本文整理汇总了C#中EA.SaveDiagram方法的典型用法代码示例。如果您正苦于以下问题:C# EA.SaveDiagram方法的具体用法?C# EA.SaveDiagram怎么用?C# EA.SaveDiagram使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EA
的用法示例。
在下文中一共展示了EA.SaveDiagram方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetLineStyleDiagram
//--------------------------------------------------------------------------------------------------------------
// SetLineStyleDiagram Set line style for a diagram (all visible connectors)
//--------------------------------------------------------------------------------------------------------------
// linestyle
// LH = "Line Style: Lateral Horizontal";
// LV = "Line Style: Lateral Vertical";
// TH = "Line Style: Tree Horizontal";
// TV = "Line Style: Tree Vertical";
// OS = "Line Style: Orthogonal Square";
// OR = Orthogonal Round
// A = Automatic
// D = Direct
// C = Customer
public static void SetLineStyleDiagram(EA.Repository rep, EA.Diagram d, string lineStyle)
{
// store current diagram
rep.SaveDiagram(d.DiagramID);
// all links
foreach (EA.DiagramLink link in d.DiagramLinks)
{
if (link.IsHidden == false)
{
SetLineStyleForDiagramLink(lineStyle, link);
}
}
rep.ReloadDiagram(d.DiagramID);
}
示例2: SetLineStyleDiagramObjectsAndConnectors
//--------------------------------------------------------------------------------------------------------------
// SetLineStyleDiagramObjectsAndConnectors Set line style for diagram objects and connectors
//--------------------------------------------------------------------------------------------------------------
// linestyle
// LH = "Line Style: Lateral Horizontal";
// LV = "Line Style: Lateral Vertical";
// TH = "Line Style: Tree Horizontal";
// TV = "Line Style: Tree Vertical";
// OS = "Line Style: Orthogonal Square";
// OR = Orthogonal Round
// A = Automatic
// D = Direct
// C = Customer
// B = Bezier
public static void SetLineStyleDiagramObjectsAndConnectors(EA.Repository rep, EA.Diagram d, string lineStyle)
{
EA.Collection selectedObjects = d.SelectedObjects;
EA.Connector selectedConnector = d.SelectedConnector;
// store current diagram
rep.SaveDiagram(d.DiagramID);
foreach (EA.DiagramLink link in d.DiagramLinks)
{
if (link.IsHidden == false)
{
// check if connector is connected with diagram object
EA.Connector c = rep.GetConnectorByID(link.ConnectorID);
foreach (EA.DiagramObject dObject in d.SelectedObjects)
{
if (c.ClientID == dObject.ElementID | c.SupplierID == dObject.ElementID)
{
SetLineStyleForDiagramLink(lineStyle, link);
}
}
if (selectedConnector != null)
{
if (c.ConnectorID == selectedConnector.ConnectorID)
{
SetLineStyleForDiagramLink(lineStyle, link);
continue;
}
}
}
}
rep.ReloadDiagram(d.DiagramID);
if (selectedConnector != null) d.SelectedConnector = selectedConnector;
foreach (EA.DiagramObject dObject in selectedObjects)
{
//d.SelectedObjects.AddNew(el.ElementID.ToString(), el.Type);
d.SelectedObjects.AddNew(dObject.ElementID.ToString(), dObject.ObjectType.ToString());
}
//d.Update();
d.SelectedObjects.Refresh();
}