Exemple #1
0
        public FilteredConnectablesGroup(string name, ConnectableFilter filter)
        {
            this.Name = name;

            this.filter = filter;
            this.filter.FilterChanged += filterChanged;
        }
        public void PassesFilterTest()
        {
            ConnectableFilter filter = new ConnectableFilter();

            filter.FilterLocation = new TECLocation();


            TECSubScope subScope = new TECSubScope();

            Assert.IsFalse(filter.PassesFilter(subScope));
        }
Exemple #3
0
 private void parentChanged(TECChangedEventArgs obj)
 {
     if (obj.Value is TECLocation location)
     {
         if (obj.Change == Change.Add)
         {
             this.Locations.Add(location);
         }
         else if (obj.Change == Change.Remove)
         {
             this.Locations.Remove(location);
         }
     }
     else if (obj.Value is IControllerConnection)
     {
         ControllerFilter.RaiseFilter();
         ConnectableFilter.RaiseFilter();
     }
 }
Exemple #4
0
        public FilteredConnectablesGroup(ITECScope scope, ConnectableFilter filter) : this(scope.Name, filter)
        {
            this.Scope = scope;
            scopeDictionary.Add(scope, this);
            this.Scope.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName == "Name")
                {
                    Name = scope.Name;
                }
            };

            if (scope is IConnectable connectable)
            {
                this.PassesFilter = filter.PassesFilter(connectable);
            }
            else
            {
                this.PassesFilter = false;
            }
        }