本文整理汇总了C#中ThreatLevel.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# ThreatLevel.ToString方法的具体用法?C# ThreatLevel.ToString怎么用?C# ThreatLevel.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ThreatLevel
的用法示例。
在下文中一共展示了ThreatLevel.ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ThreatLevelDefinition
public ThreatLevelDefinition(ThreatLevel threatLevel, UserSet userSet, ScriptProtectionModule module)
{
m_threatLevel = threatLevel;
m_userSet = userSet;
m_scriptProtectionModule = module;
m_allowGroupPermissions = m_scriptProtectionModule.m_config.GetBoolean(
"AllowGroupThreatPermissionCheck", m_allowGroupPermissions);
string perm = m_scriptProtectionModule.m_config.GetString("Allow_" + m_threatLevel.ToString(), "");
if (perm != "")
{
string[] ids = perm.Split(',');
foreach (string current in ids.Select(id => id.Trim()))
{
UUID uuid;
if (UUID.TryParse(current, out uuid))
{
if (uuid != UUID.Zero)
m_allowedUsers.Add(uuid);
}
}
}
perm = m_scriptProtectionModule.m_config.GetString("Allow_All", "");
if (perm != "")
{
string[] ids = perm.Split(',');
foreach (string current in ids.Select(id => id.Trim()))
{
UUID uuid;
if (UUID.TryParse(current, out uuid))
{
if (uuid != UUID.Zero)
m_allowedUsers.Add(uuid);
}
}
}
}
示例2: ThreatLevelDefinition
public ThreatLevelDefinition(ThreatLevel threatLevel, UserSet userSet, ScriptProtectionModule module)
{
m_threatLevel = threatLevel;
m_userSet = userSet;
m_scriptProtectionModule = module;
m_allowGroupPermissions = m_scriptProtectionModule.m_config.GetBoolean(
"AllowGroupThreatPermissionCheck", m_allowGroupPermissions);
string perm = m_scriptProtectionModule.m_config.GetString("Allow_" + m_threatLevel.ToString(), "");
if (perm != "")
{
string[] ids = perm.Split(',');
m_allowedUsers = ids.Select(id =>
{
UUID uuid;
if (UUID.TryParse(id.Trim(), out uuid))
return uuid;
else
return UUID.Zero;
}).Where((id) => id != UUID.Zero).ToList();
}
perm = m_scriptProtectionModule.m_config.GetString("Allow_All", "");
if (perm != "")
{
string[] ids = perm.Split(',');
m_allowedUsers = ids.Select(id =>
{
UUID uuid;
if (UUID.TryParse(id.Trim(), out uuid))
return uuid;
else
return UUID.Zero;
}).Where((id) => id != UUID.Zero).ToList();
}
}