本文整理汇总了C#中Options.ProcessArgs方法的典型用法代码示例。如果您正苦于以下问题:C# Options.ProcessArgs方法的具体用法?C# Options.ProcessArgs怎么用?C# Options.ProcessArgs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Options
的用法示例。
在下文中一共展示了Options.ProcessArgs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main (string [] args)
{
Options options = new Options ();
if (!options.ProcessArgs (args))
return;
if (options.AssemblyReference != null) {
assembly = options.AssemblyReference;
if (options.Type == null) {
if (options.PrintRefs)
PrintRefs (assembly);
else
PrintTypes (assembly, options.ShowPrivate, options.FilterObsolete);
return;
}
}
string message = null;
string tname = options.Type;
Type t = null;
int count;
if (options.Search) {
string matches = SearchTypes (tname, ref t, out count);
if (count == 0)
goto notfound;
if (count == 1)
goto found;
if (count > 1){
Console.WriteLine ("Found " + count + " types that match:");
Console.WriteLine (matches);
return;
}
}
t = GetType (tname);
if (t == null) {
// Try some very common ones, dont load anything
foreach (string ns in v_common_ns) {
t = GetType (ns + "." + tname, true);
if (t != null)
goto found;
}
}
if (t == null) {
foreach (string assm in GetKnownAssemblyNames ()) {
try {
Assembly a = GetAssembly (assm, false);
t = a.GetType (tname, false, true);
if (t != null) {
message = String.Format ("{0} is included in the {1} assembly.",
t.FullName,
t.Assembly.GetName ().Name);
goto found;
}
foreach (string ns in common_ns) {
t = a.GetType (ns + "." + tname, false, true);
if (t != null) {
message = String.Format ("{0} is included in the {1} assembly.",
t.FullName,
t.Assembly.GetName ().Name);
goto found;
}
}
} catch {
}
}
}
notfound:
if (t == null) {
Console.WriteLine ("Could not find {0}", tname);
return;
}
found:
//
// This gets us nice buffering
//
StreamWriter sw = new StreamWriter (Console.OpenStandardOutput (), Console.Out.Encoding);
new Outline (t, sw, options.DeclaredOnly, options.ShowPrivate, options.FilterObsolete).OutlineType ();
sw.Flush ();
if (message != null)
Console.WriteLine (message);
}