Пример #1
0
        /// <summary>
        /// This is used to create a snapshot that is equivalent to the current state of a particular CmObject,
        /// but not linked to it. Currently this is just used in testing, to simulate state obtained from
        /// another client.
        /// </summary>
        internal static CmObjectSurrogate CreateSnapshot(ICmObject obj)
        {
            var result = new CmObjectSurrogate(obj);

            result.m_object = null;
            result.Xml      = ((ICmObjectInternal)obj).ToXmlString();
            return(result);
        }
Пример #2
0
 /// <summary>
 /// Create one from an existing object; set its XML to the current state of the object.
 /// </summary>
 public ICmObjectSurrogate Create(ICmObject obj)
 {
     return(CmObjectSurrogate.CreateSnapshot(obj));
 }