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