private void OnFormLoad(object sender, EventArgs e) { this.Text += " " + PwDefs.VersionString; m_trl.Forms = FormTrlMgr.CreateListOfCurrentVersion(); m_rtbUnusedText.SimpleTextOnly = true; string strSearchTr = ((WinUtil.IsAtLeastWindowsVista ? string.Empty : " ") + "Search in active tab..."); UIUtil.SetCueBanner(m_tbFind, strSearchTr); this.CreateStringTableUI(); this.UpdateControlTree(); if (m_tvControls.SelectedNode == null) { m_tvControls.SelectedNode = m_tvControls.Nodes[0]; } UpdatePreviewForm(); m_prev.Show(); try { this.DoubleBuffered = true; } catch (Exception) { Debug.Assert(false); } UpdateUIState(); }
private void OnFormLoad(object sender, EventArgs e) { m_trl.Forms = FormTrlMgr.CreateListOfCurrentVersion(); this.CreateStringTableUI(); this.UpdateControlTree(); if (m_tvControls.SelectedNode == null) { m_tvControls.SelectedNode = m_tvControls.Nodes[0]; } UpdatePreviewForm(); m_prev.Show(); }
private void OnFileOpen(object sender, EventArgs e) { OpenFileDialogEx ofd = UIUtil.CreateOpenFileDialog("Open KeePass Translation", m_strFileFilter, 1, null, false, AppDefs.FileDialogContext.Attachments); if (ofd.ShowDialog() != DialogResult.OK) { return; } KPTranslation kpTrl = null; try { XmlSerializerEx xs = new XmlSerializerEx(typeof(KPTranslation)); kpTrl = KPTranslation.LoadFromFile(ofd.FileName, xs); } catch (Exception ex) { MessageBox.Show(this, ex.Message, TrlUtilName, MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } m_strFile = ofd.FileName; StringBuilder sbUnusedText = new StringBuilder(); if (kpTrl.UnusedText.Length > 0) { if (kpTrl.UnusedText.EndsWith("\r") || kpTrl.UnusedText.EndsWith("\n")) { sbUnusedText.Append(kpTrl.UnusedText); } else { sbUnusedText.AppendLine(kpTrl.UnusedText); } } m_trl.Properties = kpTrl.Properties; foreach (KPStringTable kpstNew in kpTrl.StringTables) { foreach (KPStringTable kpstInto in m_trl.StringTables) { if (kpstInto.Name == kpstNew.Name) { MergeInStringTable(kpstInto, kpstNew, sbUnusedText); } } } FormTrlMgr.MergeForms(m_trl.Forms, kpTrl.Forms, sbUnusedText); m_tbNameEng.Text = m_trl.Properties.NameEnglish; m_tbNameLcl.Text = m_trl.Properties.NameNative; m_tbLangID.Text = m_trl.Properties.Iso6391Code; m_tbAuthorName.Text = m_trl.Properties.AuthorName; m_tbAuthorContact.Text = m_trl.Properties.AuthorContact; m_cbRtl.Checked = m_trl.Properties.RightToLeft; m_rtbUnusedText.Text = sbUnusedText.ToString(); this.UpdateStringTableUI(); this.UpdateStatusImages(null); this.UpdatePreviewForm(); }
private void UpdateControlTree() { FormTrlMgr.RenderToTreeControl(m_trl.Forms, m_tvControls); UpdateStatusImages(null); }