Пример #1
0
        /// <summary>
        /// Creates a Push object for registering for notifications
        /// </summary>
        /// <param name="client">The MobileServiceClient to create with.</param>
        public Push(MobileServiceClient client)
        {
            if (client == null)
            {
                throw new ArgumentNullException("client");
            }

            var storageManager = new LocalStorageManager(client.ApplicationUri.Host);
            var pushHttpClient = new PushHttpClient(client);
            this.RegistrationManager = new RegistrationManager(pushHttpClient, storageManager);
        }
Пример #2
0
        /// <summary>
        /// Creates a Push object for registering for notifications
        /// </summary>
        /// <param name="client">The MobileServiceClient to create with.</param>
        public Push(MobileServiceClient client)
        {
            if (client == null)
            {
                throw new ArgumentNullException("client");
            }

            var storageManager = new LocalStorageManager(client.ApplicationUri.Host);
            var pushHttpClient = new PushHttpClient(client);

            this.RegistrationManager = new RegistrationManager(pushHttpClient, storageManager);
        }
Пример #3
0
        private Push(MobileServiceClient client, string tileId, SecondaryTilesList tiles)
        {
            if (client == null)
            {
                throw new ArgumentNullException("client");
            }

            this.Client = client;
            this.TileId = tileId;

            var storageManager = new LocalStorageManager(client.ApplicationUri.Host, tileId);
            var pushHttpClient = new PushHttpClient(client);

            this.RegistrationManager = new RegistrationManager(pushHttpClient, storageManager);

            this.SecondaryTiles = tiles ?? new SecondaryTilesList(this);
        }
Пример #4
0
        private Push(MobileServiceClient client, string tileId, SecondaryTilesList tiles)
        {
            if (client == null)
            {
                throw new ArgumentNullException("client");
            }

            this.Client = client;
            this.TileId = tileId;
            if (string.IsNullOrEmpty(tileId))
            {
                tileId = PrimaryChannelId;
            }

            string name           = string.Format("{0}-PushContainer-{1}-{2}", Package.Current.Id.Name, client.ApplicationUri.Host, tileId);
            var    storageManager = new LocalStorageManager(name);
            var    pushHttpClient = new PushHttpClient(client);

            this.RegistrationManager = new RegistrationManager(pushHttpClient, storageManager);

            this.SecondaryTiles = tiles ?? new SecondaryTilesList(this);
        }