private void ComponentsOut(string serach) { SelectedComp.Content = "Выбранный компонент:"; CompName.Content = serach; DescComponent.Document.Blocks.Clear(); PropNames.Items.Clear(); Dictionary <int, Dictionary <string, object> > info = cmp.SelectWhere("comp_name", serach); //PicComponent.Source = new BitmapImage(new Uri($"{new Constants.Constants().APP_PATH}\\pictures\\{info[0]["comp_pic"]}.jpg", UriKind.Relative)); PicComponent.Source = new ImageSourceConverter().ConvertFromString($"{new Constants.Constants().APP_PATH}\\pictures\\{info[0]["comp_pic"]}.jpg") as ImageSource; MemoryStream stream = new MemoryStream(UTF8Encoding.Default.GetBytes(info[0]["comp_desc"].ToString())); DescComponent.Selection.Load(stream, DataFormats.Rtf); PropNames.Visibility = Visibility.Hidden; if (info[0]["comp_proporties"].ToString() != "") { PropNames.Visibility = Visibility.Visible; string[] props = info[0]["comp_proporties"].ToString().Split('|'); foreach (string prop in props) { PropNames.Items.Add(prop); } } }
//люблю тебя <3 private void SelectLang_SelectionChanged(object sender, SelectionChangedEventArgs e) { //CompName.Content = SelectComponent.SelectedItem.ToString(); SelectedLang.Content = string.Format("Выбранный язык: {0}", SelectLang.SelectedItem.ToString()); CodeListing.Document.Blocks.Clear(); Dictionary <int, Dictionary <string, object> > info = cmp.SelectWhere("lang_name", SelectLang.SelectedItem.ToString(), "Language"); MemoryStream stream = new MemoryStream(UTF8Encoding.Default.GetBytes(info[0]["lang_listing"].ToString())); CodeListing.Selection.Load(stream, DataFormats.Rtf); LangDesc.Document = new FlowDocument(new Paragraph(new Run(info[0]["lang_desc"].ToString()))); }