本文整理汇总了C#中SIL.Utils.StringTable.GetString方法的典型用法代码示例。如果您正苦于以下问题:C# StringTable.GetString方法的具体用法?C# StringTable.GetString怎么用?C# StringTable.GetString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SIL.Utils.StringTable
的用法示例。
在下文中一共展示了StringTable.GetString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetStringTableValues
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");
}
示例2: EnsureValidMediator
/// ------------------------------------------------------------------------------------
/// <summary>
/// Create the mediator if it doesn't already exist. Ensure that the string table in
/// the mediator is loaded from the Flex string table.
/// </summary>
/// <param name="mediator"></param>
/// <param name="fRestoreStringTable">output flag that we should restore the original string table</param>
/// <param name="stOrig">output is the original string table</param>
/// ------------------------------------------------------------------------------------
protected static Mediator EnsureValidMediator(Mediator mediator,
out bool fRestoreStringTable, out StringTable stOrig)
{
if (mediator == null)
{
mediator = new Mediator();
fRestoreStringTable = false;
stOrig = null;
}
else
{
try
{
stOrig = mediator.StringTbl;
// Check whether this is the Flex string table: look for a lexicon type
// string and compare the value with what is produced when it's not found.
string s = stOrig.GetString("MoCompoundRule-Plural", "AlternativeTitles");
fRestoreStringTable = (s == "*MoCompoundRule-Plural*");
}
catch
{
stOrig = null;
fRestoreStringTable = true;
}
}
if (fRestoreStringTable || stOrig == null)
{
string dir = Path.Combine(FwDirectoryFinder.FlexFolder, "Configuration");
mediator.StringTbl = new StringTable(dir);
}
return mediator;
}
示例3: Initialize
/// <summary>
/// This sets the original wordform and morph-broken word into the dialog.
/// </summary>
public void Initialize(ITsString tssWord, string sMorphs, ILgWritingSystemFactory wsf,
FdoCache cache, StringTable stringTable, IVwStylesheet stylesheet)
{
CheckDisposed();
Debug.Assert(tssWord != null);
Debug.Assert(wsf != null);
ITsTextProps ttp = tssWord.get_Properties(0);
Debug.Assert(ttp != null);
int var;
int ws = ttp.GetIntPropValues((int)FwTextPropType.ktptWs, out var);
Debug.Assert(ws != 0);
ILgWritingSystem wsVern = wsf.get_EngineOrNull(ws);
Debug.Assert(wsVern != null);
m_txtMorphs.WritingSystemFactory = wsf;
m_txtMorphs.WritingSystemCode = ws;
m_txtMorphs.Text = sMorphs;
m_sMorphs = sMorphs;
// Fix the help strings to use the actual MorphType markers.
IMoMorphType mmtStem;
IMoMorphType mmtPrefix;
IMoMorphType mmtSuffix;
IMoMorphType mmtInfix;
IMoMorphType mmtBoundStem;
IMoMorphType mmtProclitic;
IMoMorphType mmtEnclitic;
IMoMorphType mmtSimulfix;
IMoMorphType mmtSuprafix ;
var morphTypeRepo = cache.ServiceLocator.GetInstance<IMoMorphTypeRepository>();
morphTypeRepo.GetMajorMorphTypes(out mmtStem, out mmtPrefix, out mmtSuffix, out mmtInfix,
out mmtBoundStem, out mmtProclitic, out mmtEnclitic, out mmtSimulfix, out mmtSuprafix);
// Format the labels according to the MoMorphType Prefix/Postfix values.
string sExample1 = stringTable.GetString("EditMorphBreaks-Example1", "DialogStrings");
string sExample2 = stringTable.GetString("EditMorphBreaks-Example2", "DialogStrings");
string sStemExample = stringTable.GetString("EditMorphBreaks-stemExample", "DialogStrings");
string sAffixExample = stringTable.GetString("EditMorphBreaks-affixExample", "DialogStrings");
m_lblHelp2Example1.Text = String.Format(sExample1, mmtStem.Prefix ?? "", mmtStem.Postfix ?? "");
m_lblHelp2Example2.Text = String.Format(sExample2, mmtSuffix.Prefix ?? "", mmtSuffix.Postfix ?? "");
m_lblBreakStemExample.Text = String.Format(sStemExample, mmtStem.Prefix ?? "", mmtStem.Postfix ?? "");
m_lblBreakBoundStemExample.Text = String.Format(sStemExample, mmtBoundStem.Prefix ?? "", mmtBoundStem.Postfix ?? "");
m_lblBreakPrefixExample.Text = String.Format(sAffixExample,
mmtPrefix.Prefix == null ? "" : " " + mmtPrefix.Prefix,
mmtPrefix.Postfix == null ? "" : mmtPrefix.Postfix + " ");
m_lblBreakSuffixExample.Text = String.Format(sAffixExample,
mmtSuffix.Prefix == null ? "" : " " + mmtSuffix.Prefix,
mmtSuffix.Postfix == null ? "" : mmtSuffix.Postfix + " ");
m_lblBreakInfixExample.Text = String.Format(sAffixExample,
mmtInfix.Prefix == null ? "" : " " + mmtInfix.Prefix,
mmtInfix.Postfix == null ? "" : mmtInfix.Postfix + " ");
m_lblBreakProcliticExample.Text = String.Format(sAffixExample,
mmtProclitic.Prefix == null ? "" : " " + mmtProclitic.Prefix,
mmtProclitic.Postfix == null ? "" : mmtProclitic.Postfix + " ");
m_lblBreakEncliticExample.Text = String.Format(sAffixExample,
mmtEnclitic.Prefix == null ? "" : " " + mmtEnclitic.Prefix,
mmtEnclitic.Postfix == null ? "" : mmtEnclitic.Postfix + " ");
m_lblBreakSimulfixExample.Text = String.Format(sAffixExample,
mmtSimulfix.Prefix == null ? "" : " " + mmtSimulfix.Prefix,
mmtSimulfix.Postfix == null ? "" : mmtSimulfix.Postfix + " ");
m_lblBreakSuprafixExample.Text = String.Format(sAffixExample,
mmtSuprafix.Prefix == null ? "" : " " + mmtSuprafix.Prefix,
mmtSuprafix.Postfix == null ? "" : mmtSuprafix.Postfix + " ");
m_morphBreakContextMenu = new MorphBreakHelperMenu(m_txtMorphs, m_helpTopicProvider, cache, stringTable);
m_txtMorphs.AdjustForStyleSheet(this, null, stylesheet);
m_morphBreakHelper.Height = m_txtMorphs.Height;
}
示例4: ItemsTypeName
/// <summary>
/// The type of items contained in this list.
/// </summary>
/// <param name="stringTbl">string table containing mappings for list item names.</param>
/// <returns></returns>
public string ItemsTypeName(StringTable stringTbl)
{
string owningFieldName = Cache.MetaDataCacheAccessor.GetFieldName((uint)this.OwningFlid);
string itemsTypeName = stringTbl.GetString(owningFieldName, "PossibilityListItemTypeNames");
if (itemsTypeName != "*" + owningFieldName + "*")
return itemsTypeName;
if (this.PossibilitiesOS.Count > 0)
return stringTbl.GetString(this.PossibilitiesOS[0].GetType().Name, "ClassNames");
else
return itemsTypeName;
}
示例5: ItemTypeName
/// ------------------------------------------------------------------------------------
/// <summary>
/// The name for the type of CmPossibility. Subclasses may override.
/// </summary>
/// <param name="strTable">string table containing mappings for list item names.</param>
/// <returns></returns>
/// ------------------------------------------------------------------------------------
public virtual string ItemTypeName(StringTable strTable)
{
int ownerHvo = this.OwnerHVO;
ICmPossibilityList owningList = this.OwningList;
string owningFieldName =
Cache.MetaDataCacheAccessor.GetFieldName((uint)owningList.OwningFlid);
string itemsTypeName = (owningList as CmPossibilityList).ItemsTypeName(strTable);
if (itemsTypeName != "*" + owningFieldName + "*")
return itemsTypeName;
return strTable.GetString(this.GetType().Name, "ClassNames");
}
示例6: TryFindString
/// <summary>
///
/// </summary>
/// <param name="tbl"></param>
/// <param name="group"></param>
/// <param name="key"></param>
/// <param name="result"></param>
/// <returns>true if we found a value associated with the given key. false if result is in *{key}* format.</returns>
public static bool TryFindString(StringTable tbl, string group, string key, out string result)
{
result = tbl.GetString(key, group);
return FoundStringTableString(key, result);
}