public void Serialization2() { IDerivedObject derivedObj = null; DerivedObjectRepoSerMgr serMgr = null; RepositorySerializationContext serCtx = null; RepositorySerializationContext serCtx2 = null; String serialization = null; IContainedObject subObj = null; TextWriter tw = null; derivedObj = DerivedObjectFactory.Singleton.GetNew(); serMgr = DerivedObjectRepoSerMgr.Singleton; serCtx = new RepositorySerializationContext(); serCtx2 = new RepositorySerializationContext(); subObj = ContainedObjectFactory.Singleton.GetNew(); tw = new StringWriter(); derivedObj.SetSubObj(subObj); derivedObj.SetQuantity(234.56); derivedObj.SetTimeStamp(DateTime.Now); subObj.SetName("Pluto"); serCtx.SerializeMetadata = true; serMgr.Serialize(tw, derivedObj, serCtx); serialization = tw.ToString(); using (StringReader sr1 = new StringReader(serialization)) { IBaseObject deserResult = serMgr.Deserialize(sr1, serCtx2); } } // End of Serialization2 ()
internal T GetAncestor <T>() where T : class { for (IContainedObject parent = base.Parent; parent != null; parent = parent.Parent) { if (parent is T) { return((T)parent); } } return(null); }
public RdlCollection(IContainedObject parent) : base(parent) { }
internal ContainedObjectException(IContainedObject containedObject) : this(containedObject.GetType().Name) { }
internal ContainedObjectDestroyedException(IContainedObject containedObject) : base(containedObject) { }
protected RdlCollectionBase(IContainedObject parent) { m_parent = parent; }
public Boolean SetSubObj ( IContainedObject newSubObj ) { SubObj = newSubObj; return true; }