• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# VisioAutomation类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中VisioAutomation的典型用法代码示例。如果您正苦于以下问题:C# VisioAutomation类的具体用法?C# VisioAutomation怎么用?C# VisioAutomation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



VisioAutomation类属于命名空间,在下文中一共展示了VisioAutomation类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: PieSlice

 public PieSlice(VA.Drawing.Point p0, double r, double start, double end)
 {
     this.Center = p0;
     this.Radius = r;
     this.Start = start;
     this.End = end;
 }
开发者ID:firestream99,项目名称:VisioAutomation,代码行数:7,代码来源:PieSlice.cs


示例2: Snap

 public VA.Drawing.Size Snap(VA.Drawing.Size size)
 {
     double x;
     double y;
     this.SnapXY(size.Width,size.Height,out x, out y);
     return new VA.Drawing.Size(x, y);
 }
开发者ID:firestream99,项目名称:VisioAutomation,代码行数:7,代码来源:SnappingGrid.cs


示例3: AddElementEx

        public static VA.Text.Markup.TextElement AddElementEx(this VA.Text.Markup.TextElement p, string text,
                                                              int? font, double? size, int? color,
                                                              VA.Drawing.AlignmentHorizontal? halign,
                                                              VA.Text.CharStyle? cs)
        {
            var el = p.AddElement(text);
            if (font != null)
            {
                el.CharacterCells.Font = font.Value;
            }
            if (size.HasValue)
            {
                el.CharacterCells.Size = string.Format("{0}pt",size.Value);
            }
            if (color.HasValue)
            {
                var c = new VA.Drawing.ColorRGB(color.Value);
                el.CharacterCells.Color = c.ToFormula();
            }
            if (halign.HasValue)
            {
                el.ParagraphCells.HorizontalAlign = (int) halign.Value;
            }

            if (cs.HasValue)
            {
                el.CharacterCells.Style = (int) cs;
            }

            return el;
        }
开发者ID:shekharssorot2002,项目名称:VisioAutomation2.0,代码行数:31,代码来源:extensions.cs


示例4: GetPointAtRadius

 public static VA.Drawing.Point GetPointAtRadius(VA.Drawing.Point origin, double angle, double radius)
 {
     var new_point = new VA.Drawing.Point(radius*System.Math.Cos(angle),
                                  radius*System.Math.Sin(angle));
     new_point = origin + new_point;
     return new_point;
 }
开发者ID:shekharssorot2002,项目名称:VisioAutomation2.0,代码行数:7,代码来源:PlaygroundSamples.cs


示例5: FromEllipse

        public static BezierCurve FromEllipse(VA.Drawing.Point center, VA.Drawing.Size radius)
        {
            var pt1 = new VA.Drawing.Point(0, radius.Height); // top
            var pt2 = new VA.Drawing.Point(radius.Width, 0); // right
            var pt3 = new VA.Drawing.Point(0, -radius.Height); // bottom
            var pt4 = new VA.Drawing.Point(-radius.Width, 0); // left

            double dx = radius.Width * 4.0 * (System.Math.Sqrt(2) - 1) / 3;
            double dy = radius.Height * 4.0 * (System.Math.Sqrt(2) - 1) / 3;

            var curve_ControlPoints = new []
                                      {
                                          pt1,
                                          pt1.Add(dx, 0),
                                          pt2.Add(0, dy),
                                          pt2,
                                          pt2.Add(0, -dy),
                                          pt3.Add(dx, 0),
                                          pt3,
                                          pt3.Add(-dx, 0),
                                          pt4.Add(0, -dy),
                                          pt4,
                                          pt4.Add(0, dy),
                                          pt1.Add(-dx, 0),
                                          pt1
                                      }
                .Select(p => p + center).ToArray();
            var curve_Degree = 3;

            var curve = new BezierCurve(curve_ControlPoints, curve_Degree);
            return curve;
        }
开发者ID:firestream99,项目名称:VisioAutomation,代码行数:32,代码来源:BezierCurve.cs


示例6: SetViewRect

 public static void SetViewRect(
     this IVisio.Window window,
     VA.Drawing.Rectangle rect)
 {
     // MSDN: http://msdn.microsoft.com/en-us/library/office/ms367542(v=office.14).aspx
     window.SetViewRect(rect.Left, rect.Top, rect.Width, rect.Height);
 }
开发者ID:firestream99,项目名称:VisioAutomation,代码行数:7,代码来源:WindowMethods.cs


示例7: DrawNode

 public static void DrawNode(
     BoxL.Node node,
     VA.Drawing.Rectangle rect, IVisio.Page page)
 {           
     var shape = page.DrawRectangle(rect);
     node.Data = shape;
 }
开发者ID:shekharssorot2002,项目名称:VisioAutomation2.0,代码行数:7,代码来源:BoxLayoutShared.cs


示例8: TestResize

        private static void TestResize(IVisio.Document doc, 
            VA.Drawing.Size bottomleft_margin, 
            VA.Drawing.Size upperright_margin, 
            VA.Drawing.Size shape_size, 
            VA.Drawing.Size padding_size,  
            double expected_pinx, 
            double expected_piny)
        {
            var page = doc.Pages.Add();

            var pagecells = new VA.Pages.PageCells();
            pagecells.PageTopMargin = upperright_margin.Height;
            pagecells.PageBottomMargin = bottomleft_margin.Height;
            pagecells.PageLeftMargin = bottomleft_margin.Width;
            pagecells.PageRightMargin = upperright_margin.Width;

            var pageupdate = new VA.ShapeSheet.Update();
            pageupdate.SetFormulas(pagecells);
            pageupdate.Execute(page.PageSheet);

            var shape = page.DrawRectangle(5, 5, 5 + shape_size.Width, 5+shape_size.Height);
            page.ResizeToFitContents(padding_size);
            var xform = VA.Shapes.XFormCells.GetCells(shape);
            AssertVA.AreEqual(expected_pinx, expected_piny, xform.Pin(), 0.1);
            page.Delete(0);
        }
开发者ID:firestream99,项目名称:VisioAutomation,代码行数:26,代码来源:ResizePageTests.cs


示例9: Apply

 public void Apply(VA.ShapeSheet.Update update, short shapeid_label, short shapeid_box)
 {
     update.SetFormulas(shapeid_label, this.CharacterCells, 0);
     update.SetFormulas(shapeid_label, this.ParagraphCells, 0);
     update.SetFormulas(shapeid_box, this.FormatCells);
     update.SetFormulas(shapeid_label, this.TextCells);
 }
开发者ID:firestream99,项目名称:VisioAutomation,代码行数:7,代码来源:Formatting.cs


示例10: AddConnection

        public Connector AddConnection(string id, Shape from, Shape to, string label,
            VA.Shapes.Connections.ConnectorType type, int beginArrow, int endArrow, string hyperlink)
        {
            var new_connector = new Connector(from, to);
            new_connector.ID = id;
            new_connector.Label = label;
            new_connector.ConnectorType = type;
            new_connector.Cells = new VA.DOM.ShapeCells();
            new_connector.Cells.BeginArrow = beginArrow;
            new_connector.Cells.BeginArrowSize = beginArrow;
            new_connector.Cells.EndArrow = endArrow;
            new_connector.Cells.EndArrowSize = endArrow;

            if (!string.IsNullOrEmpty(hyperlink))
            {

                //new_connector.VisioShape = IVisio.Shape; // IVisio.Shape();
                var h = new_connector.VisioShape.Hyperlinks.Add();

                h.Name = hyperlink; // Name of Hyperlink
                h.Address = hyperlink; // Address of Hyperlink
            }

            this.Connectors.Add(id, new_connector);
            return new_connector;
        }
开发者ID:firestream99,项目名称:VisioAutomation,代码行数:26,代码来源:Drawing.cs


示例11: 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;
        }
开发者ID:firestream99,项目名称:VisioAutomation,代码行数:59,代码来源:DirectedGraphBuilder.cs


示例12: PieChart

 public PieChart(VA.Drawing.Rectangle rect)
 {
     var center = rect.Center;
     var radius = System.Math.Min(rect.Width,rect.Height)/2.0;
     this.DataPoints = new DataPointList();
     this.Center = center;
     this.Radius = radius;
 }
开发者ID:firestream99,项目名称:VisioAutomation,代码行数:8,代码来源:PieChart.cs


示例13: BezierSegment

 public BezierSegment(VA.Drawing.Point start, VA.Drawing.Point handle1, VA.Drawing.Point handle2, VA.Drawing.Point end)
     : this()
 {
     this.Start = start;
     this.Handle1 = handle1;
     this.Handle2 = handle2;
     this.End = end;
 }
开发者ID:firestream99,项目名称:VisioAutomation,代码行数:8,代码来源:BezierSegment.cs


示例14: ApplyFormus

 public void ApplyFormus(VA.ShapeSheet.Update update)
 {
     short titleshape_id = this.VisioShape.ID16;
     update.SetFormulas(titleshape_id, this.Textcells);
     update.SetFormulas(titleshape_id, this.ParagraphCells, 0);
     update.SetFormulas(titleshape_id, this.CharacterCells, 0);
     update.SetFormulas(titleshape_id, this.FormatCells);
 }
开发者ID:firestream99,项目名称:VisioAutomation,代码行数:8,代码来源:TextBlock.cs


示例15: Arc

 public Arc(VA.Drawing.Point p0, double ri, double ro, double start, double end)
 {
     this.Center = p0;
     this.InnerRadius = ri;
     this.OuterRadius = ro;
     this.StartAngle = start;
     this.EndAngle = end;
 }
开发者ID:firestream99,项目名称:VisioAutomation,代码行数:8,代码来源:Arc.cs


示例16: Drop

 public static IVisio.Shape Drop(
     this IVisio.Page page,
     IVisio.Master master,
     VA.Drawing.Point point)
 {
     var surface = new VA.Drawing.DrawingSurface(page);
     return surface.Drop(master, point);
 }
开发者ID:firestream99,项目名称:VisioAutomation,代码行数:8,代码来源:PageMethods.cs


示例17: XYToPage

 public static VA.Drawing.Point XYToPage(this IVisio.Shape shape, VA.Drawing.Point xy)
 {
     // MSDN: http://msdn.microsoft.com/en-us/library/office/ff766239.aspx
     double xprime;
     double yprime;
     shape.XYToPage(xy.X, xy.Y, out xprime, out yprime);
     return new VA.Drawing.Point(xprime, yprime);
 }
开发者ID:firestream99,项目名称:VisioAutomation,代码行数:8,代码来源:ShapeMethods.cs


示例18: FormatPaintCell

 public FormatPaintCell(VA.ShapeSheet.SRC src, string name, FormatCategory category)
 {
     this.Category = category;
     this.Name = name;
     this.SRC = src;
     this.Formula = null;
     this.Result = null;
 }
开发者ID:firestream99,项目名称:VisioAutomation,代码行数:8,代码来源:FormatPaintCell.cs


示例19: ConnectionPointValues

 internal ConnectionPointValues(int shapeid, VA.Shapes.Connections.ConnectionPointCells point)
 {
     this.ShapeID = shapeid;
     this.Type = point.Type.Formula.Value;
     this.X = point.X.Formula.Value;
     this.Y = point.Y.Formula.Value;
     this.DirX = point.DirX.Formula.Value;
     this.DirY = point.DirY.Formula.Value;
 }
开发者ID:firestream99,项目名称:VisioAutomation,代码行数:9,代码来源:ConnectionPointValues.cs


示例20: BarChart

        public void BarChart(VA.Models.Charting.BarChart chart)
        {
            this.AssertApplicationAvailable();
            this.AssertDocumentAvailable();

            var application = this.Client.VisioApplication;
            var page = application.ActivePage;
            chart.Render(page);
        }
开发者ID:firestream99,项目名称:VisioAutomation,代码行数:9,代码来源:DrawCommands.cs



注:本文中的VisioAutomation类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# VisionViewBase类代码示例发布时间:2022-05-24
下一篇:
C# Visibility类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap