/// <summary> /// lnkValidate_Click runs when the Validate button is clicked /// </summary> /// <returns></returns> /// <remarks> /// </remarks> /// <history> /// [cnurse] 9/28/2004 Updated to reflect design changes for Help, 508 support /// and localisation /// </history> protected void lnkValidate_Click(Object sender, EventArgs e) { if (Page.IsPostBack) { if (!String.IsNullOrEmpty(cmdBrowse.PostedFile.FileName)) { string strExtension = Path.GetExtension(cmdBrowse.PostedFile.FileName); ArrayList Messages = new ArrayList(); string postedFile = Path.GetFileName(cmdBrowse.PostedFile.FileName); if (strExtension.ToLower() == ".dnn") { ModuleDefinitionValidator xval = new ModuleDefinitionValidator(); xval.Validate(cmdBrowse.PostedFile.InputStream); if (xval.Errors.Count > 0) { Messages.AddRange(xval.Errors); } else { Messages.Add(string.Format(Localization.GetString("Valid", this.LocalResourceFile), postedFile, null)); } } else { Messages.Add(string.Format(Localization.GetString("Invalid", this.LocalResourceFile), postedFile, null)); } lstResults.Visible = true; lstResults.DataSource = Messages; lstResults.DataBind(); } } }
private ArrayList ValidateDnn() { //Create New Validator ModuleDefinitionValidator ModuleValidator = new ModuleDefinitionValidator(); //Tell Validator what XML to use MemoryStream xmlStream = new MemoryStream(InstallerInfo.DnnFile.Buffer); ModuleValidator.Validate(xmlStream); return(ModuleValidator.Errors); }
private ModuleDefinitionVersion GetModuleVersion() { if (InstallerInfo.DnnFile != null) { MemoryStream buffer = new MemoryStream(InstallerInfo.DnnFile.Buffer, true); ModuleDefinitionValidator xval = new ModuleDefinitionValidator(); return(xval.GetModuleDefinitionVersion(buffer)); } else { return(ModuleDefinitionVersion.VUnknown); } }