public ToolbarByMapDoc()
 {
     InitializeComponent();
     m_mapDocDataViewer = new MapDocDataViewer()
     {
         IsPopup = true, MapDocEditorObj = MapDocEditor
     };
     m_conditionInput = new ConditionInput(m_mapDocDataViewer)
     {
         IsPopup = true
     };
     this.BorderThickness = new Thickness(0);
     MapDocEditor         = new MapDocEditor(m_catalog)
     {
         IsPopup = true
     };
 }
 public ConditionInput(MapDocDataViewer mapDocDataViewer)
 {
     m_mapDocDataViewer = mapDocDataViewer;
     InitializeComponent();
     dialogPanel1.OnClose += new RoutedEventHandler(Close);
 }
예제 #3
0
        public void SetAttStruct(CAttStruct attStruct, BindClass values = null, MapDocDataViewer mapDocDataViewer = null)
        {
            m_mapDocDataViewer = mapDocDataViewer;
            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
            {
                CGetObjByID feature = new CGetObjByID();
                feature.FeatureID  = this.m_featureID;
                feature.LayerIndex = this.ActiveMapDoc.ActiveLayerIndex;
                ActiveMapDoc.GetFeatureStyleInfo(feature, new UploadStringCompletedEventHandler(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();
        }