示例#1
0
        static void Main(string[] args)
        {
            // ------------------------------------------
            //  OPTIONS
            // ------------------------------------------

            bool   help     = false;
            String language = "fr-FR";

            var p = new OptionSet()
            {
                { "l|lang=", "the {LANGUAGE} Culture. Default is fr-FR", v => language = v },
                { "h|help", "show this message and exit", v => help = v != null },
            };

            List <string> extra;

            try { extra = p.Parse(args); }
            catch (OptionException e) {
                Console.Write("NFCHelper: ");
                Console.WriteLine(e.Message);
                Console.WriteLine("Try `NFCHelper --help' for more information.");
                Application.Exit();
            }

            if (help)
            {
                ShowHelp(p);
                Application.Exit();
            }


            // ------------------------------------------
            //  STARTING
            // ------------------------------------------

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // Show the system tray icon.
            using (ProcessIcon pi = new ProcessIcon()) {
                pi.Display();

                // Start NFCHelper
                NFCHelper.getInstance();

                // Make sure the application runs!
                Application.Run();
            }
        }
示例#2
0
        static void Main(string[] args)
        {
            // ------------------------------------------
              //  OPTIONS
              // ------------------------------------------

              bool help = false;
              String language = "fr-FR";

              var p = new OptionSet() {
            { "l|lang=", "the {LANGUAGE} Culture. Default is fr-FR", v => language = v },
            { "h|help",  "show this message and exit", v => help = v != null },
              };

              List<string> extra;
              try { extra = p.Parse(args); }
              catch (OptionException e) {
            Console.Write("NFCHelper: ");
            Console.WriteLine(e.Message);
            Console.WriteLine("Try `NFCHelper --help' for more information.");
            Application.Exit();
              }

              if (help) {
            ShowHelp(p);
            Application.Exit();
              }

              // ------------------------------------------
              //  STARTING
              // ------------------------------------------

              Application.EnableVisualStyles();
              Application.SetCompatibleTextRenderingDefault(false);

              // Show the system tray icon.
              using (ProcessIcon pi = new ProcessIcon()) {
            pi.Display();

            // Start NFCHelper
            NFCHelper.getInstance();

            // Make sure the application runs!
            Application.Run();
              }
        }