检索连接器信息
Contents
[
Hide
]
VSTO
下面是获取连接器信息的代码:
foreach (Visio.Connect Connect in Application.ActiveDocument.Pages[1].Connects)
{
MessageBox.Show("\nFrom Shape ID : " + Connect.FromSheet);
MessageBox.Show("To Shape ID : " + Connect.ToSheet);
}
Aspose.Diagram
这连接对象表示连接 Visio 绘图页上两个形状的连接器。 Connects 属性,由页类支持 Aspose.Diagram.Connect 对象的集合。此属性可用于检索有关连接器的 ID 和名称信息。
下面是使用Aspose.Diagram .NET获取连接器信息的代码:
//Call the diagram constructor to load diagram from a VDX file
Diagram vdxDiagram = new Diagram(@"E:\Aspose\Aspose Vs VSTO\Aspose.Diagram Vs VSTO Visio v1.1\Sample Files\Drawing1.vdx");
foreach (Aspose.Diagram.Connect connector in vdxDiagram.Pages[1].Connects)
{
//Display information about the Connectors
Console.WriteLine("\nFrom Shape ID : " + connector.FromSheet);
Console.WriteLine("To Shape ID : " + connector.ToSheet);
}
Console.ReadLine();