Ejemplo n.º 1
0
        private void AE_Click(object sender, EventArgs e)
        {
            if (Control.ModifierKeys == Keys.Shift)
            {
                String Program = null;
                ShowInputDialog(ref Program);
                if (Program != null || Program != "")
                {
                    ProgramsList.Items.Add(Program);
                    SaveList();
                }
            }
            else
            {
                AddAllowedProgram.InitialDirectory = Properties.Settings.Default.LastBrowserPath;
                AddAllowedProgram.FileName         = "";

                if (AddAllowedProgram.ShowDialog() == DialogResult.OK)
                {
                    foreach (string str in AddAllowedProgram.FileNames)
                    {
                        ProgramsList.Items.Add(str);
                    }

                    Properties.Settings.Default.LastBrowserPath = Path.GetDirectoryName(AddAllowedProgram.FileNames[0]);
                    Properties.Settings.Default.Save();
                    SaveList();
                }
            }
        }
Ejemplo n.º 2
0
 private void AE_Click(object sender, EventArgs e)
 {
     if (Control.ModifierKeys == Keys.Shift)
     {
         String Program = null;
         ShowInputDialog(ref Program);
         if (Program != null || Program != "")
         {
             ProgramsList.Items.Add(Program);
             SaveList();
         }
     }
     else
     {
         AddAllowedProgram.FileName = "";
         if (AddAllowedProgram.ShowDialog() == DialogResult.OK)
         {
             foreach (string str in AddAllowedProgram.FileNames)
             {
                 RegistryKey SynthPaths = Registry.CurrentUser.OpenSubKey("SOFTWARE\\OmniMIDI\\Paths", true);
                 LastBrowserPath = Path.GetDirectoryName(str);
                 SynthPaths.SetValue("lastpathrivatunerosd", LastBrowserPath, RegistryValueKind.String);
                 SynthPaths.Close();
                 ProgramsList.Items.Add(str);
             }
             SaveList();
         }
     }
 }