Exemplo n.º 1
0
 /// <summary>
 /// Adds a new web event to the server.
 /// </summary>
 /// <param name="webEvent">The web event and corresponding data that the server will handle.</param>
 /// <returns>A Boolean value that indicates whether the <see cref="WebEvent"/> could be added, <b>true</b> if added,
 /// <b>false</b>, if webEvent already exists. </returns>
 internal bool AddWebEvent(WebEvent webEvent)
 {
     if (!WebEvents.Contains(webEvent.GetWebEventId()))
     {
         WebEvents.Add(webEvent.GetWebEventId(), webEvent);
         return(true);
     }
     return(false);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Stops and removes the given <see cref="WebEvent"/>.
        /// </summary>
        /// <param name="webEvent">The <see cref="WebEvent"/> to stop.</param>
        /// <returns>Returns <b>true</b> if the <see cref="WebEvent"/> exists and can be removed, <b>false</b> if <see cref="WebEvent"/>
        /// does not exist or cannot be stopped.</returns>
        public bool Stop(WebEvent webEvent)
        {
            if (WebEvents.Contains(webEvent.GetWebEventId()))
            {
                WebEvents.Remove(webEvent.GetWebEventId());
                return(true);
            }

            // Debug.Print("Service not found");
            return(false);
        }