Пример #1
0
        public void loadTopology(string xmlPath)
        {
            try
            {
                Config conf = new Config(xmlPath, Constants.Link);
                foreach (List <string> link in conf.links)
                {
                    if (link.Count > 4)
                    {
                        if (domain == link[5] && domain == link[6])
                        {
                            //linkConnections.Add(link[0], new Topology.Link())
                            SNPLink l = new SNPLink(link.ElementAt(1), link.ElementAt(2), link.ElementAt(3), link.ElementAt(4), link.ElementAt(9));
                            resources.Add(link[0], l);
                            links.Items.Add(new SNPLink(link.ElementAt(1), link.ElementAt(2), link.ElementAt(3), link.ElementAt(4), link.ElementAt(9)));
                        }

                        else if (domain == link[5])
                        {
                            SNPLink l = new SNPLink(link.ElementAt(1), link.ElementAt(6), link.ElementAt(3), link.ElementAt(4), link.ElementAt(9));
                            resources.Add(link[0], l);
                            links.Items.Add(new SNPLink(link.ElementAt(1), link.ElementAt(6), link.ElementAt(3), link.ElementAt(4), link.ElementAt(9)));
                        }

                        else if (domain == link[6])
                        {
                            SNPLink l = new SNPLink(link.ElementAt(5), link.ElementAt(2), link.ElementAt(3), link.ElementAt(4), link.ElementAt(9));
                            resources.Add(link[0], l);
                            links.Items.Add(new SNPLink(link.ElementAt(5), link.ElementAt(2), link.ElementAt(3), link.ElementAt(4), link.ElementAt(9)));
                        }
                    }
                }
            }
            catch { }
        }
Пример #2
0
        public void loadTopology(string xmlPath)
        {
            try
            {
                Config conf = new Config(xmlPath, Constants.Link);
                foreach(List<string> link in conf.links)
                {
                    if (link.Count > 4)
                    {
                        if (domain == link[5] && domain == link[6])
                        {
                            //linkConnections.Add(link[0], new Topology.Link())
                            SNPLink l = new SNPLink(link.ElementAt(1), link.ElementAt(2), link.ElementAt(3), link.ElementAt(4), link.ElementAt(9));
                            resources.Add(link[0], l);
                            links.Items.Add(new SNPLink(link.ElementAt(1), link.ElementAt(2), link.ElementAt(3), link.ElementAt(4), link.ElementAt(9)));
                        }

                        else if (domain == link[5])
                        {
                            SNPLink l = new SNPLink(link.ElementAt(1), link.ElementAt(6), link.ElementAt(3), link.ElementAt(4), link.ElementAt(9));
                            resources.Add(link[0], l);
                            links.Items.Add(new SNPLink(link.ElementAt(1), link.ElementAt(6), link.ElementAt(3), link.ElementAt(4), link.ElementAt(9)));
                        }

                        else if (domain == link[6])
                        {
                            SNPLink l = new SNPLink(link.ElementAt(5), link.ElementAt(2), link.ElementAt(3), link.ElementAt(4), link.ElementAt(9));
                            resources.Add(link[0], l);
                            links.Items.Add(new SNPLink(link.ElementAt(5), link.ElementAt(2), link.ElementAt(3), link.ElementAt(4), link.ElementAt(9)));
                        }

                    }
                }
            }
            catch { }
        }