//下面的代码来模拟属性表如何使用compound static public void Analysis(IBLCompound compound) { foreach (IBLElement one in compound.Elements) { if (one is IBLCompound) { Analysis(one as IBLCompound); } else { IBLUIConfig config = (one as IBLUIConfigable).UIConfig; IBLUIValue UIValue = one as IBLUIValue; string s = UIValue.GetUIValue(); UIValue.SetUIValue("123"); string s1 = UIValue.GetUIValue(); } } }
/// <summary> /// /// </summary> /// <param name="obj">2D的一个图件</param> /// <returns></returns> public IBLCompound CreatePackage(object obj) { TDCompoundPackage result = new TDCompoundPackage(); IBLUIConfigGroup group = UIConfigs.GetConfigGroup("2D"); Type type = obj.GetType(); PropertyInfo[] properties = type.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.DeclaredOnly); object[] tempAttributes = null; TDUIConfigAttribute tempAttribute = null; TDPptElement temp = null; foreach (PropertyInfo one in properties) { tempAttributes = one.GetCustomAttributes(typeof(TDUIConfigAttribute), false); if (tempAttributes.Length <= 0) { continue; } tempAttribute = tempAttributes[0] as TDUIConfigAttribute; temp = tempAttribute.CreateTDObject(obj, one); if (temp == null) { throw new Exception("没有正确生成包装对象,检查图件属性的标签是否设置错误。"); } temp.UIConfig = group.GetItemConfig(tempAttribute.ConfigItemID); if (temp is TDPptCompoud) { IBLUIConfig[] configs = new IBLUIConfig[tempAttribute.ChildConfigItemID.Length]; Int32 index = 0; foreach (Int32 id in tempAttribute.ChildConfigItemID) { configs[index] = group.GetItemConfig(id); index++; } (temp as TDPptCompoud).InitChildUIConfig(configs); } result.AddChild(temp); } return(result); }
protected IBLUIConfigMultiColumn CreateMultiColumn(XmlElement node) { string s = node.GetAttribute(BLXmlConfigItem.s_itemMultiColumn.key); Int32 multiColumn = -1; if (!Int32.TryParse(s, out multiColumn) || (multiColumn < 2)) { return(null); } XmlNodeList child = node.SelectNodes("Column"); IBLUIConfig[] columns = new IBLUIConfig[multiColumn]; UInt16[] ratios = new UInt16[multiColumn]; int index = -1; foreach (XmlElement one in child) { index++; columns[index] = GetItemConfig(Int32.Parse(one.GetAttribute("id"))); ratios[index] = UInt16.Parse(one.GetAttribute("width")); } return(new BLUIConfigMultiColumn(columns, ratios)); }
public TDPptElement(IBLUIConfig uiConfig) { _uiConfig = uiConfig; }
public TDPptElement() { _uiConfig = null; }