Exemple #1
0
 void ConfigureShellExtensions()
 {
     string homeDir = CSScriptInstaller.GetEnvironmentVariable("CSSCRIPT_DIR");
     if (homeDir != null)
     {
         try
         {
             using (CSSScript.ShellExForm f = new CSSScript.ShellExForm())
             {
                 if (DialogResult.OK == f.ShowDialog())
                     configForm.RefreshTreeView();
             }
         }
         catch (Exception ex) { MessageBox.Show(ex.Message); }
     }
 }
Exemple #2
0
        private void ConfigForm_Load(object sender, EventArgs e)
        {
            SetForegroundWindow(this.Handle);
            SetActiveWindow(this.Handle);
            Environment.SetEnvironmentVariable("ConfigConsoleLoaded", "true"); //loosely coupled notification as the progress SplashScreen can be in another assembly

            //SplashScreen.HideSplash();
            advancedShellEx.Checked = CSScriptInstaller.IsComShellExtInstalled();
            allFilesAdvancedShellEx.Checked = CSScriptInstaller.IsComShellExtInstalledForAllFiles();
            allFilesAdvancedShellEx.Enabled = advancedShellEx.Checked;

            if (CSScriptInstaller.IsLightVersion)
                tabControl2.TabPages.RemoveAt(0);

            initialised = true;
            configForm = new CSSScript.ShellExForm(true);
            configForm.FormBorderStyle = FormBorderStyle.None;
            configForm.TopLevel = false;
            configForm.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
            configForm.Parent = tabPage5;
            configForm.Size = tabPage5.Size;
            configForm.Left = tabPage5.Left;
            configForm.Top += advancedShellEx.Top + advancedShellEx.Height + 20;
            configForm.Height -= advancedShellEx.Top + advancedShellEx.Height + 35;
            configForm.Width -= advancedShellEx.Left;
            configForm.Visible = true;
            configForm.additionalOnCheckHandler = new TreeViewEventHandler(OnCheckHandler);

            RerfreshFileIcon();

            //repareBtn.Visible = !CSScriptInstaller.IsFileAssosiationOk();
            try
            {
                var resources = new ResourceManager("images", Assembly.GetExecutingAssembly());

                string imgFile = Path.Combine(CSScriptInstaller.GetEnvironmentVariable("CSSCRIPT_DIR"), @"Lib\Donate.png");

                if (File.Exists(imgFile))
                    donateBtn.BackgroundImage = Bitmap.FromFile(imgFile);
                else
                    donateBtn.BackgroundImage = (Bitmap)resources.GetObject("donate.png");

                //donateBtn.BackgroundImageLayout = ImageLayout.Center; //will fail under 1.1
                donateBtn.Width = donateBtn.BackgroundImage.Width + 5;
                donateBtn.Height = donateBtn.BackgroundImage.Height + 5;
                donateBtn.Text = "";

                imgFile = Path.Combine(CSScriptInstaller.GetEnvironmentVariable("CSSCRIPT_DIR"), @"Lib\css_logo_256x256.png");
                if (File.Exists(imgFile))
                    pictureBox1.Image = Image.FromFile(imgFile);
                else
                    pictureBox1.Image = (Bitmap)resources.GetObject("css_logo_256x256.png");
                pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
            }
            catch { }

            doubleClickAction.Items.Add(doubleClickRunAction);
            doubleClickAction.Items.Add(doubleClickOpenWithAction);
            doubleClickAction.Items.Add(doubleClickSysDefaultAction);

            string nppPath = CSScriptInstaller.GetNotepadPP();
            if (nppPath != null)
            {
                doubleClickAction.Items.Insert(0, "\"" + nppPath + "\" \"%1\"");
            }

            CSScriptInstaller.ValidateShellExtensionsCompatibility();
        }
Exemple #3
0
        private void ConfigForm_Load(object sender, EventArgs e)
        {
            Environment.SetEnvironmentVariable("ConfigConsoleLoaded", "true"); //loosely coupled notification as the progress SplashScreen can be n another allsembly
            //SplashScreen.HideSplash();

            advancedShellEx.Checked = CSScriptInstaller.IsComShellExtInstalled();
            initialised = true;
            configForm = new CSSScript.ShellExForm(true);
            configForm.FormBorderStyle = FormBorderStyle.None;
            configForm.TopLevel = false;
            configForm.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
            configForm.Parent = tabPage5;
            configForm.Size = tabPage5.Size;
            configForm.Left = tabPage5.Left;
            configForm.Top += advancedShellEx.Top + advancedShellEx.Height + 5;
            configForm.Height -= advancedShellEx.Top + advancedShellEx.Height + 10;
            configForm.Width -= advancedShellEx.Left;
            configForm.Visible = true;
            configForm.additionalOnCheckHandler = new TreeViewEventHandler(OnCheckHandler);

            RerfreshFileIcon();

            //repareBtn.Visible = !CSScriptInstaller.IsFileAssosiationOk();
            try
            {
                donateBtn.BackgroundImage = Bitmap.FromFile(Path.Combine(CSScriptInstaller.GetEnvironmentVariable("CSSCRIPT_DIR"), @"Lib\Donate.png"));
                //donateBtn.BackgroundImageLayout = ImageLayout.Center; //will fail under 1.1
                donateBtn.Width = donateBtn.BackgroundImage.Width + 5;
                donateBtn.Height = donateBtn.BackgroundImage.Height + 5;
                donateBtn.Text = "";
            }
            catch { }

            doubleClickAction.Items.Add(doubleClickRunAction);
            doubleClickAction.Items.Add(doubleClickOpenWithAction);
            doubleClickAction.Items.Add(doubleClickSysDefaultAction);

            string nppPath = CSScriptInstaller.GetNotepadPP();
            if (nppPath != null)
            {
                doubleClickAction.Items.Insert(0, "\"" + nppPath + "\" \"%1\"");
            }
        }
Exemple #4
0
 private void configureShellExt_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     string homeDir = CSScriptInstaller.GetEnvironmentVariable("CSSCRIPT_DIR");
     if (homeDir != null)
     {
         try
         {
             using (CSSScript.ShellExForm f = new CSSScript.ShellExForm())
             {
                 if (DialogResult.OK == f.ShowDialog())
                     configForm.RefreshTreeView();
             }
         }
         catch (Exception ex) { MessageBox.Show(ex.Message); }
     }
 }
Exemple #5
0
 private void OnCheckHandler(object o, TreeViewEventArgs arg)
 {
     //MessageBox.Show("If you want to modify menu item click 'Configure Shell Extension' link.");
     using (Form f = new CSSScript.ShellExForm())
         f.ShowDialog();
 }