Пример #1
0
        private void Reload()
        {
            layerTreeView.Nodes.Clear();
            if (_mashup != null)
            {
                foreach (Layer current in _mashup.layerList)
                {
                    List <TreeNode> list = new List <TreeNode>();
                    foreach (SourceMap current2 in current)
                    {
                        List <TreeNode> list2 = new List <TreeNode>();
                        foreach (Legend current3 in current2.legendList)
                        {
                            TreeNode treeNode = new NameWatchingTreeNode(current3);
                            tagToTreeNodeDict[current3] = treeNode;
                            list2.Add(treeNode);
                        }

                        TreeNode treeNode2 = new NameWatchingTreeNode(current2, list2.ToArray());
                        tagToTreeNodeDict[current2] = treeNode2;
                        if (current2.expanded)
                        {
                            treeNode2.Expand();
                        }
                        else
                        {
                            treeNode2.Collapse();
                        }

                        list.Add(treeNode2);
                    }

                    TreeNode treeNode3 = new NameWatchingTreeNode(current, list.ToArray());
                    tagToTreeNodeDict[current] = treeNode3;
                    if (current.expanded)
                    {
                        treeNode3.Expand();
                    }
                    else
                    {
                        treeNode3.Collapse();
                    }

                    layerTreeView.Nodes.Add(treeNode3);
                }
            }

            if (_mashup != null)
            {
                if (_mashup.lastView is SourceMapRegistrationView)
                {
                    SelectObject(((SourceMapRegistrationView)_mashup.lastView).sourceMap);
                }
                else
                {
                    if (_mashup.lastView is LayerView)
                    {
                        SelectObject(((LayerView)_mashup.lastView).layer);
                    }
                    else
                    {
                        if (_mashup.lastView is LegendView)
                        {
                            SelectObject(((LegendView)_mashup.lastView).legend);
                        }
                        else
                        {
                            if (_mashup.lastView is NoView)
                            {
                                SelectObject(null);
                            }
                            else
                            {
                                SelectObject(null);
                            }
                        }
                    }
                }
            }

            gettingStartedLabel.Visible = _mashup == null || _mashup.layerList.Count <= 0;
            Invalidate();
        }
Пример #2
0
		private void Reload()
		{
			this.layerTreeView.Nodes.Clear();
			if (this._mashup != null)
			{
				foreach (Layer current in this._mashup.layerList)
				{
					List<TreeNode> list = new List<TreeNode>();
					foreach (SourceMap current2 in current)
					{
						List<TreeNode> list2 = new List<TreeNode>();
						foreach (Legend current3 in current2.legendList)
						{
							TreeNode treeNode = new NameWatchingTreeNode(current3);
							this.tagToTreeNodeDict[current3] = treeNode;
							list2.Add(treeNode);
						}
						TreeNode treeNode2 = new NameWatchingTreeNode(current2, list2.ToArray());
						this.tagToTreeNodeDict[current2] = treeNode2;
						if (current2.expanded)
						{
							treeNode2.Expand();
						}
						else
						{
							treeNode2.Collapse();
						}
						list.Add(treeNode2);
					}
					TreeNode treeNode3 = new NameWatchingTreeNode(current, list.ToArray());
					this.tagToTreeNodeDict[current] = treeNode3;
					if (current.expanded)
					{
						treeNode3.Expand();
					}
					else
					{
						treeNode3.Collapse();
					}
					this.layerTreeView.Nodes.Add(treeNode3);
				}
			}
			if (this._mashup != null)
			{
				if (this._mashup.lastView is SourceMapRegistrationView)
				{
					this.SelectObject(((SourceMapRegistrationView)this._mashup.lastView).sourceMap);
				}
				else
				{
					if (this._mashup.lastView is LayerView)
					{
						this.SelectObject(((LayerView)this._mashup.lastView).layer);
					}
					else
					{
						if (this._mashup.lastView is LegendView)
						{
							this.SelectObject(((LegendView)this._mashup.lastView).legend);
						}
						else
						{
							if (this._mashup.lastView is NoView)
							{
								this.SelectObject(null);
							}
							else
							{
								this.SelectObject(null);
							}
						}
					}
				}
			}
			this.gettingStartedLabel.Visible = (this._mashup == null || this._mashup.layerList.Count <= 0);
			base.Invalidate();
		}