Beispiel #1
0
        public static void Main (string [] args)
        {
            Arguments = args;

            if (args.Length != 0 && (args [0].Equals ("help") || args [0].Equals ("version")) &&
                InstallationInfo.OperatingSystem != OS.Mac &&
                InstallationInfo.OperatingSystem != OS.Windows) {

                string n = Environment.NewLine;

                Console.WriteLine (n +
                    "Share and collaborate by syncing with any Git repository instantly." + n +
                    n +
                   "Version: " + InstallationInfo.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);

                Environment.Exit (0);
            }

            // 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 Controller ();
            Controller.Initialize ();

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

            #if !__MonoCS__
            // Suppress assertion messages in debug mode
            GC.Collect (GC.MaxGeneration, GCCollectionMode.Forced);
            GC.WaitForPendingFinalizers ();
            #endif
        }