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(); }
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 { } } }
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); }
public static string[] ToStrings(ScopeGroup scopeGroup) { return(scopesDict [scopeGroup]); }