public void CreateViewObjectsFor(InfraReader netWork) { Dictionary <string, NetworkElement> sourceElements = netWork.NetworkElements; foreach (NetworkElement element in sourceElements.Values) { ViewNetworkElement elementInView = new ViewNetworkElement(element); trackElements[elementInView.ID] = elementInView; } Dictionary <string, PlatformEdge> sourcePlatforms = netWork.PlatformEdges; foreach (PlatformEdge platformEdge in sourcePlatforms.Values) { ViewPlatform platformInView = new ViewPlatform(platformEdge); ViewNetworkElement elementInView = FindMatchingViewElement(platformEdge.Location); if (elementInView != null) { platformInView.OnElement = elementInView; platformInView.UpdateFractions(); } platForms[platformInView.ID] = platformInView; } }
public override void AllElementsConnected(InfraReader infra) { foreach (NetworkElement element in connectedElements) { //Point NetworkElement if (element.From == this) { Point point = element.LogicalStartPoint; if (!point.IsEmpty) { AddPoint(point, counts); } } if (element.To == this) { Point point = element.LogicalEndPoint; if (!point.IsEmpty) { AddPoint(point, counts); } } } Point newLogicalCenter = GetLogicalCenter(counts); if (newLogicalCenter != Point.Empty) { this.logicalCenter = newLogicalCenter; } }
static void Main() { Application.SetHighDpiMode(HighDpiMode.SystemAware); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); InfraReader infra = new InfraReader(); infra.InitFromFile("Infra.xml"); Form1 mainForm = new Form1(); mainForm.SetIntialNetwork(infra); Application.Run(mainForm); }
internal void ChangeToViewNetwork(InfraReader netWork) { managedObjects = new NetworkViewData(); managedObjects.CreateViewObjectsFor(netWork); }
public void SetIntialNetwork(InfraReader infra) { networkView.ChangeToViewNetwork(infra); }