Example #1
0
        private void ShowOptions(DatasourceDriver driver, GdalDriverMetadata metadata,
                                 StronglyTypedGrid <DriverOption> grid, TabPageAdv tabPage)
        {
            string options    = driver.get_Metadata(metadata);
            bool   hasOptions = !string.IsNullOrWhiteSpace(options);

            if (hasOptions)
            {
                var list = DriverMetadata.ParseOptionList(options).OrderBy(o => o.Name).ToList();
                hasOptions      = list.Any();
                grid.DataSource = list;

                var cmn = grid.Adapter.GetColumn(item => item.UserDescription);
                if (cmn != null)
                {
                    cmn.Width = 0;      // to make it shrink
                }

                grid.AdjustColumnWidths();

                if (cmn != null && cmn.Width > DescriptionColumnWidth)
                {
                    cmn.Width = DescriptionColumnWidth;
                }

                grid.AdjustRowHeights();
            }

            tabPage.TabVisible = hasOptions;
        }
Example #2
0
 public DriverMetadata(string name, string value, GdalDriverMetadata type)
 {
     _value = value;
     Name   = name;
     Type   = type;
 }
Example #3
0
 public string get_Metadata(GdalDriverMetadata metadata)
 {
     return(_driver.Metadata[(tkGdalDriverMetadata)metadata]);
 }
Example #4
0
 public string get_DriverMetadata(GdalDriverMetadata metadata)
 {
     return(_datasource.DriverMetadata[(tkGdalDriverMetadata)metadata]);
 }