Ejemplo n.º 1
0
        /// <summary>
        /// Remove registered verification handler.
        /// </summary>
        /// <remarks>
        /// Do nothing if <paramref name="verificationHandler"/> is not registered in the system.
        /// </remarks>
        /// <param name="verificationHandler">
        /// The verification handler implementation.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// If <paramref name="verificationHandler"/> is null.
        /// </exception>
        public static void RemoveVerificationHandler(IVerificationHandler verificationHandler)
        {
            if (verificationHandler == null)
            {
                throw new ArgumentNullException("verificationHandler");
            }

            MultiVerificationHandler.VerificationHandlers.Remove(verificationHandler);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="VerifierImplementation"/> class.
        /// </summary>
        /// <param name="verificationHandler">
        /// The verification handler.
        /// </param>
        internal VerifierImplementation(IVerificationHandler verificationHandler)
        {
            if (verificationHandler == null)
            {
                throw new ArgumentNullException("verificationHandler");
            }

            this.verificationHandler    = verificationHandler;
            this.ForceGarbageCollection = true;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="VerifierImplementation"/> class.
        /// </summary>
        /// <param name="verificationHandler">
        /// The verification handler.
        /// </param>
        internal VerifierImplementation(IVerificationHandler verificationHandler)
        {
            if (verificationHandler == null)
            {
                throw new ArgumentNullException("verificationHandler");
            }

            this.verificationHandler = verificationHandler;
            this.ForceGarbageCollection = true;
        }
Ejemplo n.º 4
0
        public static void RequestOsuUserStatus(string user, DiscordMessage message, string originalText)
        {
            IVerificationHandler verifyHandler = Modules.ModuleHandler.Get("verification") as IVerificationHandler;

            if (verifyHandler == null)
            {
                message.ModifyAsync(originalText + " failed to request status").Wait();
                return;
            }

            verifyHandler.GetUserStatus(user, message, originalText);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Register verification handler.
        /// </summary>
        /// <param name="verificationHandler">
        /// The verification handler implementation.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// If <paramref name="verificationHandler"/> is null.
        /// </exception>
        public static void AddVerificationHandler(IVerificationHandler verificationHandler)
        {
            if (verificationHandler == null)
            {
                throw new ArgumentNullException("verificationHandler");
            }

            MultiVerificationHandler.VerificationHandlers.Add(verificationHandler);
        }
Ejemplo n.º 6
0
 public void AccessDependency(Source key)
 {
     IVerificationHandler dependency = _factory.Get(key);
 }