Exemple #1
0
 public override IHierarchicalEnumerable Select()
 {
     if (fshe == null)
     {
         fshe = GetHierarchicalEnumerable(viewPath);
     }
     return(fshe);
 }
        /// <summary>
        /// ctor
        /// </summary>
        /// <param name="id">node id</param>
        /// <param name="name">node name</param>
        /// <param name="path">node path</param>
        public ValidationInfoHierarchyData(string id, string name, string path)
        {
            hasChildren  = true;
            navigatePage = "";

            this.id   = id;
            this.name = name;
            this.path = path + PathAnalyzer.SPLITTER + id;

            children = new ValidationInfoHierarchicalEnumerable();
        }
Exemple #3
0
        private static ValidationInfoHierarchicalEnumerable GetHierarchicalEnumerable(string viewPath)
        {
            ValidationInfoHierarchicalEnumerable fshe = new ValidationInfoHierarchicalEnumerable();

            PathAnalyzer.ItemType type = PathAnalyzer.GetItemType(viewPath);
            switch (type)
            {
            case PathAnalyzer.ItemType.Root:
                fshe.Add(
                    new RootValidationInfoHierarchyData("Root", "Servers", viewPath));
                break;

            case PathAnalyzer.ItemType.Server:
            {
                IList <KeyValuePair <string, string> > list = IlcWebDao.GetServersList();
                foreach (KeyValuePair <string, string> kvp in list)
                {
                    fshe.Add(
                        new ServerValidationInfoHierarchyData(kvp.Key, kvp.Value, viewPath));
                }
            }
            break;

            case PathAnalyzer.ItemType.Project:
            {
                IList <KeyValuePair <string, string> > list =
                    IlcWebDao.GetProjectsList(PathAnalyzer.GetServerId(viewPath));
                foreach (KeyValuePair <string, string> kvp in list)
                {
                    fshe.Add(new ProjectValidationInfoHierarchyData(kvp.Key, kvp.Value, viewPath));
                }
            }
            break;

            default:
                throw new ApplicationException("Unexpected type of tree node");
            }
            return(fshe);
        }