private void AddFeatureToTree(KmlFeature feature, LayerUITreeNode parent)
        {
            feature.Dirty = false;
            string text = feature.Name;

            //if (!string.IsNullOrEmpty(feature.description))
            //{
            //    text += Environment.NewLine + feature.description;
            //}
            bool bold = false;
            if (text.Contains("<b>"))
            {
                bold = true;
                text = text.Replace("<b>", "").Replace("</b>", "");
            }

            LayerUITreeNode node = null;

            if (!(feature is KmlNetworkLink))
            {
                node = parent.Add(text);
                node.Tag = feature;
                node.Checked = feature.visibility;
                node.Opened = feature.open;
                node.NodeChecked += new LayerUITreeNodeCheckedDelegate(node_NodeChecked);
                node.NodeUpdated += new LayerUITreeNodeUpdatedDelegate(node_NodeUpdated);
                node.NodeActivated += new LayerUITreeNodeActivatedDelegate(node_NodeActivated);
                node.NodeSelected += new LayerUITreeNodeSelectedDelegate(node_NodeSelected);
                if (bold)
                {
                    node.Bold = true;
                }
            }

            if (feature is KmlContainer)
            {
                KmlContainer container = (KmlContainer)feature;
                if (container.children != null)
                {
                    //  if (feature.Style.GetStyle(false).ListStyle.ListItemType != KmlListItemTypes.CheckHideChildren)
                    {

                        foreach (KmlFeature child in container.children)
                        {
                            AddFeatureToTree(child, node);
                        }
                    }
                }
            }
            else
            {
                if (feature is KmlNetworkLink)
                {
                    KmlNetworkLink netLink = (KmlNetworkLink)feature;
                    if (netLink.LinkRoot != null)
                    {
                        AddRootToTree(netLink.LinkRoot, parent);
                    }
                }
            }
        }
Example #2
0
        private void AddFeatureToTree(KmlFeature feature, LayerUITreeNode parent)
        {
            feature.Dirty = false;
            string text = feature.Name;

            //if (!string.IsNullOrEmpty(feature.description))
            //{
            //    text += Environment.NewLine + feature.description;
            //}
            bool bold = false;

            if (text.Contains("<b>"))
            {
                bold = true;
                text = text.Replace("<b>", "").Replace("</b>", "");
            }

            LayerUITreeNode node = null;

            if (!(feature is KmlNetworkLink))
            {
                node                = parent.Add(text);
                node.Tag            = feature;
                node.Checked        = feature.visibility;
                node.Opened         = feature.open;
                node.NodeChecked   += new LayerUITreeNodeCheckedDelegate(node_NodeChecked);
                node.NodeUpdated   += new LayerUITreeNodeUpdatedDelegate(node_NodeUpdated);
                node.NodeActivated += new LayerUITreeNodeActivatedDelegate(node_NodeActivated);
                node.NodeSelected  += new LayerUITreeNodeSelectedDelegate(node_NodeSelected);
                if (bold)
                {
                    node.Bold = true;
                }
            }

            if (feature is KmlContainer)
            {
                KmlContainer container = (KmlContainer)feature;
                if (container.children != null)
                {
                    //  if (feature.Style.GetStyle(false).ListStyle.ListItemType != KmlListItemTypes.CheckHideChildren)
                    {
                        foreach (KmlFeature child in container.children)
                        {
                            AddFeatureToTree(child, node);
                        }
                    }
                }
            }
            else
            {
                if (feature is KmlNetworkLink)
                {
                    KmlNetworkLink netLink = (KmlNetworkLink)feature;
                    if (netLink.LinkRoot != null)
                    {
                        AddRootToTree(netLink.LinkRoot, parent);
                    }
                }
            }
        }
 private void AddConstellationParts(LayerUITreeNode filterNode, ConstellationFilter constellationFilter)
 {
     foreach (var kv in ConstellationFilter.BitIDs)
     {
         if (constellationFilter.IsSet(kv.Key))
         {
             var constellationNodes = filterNode.Add(Constellations.FullName(kv.Key));
             constellationNodes.Tag = filterNode.Tag;
             constellationNodes.Checked = true;
             constellationNodes.NodeSelected += constellationNodes_NodeSelected;
             constellationNodes.NodeChecked += constellationNodes_NodeChecked;
             constellationNodes.IsChecked += constellationNodes_IsChecked;
         }
     }
 }
 private void AddConstellationParts(LayerUITreeNode filterNode, ConstellationFilter constellationFilter)
 {
     foreach (KeyValuePair<string, int> kv in ConstellationFilter.BitIDs)
     {
         if (constellationFilter.IsSet(kv.Key))
         {
             LayerUITreeNode constellationNodes = filterNode.Add(Constellations.FullName(kv.Key));
             constellationNodes.Tag = filterNode.Tag;
             constellationNodes.Checked = true;
             constellationNodes.NodeSelected += new LayerUITreeNodeSelectedDelegate(constellationNodes_NodeSelected);
             constellationNodes.NodeChecked += new LayerUITreeNodeCheckedDelegate(constellationNodes_NodeChecked);
             constellationNodes.IsChecked += new LayerUITreeNodeIsCheckedDelegate(constellationNodes_IsChecked);
         }
     }
 }