private void btnOK_Click(object sender, EventArgs e) { if (((this.cboJoiningField.SelectedIndex != -1) && (this.cboJoiningTable.SelectedIndex != -1)) && (this.cboJoiningTableField.SelectedIndex != -1)) { ITable featureClass = (this.cboJoiningTable.SelectedItem as ObjectWrap).Object as ITable; if (featureClass is IFeatureLayer) { featureClass = (featureClass as IFeatureLayer).FeatureClass as ITable; } JoiningRelatingHelper.JoinTableLayer(this.itable_0, this.cboJoiningField.Text, featureClass, this.cboJoiningTableField.Text); } }
private void method_0(ICompositeLayer icompositeLayer_0) { for (int i = 0; i < icompositeLayer_0.Count; i++) { ILayer layer = icompositeLayer_0.get_Layer(i); if (layer != this.itable_0) { if (layer is IAttributeTable) { ITable attributeTable = (layer as IAttributeTable).AttributeTable; if (!JoiningRelatingHelper.TableIsJoinLayer(this.itable_0, attributeTable)) { this.cboJoiningTable.Properties.Items.Add(new ObjectWrap(layer)); } } else if (layer is IGroupLayer) { this.method_0(layer as ICompositeLayer); } } } }
private void btnOK_Click(object sender, EventArgs e) { if (((this.cboRelatingField.SelectedIndex != -1) && (this.cboRelatingTable.SelectedIndex != -1)) && (this.cboRelatingTableField.SelectedIndex != -1)) { if (this.txtName.Text.Trim().Length == 0) { MessageBox.Show("请输入关联名!"); } else { ITable featureClass = (this.cboRelatingTable.SelectedItem as ObjectWrap).Object as ITable; if (featureClass is IFeatureLayer) { featureClass = (featureClass as IFeatureLayer).FeatureClass as ITable; } JoiningRelatingHelper.RelateTableLayer(this.txtName.Text.Trim(), this.itable_0, this.cboRelatingField.Text, featureClass, this.cboRelatingTableField.Text); base.DialogResult = DialogResult.OK; base.Close(); } } }
private void method_1() { if (this.itable_0 != null) { int num; IFields fields = this.itable_0.Fields; if (fields != null) { for (num = 0; num < fields.FieldCount; num++) { IField field = fields.get_Field(num); switch (field.Type) { case esriFieldType.esriFieldTypeDouble: case esriFieldType.esriFieldTypeInteger: case esriFieldType.esriFieldTypeOID: case esriFieldType.esriFieldTypeSingle: case esriFieldType.esriFieldTypeSmallInteger: case esriFieldType.esriFieldTypeString: this.cboJoiningField.Properties.Items.Add(field.Name); break; } } } if (this.cboJoiningField.Properties.Items.Count > 0) { this.cboJoiningField.SelectedIndex = 0; } if (this.ibasicMap_0 != null) { ITable attributeTable; ILayer layer = null; for (num = 0; num < this.ibasicMap_0.LayerCount; num++) { layer = this.ibasicMap_0.get_Layer(num); if (layer != this.itable_0) { if (layer is IAttributeTable) { attributeTable = (layer as IAttributeTable).AttributeTable; if (!JoiningRelatingHelper.TableIsJoinLayer(this.itable_0, attributeTable)) { this.cboJoiningTable.Properties.Items.Add(new ObjectWrap(layer)); } } else if (layer is IGroupLayer) { this.method_0(layer as ICompositeLayer); } } } IStandaloneTableCollection tables = this.ibasicMap_0 as IStandaloneTableCollection; for (num = 0; num < tables.StandaloneTableCount; num++) { attributeTable = tables.get_StandaloneTable(num) as ITable; if (!JoiningRelatingHelper.TableIsJoinLayer(this.itable_0, attributeTable)) { this.cboJoiningTable.Properties.Items.Add(new ObjectWrap(attributeTable)); } } if (this.cboJoiningTable.Properties.Items.Count > 0) { this.cboJoiningTable.SelectedIndex = 0; } } } }