public void ValidateMatchedPairs_InvalidEntries() { PunctuationDlg punctDlg = new PunctuationDlg(); MatchedPairList pairList = new MatchedPairList(); MatchedPair pair = new MatchedPair(); pair.Close = ")"; pairList.Add(pair); bool result = ReflectionHelper.GetBoolResult(punctDlg, "ValidateMatchedPairs", new object[] {pairList, false}); Assert.IsFalse(result); }
public void ValidateMatchedPairs_ValidEntries() { using (var punctDlg = new PunctuationDlg()) { var pairList = new MatchedPairList(); var pair = new MatchedPair { Open = "(", Close = ")" }; pairList.Add(pair); bool result = ReflectionHelper.GetBoolResult(punctDlg, "ValidateMatchedPairs", new object[] { pairList, false }); Assert.IsTrue(result); } }
public void ValidateMatchedPairs_InvalidEntries() { PunctuationDlg punctDlg = new PunctuationDlg(); MatchedPairList pairList = new MatchedPairList(); MatchedPair pair = new MatchedPair(); pair.Close = ")"; pairList.Add(pair); bool result = ReflectionHelper.GetBoolResult(punctDlg, "ValidateMatchedPairs", new object[] { pairList, false }); Assert.IsFalse(result); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Handles the Click event of the btnPunctuation control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> /// ------------------------------------------------------------------------------------ private void btnPunctuation_Click(object sender, EventArgs e) { using (PunctuationDlg dlg = new PunctuationDlg(m_cache, m_helpTopicProvider, m_langDefCurrent, m_FullNameGeneral, StandardCheckIds.kguidMatchedPairs)) { dlg.ShowDialog(this); } }
/// ------------------------------------------------------------------------------------ /// <summary> /// Display the punctuation dialog box, using the specified guid to determine what /// tab on the dialog is initially brought to front. /// </summary> /// ------------------------------------------------------------------------------------ private void ShowPunctuationDialog(Guid initialTab) { ILgWritingSystemFactory lgwsf = m_cache.LanguageWritingSystemFactoryAccessor; int hvoWs = m_cache.DefaultVernWs; IWritingSystem ws = lgwsf.get_EngineOrNull(hvoWs); LanguageDefinition langDef = new LanguageDefinition(ws); LgWritingSystem lgWs = new LgWritingSystem(m_cache, hvoWs); using (PunctuationDlg dlg = new PunctuationDlg(m_cache, FwApp.App, langDef, lgWs.Name.UserDefaultWritingSystem, initialTab)) { if (dlg.ShowDialog(this) == DialogResult.OK) { ws.SaveIfDirty(m_cache.DatabaseAccessor); langDef.Serialize(); } } }
private void btnPunctuation_Click(object sender, EventArgs e) { using (var dlg = new PunctuationDlg(m_cache, m_wsContainer, m_helpTopicProvider, m_app, CurrentWritingSystem, CurrentWritingSystem.DisplayLabel, StandardCheckIds.kguidMatchedPairs)) { dlg.ShowDialog(this); } }