本文整理汇总了C#中DocProject.GetTemplateList方法的典型用法代码示例。如果您正苦于以下问题:C# DocProject.GetTemplateList方法的具体用法?C# DocProject.GetTemplateList怎么用?C# DocProject.GetTemplateList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DocProject
的用法示例。
在下文中一共展示了DocProject.GetTemplateList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckGridExchange
public CheckGridExchange(DocExchangeDefinition docExchange, DocModelView docView, DocProject docProject)
{
this.m_project = docProject;
this.m_view = docView;
this.m_exchange = docExchange;
this.m_listTemplate = docProject.GetTemplateList();
// filter out template list to only those that are currently used
for (int i = this.m_listTemplate.Count - 1; i >= 0; i--)
{
bool used = false;
foreach (DocConceptRoot docRoot in this.m_view.ConceptRoots)
{
foreach (DocTemplateUsage docUsage in docRoot.Concepts)
{
if (docUsage.Definition == this.m_listTemplate[i])
{
used = true;
break;
}
}
}
if (!used)
{
this.m_listTemplate.RemoveAt(i);
}
}
}
示例2: Export
//.........这里部分代码省略.........
{
format.WriteLine("<li>" + key + "</li>");
}
format.WriteLine("</ul>");
format.WriteLine("<h3>6.1.3 Exchange requirement coverage analysis</h3>");
format.WriteLine("<p>Each exchange is listed by name and corresponding classifications for the process undertaken, the sender of the information, and the receiver of the information.</p>");
format.WriteLine("<table class=\"gridtable\">");
format.WriteLine("<tr><th>Exchange</th><th>Process</th><th>Sender</th><th>Receiver</th></tr>");
foreach (DocExchangeDefinition docExchange in docView.Exchanges)
{
format.WriteLine("<tr><td>" + docExchange.Name + "</td><td>" + docExchange.ExchangeClass + "</td><td>" + docExchange.SenderClass + "</td><td>" + docExchange.ReceiverClass);
}
format.WriteLine("</table>");
format.WriteLine("<h2>6.2 Exchange requirements detail</h2>");
format.WriteLine("<h3>6.2.1 Exchange requirements definition</h3>");
format.WriteLine("<p>Each exchange is listed by name and a description of the information contained.</p>");
foreach (DocExchangeDefinition docExchange in docView.Exchanges)
{
format.WriteLine("<h4>" + docExchange.Name + "</h4>");
format.WriteLine(docExchange.Documentation);
}
format.WriteLine("<h3>6.2.2 Business rule list</h3>");
format.WriteLine("<p>Each exchange consists of a set of entity data definitions with usage defined according to business rule concepts. " +
"An entity describes an object class having one or more attributes, where each attribute may refer to values, collections, or references to other objects. "+
"A concept describes usage of object classes, where allowable values and object types are indicated for specific attributes." +
"Each heading that follows refers to an exchange, where each table row corresponds to an entity, each table column corresponds to an exchange, and each cell indicates whether the concept is used for the entity within the exchange.</p>");
foreach (DocExchangeDefinition docExchange in docView.Exchanges)
{
format.WriteLine("<h4>" + docExchange.Name + "</h4>");
List<DocTemplateDefinition> listTemplate = project.GetTemplateList();
List<DocTemplateDefinition> usedTemplate = new List<DocTemplateDefinition>();
foreach (DocConceptRoot docRoot in docView.ConceptRoots)
{
foreach (DocTemplateUsage docConcept in docRoot.Concepts)
{
if (!usedTemplate.Contains(docConcept.Definition))
{
foreach (DocExchangeItem docExchangeItem in docConcept.Exchanges)
{
if (docExchangeItem.Exchange == docExchange &&
(docExchangeItem.Requirement == DocExchangeRequirementEnum.Mandatory || docExchangeItem.Requirement == DocExchangeRequirementEnum.Optional))
{
usedTemplate.Add(docConcept.Definition);
break;
}
}
}
}
}
for(int i = listTemplate.Count - 1; i >= 0; i--)
{
if (!usedTemplate.Contains(listTemplate[i]))
{
listTemplate.RemoveAt(i);
}
}
format.WriteLine("<table class=\"gridtable\">");
format.Write("<tr>");
format.Write("<th>Entity</th>");
示例3: CheckGridEntity
public CheckGridEntity(DocConceptRoot docRoot, DocModelView docView, DocProject docProject, Dictionary<string, DocObject> map)
{
this.m_root = docRoot;
this.m_view = docView;
this.m_project = docProject;
this.m_listTemplate = new List<DocTemplateDefinition>();
List<DocTemplateDefinition> listTemplate = docProject.GetTemplateList();
//... filter out templates to only those that apply to entity...
foreach (DocTemplateDefinition docTemplate in listTemplate)
{
if (docTemplate.Rules != null && docTemplate.Rules.Count > 0) // don't include abstract/organizational templates
{
bool include = false;
// check for inheritance
DocObject docApplicableEntity = null;
if (docTemplate.Type != null && map.TryGetValue(docTemplate.Type, out docApplicableEntity) && docApplicableEntity is DocEntity)
{
// check for inheritance
DocEntity docBase = docRoot.ApplicableEntity;
while (docBase != null)
{
if (docBase == docApplicableEntity)
{
include = true;
break;
}
if (docBase.BaseDefinition == null)
break;
DocObject docEach = null;
if (map.TryGetValue(docBase.BaseDefinition, out docEach))
{
docBase = (DocEntity)docEach;
}
else
{
docBase = null;
}
}
}
if (include)
{
this.m_listTemplate.Add(docTemplate);
}
}
}
}