Exemplo n.º 1
0
        public SamplePushUserRegistrationService(HttpContextBase context, WebOperationContext webOperationContext, IFormsAuthentication formsAuth, IMembershipService membershipService, IPushUserEndpointsRepository pushUserEndpointsRepository, CloudQueueClient cloudQueueClient)
        {
            if ((context == null) && (HttpContext.Current == null))
            {
                throw new ArgumentNullException("context", "Context cannot be null if not running on a Web context.");
            }

            if (pushUserEndpointsRepository == null)
            {
                throw new ArgumentNullException("pushUserEndpointsRepository", "PushUserEndpoints repository cannot be null.");
            }

            if (formsAuth == null)
            {
                throw new ArgumentNullException("formsAuth", "Forms Authentication service cannot be null.");
            }

            if (membershipService == null)
            {
                throw new ArgumentNullException("membershipService", "Membership service cannot be null.");
            }

            if ((cloudQueueClient == null) && (GetStorageAccountFromConfigurationSetting() == null))
            {
                throw new ArgumentNullException("cloudQueueClient", "Cloud Queue Client cannot be null if no configuration is loaded.");
            }

            this.cloudQueueClient            = cloudQueueClient ?? GetStorageAccountFromConfigurationSetting().CreateCloudQueueClient();
            this.webOperationContext         = webOperationContext;
            this.context                     = context;
            this.pushUserEndpointsRepository = pushUserEndpointsRepository;
            this.formsAuth                   = formsAuth;
            this.membershipService           = membershipService;
        }
        public SamplePushUserRegistrationService(HttpContextBase context, WebOperationContext webOperationContext, IFormsAuthentication formsAuth, IMembershipService membershipService, IPushUserEndpointsRepository pushUserEndpointsRepository)
        {
            if ((context == null) && (HttpContext.Current == null))
            {
                throw new ArgumentNullException("context", "Context cannot be null if not running on a Web context.");
            }

            if (pushUserEndpointsRepository == null)
            {
                throw new ArgumentNullException("pushUserEndpointsRepository", "PushUserEndpoints repository cannot be null.");
            }

            if (formsAuth == null)
            {
                throw new ArgumentNullException("formsAuth", "Forms Authentication service cannot be null.");
            }

            if (membershipService == null)
            {
                throw new ArgumentNullException("membershipService", "Membership service cannot be null.");
            }

            this.webOperationContext = webOperationContext;
            this.context = context;
            this.pushUserEndpointsRepository = pushUserEndpointsRepository;
            this.formsAuth = formsAuth;
            this.membershipService = membershipService;
        }
        public PushNotificationsController(CloudQueueClient cloudQueueClient, IPushUserEndpointsRepository pushUserEndpointsRepository, IMembershipService membershipService)
        {
            if (GetStorageAccountFromConfigurationSetting() == null)
            {
                if (cloudQueueClient == null)
                {
                    throw new ArgumentNullException("cloudQueueClient", "Cloud Queue Client cannot be null if no configuration is loaded.");
                }
            }

            this.cloudQueueClient            = cloudQueueClient ?? GetStorageAccountFromConfigurationSetting().CreateCloudQueueClient();
            this.membershipService           = membershipService;
            this.pushUserEndpointsRepository = pushUserEndpointsRepository;
        }
        public PushNotificationsController(CloudQueueClient cloudQueueClient, IPushUserEndpointsRepository pushUserEndpointsRepository, IUserRepository userRepository)
        {
            if (GetStorageAccountFromConfigurationSetting() == null)
            {
                if (cloudQueueClient == null)
                {
                    throw new ArgumentNullException("cloudQueueClient", "Cloud Queue Client cannot be null if no configuration is loaded.");
                }
            }

            this.cloudQueueClient = cloudQueueClient ?? GetStorageAccountFromConfigurationSetting().CreateCloudQueueClient();
            this.userRepository = userRepository;
            this.pushUserEndpointsRepository = pushUserEndpointsRepository;
        }
        public SamplePushUserRegistrationService(HttpContextBase context, WebOperationContext webOperationContext, IPushUserEndpointsRepository pushUserEndpointsRepository, CloudQueueClient cloudQueueClient)
        {
            if ((context == null) && (HttpContext.Current == null))
            {
                throw new ArgumentNullException("context", "Context cannot be null if not running on a Web context.");
            }

            if (pushUserEndpointsRepository == null)
            {
                throw new ArgumentNullException("pushUserEndpointsRepository", "PushUserEndpoints repository cannot be null.");
            }

            if ((cloudQueueClient == null) && (GetStorageAccountFromConfigurationSetting() == null))
            {
                throw new ArgumentNullException("cloudQueueClient", "Cloud Queue Client cannot be null if no configuration is loaded.");
            }

            this.cloudQueueClient = cloudQueueClient ?? GetStorageAccountFromConfigurationSetting().CreateCloudQueueClient();
            this.webOperationContext = webOperationContext;
            this.context = context;
            this.pushUserEndpointsRepository = pushUserEndpointsRepository;
        }