示例#1
0
        void proxy_getWMSLayersQoSSummaryInfoCompleted(object sender, getWMSLayersQoSSummaryInfoCompletedEventArgs e)
        {
            if (e.Error != null)
            {
            }
            else
            {
                WMSLayerInfoWithQoS results = e.Result;
                if (results != null && results.WMSLayersList != null && results.WMSLayersList.Count > 0)
                {
                    App       app       = (App)Application.Current;
                    UIElement uiElement = app.RootVisual;
                    if (uiElement is UserControl)
                    {
                        UserControl control = uiElement as UserControl;
                        UIElement   root    = control.Content;
                        if (root is SearchingResultPage)
                        {
                            SearchingResultPage srp = root as SearchingResultPage;

                            //if user trigger new search during current search stage, current search results will be ignored and this iterative search will be ended.
                            //if not, these search results will be add to current result page
                            if (SearchingResultPage.ID == ID)
                            {
                                if (view != null)
                                {
                                    view.serviceQualityInfoPanel.showLayerInfoOnTreeView(results);
                                }
                            }
                        }
                    }
                }
            }
        }
示例#2
0
        public void showLayerInfoOnTreeView(WMSLayerInfoWithQoS wmsLayerInfoWithQoS)
        {
            TreeViewItem rootTreeNode = new TreeViewItem();

            RadioButtonWithTextAndMultiIcon area1 = new RadioButtonWithTextAndMultiIcon();

            area1.TextBlock_Name.Text               = "All layers (" + wmsLayerInfoWithQoS.WMSLayersList.Count + ")";
            area1.TextBlock_Name.FontSize           = 15;
            area1.TextBlock_Name.FontWeight         = FontWeights.Bold;
            area1.isSelected_RadioButton.Visibility = Visibility.Collapsed;
            area1.Image_Layer.Visibility            = Visibility.Collapsed;
            area1.Image_QoS.Visibility              = Visibility.Collapsed;

            //we customs the TreeviewItem: add checkbox and image icon before title text content,
            //then we use our TreeViewItem UserControl as the Header Object of TreeViewItem.
            rootTreeNode.Header     = area1;
            rootTreeNode.IsExpanded = true;

            foreach (GeoSearch.QualityQueryServiceReference.WMSLayer layer in wmsLayerInfoWithQoS.WMSLayersList)
            {
                TreeViewItem layerTreeNode            = new TreeViewItem();
                RadioButtonWithTextAndMultiIcon area2 = new RadioButtonWithTextAndMultiIcon();
                //we show the layer's title in tree view as tree node
                area2.TextBlock_Name.Text = layer.title;
                //and the true layer is taged as the object
                area2.TextBlock_Name.Tag   = layer.name;
                area2.Image_Map.Visibility = Visibility.Collapsed;

                BitmapImage image = new BitmapImage(new Uri(Converters.getQoSBarImagePathString(layer.rankValue), UriKind.Relative));
                area2.Image_QoS.Source = image;

                area2.isSelected_RadioButton.Checked += new RoutedEventHandler(radioButton_Selected);
                layerTreeNode.Selected += new RoutedEventHandler(layerTreeNode_Selected);
                layerTreeNode.Header    = area2;
                rootTreeNode.Items.Add(layerTreeNode);
            }
            this.TreeView_WMSLayer.Items.Add(rootTreeNode);
        }