Ejemplo n.º 1
0
		private void BuildDocData(XmlElement node, XmlNodeList nodes, bool recurse)
		{
			String id = node.GetAttribute("id");
			
			Console.WriteLine(id);
			
			XmlNode classNode = projectDom.SelectSingleNode("//class[@id='" + id + "']");
			
			if (classNode != null)
			{
				ClassDocData classDoc = new ClassDocData(ClassType.Class);
				
				PopulateClass(classDoc, (XmlElement) classNode);
				
				types.Add(classDoc);
			}
			
			XmlNode interfaceNode = projectDom.SelectSingleNode("//interface[@id='" + id + "']");
			
			if (interfaceNode != null)
			{
				ClassDocData classDoc = new ClassDocData(ClassType.Interface);
				
				PopulateClass(classDoc, (XmlElement) interfaceNode);
				
				types.Add(classDoc);
			}
			
			XmlNode enumNode = projectDom.SelectSingleNode("//enumeration[@id='" + id + "']");
			
			if (enumNode != null)
			{
				EnumDocData enumDoc = new EnumDocData();
				
				PopulateEnum(enumDoc, (XmlElement) enumNode);
				
				enums.Add(enumDoc);
			}
			
			if (recurse)
			{
				foreach(XmlElement elem in nodes)
				{
					BuildDocData(elem, elem.ChildNodes, recurse);
				}
			}
		}
Ejemplo n.º 2
0
		private void PopulateClass(ClassDocData doc, XmlElement node)
		{			
			String name = node.GetAttribute("name");
			String id = node.GetAttribute("id");
			String access = node.GetAttribute("access");
			String baseType = node.GetAttribute("baseType");
			
			doc.name = name;
			doc.id = id;
			doc.access = (Visibility) Enum.Parse(typeof(Visibility), access);
		
			PopulateCommonDoc(doc, node);

			// Constructors
			
			doc.constructors = CreateConstructors(node);
			
			// Properties
			
			doc.properties = CreateProperties(node);
			
			// Methods
			
			doc.methods = CreateMethods(node);
			
			// Events
			
			doc.events = CreateEvents(node);
		}
Ejemplo n.º 3
0
		private IContext CreateContext(ClassDocData doc)
		{
			VelocityContext context = new VelocityContext();
			
			context.Put("doc", doc);
			context.Put("counter", counter++);
			context.Put("helper", helper);
						
			return context;
		}