private void menuEnableAttachment_Click(object sender, EventArgs e) { myTreeNode selectNode = this.tv_CatalogTree.SelectedNode as myTreeNode; IFeatureClass fc = selectNode.Tag as IFeatureClass; if (fc.HasAttachments()) { if (MessageBox.Show("禁用附件功能会删除所有现存的附件,请确认!", "警告", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK) { fc.DisableAttachment(); } } else { fc.EnableAttachment(); } }