Ejemplo n.º 1
0
 void menuNew_Click(object sender, EventArgs e)
 {
     using (var saveDialog = new SimpleSaveDialog(string.Empty))
     {
         var result = saveDialog.ShowDialog();
         if (result == DialogResult.OK)
         {
             NewSettings(Path.Combine(SettingsFilePath, saveDialog.NewFileName) + ".conf");
         }
     }
 }
Ejemplo n.º 2
0
 void SaveSettingsAsMenuItem_Click(object sender, EventArgs e)
 {
     using (var saveDialog = new SimpleSaveDialog(string.Empty))
     {
         saveDialog.StartPosition = FormStartPosition.CenterParent;
         var result = saveDialog.ShowDialog();
         if (result == DialogResult.OK)
         {
             SaveSettings(Path.Combine(SettingsFilePath, saveDialog.NewFileName) + ".conf");
         }
     }
 }
Ejemplo n.º 3
0
 void menuClone_Click(object sender, EventArgs e)
 {
     using (var saveDialog = new SimpleSaveDialog(string.Empty))
     {
         var result = saveDialog.ShowDialog();
         if (result == DialogResult.OK)
         {
             CloneSettings(
                 ((ConfigEntry)lstConfigFiles.SelectedItem).Path,
                 Path.Combine(SettingsFilePath, saveDialog.NewFileName) + ".conf");
         }
     }
 }
Ejemplo n.º 4
0
        void renameToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string current  = ((ConfigEntry)lstConfigFiles.SelectedItem).Path;
            string fileName = Path.GetFileNameWithoutExtension(current);

            using (var saveDialog = new SimpleSaveDialog(fileName))
            {
                var result = saveDialog.ShowDialog();
                if (result == DialogResult.OK)
                {
                    string newPath = Path.Combine(SettingsFilePath, saveDialog.NewFileName) + ".conf";
                    RenameSettings(current, newPath);
                }
            }
        }