Пример #1
0
 public VersionWarning(bizilante.Windows.Forms.DeploymentDbFormsControlLibrary.DeploymentVersion version)
 {
     InitializeComponent();
     this.bindingSourceVersion.DataSource = version;
 }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="appliction">BizTalk application name</param>
        /// <param name="version">Current BizTalk application version</param>
        /// <param name="dbversion">Current BizTalk application version (dixit DeploymentDb)</param>
        /// <param name="newversion">The tobe deployed BizTalk application version</param>
        /// <returns>A new VersionWarning form to display or NULL there is no warning.</returns>
        /// <exception cref="ArgumentNullException">application, version and newversion cannot be empty or null</exception>
        public static VersionWarning Create(string appliction, string version, string dbversion, string newversion)
        {
            #region Argument validation
            if (string.IsNullOrEmpty(appliction))
            {
                throw new ArgumentNullException("application", "Value cannot be empty or null");
            }
            if (string.IsNullOrEmpty(appliction))
            {
                throw new ArgumentNullException("version", "Value cannot be empty or null");
            }
            if (string.IsNullOrEmpty(appliction))
            {
                throw new ArgumentNullException("newversion", "Value cannot be empty or null");
            }
            if (version.Split(new string[] { "." }, StringSplitOptions.None).Length != 4)
            {
                throw new ArgumentException("version", "Version not in the form 'major.minor.build.revision'");
            }
            if (newversion.Split(new string[] { "." }, StringSplitOptions.None).Length != 4)
            {
                throw new ArgumentException("version", "Version not in the form 'major.minor.build.revision'");
            }
            #endregion

            // Is there a warning?
            if (!ShouldWarn(version, newversion))
            {
                return(null);
            }

            bizilante.Windows.Forms.DeploymentDbFormsControlLibrary.DeploymentVersion deploymentVersion =
                new bizilante.Windows.Forms.DeploymentDbFormsControlLibrary.DeploymentVersion
            {
                Application = appliction,
                Version     = version,
                NewVersion  = newversion,
                DbVersion   = dbversion
            };
            return(new VersionWarning(deploymentVersion));
        }