ArcGISCompare.frmMaster.CheckforGeoSpatialData C# (CSharp) Method

CheckforGeoSpatialData() public method

public CheckforGeoSpatialData ( String strPath, String geoType, ListBox lstBox ) : void
strPath String
geoType String
lstBox ListBox
return void
        public void CheckforGeoSpatialData(String strPath, String geoType, ListBox lstBox)
        {
            IWorkspaceFactory owrkspaceFact = null;
            IFeatureWorkspace theFWS;
            IFeatureClass theFClass;
            int FCount;

            try
            {
                switch (geoType)
                {
                    case "ShapeFile":
                        owrkspaceFact = new ShapefileWorkspaceFactory();
                        break;
                    default:
                        owrkspaceFact = new AccessWorkspaceFactoryClass();
                        break;
                }

                PropertySet pPropSet = new PropertySetClass();
                pPropSet.SetProperty("DATABASE", strPath);

                IWorkspace theWS = owrkspaceFact.Open(pPropSet, 0);
                theFWS = (IFeatureWorkspace)theWS;

                if (theWS != null)
                {
                    String[] theSrcNames = GeoDbProcs.GetFeatureClassNames(theWS);

                    foreach (String theSrcName in theSrcNames)
                    {
                        theFClass = theFWS.OpenFeatureClass(theSrcName);
                        lbSource.Items.Add(new FeatureData(theSrcName, theFClass));
                        Application.DoEvents();
                    }
                }
            }
            catch { }
        }