Exemplo n.º 1
0
        private void browseWithCheckBox_CheckedChanged(object sender, EventArgs e)
        {
            if (settingsStarted)
            {
                try
                {
                    if (browseWithCheckBox.Checked)
                    {
                        Registry.SetValue("HKEY_CLASSES_ROOT\\Directory\\Background\\shell\\QuickPictureViewer", "", "Browse folder with Quick Picture Viewer");
                        Registry.SetValue("HKEY_CLASSES_ROOT\\Directory\\Background\\shell\\QuickPictureViewer", "Icon", string.Format("\"{0}picture.ico\"", AppDomain.CurrentDomain.BaseDirectory));
                        Registry.SetValue("HKEY_CLASSES_ROOT\\Directory\\Background\\shell\\QuickPictureViewer\\command", "", string.Format("\"{0}quick-picture-viewer.exe\" \"%V\"", AppDomain.CurrentDomain.BaseDirectory));

                        Registry.SetValue("HKEY_CLASSES_ROOT\\Directory\\shell\\QuickPictureViewer", "", "Browse folder with Quick Picture Viewer");
                        Registry.SetValue("HKEY_CLASSES_ROOT\\Directory\\shell\\QuickPictureViewer", "Icon", string.Format("\"{0}picture.ico\"", AppDomain.CurrentDomain.BaseDirectory));
                        Registry.SetValue("HKEY_CLASSES_ROOT\\Directory\\shell\\QuickPictureViewer\\command", "", string.Format("\"{0}quick-picture-viewer.exe\" \"%V\"", AppDomain.CurrentDomain.BaseDirectory));
                    }
                    else
                    {
                        RegistryKey RegKey = Registry.ClassesRoot.OpenSubKey("Directory\\Background\\shell\\QuickPictureViewer", true);
                        RegKey.DeleteSubKeyTree("");
                        RegistryKey RegKey2 = Registry.ClassesRoot.OpenSubKey("Directory\\shell\\QuickPictureViewer", true);
                        RegKey2.DeleteSubKeyTree("");
                    }
                }
                catch
                {
                    settingsStarted = false;
                    DialogMan.ShowInfo(
                        this,
                        LangMan.Get("context-menu-notice"),
                        LangMan.Get("error"),
                        DarkMode,
                        TopMost
                        );
                    browseWithCheckBox.Checked = !browseWithCheckBox.Checked;
                    settingsStarted            = true;
                }
            }
        }
Exemplo n.º 2
0
        private void langComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (settingsStarted)
            {
                Properties.Settings.Default.Language = languages[langComboBox.SelectedIndex].Code;
                Properties.Settings.Default.Save();
            }

            if (owner != null)
            {
                if (languages[langComboBox.SelectedIndex].Beta && settingsStarted)
                {
                    DialogMan.ShowInfo(
                        owner.resMan.GetString("beta-lang-warning"),
                        owner.resMan.GetString("warning") + " - " + langComboBox.Items[langComboBox.SelectedIndex].ToString(),
                        darkMode
                        );
                }

                translateAuthorsPanel.Controls.Clear();
                translateAuthorsPanel.Left = translatedByLabel.Location.X + translatedByLabel.Width;

                int curX = 0;
                for (int i = 0; i < languages[langComboBox.SelectedIndex].Authors.Length; i++)
                {
                    LinkLabel ll = new LinkLabel();
                    ll.AutoSize  = true;
                    ll.Text      = languages[langComboBox.SelectedIndex].Authors[i];
                    ll.LinkColor = ThemeManager.AccentColor;
                    ll.Margin    = new Padding(0, 0, 0, 0);
                    ll.Click    += Ll_Click;
                    translateAuthorsPanel.Controls.Add(ll);
                    ll.Left = curX;
                    curX   += ll.Width;
                }
            }
        }