public virtual void DeserializeFrom(XmlSerializationContext xmlsc) { m_name = (string)xmlsc.LoadObject("Name"); ArrayList tmpPostEdges = (ArrayList)xmlsc.LoadObject("PostEdges"); foreach (Edge edge in tmpPostEdges) { if (!PostEdges.Contains(edge)) { PostEdges.Add(edge); } NumPostEdges++; } ArrayList tmpPreEdges = (ArrayList)xmlsc.LoadObject("PreEdges"); foreach (Edge edge in tmpPreEdges) { if (!PreEdges.Contains(edge)) { PreEdges.Add(edge); } NumPreEdges++; } m_principalEdge = (Edge)xmlsc.LoadObject("PrincipalEdge"); m_role = (WhichVertex)xmlsc.LoadObject("Role"); m_roleIsKnown = (bool)xmlsc.LoadObject("RoleIsKnown"); m_synchronizer = (VertexSynchronizer)xmlsc.LoadObject("Synchronizer"); m_triggerDelegate = (TriggerDelegate)xmlsc.LoadObject("TriggerDelegate"); // _Debug.WriteLine("Deserializing " + m_name + " : it has " + m_postEdges.Count + " post edges in object w/ hashcode " // + m_postEdges.GetHashCode() + ". (BTW, this has hashcode " + this.GetHashCode() + ")."); }
/// <summary> /// This is used as an internal accessor to set synchronizer to null, or other values. The /// property is public, but read-only. /// </summary> /// <param name="synch"></param> internal void SetSynchronizer(VertexSynchronizer synch) { if (synch != null && m_synchronizer != null) { throw new ApplicationException(Name + " already has a synchronizer assigned!"); } bool hasVm = (m_vm != null); if (hasVm) { m_vm.Suspend(); } m_synchronizer = synch; if (StructureChangeHandler != null) { StructureChangeHandler(this, StructureChangeType.NewSynchronizer, false); } if (hasVm) { m_vm.Resume(); } }