本文整理汇总了C#中ITsTextProps类的典型用法代码示例。如果您正苦于以下问题:C# ITsTextProps类的具体用法?C# ITsTextProps怎么用?C# ITsTextProps使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ITsTextProps类属于命名空间,在下文中一共展示了ITsTextProps类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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();
}
}
示例2: AllTextSelInfo
/// <summary>
/// Get an array of SelLevInfo structs from the given selection.
/// </summary>
/// <param name="vwsel"></param>
/// <param name="cvsli"></param>
/// <param name="ihvoRoot"></param>
/// <param name="tagTextProp"></param>
/// <param name="cpropPrevious"></param>
/// <param name="ichAnchor"></param>
/// <param name="ichEnd"></param>
/// <param name="ws"></param>
/// <param name="fAssocPrev"></param>
/// <param name="ihvoEnd"></param>
/// <param name="ttp"></param>
/// <returns></returns>
public static SelLevInfo[] AllTextSelInfo(IVwSelection vwsel, int cvsli,
out int ihvoRoot, out int tagTextProp, out int cpropPrevious, out int ichAnchor,
out int ichEnd, out int ws, out bool fAssocPrev, out int ihvoEnd, out ITsTextProps ttp)
{
Debug.Assert(vwsel != null);
using (ArrayPtr rgvsliPtr = MarshalEx.ArrayToNative<SelLevInfo>(cvsli))
{
vwsel.AllTextSelInfo(out ihvoRoot, cvsli, rgvsliPtr,
out tagTextProp, out cpropPrevious, out ichAnchor, out ichEnd,
out ws, out fAssocPrev, out ihvoEnd, out ttp);
return MarshalEx.NativeToArray<SelLevInfo>(rgvsliPtr, cvsli);
}
}
示例3: RequestSelectionHelper
/// -----------------------------------------------------------------------------------
/// <summary>
/// Make one and hook it up to be called at the appropriate time.
/// </summary>
/// -----------------------------------------------------------------------------------
public RequestSelectionHelper(IActionHandlerExtensions hookup, IVwRootBox rootb, int ihvoRoot,
SelLevInfo[] rgvsli, int tagTextProp, int cpropPrevious, int ich, int wsAlt, bool fAssocPrev,
ITsTextProps selProps)
{
m_hookup = hookup;
m_rootb = rootb;
m_ihvoRoot = ihvoRoot;
m_rgvsli = rgvsli;
m_tagTextProp = tagTextProp;
m_cpropPrevious = cpropPrevious;
m_ich = ich;
m_wsAlt = wsAlt;
m_fAssocPrev = fAssocPrev;
m_selProps = selProps;
m_hookup.DoAtEndOfPropChanged(m_hookup_PropChangedCompleted);
}
示例4: ClassesFromTsTextProps
public static List<string> ClassesFromTsTextProps(ITsTextProps props, int[] intPropsToSkip, int[] strPropsToSkip)
{
var classes = new List<string>();
for (int i = 0, n = props.IntPropCount; i < n; i++)
{
int propNum;
int variation;
int propValue = props.GetIntProp(i, out propNum, out variation);
if (intPropsToSkip.Contains(propNum))
continue;
string className = String.Format("propi_{0}_{1}_{2}_{3}", propNum, IntPropertyName(propNum), propValue, variation);
classes.Add(className);
}
for (int i = 0, n = props.StrPropCount; i < n; i++)
{
int propNum;
string propValue = props.GetStrProp(i, out propNum).Replace(" ", "_SPACE_");
string className = String.Format("props_{0}_{1}_{2}", propNum, StringPropertyName(propNum), propValue);
if (strPropsToSkip.Contains(propNum))
continue;
classes.Add(className);
}
return classes;
}
示例5: GetHotObjectGuidFromProps
/// ------------------------------------------------------------------------------------
/// <summary>
/// Get a "Hot" Guid from the given text props.
/// </summary>
/// <param name="ttp">The text props</param>
/// <returns>The GUID from the text props or Guid.Empty if the props do not contain
/// a GUID or have a non-hot ORC</returns>
/// ------------------------------------------------------------------------------------
public static Guid GetHotObjectGuidFromProps(ITsTextProps ttp)
{
FwObjDataTypes odt;
return GetGuidFromProps(ttp, s_hotObjectTypes, out odt);
}
示例6: GetGuidFromRun
/// ------------------------------------------------------------------------------------
/// <summary>
/// Get a Guid from the given run in a structured text string.
/// </summary>
/// <param name="tss">given structured text string</param>
/// <param name="iRun">given run</param>
/// <param name="ttp">text properties of the run</param>
/// <returns>
/// The GUID associated with the specified run of the tss, if any; otherwise Guid.Empty
/// </returns>
/// ------------------------------------------------------------------------------------
public static Guid GetGuidFromRun(ITsString tss, int iRun, ITsTextProps ttp)
{
FwObjDataTypes odt;
TsRunInfo tri;
return GetGuidFromRun(tss, iRun, null, out odt, out tri, ref ttp);
}
示例7: GetUsefulGuidFromProps
/// ------------------------------------------------------------------------------------
/// <summary>
/// Get a Guid from the given text props if the object type is a footnote or a picture.
/// </summary>
/// <param name="ttp">The text props</param>
/// <returns>The GUID from the text props or Guid.Empty if the props do not contain
/// a GUID or have a type of ORC that is not one of the desired kinds</returns>
/// ------------------------------------------------------------------------------------
public static Guid GetUsefulGuidFromProps(ITsTextProps ttp)
{
FwObjDataTypes odt;
return GetGuidFromProps(ttp, s_footnoteAndPicObjectTypes, out odt);
}
示例8: SetTextProps
/// ------------------------------------------------------------------------------------
/// <summary>
/// Used by constructor.
/// Sets the text property vars for this proxy, from the name, type, and ws
/// </summary>
/// ------------------------------------------------------------------------------------
private void SetTextProps()
{
if (m_Context == ContextValues.EndMarker || m_sStyleName == null || m_sStyleName == string.Empty)
{ // props are not relevant for end markers or markers with no style name
m_ttpRunProps = m_ws == 0 ? null : StyleUtils.CharStyleTextProps(null, m_ws);
m_rgbParaProps = null;
return;
}
Debug.Assert(m_StyleType == StyleType.kstCharacter || m_StyleType == StyleType.kstParagraph);
Debug.Assert(m_ws != 0);
// For char style, the run props contain writing system & char style name; for para
// style, they contain only the writing system.
m_ttpRunProps = StyleUtils.CharStyleTextProps(
(m_StyleType == StyleType.kstCharacter) ? m_sStyleName : null, m_ws);
// For char style, the paragraph props are empty; for para style, they contain the
// para style name.
if (m_StyleType == StyleType.kstParagraph)
{
ITsTextProps props = StyleUtils.ParaStyleTextProps(m_sStyleName);
using (ArrayPtr rgbFmtBufPtr = MarshalEx.ArrayToNative<byte>(kcbFmtBufMax))
{
int nBytes = props.SerializeRgb(rgbFmtBufPtr, kcbFmtBufMax);
m_rgbParaProps = MarshalEx.NativeToArray<byte>(rgbFmtBufPtr, nBytes);
}
}
else
m_rgbParaProps = null;
}
示例9: OnInsertDiffParas
/// ------------------------------------------------------------------------------------
/// <summary>
/// Handle insertion of paragraphs (i.e., from clipboard) with properties that don't
/// match the properties of the paragraph where they are being inserted. This gives us
/// the opportunity to create/modify the DB structure to recieve the paragraphs being
/// inserted and to reject certain types of paste operations (such as attempting to
/// paste a book).
/// </summary>
/// <param name="rootBox">the sender</param>
/// <param name="ttpDest">properties of destination paragraph</param>
/// <param name="cPara">number of paragraphs to be inserted</param>
/// <param name="ttpSrcArray">Array of props of each para to be inserted</param>
/// <param name="tssParas">Array of TsStrings for each para to be inserted</param>
/// <param name="tssTrailing">Text of an incomplete paragraph to insert at end (with
/// the properties of the destination paragraph.</param>
/// <returns>One of the following:
/// kidprDefault - causes the base implementation to insert the material as part of the
/// current StText in the usual way;
/// kidprFail - indicates that we have decided that this text should not be pasted at
/// this location at all, causing entire operation to roll back;
/// kidprDone - indicates that we have handled the paste ourselves, inserting the data
/// wherever it ought to go and creating any necessary new structure.</returns>
/// ------------------------------------------------------------------------------------
public override VwInsertDiffParaResponse OnInsertDiffParas(IVwRootBox rootBox,
ITsTextProps ttpDest, int cPara, ITsTextProps[] ttpSrcArray, ITsString[] tssParas,
ITsString tssTrailing)
{
CheckDisposed();
if (TeEditingHelper == null)
return VwInsertDiffParaResponse.kidprFail;
return TeEditingHelper.InsertDiffParas(rootBox, ttpDest, cPara, ttpSrcArray,
tssParas, tssTrailing);
}
示例10: GetGuidFromProps
/// ------------------------------------------------------------------------------------
/// <summary>
/// Get a Guid from the given text props.
/// </summary>
/// <param name="ttp">The text props</param>
/// <param name="desiredOrcTypes">Set of ORC types that we're interested in, dude; or
/// null if it don't make no difference</param>
/// <param name="odt">Actual object type</param>
/// <returns>The GUID from the text props or Guid.Empty if the props do not contain
/// a GUID or have a type of ORC that is not one of the desired kinds</returns>
/// ------------------------------------------------------------------------------------
public static Guid GetGuidFromProps(ITsTextProps ttp, FwObjDataTypes[] desiredOrcTypes, out FwObjDataTypes odt)
{
odt = 0;
string sObjData = ttp.ObjData();
if (sObjData != null)
{
odt = (FwObjDataTypes)Convert.ToByte(sObjData[0]);
// See if it's one of the types of objects we want.
if (desiredOrcTypes == null || desiredOrcTypes.Contains(odt))
{
// Get GUID for ORC
return MiscUtils.GetGuidFromObjData(sObjData.Substring(1));
}
}
return Guid.Empty;
}
示例11: AllSelEndInfo
public void AllSelEndInfo(bool fEndPoint, out int _ihvoRoot, int cvlsi, ArrayPtr _rgvsli,
out int _tagTextProp, out int _cpropPrevious, out int _ich, out int _ws,
out bool _fAssocPrev, out ITsTextProps _pttp)
{
_ihvoRoot = 0;
_tagTextProp = 0;
_cpropPrevious = 0;
if (fEndPoint)
_ich = End;
else
_ich = Anchor;
_ws = 0;
_fAssocPrev = false;
_pttp = null;
}
示例12: RegRuleFormulaVc
public RegRuleFormulaVc(FdoCache cache, Mediator mediator)
: base(cache, mediator)
{
ITsPropsBldr tpb = TsPropsBldrClass.Create();
tpb.SetIntPropValues((int)FwTextPropType.ktptBorderBottom, (int)FwTextPropVar.ktpvMilliPoint, 1000);
tpb.SetIntPropValues((int)FwTextPropType.ktptBorderColor, (int)FwTextPropVar.ktpvDefault,
(int)ColorUtil.ConvertColorToBGR(Color.Gray));
tpb.SetIntPropValues((int)FwTextPropType.ktptAlign, (int)FwTextPropVar.ktpvEnum, (int)FwTextAlign.ktalCenter);
m_ctxtProps = tpb.GetTextProps();
tpb = TsPropsBldrClass.Create();
tpb.SetIntPropValues((int)FwTextPropType.ktptFontSize, (int)FwTextPropVar.ktpvMilliPoint, 20000);
tpb.SetIntPropValues((int)FwTextPropType.ktptForeColor, (int)FwTextPropVar.ktpvDefault,
(int)ColorUtil.ConvertColorToBGR(Color.Gray));
tpb.SetIntPropValues((int)FwTextPropType.ktptAlign, (int)FwTextPropVar.ktpvEnum, (int)FwTextAlign.ktalCenter);
tpb.SetIntPropValues((int)FwTextPropType.ktptPadLeading, (int)FwTextPropVar.ktpvMilliPoint, 2000);
tpb.SetIntPropValues((int)FwTextPropType.ktptPadTrailing, (int)FwTextPropVar.ktpvMilliPoint, 2000);
tpb.SetStrPropValue((int)FwTextPropType.ktptFontFamily, MiscUtils.StandardSansSerif);
tpb.SetIntPropValues((int)FwTextPropType.ktptEditable, (int)FwTextPropVar.ktpvEnum, (int)TptEditable.ktptNotEditable);
m_charProps = tpb.GetTextProps();
ITsStrFactory tsf = m_cache.TsStrFactory;
int userWs = m_cache.DefaultUserWs;
m_arrow = tsf.MakeString("\u2192", userWs);
m_slash = tsf.MakeString("/", userWs);
m_underscore = tsf.MakeString("__", userWs);
}
示例13: AffixRuleFormulaVc
public AffixRuleFormulaVc(FdoCache cache, XCore.Mediator mediator)
: base(cache, mediator)
{
ITsPropsBldr tpb = TsPropsBldrClass.Create();
tpb.SetStrPropValue((int)FwTextPropType.ktptFontFamily, MiscUtils.StandardSansSerif);
tpb.SetIntPropValues((int)FwTextPropType.ktptFontSize, (int)FwTextPropVar.ktpvMilliPoint, 10000);
tpb.SetIntPropValues((int)FwTextPropType.ktptBorderColor, (int)FwTextPropVar.ktpvDefault,
(int)ColorUtil.ConvertColorToBGR(Color.Gray));
tpb.SetIntPropValues((int)FwTextPropType.ktptForeColor, (int)FwTextPropVar.ktpvDefault,
(int)ColorUtil.ConvertColorToBGR(Color.Gray));
tpb.SetIntPropValues((int)FwTextPropType.ktptEditable, (int)FwTextPropVar.ktpvEnum, (int)TptEditable.ktptNotEditable);
m_headerProps = tpb.GetTextProps();
tpb = TsPropsBldrClass.Create();
tpb.SetIntPropValues((int)FwTextPropType.ktptBold, (int)FwTextPropVar.ktpvEnum, (int)FwTextToggleVal.kttvForceOn);
tpb.SetIntPropValues((int)FwTextPropType.ktptFontSize, (int)FwTextPropVar.ktpvMilliPoint, 24000);
tpb.SetIntPropValues((int)FwTextPropType.ktptForeColor, (int)FwTextPropVar.ktpvDefault,
(int)ColorUtil.ConvertColorToBGR(Color.Gray));
tpb.SetIntPropValues((int)FwTextPropType.ktptAlign, (int)FwTextPropVar.ktpvEnum, (int)FwTextAlign.ktalCenter);
tpb.SetStrPropValue((int)FwTextPropType.ktptFontFamily, "Charis SIL");
tpb.SetIntPropValues((int)FwTextPropType.ktptEditable, (int)FwTextPropVar.ktpvEnum, (int)TptEditable.ktptNotEditable);
m_arrowProps = tpb.GetTextProps();
tpb = TsPropsBldrClass.Create();
tpb.SetIntPropValues((int)FwTextPropType.ktptBorderTop, (int)FwTextPropVar.ktpvMilliPoint, 1000);
tpb.SetIntPropValues((int)FwTextPropType.ktptBorderBottom, (int)FwTextPropVar.ktpvMilliPoint, 1000);
tpb.SetIntPropValues((int)FwTextPropType.ktptBorderTrailing, (int)FwTextPropVar.ktpvMilliPoint, 1000);
tpb.SetIntPropValues((int)FwTextPropType.ktptBorderColor, (int)FwTextPropVar.ktpvDefault,
(int)ColorUtil.ConvertColorToBGR(Color.Gray));
tpb.SetIntPropValues((int)FwTextPropType.ktptAlign, (int)FwTextPropVar.ktpvEnum, (int)FwTextAlign.ktalCenter);
m_ctxtProps = tpb.GetTextProps();
tpb = TsPropsBldrClass.Create();
tpb.SetIntPropValues((int)FwTextPropType.ktptBorderBottom, (int)FwTextPropVar.ktpvMilliPoint, 1000);
tpb.SetIntPropValues((int)FwTextPropType.ktptBorderTrailing, (int)FwTextPropVar.ktpvMilliPoint, 1000);
tpb.SetIntPropValues((int)FwTextPropType.ktptBorderColor, (int)FwTextPropVar.ktpvDefault,
(int)ColorUtil.ConvertColorToBGR(Color.Gray));
tpb.SetIntPropValues((int)FwTextPropType.ktptAlign, (int)FwTextPropVar.ktpvEnum, (int)FwTextAlign.ktalCenter);
tpb.SetIntPropValues((int)FwTextPropType.ktptEditable, (int)FwTextPropVar.ktpvEnum, (int)TptEditable.ktptNotEditable);
tpb.SetIntPropValues((int)FwTextPropType.ktptForeColor, (int)FwTextPropVar.ktpvDefault,
(int)ColorUtil.ConvertColorToBGR(Color.Gray));
m_indexProps = tpb.GetTextProps();
tpb = TsPropsBldrClass.Create();
tpb.SetIntPropValues((int)FwTextPropType.ktptBorderBottom, (int)FwTextPropVar.ktpvMilliPoint, 1000);
tpb.SetIntPropValues((int)FwTextPropType.ktptBorderColor, (int)FwTextPropVar.ktpvDefault,
(int)ColorUtil.ConvertColorToBGR(Color.Gray));
m_resultProps = tpb.GetTextProps();
var tsf = m_cache.TsStrFactory;
var userWs = m_cache.DefaultUserWs;
m_inputStr = tsf.MakeString(MEStrings.ksAffixRuleInput, userWs);
m_indexStr = tsf.MakeString(MEStrings.ksAffixRuleIndex, userWs);
m_resultStr = tsf.MakeString(MEStrings.ksAffixRuleResult, userWs);
m_doubleArrow = tsf.MakeString("\u21d2", userWs);
m_space = tsf.MakeString(" ", userWs);
}
示例14: SimpleStyleSheet
public SimpleStyleSheet()
{
ITsPropsBldr tpb = (ITsPropsBldr) new FwKernelLib.TsPropsBldrClass();
m_ttpNormal = tpb.GetTextProps(); // normal has nothing defined, use system defaults.
tpb.SetIntPropValues((int)FwKernelLib.FwTextPropType.ktptForeColor, (int)FwKernelLib.FwTextPropVar.ktpvDefault,
(int)ViewSampleVc.RGB(Color.Red));
tpb.SetIntPropValues((int)FwKernelLib.FwTextPropType.ktptSuperscript, (int)FwKernelLib.FwTextPropVar.ktpvEnum,
(int)FwKernelLib.FwSuperscriptVal.kssvSuper);
m_ttpVerseNumber = tpb.GetTextProps();
}
示例15: Setup
public void Setup()
{
tsf = TsStrFactoryClass.Create();
wsf = new MockWsf();
wsEn = wsf.GetWsFromStr("en");
wsFrn = wsf.GetWsFromStr("fr");
ITsPropsBldr propBldr = TsPropsBldrClass.Create();
propBldr.SetIntPropValues((int)FwTextPropType.ktptWs, (int)FwTextPropVar.ktpvDefault, wsFrn);
ttpFrn = propBldr.GetTextProps();
}