本文整理汇总了C#中System.Security.Util.StringExpressionSet.Copy方法的典型用法代码示例。如果您正苦于以下问题:C# StringExpressionSet.Copy方法的具体用法?C# StringExpressionSet.Copy怎么用?C# StringExpressionSet.Copy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Security.Util.StringExpressionSet
的用法示例。
在下文中一共展示了StringExpressionSet.Copy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Union
[System.Security.SecurityCritical] // auto-generated
public StringExpressionSet Union( StringExpressionSet ses )
{
// If either set is empty, the union represents a copy of the other.
if (ses == null || ses.IsEmpty())
return this.Copy();
if (this.IsEmpty())
return ses.Copy();
CheckList();
ses.CheckList();
// Perform the union
// note: insert smaller set into bigger set to reduce needed comparisons
StringExpressionSet bigger = ses.m_list.Count > this.m_list.Count ? ses : this;
StringExpressionSet smaller = ses.m_list.Count <= this.m_list.Count ? ses : this;
StringExpressionSet unionSet = bigger.Copy();
unionSet.Reduce();
for (int index = 0; index < smaller.m_list.Count; ++index)
{
unionSet.AddSingleExpressionNoDuplicates( (String)smaller.m_list[index] );
}
unionSet.GenerateString();
return unionSet;
}
示例2: Union
public StringExpressionSet Union(StringExpressionSet ses)
{
if ((ses == null) || ses.IsEmpty())
{
return this.Copy();
}
if (this.IsEmpty())
{
return ses.Copy();
}
this.CheckList();
ses.CheckList();
StringExpressionSet set = (ses.m_list.Count > this.m_list.Count) ? ses : this;
StringExpressionSet set2 = (ses.m_list.Count <= this.m_list.Count) ? ses : this;
StringExpressionSet set3 = set.Copy();
set3.Reduce();
for (int i = 0; i < set2.m_list.Count; i++)
{
set3.AddSingleExpressionNoDuplicates((string) set2.m_list[i]);
}
set3.GenerateString();
return set3;
}