//Copy Constructor
 public TECSubScope(TECSubScope sourceSubScope, Dictionary <Guid, Guid> guidDictionary = null,
                    ObservableListDictionary <ITECObject> characteristicReference      = null) : this()
 {
     if (guidDictionary != null)
     {
         guidDictionary[_guid] = sourceSubScope.Guid;
     }
     foreach (IEndDevice device in sourceSubScope.Devices)
     {
         Devices.Add(device);
     }
     foreach (TECPoint point in sourceSubScope.Points)
     {
         var toAdd = new TECPoint(point);
         characteristicReference?.AddItem(point, toAdd);
         Points.Add(toAdd);
     }
     foreach (TECInterlockConnection interlock in sourceSubScope.Interlocks)
     {
         var toAdd = new TECInterlockConnection(interlock);
         characteristicReference?.AddItem(interlock, toAdd);
         Interlocks.Add(toAdd);
     }
     foreach (TECScopeBranch branch in sourceSubScope.ScopeBranches)
     {
         var toAdd = new TECScopeBranch(branch);
         characteristicReference?.AddItem(branch, toAdd);
         ScopeBranches.Add(toAdd);
     }
     this.copyPropertiesFromScope(sourceSubScope);
 }
 public void ReleaseParashot()
 {
     if (Parashot is null)
     {
         return;
     }
     Interlocks.Release(ParashotTableName);
     if (ClearListsOnCloseOrRelease)
     {
         Parashot.Clear();
     }
     Parashot = null;
 }
 public List <Parashah> TakeParashot(bool reload = false)
 {
     CheckConnected();
     if (!reload && Parashot is not null)
     {
         return(Parashot);
     }
     Interlocks.Take(ParashotTableName);
     if (ParashotFirstTake)
     {
         ParashotFactory.Instance.Reset();
         ParashotFirstTake = false;
     }
     return(CreateParashotDataIfNotExistAndLoad());
 }
 bool ITypicalable.ContainsChildForProperty(string property, ITECObject item)
 {
     if (property == "Points" && item is TECPoint point)
     {
         return(Points.Contains(point));
     }
     else if (property == "Devices" && item is IEndDevice device)
     {
         return(Devices.Contains(device));
     }
     else if (property == "Interlocks" && item is TECInterlockConnection interlock)
     {
         return(Interlocks.Contains(interlock));
     }
     else if (property == "ScopeBranches" && item is TECScopeBranch branch)
     {
         return(ScopeBranches.Contains(branch));
     }
     else
     {
         return(this.ContainsChildForScopeProperty(property, item));
     }
 }
 void ITypicalable.AddChildForProperty(string property, ITECObject item)
 {
     if (property == "Points" && item is TECPoint point)
     {
         AddPoint(point);
     }
     else if (property == "Devices" && item is IEndDevice device)
     {
         Devices.Add(device);
     }
     else if (property == "Interlocks" && item is TECInterlockConnection interlock)
     {
         Interlocks.Add(interlock);
     }
     else if (property == "ScopeBranches" && item is TECScopeBranch branch)
     {
         ScopeBranches.Add(branch);
     }
     else
     {
         this.AddChildForScopeProperty(property, item);
     }
 }
 public bool IsParashotReadOnly()
 {
     CheckConnected();
     return(Interlocks.GetCount(ParashotTableName) > 1);
 }