示例#1
0
		protected XmlNode GetAttributeInfoTable(HtmlAttribute[] attrs){
			if(attrs == null || attrs.Length == 0) return Html.Null;

			XmlElement result = Html.Create("table");
			result.SetAttribute("summary", HtmlRefViewAttribute.AttributeInfoTableSummary);

			XmlElement thead = Html.Create("thead");
			result.AppendChild(thead);

			XmlElement theadTr = Html.HeadTr(null, "属性名", "バージョン", "属性値", "既定値", "備考");
			thead.AppendChild(theadTr);

			XmlElement tbody = Html.Create("tbody");
			result.AppendChild(tbody);
			foreach(HtmlAttribute a in attrs){
				XmlNode values = GetHtmlItemList(a.Value);
				XmlElement tbodyTr = Html.Tr(null, 0, GetHtmlItemLink(a, false), a.GetVersion(), values, a.Default, a.Note);
				tbody.AppendChild(tbodyTr);
			}
			return result;
		}
示例#2
0
// データのロード

		public void AddData(HtmlAttribute e){
			Object[] data = new Object[]{null, e.Id, e.Name, e};
			DataRow row = this.NewRow();
			row.ItemArray = data;
			this.Rows.Add(row);
		}
示例#3
0
		// 属性値を解析して格納します。
		// 親として関連づけます。
		private void SetChildren(HtmlAttribute ha){
			string valueStr = ha.XmlElement.GetInnerText(ValueElementName);
			HtmlItem item = GetDataByName(valueStr);
			if(item == null) item = new HtmlMisc(valueStr);
			item.AddParent(ha);
			ha.Value = item;
		}
示例#4
0
		/// <summary>
		/// 指定された XML ファイルからデータをロードします。
		/// この処理はスレッドセーフではありません。
		/// </summary>
		public void Load(){
			XmlNodeList elems = Document.DocumentElement[ElementsRefName].GetElementsByTagName(ElementElementName);
			XmlNodeList elemGroups = Document.DocumentElement[ElementsRefName].GetElementsByTagName(ElementGroupElementName);
			XmlNodeList attrs = Document.DocumentElement[AttributesRefName].GetElementsByTagName(AttributeElementName);
			XmlNodeList attrGroups = Document.DocumentElement[AttributesRefName].GetElementsByTagName(AttributeGroupElementName);
			XmlNodeList datas = Document.DocumentElement[DataRefName].GetElementsByTagName(DataFormatElementName);

			HtmlElement[] he = new HtmlElement[elems.Count];
			for(int i=0; i < elems.Count; i++){he[i] = new HtmlElement(elems[i] as XmlElement);}
			HtmlElementGroup[] heg = new HtmlElementGroup[elemGroups.Count];
			for(int i=0; i < elemGroups.Count; i++){heg[i] = new HtmlElementGroup(elemGroups[i] as XmlElement);}
			HtmlAttribute[] ha = new HtmlAttribute[attrs.Count];
			for(int i=0; i < attrs.Count; i++){ha[i] = new HtmlAttribute(attrs[i] as XmlElement);}
			HtmlAttributeGroup[] hag = new HtmlAttributeGroup[attrGroups.Count];
			for(int i=0; i < attrGroups.Count; i++){hag[i] = new HtmlAttributeGroup(attrGroups[i] as XmlElement);}
			HtmlData[] hd = new HtmlData[datas.Count];
			for(int i=0; i < datas.Count; i++){hd[i] = new HtmlData(datas[i] as XmlElement);}

			ElementTable.MinimumCapacity = he.Length;
			Array.ForEach(he, item=>{ElementTable.AddData(item);});
			ElementGroupTable.MinimumCapacity = heg.Length;
			Array.ForEach(heg, item=>{ElementGroupTable.AddData(item);});
			AttributeTable.MinimumCapacity = ha.Length;
			Array.ForEach(ha, item=>{AttributeTable.AddData(item);});
			AttributeGroupTable.MinimumCapacity = hag.Length;
			Array.ForEach(hag, item=>{AttributeGroupTable.AddData(item);});
			DataTable.MinimumCapacity = hd.Length;
			Array.ForEach(hd, item=>{DataTable.AddData(item);});

			// 属性や親子関係を取得
			Array.ForEach(he, item=>{SetChildren(item);SetAttribute(item);});
			Array.ForEach(heg, item=>{SetChildren(item);});
			Array.ForEach(ha, item=>{SetChildren(item);});
			Array.ForEach(hag, item=>{SetChildren(item);});

		}
示例#5
0
		// Row[] を HtmlAttribute[] に変換します。
		private HtmlAttribute[] DataRowsToHtmlAttribute(DataRow[] rows){
			HtmlAttribute[] result = new HtmlAttribute[rows.Length];
			for(int i = 0; i < rows.Length; i++){
				result[i] = GetHtmlAttribute(rows[i]);
			}
			return result;
		}
示例#6
0
		// 属性のリストをtableとして取得します。
		protected XmlNode GetAttributeInfoTable(HtmlAttribute attr){
			return GetAttributeInfoTable(new HtmlAttribute[]{attr});
		}