private void OnClickNext(object sender, RoutedEventArgs e) { this.lblErrorMessage.Content = ""; if (string.IsNullOrEmpty(this.tbName.Text)) { this.lblErrorMessage.Content = AfaStrings.NameCannotBeBlank; return; } string text = this.tbName.Text; if (!string.IsNullOrEmpty(text)) { text = text.Trim(); } if (string.IsNullOrEmpty(text)) { this.lblErrorMessage.Content = AfaStrings.NameCannotBeBlank; return; } text = NewFeatureClass.FixFeatureClassName(text); MSCDataset docDataset = AfaDocData.ActiveDocData.DocDataset; MSCFeatureClass mSCFeatureClass = new MSCFeatureClass(docDataset); this.tbName.Text = text; mSCFeatureClass.Name = text; mSCFeatureClass.SetGeometryType(this.cbType.SelectedValue.ToString()); mSCFeatureClass.Query = new ResultBuffer(new TypedValue[] { new TypedValue(8, "*") }); mSCFeatureClass.Write(AfaDocData.ActiveDocData.Document); docDataset.FeatureClasses.Add(mSCFeatureClass.Name, mSCFeatureClass); docDataset.FeatureClassViewList.Add(new FCView(mSCFeatureClass)); base.Close(); FeatureClassProperties featureClassProperties = new FeatureClassProperties(mSCFeatureClass); try { Application.ShowModalWindow(featureClassProperties); } catch (Exception) { } AfaDocData.ActiveDocData.SetActiveFeatureClass(mSCFeatureClass); ArcGISRibbon.SetActiveFeatureClass(mSCFeatureClass); }
void IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.This = (FeatureClassProperties)target; return; case 7: this.lblName = (System.Windows.Controls.Label)target; return; case 8: this.lblType = (System.Windows.Controls.Label)target; return; case 9: this.lblProperty = (System.Windows.Controls.Label)target; return; case 10: this.cbProperty = (System.Windows.Controls.ComboBox)target; this.cbProperty.SelectionChanged += new SelectionChangedEventHandler(this.cbProperty_SelectionChanged); return; case 11: this.lblValue = (System.Windows.Controls.Label)target; return; case 12: this.cbValue = (System.Windows.Controls.ComboBox)target; this.cbValue.SelectionChanged += new SelectionChangedEventHandler(this.cbValue_SelectionChanged); return; case 13: this.cbAppend = (System.Windows.Controls.CheckBox)target; return; case 14: this.dgQuery = (System.Windows.Controls.DataGrid)target; return; case 15: this.btnPreview = (System.Windows.Controls.Button)target; this.btnPreview.Click += new RoutedEventHandler(this.btnPreview_Click); return; case 16: this.dgFields = (System.Windows.Controls.DataGrid)target; this.dgFields.GotFocus += new RoutedEventHandler(this.DataGrid_GotFocus); this.dgFields.InitializingNewItem += new InitializingNewItemEventHandler(this.dgInitializeNewItem); return; case 19: ((System.Windows.Controls.Button)target).Click += new RoutedEventHandler(this.OnClickOK); return; case 20: ((System.Windows.Controls.Button)target).Click += new RoutedEventHandler(this.OnClickCancel); return; } this._contentLoaded = true; }