本文整理汇总了C#中HashedSet.CopyTo方法的典型用法代码示例。如果您正苦于以下问题:C# HashedSet.CopyTo方法的具体用法?C# HashedSet.CopyTo怎么用?C# HashedSet.CopyTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HashedSet
的用法示例。
在下文中一共展示了HashedSet.CopyTo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetAllConfigurations
/// <summary>
/// Pendent
/// </summary>
public Configuration[] GetAllConfigurations()
{
HashedSet set = new HashedSet(type2Conf.Values);
Configuration[] confs = new Configuration[set.Count];
set.CopyTo(confs, 0);
return confs;
}
示例2: SetErrorMessage
/// <summary>
/// Sets error message that should be displayed in the case
/// of a non-fatal binding error.
/// </summary>
/// <param name="messageId">
/// Resource ID of the error message.
/// </param>
/// <param name="errorProviders">
/// List of error providers message should be added to.
/// </param>
public void SetErrorMessage(string messageId, params string[] errorProviders)
{
AssertUtils.ArgumentHasText(messageId, "messageId");
if (errorProviders == null || errorProviders.Length == 0)
{
throw new ArgumentException("At least one error provider has to be specified.", "providers");
}
this.errorMessage = new BindingErrorMessage(this.BINDING_ID, messageId, null);
Set providers = new HashedSet();
providers.Add(ALL_BINDINGERRORS_PROVIDER);
providers.AddAll(errorProviders);
errorProviders = new string[providers.Count];
providers.CopyTo(errorProviders, 0);
this.errorProviders = errorProviders;
}
示例3: UnionSubclassEntityPersister
public UnionSubclassEntityPersister(PersistentClass persistentClass, ICacheConcurrencyStrategy cache,
ISessionFactoryImplementor factory, IMapping mapping):base(persistentClass, cache, factory)
{
if (IdentifierGenerator is IdentityGenerator)
{
throw new MappingException("Cannot use identity column key generation with <union-subclass> mapping for: " + EntityName);
}
// TABLE
tableName =
persistentClass.Table.GetQualifiedName(factory.Dialect, factory.Settings.DefaultCatalogName,
factory.Settings.DefaultSchemaName);
#region Custom SQL
SqlString sql;
bool callable;
ExecuteUpdateResultCheckStyle checkStyle;
sql = persistentClass.CustomSQLInsert;
callable = sql != null && persistentClass.IsCustomInsertCallable;
checkStyle = sql == null
? ExecuteUpdateResultCheckStyle.Count
: (persistentClass.CustomSQLInsertCheckStyle
?? ExecuteUpdateResultCheckStyle.DetermineDefault(sql, callable));
customSQLInsert = new SqlString[] { sql };
insertCallable = new bool[] { callable };
insertResultCheckStyles = new ExecuteUpdateResultCheckStyle[] { checkStyle };
sql = persistentClass.CustomSQLUpdate;
callable = sql != null && persistentClass.IsCustomUpdateCallable;
checkStyle = sql == null
? ExecuteUpdateResultCheckStyle.Count
: (persistentClass.CustomSQLUpdateCheckStyle
?? ExecuteUpdateResultCheckStyle.DetermineDefault(sql, callable));
customSQLUpdate = new SqlString[] { sql };
updateCallable = new bool[] { callable };
updateResultCheckStyles = new ExecuteUpdateResultCheckStyle[] { checkStyle };
sql = persistentClass.CustomSQLDelete;
callable = sql != null && persistentClass.IsCustomDeleteCallable;
checkStyle = sql == null
? ExecuteUpdateResultCheckStyle.Count
: (persistentClass.CustomSQLDeleteCheckStyle
?? ExecuteUpdateResultCheckStyle.DetermineDefault(sql, callable));
customSQLDelete = new SqlString[] { sql };
deleteCallable = new bool[] { callable };
deleteResultCheckStyles = new ExecuteUpdateResultCheckStyle[] { checkStyle };
#endregion
discriminatorValue = persistentClass.SubclassId;
discriminatorSQLValue = persistentClass.SubclassId.ToString();
#region PROPERTIES
int subclassSpan = persistentClass.SubclassSpan + 1;
subclassClosure = new string[subclassSpan];
subclassClosure[0] = EntityName;
#endregion
#region SUBCLASSES
subclassByDiscriminatorValue[persistentClass.SubclassId] = persistentClass.EntityName;
if (persistentClass.IsPolymorphic)
{
int k = 1;
foreach (Subclass sc in persistentClass.SubclassIterator)
{
subclassClosure[k++] = sc.EntityName;
subclassByDiscriminatorValue[sc.SubclassId] = sc.EntityName;
}
}
#endregion
#region SPACES
//TODO: i'm not sure, but perhaps we should exclude abstract denormalized tables?
int spacesSize = 1 + persistentClass.SynchronizedTables.Count;
spaces = new string[spacesSize];
spaces[0] = tableName;
IEnumerator<string> iSyncTab = persistentClass.SynchronizedTables.GetEnumerator();
for (int i = 1; i < spacesSize; i++)
{
iSyncTab.MoveNext();
spaces[i] = iSyncTab.Current;
}
HashedSet<string> subclassTables = new HashedSet<string>();
foreach (Table table in persistentClass.SubclassTableClosureIterator)
{
subclassTables.Add(
table.GetQualifiedName(factory.Dialect, factory.Settings.DefaultCatalogName, factory.Settings.DefaultSchemaName));
}
subclassSpaces = new string[subclassTables.Count];
subclassTables.CopyTo(subclassSpaces, 0);
//.........这里部分代码省略.........