Application/AppHelper.cs
(开头部分) 7KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.Collections.Specialized;
using System.IO;
using System.Reflection;
using ComLib;
using ComLib.Logging;
using ComLib.Environments;
using ComLib.Arguments;
using ComLib.Authentication;
namespace ComLib.Application
{
/// <summary>
/// Utility class with methods that provide application information.
/// </summary>
public class AppHelper
{
/// <summary>
/// <para>
/// Handle possible "meta data" options of the application.
/// 1. -help
/// 2. -version
/// 3. -pause
/// </para>
/// </summary>
/// <param name="app"></param>
/// <param name="args"></param>
/// <returns></returns>
public static BoolMessageItem<Args> HandleOptions(IApp app, Args args)
{
BoolMessageItem<Args> result = new BoolMessageItem<Args>(args, true, string.Empty);
// Pause the execution of application to allow attaching of debugger.
if (args.IsPause)
{
Console.WriteLine("Paused for debugging ....");
Console.ReadKey();
result = new BoolMessageItem<Args>(args, true, string.Empty);
}
else if (args.IsVersion || args.IsInfo)
{
AppHelper.ShowAppInfo(app);
result = new BoolMessageItem<Args>(args, false, "Displaying description/version.");
}
else if (args.IsHelp)
{
// -help or ?
args.ShowUsage(app.Name);
result = new BoolMessageItem<Args>(args, false, "Displaying usage");
}
return result;
}
后面还有 111 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
