本文整理汇总了C#中IVwEnv类的典型用法代码示例。如果您正苦于以下问题:C# IVwEnv类的具体用法?C# IVwEnv怎么用?C# IVwEnv使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IVwEnv类属于命名空间,在下文中一共展示了IVwEnv类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Display
/// ------------------------------------------------------------------------------------
/// <summary>
///
/// </summary>
/// <param name="vwenv"></param>
/// <param name="hvo"></param>
/// <param name="frag"></param>
/// ------------------------------------------------------------------------------------
public override void Display(IVwEnv vwenv, int hvo, int frag)
{
int frWs = vwenv.DataAccess.WritingSystemFactory.GetWsFromStr("fr");
int hvoOuter, tag, ihvo;
ITsString tss;
switch (frag)
{
case 1: // A ScrBook; display the title.
vwenv.AddObjProp(ScrBookTags.kflidTitle, this, 2);
break;
case 2: // An StText; display the paragraphs.
vwenv.GetOuterObject(vwenv.EmbeddingLevel - 1, out hvoOuter, out tag, out ihvo);
tss = TsStringHelper.MakeTSS(
"Hvo = " + hvoOuter + "; Tag = " + tag + "; Ihvo = " + ihvo,
frWs);
vwenv.AddString(tss);
vwenv.AddObjVecItems(StTextTags.kflidParagraphs, this, 3);
break;
case 3: // StTxtPara, display details of our outer object
vwenv.GetOuterObject(vwenv.EmbeddingLevel - 1, out hvoOuter, out tag, out ihvo);
tss = TsStringHelper.MakeTSS(
"Hvo = " + hvoOuter + "; Tag = " + tag + "; Ihvo = " + ihvo,
frWs);
vwenv.AddString(tss);
break;
default:
throw new ApplicationException("Unexpected frag in DummyCollectorEnvVc");
}
}
示例2: Display
/// ------------------------------------------------------------------------------------
/// <summary>
///
/// </summary>
/// <param name="vwenv"></param>
/// <param name="hvo"></param>
/// <param name="frag"></param>
/// ------------------------------------------------------------------------------------
public override void Display(IVwEnv vwenv, int hvo, int frag)
{
CheckDisposed();
int hvoOuter, tag, ihvo;
ITsString tss;
switch (frag)
{
case 1: // A ScrBook; display the title.
vwenv.AddObjProp((int)ScrBook.ScrBookTags.kflidTitle, this, 2);
break;
case 2: // An StText; display the paragraphs.
vwenv.GetOuterObject(vwenv.EmbeddingLevel - 1, out hvoOuter, out tag, out ihvo);
tss = TsStringHelper.MakeTSS(
"Hvo = " + hvoOuter + "; Tag = " + tag + "; Ihvo = " + ihvo,
InMemoryFdoCache.s_wsHvos.Fr);
vwenv.AddString(tss);
vwenv.AddObjVecItems((int)StText.StTextTags.kflidParagraphs, this, 3);
break;
case 3: // StTxtPara, display details of our outer object
vwenv.GetOuterObject(vwenv.EmbeddingLevel - 1, out hvoOuter, out tag, out ihvo);
tss = TsStringHelper.MakeTSS(
"Hvo = " + hvoOuter + "; Tag = " + tag + "; Ihvo = " + ihvo,
InMemoryFdoCache.s_wsHvos.Fr);
vwenv.AddString(tss);
break;
default:
throw new ApplicationException("Unexpected frag in DummyCollectorEnvVc");
}
}
示例3: Display
/// ------------------------------------------------------------------------------------
/// <summary>
/// This is the main interesting method of displaying objects and fragments of them.
/// A Scripture is displayed by displaying its Books;
/// and a Book is displayed by displaying its Title and Sections;
/// and a Section is diplayed by displaying its Heading and Content;
/// which are displayed by using the standard view constructor for StText.
/// </summary>
/// <param name="vwenv"></param>
/// <param name="hvo"></param>
/// <param name="frag"></param>
/// ------------------------------------------------------------------------------------
public override void Display(IVwEnv vwenv, int hvo, int frag)
{
CheckDisposed();
if (hvo == 0)
return; // not much we can display without a valid object
switch (frag)
{
case (int)ScrFrags.kfrBook:
vwenv.OpenDiv();
vwenv.AddObjProp((int)ScrBook.ScrBookTags.kflidTitle, this,
(int)StTextFrags.kfrText);
vwenv.NoteDependency(new int[] { m_cache.LangProject.TranslatedScriptureOAHvo },
new int[] { (int)Scripture.ScriptureTags.kflidScriptureBooks }, 1);
vwenv.NoteDependency(new int[] { hvo },
new int[] { (int)ScrBook.ScrBookTags.kflidSections }, 1);
vwenv.AddLazyVecItems(m_sectionTag, this, (int)ScrFrags.kfrSection);
// TODO (EberhardB): The gap between the intro division and the text
// division probably needs to be configurable somewhere...
// Add a 24 point gap at the bottom of the intro section
vwenv.AddSimpleRect(ColorUtil.ConvertColorToBGR(BackColor), -1, 24000, 0);
vwenv.CloseDiv();
break;
default:
base.Display(vwenv, hvo, frag);
break;
}
}
示例4: Display
public override void Display(IVwEnv vwenv, int hvo, int frag)
{
switch (frag)
{
default:
break;
case kfrBook:
vwenv.set_IntProperty((int)FwKernelLib.FwTextPropType.ktptFontSize, (int)FwKernelLib.FwTextPropVar.ktpvMilliPoint, 24000);
vwenv.set_IntProperty((int)FwKernelLib.FwTextPropType.ktptBold, (int)FwKernelLib.FwTextPropVar.ktpvEnum,
(int)FwKernelLib.FwTextToggleVal.kttvOn);
vwenv.set_IntProperty((int)FwKernelLib.FwTextPropType.ktptAlign, (int)FwKernelLib.FwTextPropVar.ktpvEnum,
(int)FwKernelLib.FwTextAlign.ktalCenter);
vwenv.AddStringProp(ktagBookName, this);
vwenv.AddLazyVecItems(ktagBookSections, this, kfrSection);
break;
case kfrSection:
vwenv.set_IntProperty((int)FwKernelLib.FwTextPropType.ktptItalic, (int)FwKernelLib.FwTextPropVar.ktpvEnum,
(int)FwKernelLib.FwTextToggleVal.kttvOn);
vwenv.OpenParagraph();
vwenv.AddStringProp(ktagSectionTitle, this);
vwenv.AddString(m_tssLeftParen);
vwenv.AddStringProp(ktagSectionRefs, this);
vwenv.AddString(m_tssRightParen);
vwenv.CloseParagraph();
vwenv.AddLazyVecItems(ktagSectionParas, this, kfrDoublePara);
break;
case kfrDoublePara:
AddDoublePara(vwenv, hvo);
// Now insert an interlinear version of the paragraph. This is basically editable.
vwenv.set_IntProperty((int)FwKernelLib.FwTextPropType.ktptBackColor,
(int)FwKernelLib.FwTextPropVar.ktpvDefault, m_colorEditable);
vwenv.OpenParagraph();
vwenv.AddObjVecItems(ktagParaBundles, this, kfrBundle);
vwenv.CloseParagraph();
break;
case kfrBundle:
// Put a little space after each bundle to separate them.
vwenv.set_IntProperty((int)FwKernelLib.FwTextPropType.ktptMarginTrailing,
(int)FwKernelLib.FwTextPropVar.ktpvMilliPoint, 5000);
vwenv.OpenInnerPile();
vwenv.AddStringProp(ktagBundleBase, this);
vwenv.set_IntProperty((int)FwKernelLib.FwTextPropType.ktptBold,
(int)FwKernelLib.FwTextPropVar.ktpvEnum,
(int)FwKernelLib.FwTextToggleVal.kttvOn);
vwenv.set_IntProperty((int)FwKernelLib.FwTextPropType.ktptFontSize,
(int)FwKernelLib.FwTextPropVar.ktpvMilliPoint, 13000);
vwenv.AddStringProp(ktagBundleIdiom, this);
vwenv.set_IntProperty((int)FwKernelLib.FwTextPropType.ktptFontSize,
(int)FwKernelLib.FwTextPropVar.ktpvMilliPoint, 8000);
vwenv.AddStringProp(ktagBundleLing, this);
vwenv.CloseInnerPile();
break;
}
}
示例5: HvoOfObjectToDisplay
protected override int HvoOfObjectToDisplay(IVwEnv vwenv, int hvo)
{
ISilDataAccess sda = vwenv.DataAccess;
int chvo = sda.get_VecSize(hvo, m_flid);
if (chvo < 1)
return 0;
else
return sda.get_VecItem(hvo, m_flid, 0);
}
示例6: Display
public override void Display(IVwEnv vwenv, int hvo, int frag)
{
switch (frag)
{
default:
break;
case HelloViewView.kfrText:
vwenv.AddStringProp(HelloViewView.ktagProp, this);
break;
}
}
示例7: HvoOfObjectToDisplay
protected override int HvoOfObjectToDisplay(IVwEnv vwenv, int hvo)
{
ISilDataAccess sda = vwenv.DataAccess;
int chvo = sda.get_VecSize(hvo, m_flid);
if (chvo < 2)
return 0;
int hvoItem = sda.get_VecItem(hvo, m_flid, 0);
if (hvoItem == m_hvoDisplayParent)
hvoItem = sda.get_VecItem(hvo, m_flid, 1);
return hvoItem;
}
示例8: XmlVcDisplayVec
/// <summary>
/// The method object's constructor.
/// </summary>
/// <param name="vc">The view constructor</param>
/// <param name="vwenv">The view environment</param>
/// <param name="hvo">A handle on the root object</param>
/// <param name="flid">The field ID</param>
/// <param name="frag">A code identifying the current part of the display</param>
public XmlVcDisplayVec(XmlVc vc, IVwEnv vwenv, int hvo, int flid, int frag)
{
m_viewConstructor = vc;
m_vwEnv = vwenv;
m_hvo = hvo;
m_flid = flid;
m_frag = frag;
m_cache = m_viewConstructor.Cache;
m_sda = m_viewConstructor.DataAccess;
if (vwenv.DataAccess != null)
m_sda = vwenv.DataAccess;
m_objRepo = m_cache.ServiceLocator.GetInstance<ICmObjectRepository>();
m_stringTable = m_viewConstructor.StringTbl;
}
示例9: DisplayVec
/// <summary>
/// Calling vwenv.AddObjVec() in Display() and implementing DisplayVec() seems to
/// work better than calling vwenv.AddObjVecItems() in Display(). Theoretically
/// this should not be case, but experience trumps theory every time. :-) :-(
/// </summary>
public override void DisplayVec(IVwEnv vwenv, int hvo, int tag, int frag)
{
CheckDisposed();
ISilDataAccess da = vwenv.DataAccess;
int count = da.get_VecSize(hvo, tag);
// Tree Branches consist of everything FOLLOWING the first element which is the Tree root.
for (int i = 1; i < count; ++i)
{
vwenv.AddObj(da.get_VecItem(hvo, tag, i), this,
VectorReferenceView.kfragTargetObj);
vwenv.AddSeparatorBar();
}
}
示例10: Display
/// ------------------------------------------------------------------------------------
/// <summary>
/// Displays the specified vwenv.
/// </summary>
/// <param name="vwenv">The vwenv.</param>
/// <param name="hvo">The hvo.</param>
/// <param name="frag">The frag.</param>
/// ------------------------------------------------------------------------------------
public override void Display(IVwEnv vwenv, int hvo, int frag)
{
switch(frag)
{
case kfragLazyScripture:
{
// The configure method insists on trying to make an initial selection.
// If there isn't something selectable there, it expands everything.
vwenv.AddStringProp(ScriptureTags.kflidChapterLabel, this);
vwenv.AddLazyVecItems(ScriptureTags.kflidScriptureBooks, this,
kfragLazyBook);
break;
}
case kfragLazyBook:
{
vwenv.AddLazyVecItems(ScrBookTags.kflidSections, this,
kfragDummySection);
break;
}
case kfragDummySection:
{
vwenv.AddObjProp(ScrSectionTags.kflidHeading, this,
kfragDummyStText);
vwenv.AddObjProp(ScrSectionTags.kflidContent, this,
kfragDummyStText);
break;
}
case kfragDummyStText:
{
vwenv.AddObjVecItems(StTextTags.kflidParagraphs, this,
m_fParaWithContent ? kfragDummyParaWithContent : kfragDummyPara);
break;
}
case kfragDummyPara:
{
// Display each dummy paragraph as a rectangle an inch high, which allows us
// to accurately predict the height of a known number of them.
vwenv.AddSimpleRect(0, MiscUtils.kdzmpInch, MiscUtils.kdzmpInch, 0);
break;
}
case kfragDummyParaWithContent:
{
vwenv.OpenMappedTaggedPara();
vwenv.AddStringProp(StTxtParaTags.kflidContents, null);
vwenv.CloseParagraph();
break;
}
}
}
示例11: Display
/// ------------------------------------------------------------------------------------
/// <summary>
/// Display some simple rectangles to represent a header and a footer.
/// </summary>
/// <param name="vwenv"></param>
/// <param name="hvo"></param>
/// <param name="frag"></param>
/// ------------------------------------------------------------------------------------
public override void Display(IVwEnv vwenv, int hvo, int frag)
{
// Display each dummy header or footer as a rectangle, which allows us
// to accurately predict the height.
switch(hvo)
{
case DummyHeaderFooterConfigurer.khvoHeader:
vwenv.AddSimpleRect(0, MiscUtils.kdzmpInch, MiscUtils.kdzmpInch / 4, 0);
break;
case DummyHeaderFooterConfigurer.khvoFooter:
vwenv.AddSimpleRect(0, MiscUtils.kdzmpInch, MiscUtils.kdzmpInch, 0);
break;
default:
Assert.Fail();
break;
}
}
示例12: Display
/// ------------------------------------------------------------------------------------
/// <summary>
/// This is the main interesting method of displaying objects and fragments of them.
/// Scripture Footnotes are displayed by displaying each footnote's reference and text.
/// The text is displayed using the standard view constructor for StText.
/// </summary>
/// <param name="vwenv"></param>
/// <param name="hvo"></param>
/// <param name="frag"></param>
/// ------------------------------------------------------------------------------------
public override void Display(IVwEnv vwenv, int hvo, int frag)
{
switch (frag)
{
case (int)FootnoteFrags.kfrScripture:
{
vwenv.AddLazyVecItems(ScriptureTags.kflidScriptureBooks,
this, (int)FootnoteFrags.kfrBook);
break;
}
case (int)FootnoteFrags.kfrBook:
{
vwenv.AddObjVecItems(ScrBookTags.kflidFootnotes, m_stvc,
(int)StTextFrags.kfrFootnote);
break;
}
default:
Debug.Assert(false);
break;
}
}
示例13: Display
public override void Display(IVwEnv vwenv, int hvo, int frag)
{
switch (frag)
{
default:
break;
case InterlinearView.kfrText:
vwenv.OpenParagraph();
vwenv.AddObjVecItems(InterlinearView.ktagText_Words, this, InterlinearView.kfrWord);
vwenv.CloseParagraph();
break;
case InterlinearView.kfrWord:
vwenv.set_IntProperty((int)FwKernelLib.FwTextPropType.ktptMarginTrailing,
(int)FwKernelLib.FwTextPropVar.ktpvMilliPoint, 10000);
vwenv.OpenInnerPile();
vwenv.AddStringProp(InterlinearView.ktagWord_Form, this);
vwenv.AddStringProp(InterlinearView.ktagWord_Type, this);
vwenv.CloseInnerPile();
break;
}
}
示例14: Display
/// ------------------------------------------------------------------------------------
/// <summary>
/// Displays the specified vwenv.
/// </summary>
/// <param name="vwenv">The vwenv.</param>
/// <param name="hvo">The hvo.</param>
/// <param name="frag">The frag.</param>
/// ------------------------------------------------------------------------------------
public override void Display(IVwEnv vwenv, int hvo, int frag)
{
CheckDisposed();
switch (frag)
{
case kfragScrFootnotes:
{
vwenv.AddObjVecItems((int)Scripture.ScriptureTags.kflidScriptureBooks, this,
kfragBookFootnotes);
break;
}
case kfragBookFootnotes:
{
vwenv.AddObjVecItems((int)ScrBook.ScrBookTags.kflidFootnotes, this,
kfragFootnote);
break;
}
case kfragFootnote:
{
// Display each dummy footnote as a rectangle a half inch high, which allows us
// to accurately predict the height of a known number of them. Also put in a very
// short editable string, which we use for some other tests, but should not
// affect the paragraph height.
vwenv.set_IntProperty((int)FwTextPropType.ktptMarginTop,
(int)FwTextPropVar.ktpvMilliPoint, MiscUtils.kdzmpInch / 10);
vwenv.set_IntProperty((int)FwTextPropType.ktptMarginBottom,
(int)FwTextPropVar.ktpvMilliPoint, MiscUtils.kdzmpInch / 5);
vwenv.OpenParagraph();
if (m_fWantStrings)
vwenv.AddStringProp((int)StFootnote.StFootnoteTags.kflidFootnoteMarker, this);
vwenv.AddSimpleRect(0, MiscUtils.kdzmpInch / 2, MiscUtils.kdzmpInch / 2, 0);
vwenv.CloseParagraph();
break;
}
}
}
示例15: Display
/// ------------------------------------------------------------------------------------
/// <summary>
/// This is the main interesting method of displaying objects and fragments of them.
/// A Scripture is displayed by displaying its Books;
/// and a Book is displayed by displaying its Title and Sections;
/// and a Section is diplayed by displaying its Heading and Content;
/// which are displayed by using the standard view constructor for StText.
/// </summary>
/// <param name="vwenv"></param>
/// <param name="hvo"></param>
/// <param name="frag"></param>
/// ------------------------------------------------------------------------------------
public override void Display(IVwEnv vwenv, int hvo, int frag)
{
CheckDisposed();
if (hvo == 0)
return; // not much we can display without a valid object
switch (frag)
{
case (int)ScrFrags.kfrBook:
vwenv.OpenDiv();
vwenv.NoteDependency(new int[] { m_cache.LanguageProject.TranslatedScriptureOA.Hvo },
new int[] { ScriptureTags.kflidScriptureBooks }, 1);
vwenv.NoteDependency(new int[] { hvo },
new int[] { ScrBookTags.kflidSections }, 1);
vwenv.AddLazyVecItems(ScrBookTags.kflidSections, this, (int)ScrFrags.kfrSection);
vwenv.CloseDiv();
break;
default:
base.Display(vwenv, hvo, frag);
break;
}
}