예제 #1
0
        private void SetGroupedShips()
        {
            if (_shipsTypes == null)
            {
                return;
            }

            var order = Properties.Settings.Default.DScanShipAggregatorGroupBy;

            if (order == "Role")
            {
                _shipsTypes = _shipsTypes.OrderBy(x => x, ROLE_COMPARER)
                              .ToList();

                var vs = new ListCollectionView(_shipsTypes);
                // ReSharper disable PossibleNullReferenceException
                vs.GroupDescriptions.Add( // ReSharper restore PossibleNullReferenceException
                    new PropertyGroupDescription(
                        NotifyUtils.GetPropertyName((AggregatedShipTypeViewModel a) => a.FleetRole)));

                DataShips.ItemsSource = vs;
            }
            else
            {
                _shipsTypes = _shipsTypes.OrderBy(x => x, GROUP_COMPARER)
                              .ToList();
                var vs = new ListCollectionView(_shipsTypes);
                // ReSharper disable PossibleNullReferenceException
                vs.GroupDescriptions.Add( // ReSharper restore PossibleNullReferenceException
                    new PropertyGroupDescription(
                        NotifyUtils.GetPropertyName((AggregatedShipTypeViewModel a) => a.ShipGroup)));

                DataShips.ItemsSource = vs;
            }
        }
예제 #2
0
 private void SettingsPropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     if (e.PropertyName == NotifyUtils.GetPropertyName((Settings s) => s.CoalitionsJson))
     {
         InitCoalitions();
     }
 }
예제 #3
0
 private void SettingsOnPropertyChanged(object sender, PropertyChangedEventArgs propertyChangedEventArgs)
 {
     //TODO extract in extra class/binder between settings/shortcutregistry/editorwidget
     if (propertyChangedEventArgs.PropertyName == NotifyUtils.GetPropertyName((Settings s) => s.ShortcutToggleMinimizeAll) || propertyChangedEventArgs.PropertyName == NotifyUtils.GetPropertyName((Settings s) => s.ShortcutQuickAction))
     {
         Settings.RegisterGlobalShortcut();
     }
 }
예제 #4
0
 private void SettingsOnPropertyChanged(object sender, PropertyChangedEventArgs propertyChangedEventArgs)
 {
     if (propertyChangedEventArgs.PropertyName == NotifyUtils.GetPropertyName((Settings s) => s.AreVoiceCommandsEnabled) ||
         propertyChangedEventArgs.PropertyName == NotifyUtils.GetPropertyName((Settings s) => s.VoiceCommandToggleMinimze) ||
         propertyChangedEventArgs.PropertyName == NotifyUtils.GetPropertyName((Settings s) => s.VoiceCommandQuickAction))
     {
         Setup();
     }
 }
예제 #5
0
        private void DefaultOnPropertyChanged(object sender, PropertyChangedEventArgs propertyChangedEventArgs)
        {
            if (propertyChangedEventArgs.PropertyName !=
                NotifyUtils.GetPropertyName((Settings s) => s.PositionTrackingCharacters))
            {
                return;
            }

            var lastActiveCharacter = _activeCharacterTracker.LastActiveCharacter;

            if (lastActiveCharacter == null || _curActiveCharacter == lastActiveCharacter)
            {
                return;
            }

            ActiveCharacterTrackerOnActiveCharacterChanged(lastActiveCharacter);
        }
예제 #6
0
 private void UpdateColors()
 {
     OnPropertyChanged(NotifyUtils.GetPropertyName((SolarSystemViewModel x) => x.ForegroundColor));
     OnPropertyChanged(NotifyUtils.GetPropertyName((SolarSystemViewModel x) => x.BackgroundColor));
 }