public ToolbarByLayer()
 {
     InitializeComponent();
     m_layerDataViewer = new LayerDataViewer()
     {
         IsPopup = true, LayerEditorObj = LayerEditor
     };
     m_conditionInput = new LayerConditionInput(m_layerDataViewer)
     {
         IsPopup = true
     };
     LayerEditor = new LayerEditor();
 }
예제 #2
0
        private void onPlug(object sender, UploadStringCompletedEventArgs e)
        {
            //设置两个矩形不可见
            this.IMSRect.Visibility  = Visibility.Collapsed;
            this.IMSRect2.Visibility = Visibility.Collapsed;
            //获取调用插件的请求结果,得到分析成功后的url地址
            String getOverLayerUrl = plug.OnGetPluginList(sender, e) as String;

            //判断是否成功

            if (getOverLayerUrl != "" && getOverLayerUrl != null)
            {
                if (this.layerDataViewer != null)
                {
                    this.layerDataViewer.removeLayer();
                    this.layerDataViewer.Close();
                    layerDataViewer = null;
                }
                if (this.layerDataViewer == null)
                {
                    layerDataViewer            = new LayerDataViewer();
                    layerDataViewer.IMSCatalog = this.iMSCatalog1;
                }

                int loc1 = getOverLayerUrl.IndexOf("sfcls") + 6;
                int loc3 = getOverLayerUrl.Length - 1;
                int loc4 = loc3 - loc1;
                //截取字符串,获取叠加分析成功后的图层名称
                String   loc2      = getOverLayerUrl.Substring(loc1, loc4);
                XClsType layerType = XClsType.SFeatureCls;
                String   SAddress  = this.mapDoc.ServerAddress;
                this.layerDataViewer.IMSCatalog    = this.iMSCatalog1;
                this.layerDataViewer.GraphicsLayer = g_GraphicsLayer;
                this.layerDataViewer.Show();
                this.layerDataViewer.ShowLayerAttRecord(loc2, layerType, SAddress);
                ISSuccess = true;
                Overflag  = true;
                this.layerDataViewer.Margin = new Thickness(0, 120, 0, 0);
                this.layerDataViewer.HorizontalAlignment = HorizontalAlignment.Right;
                this.layerDataViewer.Visibility          = Visibility.Visible;
            }
            else
            {
                MessageBox.Show("分析失败,重新点击分析!");
                ISSuccess = true;
            };
        }
예제 #3
0
 public LayerConditionInput(LayerDataViewer layerDataViewer)
 {
     m_layerDataViewer = layerDataViewer;
     InitializeComponent();
     dialogPanel1.OnClose += new RoutedEventHandler(Close);
 }
        public void SetAttStruct(CAttStruct attStruct, BindClass values = null, LayerDataViewer layerDataViewer = null)
        {
            m_layerDataViewer = layerDataViewer;
            m_attStruct       = attStruct;
            m_featureStyle    = null;
            Clear();
            Label   label;
            TextBox txtbox;

            if (values != null && values.ColumnCount > 0)
            {
                m_featureID = Convert.ToInt32(values.keyarr[0]);
            }
            for (int i = 0; i < m_attStruct.FldNumber; i++)
            {
                grid1.RowDefinitions.Add(new RowDefinition()
                {
                    Height = new GridLength(30)
                });
                label = new Label()
                {
                    Content = m_attStruct.FldName[i] + ":", Width = 60
                };
                grid1.Children.Add(label);
                Grid.SetRow(label, i);
                txtbox = new TextBox()
                {
                    Width = 120, Height = 23, Text = "0"
                };                                                              //, Name = "Fld_" + m_attStruct.FldName[i] };
                grid1.Children.Add(txtbox);
                m_textBoxArr.Add(txtbox);
                if (values != null && values.ColumnCount > i + 1)
                {
                    txtbox.Text = values.keyarr[i + 1];
                }
                Grid.SetRow(txtbox, i);
                Grid.SetColumn(txtbox, 1);
            }
            if (values == null)
            {
                switch ((m_targetGeo as IWebGeometry).GetGeomType())
                {
                case WebGeomType.Point:
                    m_style = new PointStyle();
                    break;

                case WebGeomType.Line:
                    m_style = new LineStyle();
                    break;

                case WebGeomType.Polygon:
                    m_style = new PolygonStyle();
                    break;
                }
                grid2.Children.Add(m_style as UIElement);
            }
            else
            {
                CLayerGetByID feature = new CLayerGetByID();
                feature.FeatureID  = this.m_featureID;
                feature.GdbIndex   = ActiveLayerObj.ActiveGdbIndex;
                feature.LayerIndex = ActiveLayerObj.ActiveLayerIndex;
                ActiveLayerObj.GetGraphicInfo(feature, OnGetStyle);
            }
            Button btn = new Button()
            {
                Width = 70
            };

            btn.Content = "提交";
            if (values == null)
            {
                btn.Click += new RoutedEventHandler(SubmitForAdd);
            }
            else
            {
                btn.Click += new RoutedEventHandler(SubmitForEdit);
            }
            grid3.Children.Add(btn);
            btn = new Button()
            {
                Width = 70
            };
            btn.Content = "关闭";
            btn.Click  += new RoutedEventHandler(Close);
            grid3.Children.Add(btn);
            Grid.SetColumn(btn, 1);
            if (values != null)
            {
                grid3.ColumnDefinitions.Add(new ColumnDefinition()); //{ Width = new GridLength(120) });
                btn = new Button()
                {
                    Width = 90
                };
                btn.Content = "调整要素位置";
                btn.Click  += new RoutedEventHandler(EditPoint);
                grid3.Children.Add(btn);
                Grid.SetColumn(btn, 2);
            }
            this.Show();
        }