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


C# Specialized.HybridDictionary類代碼示例

本文整理匯總了C#中System.Collections.Specialized.HybridDictionary的典型用法代碼示例。如果您正苦於以下問題:C# HybridDictionary類的具體用法?C# HybridDictionary怎麽用?C# HybridDictionary使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


HybridDictionary類屬於System.Collections.Specialized命名空間,在下文中一共展示了HybridDictionary類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: RolePrincipal

 protected RolePrincipal(SerializationInfo info, StreamingContext context)
 {
     this._Version = info.GetInt32("_Version");
     this._ExpireDate = info.GetDateTime("_ExpireDate");
     this._IssueDate = info.GetDateTime("_IssueDate");
     try
     {
         this._Identity = info.GetValue("_Identity", typeof(IIdentity)) as IIdentity;
     }
     catch
     {
     }
     this._ProviderName = info.GetString("_ProviderName");
     this._Username = info.GetString("_Username");
     this._IsRoleListCached = info.GetBoolean("_IsRoleListCached");
     this._Roles = new HybridDictionary(true);
     string str = info.GetString("_AllRoles");
     if (str != null)
     {
         foreach (string str2 in str.Split(new char[] { ',' }))
         {
             if (this._Roles[str2] == null)
             {
                 this._Roles.Add(str2, string.Empty);
             }
         }
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:28,代碼來源:RolePrincipal.cs

示例2: InventoryComponent

        /// <summary>
        ///     Initializes a new instance of the <see cref="InventoryComponent" /> class.
        /// </summary>
        /// <param name="userId">The user identifier.</param>
        /// <param name="client">The client.</param>
        /// <param name="userData">The user data.</param>
        internal InventoryComponent(uint userId, GameClient client, UserData userData)
        {
            _mClient = client;
            UserId = userId;
            _floorItems = new HybridDictionary();
            _wallItems = new HybridDictionary();
            SongDisks = new HybridDictionary();

            foreach (UserItem current in userData.Inventory)
            {
                if (current.BaseItem.InteractionType == Interaction.MusicDisc)
                    SongDisks.Add(current.Id, current);
                if (current.IsWallItem)
                    _wallItems.Add(current.Id, current);
                else
                    _floorItems.Add(current.Id, current);
            }

            _inventoryPets = new HybridDictionary();
            _inventoryBots = new HybridDictionary();
            _mAddedItems = new HybridDictionary();
            _mRemovedItems = new HybridDictionary();
            _isUpdated = false;

            foreach (KeyValuePair<uint, RoomBot> bot in userData.Bots)
                AddBot(bot.Value);

            foreach (KeyValuePair<uint, Pet> pets in userData.Pets)
                AddPets(pets.Value);
        }
開發者ID:AngelRmz,項目名稱:Yupi,代碼行數:36,代碼來源:InventoryComponent.cs

示例3: DbEnum

 public DbEnum(int type)
 {
     IList dic = DbEntry
         .From<LeafingEnum>()
         .Where(CK.K["Type"] == type)
         .OrderBy("Id")
         .Select();
     _dict = new HybridDictionary();
     _vdic = new HybridDictionary();
     _list = new string[dic.Count];
     int n = 0;
     int m = 0;
     foreach (LeafingEnum e in dic)
     {
         _list[n] = e.Name;
         if (e.Value != null)
         {
             m = (int)e.Value;
         }
         _dict[e.Name.ToLower()] = m;
         _vdic[m] = e.Name;
         n++;
         m++;
     }
 }
開發者ID:991899783,項目名稱:DbEntry,代碼行數:25,代碼來源:DbEnum.cs

示例4: ConsumerConnectionPointCollection

        public ConsumerConnectionPointCollection(ICollection connectionPoints) {
            if (connectionPoints == null) {
                throw new ArgumentNullException("connectionPoints");
            }

            _ids = new HybridDictionary(connectionPoints.Count, true /* caseInsensitive */);
            foreach (object obj in connectionPoints) {
                if (obj == null) {
                    throw new ArgumentException(SR.GetString(SR.Collection_CantAddNull), "connectionPoints");
                }
                ConsumerConnectionPoint point = obj as ConsumerConnectionPoint;
                if (point == null) {
                    throw new ArgumentException(SR.GetString(SR.Collection_InvalidType, "ConsumerConnectionPoint"),
                                                "connectionPoints");
                }
                string id = point.ID;
                if (!_ids.Contains(id)) {
                    InnerList.Add(point);
                    _ids.Add(id, point);
                }
                else {
                    throw new ArgumentException(SR.GetString(SR.WebPart_Collection_DuplicateID, "ConsumerConnectionPoint", id), "connectionPoints");
                }
            }
        }
開發者ID:krytht,項目名稱:DotNetReferenceSource,代碼行數:25,代碼來源:ConsumerConnectionPointCollection.cs

示例5: DbConnectionPoolGroup

 internal DbConnectionPoolGroup(System.Data.Common.DbConnectionOptions connectionOptions, System.Data.ProviderBase.DbConnectionPoolGroupOptions poolGroupOptions)
 {
     this._connectionOptions = connectionOptions;
     this._poolGroupOptions = poolGroupOptions;
     this._poolCollection = new HybridDictionary(1, false);
     this._state = 1;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:7,代碼來源:DbConnectionPoolGroup.cs

示例6: InventoryComponent

		internal InventoryComponent(uint UserId, GameClient Client, UserData UserData)
		{
			this.mClient = Client;
			this.UserId = UserId;
			this.floorItems = new HybridDictionary();
			this.wallItems = new HybridDictionary();
			this.discs = new HybridDictionary();
			foreach (UserItem current in UserData.inventory)
			{
				if (current.GetBaseItem().InteractionType == InteractionType.musicdisc)
				{
					this.discs.Add(current.Id, current);
				}
				if (current.isWallItem)
				{
					this.wallItems.Add(current.Id, current);
				}
				else
				{
					this.floorItems.Add(current.Id, current);
				}
			}
			this.InventoryPets = new SafeDictionary<uint, Pet>(UserData.pets);
			this.InventoryBots = new SafeDictionary<uint, RoomBot>(UserData.Botinv);
			this.mAddedItems = new HybridDictionary();
			this.mRemovedItems = new HybridDictionary();
			this.isUpdated = false;
		}
開發者ID:kessiler,項目名稱:habboServer,代碼行數:28,代碼來源:InventoryComponent.cs

示例7: HasReliableHashCode

        [FriendAccessAllowed]   // defined in Base, used in Core and Framework
        internal static bool HasReliableHashCode(object item)
        {
            // null doesn't actually have a hashcode at all.  This method can be
            // called with a representative item from a collection - if the
            // representative is null, we'll be pessimistic and assume the
            // items in the collection should not be hashed.
            if (item == null)
                return false;

            Type type = item.GetType();
            Assembly assembly = type.Assembly;
            HybridDictionary dictionary;

            lock(_table)
            {
                dictionary = (HybridDictionary)_table[assembly];
            }

            if (dictionary == null)
            {
                dictionary = new HybridDictionary();

                lock(_table)
                {
                    _table[assembly] = dictionary;
                }
            }

            return !dictionary.Contains(type);
        }
開發者ID:nlh774,項目名稱:DotNetReferenceSource,代碼行數:31,代碼來源:BaseHashHelper.cs

示例8: GetRowsFromTable

        public static TableRow[] GetRowsFromTable(Database msidb, string tableName)
        {
            if (!msidb.TableExists(tableName))
            {
                Trace.WriteLine(string.Format("Table name does {0} not exist Found.", tableName));
                return new TableRow[0];
            }

            string query = string.Concat("SELECT * FROM `", tableName, "`");
            using (var view = new ViewWrapper(msidb.OpenExecuteView(query)))
            {
                var /*<TableRow>*/ rows = new ArrayList(view.Records.Count);

                ColumnInfo[] columns = view.Columns;
                foreach (object[] values in view.Records)
                {
                    HybridDictionary valueCollection = new HybridDictionary(values.Length);
                    for (int cIndex = 0; cIndex < columns.Length; cIndex++)
                    {
                        valueCollection[columns[cIndex].Name] = values[cIndex];
                    }
                    rows.Add(new TableRow(valueCollection));
                }
                return (TableRow[]) rows.ToArray(typeof(TableRow));
            }
        }
開發者ID:dbremner,項目名稱:lessmsi,代碼行數:26,代碼來源:TableWrapper.cs

示例9: BasicPropertiesWrapper

        public BasicPropertiesWrapper(IBasicProperties basicProperties)
        {
            ContentType = basicProperties.ContentType;
            ContentEncoding = basicProperties.ContentEncoding;
            DeliveryMode = basicProperties.DeliveryMode;
            Priority = basicProperties.Priority;
            CorrelationId = basicProperties.CorrelationId;
            ReplyTo = basicProperties.ReplyTo;
            Expiration = basicProperties.Expiration;
            MessageId = basicProperties.MessageId;
            Timestamp = basicProperties.Timestamp.UnixTime;
            Type = basicProperties.Type;
            UserId = basicProperties.UserId;
            AppId = basicProperties.AppId;
            ClusterId = basicProperties.ClusterId;

            if (basicProperties.IsHeadersPresent())
            {
                Headers = new HybridDictionary();
                foreach (DictionaryEntry header in basicProperties.Headers)
                {
                    Headers.Add(header.Key, header.Value);
                }
            }
        }
開發者ID:sovanesyan,項目名稱:Burrow.NET,代碼行數:25,代碼來源:BurrowError.cs

示例10: DataTypeParser

		static DataTypeParser()
		{
			Types = new HybridDictionary();
            Types[typeof(string)]   = DataType.String;
            Types[typeof(DateTime)] = DataType.DateTime;
            Types[typeof(Date)]     = DataType.Date;
            Types[typeof(Time)]     = DataType.Time;
            Types[typeof(bool)]     = DataType.Boolean;

            Types[typeof(byte)]     = DataType.Byte;
            Types[typeof(sbyte)]    = DataType.SByte;
            Types[typeof(decimal)]  = DataType.Decimal;
            Types[typeof(double)]   = DataType.Double;
            Types[typeof(float)]    = DataType.Single;

            Types[typeof(int)]      = DataType.Int32;
            Types[typeof(uint)]     = DataType.UInt32;
            Types[typeof(long)]     = DataType.Int64;
            Types[typeof(ulong)]    = DataType.UInt64;
            Types[typeof(short)]    = DataType.Int16;
            Types[typeof(ushort)]   = DataType.UInt16;

            Types[typeof(Guid)]     = DataType.Guid;
            Types[typeof(byte[])]   = DataType.Binary;
            Types[typeof(Enum)]     = DataType.Int32;

            Types[typeof(DBNull)]   = DataType.Single; // is that right?
        }
開發者ID:991899783,項目名稱:DbEntry,代碼行數:28,代碼來源:DataTypeParser.cs

示例11: MaxLength

		/// <summary>
		/// Obtém o tamanho máximo de um campo no banco de dados.
		/// </summary>
		/// <param name="table">A tabela</param>
		/// <param name="field">O campo</param>
		/// <returns>
		/// O tamanho máximo do campo, ou 
		/// <c>null</c> caso não seja
		/// possível obter o tamanho máximo.
		/// </returns>
		public NullableInt32 MaxLength(string table, string field)
		{
			Type t = GetModelType(table);
			if (t == null) return null;

			EnsureMetadataCache(t);

			ActiveRecordModel model = ActiveRecordModel.GetModel(t);
			if (model == null) return null;

			IDictionary type2len = (IDictionary) type2lengths[t];
			if (type2len == null)
			{
				lock (type2lengths.SyncRoot)
				{
					type2len = new HybridDictionary(true);

					string physicalTableName = model.ActiveRecordAtt.Table;

					foreach (PropertyModel p in model.Properties)
					{
						string physicalColumnName = p.PropertyAtt.Column;
						type2len.Add(p.Property.Name, mdCache.MaxLength(physicalTableName, physicalColumnName));
					}

					type2lengths[t] = type2len;
				}
			}

			if (!type2len.Contains(field))
				return null;

			return (int) type2len[field];
		}
開發者ID:elementar,項目名稱:Suprifattus.Util,代碼行數:44,代碼來源:AbstractDbHelper.cs

示例12: ConfigurationLockCollection

        internal ConfigurationLockCollection(ConfigurationElement thisElement, ConfigurationLockCollectionType lockType,
                    string ignoreName, ConfigurationLockCollection parentCollection) {
            _thisElement = thisElement;
            _lockType = lockType;
            internalDictionary = new HybridDictionary();
            internalArraylist = new ArrayList();
            _bModified = false;

            _bExceptionList = _lockType == ConfigurationLockCollectionType.LockedExceptionList ||
                              _lockType == ConfigurationLockCollectionType.LockedElementsExceptionList;
            _ignoreName = ignoreName;

            if (parentCollection != null) {
                foreach (string key in parentCollection) // seed the new collection
                {
                    Add(key, ConfigurationValueFlags.Inherited);  // add the local copy
                    if (_bExceptionList) {
                        if (SeedList.Length != 0)
                            SeedList += ",";
                        SeedList += key;
                    }
                }
            }

        }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:25,代碼來源:ConfigurationLockCollection.cs

示例13: AnalyzeEnum

		private void AnalyzeEnum( Type enumType )
		{
			_enumName = enumType.Name;

			R.FieldInfo[] fieldInfos = enumType.GetFields( BindingFlags.Static | BindingFlags.Public );

			_namedValues = new HybridDictionary( fieldInfos.Length, false );
			_valuedNames = new HybridDictionary( fieldInfos.Length, false );

			foreach( R.FieldInfo fi in fieldInfos )
			{
				if( ( fi.Attributes & EnumField ) == EnumField )
				{
					string name = fi.Name;
					object value = fi.GetValue( null );

					Attribute[] attrs =
						Attribute.GetCustomAttributes( fi, typeof( XmlEnumAttribute ) );
					if( attrs.Length > 0 )
					{
						XmlEnumAttribute attr = (XmlEnumAttribute)attrs[0];
						name = attr.Name;
					}

					_namedValues.Add( name, value );
					if( !_valuedNames.Contains( value ))
						_valuedNames.Add( value, name );
				}
			}
		}
開發者ID:zanyants,項目名稱:mvp.xml,代碼行數:30,代碼來源:EnumConverter.cs

示例14: DbConnectionPoolGroup

 internal DbConnectionPoolGroup(DbConnectionOptions connectionOptions, DbConnectionPoolGroupOptions poolGroupOptions)
 {
     this._connectionOptions = connectionOptions;
     this._poolGroupOptions = poolGroupOptions;
     this._poolCollection = new HybridDictionary(1, false);
     this._state = 1;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:7,代碼來源:DbConnectionPoolGroup.cs

示例15: LookupMember

 private void LookupMember(string name, HybridDictionary visitedAliases, out PSMemberInfo returnedMember, out bool hasCycle)
 {
     returnedMember = null;
     if (base.instance == null)
     {
         throw new ExtendedTypeSystemException("AliasLookupMemberOutsidePSObject", null, ExtendedTypeSystem.AccessMemberOutsidePSObject, new object[] { name });
     }
     PSMemberInfo info = PSObject.AsPSObject(base.instance).Properties[name];
     if (info == null)
     {
         throw new ExtendedTypeSystemException("AliasLookupMemberNotPresent", null, ExtendedTypeSystem.MemberNotPresent, new object[] { name });
     }
     PSAliasProperty property = info as PSAliasProperty;
     if (property == null)
     {
         hasCycle = false;
         returnedMember = info;
     }
     else if (visitedAliases.Contains(name))
     {
         hasCycle = true;
     }
     else
     {
         visitedAliases.Add(name, name);
         this.LookupMember(property.ReferencedMemberName, visitedAliases, out returnedMember, out hasCycle);
     }
 }
開發者ID:nickchal,項目名稱:pash,代碼行數:28,代碼來源:PSAliasProperty.cs


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