コード例 #1
0
        private TreeNode getTreeNodeFromNrlDataSet(XPathNodeIterator iter)
        {
            TreeNode          newNode       = new TreeNode(iter.Current.GetAttribute("Name", ""));
            XPathNodeIterator childDataSets = iter.Current.Select("ChildDataSets");

            if (childDataSets.Count > 0)
            {
                while (childDataSets.MoveNext())
                {
                    XPathNodeIterator childIter = childDataSets.Current.Select("NRL_DataSet");
                    while (childIter.MoveNext())
                    {
                        newNode.Nodes.Add(getTreeNodeFromNrlDataSet(childIter));
                    }
                }
            }
            else
            {
                string            directoryUrl              = getInnerTextFromFirstChild(iter.Current.Select("Directory_Url"));
                string            description               = getInnerTextFromFirstChild(iter.Current.Select("Description"));
                string            keywordFilter             = getInnerTextFromFirstChild(iter.Current.Select("Directory_Keyword_Filter"));
                XPathNodeIterator geographicBoundingBoxIter = iter.Current.Select("GeographicBoundingBox");
                double            north = 0;
                double            south = 0;
                double            west  = 0;
                double            east  = 0;

                if (geographicBoundingBoxIter.Count > 0)
                {
                    geographicBoundingBoxIter.MoveNext();
                    north = double.Parse(getInnerTextFromFirstChild(geographicBoundingBoxIter.Current.Select("North/Value")), System.Globalization.CultureInfo.InvariantCulture);
                    south = double.Parse(getInnerTextFromFirstChild(geographicBoundingBoxIter.Current.Select("South/Value")), System.Globalization.CultureInfo.InvariantCulture);
                    east  = double.Parse(getInnerTextFromFirstChild(geographicBoundingBoxIter.Current.Select("East/Value")), System.Globalization.CultureInfo.InvariantCulture);
                    west  = double.Parse(getInnerTextFromFirstChild(geographicBoundingBoxIter.Current.Select("West/Value")), System.Globalization.CultureInfo.InvariantCulture);

                    NRLDataSet newDataSet = new NRLDataSet(
                        newNode.Text,
                        directoryUrl,
                        description,
                        north,
                        south,
                        east,
                        west,
                        keywordFilter);

                    newNode.Tag = newDataSet;
                }
            }

            return(newNode);
        }
コード例 #2
0
        private void button1_Click(object sender, System.EventArgs e)
        {
            try
            {
                if (this.curSelectedDataSet == null)
                {
                    return;
                }

                this.currentImageList.Clear();
                this.currentAnimatingImages.Clear();
                if (this.imageLayer != null)
                {
                    m_WorldWindow.CurrentWorld.RenderableObjects.Remove(this.imageLayer.Name);
                    this.imageLayer.Dispose();
                    this.imageLayer = null;
                }

                if (this.buttonLoad.Text == "Cancel")
                {
                    this.buttonLoad.Text = "Load";
                }
                else
                {
                    this.currentAnimatingDataSet = this.curSelectedDataSet;

                    if (this.listBox1.SelectedItems.Count > 0)
                    {
                        this.animationTimer.Start();
                        foreach (string item in this.listBox1.SelectedItems)
                        {
                            this.currentImageList.Add(item);
                        }
                        this.buttonLoad.Text  = "Cancel";
                        this.downloaderThread = new System.Threading.Thread(new System.Threading.ThreadStart(this.downloadThreadFunc));
                        this.downloaderThread.IsBackground = true;
                        this.downloaderThread.Start();
                    }
                }
            }
            catch (Exception ex)
            {
                this.statusBar1.Text = "Error";
                Log.Write(ex);
            }
        }
コード例 #3
0
 private void treeView1_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e)
 {
     try
     {
         if (e.Node.Tag != null)
         {
             this.curSelectedDataSet = (NRLDataSet)e.Node.Tag;
             System.Threading.Thread t = new System.Threading.Thread(new System.Threading.ThreadStart(this.UpdateListFromServer));
             t.IsBackground = true;
             t.Start();
         }
         else
         {
             this.curSelectedDataSet = null;
         }
     }
     catch (Exception)
     {
         this.statusBar1.Text = "Error";
     }
 }
コード例 #4
0
ファイル: NRLWeather.cs プロジェクト: jpespartero/WorldWind
		private void treeView1_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e)
		{
			try
			{
				if(e.Node.Tag != null)
				{
					this.curSelectedDataSet = (NRLDataSet)e.Node.Tag;
					System.Threading.Thread t = new System.Threading.Thread(new System.Threading.ThreadStart(this.UpdateListFromServer));
					t.IsBackground = true;
					t.Start();
				
				}
				else
					this.curSelectedDataSet = null;
			}
			catch(Exception)
			{
				this.statusBar1.Text = "Error";
			}
		}
コード例 #5
0
ファイル: NRLWeather.cs プロジェクト: jpespartero/WorldWind
		private void button1_Click(object sender, System.EventArgs e)
		{
			try
			{
				if(this.curSelectedDataSet == null)
					return;

				this.currentImageList.Clear();
				this.currentAnimatingImages.Clear();
				if(this.imageLayer != null)
				{
					m_WorldWindow.CurrentWorld.RenderableObjects.Remove(this.imageLayer.Name);
					this.imageLayer.Dispose();
					this.imageLayer = null;
				}

				if(this.buttonLoad.Text == "Cancel")
				{
					this.buttonLoad.Text = "Load";
				}
				else
				{

					this.currentAnimatingDataSet = this.curSelectedDataSet;

					if(this.listBox1.SelectedItems.Count > 0)
					{
						this.animationTimer.Start();
						foreach(string item in this.listBox1.SelectedItems)
						{
							this.currentImageList.Add(item);
						}
						this.buttonLoad.Text = "Cancel";
						this.downloaderThread = new System.Threading.Thread(new System.Threading.ThreadStart(this.downloadThreadFunc));
						this.downloaderThread.IsBackground = true;
						this.downloaderThread.Start();
					}
				}
			}
			catch(Exception ex)
			{
				this.statusBar1.Text = "Error";
				Log.Write(ex);
			}
		}
コード例 #6
0
ファイル: NRLWeather.cs プロジェクト: jpespartero/WorldWind
		private TreeNode getTreeNodeFromNrlDataSet(XPathNodeIterator iter)
		{
			TreeNode newNode = new TreeNode(iter.Current.GetAttribute("Name", ""));
			XPathNodeIterator childDataSets = iter.Current.Select("ChildDataSets");
			if(childDataSets.Count > 0)
			{
				while(childDataSets.MoveNext())
				{
					XPathNodeIterator childIter = childDataSets.Current.Select("NRL_DataSet");
					while(childIter.MoveNext())
					{
						newNode.Nodes.Add(getTreeNodeFromNrlDataSet(childIter));
					}
				}
			}
			else
			{
				string directoryUrl = getInnerTextFromFirstChild(iter.Current.Select("Directory_Url"));
				string description = getInnerTextFromFirstChild(iter.Current.Select("Description"));
				string keywordFilter = getInnerTextFromFirstChild(iter.Current.Select("Directory_Keyword_Filter"));
				XPathNodeIterator geographicBoundingBoxIter = iter.Current.Select("GeographicBoundingBox");
				double north = 0;
				double south = 0;
				double west = 0;
				double east = 0;

				if(geographicBoundingBoxIter.Count > 0)
				{
					geographicBoundingBoxIter.MoveNext();
					north = double.Parse(getInnerTextFromFirstChild(geographicBoundingBoxIter.Current.Select("North/Value")), System.Globalization.CultureInfo.InvariantCulture);
                    south = double.Parse(getInnerTextFromFirstChild(geographicBoundingBoxIter.Current.Select("South/Value")), System.Globalization.CultureInfo.InvariantCulture);
                    east = double.Parse(getInnerTextFromFirstChild(geographicBoundingBoxIter.Current.Select("East/Value")), System.Globalization.CultureInfo.InvariantCulture);
                    west = double.Parse(getInnerTextFromFirstChild(geographicBoundingBoxIter.Current.Select("West/Value")), System.Globalization.CultureInfo.InvariantCulture);

					NRLDataSet newDataSet = new NRLDataSet(
						newNode.Text,
						directoryUrl,
						description,
						north,
						south,
						east,
						west,
						keywordFilter);
					
					newNode.Tag = newDataSet;
				}
			}

			return newNode;
		}