本文整理汇总了C#中ConsoleSystem.CheckPermissions方法的典型用法代码示例。如果您正苦于以下问题:C# ConsoleSystem.CheckPermissions方法的具体用法?C# ConsoleSystem.CheckPermissions怎么用?C# ConsoleSystem.CheckPermissions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConsoleSystem
的用法示例。
在下文中一共展示了ConsoleSystem.CheckPermissions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: find
public static void find(ref ConsoleSystem.Arg arg)
{
string str;
if (!arg.HasArgs(1))
{
return;
}
string args = arg.Args[0];
string empty = string.Empty;
Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
for (int i = 0; i < (int)assemblies.Length; i++)
{
Type[] types = assemblies[i].GetTypes();
for (int j = 0; j < (int)types.Length; j++)
{
if (types[j].IsSubclassOf(typeof(ConsoleSystem)))
{
MethodInfo[] methods = types[j].GetMethods();
for (int k = 0; k < (int)methods.Length; k++)
{
if (methods[k].IsStatic)
{
if (!(args != "*") || types[j].Name.Contains(args) || methods[k].Name.Contains(args))
{
if (arg.CheckPermissions(methods[k].GetCustomAttributes(true)))
{
str = empty;
empty = string.Concat(new string[] { str, types[j].Name, ".", global.BuildMethodString(ref methods[k]), "\n" });
}
}
}
}
FieldInfo[] fields = types[j].GetFields();
for (int l = 0; l < (int)fields.Length; l++)
{
if (fields[l].IsStatic)
{
if (!(args != "*") || types[j].Name.Contains(args) || fields[l].Name.Contains(args))
{
if (arg.CheckPermissions(fields[l].GetCustomAttributes(true)))
{
str = empty;
empty = string.Concat(new string[] { str, types[j].Name, ".", global.BuildFieldsString(ref fields[l]), "\n" });
}
}
}
}
PropertyInfo[] properties = types[j].GetProperties();
for (int m = 0; m < (int)properties.Length; m++)
{
if (!(args != "*") || types[j].Name.Contains(args) || properties[m].Name.Contains(args))
{
if (arg.CheckPermissions(properties[m].GetCustomAttributes(true)))
{
str = empty;
empty = string.Concat(new string[] { str, types[j].Name, ".", global.BuildPropertyString(ref properties[m]), "\n" });
}
}
}
}
}
}
arg.ReplyWith(string.Concat("Finding ", args, ":\n", empty));
}