protected virtual void RaiseStateChangeEvent(WebConnectorStateChangeEventArgs e)
        {
            // Make a temporary copy of the event to avoid possibility of
            // a race condition if the last subscriber unsubscribes
            // immediately after the null check and before the event is raised.
            EventHandler <WebConnectorStateChangeEventArgs> raiseEvent = WebStateChangeEvent;

            // Event will be null if there are no subscribers
            if (raiseEvent != null)
            {
                raiseEvent(this, e);
            }
        }
Example #2
0
 public void UpdateWebConnectorStatus(WebConnectorStateChangeEventArgs webStateArgs)
 {
     if (_menu.InvokeRequired)
     {
         _menu.Invoke(new Action(() =>
         {
             _webStatusLabel.Text  = "Web: " + webStateArgs.State.ToString();
             _webHostUrl           = FixUrlPlusSign(webStateArgs.Url);
             _webBrowseButton.Text = FixUrlPlusSign(webStateArgs.Url);
         }));
     }
     else
     {
         _webStatusLabel.Text  = "Web: " + webStateArgs.State.ToString();
         _webHostUrl           = FixUrlPlusSign(webStateArgs.Url);
         _webBrowseButton.Text = FixUrlPlusSign(webStateArgs.Url);
     }
 }
Example #3
0
 private void _webAccessHost_WebStateChangeEvent(object sender, WebConnectorStateChangeEventArgs e)
 {
     _contextMenus.UpdateWebConnectorStatus(e);
 }