示例#1
0
        public 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);

            MsSql2008SpatialSdeExplorerObject dsObject = new MsSql2008SpatialSdeExplorerObject();

            dsObject = dsObject.CreateInstanceByFullName(dsName, cache) as MsSql2008SpatialSdeExplorerObject;
            if (dsObject == null || dsObject.ChildObjects == null)
            {
                return(null);
            }

            foreach (IExplorerObject exObject in dsObject.ChildObjects)
            {
                if (exObject.Name == fcName)
                {
                    cache.Append(exObject);
                    return(exObject);
                }
            }
            return(null);
        }