System.Runtime.Serialization.ObjectHolder.SetFlags C# (CSharp) Method

SetFlags() private method

An internal-only routine to set the flags based upon the data contained in the ObjectHolder
private SetFlags ( ) : void
return void
        internal void SetFlags()
        {
            if (_object is IObjectReference)
            {
                _flags |= IncompleteObjectReference;
            }

            _flags &= ~(HAS_ISERIALIZABLE | HAS_SURROGATE);
            if (_surrogate != null)
            {
                _flags |= HAS_SURROGATE;
            }
            else if (_object is ISerializable)
            {
                _flags |= HAS_ISERIALIZABLE;
            }

            if (_valueFixup != null)
            {
                _flags |= REQUIRES_VALUETYPE_FIXUP;
            }
        }

Usage Example

コード例 #1
0
        private void FixupSpecialObject(ObjectHolder holder)
        {
            ISurrogateSelector selector = null;

            if (holder.HasSurrogate)
            {
                ISerializationSurrogate surrogate = holder.Surrogate;
                object obj = surrogate.SetObjectData(holder.ObjectValue, holder.SerializationInfo, this.m_context, selector);
                if (obj != null)
                {
                    if (!holder.CanSurrogatedObjectValueChange && obj != holder.ObjectValue)
                    {
                        throw new SerializationException(string.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("Serialization_NotCyclicallyReferenceableSurrogate"), surrogate.GetType().FullName));
                    }
                    holder.SetObjectValue(obj, 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);
        }
All Usage Examples Of System.Runtime.Serialization.ObjectHolder::SetFlags