Exemple #1
0
        public static List<String> GetClassificationList(VSGController control, int rootID)
        {
            List<String> classifications = new List<string>();

            IXPathNavigable iNavClassType = control.GetComponentAndChildren(control.ScenarioId, "Scenario", new ComponentOptions());//.GetComponent("Scenario");
            XPathNavigator navigator = iNavClassType.CreateNavigator();
            XPathNodeIterator itClassifications = navigator.Select("/Components/Component[@Type='Scenario']/Component[@Type='Classification']");
            if (itClassifications.Count > 0)
            {
                while (itClassifications.MoveNext())
                {
                    classifications.Add(itClassifications.Current.GetAttribute("Name", itClassifications.Current.NamespaceURI));
                }
            }

            return classifications;
        }
Exemple #2
0
 public static List<String> GetStatesListBySpecies(VSGController control, int rootID, string linkType, int speciesId)
 {
     List<String> states = new List<string>();
     if (speciesId < 0)
     {
         return states;
     }
     ComponentOptions compOptions = new ComponentOptions();
     IXPathNavigable iNavSpeciesType = control.GetComponentAndChildren(control.ScenarioId, "SpeciesType", compOptions);
     XPathNavigator navSpeciesType = iNavSpeciesType.CreateNavigator();
     XPathNavigator navSpecies = navSpeciesType.SelectSingleNode(String.Format("/Components/Component/Component[@ID='{0}']", speciesId));
     XPathNodeIterator itSpecies = navSpecies.Select("self::*");
     while (itSpecies.MoveNext())
     {
         String id = itSpecies.Current.GetAttribute("ID", itSpecies.Current.NamespaceURI);
         IXPathNavigable iNavScenario = control.GetComponentAndChildren(Int32.Parse(id), "Scenario", compOptions);
         XPathNavigator navScenario = iNavScenario.CreateNavigator();
         XPathNodeIterator itStates = navScenario.Select("/Components/Component[@Type='Species']/Component[@Type='State']");
         while (itStates.MoveNext())
         {
             String name = itStates.Current.GetAttribute("Name", itStates.Current.NamespaceURI);
             if (!states.Contains(name))
                 states.Add(name);
         }
     }
     return states;
 }