Exemplo n.º 1
0
 private void ResetActiveRowBackground()
 {
     ActiveRowBackground = null;
 }
Exemplo n.º 2
0
 private void ResetDirtyMarkerBackground()
 {
     DirtyMarkerBackground = null;
 }
Exemplo n.º 3
0
        /// <summary>
        /// Applies the style to instance of this style.
        /// </summary>
        /// <param name="style">Style to apply.</param>
        public void ApplyStyle(RowHeaderVisualStyle style)
        {
            if (style != null)
            {
                base.ApplyStyle(style);

                if (style._ActiveRowIndicatorColor.IsEmpty == false)
                    _ActiveRowIndicatorColor = style._ActiveRowIndicatorColor;

                if (style._ActiveRowBackground != null && style._ActiveRowBackground.IsEmpty == false)
                    _ActiveRowBackground = style._ActiveRowBackground.Copy();

                if (style._DirtyMarkerBackground != null && style._DirtyMarkerBackground.IsEmpty == false)
                    _DirtyMarkerBackground = style._DirtyMarkerBackground.Copy();

                if (style.ActiveRowImageIndex >= 0)
                {
                    _ActiveRowImage = null;
                    _ActiveRowImageIndex = style.ActiveRowImageIndex;
                }

                if (style.ActiveRowImage != null)
                {
                    _ActiveRowImage = style.ActiveRowImage;
                    _ActiveRowImageIndex = -1;
                }

                if (style.EditingRowImageIndex >= 0)
                {
                    _EditingRowImage = null;
                    _EditingRowImageIndex = style.EditingRowImageIndex;
                }

                if (style.EditingRowImage != null)
                {
                    _EditingRowImage = style.EditingRowImage;
                    _EditingRowImageIndex = -1;
                }

                if (style.InfoRowImageIndex >= 0)
                {
                    _InfoRowImage = null;
                    _InfoRowImageIndex = style.InfoRowImageIndex;
                }

                if (style.InfoRowImage != null)
                {
                    _InfoRowImage = style.InfoRowImage;
                    _InfoRowImageIndex = -1;
                }
            }
        }
Exemplo n.º 4
0
 private void ResetHotBackground()
 {
     HotBackground = null;
 }
Exemplo n.º 5
0
 private void ResetBackground()
 {
     _Background = null;
 }
Exemplo n.º 6
0
 public bool IsEqualTo(Background background)
 {
     return (_Color1 == background.Color1 &&
             _Color2 == background.Color2 &&
             _BackColorBlend.Equals(background._BackColorBlend) &&
             _GradientAngle == background.GradientAngle &&
             _BackFillType == background.BackFillType);
 }
Exemplo n.º 7
0
        /// <summary>
        /// Creates an exact copy of the background.
        /// </summary>
        /// <returns>Copy of the background.</returns>
        public Background Copy()
        {
            Background copy = new Background();

            copy.Color1 = _Color1;
            copy.Color2 = _Color2;

            copy.GradientAngle = _GradientAngle;
            copy.BackFillType = _BackFillType;

            if (_BackColorBlend != null)
                copy.BackColorBlend = _BackColorBlend.Copy();

            return (copy);
        }
        private RowVisualStyle GetDefaultRowStyle(ColorFactory factory)
        {
            RowVisualStyle rowStyle = new RowVisualStyle();
            rowStyle.Background = new Background(factory.GetColor(Color.White));

            RowHeaderVisualStyle style = new RowHeaderVisualStyle();

            style.Font = SystemFonts.DefaultFont;
            style.TextColor = factory.GetColor(0x1E395B);

            Background bg = new Background();
            BackColorBlend bcb = new BackColorBlend();

            bcb.Colors = new Color[3];
            bcb.Colors[0] = factory.GetColor(0x6A6A6A);
            bcb.Colors[1] = factory.GetColor(0x6A6A6A);
            bcb.Colors[2] = factory.GetColor(0x5E5E5E);

            bcb.Positions = new float[3];
            bcb.Positions[0] = 0f;
            bcb.Positions[1] = .75f;
            bcb.Positions[2] = 1f;

            bg.BackColorBlend = bcb;
            bg.GradientAngle = 0;

            style.Background = bg;
            style.TextColor = factory.GetColor(0xE2E2E2);

            bg = new Background(factory.GetColor(0x6A6A6A));

            style.ActiveRowBackground = bg;
            style.DirtyMarkerBackground = new Background(factory.GetColor(0xAE054F), factory.GetColor(0xE75E94), BackFillType.VerticalCenter);
            style.BorderHighlightColor = GetBorderHighlight(factory);

            rowStyle.RowHeaderStyle = style;

            return (rowStyle);
        }
        private RowVisualStyle GetMouseOverRowStyle(ColorFactory factory)
        {
            RowVisualStyle rowStyle = new RowVisualStyle();
            rowStyle.Background = new Background(Color.White);

            RowHeaderVisualStyle style = new RowHeaderVisualStyle();
            style.Background = new Background(Color.Plum);
            style.ActiveRowBackground = new Background(Color.Blue);

            Background bg = new Background();
            BackColorBlend bcb = new BackColorBlend();

            bcb.Colors = new Color[3];
            bcb.Colors[0] = factory.GetColor(0xFFE575);
            bcb.Colors[1] = factory.GetColor(0xFFE575);
            bcb.Colors[2] = factory.GetColor(0xF2CD66);

            bcb.Positions = new float[3];
            bcb.Positions[0] = 0f;
            bcb.Positions[1] = .75f;
            bcb.Positions[2] = 1f;

            bg.BackColorBlend = bcb;
            bg.GradientAngle = 0;

            style.Background = bg;
            style.TextColor = factory.GetColor(0x444444);

            bg = new Background();
            bcb = new BackColorBlend();

            bcb.Colors = new Color[3];
            bcb.Colors[0] = Color.FromArgb(254 - 20, 240 - 20, 214 - 20);
            bcb.Colors[1] = Color.FromArgb(254 - 30, 199 - 30, 104 - 30);
            bcb.Colors[2] = Color.FromArgb(229 - 30, 133 - 30, 0);

            bcb.Positions = new float[3];
            bcb.Positions[0] = 0f;
            bcb.Positions[1] = .75f;
            bcb.Positions[2] = 1f;

            bg.BackColorBlend = bcb;
            bg.GradientAngle = 0;

            style.ActiveRowBackground = bg;

            rowStyle.RowHeaderStyle = style;

            return (rowStyle);
        }
 private Background GetDefaultSelectedColumnBackground(ColorFactory factory)
 {
     Background bg = new Background(factory.GetColor(0xFFD359), factory.GetColor(0xFFEF71));
     return bg;
 }
Exemplo n.º 11
0
        private Background GetDefaultSelectedBackground(ColorFactory factory)
        {
            MetroPartColors metroColors = _MetroPartColors;

            Background bg = new Background(factory.GetColor(metroColors.BaseColor));

            return (bg);
        }
Exemplo n.º 12
0
        private Background GetDefaultSelectedColumnBackground(ColorFactory factory)
        {
            MetroPartColors metroColors = _MetroPartColors;

            Background bg = new Background(factory.GetColor(metroColors.CanvasColorLighterShade),
                factory.GetColor(metroColors.CanvasColorLightShade));

            return (bg);
        }
Exemplo n.º 13
0
        private RowVisualStyle GetMouseOverRowStyle()
        {
            MetroPartColors metroColors = _MetroPartColors;

            RowVisualStyle rowStyle = new RowVisualStyle();
            rowStyle.Background = new Background(metroColors.CanvasColor);

            RowHeaderVisualStyle style = new RowHeaderVisualStyle();
            style.Background = new Background(metroColors.CanvasColorLighterShade);
            style.ActiveRowBackground = new Background(metroColors.CanvasColorLightShade);

            Background bg = new Background(metroColors.CanvasColorLightShade);
            style.Background = bg;

            bg = new Background(metroColors.BaseColor);
            style.ActiveRowBackground = bg;

            rowStyle.RowHeaderStyle = style;

            return (rowStyle);
        }
Exemplo n.º 14
0
        private RowVisualStyle GetDefaultRowStyle()
        {
            MetroPartColors metroColors = _MetroPartColors;

            RowVisualStyle rowStyle = new RowVisualStyle();
            rowStyle.Background = new Background(metroColors.CanvasColor);

            RowHeaderVisualStyle style = new RowHeaderVisualStyle();

            style.Font = SystemFonts.DefaultFont;
            style.TextColor = metroColors.TextColor;

            Background bg = new Background(metroColors.CanvasColorLighterShade);
            style.Background = bg;

            bg = new Background(metroColors.BaseColor);
            style.ActiveRowBackground = bg;
            style.DirtyMarkerBackground = new Background(metroColors.BaseColorDarker);
            style.BorderHighlightColor = GetBorderHighlight();

            rowStyle.RowHeaderStyle = style;

            return (rowStyle);
        }