private void Window_Loaded(object sender, RoutedEventArgs e) { if (video != null) { txtName.Text = _proxy.GetItemProperty(Convert.ToInt32(video), EngServRef.ServerData.Video, EngServRef.PropertyData.Name); txtDesc.Text = _proxy.GetItemProperty(Convert.ToInt32(video), EngServRef.ServerData.Video, EngServRef.PropertyData.Description); txtPath.Text = _proxy.GetItemProperty(Convert.ToInt32(video), EngServRef.ServerData.Video, EngServRef.PropertyData.Path); txtSubs.Text = _proxy.GetItemProperty(Convert.ToInt32(video), EngServRef.ServerData.Video, EngServRef.PropertyData.SubPath); if (_proxy.GetItemProperty(Convert.ToInt32(video), EngServRef.ServerData.Video, EngServRef.PropertyData.Year) != null) { txtYear.Text = _proxy.GetItemProperty(Convert.ToInt32(video), EngServRef.ServerData.Video, EngServRef.PropertyData.Year).ToString(); } chCopy.IsChecked = !_proxy.CheckAbsolute(Convert.ToInt32(video), EngServRef.ServerData.Video); string imgPath = _proxy.GetItemProperty(Convert.ToInt32(video), EngServRef.ServerData.Video, EngServRef.PropertyData.Imgpath); if (imgPath == "WolfV.png") { FormData.SetImage("pack://*****:*****@"Temp\VideoImages\{imgPath}")) { FormData.SetImage($@"pack://siteoforigin:,,,/Temp\VideoImages\{imgPath}", imDrag); } else { MessageBox.Show("Image can not be found!", "Something went wrong", MessageBoxButton.OK, MessageBoxImage.Error); } } lPath.Content = "..."; stRating.Visibility = Visibility.Collapsed; FillCategories(new List <int>(_proxy.GetItemData(Convert.ToInt32(video), EngServRef.ServerData.Video, EngServRef.ServerData.VideoCategory))); } }
//Fill listboxes. private void Window_Loaded(object sender, RoutedEventArgs e) { if (grammarId != null) { txtDescription.Text = _proxy.GetItemProperty(Convert.ToInt32(grammarId), EngServRef.ServerData.Grammar, EngServRef.PropertyData.Description); if (_proxy.GetItemData(Convert.ToInt32(grammarId), EngServRef.ServerData.Grammar, EngServRef.ServerData.Rule) != null) { FillRules(new List <int>(_proxy.GetItemData(Convert.ToInt32(grammarId), EngServRef.ServerData.Grammar, EngServRef.ServerData.Rule))); } if (_proxy.GetItemData(Convert.ToInt32(grammarId), EngServRef.ServerData.Grammar, EngServRef.ServerData.GrammarException) != null) { FillExceptions(new List <int>(_proxy.GetItemData(Convert.ToInt32(grammarId), EngServRef.ServerData.Grammar, EngServRef.ServerData.GrammarException))); } if (_proxy.GetItemData(Convert.ToInt32(grammarId), EngServRef.ServerData.Grammar, EngServRef.ServerData.GrammarExample) != null) { FillExamples(new List <int>(_proxy.GetItemData(Convert.ToInt32(grammarId), EngServRef.ServerData.Grammar, EngServRef.ServerData.GrammarExample))); } } }
//Fill listboxes. private void Window_Loaded(object sender, RoutedEventArgs e) { int role = Convert.ToInt32(_proxy.GetItemProperty(user, EngServRef.ServerData.User, EngServRef.PropertyData.Role)); if (name != null) { txtName.Text = name; } if (editForm) { string plural = _proxy.GetItemProperty(wordsId, EngServRef.ServerData.Word, EngServRef.PropertyData.PluralForm); string past = _proxy.GetItemProperty(wordsId, EngServRef.ServerData.Word, EngServRef.PropertyData.PastForm); string pastTh = _proxy.GetItemProperty(wordsId, EngServRef.ServerData.Word, EngServRef.PropertyData.PastThForm); if (plural != null) { grForm.Visibility = Visibility.Visible; stPlural.Visibility = Visibility.Visible; txtPlural.Text = plural; } if (past != null) { grForm.Visibility = Visibility.Visible; stPast.Visibility = Visibility.Visible; txtPast.Text = past; } if (pastTh != null) { grForm.Visibility = Visibility.Visible; stPastParticiple.Visibility = Visibility.Visible; txtPastTh.Text = pastTh; } int tran = Convert.ToInt32(_proxy.GetItemProperty(wordsId, EngServRef.ServerData.Word, EngServRef.PropertyData.Transcription)); if (tran != 0) { txtAmerican.Text = _proxy.GetItemProperty(tran, EngServRef.ServerData.Transcription, EngServRef.PropertyData.American); txtBritish.Text = _proxy.GetItemProperty(tran, EngServRef.ServerData.Transcription, EngServRef.PropertyData.British); txtCanadian.Text = _proxy.GetItemProperty(tran, EngServRef.ServerData.Transcription, EngServRef.PropertyData.Canadian); txtAustralian.Text = _proxy.GetItemProperty(tran, EngServRef.ServerData.Transcription, EngServRef.PropertyData.Australian); } string imgPath = _proxy.GetItemProperty(wordsId, EngServRef.ServerData.Word, EngServRef.PropertyData.Imgpath); if (imgPath != null) { if (File.Exists($@"Temp\WordImages\{imgPath}")) { FormData.SetImage($@"pack://siteoforigin:,,,/Temp\WordImages\{imgPath}", imDrag); } } FillExamples(new List <int>(_proxy.GetItemData(wordsId, EngServRef.ServerData.Word, EngServRef.ServerData.Example))); FillDefinitions(new List <int>(_proxy.GetItemData(wordsId, EngServRef.ServerData.Word, EngServRef.ServerData.Definition))); FillTranslations(new List <int>(_proxy.GetItemData(wordsId, EngServRef.ServerData.Word, EngServRef.ServerData.Translation))); } if (_proxy.GetItemProperty(role, EngServRef.ServerData.Role, EngServRef.PropertyData.Name) == "admin") { if (!editForm) { FillGroups(); } else { List <int> groups = new List <int>(_proxy.GetItemData(wordsId, EngServRef.ServerData.Word, EngServRef.ServerData.Group)); FillGroups(groups); } stGroups.Visibility = Visibility.Visible; } if (!editForm) { FillCategories(); } else { List <int> categories = new List <int>(_proxy.GetItemData(wordsId, EngServRef.ServerData.Word, EngServRef.ServerData.WordCategory)); FillCategories(categories); } }