/// <summary> /// 打开编辑语言项的界面 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void dpEdit_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { if (App.GLstLanguageItemInEdit.Count <= 0) { MessageBox.Show(this.TryFindResource("SelectLanguage").ToString(), this.TryFindResource("ErrorMsgTitle").ToString(), MessageBoxButton.OK, MessageBoxImage.Error); return; } LanManagerWindow.spOperator.Children.RemoveAt(1); UC_EditLanguageItem uc_ExportLan = new UC_EditLanguageItem(LanManagerWindow, App.GLstLanguageItemInEdit); LanManagerWindow.dpDetail.Children.Clear(); LanManagerWindow.dpDetail.Children.Add(uc_ExportLan); UC_ConfirmEdit uc_confirmEdit = new UC_ConfirmEdit(LanManagerWindow); LanManagerWindow.spOperator.Children.Add(uc_confirmEdit); }
/// <summary> /// 将修改完成的语言整理成languageinfo类对象 便于传入wcf进行更新 /// </summary> /// <returns></returns> List <LanguageInfo> GetLanguagesEdited() { List <LanguageInfo> lstEditedLans = new List <LanguageInfo>(); UC_EditLanguageItem uc_EditLan = LanManagerWindow.dpDetail.Children[0] as UC_EditLanguageItem; if (uc_EditLan.spDisplayContent.Children.Count > 0) { TextBox txtDisPlay = null; LanguageInfo lan = null; TextBox txtTip = null; StackPanel spDis = null; for (int i = 0; i < uc_EditLan.spDisplayContent.Children.Count; i++) { spDis = uc_EditLan.spDisplayContent.Children[i] as StackPanel; if (spDis.Children.Count > 0) { for (int iChild = 0; iChild < spDis.Children.Count; iChild++) { try { txtDisPlay = spDis.Children[iChild] as TextBox; lan = new LanguageInfo(); lan.ChildModuleID = uc_EditLan.lblChildModuleID.Content.ToString(); lan.DisplayMessage = txtDisPlay.Text; lan.InFrame = uc_EditLan.lblInPageFrame.Content.ToString(); lan.InObject = null; lan.LanguageCode = txtDisPlay.Tag.ToString(); lan.MessageID = uc_EditLan.lblMessageID.Content.ToString(); lan.ModuleID = uc_EditLan.lblModuleID.Content.ToString(); //遍历spTipContet 根据lan.LanguageCode加载提示信息 StackPanel spTip = null; for (int j = 0; j < uc_EditLan.spTipContent.Children.Count; j++) { spTip = uc_EditLan.spTipContent.Children[j] as StackPanel; if (spTip.Children.Count > 0) { for (int jChild = 0; jChild < spTip.Children.Count; jChild++) { try { txtTip = spTip.Children[jChild] as TextBox; if (txtTip.Tag.ToString().Equals(lan.LanguageCode)) { lan.TipMessage = txtTip.Text; } } catch { continue; } } } } lstEditedLans.Add(lan); } catch { continue; } } } } } return(lstEditedLans); }