當前位置: 首頁>>代碼示例>>C#>>正文


C# ObjectHolder.SetFlags方法代碼示例

本文整理匯總了C#中System.Runtime.Serialization.ObjectHolder.SetFlags方法的典型用法代碼示例。如果您正苦於以下問題:C# ObjectHolder.SetFlags方法的具體用法?C# ObjectHolder.SetFlags怎麽用?C# ObjectHolder.SetFlags使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Runtime.Serialization.ObjectHolder的用法示例。


在下文中一共展示了ObjectHolder.SetFlags方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: FixupSpecialObject

 private void FixupSpecialObject(ObjectHolder holder)
 {
     ISurrogateSelector selector = null;
     if (holder.HasSurrogate)
     {
         ISerializationSurrogate surrogate = holder.Surrogate;
         object obj2 = surrogate.SetObjectData(holder.ObjectValue, holder.SerializationInfo, this.m_context, selector);
         if (obj2 != null)
         {
             if (!holder.CanSurrogatedObjectValueChange && (obj2 != holder.ObjectValue))
             {
                 throw new SerializationException(string.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("Serialization_NotCyclicallyReferenceableSurrogate"), new object[] { surrogate.GetType().FullName }));
             }
             holder.SetObjectValue(obj2, this);
         }
         holder.m_surrogate = null;
         holder.SetFlags();
     }
     else
     {
         this.CompleteISerializableObject(holder.ObjectValue, holder.SerializationInfo, this.m_context);
     }
     holder.SerializationInfo = null;
     holder.RequiresSerInfoFixup = false;
     if (holder.RequiresValueTypeFixup && holder.ValueTypeFixupPerformed)
     {
         this.DoValueTypeFixup(null, holder, holder.ObjectValue);
     }
     this.DoNewlyRegisteredObjectFixups(holder);
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:30,代碼來源:ObjectManager.cs

示例2: FixupSpecialObject

        [System.Security.SecurityCritical]  // auto-generated 
        private void FixupSpecialObject(ObjectHolder holder) {
            ISurrogateSelector uselessSelector=null; 
 
            Contract.Assert(holder.RequiresSerInfoFixup,"[ObjectManager.FixupSpecialObject]holder.HasSurrogate||holder.HasISerializable");
            if (holder.HasSurrogate) { 
                ISerializationSurrogate surrogate = holder.Surrogate;
                Contract.Assert(surrogate!=null,"surrogate!=null");
                object returnValue = surrogate.SetObjectData(holder.ObjectValue, holder.SerializationInfo, m_context, uselessSelector);
                if (returnValue != null) 
                {
                    if (!holder.CanSurrogatedObjectValueChange && returnValue != holder.ObjectValue) 
                        throw new SerializationException(String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("Serialization_NotCyclicallyReferenceableSurrogate"), surrogate.GetType().FullName)); 
                    holder.SetObjectValue(returnValue, this);
                } 
                holder.m_surrogate = null;
                holder.SetFlags();
            } else {
                //Set the object data 
                Contract.Assert(holder.ObjectValue is ISerializable,"holder.m_object is ISerializable");
                BCLDebug.Trace("SER","[ObjectManager.FixupSpecialObject]Fixing up ISerializable object ",holder.ObjectValue," with id ",holder.m_id); 
                CompleteISerializableObject(holder.ObjectValue, holder.SerializationInfo, m_context); 
            }
            //Clear anything that we know that we're not going to need. 
            holder.SerializationInfo=null;
            holder.RequiresSerInfoFixup = false;

            // For value types, fixups would have been done. So the newly fixed object must be copied 
            // to its container.
            if (holder.RequiresValueTypeFixup && holder.ValueTypeFixupPerformed){ 
                DoValueTypeFixup(null, holder, holder.ObjectValue); 
            }
            DoNewlyRegisteredObjectFixups(holder); 
        }
開發者ID:wsky,項目名稱:System.Runtime.Remoting,代碼行數:34,代碼來源:ObjectManager.cs

示例3: FixupSpecialObject

        private void FixupSpecialObject(ObjectHolder holder) {
            ISurrogateSelector uselessSelector=null;

            BCLDebug.Assert(holder.RequiresSerInfoFixup,"[ObjectManager.FixupSpecialObject]holder.HasSurrogate||holder.HasISerializable");
            if (holder.HasSurrogate) {
                ISerializationSurrogate surrogate = holder.Surrogate;
                BCLDebug.Assert(surrogate!=null,"surrogate!=null");
                object returnValue = surrogate.SetObjectData(holder.ObjectValue, holder.SerializationInfo, m_context, uselessSelector);
                if (returnValue != null)
                    holder.SetObjectValue(returnValue, this);
                holder.m_surrogate = null;
                holder.SetFlags();
            } else {
                //Set the object data 
                BCLDebug.Assert(holder.ObjectValue is ISerializable,"holder.m_object is ISerializable");
                BCLDebug.Trace("SER","[ObjectManager.FixupSpecialObject]Fixing up ISerializable object ",holder.ObjectValue," with id ",holder.m_id);
                CompleteISerializableObject(holder.ObjectValue, holder.SerializationInfo, m_context);
            }
            //Clear anything that we know that we're not going to need.
            holder.SerializationInfo=null;
            holder.RequiresSerInfoFixup = false;

            // For value types, fixups would have been done. So the newly fixed object must be copied
            // to its container.
            if (holder.RequiresValueTypeFixup && holder.ValueTypeFixupPerformed){
                DoValueTypeFixup(null, holder, holder.ObjectValue);
            }
            DoNewlyRegisteredObjectFixups(holder);
        }
開發者ID:gbarnett,項目名稱:shared-source-cli-2.0,代碼行數:29,代碼來源:objectmanager.cs


注:本文中的System.Runtime.Serialization.ObjectHolder.SetFlags方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。