Exemplo n.º 1
0
        public void Load()
        {
            IEnumerator enumerator  = null;
            IEnumerator enumerator1 = null;
            string      str         = string.Format("{0}Data/System/Altitude.xml", AppDomain.CurrentDomain.BaseDirectory);
            XmlDocument xmlDocument = new XmlDocument();

            try
            {
                xmlDocument.Load(str);
                this.i_AltitudeTable.Clear();
                try
                {
                    enumerator1 = xmlDocument.SelectNodes("Altitudes").GetEnumerator();
                    while (enumerator1.MoveNext())
                    {
                        XmlElement current = (XmlElement)enumerator1.Current;
                        try
                        {
                            enumerator = current.SelectNodes("Altitude").GetEnumerator();
                            while (enumerator.MoveNext())
                            {
                                ClsElevation clsAltitude = new ClsElevation((XmlElement)enumerator.Current);
                                this.i_AltitudeTable.Add(clsAltitude.Key, clsAltitude);
                            }
                        }
                        finally
                        {
                            if (enumerator is IDisposable)
                            {
                                ((IDisposable)enumerator).Dispose();
                            }
                        }
                    }
                }
                finally
                {
                    if (enumerator1 is IDisposable)
                    {
                        ((IDisposable)enumerator1).Dispose();
                    }
                }
            }
            catch (Exception exception)
            {
                ProjectData.SetProjectError(exception);
                Interaction.MsgBox(string.Format("XMLFile:{0}", str), MsgBoxStyle.OkOnly, null);
                ProjectData.ClearProjectError();
            }
        }
Exemplo n.º 2
0
        public void Display(ListBox iList)
        {
            IEnumerator enumerator = null;

            iList.Items.Clear();
            try
            {
                enumerator = this.i_AltitudeTable.Values.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    ClsElevation current = (ClsElevation)enumerator.Current;
                    iList.Items.Add(current);
                }
            }
            finally
            {
                if (enumerator is IDisposable)
                {
                    ((IDisposable)enumerator).Dispose();
                }
            }
        }
Exemplo n.º 3
0
        public ColorPalette GetAltPalette()
        {
            IEnumerator  enumerator = null;
            ColorPalette palette    = (new Bitmap(2, 2, PixelFormat.Format8bppIndexed)).Palette;

            try
            {
                enumerator = this.i_AltitudeTable.Values.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    ClsElevation current = (ClsElevation)enumerator.Current;
                    palette.Entries[current.Key] = current.AltitudeColor;
                }
            }
            finally
            {
                if (enumerator is IDisposable)
                {
                    ((IDisposable)enumerator).Dispose();
                }
            }
            return(palette);
        }
 public void Load()
 {
     IEnumerator enumerator = null;
     IEnumerator enumerator1 = null;
     string str = string.Format("{0}Data/System/Altitude.xml", AppDomain.CurrentDomain.BaseDirectory);
     XmlDocument xmlDocument = new XmlDocument();
     try
     {
         xmlDocument.Load(str);
         this.i_AltitudeTable.Clear();
         try
         {
             enumerator1 = xmlDocument.SelectNodes("Altitudes").GetEnumerator();
             while (enumerator1.MoveNext())
             {
                 XmlElement current = (XmlElement)enumerator1.Current;
                 try
                 {
                     enumerator = current.SelectNodes("Altitude").GetEnumerator();
                     while (enumerator.MoveNext())
                     {
                         ClsElevation clsAltitude = new ClsElevation((XmlElement)enumerator.Current);
                         this.i_AltitudeTable.Add(clsAltitude.Key, clsAltitude);
                     }
                 }
                 finally
                 {
                     if (enumerator is IDisposable)
                     {
                         ((IDisposable)enumerator).Dispose();
                     }
                 }
             }
         }
         finally
         {
             if (enumerator1 is IDisposable)
             {
                 ((IDisposable)enumerator1).Dispose();
             }
         }
     }
     catch (Exception exception)
     {
         ProjectData.SetProjectError(exception);
         Interaction.MsgBox(string.Format("XMLFile:{0}", str), MsgBoxStyle.OkOnly, null);
         ProjectData.ClearProjectError();
     }
 }
 public void SetAltitude(int Index, ClsElevation Value)
 {
     this.i_AltitudeTable[Index] = Value;
 }
Exemplo n.º 6
0
 public void SetAltitude(int Index, ClsElevation Value)
 {
     this.i_AltitudeTable[Index] = Value;
 }