private void GetAttStructCallBack(object sender, UploadStringCompletedEventArgs e) { CAttStruct curLayerAttStru = ActiveMapDoc.OnGetMapLayerAttStruct(e); ActiveMapDoc.ActiveLayerAttStruct = curLayerAttStru; SetAttStruct(curLayerAttStru); }
private void GetAttStructCallBack(object sender, UploadStringCompletedEventArgs e) { CAttStruct attStru = activeLayer.OnGetLayerAttStruct(e); fieldList.Items.Clear(); for (int i = 0; i < attStru.FldName.Length; i++) { fieldList.Items.Add(attStru.FldName[i]); } }
private void GetAttStructCallBack(object sender, UploadStringCompletedEventArgs e) { CAttStruct curLayerAttStru = activeMapDoc.OnGetMapLayerAttStruct(e); if (curLayerAttStru != null) { for (int i = 0; i < curLayerAttStru.FldName.Length; i++) { fieldList.Items.Add(curLayerAttStru.FldName[i]);//new FontFamily(curLayerAttStru.FldName[i])); } } }
private void onGetMapAttStruct(object sender, UploadStringCompletedEventArgs e) { CAttStruct attStruct = m_catalog.ActiveMapDoc.OnGetMapLayerAttStruct(e); this.m_bufferControl.setTargetattStrct(attStruct); BindClass bindobj = ((System.Windows.Controls.DataGrid)(((System.Windows.Controls.ContentControl)(tabControl1.SelectedItem)).Content)).SelectedItem as BindClass; CGetObjByID getobj = new CGetObjByID(); getobj.MapDocIndex = 0; getobj.LayerIndex = Convert.ToInt32(((System.Windows.FrameworkElement)(((System.Windows.Controls.ContentControl)(tabControl1.SelectedItem)).Content)).Name.ToString().Split('_')[1]); getobj.FeatureID = Convert.ToInt64(bindobj.key0); m_catalog.ActiveMapDoc.GetFeatureByID(getobj, new UploadStringCompletedEventHandler(onGetFeatureByID)); }
/// <summary> /// 获取激活图层属性结构 /// </summary> private void GetActiveLayerAttStruct() { CAttStruct curLayerAttStru = ActiveMapDoc.ActiveLayerAttStruct; if (curLayerAttStru != null) { SetAttStruct(curLayerAttStru); } else { ActiveMapDoc.GetMapLayerAttStruct(ActiveMapDoc.ActiveLayerIndex, new UploadStringCompletedEventHandler(GetAttStructCallBack)); } }
private void layerList_SelectionChanged(object sender, SelectionChangedEventArgs e) { int index = layerList.SelectedIndex; if (index >= 0 && index < activeMapDoc.LoadMapResult.LayerCount) { CAttStruct curLayerAttStru = activeMapDoc.LoadMapResult.LayerAttStruct[index]; if (curLayerAttStru != null) { fieldList.Items.Clear(); for (int i = 0; i < curLayerAttStru.FldName.Length; i++) { fieldList.Items.Add(curLayerAttStru.FldName[i]);//new FontFamily(curLayerAttStru.FldName[i])); } } else { activeMapDoc.GetMapLayerAttStruct(index, new UploadStringCompletedEventHandler(GetAttStructCallBack)); } } }
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(); }
/** * 设置传入参数 */ public void setTargetattStrct(CAttStruct target) { _attStrct = target; }
private void GetAttStructCallBack(object sender, UploadStringCompletedEventArgs e) { CAttStruct attStru = ActiveLayerObj.OnGetLayerAttStruct(e); SetAttStruct(attStru); }