本文整理汇总了C#中ILgWritingSystemFactory类的典型用法代码示例。如果您正苦于以下问题:C# ILgWritingSystemFactory类的具体用法?C# ILgWritingSystemFactory怎么用?C# ILgWritingSystemFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ILgWritingSystemFactory类属于命名空间,在下文中一共展示了ILgWritingSystemFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: XmlNoteCategory
/// ------------------------------------------------------------------------------------
/// <summary>
/// Initializes a new instance of the <see cref="XmlNoteCategory"/> class based on the
/// specified category.
/// </summary>
/// ------------------------------------------------------------------------------------
public XmlNoteCategory(ICmPossibility category, ILgWritingSystemFactory lgwsf)
{
List<CategoryNode> categoryList = GetCategoryHierarchyList(category);
m_categoryPath = category.NameHierarchyString;
InitializeCategory(categoryList, lgwsf);
}
示例2: SimpleMatchDlg
/// ------------------------------------------------------------------------------------
/// <summary>
/// Initializes a new instance of the <see cref="T:SimpleMatchDlg"/> class.
/// </summary>
/// <param name="wsf">The WSF.</param>
/// <param name="ws">The ws.</param>
/// <param name="ss">The ss.</param>
/// ------------------------------------------------------------------------------------
public SimpleMatchDlg(ILgWritingSystemFactory wsf, int ws, IVwStylesheet ss)
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
// We do this outside the designer-controlled code because it does funny things
// to FwTextBoxes, owing to the need for a writing system factory, and some
// properties it should not persist but I can't persuade it not to.
this.m_textBox = new FwTextBox();
this.m_textBox.WritingSystemFactory = wsf; // set ASAP.
this.m_textBox.WritingSystemCode = ws;
this.m_textBox.StyleSheet = ss; // before setting text, otherwise it gets confused about height needed.
this.m_textBox.Location = new System.Drawing.Point(8, 24);
this.m_textBox.Name = "m_textBox";
this.m_textBox.Size = new System.Drawing.Size(450, 32);
this.m_textBox.TabIndex = 0;
this.m_textBox.Text = "";
this.Controls.Add(this.m_textBox);
regexContextMenu = new RegexHelperMenu(m_textBox, FwApp.App);
m_ivwpattern = VwPatternClass.Create();
helpProvider = new System.Windows.Forms.HelpProvider();
helpProvider.HelpNamespace = FwApp.App.HelpFile;
helpProvider.SetHelpKeyword(this, FwApp.App.GetHelpString(s_helpTopic, 0));
helpProvider.SetHelpNavigator(this, System.Windows.Forms.HelpNavigator.Topic);
}
示例3: AddBulletFontInfoToBldr
/// ------------------------------------------------------------------------------------
/// <summary>
/// Adds the bullet font information to the specified props builder.
/// </summary>
/// <param name="bldr">The props builder.</param>
/// <param name="bulFontInfo">The bullet font information XML.</param>
/// <param name="lgwsf">The writing system factory.</param>
/// ------------------------------------------------------------------------------------
private static void AddBulletFontInfoToBldr(ITsPropsBldr bldr, XElement bulFontInfo,
ILgWritingSystemFactory lgwsf)
{
int intValue, type, var;
string strValue;
ITsPropsBldr fontProps = GetPropAttributesForElement(bulFontInfo, lgwsf);
// Add the integer properties to the bullet props string
StringBuilder bulletProps = new StringBuilder(fontProps.IntPropCount * 3 + fontProps.StrPropCount * 20);
for (int i = 0; i < fontProps.IntPropCount; i++)
{
fontProps.GetIntProp(i, out type, out var, out intValue);
bulletProps.Append((char)type);
WriteIntToStrBuilder(bulletProps, intValue);
}
// Add the string properties to the bullet props string
for (int i = 0; i < fontProps.StrPropCount; i++)
{
fontProps.GetStrProp(i, out type, out strValue);
bulletProps.Append((char)type);
bulletProps.Append(strValue);
bulletProps.Append('\u0000');
}
bldr.SetStrPropValue((int)FwTextPropType.ktptBulNumFontInfo, bulletProps.ToString());
}
示例4: XmlNotePara
/// ------------------------------------------------------------------------------------
/// <summary>
/// Initializes a new instance of the <see cref="XmlNotePara"/> class based on the given
/// StTxtPara.
/// </summary>
/// <param name="stTxtPara">The FDO paragraph.</param>
/// <param name="wsDefault">The default (analysis) writing system.</param>
/// <param name="lgwsf">The writing system factory.</param>
/// ------------------------------------------------------------------------------------
public XmlNotePara(IStTxtPara stTxtPara, int wsDefault, ILgWritingSystemFactory lgwsf)
{
// REVIEW: Ask TomB about this. The only paragraph style allowed in
// TE for notes is "Remark" so is it necessary to write it to the XML?
// It causes a problem for the OXES validator.
//StyleName = stTxtPara.StyleName;
ITsString tssParaContents = stTxtPara.Contents;
if (tssParaContents.RunCount == 0)
return;
int dummy;
int wsFirstRun = tssParaContents.get_Properties(0).GetIntPropValues(
(int)FwTextPropType.ktptWs, out dummy);
//if (wsFirstRun != wsDefault)
IcuLocale = lgwsf.GetStrFromWs(wsFirstRun);
for (int iRun = 0; iRun < tssParaContents.RunCount; iRun++)
{
ITsTextProps props = tssParaContents.get_Properties(iRun);
string text = tssParaContents.get_RunText(iRun);
if (TsStringUtils.IsHyperlink(props))
Runs.Add(new XmlHyperlinkRun(wsFirstRun, lgwsf, text, props));
else
Runs.Add(new XmlTextRun(wsFirstRun, lgwsf, text, props));
}
}
示例5: FdoParaToLfPara
/// <summary>
/// Make an LfParagraph object from an FDO StTxtPara.
/// </summary>
/// <returns>The LFParagraph.</returns>
/// <param name="fdoPara">FDO StTxtPara object to convert.</param>
public static LfParagraph FdoParaToLfPara(IStTxtPara fdoPara, ILgWritingSystemFactory wsf)
{
var lfPara = new LfParagraph();
lfPara.Guid = fdoPara.Guid;
lfPara.StyleName = fdoPara.StyleName;
lfPara.Content = ConvertFdoToMongoTsStrings.TextFromTsString(fdoPara.Contents, wsf);
return lfPara;
}
示例6: GetAdjustedTsString
/// -------------------------------------------------------------------------------------
/// <summary>
/// Make sure that all runs of the given ts string will fit within the given height.
/// </summary>
/// <param name="tss">(Potentially) unadjusted TsString -- may have some pre-existing
/// adjustments, but if it does, we (probably) ignore those and recheck every run</param>
/// <param name="dympMaxHeight">The maximum height (in millipoints) of the Ts String.</param>
/// <param name="styleSheet"></param>
/// <param name="writingSystemFactory"></param>
/// -------------------------------------------------------------------------------------
public static ITsString GetAdjustedTsString(ITsString tss, int dympMaxHeight,
IVwStylesheet styleSheet, ILgWritingSystemFactory writingSystemFactory)
{
if (dympMaxHeight == 0)
return tss;
ITsStrBldr bldr = null;
int runCount = tss.RunCount;
for (int irun = 0; irun < runCount; irun++)
{
ITsTextProps props = tss.get_Properties(irun);
int var;
int wsTmp = props.GetIntPropValues((int)FwTextPropType.ktptWs,
out var);
string styleName =
props.GetStrPropValue((int)FwTextStringProp.kstpNamedStyle);
int height;
string name;
float sizeInPoints;
using (Font f = GetFontForStyle(styleName, styleSheet, wsTmp, writingSystemFactory))
{
height = GetFontHeight(f);
name = f.Name;
sizeInPoints = f.SizeInPoints;
}
int curHeight = height;
// incrementally reduce the size of the font until the text can fit
while (curHeight > dympMaxHeight)
{
using (var f = new Font(name, sizeInPoints - 0.25f))
{
curHeight = GetFontHeight(f);
name = f.Name;
sizeInPoints = f.SizeInPoints;
}
}
if (curHeight != height)
{
// apply formatting to the problem run
if (bldr == null)
bldr = tss.GetBldr();
int iStart = tss.get_MinOfRun(irun);
int iEnd = tss.get_LimOfRun(irun);
bldr.SetIntPropValues(iStart, iEnd,
(int)FwTextPropType.ktptFontSize,
(int)FwTextPropVar.ktpvMilliPoint, (int)(sizeInPoints * 1000.0f));
}
}
if (bldr != null)
return bldr.GetString();
else
return tss;
}
示例7: GetXmlRep
/// ------------------------------------------------------------------------------------
/// <summary>
/// Get an XML representation of the given ITsTextProps.
/// </summary>
/// <param name="ttp">The TTP.</param>
/// <param name="wsf">The WSF.</param>
/// <returns></returns>
/// ------------------------------------------------------------------------------------
public static string GetXmlRep(ITsTextProps ttp, ILgWritingSystemFactory wsf)
{
using (var writer = new StringWriter())
{
var stream = new TextWriterStream(writer);
ttp.WriteAsXml(stream, wsf, 0);
return writer.ToString();
}
}
示例8: ConvertFdoToMongoOptionList
/// <summary>
/// Initializes a new instance of the <see cref="LfMerge.DataConverters.ConvertFdoToMongoOptionList"/> class.
/// </summary>
/// <param name="lfOptionList">Lf option list.</param>
/// <param name="wsForKeys">Ws for keys.</param>
/// <param name="listCode">List code.</param>
/// <param name="logger">Logger.</param>
public ConvertFdoToMongoOptionList(LfOptionList lfOptionList, int wsForKeys, string listCode, ILogger logger, ILgWritingSystemFactory wsf)
{
_logger = logger;
_wsf = wsf;
_wsForKeys = wsForKeys;
if (lfOptionList == null)
lfOptionList = MakeEmptyOptionList(listCode);
_lfOptionList = lfOptionList;
UpdateOptionListItemDictionaries(_lfOptionList);
}
示例9: WordMaker
public WordMaker(ITsString tss, ILgWritingSystemFactory encf)
{
m_tss = tss;
m_ich = 0;
m_st = tss.get_Text();
if (m_st == null)
m_st = "";
m_cch = m_st.Length;
// Get a character property engine from the wsf.
m_cpe = encf.get_UnicodeCharProps();
Debug.Assert(m_cpe != null, "encf.get_UnicodeCharProps() returned null");
}
示例10: DeserializeTsStringFromXml
/// ------------------------------------------------------------------------------------
/// <summary>
/// Deserializes a TsString from the XML node.
/// </summary>
/// <param name="xml">The XML node.</param>
/// <param name="lgwsf">The writing system factory.</param>
/// <returns>The created TsString. Will never be <c>null</c> because an exception is
/// thrown if anything is invalid.</returns>
/// ------------------------------------------------------------------------------------
public static ITsString DeserializeTsStringFromXml(XElement xml, ILgWritingSystemFactory lgwsf)
{
if (xml != null)
{
switch (xml.Name.LocalName)
{
case "AStr":
case "Str":
return HandleSimpleString(xml, lgwsf) ?? HandleComplexString(xml, lgwsf);
default:
throw new XmlSchemaException("TsString XML must contain a <Str> or <AStr> root element");
}
}
return null;
}
示例11: SimpleDataParser
public SimpleDataParser(IFwMetaDataCache mdc, IVwCacheDa cda)
{
m_mdc = mdc;
m_cda = cda;
m_sda = cda as ISilDataAccess;
m_wsf = m_sda.WritingSystemFactory;
}
示例12: FixtureTeardown
/// <summary>
/// Clear out test data.
/// </summary>
public override void FixtureTeardown()
{
m_wsf = null;
m_styleSheet = null;
base.FixtureTeardown();
}
示例13: FixtureSetup
public override void FixtureSetup()
{
base.FixtureSetup();
m_flidContainingTexts = ScrBookTags.kflidFootnotes;
m_wsf = Cache.WritingSystemFactory;
m_wsEng = m_wsf.GetWsFromStr("en");
}
示例14: TestFixtureSetup
public void TestFixtureSetup()
{
// This needs to be set for ICU
RegistryHelper.CompanyName = "SIL";
Icu.InitIcuDataDir();
m_wsf = new PalasoWritingSystemManager();
m_DebugProcs = new DebugProcs();
}
示例15: CreateTestData
/// ------------------------------------------------------------------------------------
/// <summary>
/// Creates the test data.
/// </summary>
/// ------------------------------------------------------------------------------------
protected override void CreateTestData()
{
m_servLoc = Cache.ServiceLocator;
m_wsf = Cache.WritingSystemFactory;
m_ws_en = m_wsf.GetWsFromStr("en");
m_ws_fr = m_wsf.GetWsFromStr("fr");
CreateTestText();
}