Beispiel #1
0
        /// <summary>
        /// Handles the execution of <see cref="ExternalRetrievalMethod.Install"/>.
        /// </summary>
        private void RunNative([NotNull] ExternalRetrievalMethod externalRetrievalMethod)
        {
            if (!string.IsNullOrEmpty(externalRetrievalMethod.ConfirmationQuestion))
            {
                if (!Handler.Ask(externalRetrievalMethod.ConfirmationQuestion,
                                 defaultAnswer: false, alternateMessage: externalRetrievalMethod.ConfirmationQuestion))
                {
                    throw new OperationCanceledException();
                }
            }

            externalRetrievalMethod.Install();
        }
        /// <summary>
        /// Handles the execution of <see cref="ExternalRetrievalMethod.Install"/>.
        /// </summary>
        private void RunNative(ExternalRetrievalMethod externalRetrievalMethod)
        {
            if (externalRetrievalMethod.Install == null)
            {
                throw new NotSupportedException("No installation callback registered for native package.");
            }

            if (!string.IsNullOrEmpty(externalRetrievalMethod.ConfirmationQuestion))
            {
                if (!Handler.Ask(externalRetrievalMethod.ConfirmationQuestion,
                                 defaultAnswer: false, alternateMessage: externalRetrievalMethod.ConfirmationQuestion))
                {
                    throw new OperationCanceledException();
                }
            }

            externalRetrievalMethod.Install();
        }