本文整理汇总了C#中IVwEnv.CloseSpan方法的典型用法代码示例。如果您正苦于以下问题:C# IVwEnv.CloseSpan方法的具体用法?C# IVwEnv.CloseSpan怎么用?C# IVwEnv.CloseSpan使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVwEnv
的用法示例。
在下文中一共展示了IVwEnv.CloseSpan方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DisplayClausePlaceholder
private void DisplayClausePlaceholder(IVwEnv vwenv, int hvoClause)
{
string clauseType = GetRowStyleName(vwenv, hvoClause) + "Mkr";
ApplyFormatting(vwenv, clauseType);
vwenv.OpenSpan();
InsertOpenBracket(vwenv, clauseType);
vwenv.AddObjVec(kflidAppliesTo, this, kfragClauseLabels);
InsertCloseBracket(vwenv, clauseType);
vwenv.CloseSpan();
}
示例2: AddWsLabel
/// <summary>
/// Add to the current display (a paragraph should be open) a label followed by colon, in the standard style,
/// that identifies a particular writing system from the current list.
/// </summary>
/// <param name="vwenv"></param>
/// <param name="iws"></param>
public void AddWsLabel(IVwEnv vwenv, int iws)
{
CheckDisposed();
if (m_tssColon == null)
{
ITsStrFactory tsf = TsStrFactoryClass.Create();
m_tssColon = tsf.MakeString(": ", m_lp.Cache.DefaultUserWs);
}
if (m_ttpLabelStyle == null)
{
m_ttpLabelStyle = LanguageCodeStyle;
}
vwenv.Props = m_ttpLabelStyle;
vwenv.OpenSpan();
vwenv.AddString(AnalysisWsLabels[iws]);
vwenv.AddString(m_tssColon);
vwenv.CloseSpan();
}
示例3: DisplayMovedTextTag
private void DisplayMovedTextTag(int hvo, IVwEnv vwenv)
{
string formatTag1 = m_chart.Logic.MovedTextTag(vwenv.DataAccess.get_VecItem(hvo,
kflidAppliesTo, 0)) + "Mkr";
ApplyFormatting(vwenv, formatTag1);
vwenv.OpenSpan();
InsertOpenBracket(vwenv, formatTag1);
vwenv.AddStringAltMember((int)CmAnnotation.CmAnnotationTags.kflidComment,
m_cache.DefaultUserWs, this); // Enhance JohnT: what if that has changed??
InsertCloseBracket(vwenv, formatTag1);
vwenv.CloseSpan();
}
示例4: Display
public override void Display(IVwEnv vwenv, int hvo, int frag)
{
switch (frag)
{
case kfragPrintChart: // the whole chart with headings for printing.
if (hvo == 0)
return;
PrintColumnGroupHeaders(hvo, vwenv);
PrintIndividualColumnHeaders(hvo, vwenv);
// Rest is same as kfragChart
DisplayChartBody(vwenv);
break;
case kfragTemplateHeader: // Display the template as group headers.
vwenv.AddObjVecItems((int)CmPossibility.CmPossibilityTags.kflidSubPossibilities, this, kfragColumnGroupHeader);
break;
// This is only used for printing, the headers in the screen version are a separate control.
case kfragColumnGroupHeader:
int ccols = vwenv.DataAccess.get_VecSize(hvo, (int)CmPossibility.CmPossibilityTags.kflidSubPossibilities);
// If there are no subitems, we still want a blank cell as a placeholder.
MakeCellsMethod.OpenStandardCell(vwenv, Math.Max(ccols, 1), true);
if (ccols > 0)
{
// It's a group, include its name
vwenv.set_IntProperty((int)FwTextPropType.ktptAlign, (int)FwTextPropVar.ktpvEnum,
(int)FwTextAlign.ktalCenter);
vwenv.OpenParagraph();
vwenv.AddString(CmPossibility.BestAnalysisName(m_cache, hvo));
vwenv.CloseParagraph();
}
vwenv.CloseTableCell();
break;
case kfragChart: // the whole chart, a DsConstChart.
if (hvo == 0)
return;
DisplayChartBody(vwenv);
break;
case kfragChartRow: // one row, a CmIndirectAnnotation
{
MakeTableAndRowWithStdWidths(vwenv, hvo, false);
MakeCells(vwenv, hvo);
vwenv.CloseTableRow();
vwenv.CloseTable();
}
break;
case kfragCca: // a single group of words, the contents of one cell.
if (ConstituentChartLogic.IsWficGroup(m_cache, hvo))
vwenv.AddObjVec(kflidAppliesTo, this, kfragBundleVec);
else
{
// it's a moved text or missing-item placeholder.
int hvoClause;
if (m_chart.Logic.IsClausePlaceholder(hvo, out hvoClause))
DisplayClausePlaceholder(vwenv, hvoClause);
else if (vwenv.DataAccess.get_VecSize(hvo, kflidAppliesTo) == 0)
DisplayMissingMarker(vwenv);
else
DisplayMovedTextTag(hvo, vwenv);
}
break;
case kfragCcaMoved: // a single group of words, the contents of one cell, which is considered moved-within-line.
// can't be a placeholder.
string formatTag = m_chart.Logic.MovedTextTag(hvo);
ApplyFormatting(vwenv, formatTag);
vwenv.OpenSpan();
InsertOpenBracket(vwenv, formatTag);
vwenv.AddObjVec(kflidAppliesTo, this, kfragBundleVec);
InsertCloseBracket(vwenv, formatTag);
vwenv.CloseSpan();
break;
case kfragCcaListItem: // a single CCA, referring to a list item.
// can't be a placeholder.
ApplyFormatting(vwenv, "marker");
vwenv.OpenSpan();
InsertOpenBracket(vwenv, "marker");
vwenv.AddObjProp((int)CmBaseAnnotation.CmBaseAnnotationTags.kflidBeginObject,
this, kfragPossibility);
InsertCloseBracket(vwenv, "marker");
vwenv.CloseSpan();
break;
case kfragPossibility: // A CmPossibility, show it's abbreviation
int flid = (int)CmPossibility.CmPossibilityTags.kflidAbbreviation;
int retWs;
m_cache.LangProject.GetMagicStringAlt(LangProject.kwsFirstAnal, hvo, flid, false, out retWs);
// If we didn't find an abbreviation try for the name
ITsString tss = null;
if (retWs != 0)
tss = m_cache.GetMultiStringAlt(hvo, flid, retWs);
if (tss == null || string.IsNullOrEmpty(tss.Text))
{
flid = (int)CmPossibility.CmPossibilityTags.kflidName;
m_cache.LangProject.GetMagicStringAlt(LangProject.kwsFirstAnal, hvo, flid, false, out retWs);
}
// Unless we didn't get anything, go ahead and insert the best option we found.
if (retWs != 0)
vwenv.AddStringAltMember(flid, retWs, this);
// retWS was m_cache.DefaultAnalWs, this fixes LT-7838
break;
case kfragBundle: // One annotated word bundle; hvo is CmBaseAnnotation. Overrides behavior of InterlinVc
//.........这里部分代码省略.........
示例5: Display
public override void Display(IVwEnv vwenv, int hvo, int frag)
{
switch (frag)
{
case kfragPrintChart: // the whole chart with headings for printing.
if (hvo == 0)
return;
PrintColumnGroupHeaders(hvo, vwenv);
PrintIndividualColumnHeaders(hvo, vwenv);
// Rest is same as kfragChart
DisplayChartBody(vwenv);
break;
case kfragTemplateHeader: // Display the template as group headers.
vwenv.AddObjVecItems(CmPossibilityTags.kflidSubPossibilities, this, kfragColumnGroupHeader);
break;
// This is only used for printing, the headers in the screen version are a separate control.
case kfragColumnGroupHeader:
var ccols = vwenv.DataAccess.get_VecSize(hvo, CmPossibilityTags.kflidSubPossibilities);
// If there are no subitems, we still want a blank cell as a placeholder.
MakeCellsMethod.OpenStandardCell(vwenv, Math.Max(ccols, 1), true);
if (ccols > 0)
{
// It's a group, include its name
var possGroup = m_cache.ServiceLocator.GetInstance<ICmPossibilityRepository>().GetObject(hvo);
vwenv.set_IntProperty((int) FwTextPropType.ktptAlign, (int) FwTextPropVar.ktpvEnum,
(int) FwTextAlign.ktalCenter);
vwenv.OpenParagraph();
vwenv.AddString(possGroup.Name.BestAnalysisAlternative);
vwenv.CloseParagraph();
}
vwenv.CloseTableCell();
break;
case kfragChart: // the whole chart, a DsConstChart.
if (hvo == 0)
return;
DisplayChartBody(vwenv);
break;
case kfragChartRow: // one row, a ConstChartRow
{
MakeTableAndRowWithStdWidths(vwenv, hvo, false);
MakeCells(vwenv, hvo);
vwenv.CloseTableRow();
vwenv.CloseTable();
}
break;
case kfragCellPart: // a single group of words, the contents of one cell.
if (m_chart.Logic.IsWordGroup(hvo))
DisplayWordforms(vwenv, hvo);
else
{
// it's a moved text or clause reference placeholder.
int hvoClause;
if (m_chart.Logic.IsClausePlaceholder(hvo, out hvoClause))
DisplayClausePlaceholder(vwenv, hvoClause);
else
DisplayMovedTextTag(hvo, vwenv);
}
break;
case kfragMovedTextCellPart: // a single group of words (ConstChartWordGroup),
// the contents of one cell, which is considered moved-within-line.
// Can't be a placeholder.
var formatTag = m_chart.Logic.MovedTextTag(hvo);
ApplyFormatting(vwenv, formatTag);
vwenv.OpenSpan();
InsertOpenBracket(vwenv, formatTag);
DisplayWordforms(vwenv, hvo);
InsertCloseBracket(vwenv, formatTag);
vwenv.CloseSpan();
break;
case kfragChartListItem: // a single ConstChartTag, referring to a list item.
// can't be a placeholder.
ApplyFormatting(vwenv, "marker");
vwenv.OpenSpan();
InsertOpenBracket(vwenv, "marker");
vwenv.AddObjProp(ConstChartTagTags.kflidTag, this, kfragPossibility);
InsertCloseBracket(vwenv, "marker");
vwenv.CloseSpan();
break;
case kfragPossibility: // A CmPossibility, show it's abbreviation
var flid = CmPossibilityTags.kflidAbbreviation;
var retWs = WritingSystemServices.ActualWs(m_cache, WritingSystemServices.kwsFirstAnal, hvo, flid);
if (retWs == 0)
{
// No Abbreviation! Switch to Name
flid = CmPossibilityTags.kflidName;
retWs = WritingSystemServices.ActualWs(m_cache, WritingSystemServices.kwsFirstAnal, hvo, flid);
}
// Unless we didn't get anything, go ahead and insert the best option we found.
if (retWs != 0)
vwenv.AddStringAltMember(flid, retWs, this);
break;
case kfragBundle: // One annotated word bundle; hvo is IAnalysis object. Overrides behavior of InterlinVc
AddWordBundleInternal(hvo, vwenv);
break;
case kfragNotesString: // notes text
vwenv.AddStringProp(ConstChartRowTags.kflidNotes, this);
break;
case kfragComment: // hvo is a ConstChartRow
//.........这里部分代码省略.........
示例6: DisplayMovedTextTag
private void DisplayMovedTextTag(int hvo, IVwEnv vwenv)
{
// hvo is a ConstChartMovedTextMarker
var mtt = m_partRepo.GetObject(hvo) as IConstChartMovedTextMarker;
Debug.Assert(mtt != null, "Hvo is not for a MovedText Marker.");
var formatTag1 = m_chart.Logic.MovedTextTag(mtt.WordGroupRA.Hvo) + "Mkr";
ApplyFormatting(vwenv, formatTag1);
vwenv.OpenSpan();
InsertOpenBracket(vwenv, formatTag1);
vwenv.AddObj(hvo, this, kfragMTMarker);
InsertCloseBracket(vwenv, formatTag1);
vwenv.CloseSpan();
}
示例7: AddWsLabel
/// <summary>
/// Add to the current display (a paragraph should be open) a label followed by colon, in the standard style,
/// that identifies a particular writing system from the current list.
/// </summary>
/// <param name="vwenv"></param>
/// <param name="iws"></param>
public void AddWsLabel(IVwEnv vwenv, int iws)
{
CheckDisposed();
if (m_tssColon == null)
{
ITsStrFactory tsf = TsStrFactoryClass.Create();
m_tssColon = tsf.MakeString(": ", m_lp.Cache.DefaultUserWs);
}
if (m_ttpLabelStyle == null)
{
ITsPropsFactory tpf = TsPropsFactoryClass.Create();
// Get a ttp invoking the style "Language Code" style for the writing system
// which corresponds to the user's environment.
m_ttpLabelStyle = tpf.MakeProps("Language Code", m_lp.Cache.DefaultUserWs, 0);
}
vwenv.Props = m_ttpLabelStyle;
vwenv.OpenSpan();
vwenv.AddString(AnalysisWsLabels[iws]);
vwenv.AddString(m_tssColon);
vwenv.CloseSpan();
}