public void TestInitiation() { Xml = new ExEmEl(@"C:\Users\jogo\Documents\git_Test\HWLogCriteria.xml", ExEmEl.NewDocument.No); Info = new Information(); TextBoxAppearance TextBoxInfo = new TextBoxAppearance(); ChoicActMain = new ChoiceActions() { TextBoxInfo = TextBoxInfo }; TextBlockSettings = new ViewSettings(); }
public Controls(ExEmEl xml = null) { XmlFile = xml; GetType().GetProperties().ToList(). Where(prop => prop.PropertyType == typeof(AppearanceSettings)). Where(prop => (AppearanceSettings)prop.GetValue(this) != null).ToList(). ForEach(prop => prop.GetValue(this).GetType().GetProperties(). Where(subprop => subprop.GetValue(prop.GetValue(this)) != null). Where(subprop => subprop.Name.Equals("NameProp")).ToList(). ForEach(subprop => subprop.SetValue(prop.GetValue(this), prop.Name))); }
public void PerformInitiliazation() { var hWLogCritStream = Assembly.GetAssembly(typeof(LogAnalyzer)).GetManifestResourceStream("Ericsson.AM.LogAnalyzer.EmbeddedCriteria.RBS6000.Aftermarket.HWLogCriteria.xml"); if (hWLogCritStream != null) { var filepath = @"C:\Users\jogo\Gitrepos\LogAnalyzerRepo\LogAnalyzer\Ericsson.AM.LogAnalyzer\EmbeddedCriteria\RBS6000\Aftermarket/HWLogCriteria.xml"; Xml = new ExEmEl(filepath: filepath, stream: hWLogCritStream, yesorno: ExEmEl.NewDocument.No); var revision = Xml.XDoc.XPathSelectElement("*//Revision").Value; MessageBox.Show($"The criteria to be used has revision: {revision}", "Information", MessageBoxButton.OK, MessageBoxImage.Information); } else { MessageBox.Show($"Please browse the HWLogCriteria.xml file directory in which changes are to be saved", "Information", MessageBoxButton.OK, MessageBoxImage.Information); var dialog = new System.Windows.Forms.FolderBrowserDialog(); dialog.SelectedPath = @"C:\Users\jogo\Gitrepos\LogAnalyzerRepo\LogAnalyzer\Ericsson.AM.LogAnalyzer\EmbeddedCriteria\RBS6000\Aftermarket"; dialog.ShowDialog(); var filepath = dialog.SelectedPath + "\\HWLogCriteria.xml"; Xml = new ExEmEl(filepath, yesorno: ExEmEl.NewDocument.No); if (string.IsNullOrEmpty(dialog.SelectedPath)) { System.Windows.Application.Current.Shutdown(); } } var ControlInfo = new Controls(Xml); Main.DataContext = ControlInfo; CreateTreeDict Dict = new CreateTreeDict() { Information = ControlInfo }; AllWind = new AllWindows { ExWindow = ExWindow, ProdWindow = ProdWindow, InfoTextWin = InfoTextWin, Main = Main }; ChoicAct = new ChoiceActions() { ControlInfo = ControlInfo, Dict = Dict, AllWind = AllWind, Xml = Xml }; Main.KeyDown += (s, e) => { if (e.Key == System.Windows.Input.Key.Enter) { ControlInfo.SearchKey.Text = ControlInfo.SearchKey.ItemsSource.Any(item => item.Contains(ControlInfo.SearchKey.Text)) ? ControlInfo.SearchKey.ItemsSource.FirstOrDefault(item => item.Contains(ControlInfo.SearchKey.Text)) : ControlInfo.SearchKey.Text; } }; }