SIL.FieldWorks.XWorks.MorphologyEditor.InflAffixTemplateControl.SetStringTableValues C# (CSharp) Method

SetStringTableValues() public method

public SetStringTableValues ( SIL.Utils.StringTable stringTable ) : void
stringTable SIL.Utils.StringTable
return void
		public void SetStringTableValues(StringTable stringTable)
		{
			CheckDisposed();

			m_sStem = stringTable.GetString("Stem", "Linguistics/Morphology/TemplateTable");

			m_sSlotChooserTitle = stringTable.GetString("SlotChooserTitle", "Linguistics/Morphology/TemplateTable");
			m_sSlotChooserInstructionalText = stringTable.GetString("SlotChooserInstructionalText", "Linguistics/Morphology/TemplateTable");
			m_sObligatorySlot = stringTable.GetString("ObligatorySlot", "Linguistics/Morphology/TemplateTable");
			m_sOptionalSlot = stringTable.GetString("OptionalSlot", "Linguistics/Morphology/TemplateTable");

			m_sNewSlotName = stringTable.GetString("NewSlotName", "Linguistics/Morphology/TemplateTable");
			m_sUnnamedSlotName = stringTable.GetString("UnnamedSlotName", "Linguistics/Morphology/TemplateTable");

			m_sInflAffixChooserTitle = stringTable.GetString("InflAffixChooserTitle", "Linguistics/Morphology/TemplateTable");
			m_sInflAffixChooserInstructionalTextReq = stringTable.GetString("InflAffixChooserInstructionalTextReq", "Linguistics/Morphology/TemplateTable");
			m_sInflAffixChooserInstructionalTextOpt = stringTable.GetString("InflAffixChooserInstructionalTextOpt", "Linguistics/Morphology/TemplateTable");
			m_sInflAffix = stringTable.GetString("InflAffix", "Linguistics/Morphology/TemplateTable");

		}

Usage Example

		/// <summary>
		/// Therefore this method, called once we have a cache and object, is our first chance to
		/// actually create the embedded control.
		/// </summary>
		public override void FinishInit()
		{
			CheckDisposed();
			IWritingSystemContainer wsContainer = Cache.ServiceLocator.WritingSystems;
			bool fVernRTL = wsContainer.DefaultVernacularWritingSystem.RightToLeftScript;
			bool fAnalRTL = wsContainer.DefaultAnalysisWritingSystem.RightToLeftScript;
			System.Xml.XmlAttribute xa = ConfigurationNode.Attributes["layout"];
			// To properly fix LT-6239, we need to consider all four mixtures of directionality
			// involving the vernacular (table) and analysis (slot name) writing systems.
			// These four possibilities are marked RTL, LTRinRTL, RTLinLTR, and <nothing>.
			if (fVernRTL && fAnalRTL)
			{
				if (xa.Value.EndsWith("RTLinLTR") || xa.Value.EndsWith("LTRinRTL"))
					xa.Value = xa.Value.Substring(0, xa.Value.Length - 8);
				if (!xa.Value.EndsWith("RTL"))
					xa.Value += "RTL";		// both vern and anal are RTL
			}
			else if (fVernRTL && !fAnalRTL)
			{
				if (xa.Value.EndsWith("RTLinLTR"))
					xa.Value = xa.Value.Substring(0, xa.Value.Length - 8);
				else if (xa.Value.EndsWith("RTL") && !xa.Value.EndsWith("LTRinRTL"))
					xa.Value = xa.Value.Substring(0, xa.Value.Length - 3);
				if (!xa.Value.EndsWith("LTRinRTL"))
					xa.Value += "LTRinRTL";		// LTR anal name in RTL vern table
			}
			else if (!fVernRTL && fAnalRTL)
			{
				if (xa.Value.EndsWith("LTRinRTL"))
					xa.Value = xa.Value.Substring(0, xa.Value.Length - 8);
				else if (xa.Value.EndsWith("RTL"))
					xa.Value = xa.Value.Substring(0, xa.Value.Length - 3);
				if (!xa.Value.EndsWith("RTLinLTR"))
					xa.Value += "RTLinLTR";		// RTL anal name in LTR vern table
			}
			else
			{
				if (xa.Value.EndsWith("RTLinLTR") || xa.Value.EndsWith("LTRinRTL"))
					xa.Value = xa.Value.Substring(0, xa.Value.Length - 8);
				else if (xa.Value.EndsWith("RTL"))
					xa.Value = xa.Value.Substring(0, xa.Value.Length - 3);
				// both vern and anal are LTR (unmarked case)
			}
			var ctrl = new InflAffixTemplateControl((FdoCache)Mediator.PropertyTable.GetValue("cache"),
				Object.Hvo, ConfigurationNode, StringTbl);
			Control = ctrl;
			m_menuHandler = InflAffixTemplateMenuHandler.Create(ctrl, ConfigurationNode);
#if !Want
			m_menuHandler.Init(Mediator, null);
#else
			m_menuHandler.Init(null, null);
#endif
			ctrl.SetContextMenuHandler(m_menuHandler.ShowSliceContextMenu);
			ctrl.Mediator = Mediator;
			ctrl.SetStringTableValues(Mediator.StringTbl);
			if (ctrl.RootBox == null)
				ctrl.MakeRoot();
		}