예제 #1
0
 public ScopeDefinition(byte id, string name, ScopeGroup group, string desc)
 {
     ID = id;
     Name = name;
     Group = group;
     Description = desc;
     Total = (((Group == ScopeGroup.Other) ? "" : VarScopeSelect.Categories[(int)Group] + " ") + Name).ToLowerInvariant();
 }
예제 #2
0
        public void NotifyStateChange(ScopeGroup group, dynamic?data = null)
        {
            if (!Groups.ContainsKey(group))
            {
                return;
            }

            foreach (var action in this.Groups[group])
            {
                try
                {
                    action.Value.Inline.Invoke();
                    action.Value.Override?.Invoke(data);
                }
                catch { }
            }
        }
예제 #3
0
        public InterlocksVM(IRelatable root, ChangeWatcher watcher,
                            TECCatalogs catalogs, Func <ITECObject, bool> filterPredicate = null)
        {
            if (filterPredicate == null)
            {
                filterPredicate = item => true;
            }
            this.filterPredicate = filterPredicate;

            this.root = root;
            new DirectRelationshipChangedFilter(watcher).DirectRelationshipChanged += parentScopeChanged;


            noneConduit                  = new TECElectricalMaterial();
            noneConduit.Name             = "None";
            this.rootInterlockablesGroup = new ScopeGroup("root");
            this.AddInterlockCommand     = new RelayCommand(addInterlockExecute, canAddInterlock);
            this.DeleteInterlockCommand  = new RelayCommand <TECInterlockConnection>(deleteInterlockExecute, canDeleteInterlock);
            this.ConduitTypes            = new List <TECElectricalMaterial>(catalogs.ConduitTypes);
            this.ConduitTypes.Add(noneConduit);
            this.ConduitType = noneConduit;

            repopulateGroups(null, root, addInterlockable);
        }
예제 #4
0
 public static string[] ToStrings(ScopeGroup scopeGroup)
 {
     return(scopesDict [scopeGroup]);
 }