public void AddShaftComponent(ShaftComponent child) { if (!Shafts.Contains(child)) { child.Component.Parent = this; Shafts.Add(child); } }
public void RemoveShaftComponent(ShaftComponent child) { if (Shafts.Contains(child)) { child.Component.Parent = null; Shafts.Remove(child); } }
public void InsertShaftComponent(int index, ShaftComponent child) { if (!Shafts.Contains(child)) { child.Component.Parent = this; Shafts.Insert(index, child); } }
public DeviceDiagnoseComponent(IList <ItemInfo> items, Guid deviceguid, string devicename = "新建设备") { var shaftComponent = new ShaftComponent() { Component = new ShaftClass() }; shaftComponent.Component.AddBearingComponent(new BearingComponent()); Component.UnAllotItems = new ObservableCollection <ItemInfo>(items); Component.AddShaftComponent(shaftComponent); Guid = deviceguid; Name = devicename; }