Dialog for specifying the valid characters for a FieldWorks writing system
상속: System.Windows.Forms.Form
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Handles the Click event of the btnValidChars 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 btnValidChars_Click(object sender, EventArgs e)
		{
			// Save the current language definition so the checked PUA
			// characters show up in the valid characters dialog.
			SaveCurrentLangDef();

			using (ValidCharactersDlg dlg = new ValidCharactersDlg(m_cache, m_helpTopicProvider,
				m_langDefCurrent, m_FullNameGeneral))
			{
				if (dlg.ShowDialog(this) == DialogResult.OK)
					SetupPUAList();
			}
		}
		private void btnValidChars_Click(object sender, EventArgs e)
		{
			using (var dlg = new ValidCharactersDlg(m_cache, m_wsContainer, m_helpTopicProvider,
				m_app, CurrentWritingSystem, CurrentWritingSystem.DisplayLabel))
			{
				dlg.ShowDialog(this);
			}
		}
예제 #3
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Display the valid characters dialog box. Return true if OK was chosen.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		public static bool RunDialog(FdoCache cache, IApp app, IWin32Window owner, IHelpTopicProvider helpTopicProvider)
		{
			IWritingSystem ws = cache.ServiceLocator.WritingSystems.DefaultVernacularWritingSystem;

			using (var dlg = new ValidCharactersDlg(cache, cache.ServiceLocator.WritingSystems,
				helpTopicProvider, app, ws, ws.DisplayLabel))
			{
				if (dlg.ShowDialog(owner) == DialogResult.OK)
					return true;
			}

			return false;
		}
예제 #4
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Display the valid characters dialog box. Return true if OK was chosen.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		public static bool RunDialog(FdoCache cache, IWin32Window owner, IHelpTopicProvider helpTopicProvider)
		{
			ILgWritingSystemFactory lgwsf = cache.LanguageWritingSystemFactoryAccessor;
			int hvoWs = cache.DefaultVernWs;
			IWritingSystem ws = lgwsf.get_EngineOrNull(hvoWs);
			LanguageDefinition langDef = new LanguageDefinition(ws);
			LgWritingSystem lgWs = new LgWritingSystem(cache, hvoWs);
			langDef.ValidChars = ws.ValidChars;

			string sWsName = lgWs.Name.UserDefaultWritingSystem;

			if (String.IsNullOrEmpty(sWsName))
				sWsName = lgWs.Name.BestAnalysisAlternative.Text;

			if (String.IsNullOrEmpty(sWsName) || sWsName == lgWs.Name.NotFoundTss.Text)
				sWsName = lgWs.Name.BestVernacularAlternative.Text;

			using (ValidCharactersDlg dlg =
				new ValidCharactersDlg(cache, helpTopicProvider, langDef, sWsName))
			{
				if (dlg.ShowDialog(owner) == DialogResult.OK)
				{
					ws.ValidChars = langDef.ValidChars;
					ws.SaveIfDirty(cache.DatabaseAccessor);
					langDef.Serialize();
					return true;
				}
			}

			return false;
		}