本文整理汇总了C#中VisioAutomation.WriteVerbose方法的典型用法代码示例。如果您正苦于以下问题:C# VisioAutomation.WriteVerbose方法的具体用法?C# VisioAutomation.WriteVerbose怎么用?C# VisioAutomation.WriteVerbose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VisioAutomation
的用法示例。
在下文中一共展示了VisioAutomation.WriteVerbose方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadFromXML
public static IList<DGMODEL.Drawing> LoadFromXML(VA.Scripting.Client client, SXL.XDocument xmldoc)
{
var pagedatas = LoadPageDataFromXML(client, xmldoc);
// STOP IF ANY ERRORS
int num_errors = pagedatas.Select(pagedata => pagedata.Errors.Count).Sum();
if (num_errors > 1)
{
foreach (var pagedata in pagedatas)
{
foreach (var error in pagedata.Errors)
{
client.WriteVerbose( error.Text);
}
client.WriteVerbose( "Errors encountered in shape data. Stopping.");
}
}
// DRAW EACH PAGE
foreach (var pagedata in pagedatas)
{
client.WriteVerbose( "Creating shape AutoLayout nodes");
foreach (var shape_info in pagedata.ShapeInfos)
{
var dg_shape = pagedata.DirectedGraph.AddShape(shape_info.ID, shape_info.Label, shape_info.Stencil, shape_info.Master);
dg_shape.URL = shape_info.URL;
dg_shape.CustomProperties = new Dictionary<string, VACUSTPROP.CustomPropertyCells>();
foreach (var kv in shape_info.custprops)
{
dg_shape.CustomProperties[kv.Key] = kv.Value;
}
}
client.WriteVerbose( "Creating connector AutoLayout nodes");
foreach (var con_info in pagedata.ConnectorInfos)
{
var def_connector_type = VACXN.ConnectorType.Curved;
var connectory_type = def_connector_type;
var from_shape = pagedata.DirectedGraph.Shapes.Find(con_info.From);
var to_shape = pagedata.DirectedGraph.Shapes.Find(con_info.To);
var def_con_color = new VA.Drawing.ColorRGB(0x000000);
var def_con_weight = 1.0/72.0;
var def_end_arrow = 2;
var dg_connector = pagedata.DirectedGraph.Connect(con_info.ID, from_shape, to_shape, con_info.Label, connectory_type);
dg_connector.Cells = new VA.DOM.ShapeCells();
dg_connector.Cells.LineColor = con_info.Element.AttributeAsColor("color", def_con_color).ToFormula();
dg_connector.Cells.LineWeight = con_info.Element.AttributeAsInches("weight", def_con_weight);
dg_connector.Cells.EndArrow = def_end_arrow;
}
client.WriteVerbose( "Rendering AutoLayout...");
}
client.WriteVerbose( "Finished rendering AutoLayout");
var directedgraphs = pagedatas.Select(pagedata => pagedata.DirectedGraph).ToList();
return directedgraphs;
}
示例2: LoadPageDataFromXML
private static List<PageData> LoadPageDataFromXML(VA.Scripting.Client client, SXL.XDocument xmldoc)
{
var pagedatas = new List<PageData>();
// LOAD and ANALYZE EACH PAGE
int pagenum = 0;
var page_els = xmldoc.Root.Elements("page");
foreach (var page_el in page_els)
{
var node_ids = new HashSet<string>();
var con_ids = new HashSet<string>();
var pagedata = new PageData();
pagedatas.Add(pagedata);
pagedata.Errors = new List<BuilderError>();
pagedata.LayoutOptions = new VA.Models.DirectedGraph.MSAGLLayoutOptions();
var renderoptions_el = page_el.Element("renderoptions");
GetRenderOptionsFromXml(renderoptions_el, pagedata.LayoutOptions);
pagedata.DirectedGraph = new DGMODEL.Drawing();
var shape_els = page_el.Element("shapes").Elements("shape");
var con_els = page_el.Element("connectors").Elements("connector");
pagedata.ShapeInfos = shape_els.Select(e => ShapeInfo.FromXml(client, e)).ToList();
pagedata.ConnectorInfos = con_els.Select(e => ConnectorInfo.FromXml(client, e)).ToList();
client.WriteVerbose( "Analyzing shape data for page {0}", pagenum);
foreach (var shape_info in pagedata.ShapeInfos)
{
client.WriteVerbose( "shape {0}", shape_info.ID);
if (node_ids.Contains(shape_info.ID))
{
pagedata.Errors.Add(BuilderError.NodeAlreadyDefined(pagenum, shape_info.ID));
}
else
{
node_ids.Add(shape_info.ID);
}
}
client.WriteVerbose( "Analyzing connector data...");
foreach (var con_info in pagedata.ConnectorInfos)
{
client.WriteVerbose( "connector {0}", con_info.ID);
if (con_ids.Contains(con_info.ID))
{
pagedata.Errors.Add(BuilderError.ConnectorAlreadyDefined(pagenum, con_info.ID));
}
else
{
con_ids.Add(con_info.ID);
}
if (!node_ids.Contains(con_info.From))
{
pagedata.Errors.Add(BuilderError.InvalidFromNode(pagenum, con_info.ID, con_info.From));
}
if (!node_ids.Contains(con_info.To))
{
pagedata.Errors.Add(BuilderError.InvalidToNode(pagenum, con_info.ID, con_info.To));
}
}
}
return pagedatas;
}