private void MoveMethodWindowButton_Click(object sender, RoutedEventArgs e) { var screen = new MoveMethodWindow(); if (screen.ShowDialog() == true) { var action = new MoveOperation() { Args = new MoveArgs() { From = MoveMethodWindow.moveNChars, To = MoveMethodWindow.fromto } }; actions.Add(action.Clone()); } }
private void LoadListMethods_Click(object sender, RoutedEventArgs e) { string text = ""; OpenFileDialog openFileDialog = new OpenFileDialog(); if (openFileDialog.ShowDialog() == true) { text = System.IO.File.ReadAllText(openFileDialog.FileName); string[] textpart = text.Split('\n'); int numberofMethods = int.Parse(textpart[0]); for (int i = 1; i <= numberofMethods; i++) { string[] textpartoftextpart = textpart[i].Split(' '); if (textpartoftextpart[0] == "Replace") { var action = new ReplaceOperation() { Args = new ReplaceArgs() { From = textpartoftextpart[1], To = textpartoftextpart[2] } }; actions.Add(action.Clone()); } if (textpartoftextpart[0] == "NewCase") { var action = new NewCaseOperation() { Args = new NewCaseArgs() { From = textpartoftextpart[1], To = textpartoftextpart[2] } }; actions.Add(action.Clone()); } if (textpartoftextpart[0] == "FullNameNormalize") { var action = new FullNameOperation() { Args = new FullNameArgs() { From = textpartoftextpart[1], To = textpartoftextpart[2] } }; actions.Add(action.Clone()); } if (textpartoftextpart[0] == "Move") { var action = new MoveOperation() { Args = new MoveArgs() { From = textpartoftextpart[1], To = textpartoftextpart[2] } }; actions.Add(action.Clone()); } if (textpartoftextpart[0] == "UniqueName") { var action = new UniqueNameOperation() { Args = new UniqueNameArgs() { From = textpartoftextpart[1], To = textpartoftextpart[2] } }; actions.Add(action.Clone()); } } } }