Пример #1
0
		protected void buildChildren(SortedTreeNode rootNode, DirectoryInfo rootInfo)
		{
			ZeusTemplate template;

			foreach (DirectoryInfo dirInfo in rootInfo.GetDirectories()) 
			{
				FolderTreeNode node = new FolderTreeNode(dirInfo.Name);
				rootNode.AddSorted(node);

				this.buildChildren(node, dirInfo);
			}

			foreach (FileInfo fileInfo in rootInfo.GetFiles()) 
			{
				if ( (fileInfo.Extension == ".jgen")
					|| (fileInfo.Extension == ".vbgen")
					|| (fileInfo.Extension == ".csgen")
					|| (fileInfo.Extension == ".zeus") ) 
				{
					string filename = fileInfo.FullName;

					try 
					{
						template = new ZeusTemplate(filename);
					}
					catch 
					{
						continue;
					}

					TemplateTreeNode node = new TemplateTreeNode(template, true);
					rootNode.AddSorted(node);

				}
			}
		}