//Anchor Text After Update Event private void AnchorTextParamComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { //Update IDText UpdateIDText(); Encoding encoding = Encoding.Default; //Return IDText Parent string MyIDTextParent = DesignUtils.ReturnCurrentFileIDText(); if (MyIDTextParent != null) { //Get Encoding encoding = DesignUtils.GetEncodingIDText(MyIDTextParent); //Fill in Global Variable MyArgument = "Anchor Words Parameter"; //Get ITem from the ComboBox string MyAnchorTextParamComboBox = this.AnchorTextParamComboBox.SelectedItem.ToString(); //Log ComboBox DesignUtils.CallLogComboBox(MyIDText, MyArgument, MyAnchorTextParamComboBox, encoding); } }
//Auto Fill Controls public void AutoFillControls() { //Check if File Exists, if not create it //Get the File Path string FilePath = Directory.GetCurrentDirectory() + "/StorageTextToolbox/Infos/" + MyIDText + ".txt"; //If false create it if (File.Exists(FilePath) == false) { //Create File System.IO.File.WriteAllText(FilePath, ""); } #region Encoding string MyArgument = "Encoding"; //Get Item from the ComboBox string MyEncoding = ReturnEncoding(); if (MyEncoding != null) { Encoding encoding = Utils.ConvertStringToEncoding(MyEncoding); //Log ComboBox DesignUtils.CallLogComboBox(MyIDText, MyArgument, MyEncoding, encoding); #region File Name //Copy the Arguments, in case there is string FilePathPreview = ReturnCurrentFile(); if (FilePathPreview != null) { //Update Text File Row Argument DesignUtils.CallUpdateTextFileRowArgument(FilePath, "FileName", FilePathPreview, encoding); } #endregion } #endregion }
//Occurences Update Event private void OccurrencesComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { Encoding encoding = Encoding.Default; //Return IDText Parent string MyIDTextParent = DesignUtils.ReturnCurrentFileIDText(); //Get Encoding encoding = DesignUtils.GetEncodingIDText(MyIDTextParent); //Update IDText UpdateIDText(); string MyOccurenceParameter = null; //Fill in Global Variable MyArgument = "Occurence Parameter"; //Get IDText, if there is MyIDText = ReturnIDText(); //Get item from the ComboBox MyOccurenceParameter = (string)OccurrencesComboBox.SelectedValue; //Log ComboBox DesignUtils.CallLogComboBox(MyIDText, MyArgument, MyOccurenceParameter, encoding); //Hide / Display Occurence Number Control if (MyOccurenceParameter == "Custom") { //Visible this.OccurrenceNumber.Visibility = Visibility.Visible; } else { //Hidden this.OccurrenceNumber.Visibility = Visibility.Collapsed; //Clear Field Value ModelProperty property = this.ModelItem.Properties["OccurrenceNumber"]; property.SetValue(null); } }