Ejemplo n.º 1
0
 public static IDataSource OpenDataSource()
 {
     using (frmDataSource frm = new frmDataSource())
     {
         frm.ucBudGISDataSource1.SelectableType = enumCatalogItemType.FeatureClass;
         if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             ICatalogItem citem = frm.ucBudGISDataSource1.SelectedCatalogItem;
             if (citem is CatalogFile)
             {
                 return(GetDataSource(citem as CatalogFile));
             }
             else if (citem is CatalogFeatureClass)
             {
                 return(GetDataSource(citem as CatalogFeatureClass));
             }
             else if (citem is CatalogNetFeatureClass)
             {
                 return(GetDataSource(citem as CatalogNetFeatureClass));
             }
             else
             {
                 throw new NotSupportedException("暂时不支持类型为\"" + citem.Tag.ToString() + "\"的数据源。");
             }
         }
     }
     return(null);
 }
Ejemplo n.º 2
0
 public override object GetValue(object sender)
 {
     using (frmDataSource frmds = new frmDataSource())
     {
         frmds.ucBudGISDataSource1.SelectableType = GetCatalogItemType();
         if (frmds.ShowDialog() == DialogResult.OK)
         {
             return(frmds.ucBudGISDataSource1.SelectedCatalogItem);
         }
     }
     return(base.GetValue(sender));
 }