本文整理汇总了C#中System.Security.Util.TokenBasedSet.GetStartingIndex方法的典型用法代码示例。如果您正苦于以下问题:C# TokenBasedSet.GetStartingIndex方法的具体用法?C# TokenBasedSet.GetStartingIndex怎么用?C# TokenBasedSet.GetStartingIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Security.Util.TokenBasedSet
的用法示例。
在下文中一共展示了TokenBasedSet.GetStartingIndex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PermissionSet
public PermissionSet(PermissionSet permSet)
: this()
{
if (permSet == null)
{
Reset();
return;
}
m_Unrestricted = permSet.m_Unrestricted;
m_CheckedForNonCas = permSet.m_CheckedForNonCas;
m_ContainsCas = permSet.m_ContainsCas;
m_ContainsNonCas = permSet.m_ContainsNonCas;
m_ignoreTypeLoadFailures = permSet.m_ignoreTypeLoadFailures;
if (permSet.m_permSet != null)
{
m_permSet = new TokenBasedSet(permSet.m_permSet);
// now deep copy all permissions in set
for (int i = m_permSet.GetStartingIndex(); i <= m_permSet.GetMaxUsedIndex(); i++)
{
Object obj = m_permSet.GetItem(i);
IPermission perm = obj as IPermission;
#if FEATURE_CAS_POLICY
ISecurityElementFactory elem = obj as ISecurityElementFactory;
#endif // FEATURE_CAS_POLICY
if (perm != null)
{
m_permSet.SetItem(i, perm.Copy());
}
#if FEATURE_CAS_POLICY
else if (elem != null)
{
m_permSet.SetItem(i, elem.Copy());
}
#endif // FEATURE_CAS_POLICY
}
}
}
示例2: PermissionSet
public PermissionSet(PermissionSet permSet)
: this()
{
if (permSet == null)
{
Reset();
return;
}
m_Unrestricted = permSet.m_Unrestricted;
m_CheckedForNonCas = permSet.m_CheckedForNonCas;
m_ContainsCas = permSet.m_ContainsCas;
m_ContainsNonCas = permSet.m_ContainsNonCas;
m_ignoreTypeLoadFailures = permSet.m_ignoreTypeLoadFailures;
if (permSet.m_permSet != null)
{
m_permSet = new TokenBasedSet(permSet.m_permSet);
// now deep copy all permissions in set
for (int i = m_permSet.GetStartingIndex(); i <= m_permSet.GetMaxUsedIndex(); i++)
{
Object obj = m_permSet.GetItem(i);
IPermission perm = obj as IPermission;
if (perm != null)
{
m_permSet.SetItem(i, perm.Copy());
}
}
}
}