I have a standalone ArcGIS Application used for moving data around. It was written vb.NET using Windows XP and ArcGIS 10.0 and has recently been translated to C# on a Windows 7 machine using ArcGIS 10.1. (SP1).
Since being translated, the problem I am having is the IGxDialog window takes anything from 5 to 20 minutes to display it's contents and then when the Look in: location in the window is changed, such as choosing a directory, it takes another 10 minutes to refresh the display.
The code calling the browse Dialog window is:
switch (m_iDataTypeCurrent)
{
case m_eDataType.FeatureClass:
{
pGxFilter = new GxFilterFeatureClasses();
sTitle = "Select a FeatureClass";
break;
}
case m_eDataType.Table:
{
pGxFilter = new GxFilterTables();
sTitle = "Select a Table";
break;
}
case m_eDataType.TableOrFeatureClass:
{
pGxFilter = new GxFilterTablesAndFeatureClasses();
sTitle = "Table or Featureclass";
break;
}
case m_eDataType.FeatureDataset:
{
pGxFilter = new GxFilterFeatureDatasets();
sTitle = "Select a Feature Dataset";
break;
}
case m_eDataType.GeoDatabase:
{
pGxFilter = new GxFilterGeoDataServersAndWorkspaces();
sTitle = "Select a GeoDatabase";
break;
}
case m_eDataType.ProjectionFile:
{
pGxFilter = new GxFilterSpatialReferences();
sTitle = "Select a Spatial Ref";
break;
}
}
pGxDialog = new GxDialogClass();
pGxDialog.AllowMultiSelect = false;
pGxDialog.Title = sTitle;
pGxDialog.ButtonCaption = "Load";
if (pGxFilter != null)
{
pGxDialog.ObjectFilter = pGxFilter;
}
bSelectOK = pGxDialog.DoModalOpen(iHandle, out pEnumGxObj);
if (bSelectOK == false) return;
pGxObj = pEnumGxObj.Next();
if ((pGxObj == null))
{
return;
}
// Get the item details
sName = pGxObj.FullName;
sType = pGxObj.Parent.Category.ToUpper();
sClass = pGxObj.Category.ToUpper ();
.... etc
All the code for browsing is contained in a separate class:
namespace NHVR_DataTransfer
{
class clsEsriData
{
The handle for DoModalOpen is taken from the calling form using this.Handle but using zero seems to work just as well.
My ArcMap and ArcCatalog software don't have the same time lag when browsing data.
I tried removing the filter but nothing changed.
The time lag seems to be dependent upon the number of objects (directories, files etc) in the directory being browsed so I set the Options in ArcCatalog to be the minimum possible. No change.
It appears that the problem has something to do with this being a standalone application. It wasn't a problem with 10.0 but maybe it is with 10.1?
Does anyone have an idea of what is causing this?
Thanks
class clsEsriData {