private void fields_Enter(object sender, EventArgs e) { if (fields.SelectedItems.Count == 1) { FieldListViewItem field = fields.SelectedItems[0] as FieldListViewItem; Debug.Assert(field != null); properties.SelectedObject = field.Field; } }
private void bgList_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (!e.Cancelled) { if (e.Error == null) { // // Update the item with the result. // itemUpdating.List = (List)e.Result; itemUpdating.Loaded = true; // // Create list items for the field mappings for the list. Check all of the known fields by default. // itemUpdating.Fields.Clear(); foreach (Field field in itemUpdating.List.GetKnownFields()) { FieldListViewItem fi = new FieldListViewItem(field); fi.Checked = field.Include = true; itemUpdating.Fields.Add(fi); } // // Self-select. // lists.SelectedItems.Clear(); itemUpdating.Selected = true; // // Self-check. Toggle check mode to make sure the item is selected. // if (checkListAfterLoad) { itemUpdating.Checked = false; itemUpdating.Checked = true; } } else { MessageBox.Show("An error occurred while connecting to the server.\n\n" + e.Error.Message, this.ParentForm.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } } // // Signal background work completed. // if (WorkCompleted != null) { WorkCompleted(this, new EventArgs()); } lists.Focus(); }
private void fields_ItemCheck(object sender, ItemCheckEventArgs e) { // // Track selection of field mappings. Make sure the selected item is a FieldListViewItem. // FieldListViewItem item = fields.Items[e.Index] as FieldListViewItem; Debug.Assert(item != null); if (item.Field.IsPrimaryKey) { e.NewValue = CheckState.Checked; } }
private void fields_ItemChecked(object sender, ItemCheckedEventArgs e) { // // Track selection of field mappings. Make sure the selected item is a FieldListViewItem. // FieldListViewItem item = e.Item as FieldListViewItem; Debug.Assert(item != null); // // Set inclusion in export. // item.Field.Include = item.Checked; properties.Refresh(); }
private void DoFieldSelect() { // // Make sure an item has been selected; single-select mode should be on. // if (fields.SelectedItems.Count == 1) { // // Get the selected item; it should be of type FieldListViewItem. // FieldListViewItem field = fields.SelectedItems[0] as FieldListViewItem; Debug.Assert(field != null); // // Show properties for the field. // properties.SelectedObject = field.Field; } }