Example #1
0
        private void txtTargetFeatureclass_TextChanged(object sender, EventArgs e)
        {
            if (lstFeatureclasses.SelectedItems.Count == 0)
            {
                return;
            }

            FeatureClassListViewItem item = lstFeatureclasses.SelectedItems[0] as FeatureClassListViewItem;

            if (item == null)
            {
                return;
            }
            item.TargetName = txtTargetFeatureclass.Text;
        }
Example #2
0
        private void lstFeatureclasses_SelectedIndexChanged(object sender, EventArgs e)
        {
            gvFields.DataSource = null;
            if (_fcs == null)
            {
                return;
            }
            if (lstFeatureclasses.SelectedItems.Count == 0 || lstFeatureclasses.SelectedIndices[0] < 0 || lstFeatureclasses.SelectedIndices[0] >= _fcs.Count)
            {
                return;
            }

            FeatureClassListViewItem item = lstFeatureclasses.SelectedItems[0] as FeatureClassListViewItem;

            gvFields.DataSource        = item.Fields;
            txtTargetFeatureclass.Text = item.TargetName;
        }
Example #3
0
        private void FormFeatureclassCopy_Load(object sender, EventArgs e)
        {
            if (_fcs == null)
            {
                return;
            }

            if (SchemaOnly)
            {
                btnScript.Visible = false;
                this.Text         = "Copy Featureclass Schema(s)";
            }

            if (_destDatabases == null)
            {
                foreach (IFeatureClass fc in _fcs)
                {
                    FeatureClassListViewItem item = new FeatureClassListViewItem(fc, _maxFieldLength);
                    switch (fc.GeometryType)
                    {
                    case geometryType.Point:
                    case geometryType.Multipoint:
                        item.ImageIndex = 0;
                        break;

                    case geometryType.Polyline:
                        item.ImageIndex = 1;
                        break;

                    default:
                        item.ImageIndex = 2;
                        break;
                    }

                    item.Checked = true;
                    lstFeatureclasses.Items.Add(item);
                }
                if (lstFeatureclasses.Items.Count > 0)
                {
                    lstFeatureclasses.Items[0].Selected = true;
                }
            }
            else
            {
                panelFormat.Visible = true;
                foreach (IFileFeatureDatabase database in _destDatabases)
                {
                    if (database == null)
                    {
                        continue;
                    }

                    List <FeatureClassListViewItem> items = new List <FeatureClassListViewItem>();
                    foreach (IFeatureClass fc in _fcs)
                    {
                        FeatureClassListViewItem item = new FeatureClassListViewItem(fc, database.MaxFieldNameLength);
                        switch (fc.GeometryType)
                        {
                        case geometryType.Point:
                        case geometryType.Multipoint:
                            item.ImageIndex = 0;
                            break;

                        case geometryType.Polyline:
                            item.ImageIndex = 1;
                            break;

                        default:
                            item.ImageIndex = 2;
                            break;
                        }

                        item.Checked = true;
                        items.Add(item);
                    }

                    cmbDestFormat.Items.Add(new FileDatabaseItem(database, items));
                }
                if (cmbDestFormat.Items.Count > 0)
                {
                    cmbDestFormat.SelectedIndex = 0;
                }

                //btnScript.Visible = false;
            }
        }