コード例 #1
0
 public Town(string name, Country country, State state)
 {
     this.Name = name;
     this.Country = country;
     this.State = state;
 }
コード例 #2
0
ファイル: Setup.cs プロジェクト: tehknox/tap-desktop
        /*!loads the states
         */
        private static void LoadStates()
        {
            XmlDocument doc = new XmlDocument();
            doc.Load(AppSettings.getDataPath() + "\\states.xml");
            XmlElement root = doc.DocumentElement;

            XmlNodeList statesList = root.SelectNodes("//state");
            foreach (XmlElement element in statesList)
            {
                Country country = Countries.GetCountry(element.Attributes["country"].Value);
                string name = element.Attributes["name"].Value;
                string shortname = element.Attributes["shortname"].Value;
                Boolean overseas = false;

                if (element.HasAttribute("overseas"))
                    overseas = Convert.ToBoolean(element.Attributes["overseas"].Value);

                State state = new State(country, name, shortname, overseas);
                state.Flag = AppSettings.getDataPath() + "\\graphics\\flags\\states\\" + element.Attributes["flag"].Value + ".png";

                States.AddState(state);

                if (!File.Exists(state.Flag))
                {
                    name = "";
                }

            }
        }
コード例 #3
0
 public static Town GetTown(string name, State state)
 {
     return Airports.GetAirport(a => a.Profile.Town.Name == name && a.Profile.Town.State == state).Profile.Town;
 }
コード例 #4
0
 //adds a state to the list
 public static void AddState(State state)
 {
     states.Add(state);
 }