SparkleShare.SparkleController.Initialize C# (CSharp) Method

Initialize() public method

public Initialize ( ) : void
return void
        public override void Initialize()
        {
            // Add msysgit to path, as we cannot asume it is added to the path
            // Asume it is installed in @"<exec dir>\msysgit\bin"
            string executable_path = Path.GetDirectoryName (Forms.Application.ExecutablePath);
            string msysgit_path    = Path.Combine (executable_path, "msysgit");

            string new_PATH = msysgit_path + @"\bin" + ";" +
                msysgit_path + @"\mingw\bin" + ";" +
                msysgit_path + @"\cmd" + ";" +
                Environment.ExpandEnvironmentVariables ("%PATH%");

            Environment.SetEnvironmentVariable ("PATH", new_PATH);
            Environment.SetEnvironmentVariable ("HOME", Environment.GetFolderPath (Environment.SpecialFolder.UserProfile));

            Sparkles.Git.SparkleGit.SSHPath = Path.Combine (msysgit_path, "bin", "ssh.exe");

            base.Initialize ();
        }

Usage Example

Ejemplo n.º 1
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 ();
            }
        }
All Usage Examples Of SparkleShare.SparkleController::Initialize