Esempio n. 1
0
        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 ()
Esempio n. 2
0
 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);
 }
Esempio n. 3
0
 public RdlCollection(IContainedObject parent)
     : base(parent)
 {
 }
 internal ContainedObjectException(IContainedObject containedObject)
     : this(containedObject.GetType().Name)
 {
 }
Esempio n. 5
0
 internal ContainedObjectDestroyedException(IContainedObject containedObject)
     : base(containedObject)
 {
 }
Esempio n. 6
0
 protected RdlCollectionBase(IContainedObject parent)
 {
     m_parent = parent;
 }
Esempio n. 7
0
 public Boolean SetSubObj ( IContainedObject newSubObj )
 { SubObj = newSubObj; return true; }