Example #1
0
        private static void XenConnections_CollectionChanged(object sender, CollectionChangeEventArgs e)
        {
            InvokeHelper.BeginInvoke(() =>
            {
                IXenConnection connection = e.Element as IXenConnection;

                switch (e.Action)
                {
                case CollectionChangeAction.Add:
                    if (connection != null)
                    {
                        AddConnection(connection);
                    }
                    break;

                case CollectionChangeAction.Remove:
                    if (connection != null)
                    {
                        RemoveConnection(connection);
                    }
                    else
                    {
                        var range = e.Element as List <IXenConnection>;
                        if (range != null)
                        {
                            foreach (var con in range)
                            {
                                RemoveConnection(con);
                            }
                        }
                    }
                    break;
                }
            });
        }
Example #2
0
        private void StatusMessaging_StatusUpdate(StatusEventArgs args)
        {
            if (!this.IsDisposed)
            {
                bool found = false;
                if (args != null && !String.IsNullOrEmpty(args.Key))
                {
                    for (int i = 0; i < _StatusUpdates.Count; i++)
                    {
                        if (_StatusUpdates[i].Key == args.Key)
                        {
                            //overwrite old status from that key
                            _StatusUpdates[i] = args;
                            found             = true;
                            break;
                        }
                    }
                    if (!found)
                    {
                        _StatusUpdates.Add(args);
                    }
                }

                InvokeHelper.BeginInvoke(this, "RefreshTaskList", null);
            }
        }
Example #3
0
 private void StatusMessaging_StatusError(StatusErrorEventArgs args)
 {
     if (!this.IsDisposed)
     {
         _StatusErrors.Add(args);
         InvokeHelper.BeginInvoke(this, "RefreshErrorList", new object[] { args });
     }
 }
        private static void XenConnections_CollectionChanged(object sender, CollectionChangeEventArgs e)
        {
            InvokeHelper.BeginInvoke(() =>
            {
                IXenConnection connection = e.Element as IXenConnection;
                if (connection == null)
                {
                    return;
                }

                switch (e.Action)
                {
                case CollectionChangeAction.Add:
                    AddConnection(connection);
                    break;

                case CollectionChangeAction.Remove:
                    RemoveConnection(connection);
                    break;
                }
            });
        }
Example #5
0
 private static void CollectionChanged(Object sender, System.ComponentModel.CollectionChangeEventArgs e)
 {
     //InvokeHelper.AssertOnEventThread();
     InvokeHelper.BeginInvoke(SynchroniseSearches);
 }