コード例 #1
0
ファイル: AppBaseConfig.cs プロジェクト: firstsoft/NextG
        internal void LoadSysParams()
        {
            PropertyInfo[] infos = typeof(Brushes).GetProperties();

            List <BrushInfo> BrushArray = new List <BrushInfo>();

            foreach (PropertyInfo f in infos)
            {
                SolidColorBrush brush = (SolidColorBrush)f.GetValue(null, null);
                brush.Freeze();

                if (brush.Equals(Brushes.Transparent))
                {
                    continue;
                }

                BrushInfo bi = new BrushInfo();
                bi.Name     = f.Name;
                bi.CurBrush = brush;

                BrushArray.Add(bi);
            }

            SystemParams.AllBrushes = BrushArray.ToArray();
        }
コード例 #2
0
        private static void EditingCommandsEx_SelectBackgroundColor_Executed(Object sender, ExecutedRoutedEventArgs e)
        {
            var   editor = sender as RichTextBox;
            Color?color  = RichTextBoxToolBarHelper.GetSelectionColor(e.Parameter, Colors.White);

            if (e.Handled = (editor != null && color != null))
            {
                RichTextBoxToolBarHelper.ApplyNewValueToFormattingProperty <SolidColorBrush>(
                    editor.Selection, TextElement.BackgroundProperty, new SolidColorBrush((Color)color),
                    (item1, item2) => SolidColorBrush.Equals(item1, item2));
            }
        }
コード例 #3
0
        private void ShowAnimate(SolidColorBrush brush = null)
        {
            Visibility = Visibility.Visible;
            var animation = new ThicknessAnimation();

            animation.Duration = new Duration(TimeSpan.FromMilliseconds(180));
            animation.To       = new Thickness(0, 0, 0, 0);
            mainGrid.BeginAnimation(MarginProperty, animation);
            if (brush != null && !brush.Equals(RowBackground))
            {
                RowBackground = new SolidColorBrush(((RowBackground as SolidColorBrush)?.Color ?? Colors.DarkSlateBlue));

                var brushAnimation = new ColorAnimation();
                brushAnimation.Duration = new Duration(TimeSpan.FromMilliseconds(250));
                brushAnimation.To       = brush.Color;
                RowBackground.BeginAnimation(SolidColorBrush.ColorProperty, brushAnimation);
            }
        }
コード例 #4
0
 public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
 {
     if (value is SolidColorBrush)
     {
         SolidColorBrush scbrush = (SolidColorBrush)(value);
         if (scbrush.Equals(Brushes.Blue))
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     else
     {
         return(false);
     }
 }
コード例 #5
0
 private static bool IsDefaultColor(SolidColorBrush color)
 => !(color.Equals(FieldColorHelper.GoodFieldColor) || color.Equals(FieldColorHelper.BadFieldColor));
コード例 #6
0
 public void SwitchSplineColor_2()
 {
     SPLINE_COLOR_2 = SPLINE_COLOR_2.Equals(SPLINE_COLOR_2_A) ? SPLINE_COLOR_2_B : SPLINE_COLOR_2_A;
 }
コード例 #7
0
 public void SwitchSplineColor_1()
 {
     SPLINE_COLOR_1 = SPLINE_COLOR_1.Equals(SPLINE_COLOR_1_A) ? SPLINE_COLOR_1_B : SPLINE_COLOR_1_A;
 }