Esempio n. 1
0
        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;
            }
        }
Esempio n. 2
0
        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;
            }
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
 internal void ChangeToViewNetwork(InfraReader netWork)
 {
     managedObjects = new NetworkViewData();
     managedObjects.CreateViewObjectsFor(netWork);
 }
Esempio n. 5
0
 public void SetIntialNetwork(InfraReader infra)
 {
     networkView.ChangeToViewNetwork(infra);
 }