Exemplo n.º 1
0
        static void Main(string[] args)
        {
            //--
            //FutureDev: make sure user has sufficient priviledges to open files and run SUSHI.

            //--initialize settings
            SushiSettingsUtil.LoadSushiSettings();

            //--command line args
            parseArgs(args);
            if (GlobalVars.AutoStartBackup)
            {
                AutoBackup.StartBackup();
                return;
            }

            //--windows init stuff
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException); //note: don't want to add this handler when starting from commandline, because we don't want to try and show a message box.

            //--Splash screen
            //SplashScreen.Definstance = new SplashScreen();
            //SplashScreen.Definstance.Show();
            //Application.DoEvents();

            //--kick off main Form of SUSHI
            MainForm.DefInstance = new MainForm();
            Application.Run(MainForm.DefInstance);
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            //--
            //FutureDev: make sure user has sufficient priviledges to open files and run SUSHI.

            //--initialize settings
            SushiSettingsUtil.LoadSushiSettings();

            //--command line args
            parseArgs(args);
            if (GlobalVars.AutoStartBackup)
            {
                AutoBackup.StartBackup();
                return;
            }

            //--windows init stuff
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException); //note: don't want to add this handler when starting from commandline, because we don't want to try and show a message box.

            //--Splash screen
            //SplashScreen.Definstance = new SplashScreen();
            //SplashScreen.Definstance.Show();
            //Application.DoEvents();

            //Resolve Assemblies
            AppDomain.CurrentDomain.AssemblyResolve += (sender, e) =>
            {
                if (e.Name == "Microsoft.SharePoint")
                {
                    if (SharePointUtil.IsSharePoint2007InstalledLocally)
                    {
                        return(Assembly.Load("Microsoft.SharePoint, Version=12.0.0.0"));
                    }
                    else
                    if (SharePointUtil.IsSharePoint2010InstalledLocally)
                    {
                        return(Assembly.Load("Microsoft.SharePoint, Version=14.0.0.0"));
                    }
                    else
                    if (SharePointUtil.IsSharePoint2013InstalledLocally)
                    {
                        return(Assembly.Load("Microsoft.SharePoint, Version=15.0.0.0"));
                    }
                    else
                    {
                        throw new Exception("SharePoint is not installed.  You must run SUSHI locally from a machine that has SharePoint installed.");
                    }
                }
                else
                {
                    return(null);
                }
            };

            //--kick off main Form of SUSHI
            MainForm.DefInstance = new MainForm();
            Application.Run(MainForm.DefInstance);
        }
Exemplo n.º 3
0
 internal static void SaveSettingsPlease()
 {
     try
     {
         MainForm.DefInstance.Cursor = Cursors.WaitCursor;
         SushiSettingsUtil.SaveSushiSettings();
     }
     finally { MainForm.DefInstance.Cursor = Cursors.Default; }
 }