public void SetAlign(ELegendAlign align)
 {
     chk_top_left.Checked     = align == ELegendAlign.TopLeft;
     chk_top_right.Checked    = align == ELegendAlign.TopRight;
     chk_botton_left.Checked  = align == ELegendAlign.BottonLeft;
     chk_botton_right.Checked = align == ELegendAlign.BottonRight;
 }
        public void Update(ELegendAlign align, Font font)
        {
            if (_location == null || _size == null)
            {
                return;
            }

            this._font = font;

            var text = TextRenderer.MeasureText(DateTime.Now.ToString(Consts.FORMAT_DATE_TIME), font);

            var width  = text.Width;
            var height = text.Height;

            switch (align)
            {
            case ELegendAlign.TopLeft:
                _location.X = Consts.LOCATION.X;
                _location.Y = Consts.LOCATION.Y;
                break;

            case ELegendAlign.TopRight:
                _location.X = _size.Width - (Consts.LOCATION.X + width);
                _location.Y = Consts.LOCATION.Y;
                break;

            case ELegendAlign.BottonLeft:
                _location.X = Consts.LOCATION.X;
                _location.Y = _size.Height - (Consts.LOCATION.Y + height);
                break;

            case ELegendAlign.BottonRight:
                _location.X = _size.Width - (Consts.LOCATION.X + width);
                _location.Y = _size.Height - (Consts.LOCATION.Y + height);
                break;
            }
        }
 public Legend(ELegendAlign align, Font font, Size resolution)
 {
     this._size = resolution;
     Update(align, font);
 }