//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 bool RemovePoint(TECPoint point) { bool removed = Points.Remove(point); raisePropertyChanged("PointNumber"); return(removed); }
public bool AddPoint(TECPoint point) { if (this.Connection == null || !(this.Connection is TECHardwiredConnection)) { this.Points.Add(point); return(true); } else { TECIO io = new TECIO(point.Type) { Quantity = point.Quantity }; if (this.Connection.ParentController.AvailableIO.Contains(io)) { this.Points.Add(point); return(true); } } raisePropertyChanged("PointNumber"); return(false); }
public TECPoint(TECPoint pointSource) : this() { _type = pointSource.Type; _label = pointSource.Label; _quantity = pointSource.Quantity; }