Exemplo n.º 1
0
        /// <summary>
        /// Checks a stale update to see if current rules allow it to be approved
        /// </summary>
        /// <param name="update">
        /// the update
        /// </param>
        /// <param name="isTest">
        /// whether we are in test most
        /// </param>
        /// <param name="approveLicenseAgreement">
        /// whether we auto accept license agreements
        /// </param>
        private static void CheckStaleUpdate(IUpdate update, bool isTest, bool approveLicenseAgreement)
        {
            if (update.RequiresLicenseAgreementAcceptance)
            {
                if (!approveLicenseAgreement)
                {
                    Console.Out.WriteLine(
                        "Warning: Unable to approve '" + update.Title
                        + "' as it requires a license agreement and the current settings prevent this.");
                    return;
                }

                if (!isTest)
                {
                    update.AcceptLicenseAgreement();
                }
            }

            if (isTest)
            {
                Console.Out.Write("(TEST) ");
            }
            else
            {
                update.RefreshUpdateApprovals();
            }

            Console.Out.WriteLine(update.Title);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Checks a stale update to see if current rules allow it to be approved
        /// </summary>
        /// <param name="update">
        /// the update
        /// </param>
        /// <param name="isTest">
        /// whether we are in test most
        /// </param>
        /// <param name="approveLicenseAgreement">
        /// whether we auto accept license agreements
        /// </param>
        private static void CheckStaleUpdate(IUpdate update, bool isTest, bool approveLicenseAgreement)
        {
            if (update.RequiresLicenseAgreementAcceptance)
            {
                if (!approveLicenseAgreement)
                {
                    Console.Out.WriteLine(
                        "Warning: Unable to approve '" + update.Title
                        + "' as it requires a license agreement and the current settings prevent this.");
                    return;
                }

                if (!isTest)
                {
                    update.AcceptLicenseAgreement();
                }
            }

            if (isTest)
            {
                Console.Out.Write("(TEST) ");
            }
            else
            {
                update.RefreshUpdateApprovals();
            }

            Console.Out.WriteLine(update.Title);
        }