From e1e0510cebd177085c25bc52850497858468f602 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Thu, 27 Sep 2007 00:07:14 +0200 Subject: [PATCH] - implement static part of new i/o matching system --- Schematic.cs | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/Schematic.cs b/Schematic.cs index 936c632..09e4758 100644 --- a/Schematic.cs +++ b/Schematic.cs @@ -137,21 +137,29 @@ namespace Eithne IPlugin fp = from.Parent.Plugin; IPlugin tp = to.Parent.Plugin; - // ograniczenia co do typu przesyƂanych danych - if(fp is IOtherPlugin || tp is IOtherPlugin) - return true; - if(fp is IInPlugin && !(tp is IImgProcPlugin || tp is IComparatorPlugin || tp is IOutPlugin)) - return false; - if(fp is IImgProcPlugin && !(tp is IImgProcPlugin || tp is IComparatorPlugin || tp is IOutPlugin)) - return false; - if(fp is IComparatorPlugin && !(tp is IResProcPlugin || tp is IOutPlugin)) - return false; - if(fp is IResProcPlugin && !(tp is IResProcPlugin || tp is IOutPlugin)) - return false; - if(fp is IOutPlugin) - return false; - return true; + foreach(string mOut in fp.MatchOut) + { + string tmp = mOut; + ArrayList matches = new ArrayList(); + matches.Add(tmp); + + while(tmp.LastIndexOf('/') != -1) + { + int lastIndex = tmp.LastIndexOf('/'); + tmp = tmp.Substring(0, lastIndex); + matches.Add(tmp); + } + matches.Add(""); + + foreach(string mIn in tp.MatchIn) + { + if(matches.Contains(mIn)) + return true; + } + } + + return false; } protected override bool OnMotionNotifyEvent(Gdk.EventMotion args) -- 2.11.4.GIT