Ejemplo n.º 1
0
        /// <summary>
        /// Adds a media item to the Black list. Adds Locally and to the WebService
        /// </summary>
        /// <param name="id">The Media ID</param>
        /// <param name="type">The BlackListType, either All (to blacklist on all displays) or Single (to blacklist only on this display)</param>
        /// <param name="reason">The reason for the blacklist</param>
        public void Add(string id, BlackListType type, string reason)
        {
            // Do some validation
            if (reason == "")
            {
                reason = "No reason provided";
            }

            int mediaId;

            if (!Int32.TryParse(id, out mediaId))
            {
                Trace.WriteLine(
                    String.Format("Currently can only append Integer media types. Id {0}", id), "BlackList - Add");
            }

            // Send to the webservice
            xmds1 = new ServiceClient();
            xmds1.BlackListCompleted += (xmds1_BlackListCompleted);

            xmds1.BlackListAsync(Settings.Default.ServerKey, hardwareKey.Key, mediaId, type.ToString(), reason,
                                 Settings.Default.Version);

            // Add to the local list
            AddLocal(id);
        }
Ejemplo n.º 2
0
 public void Add(string id, BlackListType type, string reason)
 {
     int num;
     if (reason == "")
     {
         reason = "No reason provided";
     }
     if (!int.TryParse(id, out num))
     {
         Trace.WriteLine(string.Format("Currently can only append Integer CurrentMedia types. Id {0}", id), "BlackList - Add");
     }
     this.xmds1 = new ServiceClient();
     this.xmds1.BlackListCompleted += new EventHandler<AsyncCompletedEventArgs>(this.xmds1_BlackListCompleted);
     this.xmds1.BlackListAsync(Settings.Default.ServerKey, this.hardwareKey.Key, num, type.ToString(), reason, Settings.Default.Version);
     this.AddLocal(id);
 }
Ejemplo n.º 3
0
        public void Add(string id, BlackListType type, string reason)
        {
            int num;

            if (reason == "")
            {
                reason = "No reason provided";
            }
            if (!int.TryParse(id, out num))
            {
                Trace.WriteLine(string.Format("Currently can only append Integer CurrentMedia types. Id {0}", id), "BlackList - Add");
            }
            this.xmds1 = new ServiceClient();
            this.xmds1.BlackListCompleted += new EventHandler <AsyncCompletedEventArgs>(this.xmds1_BlackListCompleted);
            this.xmds1.BlackListAsync(Settings.Default.ServerKey, this.hardwareKey.Key, num, type.ToString(), reason, Settings.Default.Version);
            this.AddLocal(id);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Adds a media item to the Black list. Adds Locally and to the WebService
        /// </summary>
        /// <param name="id">The Media ID</param>
        /// <param name="type">The BlackListType, either All (to blacklist on all displays) or Single (to blacklist only on this display)</param>
        /// <param name="reason">The reason for the blacklist</param>
        public void Add(string id, BlackListType type, string reason)
        {
            // Do some validation
            if (reason == "") reason = "No reason provided";
            
            int mediaId;
            if (!int.TryParse(id, out mediaId))
            {
                System.Diagnostics.Trace.WriteLine(String.Format("Currently can only append Integer media types. Id {0}", id), "BlackList - Add");
            }

            // Send to the webservice
            xmds1 = new XiboClient.xmds.xmds();
            xmds1.BlackListCompleted += new XiboClient.xmds.BlackListCompletedEventHandler(xmds1_BlackListCompleted);

            xmds1.BlackListAsync(ApplicationSettings.Default.ServerKey, hardwareKey.Key, mediaId, type.ToString(), reason, ApplicationSettings.Default.Version);

            // Add to the local list
            AddLocal(id);
        }