CSReportWebServer.Main.Init C# (CSharp) Метод

Init() публичный статический Метод

public static Init ( string args, fMain f ) : int
args string
f fMain
Результат int
        public static int Init(string[] args, fMain f)
        {
            // configure log4net
            log4net.Config.XmlConfigurator.Configure();

            log.Info("application started");
            log.DebugFormat("command line : \"{0}\"", string.Join("\", \"", args));

            // started with no arguments?
            if (args.Length == 0) Usage();

            // started by chrome?
            else if (args[args.Length - 1].StartsWith("chrome-extension://")) RunNativeMessagingHost(args, f);

            // register command?
            else if (args[args.Length - 1] == "register") RegisterNativeMessagingHost(args);

            // invalid command line
            else InvalidCommand(args[args.Length - 1]);

            log.Info("application stopped");
            return 0;
        }

Usage Example

Пример #1
0
 private void fMain_Load(object sender, EventArgs e)
 {
     Main.Init(m_args, this);
 }