Beispiel #1
0
        private void SettingsAppearanceValueRangeSelectedItem_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName == nameof(StatInfoOptionValueRange.Color) ||
                e.PropertyName == nameof(StatInfoOptionValueRange.IsChecked))
            {
                ValueSetColor(CurrentValue);
            }

            // re-sort color ranges
            if (e.PropertyName == nameof(StatInfoOptionValueRange.Value))
            {
                var orderedItems = SettingsAppearanceValueRangeCollection.OrderBy(x => x.Value).ToArray();

                SettingsAppearanceValueRangeCollection.Clear();

                for (var i = 0; i < orderedItems.Length; i++)
                {
                    SettingsAppearanceValueRangeCollection.Add(orderedItems[i]);

                    if (i < orderedItems.Length - 1)
                    {
                        orderedItems[i].ValueRangeType = EnumStatInfoValueRangeType.LessThan;
                    }
                    else
                    {
                        orderedItems[i].ValueRangeType = EnumStatInfoValueRangeType.MoreThan;
                    }
                }
            }
        }
Beispiel #2
0
        public virtual StatInfo Clone()
        {
            var statInfoClone = new StatInfo();

            statInfoClone.MinSample = MinSample;
            statInfoClone.DigitsAfterDecimalPoint = DigitsAfterDecimalPoint;
            statInfoClone.Label = Label;
            statInfoClone.SettingsAppearanceFontBold                = SettingsAppearanceFontBold;
            statInfoClone.SettingsAppearanceFontBold_IsChecked      = SettingsAppearanceFontBold_IsChecked;
            statInfoClone.SettingsAppearanceFontFamily              = SettingsAppearanceFontFamily;
            statInfoClone.SettingsAppearanceFontItalic              = SettingsAppearanceFontItalic;
            statInfoClone.SettingsAppearanceFontItalic_IsChecked    = SettingsAppearanceFontItalic_IsChecked;
            statInfoClone.SettingsAppearanceFontSize                = SettingsAppearanceFontSize;
            statInfoClone.SettingsAppearanceFontUnderline           = SettingsAppearanceFontUnderline;
            statInfoClone.SettingsAppearanceFontUnderline_IsChecked = SettingsAppearanceFontUnderline_IsChecked;
            statInfoClone.GroupName    = GroupName;
            statInfoClone.Id           = Id;
            statInfoClone.CurrentValue = CurrentValue;
            statInfoClone.CurrentColor = currentColor;
            statInfoClone.Caption      = Caption;
            statInfoClone.Stat         = Stat;
            statInfoClone.SettingsPlayerType_IsChecked = SettingsPlayerType_IsChecked;
            statInfoClone.StatInfoGroup          = StatInfoGroup;
            statInfoClone.IsNotVisible           = IsNotVisible;
            statInfoClone.GraphToolIconSource    = GraphToolIconSource;
            statInfoClone.IsPopupBarNotSupported = IsPopupBarNotSupported;

            var colorRangeCloneCollection = SettingsAppearanceValueRangeCollection.Select(x => x.Clone()).OrderBy(x => x.Value).ToArray();

            statInfoClone.SettingsAppearanceValueRangeCollection = new ObservableCollection <StatInfoOptionValueRange>(colorRangeCloneCollection);

            foreach (var v in statInfoClone.SettingsAppearanceValueRangeCollection)
            {
                v.PropertyChanged += statInfoClone.SettingsAppearanceValueRangeSelectedItem_PropertyChanged;
            }

            return(statInfoClone);
        }
Beispiel #3
0
 public void SetPopupDefaults()
 {
     SettingsAppearanceFontSize           = 12;
     SettingsAppearanceFontBold_IsChecked = true;
     SettingsAppearanceValueRangeCollection.ForEach(x => x.Color = HudDefaultSettings.StatInfoActiveColor);
 }