本文整理汇总了C#中DocProject类的典型用法代码示例。如果您正苦于以下问题:C# DocProject类的具体用法?C# DocProject怎么用?C# DocProject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DocProject类属于命名空间,在下文中一共展示了DocProject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateCode
/// <summary>
/// Generates folder of definitions
/// </summary>
/// <param name="path"></param>
public static void GenerateCode(DocProject project, string path)
{
foreach (DocSection docSection in project.Sections)
{
foreach (DocSchema docSchema in docSection.Schemas)
{
foreach (DocType docType in docSchema.Types)
{
using (FormatJAV format = new FormatJAV(path + @"\" + docSchema.Name + @"\" + docType.Name + ".java"))
{
format.Instance = project;
format.Definition = docType;
format.Save();
}
}
foreach (DocEntity docType in docSchema.Entities)
{
using (FormatJAV format = new FormatJAV(path + @"\" + docSchema.Name + @"\" + docType.Name + ".java"))
{
format.Instance = project;
format.Definition = docType;
format.Save();
}
}
}
}
}
示例2: FormSelectSchema
public FormSelectSchema(DocProject project) : this()
{
this.m_project = project;
foreach (DocSection docSection in project.Sections)
{
if (docSection.Schemas.Count > 0)
{
TreeNode tnSection = new TreeNode();
tnSection.Tag = docSection;
tnSection.Text = docSection.Name;
tnSection.ImageIndex = 1;
this.treeView.Nodes.Add(tnSection);
foreach (DocSchema docSchema in docSection.Schemas)
{
TreeNode tnSchema = new TreeNode();
tnSchema.Tag = docSchema;
tnSchema.Text = docSchema.Name;
tnSchema.ImageIndex = 0;
tnSection.Nodes.Add(tnSchema);
}
tnSection.Expand();
}
}
}
示例3: FormSelectPropertyEnum
public FormSelectPropertyEnum(DocProject project, DocPropertyEnumeration selection)
: this()
{
this.m_project = project;
SortedList<string, DocPropertyEnumeration> list = new SortedList<string, DocPropertyEnumeration>();
foreach(DocSection section in project.Sections)
{
foreach(DocSchema schema in section.Schemas)
{
foreach(DocPropertyEnumeration enumeration in schema.PropertyEnums)
{
list.Add(enumeration.Name, enumeration);
}
}
}
foreach (string s in list.Keys)
{
DocPropertyEnumeration enumeration = list[s];
ListViewItem lvi = new ListViewItem();
lvi.Tag = enumeration;
lvi.Text = enumeration.Name;
lvi.ImageIndex = 0;
this.listView.Items.Add(lvi);
if (selection == enumeration)
{
lvi.Selected = true;
}
}
}
示例4: FormatZIP
/// <summary>
///
/// </summary>
/// <param name="stream">Stream for the zip file.</param>
/// <param name="project">Project.</param>
/// <param name="included">Map of included definitions</param>
/// <param name="type">Optional type of data to export, or null for all; DocPropertySet, DocQuantitySet are valid</param>
public FormatZIP(Stream stream, DocProject project, Dictionary<DocObject, bool> included, Type type)
{
this.m_stream = stream;
this.m_project = project;
this.m_included = included;
this.m_type = type;
}
示例5: FormSelectAttribute
public FormSelectAttribute(DocEntity entity, DocProject project, string selection, bool freeform)
: this()
{
this.textBoxAttributeName.Enabled = freeform;
this.textBoxAttributeName.Text = selection;
this.LoadEntity(entity, project, selection);
}
示例6: FormReference
public FormReference(DocProject docProject, DocDefinition docBase, Dictionary<string, DocObject> map, string value)
: this()
{
this.m_project = docProject;
this.m_base = docBase;
this.m_map = map;
// parse value
CvtValuePath valuepath = CvtValuePath.Parse(value, map);
LoadValuePath(valuepath);
}
示例7: FormatData
public string FormatData(DocProject docProject, DocPublication docPublication, DocExchangeDefinition docExchange, Dictionary<string, DocObject> map, Dictionary<long, SEntity> instances, SEntity root, bool markup)
{
this.m_stream = new System.IO.MemoryStream();
this.Instance = root;
this.Markup = markup;
this.Save();
this.m_stream.Position = 0;
StreamReader reader = new StreamReader(this.m_stream);
string content = reader.ReadToEnd();
return content;
}
示例8: TopicMiddleware
public TopicMiddleware(Func<IDictionary<string, object>, Task> inner, DocProject project, IHtmlGenerator generator, DocSettings settings)
{
_inner = inner;
_project = project;
_generator = generator;
_settings = settings;
var stream = Assembly.GetExecutingAssembly()
.GetManifestResourceStream(typeof(TopicMiddleware), "WebsocketsRefresh.txt");
_webSocketScript = stream.ReadAllText();
_topicJS = Assembly.GetExecutingAssembly().GetManifestResourceStream(typeof(Program),"topics.js").ReadAllText();
}
示例9: TopicMiddleware
public TopicMiddleware(DocProject project, IHtmlGenerator generator, DocSettings settings)
{
_project = project;
_generator = generator;
_settings = settings;
var topicAssembly = typeof(TopicMiddleware).GetAssembly();
var stream = topicAssembly.GetManifestResourceStream("dotnet-stdocs.Runner.WebsocketsRefresh.txt");
_webSocketScript = stream.ReadAllText();
_topicJS = topicAssembly.GetManifestResourceStream("dotnet-stdocs.topics.js").ReadAllText();
}
示例10: FormRule
public FormRule(DocModelRule rule, DocProject project, DocTemplateDefinition template)
: this()
{
this.m_rule = rule;
this.m_project = project;
this.m_template = template;
this.Text = this.m_rule.Name;
this.textBoxIdentifier.Text = this.m_rule.Identification;
this.textBoxIdentifier.Enabled = !String.IsNullOrEmpty(this.m_rule.Identification);
if (String.IsNullOrEmpty(this.m_rule.Identification))
{
this.comboBoxUsage.SelectedIndex = 0;
}
else if (this.m_rule.Description != null && this.m_rule.Description.Equals("*"))
{
// convention indicating filter
this.comboBoxUsage.SelectedIndex = 1;
}
else
{
// indicates parameter constraint
this.comboBoxUsage.SelectedIndex = 2;
}
if (this.m_rule.CardinalityMin == 0 && this.m_rule.CardinalityMax == 0)
{
this.comboBoxCardinality.SelectedIndex = 0;
}
else if (this.m_rule.CardinalityMin == -1 && this.m_rule.CardinalityMax == -1)
{
this.comboBoxCardinality.SelectedIndex = 1;
}
else if (this.m_rule.CardinalityMin == 0 && this.m_rule.CardinalityMax == 1)
{
this.comboBoxCardinality.SelectedIndex = 2;
}
else if (this.m_rule.CardinalityMin == 1 && this.m_rule.CardinalityMax == 1)
{
this.comboBoxCardinality.SelectedIndex = 3;
}
else if (this.m_rule.CardinalityMin == 1 && this.m_rule.CardinalityMax == -1)
{
this.comboBoxCardinality.SelectedIndex = 4;
}
this.UpdateBehavior();
}
示例11: LoadEntity
private void LoadEntity(DocEntity entity, DocProject project, string selection)
{
if (entity == null)
return;
// recurse to base
if (entity.BaseDefinition != null)
{
DocEntity docBase = project.GetDefinition(entity.BaseDefinition) as DocEntity;
LoadEntity(docBase, project, selection);
}
// load attributes
foreach (DocAttribute docAttr in entity.Attributes)
{
// if attribute is derived, dont add, but remove existing
if (!String.IsNullOrEmpty(docAttr.Derived))
{
foreach (ListViewItem lvi in this.listView.Items)
{
if (lvi.Text.Equals(docAttr.Name))
{
lvi.Remove();
break;
}
}
}
else
{
ListViewItem lvi = new ListViewItem();
lvi.Tag = docAttr;
lvi.Text = docAttr.Name;
lvi.SubItems.Add(docAttr.DefinedType); // INVERSE / SET / LIST / OPTIONAL...
this.listView.Items.Add(lvi);
if(selection != null && lvi.Text.Equals(selection))
{
lvi.Selected = true;
}
}
}
}
示例12: FormSelectView
/// <summary>
///
/// </summary>
/// <param name="project">The project.</param>
public FormSelectView(DocProject project, string description)
: this()
{
this.m_project = project;
if (description != null)
{
this.labelDescription.Text = description;
}
foreach (DocModelView docView in this.m_project.ModelViews)
{
ListViewItem lvi = new ListViewItem();
lvi.Tag = docView;
lvi.Text = docView.Name;
lvi.ImageIndex = 0;
lvi.SubItems.Add(docView.Version);
this.listView.Items.Add(lvi);
}
}
示例13: FormValidate
public FormValidate(DocProject project, DocModelView docView, DocExchangeDefinition docExchange) : this()
{
this.textBoxPath.Text = Properties.Settings.Default.ValidateFile;
this.checkBoxReport.Checked = Properties.Settings.Default.ValidateReport;
foreach (DocModelView docEachView in project.ModelViews)
{
this.comboBoxView.Items.Add(docEachView);
}
if (docView == null && project.ModelViews.Count > 0)
{
docView = project.ModelViews[0];
}
this.comboBoxView.SelectedItem = docView;
if (docExchange == null && docView != null && docView.Exchanges.Count > 0)
{
docExchange = docView.Exchanges[0];
}
this.comboBoxExchange.SelectedItem = docExchange;
}
示例14: FormSelectPropertyEnum
public FormSelectPropertyEnum(DocProject project, DocPropertyEnumeration selection) : this()
{
this.m_project = project;
foreach(DocSection section in project.Sections)
{
foreach(DocSchema schema in section.Schemas)
{
foreach(DocPropertyEnumeration enumeration in schema.PropertyEnums)
{
ListViewItem lvi = new ListViewItem();
lvi.Tag = enumeration;
lvi.Text = enumeration.Name;
this.listView.Items.Add(lvi);
if (selection == enumeration)
{
lvi.Selected = true;
}
}
}
}
}
示例15: GenerateTemplateImage
private static string GenerateTemplateImage(DocTemplateDefinition docTemplate, Dictionary<string, DocObject> mapEntity, DocProject project, string path)
{
int cx = 0;
int cy = 0;
System.Drawing.Image image = IfcDoc.Format.PNG.FormatPNG.CreateTemplateDiagram(docTemplate, mapEntity, new Dictionary<System.Drawing.Rectangle, DocModelRule>(), project, null);
if (image != null)
{
using (image)
{
cx = image.Width;
cy = image.Height;
string filepath = path + "\\" + docTemplate.Name.ToLower().Replace(' ', '-') + ".png";
image.Save(filepath, System.Drawing.Imaging.ImageFormat.Png);
cx = cx / 2;
cy = cy / 2;
}
}
return "<br/><img src=\"" + docTemplate.Name.ToLower().Replace(' ', '-') + ".png\" width=\"" + cx + "\" height=\"" + cy + "\"/>";
}