/// <summary> /// Creates a new PageInstance object from the contents of a previously /// saved PageInstance. The user can then continue to make modifications /// to the PageInstance. /// </summary> /// <param name="node">The XmlNode that was generated by a previous call to the Save method.</param> public PageInstance(XmlNode node) { _PageID = Convert.ToInt32(node.Attributes["temp_page_id"].Value); PageName = node.Attributes["page_name"].Value; DisplayInNav = (node.Attributes["display_in_nav"].Value == "1" ? true : false); RequireSSL = (node.Attributes["require_ssl"].Value == "1" ? true : false); ValidateRequest = (node.Attributes["validate_request"].Value == "1" ? true : false); PageDescription = node.Attributes["page_desc"].Value; Guid = node.Attributes["guid"].Value; SetupSettings(node.Attributes["page_settings"].Value.Split(new char[] { ';' })); _Files = new FileCollection(null); _Pages = new PageInstanceCollection(); _Modules = new ModuleInstanceCollection(); foreach (XmlNode child in node.ChildNodes) { if (child.Name == "Page") { Pages.Add(new PageInstance(child)); } else if (child.Name == "ModuleInstance") { Modules.Add(new ModuleInstance(child)); } else if (child.Name == "File") { Files.Add(new File(child)); } } }
/// <summary> /// Creates a new, empty, Package object that can then be loaded with /// data by the user. /// </summary> public Package() { _Info = new PackageInfo(); _Files = new FileCollection(this); _Modules = new ModuleCollection(this); _Pages = new PageInstanceCollection(this); Readme = ""; }
/// <summary> /// Creates a new, empty, PageInstance object that can be setup by /// the user to contain the required information. /// </summary> public PageInstance() { _PageID = 0; PageName = "New Page"; DisplayInNav = false; RequireSSL = false; ValidateRequest = true; PageDescription = ""; Guid = System.Guid.NewGuid().ToString(); SetupSettings(); _Pages = new PageInstanceCollection(); _Modules = new ModuleInstanceCollection(); _Files = new FileCollection(null); }