SIL.FieldWorks.FwCoreDlgs.DummyWritingSystemPropertiesDialog.SetCustomRegionName C# (CSharp) Method

SetCustomRegionName() private method

Set a new Custom (private use) Region subtag
Unless you modify this method it will fail given an input parameter length of less than 2.
private SetCustomRegionName ( string newRegionName ) : void
newRegionName string
return void
		internal void SetCustomRegionName(string newRegionName)
		{
			var code = newRegionName.Substring(0, 2).ToUpperInvariant();
			m_regionVariantControl.RegionSubtag = new RegionSubtag(code, newRegionName, true);
		}

Usage Example

Ejemplo n.º 1
0
 public void GeneralTab_RegionVariantChanged()
 {
     m_dlg.ShowDialog(m_wsKalaba);
     // Verify Remove doesn't (yet) do anything for Wss already in the Database.
     m_dlg.VerifyListBox(new[] { "Kalaba", "Kalaba (International Phonetic Alphabet)" });
     // Switch tabs, so we can test that Add New Ws will switch to General Tab.
     m_dlg.SwitchTab(FwWritingSystemSetupDlg.kWsFonts);
     m_dlg.VerifyTab(FwWritingSystemSetupDlg.kWsFonts);
     m_dlg.VerifyAddWsContextMenuItems(new[] { "&Writing System for Kalaba..." });
     // Click on Add Button...selecting "Add New..." option.
     m_dlg.PressBtnAdd("&Writing System for Kalaba...");
     // Verify WsList has new item and it is selected
     m_dlg.VerifyListBox(new[] { "Kalaba", "Kalaba", "Kalaba (International Phonetic Alphabet)" });
     m_dlg.VerifyLoadedForListBoxSelection("Kalaba");
     // verify we automatically switched back to General Tab.
     m_dlg.VerifyTab(FwWritingSystemSetupDlg.kWsGeneral);
     // Change Region info.
     m_dlg.SetCustomRegionName("Minnesota");
     m_dlg.VerifyListBox(new[] { "Kalaba", "Kalaba (International Phonetic Alphabet)", "Kalaba (Minnesota)" });
     // Verify dialog indicates a list to add to current (vernacular) ws list
     VerifyNewlyAddedWritingSystems(new[] { "qaa-QM-x-kal-MI" });
     // Do OK
     m_dlg.PressOk();
     // Verify dialog indicates a list to add to current (vernacular) ws list
     VerifyNewlyAddedWritingSystems(new[] { "qaa-QM-x-kal-MI" });
     // Verify we've actually created the new ws.
     VerifyWsNames(
         new[] { "Kalaba", "Kalaba (International Phonetic Alphabet)", "Kalaba (Minnesota)" },
         new[] { "qaa-x-kal", "qaa-fonipa-x-kal", "qaa-QM-x-kal-MI" });
 }