本文整理汇总了C#中DocProject.GetViewInheritance方法的典型用法代码示例。如果您正苦于以下问题:C# DocProject.GetViewInheritance方法的具体用法?C# DocProject.GetViewInheritance怎么用?C# DocProject.GetViewInheritance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DocProject
的用法示例。
在下文中一共展示了DocProject.GetViewInheritance方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
//.........这里部分代码省略.........
}
}
}
}
this.ctlRules.Project = this.m_project;
this.ctlRules.BaseTemplate = this.m_parent as DocTemplateDefinition;
this.ctlRules.Template = docTemplate;
this.ctlOperators.Project = this.m_project;
this.ctlOperators.Template = docTemplate;
this.ctlOperators.Rule = null;
}
else if (docObject is DocConceptRoot)
{
this.tabControl.TabPages.Add(this.tabPageConceptRoot);
DocConceptRoot docRoot = (DocConceptRoot)docObject;
//DocEntity docEntity = (DocEntity)this.m_parent;
DocEntity docEntity = docRoot.ApplicableEntity;
DocModelView docView = null;
foreach (DocModelView docViewEach in this.m_project.ModelViews)
{
if (docViewEach.ConceptRoots.Contains(docRoot))
{
docView = docViewEach;
break;
}
}
DocModelView[] listViews = docProject.GetViewInheritance(docView); ;
// find all inherited concepts
List<DocTemplateDefinition> listTemplate = new List<DocTemplateDefinition>();
Dictionary<DocTemplateDefinition, DocEntity> mapTemplate = new Dictionary<DocTemplateDefinition, DocEntity>();
Dictionary<DocTemplateDefinition, DocModelView> mapView = new Dictionary<DocTemplateDefinition, DocModelView>();
while (docEntity != null)
{
foreach (DocModelView docSuperView in listViews)
{
foreach (DocConceptRoot docRootEach in docSuperView.ConceptRoots)
{
if (docRootEach.ApplicableEntity == docEntity)
{
foreach (DocTemplateUsage docConcept in docRootEach.Concepts)
{
if (docConcept.Definition != null)
{
if (listTemplate.Contains(docConcept.Definition))
{
listTemplate.Remove(docConcept.Definition);
}
listTemplate.Insert(0, docConcept.Definition);
mapTemplate[docConcept.Definition] = docEntity;
mapView[docConcept.Definition] = docSuperView;
}
}
}
}
}
// recurse upwards
示例2: FormatEntityConcepts
private static string FormatEntityConcepts(
DocProject docProject,
DocEntity entity,
Dictionary<string, DocObject> mapEntity,
Dictionary<string, string> mapSchema,
Dictionary<DocObject, bool> included,
List<ContentRef> listFigures,
List<ContentRef> listTables)
{
StringBuilder sb = new StringBuilder();
// find concepts for entity
foreach (DocModelView docView in docProject.ModelViews)
{
if (included == null || included.ContainsKey(docView))
{
// check if there are any applicable concepts
bool hasConceptsAtEntity = false;
foreach (DocConceptRoot docRoot in docView.ConceptRoots)
{
if (docRoot.ApplicableEntity == entity)
{
hasConceptsAtEntity = true;
}
}
// inherited use definitions
// build list of inherited views
DocModelView[] listViews = docProject.GetViewInheritance(docView);
List<string> listLines = new List<string>();
Dictionary<DocTemplateDefinition, DocTemplateUsage> mapSuper = new Dictionary<DocTemplateDefinition, DocTemplateUsage>();
List<DocTemplateDefinition> listSuppress = new List<DocTemplateDefinition>();
DocEntity docSuper = entity;
while (docSuper != null)
{
// find parent concept roots
bool renderclass = false;
foreach (DocModelView docViewBase in listViews)
{
foreach (DocConceptRoot docSuperRoot in docViewBase.ConceptRoots)
{
if (docSuperRoot.ApplicableEntity == docSuper)
{
StringBuilder sbSuper = new StringBuilder();
string schema = mapSchema[docSuper.Name].ToLower();
if (!renderclass)
{
renderclass = true;
sbSuper.Append("<tr><td colspan=\"3\">");
sbSuper.Append("<a href=\"../../" + schema + "/lexical/" + MakeLinkName(docSuper) + ".htm\">");
if (docSuper.IsAbstract())
{
sbSuper.Append("<i>");
sbSuper.Append(docSuper.Name);
sbSuper.Append("</i>");
}
else
{
sbSuper.Append(docSuper.Name);
}
sbSuper.Append("</a></td></tr>");
}
foreach (DocTemplateUsage docSuperUsage in docSuperRoot.Concepts)
{
if (docSuperUsage.Suppress && !listSuppress.Contains(docSuperUsage.Definition))
{
listSuppress.Add(docSuperUsage.Definition);
}
else if (docSuperUsage.Definition != null && !mapSuper.ContainsKey(docSuperUsage.Definition))
{
bool suppress = listSuppress.Contains(docSuperUsage.Definition);
sbSuper.Append("<tr><td> </td><td>");
mapSuper.Add(docSuperUsage.Definition, docSuperUsage);
string templateid = MakeLinkName(docSuperUsage.Definition);
sbSuper.Append("<a href=\"../../");
sbSuper.Append(schema);
sbSuper.Append("/lexical/" + MakeLinkName(docSuper) + ".htm#" + templateid + "\">");
if (suppress)
{
sbSuper.Append("<del>");
}
sbSuper.Append(docSuperUsage.Definition.Name);
if (suppress)
{
sbSuper.Append("</del>");
}
sbSuper.Append("</a>");
sbSuper.Append("</td><td>");
sbSuper.Append(docViewBase.Name);
//.........这里部分代码省略.........
示例3: GenerateDocumentation
//.........这里部分代码省略.........
"<div class=\"menu\">\r\n" +
"<table class=\"menu\" summary=\"Table of Contents\">\r\n");
// top level
htmSectionTOC.WriteLine("<tr class=\"std\"><td class=\"menu\">" + chAnnex + ". <a class=\"listing-link\" href=\"annex-" + chAnnex.ToString().ToLower() + ".htm\" target=\"info\" >" + docannex.Name + "</a></td></tr>\r\n");
switch (chAnnex)
{
case 'A':
// each MVD has specific schema
//if (Properties.Settings.Default.ConceptTables)
{
int iCodeView = 0;
foreach (DocModelView docModelView in docProject.ModelViews)
{
if ((included == null || included.ContainsKey(docModelView)) && !String.IsNullOrEmpty(docModelView.Code))
{
iCodeView++;
htmTOC.WriteTOC(1, "<a class=\"listing-link\" href=\"annex/annex-a/" + MakeLinkName(docModelView) + "/index.htm\" >A." + iCodeView.ToString() + " " + docModelView.Name + "</a>");
htmSectionTOC.WriteLine("<tr><td> </td></tr>");
htmSectionTOC.WriteLine("<tr class=\"std\"><td class=\"menu\">A." + iCodeView.ToString() + " <a href=\"annex-a/" + MakeLinkName(docModelView) + "/index.htm\" target=\"info\" >" + docModelView.Name + "</a></td></tr>");
// create page for model view
string pathRoot = path + @"\annex\annex-a\" + MakeLinkName(docModelView) + @"\index.htm";
using (FormatHTM htmRoot = new FormatHTM(pathRoot, mapEntity, mapSchema, included))
{
htmRoot.WriteComputerListing(docModelView.Name, docModelView.Code, iCodeView);
}
// show filtered schemas for model views only if exchanges defined
if (Properties.Settings.Default.ConceptTables)
{
DocModelView[] modelviews = docProject.GetViewInheritance(docModelView);
DoExport(docProject, path + @"\annex\annex-a\" + MakeLinkName(docModelView) + @"\" + docModelView.Code + ".exp", modelviews, locales, instances);
DoExport(docProject, path + @"\annex\annex-a\" + MakeLinkName(docModelView) + @"\" + docModelView.Code + ".xsd", modelviews, locales, instances);
DoExport(docProject, path + @"\annex\annex-a\" + MakeLinkName(docModelView) + @"\" + docModelView.Code + ".ifc", modelviews, locales, instances);
DoExport(docProject, path + @"\annex\annex-a\" + MakeLinkName(docModelView) + @"\" + docModelView.Code + ".ifcxml", modelviews, locales, instances);
DoExport(docProject, path + @"\annex\annex-a\" + MakeLinkName(docModelView) + @"\" + docModelView.Code + ".xml", modelviews, locales, instances);
using (FormatHTM htmExpress = new FormatHTM(path + @"\annex\annex-a\" + MakeLinkName(docModelView) + @"\" + docModelView.Code + ".exp.htm", mapEntity, mapSchema, included))
{
htmExpress.UseAnchors = true;
htmExpress.WriteHeader("EXPRESS", 3);
htmExpress.WriteExpressSchema(docProject);
htmExpress.WriteFooter("");
}
// Future: write XSD with html markup...
using (FormatHTM htmXSD = new FormatHTM(path + @"\annex\annex-a\" + MakeLinkName(docModelView) + @"\" + docModelView.Code + ".xsd.htm", mapEntity, mapSchema, included))
{
string xsdcontent = null;
using (System.IO.StreamReader reader = new System.IO.StreamReader(path + @"\annex\annex-a\" + MakeLinkName(docModelView) + @"\" + docModelView.Code + ".xsd"))
{
xsdcontent = reader.ReadToEnd();
}
htmXSD.UseAnchors = false;
htmXSD.WriteHeader("XSD", 3);
htmXSD.WriteFormatted(xsdcontent);
htmXSD.WriteFooter("");
}
}
DoExport(docProject, path + @"\annex\annex-a\" + MakeLinkName(docModelView) + @"\" + docModelView.Code + ".mvdxml", new DocModelView[] { docModelView }, locales, instances);
示例4: FormatEntityConcepts
private static string FormatEntityConcepts(
DocProject docProject,
DocEntity entity,
Dictionary<string, DocObject> mapEntity,
Dictionary<string, string> mapSchema,
Dictionary<DocObject, bool> included,
List<ContentRef> listFigures,
List<ContentRef> listTables,
string path,
DocPublication docPublication)
{
StringBuilder sb = new StringBuilder();
// find concepts for entity
foreach (DocModelView docView in docProject.ModelViews)
{
if (included == null || included.ContainsKey(docView))
{
// check if there are any applicable concepts
bool hasConceptsAtEntity = false;
foreach (DocConceptRoot docRoot in docView.ConceptRoots)
{
if (docRoot.ApplicableEntity == entity)
{
hasConceptsAtEntity = true;
}
}
// inherited use definitions
// build list of inherited views
DocModelView[] listViews = docProject.GetViewInheritance(docView);
List<string> listLines = new List<string>();
Dictionary<DocTemplateDefinition, DocTemplateUsage> mapSuper = new Dictionary<DocTemplateDefinition, DocTemplateUsage>();
List<DocTemplateDefinition> listSuppress = new List<DocTemplateDefinition>();
List<DocTemplateDefinition> listOverride = new List<DocTemplateDefinition>();
DocEntity docSuper = entity;
while (docSuper != null)
{
StringBuilder sbSuper = new StringBuilder();
// find parent concept roots
bool renderclass = false;
foreach (DocModelView docViewBase in listViews)
{
foreach (DocConceptRoot docSuperRoot in docViewBase.ConceptRoots)
{
if (docSuperRoot.ApplicableEntity == docSuper)
{
string schema = mapSchema[docSuper.Name].ToLower();
foreach (DocTemplateUsage docSuperUsage in docSuperRoot.Concepts)
{
bool flag = false;
if (docSuperUsage.Suppress)
{
if (!listSuppress.Contains(docSuperUsage.Definition))
{
listSuppress.Add(docSuperUsage.Definition);
flag = true;
}
}
else if (docSuperUsage.Override)
{
if (!listOverride.Contains(docSuperUsage.Definition))
{
listOverride.Add(docSuperUsage.Definition);
flag = true;
}
}
if (docSuperUsage.Definition != null && !mapSuper.ContainsKey(docSuperUsage.Definition) && !docSuperUsage.Suppress)
{
if (!renderclass)
{
renderclass = true;
sbSuper.Append("<tr><td colspan=\"3\">");
sbSuper.Append("<a href=\"../../" + schema + "/lexical/" + MakeLinkName(docSuper) + ".htm\">");
if (docSuper.IsAbstract())
{
sbSuper.Append("<i>");
sbSuper.Append(docSuper.Name);
sbSuper.Append("</i>");
}
else
{
sbSuper.Append(docSuper.Name);
}
sbSuper.Append("</a></td></tr>");
}
bool suppress = listSuppress.Contains(docSuperUsage.Definition);
bool overiden = listOverride.Contains(docSuperUsage.Definition);
foreach(DocTemplateDefinition dtd in listSuppress)
{
if (docSuperUsage.Definition == dtd || docSuperUsage.Definition.Templates.Contains(dtd))
{
//.........这里部分代码省略.........