private async Task GetFieldsAsync()
        {
            ReportFields.Clear();
            SelectedFields.Clear();
            if (SelectedLayer == null)
            {
                return;
            }

            await QueuedTask.Run((Action)(() =>
            {
                foreach (FieldDescription fd in SelectedLayer?.GetFieldDescriptions())
                {
                    string shapeField = SelectedLayer.GetFeatureClass().GetDefinition().GetShapeField();
                    if (fd.Name == shapeField)
                    {
                        continue;                        //filter out the shape field.
                    }
                    var defFieldAction = (Action)(() =>
                    {
                        var field = new ReportField {
                            IsSelected = false, DisplayName = fd.Alias, Name = fd.Name
                        };
                        ReportFields.Add(field);
                        field.FieldSelectionChanged += this.Field_FieldSelectionChanged;
                        //field.IsSelected = true;
                    });
                    ActionOnGuiThread(defFieldAction);
                }
            }));
        }
Exemplo n.º 2
0
 private void listViewEx1_ItemChecked(object sender, ItemCheckedEventArgs e)
 {
     SelectedFields.Clear();
     foreach (ListViewItem item in listViewEx1.Items)
     {
         if (item != null && item.Checked && _ExportableFields.Contains(item.Text))
         {
             SelectedFields.Add(item.Text);
         }
     }
 }