本文整理汇总了C#中System.Collections.Specialized.HybridDictionary类的典型用法代码示例。如果您正苦于以下问题:C# HybridDictionary类的具体用法?C# HybridDictionary怎么用?C# HybridDictionary使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HybridDictionary类属于System.Collections.Specialized命名空间,在下文中一共展示了HybridDictionary类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: WebPartDescriptionCollection
public WebPartDescriptionCollection(ICollection webPartDescriptions) {
if (webPartDescriptions == null) {
throw new ArgumentNullException("webPartDescriptions");
}
_ids = new HybridDictionary(webPartDescriptions.Count, true /* caseInsensitive */);
foreach (object obj in webPartDescriptions) {
if (obj == null) {
throw new ArgumentException(SR.GetString(SR.Collection_CantAddNull), "webPartDescriptions");
}
WebPartDescription description = obj as WebPartDescription;
if (description == null) {
throw new ArgumentException(SR.GetString(SR.Collection_InvalidType, "WebPartDescription"),
"webPartDescriptions");
}
string id = description.ID;
if (!_ids.Contains(id)) {
InnerList.Add(description);
_ids.Add(id, description);
}
else {
throw new ArgumentException(SR.GetString(SR.WebPart_Collection_DuplicateID, "WebPartDescription", id), "webPartDescriptions");
}
}
}
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:25,代码来源:WebPartDescriptionCollection.cs
示例17: WebPartDescriptionCollection
public WebPartDescriptionCollection(ICollection webPartDescriptions)
{
if (webPartDescriptions == null)
{
throw new ArgumentNullException("webPartDescriptions");
}
this._ids = new HybridDictionary(webPartDescriptions.Count, true);
foreach (object obj2 in webPartDescriptions)
{
if (obj2 == null)
{
throw new ArgumentException(System.Web.SR.GetString("Collection_CantAddNull"), "webPartDescriptions");
}
WebPartDescription description = obj2 as WebPartDescription;
if (description == null)
{
throw new ArgumentException(System.Web.SR.GetString("Collection_InvalidType", new object[] { "WebPartDescription" }), "webPartDescriptions");
}
string iD = description.ID;
if (this._ids.Contains(iD))
{
throw new ArgumentException(System.Web.SR.GetString("WebPart_Collection_DuplicateID", new object[] { "WebPartDescription", iD }), "webPartDescriptions");
}
base.InnerList.Add(description);
this._ids.Add(iD, description);
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:27,代码来源:WebPartDescriptionCollection.cs
示例18: ToXmlRpc
public static object ToXmlRpc(object val)
{
if (val == null)
throw new ArgumentNullException("val");
if (val is int || val is bool || val is string || val is double || val is DateTime || val is byte[])
return val;
if (val is IDictionary)
{
IDictionary results = new HybridDictionary();
IDictionary dict = (IDictionary) val;
foreach (string key in dict.Keys)
{
results[key] = ToXmlRpc(dict[key]);
}
return results;
}
object[] attributes = val.GetType().GetCustomAttributes(typeof (XmlRpcSerializableAttribute), false);
if (attributes.Length > 0)
{
return ToDictionary(val);
}
if (val is IEnumerable)
{
ArrayList arrList = new ArrayList();
foreach (object o in (IEnumerable) val)
arrList.Add(ToXmlRpc(o));
return arrList.ToArray();
}
throw new ArgumentException("Unable to serialize object of type " + val.GetType().Name);
}
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:35,代码来源:XmlRpcSerializer.cs
示例19: ConsumerConnectionPointCollection
public ConsumerConnectionPointCollection(ICollection connectionPoints)
{
if (connectionPoints == null)
{
throw new ArgumentNullException("connectionPoints");
}
this._ids = new HybridDictionary(connectionPoints.Count, true);
foreach (object obj2 in connectionPoints)
{
if (obj2 == null)
{
throw new ArgumentException(System.Web.SR.GetString("Collection_CantAddNull"), "connectionPoints");
}
ConsumerConnectionPoint point = obj2 as ConsumerConnectionPoint;
if (point == null)
{
throw new ArgumentException(System.Web.SR.GetString("Collection_InvalidType", new object[] { "ConsumerConnectionPoint" }), "connectionPoints");
}
string iD = point.ID;
if (this._ids.Contains(iD))
{
throw new ArgumentException(System.Web.SR.GetString("WebPart_Collection_DuplicateID", new object[] { "ConsumerConnectionPoint", iD }), "connectionPoints");
}
base.InnerList.Add(point);
this._ids.Add(iD, point);
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:27,代码来源:ConsumerConnectionPointCollection.cs
示例20: GetViewRendering
public ViewRendering GetViewRendering(Control control)
{
string str2;
DesignerRegionCollection regions;
CatalogPart part = control as CatalogPart;
if (part == null)
{
return new ViewRendering(ControlDesigner.CreateErrorDesignTimeHtml(System.Design.SR.GetString("CatalogZoneDesigner_OnlyCatalogParts"), null, control), new DesignerRegionCollection());
}
try
{
IDictionary data = new HybridDictionary(1);
data["Zone"] = base.Zone;
((IControlDesignerAccessor) part).SetDesignModeState(data);
this._partViewRendering = ControlDesigner.GetViewRendering(part);
regions = this._partViewRendering.Regions;
StringWriter writer = new StringWriter(CultureInfo.InvariantCulture);
this.RenderCatalogPart(new DesignTimeHtmlTextWriter(writer), (CatalogPart) PartDesigner.GetViewControl(part));
str2 = writer.ToString();
}
catch (Exception exception)
{
str2 = ControlDesigner.CreateErrorDesignTimeHtml(System.Design.SR.GetString("ControlDesigner_UnhandledException"), exception, control);
regions = new DesignerRegionCollection();
}
return new ViewRendering(str2, regions);
}
开发者ID:Reegenerator,项目名称:Sample-CustomizeDatasetCS,代码行数:27,代码来源:DesignerCatalogPartChrome.cs
注:本文中的System.Collections.Specialized.HybridDictionary类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论