//Button Open Wizard private void Button_OpenFormSelectData(object sender, RoutedEventArgs e) { //Show Update Call Control this.FilterWords.Visibility = Visibility.Hidden; this.UpdateCall.Visibility = Visibility.Visible; this.UpdateCall.Content = Utils.DefaultUpdateControl(); //Get the File Path string FilePath = Directory.GetCurrentDirectory() + "/StorageTextToolbox/Infos/" + MyIDText + ".txt"; //Get Item from the ComboBox string MyEncoding = ReturnEncoding(); if (MyEncoding != null) { Encoding encoding = Utils.ConvertStringToEncoding(MyEncoding); string Source = System.IO.File.ReadAllText(FilePath, encoding); //Check if all Parameters are in the File string[] searchWords = { "FileName" + Utils.DefaultSeparator(), "Anchor Words Parameter" + Utils.DefaultSeparator() }; double PercResults = Utils.FindWordsInString(Source, searchWords, false); //Case it is found if (PercResults == 1) { //Get Current File FilePath = ReturnCurrentFile(); //Open Form Select Data DesignUtils.CallformSelectDataOpen(MyArgument, MyIDText, FilePath, MyIDText, encoding); } else { //Error Message MessageBox.Show("Please fill in all arguments", "Validation Error", MessageBoxButton.OK, MessageBoxImage.Error); } } else { //Error Message MessageBox.Show("Please fill in all arguments", "Validation Error", MessageBoxButton.OK, MessageBoxImage.Error); } }
//Button Open Wizard private void Button_OpenFormSelectData(object sender, RoutedEventArgs e) { //Show Update Call Control this.Words.Visibility = Visibility.Hidden; this.UpdateCall.Visibility = Visibility.Visible; this.UpdateCall.Content = Utils.DefaultUpdateControl(); //Get File Path string FilePath = System.IO.File.ReadAllText(Directory.GetCurrentDirectory() + "/StorageTextToolbox/CurrentFile.txt"); //Return IDText Parent string MyIDTextParent = DesignUtils.ReturnCurrentFileIDText(); //Get Encoding Encoding encoding = DesignUtils.GetEncodingIDText(MyIDTextParent); //Open Form Select Data DesignUtils.CallformSelectDataOpen(MyArgument, MyIDText, FilePath, MyIDTextParent, encoding); }