当前位置: 首页>>代码示例>>C#>>正文


C# SerializationReader.ReadBoolean方法代码示例

本文整理汇总了C#中SerializationReader.ReadBoolean方法的典型用法代码示例。如果您正苦于以下问题:C# SerializationReader.ReadBoolean方法的具体用法?C# SerializationReader.ReadBoolean怎么用?C# SerializationReader.ReadBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SerializationReader的用法示例。


在下文中一共展示了SerializationReader.ReadBoolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Index

        /// <exclude/>
        public Index(SerializationInfo serializationInfo, StreamingContext streamingContext)
        {
            if (SerializerHelper.UseFastSerialization)
            {
                _columns = null;

                using (SerializationReader reader = new SerializationReader((byte[])serializationInfo.GetValue("d", typeof(byte[]))))
                {
                    UniqueId = reader.ReadString();
                    Lookups.Add(UniqueId, this);
                    _alias = reader.ReadString();
                    _columnIds = reader.ReadStringArray();
                    _enabled = reader.ReadBoolean();
                    _isUserDefined = reader.ReadBoolean();
                    _name = reader.ReadString();
                    // TODO: Parent
                    _type = reader.ReadString();
                    _userOptions = (List<IUserOption>)reader.ReadObject();
                }
            }
            else
            {
                int version = 0;

                if (SerializationVersionExists)
                {
                    try
                    {
                        version = serializationInfo.GetInt32("SerializationVersion");
                    }
                    catch (SerializationException)
                    {
                        // ignore
                        SerializationVersionExists = false;
                    }
                }
                _alias = serializationInfo.GetString("Alias");
                _columns = (List<Column>)serializationInfo.GetValue("Columns", ModelTypes.ColumnList);
                _enabled = serializationInfo.GetBoolean("Enabled");
                //this._exposedUserOptions = serializationInfo.GetValue("ExposedUserOptions", ModelTypes.Object);
                _isUserDefined = serializationInfo.GetBoolean("IsUserDefined");
                _name = serializationInfo.GetString("Name");
                _parent = (ScriptObject)serializationInfo.GetValue("Parent", ModelTypes.ScriptObject);
                _type = serializationInfo.GetString("Type");
                _userOptions = (List<IUserOption>)serializationInfo.GetValue("UserOptions", ModelTypes.UserOptionList);

                for (int i = 0; i < _userOptions.Count; i++)
                {
                    _userOptions[i].Owner = this;
                }
                if (version >= 8)
                {
                    _description = serializationInfo.GetString("Description");
                }
            }
        }
开发者ID:uQr,项目名称:Visual-NHibernate,代码行数:57,代码来源:Index.cs

示例2: Association

 public Association(SerializationInfo serializationInfo, StreamingContext streamingContext)
 {
     if (SerializerHelper.UseFastSerialization)
     {
         using (SerializationReader reader = new SerializationReader((byte[])serializationInfo.GetValue("d", typeof(byte[]))))
         {
             _UniqueId = reader.ReadString();
             _AssociatedObjectId = reader.ReadString();
             _AssociationKind = reader.ReadString();
             _Mappings = (List<Mapping>)reader.ReadObject();
             _Name = reader.ReadString();
             _Enabled = reader.ReadBoolean();
         }
     }
     else
     {
         if (SerializationVersionExists)
         {
             try
             {
             }
             catch (SerializationException)
             {
                 // ignore
                 SerializationVersionExists = false;
             }
         }
         _AssociatedObject = (ScriptObject)serializationInfo.GetValue("AssociatedObject", ModelTypes.ScriptObject);
         _PrimaryObject = (ScriptObject)serializationInfo.GetValue("PrimaryObject", ModelTypes.ScriptObject);
         _AssociationKind = serializationInfo.GetString("AssociationKind");
         _Mappings = (List<Mapping>)serializationInfo.GetValue("Mappings", typeof(List<Mapping>));
         _Name = serializationInfo.GetString("Name");
         _Enabled = serializationInfo.GetBoolean("Enabled");
     }
 }
开发者ID:uQr,项目名称:Visual-NHibernate,代码行数:35,代码来源:Association.cs

示例3: SuperPoolCall

        /// <summary>
        /// Implementing the ISerializable to provide a faster, more optimized
        /// serialization for the class.
        /// </summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        public SuperPoolCall(SerializationInfo info, StreamingContext context)
        {
            // Get from the info.
            SerializationReader reader = new SerializationReader((byte[])info.GetValue("data", typeof(byte[])));

            Id = reader.ReadInt64();
            State = (StateEnum)reader.ReadInt32();
            RequestResponse = reader.ReadBoolean();
            Parameters = reader.ReadObjectArray();
            string methodInfoName = reader.ReadString();

            _methodInfoName = methodInfoName;
            MethodInfoLocal = SerializationHelper.DeserializeMethodBaseFromString(_methodInfoName, true);
        }
开发者ID:paralin,项目名称:SuperPool,代码行数:20,代码来源:SuperPoolCall.cs

示例4: StoredProcedure

        /// <exclude/>
        public StoredProcedure(SerializationInfo serializationInfo, StreamingContext streamingContext)
        {
            if (SerializerHelper.UseFastSerialization)
            {
                using (SerializationReader reader = new SerializationReader((byte[])serializationInfo.GetValue("d", typeof(byte[]))))
                {
                    UniqueId = reader.ReadString();
                    Lookups.Add(UniqueId, this);
                    _alias = reader.ReadString();
                    _aliasPlural = reader.ReadString();
                    _columns = (List<Column>)reader.ReadObject();
                    // TODO: Database
                    _enabled = reader.ReadBoolean();
                    _filters = (List<Filter>)reader.ReadObject();
                    _isUserDefined = reader.ReadBoolean();
                    _manyToManyRelationships = (List<ManyToManyRelationship>)reader.ReadObject();
                    _manyToOneRelationships = (List<ManyToOneRelationship>)reader.ReadObject();
                    _name = reader.ReadString();
                    _oneToManyRelationships = (List<OneToManyRelationship>)reader.ReadObject();
                    _oneToOneRelationships = (List<OneToOneRelationship>)reader.ReadObject();
                    _parameters = (List<Parameter>)reader.ReadObject();
                    _userOptions = (List<IUserOption>)reader.ReadObject();
                    _Schema = reader.ReadString();
                    _Associations = (List<Association>)reader.ReadObject();

                    foreach (Column column in _columns)
                    {
                        column.Parent = this;
                    }
                    foreach (Filter filter in _filters)
                    {
                        filter.Parent = this;
                    }
                    foreach (Association association in _Associations)
                    {
                        association.PrimaryObject = this;
                    }
                    foreach (ManyToManyRelationship relationship in _manyToManyRelationships)
                    {
                        relationship.Parent = this;
                    }
                    foreach (ManyToOneRelationship relationship in _manyToOneRelationships)
                    {
                        relationship.Parent = this;
                    }
                    foreach (OneToManyRelationship relationship in _oneToManyRelationships)
                    {
                        relationship.Parent = this;
                    }
                    foreach (OneToOneRelationship relationship in _oneToOneRelationships)
                    {
                        relationship.Parent = this;
                    }
                    for (int i = 0; i < _userOptions.Count; i++)
                    {
                        _userOptions[i].Owner = this;
                    }
                }
            }
            else
            {
                _IsStoredProcedure = true;
                int version = 0;

                if (SerializationVersionExists)
                {
                    try
                    {
                        version = serializationInfo.GetInt32("SerializationVersion");
                    }
                    catch (SerializationException)
                    {
                        // ignore
                        SerializationVersionExists = false;
                    }
                }
                _alias = serializationInfo.GetString("Alias");
                _aliasPlural = serializationInfo.GetString("AliasPlural");
                _columns = (List<Column>)serializationInfo.GetValue("Columns", ModelTypes.ColumnList);
                _database = (Database)serializationInfo.GetValue("Database", ModelTypes.Database);
                _enabled = serializationInfo.GetBoolean("Enabled");
                //_exposedUserOptions = serializationInfo.GetValue("ExposedUserOptions", ModelTypes.Object);
                _filters = (List<Filter>)serializationInfo.GetValue("Filters", ModelTypes.FilterList);
                _isUserDefined = serializationInfo.GetBoolean("IsUserDefined");
                _manyToManyRelationships = (List<ManyToManyRelationship>)serializationInfo.GetValue("ManyToManyRelationships", ModelTypes.ManyToManyRelationshipList);
                _manyToOneRelationships = (List<ManyToOneRelationship>)serializationInfo.GetValue("ManyToOneRelationships", ModelTypes.ManyToOneRelationshipList);
                _name = serializationInfo.GetString("Name");
                _oneToManyRelationships = (List<OneToManyRelationship>)serializationInfo.GetValue("OneToManyRelationships", ModelTypes.OneToManyRelationshipList);
                _oneToOneRelationships = (List<OneToOneRelationship>)serializationInfo.GetValue("OneToOneRelationships", ModelTypes.OneToOneRelationshipList);
                _parameters = (List<Parameter>)serializationInfo.GetValue("Parameters", ModelTypes.ParameterList);
                _userOptions = (List<IUserOption>)serializationInfo.GetValue("UserOptions", ModelTypes.UserOptionList);

                if (version > 0)
                {
                    _Schema = serializationInfo.GetString("Schema");

                    if (version > 4)
                    {
                        _Errors = (List<string>)serializationInfo.GetValue("Errors", typeof(List<string>));
//.........这里部分代码省略.........
开发者ID:uQr,项目名称:Visual-NHibernate,代码行数:101,代码来源:StoredProcedure.cs

示例5: SetObjectData

 protected virtual void SetObjectData(SerializationReader sr)
 {
     f_IsHighlight = sr.ReadBoolean();
 }
开发者ID:grendello,项目名称:smuxi,代码行数:4,代码来源:MessagePartModel.cs

示例6: OneToManyRelationship

        /// <exclude/>
        public OneToManyRelationship(SerializationInfo serializationInfo, StreamingContext streamingContext)
        {
            if (SerializerHelper.UseFastSerialization)
            {
                _foreignColumns = null;

                using (SerializationReader reader = new SerializationReader((byte[])serializationInfo.GetValue("d", typeof(byte[]))))
                {
                    UniqueId = reader.ReadString();
                    Lookups.Add(UniqueId, this);
                    _alias = reader.ReadString();
                    _enabled = reader.ReadBoolean();
                    _filterId = reader.ReadString();
                    _ForeignColumnIds = reader.ReadStringArray();
                    _ForeignRelationshipId = reader.ReadString();
                    _ForeignScriptObjectId = reader.ReadString();
                    _isUserDefined = reader.ReadBoolean();
                    _name = reader.ReadString();
                    // TODO: Parent
                    string[] primaryColumnIds = reader.ReadStringArray();

                    foreach (string primaryColumnId in primaryColumnIds)
                    {
                        _primaryColumns.Add((Column)Lookups[primaryColumnId]);
                    }
                    // TODO: PrimaryScriptObject
                    _userOptions = (List<IUserOption>)reader.ReadObject();

                    for (int i = 0; i < _userOptions.Count; i++)
                    {
                        _userOptions[i].Owner = this;
                    }
                }
            }
            else
            {
                int version = 0;

                if (SerializationVersionExists)
                {
                    try
                    {
                        version = serializationInfo.GetInt32("SerializationVersion");
                    }
                    catch (SerializationException)
                    {
                        // ignore
                        SerializationVersionExists = false;
                    }
                }
                _alias = serializationInfo.GetString("Alias");
                _enabled = serializationInfo.GetBoolean("Enabled");
                //_exposedUserOptions = serializationInfo.GetValue("ExposedUserOptions", ModelTypes.Object);
                _filter = (Filter)serializationInfo.GetValue("Filter", ModelTypes.Filter);
                _foreignColumns = (List<Column>)serializationInfo.GetValue("ForeignColumns", ModelTypes.ColumnList);
                _foreignRelationship = (Relationship)serializationInfo.GetValue("ForeignRelationship", ModelTypes.Relationship);
                _foreignScriptObject = (ScriptObject)serializationInfo.GetValue("ForeignScriptObject", ModelTypes.ScriptObject);
                _isUserDefined = serializationInfo.GetBoolean("IsUserDefined");
                _name = serializationInfo.GetString("Name");
                _parent = (ScriptObject)serializationInfo.GetValue("Parent", ModelTypes.ScriptObject);
                _primaryColumns = (List<Column>)serializationInfo.GetValue("PrimaryColumns", ModelTypes.ColumnList);
                _primaryScriptObject = (ScriptObject)serializationInfo.GetValue("PrimaryScriptObject", ModelTypes.ScriptObject);
                _userOptions = (List<IUserOption>)serializationInfo.GetValue("UserOptions", ModelTypes.UserOptionList);

                if (version >= 8)
                {
                    _description = serializationInfo.GetString("Description");
                }
            }
        }
开发者ID:uQr,项目名称:Visual-NHibernate,代码行数:71,代码来源:OneToManyRelationship.cs

示例7: SetObjectData

        protected override void SetObjectData(SerializationReader sr)
        {
            base.SetObjectData(sr);

            f_ForegroundColor = new TextColor(sr.ReadInt32());
            f_BackgroundColor = new TextColor(sr.ReadInt32());
            f_Underline       = sr.ReadBoolean();
            f_Bold            = sr.ReadBoolean();
            f_Italic          = sr.ReadBoolean();
            f_Text            = sr.ReadString();
        }
开发者ID:tuukka,项目名称:smuxi,代码行数:11,代码来源:TextMessagePartModel.cs

示例8: Deserialize

 private object Deserialize(ref SerializationReader mySerializationReader, DBBoolean myValue)
 {
     myValue._Value = mySerializationReader.ReadBoolean();
     return myValue;
 }
开发者ID:ipbi,项目名称:sones,代码行数:5,代码来源:DBBoolean.cs

示例9: Deserialize

        public override void Deserialize(ref SerializationReader mySerializationReader)
        {
            UInt32 _Capacity;

            if (mySerializationReader != null)
            {
                try
                {
                    _UUID = new TypeUUID(this.ObjectUUID.GetByteArray());
                    ParentTypeUUID = new TypeUUID();
                    ParentTypeUUID.Deserialize(ref mySerializationReader);
                    _IsUserDefined = mySerializationReader.ReadBoolean();
                    _IsAbstract = mySerializationReader.ReadBoolean();
                    _Comment = mySerializationReader.ReadString();

                    _Capacity = mySerializationReader.ReadUInt32();

                    _Attributes = new Dictionary<AttributeUUID, TypeAttribute>();

                    _TypeAttributeLookupTable = new Dictionary<AttributeUUID, TypeAttribute>();

                    for (UInt32 i = 0; i < _Capacity; i++)
                    {
                        var _AttrAtrib = new AttributeUUID();
                        _AttrAtrib.Deserialize(ref mySerializationReader);
                        var _TypeObj = new TypeAttribute();
                        _TypeObj.Deserialize(ref mySerializationReader);
                        _Attributes.Add(_AttrAtrib, _TypeObj);
                        _TypeAttributeLookupTable.Add(_AttrAtrib, _TypeObj);
                    }

                    _Capacity = mySerializationReader.ReadUInt32();
                    _TypeSettings = new Dictionary<String, ADBSettingsBase>();

                    for (var i = 0; i < _Capacity; i++)
                    {
                        ADBSettingsBase _ADBSettingsBase = (ADBSettingsBase) mySerializationReader.ReadObject();
                        if(_ADBSettingsBase != null)
                            _TypeSettings.Add(_ADBSettingsBase.Name, _ADBSettingsBase);
                    }

                    _Capacity = mySerializationReader.ReadUInt32();
                    _UniqueAttributes = new List<AttributeUUID>();
                    AttributeUUID AttribID = null;

                    for (UInt32 i = 0; i < _Capacity; i++)
                    {
                        AttribID = new AttributeUUID(ref mySerializationReader);
                        _UniqueAttributes.Add(AttribID);
                    }

                    _Capacity = mySerializationReader.ReadUInt32();
                    _MandatoryAttributes = new HashSet<AttributeUUID>();

                    for (UInt32 i = 0; i < _Capacity; i++)
                    {
                        AttribID = new AttributeUUID(ref mySerializationReader);
                        _MandatoryAttributes.Add(AttribID);
                    }

                    ObjectDirectoryShards = mySerializationReader.ReadUInt16();

                    #region Indices

                    _AttributeIndices = new Dictionary<IndexKeyDefinition, Dictionary<String, AAttributeIndex>>();
                    _AttributeIndicesNameLookup = new Dictionary<String, IndexKeyDefinition>();

                    var idxCount = mySerializationReader.ReadUInt32();
                    for (var i = 0; i < idxCount; i++)
                    {

                        var idxKey = new IndexKeyDefinition();
                        idxKey.Deserialize(ref mySerializationReader);

                        //_AttributeIndices.Add(idxKey, new Dictionary<String, AttributeIndex>());

                        var idxVersionCount = mySerializationReader.ReadUInt32();

                        for (var j = 0; j < idxVersionCount; j++)
                        {

                            var key                 = mySerializationReader.ReadString();
                            var fileSystemLocation  = new ObjectLocation(mySerializationReader.ReadString());
                            var indexEdition        = mySerializationReader.ReadString();
                            var indexName           = mySerializationReader.ReadString();
                            var indexType           = mySerializationReader.ReadString();
                            var isUUIDIdx           = mySerializationReader.ReadBoolean();
                            var keyCount            = mySerializationReader.ReadUInt64();
                            var valueCount          = mySerializationReader.ReadUInt64();
                            var attributeIdxShards = mySerializationReader.ReadUInt16();

                            //var CreateIdxExcept = CreateAttributeIndex(indexName, idxKey.IndexKeyAttributeUUIDs, indexEdition, indexObjectType, fileSystemLocation);

                            if (isUUIDIdx)
                            {
                                AddAttributeIndex(new UUIDIndex(indexName, idxKey, this, attributeIdxShards, indexType, indexEdition, keyCount));
                            }
                            else
                            {
                                AddAttributeIndex(new AttributeIndex(indexName, idxKey, this, attributeIdxShards, indexType, indexEdition, keyCount, valueCount));
//.........这里部分代码省略.........
开发者ID:TheByte,项目名称:sones,代码行数:101,代码来源:GraphDBType.cs

示例10: SetObjectData

 protected virtual void SetObjectData(SerializationReader sr)
 {
     // FIXME: optimize this by re-parsing instead of deserializing
     _Data             = sr.ReadString();
     _DataArray        = _Data.Split(new char[] {' '});
     _Parameter        = sr.ReadString();
     _IsCommand        = sr.ReadBoolean();
     _CommandCharacter = sr.ReadString();
     _Command          = sr.ReadString();
     //_FrontendManager  = (FrontendManager) sr.ReadObject();
     //_Chat             = (ChatModel) sr.ReadObject();
 }
开发者ID:grendello,项目名称:smuxi,代码行数:12,代码来源:CommandModel.cs

示例11: Deserialize

        public override void Deserialize(ref SerializationReader mySerializationReader)
        {
            UInt32 _Capacity;

            if (mySerializationReader != null)
            {
                try
                {
                    _UUID = new TypeUUID(this.ObjectUUID.GetByteArray());
                    ParentTypeUUID = new TypeUUID();
                    ParentTypeUUID.Deserialize(ref mySerializationReader);
                    _IsUserDefined = mySerializationReader.ReadBoolean();
                    _IsAbstract = mySerializationReader.ReadBoolean();
                    _Comment = mySerializationReader.ReadString();

                    _Capacity = mySerializationReader.ReadUInt32();

                    _Attributes = new Dictionary<AttributeUUID, TypeAttribute>();

                    _TypeAttributeLookupTable = new Dictionary<AttributeUUID, TypeAttribute>();

                    for (UInt32 i = 0; i < _Capacity; i++)
                    {
                        var _AttrAtrib = new AttributeUUID();
                        _AttrAtrib.Deserialize(ref mySerializationReader);
                        var _TypeObj = new TypeAttribute();
                        _TypeObj.Deserialize(ref mySerializationReader);
                        _Attributes.Add(_AttrAtrib, _TypeObj);
                        _TypeAttributeLookupTable.Add(_AttrAtrib, _TypeObj);
                    }

                    _Capacity = mySerializationReader.ReadUInt32();
                    _TypeSettings = new Dictionary<String, ADBSettingsBase>();

                    for (var i = 0; i < _Capacity; i++)
                    {
                        ADBSettingsBase _ADBSettingsBase = (ADBSettingsBase) mySerializationReader.ReadObject();
                        if(_ADBSettingsBase != null)
                            _TypeSettings.Add(_ADBSettingsBase.Name, _ADBSettingsBase);
                    }

                    _Capacity = mySerializationReader.ReadUInt32();
                    _UniqueAttributes = new List<AttributeUUID>();
                    AttributeUUID AttribID = null;

                    for (UInt32 i = 0; i < _Capacity; i++)
                    {
                        AttribID = new AttributeUUID(ref mySerializationReader);
                        _UniqueAttributes.Add(AttribID);
                    }

                    _Capacity = mySerializationReader.ReadUInt32();
                    _MandatoryAttributes = new HashSet<AttributeUUID>();

                    for (UInt32 i = 0; i < _Capacity; i++)
                    {
                        AttribID = new AttributeUUID(ref mySerializationReader);
                        _MandatoryAttributes.Add(AttribID);
                    }

                    #region Indices

                    _AttributeIndices = new Dictionary<IndexKeyDefinition, Dictionary<String, AAttributeIndex>>();
                    _AttributeIndicesNameLookup = new Dictionary<String, IndexKeyDefinition>();
                    _AttributeIndexLocations = new Dictionary<IndexKeyDefinition, Dictionary<string, Tuple<string, ObjectLocation>>>();

                    var idxCount = mySerializationReader.ReadUInt32();
                    for (var i = 0; i < idxCount; i++)
                    {

                        var idxKey = new IndexKeyDefinition();
                        idxKey.Deserialize(ref mySerializationReader);

                        //_AttributeIndices.Add(idxKey, new Dictionary<String, AttributeIndex>());

                        var idxVersionCount = mySerializationReader.ReadUInt32();

                        _AttributeIndexLocations.Add(idxKey, new Dictionary<string, Tuple<string, ObjectLocation>>());
                        for (var j = 0; j < idxVersionCount; j++)
                        {

                            var key                 = mySerializationReader.ReadString();
                            var idxLocation         = mySerializationReader.ReadString();
                            var indexType           = mySerializationReader.ReadString();

                            _AttributeIndexLocations[idxKey][key] = new Tuple<string,ObjectLocation>(indexType, new ObjectLocation(idxLocation));

                            //idx.IndexKeyDefinition  = idxKey;
                            //AddAttributeIndex(idx as AAttributeIndex);

                        }

                    }

                    #endregion

                }

                catch (Exception e)
                {
//.........这里部分代码省略.........
开发者ID:Vadi,项目名称:sones,代码行数:101,代码来源:GraphDBType.cs

示例12: Column

        /// <summary>
        /// TODO: I don't think this should be exposed to the user???
        /// </summary>
        /// <param name="serializationInfo"></param>
        /// <param name="streamingContext"></param>
        public Column(SerializationInfo serializationInfo, StreamingContext streamingContext)
        {
            if (SerializerHelper.UseFastSerialization)
            {
                using (SerializationReader reader = new SerializationReader((byte[])serializationInfo.GetValue("d", typeof(byte[]))))
                {
                    UniqueId = reader.ReadString();
                    Lookups.Add(UniqueId, this);
                    _alias = reader.ReadString();
                    _aliasDisplay = reader.ReadString();
                    _characterMaximumLength = reader.ReadInt32();
                    _dataType = reader.ReadString();
                    _default = reader.ReadString();
                    _enabled = reader.ReadBoolean();
                    _inPrimaryKey = reader.ReadBoolean();
                    _isIdentity = reader.ReadBoolean();
                    _isNullable = reader.ReadBoolean();
                    _isUserDefined = reader.ReadBoolean();
                    _name = reader.ReadString();
                    _ordinalPosition = reader.ReadInt32();
                    // Parent
                    _readOnly = reader.ReadBoolean();
                    _userOptions = (List<IUserOption>)reader.ReadObject();
                    _IsCalculated = reader.ReadBoolean();
                    _precision = reader.ReadInt32();
                    _scale = reader.ReadInt32();

                    for (int i = 0; i < _userOptions.Count; i++)
                    {
                        _userOptions[i].Owner = this;
                    }
                }
            }
            else
            {
                int version = 0;

                if (SerializationVersionExists)
                {
                    try
                    {
                        version = serializationInfo.GetInt32("SerializationVersion");
                    }
                    catch (SerializationException)
                    {
                        // ignore
                        SerializationVersionExists = false;
                    }
                }
                _alias = serializationInfo.GetString("Alias");
                _aliasDisplay = serializationInfo.GetString("AliasDisplay");
                _characterMaximumLength = serializationInfo.GetInt32("CharacterMaximumLength");
                _dataType = serializationInfo.GetString("DataType");
                _default = serializationInfo.GetString("Default");
                _enabled = serializationInfo.GetBoolean("Enabled");
                //this._exposedUserOptions = serializationInfo.GetValue("ExposedUserOptions", ObjectType);
                _inPrimaryKey = serializationInfo.GetBoolean("InPrimaryKey");
                _isIdentity = serializationInfo.GetBoolean("IsIdentity");
                _isNullable = serializationInfo.GetBoolean("IsNullable");
                _isUserDefined = serializationInfo.GetBoolean("IsUserDefined");
                _name = serializationInfo.GetString("Name");
                _ordinalPosition = serializationInfo.GetInt32("OrdinalPosition");
                _parent = (ScriptObject)serializationInfo.GetValue("Parent", ModelTypes.ScriptObject);
                _readOnly = serializationInfo.GetBoolean("ReadOnly");
                _userOptions = (List<IUserOption>)serializationInfo.GetValue("UserOptions", ModelTypes.UserOptionList);

                if (version >= 2)
                {
                    _IsCalculated = serializationInfo.GetBoolean("IsCalculated");

                    if (version >= 3)
                    {
                        _precision = serializationInfo.GetInt32("Precision");
                        _scale = serializationInfo.GetInt32("Scale");

                        if (version >= 8)
                        {
                            _description = serializationInfo.GetString("Description");

                            if (version >= 9)
                            {
                                _Lookup = (Lookup)serializationInfo.GetValue("Lookup", ModelTypes.Lookup);
                                //_Lookup.SubscribingObjects.Add(this);
                            }
                        }
                    }
                }
            }
        }
开发者ID:uQr,项目名称:Visual-NHibernate,代码行数:94,代码来源:Column.cs

示例13: MapColumn

        /// <exclude/>
        public MapColumn(SerializationInfo serializationInfo, StreamingContext streamingContext)
        {
            if (SerializerHelper.UseFastSerialization)
            {
                _relationshipPath = null;

                using (SerializationReader reader = new SerializationReader((byte[])serializationInfo.GetValue("d", typeof(byte[]))))
                {
                    UniqueId = reader.ReadString();
                    Lookups.Add(UniqueId, this);
                    _alias = reader.ReadString();
                    _aliasDisplay = reader.ReadString();
                    _characterMaximumLength = reader.ReadInt32();
                    // TODO: CurrentParent
                    _dataType = reader.ReadString();
                    _default = reader.ReadString();
                    _enabled = reader.ReadBoolean();
                    _foreignColumnId = reader.ReadString();
                    _inPrimaryKey = reader.ReadBoolean();
                    _isIdentity = reader.ReadBoolean();
                    _isNullable = reader.ReadBoolean();
                    _isUserDefined = reader.ReadBoolean();
                    _name = reader.ReadString();
                    _ordinalPosition = reader.ReadInt32();
                    // TODO: Parent
                    _readOnly = reader.ReadBoolean();
                    _RelationshipPathIds = reader.ReadStringArray();
                    _userOptions = (List<IUserOption>)reader.ReadObject();

                    for (int i = 0; i < _userOptions.Count; i++)
                    {
                        _userOptions[i].Owner = this;
                    }
                }
            }
            else
            {
                _IsMapColumn = true;
                int version = 0;

                if (SerializationVersionExists)
                {
                    try
                    {
                        version = serializationInfo.GetInt32("SerializationVersion");
                    }
                    catch (SerializationException)
                    {
                        // ignore
                        SerializationVersionExists = false;
                    }
                }
                _alias = serializationInfo.GetString("Alias");
                _aliasDisplay = serializationInfo.GetString("AliasDisplay");
                _characterMaximumLength = serializationInfo.GetInt32("CharacterMaximumLength");
                _currentParent = (ScriptObject)serializationInfo.GetValue("CurrentParent", ModelTypes.ScriptObject);
                _dataType = serializationInfo.GetString("DataType");
                _default = serializationInfo.GetString("Default");
                _enabled = serializationInfo.GetBoolean("Enabled");
                //_exposedUserOptions = serializationInfo.GetValue("ExposedUserOptions", ModelTypes.Object);
                _foreignColumn = (Column)serializationInfo.GetValue("ForeignColumn", ModelTypes.Column);
                _inPrimaryKey = serializationInfo.GetBoolean("InPrimaryKey");
                _isIdentity = serializationInfo.GetBoolean("IsIdentity");
                _isNullable = serializationInfo.GetBoolean("IsNullable");
                _isUserDefined = serializationInfo.GetBoolean("IsUserDefined");
                _name = serializationInfo.GetString("Name");
                _ordinalPosition = serializationInfo.GetInt32("OrdinalPosition");
                _parent = (ScriptObject)serializationInfo.GetValue("Parent", ModelTypes.ScriptObject);
                _readOnly = serializationInfo.GetBoolean("ReadOnly");
                _relationshipPath = (Relationship[])serializationInfo.GetValue("RelationshipPath", ModelTypes.RelationshipArray);
                _userOptions = (List<IUserOption>)serializationInfo.GetValue("UserOptions", ModelTypes.UserOptionList);

                if (version >= 8)
                {
                    _description = serializationInfo.GetString("Description");
                }
            }
        }
开发者ID:uQr,项目名称:Visual-NHibernate,代码行数:79,代码来源:MapColumn.cs

示例14: Deserialize

 public override void Deserialize(SerializationReader reader)
 {
     coderack = (Coderack) reader.ReadPointer();    // coderack = CType(info.GetValue("coderack", GetType(Coderack)), Coderack)
     salience = reader.ReadDouble();  // salience = info.GetDouble("salience")
     space = reader.ReadInt32();  // space = info.GetInt32("space")
     time = reader.ReadInt32();   // time = info.GetInt32("time")
     reader.ReadDictionary(children); // children = CType(info.GetValue("children", GetType(Dictionary(Of String, Codelet))), Dictionary(Of String, Codelet))
     watched = reader.ReadBoolean();  // watched = info.GetBoolean("watched")
     immune = reader.ReadBoolean();   // immune = info.GetBoolean("immune")
 }
开发者ID:killix,项目名称:Virsona-ChatBot-Tools,代码行数:10,代码来源:Codelet.cs

示例15: Deserialize

        public void Deserialize(ref SerializationReader mySerializationReader)
        {
            UInt32 _Capacity;

            try
            {

                if (mySerializationReader != null)
                {

                    UUID = new AttributeUUID();
                    UUID.Deserialize(ref mySerializationReader);
                    DBTypeUUID = new TypeUUID();
                    DBTypeUUID.Deserialize(ref mySerializationReader);
                    KindOfType = (KindsOfType)mySerializationReader.ReadOptimizedByte();
                    TypeCharacteristics = new TypeCharacteristics();
                    TypeCharacteristics.Deserialize(ref mySerializationReader);

                    Name = mySerializationReader.ReadString();

                    var hasEdgeType = mySerializationReader.ReadBoolean();

                    if (hasEdgeType)
                    {
                        try
                        {
                            EdgeType = (IEdgeType) mySerializationReader.ReadObject();
                        }
                        catch(Exception ex)
                        {
                            //NLOG: temporarily commented
                            //Logger.Fatal("Could not deserialize EdgeType");
                            throw new GraphDBException(new Error_UnknownDBError(ex));
                        }

                    }

                    RelatedGraphDBTypeUUID = new TypeUUID();
                    RelatedGraphDBTypeUUID.Deserialize(ref mySerializationReader);

                    if (TypeCharacteristics.IsBackwardEdge)
                        BackwardEdgeDefinition = (EdgeKey) mySerializationReader.ReadObject();

                    DefaultValue = (IObject) mySerializationReader.ReadObject();

                    #region Read Settings

                    _Capacity = mySerializationReader.ReadUInt32();

                    _Settings = new Dictionary<String, ADBSettingsBase>();

                    for (var i = 0; i < _Capacity; i++)
                    {

                        var _SettingObject = (ADBSettingsBase) mySerializationReader.ReadObject();

                        if (_SettingObject != null)
                            _Settings.Add(_SettingObject.Name, _SettingObject);

                        /*Type settingType = (Type)mySerializationReader.ReadObject();
                        ADBSettingsBase _SettingObject = null;
                        try
                        {
                            _SettingObject = (ADBSettingsBase)Activator.CreateInstance(settingType);
                        }
                        catch
                        {
                            Logger.Error("Could not create an instance of setting " + settingType.ToString());
                        }
                        Byte[] Bytes = (Byte[])mySerializationReader.ReadObject();
                        if (_SettingObject != null)
                        {
                            _SettingObject.Deserialize(new SerializationReader(Bytes));
                            _Settings.Add(_SettingObject.Name, _SettingObject);
                        }*/
                    }

                    #endregion

                }
            }

            catch (Exception e)
            {
                throw new SerializationException("The Setting could not be deserialized!\n\n" + e);
            }
        }
开发者ID:TheByte,项目名称:sones,代码行数:87,代码来源:TypeAttribute.cs


注:本文中的SerializationReader.ReadBoolean方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。