Ejemplo n.º 1
0
        private void btnSavePreset_Click(object sender, RoutedEventArgs e)
        {
            var screen = new FillinFileNameDialog();

            if (screen.ShowDialog() == true)
            {
                var filename = screen.FileName + ".txt";
                var writer   = new StreamWriter(filename);

                foreach (StringOperation action in ActionListBox.Items)
                {
                    switch (action.Name)
                    {
                    case "Replace":
                    {
                        ReplaceArgs temp = action.Args as ReplaceArgs;
                        writer.WriteLine($"{action.Name}|{temp.From}|{temp.To}");
                        break;
                    }

                    case "NewCase":
                    {
                        NewCaseArgs temp = action.Args as NewCaseArgs;
                        writer.WriteLine($"{action.Name}|{temp.From}");
                        break;
                    }

                    case "Fullname Normalize":
                    {
                        FullnameNormalizeArgs temp = action.Args as FullnameNormalizeArgs;
                        writer.WriteLine($"{action.Name}|{temp.From}");
                        break;
                    }

                    case "Move":
                    {
                        MoveArgs temp = action.Args as MoveArgs;
                        writer.WriteLine($"{action.Name}|{temp.From}");
                        break;
                    }
                    }
                }
                writer.Close();
                loadPresetFile();
            }
        }
 public FullnameNormalizeDialog(FullnameNormalizeArgs args)
 {
     InitializeComponent();
     args.From = From;
 }