public PostGISFeatureClassExplorerObject(CosmoDbExplorerObject parent, IDatasetElement element) : base(parent, typeof(IFeatureClass), 1) { if (element == null || !(element.Class is IFeatureClass)) { return; } _parent = parent; _fcname = element.Title; if (element.Class is IFeatureClass) { _fc = (IFeatureClass)element.Class; switch (_fc.GeometryType) { case geometryType.Envelope: case geometryType.Polygon: _icon = new CosmoDbPolygonIcon(); _type = "Polygon Featureclass"; break; case geometryType.Multipoint: case geometryType.Point: _icon = new CosmoDbPointIcon(); _type = "Point Featureclass"; break; case geometryType.Polyline: _icon = new CosmoDbLineIcon(); _type = "Polyline Featureclass"; break; } } }
async public Task <IExplorerObject> CreateInstanceByFullName(string FullName, ISerializableExplorerObjectCache cache) { if (cache.Contains(FullName)) { return(cache[FullName]); } FullName = FullName.Replace("/", @"\"); int lastIndex = FullName.LastIndexOf(@"\"); if (lastIndex == -1) { return(null); } string dsName = FullName.Substring(0, lastIndex); string fcName = FullName.Substring(lastIndex + 1, FullName.Length - lastIndex - 1); CosmoDbExplorerObject dsObject = new CosmoDbExplorerObject(); dsObject = await dsObject.CreateInstanceByFullName(dsName, cache) as CosmoDbExplorerObject; var childObjects = await dsObject?.ChildObjects(); if (childObjects == null) { return(null); } foreach (IExplorerObject exObject in childObjects) { if (exObject.Name == fcName) { cache.Append(exObject); return(exObject); } } return(null); }