public void LoadTargetObject(IStory story, bool AutoDelete = false) { NodeList.ForEach(v => { var o = story.GetEntityByID(v.TargetObjectID); if (o == null) { v.TargetObjectID = Guid.Empty; } }); if (AutoDelete) { NodeList.RemoveAll(v => v.TargetObjectID == Guid.Empty); } ConnectionList.ForEach(v => { var o = story.RelationList.FirstOrDefault(r => r.ObjectID == v.TargetObjectID); if (o == null) { v.TargetObjectID = Guid.Empty; } }); if (AutoDelete) { ConnectionList.RemoveAll(v => v.TargetObjectID == Guid.Empty); } }
protected virtual void LoadData(IDiagramBase target) { target.Name = Name; target.Memo = Memo; //target.Width = Width; //target.Height = Height; NodeList.ForEach(v => target.NodeList.Add(v.Clone() as INode)); NoteList.ForEach(v => target.NoteList.Add(v.Clone() as INote)); ConnectionList.ForEach(v => target.ConnectionList.Add(v.Clone() as IConnection)); }
public override ICopySupportObject Clone() { var o = new StructureDiagram() { Memo = Memo, Name = Name, IsTimeSensitive = IsTimeSensitive, CurrentTime = CurrentTime }; NoteList.ForEach(v => o.NoteList.Add(v.Clone() as INote)); NodeList.ForEach(v => o.NodeList.Add(v.Clone() as INode)); ConnectionList.ForEach(v => o.ConnectionList.Add(v.Clone() as IConnection)); return(o); }
public override ICopySupportObject Clone() { var o = new FateDiagram() { BeginTime = BeginTime, EndTime = EndTime, Memo = Memo, Name = Name, }; NodeList.ForEach(v => o.NodeList.Add(v.Clone() as INode)); NoteList.ForEach(v => o.NoteList.Add(v.Clone() as INote)); ConnectionList.ForEach(v => o.ConnectionList.Add(v.Clone() as IConnection)); TimeSeparateList.ForEach(v => o.TimeSeparateList.Add(new TimeSeparate() { BeginTime = v.BeginTime, EndTime = v.EndTime })); TrackList.ForEach(v => o.TrackList.Add(v.Clone() as ITrack)); return(o); }