public static CompileDSTD CompileDSTDPanel(DSTDContext context, string location, string class_, string id) { CompileDSTD d = new CompileDSTD(); d.Context = context; XmlDocument doc = new XmlDocument(); doc.Load(location + ".dstdp"); d.Location = location.Substring(0, location.LastIndexOf("\\")); d.Location += d.Location.EndsWith("\\") ? "" : "\\"; if (context.myServer.GetTypeFromString(class_) == null) { return d; } d.panel = (Panel)context.myServer.GetTypeFromString(class_).GetConstructor(new[] { typeof(string) }).Invoke(new object[] { id }); Control nn = d.getControlFromNode(doc.FirstChild); if (nn.id!="") d. panel.id = nn.id; if (nn.Style != "") d.panel.Style = nn.Style; if (nn.Value != "") d.panel.Value = nn.Value; foreach (XmlNode n in doc.FirstChild.ChildNodes) { d.panel.Children.Add(d.CompileXML(n)); } d.Compiled = d.panel; return d; }
public static CompileDSTD CompileDSTDPage(DSTDContext context, string location, string class_) { CompileDSTD d=new CompileDSTD(); d.Context = context; XmlDocument doc = new XmlDocument(); doc.Load(location + ".dstd"); d.Location = location.Substring(0, location.LastIndexOf("\\")); d.Location += d.Location.EndsWith("\\") ? "" : "\\"; d.page = (Page)context.myServer.GetTypeFromString.Invoke(class_).GetConstructor(Type.EmptyTypes).Invoke(null); foreach (XmlNode n in doc.FirstChild.ChildNodes) { d.page.Children.Add(d.CompileXML(n)); } d.Compiled = d.page; return d; }