Ejemplo n.º 1
0
        private void ListViewContextsItems_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            if (!_sortingContexts)
            {
                _sortingContexts = true;
                _contextListSorter.SortLastColumn();

                // try to reselect the previously selected context
                if (_reselectContextId != UserSettings.InvalidContextId)
                {
                    StackHashStatus status = this.DataContext as StackHashStatus;
                    if (status != null)
                    {
                        foreach (StackHashContextStatus contextStatus in status.ContextStatusCollection)
                        {
                            if (contextStatus.ContextId == _reselectContextId)
                            {
                                listViewContexts.SelectedItem = contextStatus;
                                break;
                            }
                        }
                    }
                }

                _sortingContexts = false;
            }
        }
Ejemplo n.º 2
0
 private void ListViewTasksItems_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
 {
     if (!_sortingTasks)
     {
         _sortingTasks = true;
         _taskListSorter.SortLastColumn();
         _sortingTasks = false;
     }
 }
Ejemplo n.º 3
0
        void ListViewScripts_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            if (!_sortingScripts)
            {
                _sortingScripts = true;

                if ((_clientLogic.ScriptData != null) && (_reselectScriptName != null))
                {
                    foreach (StackHashScriptFileData script in _clientLogic.ScriptData)
                    {
                        if (script.Name == _reselectScriptName)
                        {
                            listViewScripts.SelectedItem = script;
                            break;
                        }
                    }
                }

                _listViewSorter.SortLastColumn();

                _sortingScripts = false;
            }
        }
Ejemplo n.º 4
0
        void clientLogic_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (this.Dispatcher.CheckAccess())
            {
                ClientLogic clientLogic = this.DataContext as ClientLogic;

                if ((e.PropertyName == "CurrentView") && (clientLogic.CurrentView == ClientLogicView.EventDetail))
                {
                    _listViewCabsSorter.SortLastColumn();
                    _listViewEventInfosSorter.SortLastColumn();

                    DisplayCab selectedCab = listViewCabs.SelectedItem as DisplayCab;
                    if (selectedCab != null)
                    {
                        clientLogic.CurrentCab = selectedCab;
                    }
                }
            }
            else
            {
                this.Dispatcher.BeginInvoke(new Action <object, PropertyChangedEventArgs>(clientLogic_PropertyChanged), sender, e);
            }
        }