Initialize() public method

public Initialize ( ) : void
return void
コード例 #1
0
ファイル: Program.cs プロジェクト: rayleyva/SparkleShare
        public static void Main(string [] args)
        {
            // Parse the command line options
            bool show_help       = false;
            OptionSet option_set = new OptionSet () {
                { "v|version", _("Print version information"), v => { PrintVersion (); } },
                { "h|help", _("Show this help text"), v => show_help = v != null }
            };

            try {
                option_set.Parse (args);

            } catch (OptionException e) {
                Console.Write ("SparkleShare: ");
                Console.WriteLine (e.Message);
                Console.WriteLine ("Try `sparkleshare --help' for more information.");
            }

            if (show_help)
                ShowHelp (option_set);

            // Initialize the controller this way so that
            // there aren't any exceptions in the OS specific UI's
            Controller = new SparkleController ();
            Controller.Initialize ();

            if (Controller != null) {
                UI = new SparkleUI ();
                UI.Run ();
            }
        }
コード例 #2
0
        public static void Main(string [] args)
        {
            // Parse the command line options
            bool      show_help  = false;
            OptionSet option_set = new OptionSet()
            {
                { "v|version", _("Print version information"), v => { PrintVersion(); } },
                { "h|help", _("Show this help text"), v => show_help = v != null }
            };

            try {
                option_set.Parse(args);
            } catch (OptionException e) {
                Console.Write("SparkleShare: ");
                Console.WriteLine(e.Message);
                Console.WriteLine("Try `sparkleshare --help' for more information.");
            }

            if (show_help)
            {
                ShowHelp(option_set);
            }


            // Initialize the controller this way so that
            // there aren't any exceptions in the OS specific UI's
            Controller = new SparkleController();
            Controller.Initialize();

            if (Controller != null)
            {
                UI = new SparkleUI();
                UI.Run();
            }
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: phamtuanchip/CmisSync
        public static void Main (string [] args)
        {
			Console.WriteLine("start");
            if (args.Length != 0 && !args [0].Equals ("start") &&
                SparkleBackend.Platform != PlatformID.MacOSX &&
                SparkleBackend.Platform != PlatformID.Win32NT) {

                string n = Environment.NewLine;

                Console.WriteLine (n +
                    "SparkleShare is a collaboration and sharing tool that is" + n +
                    "designed to keep things simple and to stay out of your way." + n +
                    n +
                    "Version: " + SparkleLib.SparkleBackend.Version + n +
                    "Copyright (C) 2010 Hylke Bons" + n +
                    "This program comes with ABSOLUTELY NO WARRANTY." + n +
                    n +
                    "This is free software, and you are welcome to redistribute it" + n +
                    "under certain conditions. Please read the GNU GPLv3 for details." + n +
                    n +
                    "Usage: sparkleshare [start|stop|restart]");
				Console.WriteLine ("SparkleShare is already running.");
                Environment.Exit (-1);
            }

			// Only allow one instance of SparkleShare (on Windows)
			if (!program_mutex.WaitOne (0, false)) {
				Console.WriteLine ("SparkleShare is already running.");
				Environment.Exit (-1);
			}

#if !DEBUG
            try {
#endif
                Controller = new SparkleController ();
                Controller.Initialize ();

                UI = new SparkleUI ();
                UI.Run ();
            
#if !DEBUG
            } catch (Exception e) {
				Console.WriteLine("Exception in Program.Main");
                SparkleLogger.WriteCrashReport (e);
                Environment.Exit (-1);
            }
#endif

            #if !__MonoCS__
            // Suppress assertion messages in debug mode
            GC.Collect (GC.MaxGeneration, GCCollectionMode.Forced);
            GC.WaitForPendingFinalizers ();
            #endif
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: mihirvj/SparkleShare
        public static void Main(string [] args)
        {
            if (args.Length != 0 && !args [0].Equals("start") &&
                SparkleBackend.Platform != PlatformID.MacOSX &&
                SparkleBackend.Platform != PlatformID.Win32NT)
            {
                string n = Environment.NewLine;

                Console.WriteLine(n +
                                  "SparkleShare is a collaboration and sharing tool that is" + n +
                                  "designed to keep things simple and to stay out of your way." + n +
                                  n +
                                  "Version: " + SparkleLib.SparkleBackend.Version + n +
                                  "Copyright (C) 2010 Hylke Bons" + n +
                                  "This program comes with ABSOLUTELY NO WARRANTY." + n +
                                  n +
                                  "This is free software, and you are welcome to redistribute it" + n +
                                  "under certain conditions. Please read the GNU GPLv3 for details." + n +
                                  n +
                                  "Usage: sparkleshare [start|stop|restart]");

                Environment.Exit(-1);
            }

            // Only allow one instance of SparkleShare (on Windows)
            if (!program_mutex.WaitOne(0, false))
            {
                Console.WriteLine("SparkleShare is already running.");

                Controller = new SparkleController();
                Controller.Initialize();

                UI = new SparkleUI();
                UI.Run();
            }

            try {
                Controller = new SparkleController();
                Controller.Initialize();

                UI = new SparkleUI();
                UI.Run();
            } catch (Exception e) {
                SparkleLogger.WriteCrashReport(e);
                Environment.Exit(-1);
            }

            #if !__MonoCS__
            // Suppress assertion messages in debug mode
            GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced);
            GC.WaitForPendingFinalizers();
            #endif
        }
コード例 #5
0
        public static void Main(string [] args)
        {
            // Parse the command line options
            bool      show_help  = false;
            OptionSet option_set = new OptionSet()
            {
                { "v|version", _("Print version information"), v => { PrintVersion(); } },
                { "h|help", _("Show this help text"), v => show_help = v != null }
            };

            try {
                option_set.Parse(args);
            } catch (OptionException e) {
                Console.Write("SparkleShare: ");
                Console.WriteLine(e.Message);
                Console.WriteLine("Try `sparkleshare --help' for more information.");
            }

            if (show_help)
            {
                ShowHelp(option_set);
            }


            // Only allow one instance of SparkleShare
            if (!ProgramMutex.WaitOne(0, false))
            {
                Console.WriteLine("SparkleShare is already running.");
                Environment.Exit(-1);
            }


            // Initialize the controller this way so that
            // there aren't any exceptions in the OS specific UI's
            Controller = new SparkleController();
            Controller.Initialize();

            if (Controller != null)
            {
                UI = new SparkleUI();
                UI.Run();
            }

            #if !__MonoCS__
            // Suppress assertion messages in debug mode
            GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced);
            GC.WaitForPendingFinalizers();
            #endif
        }
コード例 #6
0
ファイル: Program.cs プロジェクト: yiqideren/SparkleShare
        public static void Main(string [] args)
        {
            Arguments = args;

            if (args.Length != 0 && !args [0].Equals("help") &&
                SparkleBackend.Platform != PlatformID.MacOSX &&
                SparkleBackend.Platform != PlatformID.Win32NT)
            {
                string n = Environment.NewLine;

                Console.WriteLine(n +
                                  "Share and collaborate by syncing with any Git repository instantly." + n +
                                  n +
                                  "Version: " + SparkleLib.SparkleBackend.Version + n +
                                  "Copyright (C) 2010 Hylke Bons and others" + n +
                                  "This program comes with ABSOLUTELY NO WARRANTY." + n +
                                  n +
                                  "This is free software, and you are welcome to redistribute it" + n +
                                  "under certain conditions. Please read the GNU GPLv3 for details." + n +
                                  n +
                                  "Usage: sparkleshare [start|open]");

                Environment.Exit(-1);
            }

            // Only allow one instance of SparkleShare (on Windows)
            if (!program_mutex.WaitOne(0, false))
            {
                Console.WriteLine("SparkleShare is already running.");
                Environment.Exit(-1);
            }

            AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;

            Controller = new SparkleController();
            Controller.Initialize();

            UI = new SparkleUI();
            UI.Run();

            #if !__MonoCS__
            // Suppress assertion messages in debug mode
            GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced);
            GC.WaitForPendingFinalizers();
            #endif
        }
コード例 #7
0
ファイル: Program.cs プロジェクト: notox/SparkleShare
        public static void Main (string [] args)
        {
            // Parse the command line options
            bool show_help       = false;
            OptionSet option_set = new OptionSet () {
                { "v|version", _("Print version information"), v => { PrintVersion (); } },
                { "h|help", _("Show this help text"), v => show_help = v != null }
            };

            try {
                option_set.Parse (args);

            } catch (OptionException e) {
                Console.Write ("SparkleShare: ");
                Console.WriteLine (e.Message);
                Console.WriteLine ("Try `sparkleshare --help' for more information.");
            }

            if (show_help)
                ShowHelp (option_set);

			
			// Only allow one instance of SparkleShare
			if (!ProgramMutex.WaitOne (0, false)) {
				Console.WriteLine ("SparkleShare is already running.");
				Environment.Exit (-1);
			}
				
			
            // Initialize the controller this way so that
            // there aren't any exceptions in the OS specific UI's
            Controller = new SparkleController ();
            Controller.Initialize ();
        
            if (Controller != null) {
                UI = new SparkleUI ();
                UI.Run ();
            }
         
            #if !__MonoCS__
            // Suppress assertion messages in debug mode
            GC.Collect (GC.MaxGeneration, GCCollectionMode.Forced);
            GC.WaitForPendingFinalizers ();
            #endif
        }
コード例 #8
0
ファイル: Program.cs プロジェクト: rchicoli/sparkleshare
        public static void Main (string [] args)
        {
            Arguments = args;

            if (args.Length != 0 && !args [0].Equals ("help") &&
                SparkleBackend.Platform != PlatformID.MacOSX &&
                SparkleBackend.Platform != PlatformID.Win32NT) {

                string n = Environment.NewLine;

                Console.WriteLine (n +
                    "Share and collaborate by syncing with any Git repository instantly." + n +
                    n +
                    "Version: " + SparkleLib.SparkleBackend.Version + n +
                    "Copyright (C) 2010 Hylke Bons and others" + n +
                    "This program comes with ABSOLUTELY NO WARRANTY." + n +
                    n +
                    "This is free software, and you are welcome to redistribute it" + n +
                    "under certain conditions. Please read the GNU GPLv3 for details." + n +
                    n +
                    "Usage: sparkleshare [start|open]");

                Environment.Exit (-1);
            }

            // Only allow one instance of SparkleShare (on Windows)
            if (!program_mutex.WaitOne (0, false)) {
                Console.WriteLine ("SparkleShare is already running.");
                Environment.Exit (-1);
            }

            AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;

            Controller = new SparkleController ();
            Controller.Initialize ();

            UI = new SparkleUI ();
            UI.Run ();

            #if !__MonoCS__
            // Suppress assertion messages in debug mode
            GC.Collect (GC.MaxGeneration, GCCollectionMode.Forced);
            GC.WaitForPendingFinalizers ();
            #endif
        }
コード例 #9
0
ファイル: Program.cs プロジェクト: kkris/SparkleShare
        public static void Main(string [] args)
        {
            // Parse the command line options
            bool show_help       = false;
            OptionSet option_set = new OptionSet () {
                { "v|version", _("Print version information"), v => { PrintVersion (); } },
                { "h|help", _("Show this help text"), v => show_help = v != null }
            };

            try {
                option_set.Parse (args);

            } catch (OptionException e) {
                Console.Write ("SparkleShare: ");
                Console.WriteLine (e.Message);
                Console.WriteLine ("Try `sparkleshare --help' for more information.");
            }

            if (show_help)
                ShowHelp (option_set);

            // Load the right controller for the OS
            string controller_name = "Lin";
            switch (SparkleBackend.Platform) {
            case PlatformID.Unix:
                SetProcessName ("sparkleshare");
                break;
            case PlatformID.MacOSX:
                controller_name = "Mac";
                break;
            case PlatformID.Win32NT:
                controller_name = "Win";
                break;
            }

            // Initialize the controller this way so that
            // there aren't any exceptions in the OS specific UI's
            Controller = new SparkleMacController ();
            Controller.Initialize ();

            if (Controller != null) {
                UI = new SparkleUI ();
                UI.Run ();
            }
        }
コード例 #10
0
        public static void Main(string [] args)
        {
            if (args.Length != 0 && !args [0].Equals("start"))
            {
                Console.WriteLine(" ");
                Console.WriteLine("SparkleShare is a collaboration and sharing tool that is ");
                Console.WriteLine("designed to keep things simple and to stay out of your way.");
                Console.WriteLine(" ");
                Console.WriteLine("Version: " + SparkleLib.Defines.VERSION);
                Console.WriteLine("Copyright (C) 2010 Hylke Bons");
                Console.WriteLine(" ");
                Console.WriteLine("This program comes with ABSOLUTELY NO WARRANTY.");
                Console.WriteLine(" ");
                Console.WriteLine("This is free software, and you are welcome to redistribute it ");
                Console.WriteLine("under certain conditions. Please read the GNU GPLv3 for details.");
                Console.WriteLine(" ");
                Console.WriteLine("Usage: sparkleshare [start|stop|restart]");

                Environment.Exit(-1);
            }

            // Only allow one instance of SparkleShare (on Windows)
            if (!program_mutex.WaitOne(0, false))
            {
                Console.WriteLine("SparkleShare is already running.");
                Environment.Exit(-1);
            }

            // Initialize the controller this way so that
            // there aren't any exceptions in the OS specific UI's
            Controller = new SparkleController();
            Controller.Initialize();

            if (Controller != null)
            {
                UI = new SparkleUI();
                UI.Run();
            }

            #if !__MonoCS__
            // Suppress assertion messages in debug mode
            GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced);
            GC.WaitForPendingFinalizers();
            #endif
        }
コード例 #11
0
ファイル: Program.cs プロジェクト: resnostyle/SparkleShare
        public static void Main (string [] args)
        {
            if (args.Length != 0 && !args [0].Equals ("start")) {
                Console.WriteLine (" ");
                Console.WriteLine ("SparkleShare is a collaboration and sharing tool that is ");
                Console.WriteLine ("designed to keep things simple and to stay out of your way.");
                Console.WriteLine (" ");
                Console.WriteLine ("Version: " + SparkleLib.Defines.VERSION);
                Console.WriteLine ("Copyright (C) 2010 Hylke Bons");
                Console.WriteLine (" ");
                Console.WriteLine ("This program comes with ABSOLUTELY NO WARRANTY.");
                Console.WriteLine (" ");
                Console.WriteLine ("This is free software, and you are welcome to redistribute it ");
                Console.WriteLine ("under certain conditions. Please read the GNU GPLv3 for details.");
                Console.WriteLine (" ");
                Console.WriteLine ("Usage: sparkleshare [start|stop|restart]");

                Environment.Exit (-1);
            }
			
			// Only allow one instance of SparkleShare (on Windows)
			if (!program_mutex.WaitOne (0, false)) {
				Console.WriteLine ("SparkleShare is already running.");
				Environment.Exit (-1);
			}

            // Initialize the controller this way so that
            // there aren't any exceptions in the OS specific UI's
            Controller = new SparkleController ();
            Controller.Initialize ();
        
            if (Controller != null) {
                UI = new SparkleUI ();
                UI.Run ();
            }
         
            #if !__MonoCS__
            // Suppress assertion messages in debug mode
            GC.Collect (GC.MaxGeneration, GCCollectionMode.Forced);
            GC.WaitForPendingFinalizers ();
            #endif
        }
コード例 #12
0
        public static void Main (string [] args)
        {
            SetUiCulture();

            // Parse the command line options
            bool show_help       = false;
            OptionSet option_set = new OptionSet () {
                { "v|version", _("Print version information"), v => { PrintVersion (); } },
                { "h|help", _("Show this help text"), v => show_help = v != null }
            };

            try {
                option_set.Parse (args);

            } catch (OptionException e) {
                Console.Write ("SparkleShare: ");
                Console.WriteLine (e.Message);
                Console.WriteLine ("Try `sparkleshare --help' for more information.");
            }

            if (show_help)
                ShowHelp (option_set);


            // Initialize the controller this way so that
            // there aren't any exceptions in the OS specific UI's
            Controller = new SparkleController ();
            Controller.Initialize ();
        
            if (Controller != null) {
                UI = new SparkleUI ();
                UI.Run ();
            }

#if !__MonoCS__
            // For now we must do GC.Collect to free some internal handles, otherwise
            // in debug mode you can got assertion message.
            GC.Collect (GC.MaxGeneration, GCCollectionMode.Forced);
            GC.WaitForPendingFinalizers ();
            CefSharp.CEF.Shutdown ();    // Shutdown CEF.
#endif
        }