Beispiel #1
0
 internal AGSServiceExplorerObject(AGSConnectionExplorerObject parent, string name, string connectionString)
     : base(parent, typeof(AGSClass))
 {
     _name             = name;
     _connectionString = connectionString;
     _parent           = parent;
 }
Beispiel #2
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 cnName = FullName.Substring(0, lastIndex);
            string svName = FullName.Substring(lastIndex + 1, FullName.Length - lastIndex - 1);

            AGSConnectionExplorerObject cnObject = new AGSConnectionExplorerObject();

            cnObject = cnObject.CreateInstanceByFullName(cnName, cache) as AGSConnectionExplorerObject;
            if (cnObject == null || cnObject.ChildObjects == null)
            {
                return(null);
            }

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