Ejemplo n.º 1
0
        private void GDI_BrokenLine_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            tools.WaitForRendering();
            switch (e.PropertyName)
            {
            case nameof(Description):
                break;

            case nameof(Layer):
                break;

            case nameof(FillPattern):
                tools.UpdateFillPattern();
                break;

            case nameof(Points):
            case nameof(Visible):
                var rect = __points.GetBounds();
                if (rect.Size != SizeF.Empty)
                {
                    tools.RecordClip(rect);
                }
                break;

            default:
                break;
            }
        }
Ejemplo n.º 2
0
        private void GDI_Ellipse_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            tools.WaitForRendering();

            switch (e.PropertyName)
            {
            case nameof(Description):
                break;

            case nameof(Layer):
                break;

            case nameof(FillPattern):
                tools.UpdateFillPattern();
                break;

            case nameof(Location):
            case nameof(Width):
            case nameof(Height):
            case nameof(Visible):
                rect = GetBounds();
                if (rect.Size != SizeF.Empty)
                {
                    tools.RecordClip(rect);
                }

                break;

            default:
                break;
            }
        }
Ejemplo n.º 3
0
        private void GDI_Text_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            tools.WaitForRendering();
            try
            {
                switch (e.PropertyName)
                {
                case nameof(FamilyName):
                case nameof(FontSize):
                    using (var tmp = font)
                    {
                        font = new Font(FamilyName, Math.Max(9, FontSize), GraphicsUnit.Pixel);
                    }
                    break;

                case nameof(FillPattern):
                    tools.UpdateFillPattern();
                    break;

                case nameof(Location):
                case nameof(StringSize):
                case nameof(Visible):
                    if (StringSize != SizeF.Empty)
                    {
                        tools.RecordClip(new RectangleF(Location, StringSize));
                    }
                    break;

                case nameof(Alignment):
                    sf.Alignment = alignment;
                    break;

                case nameof(LineAlignment):
                    sf.LineAlignment = lineAlignment;
                    break;

                case nameof(Trimming):
                    sf.Trimming = trimming;
                    break;

                case nameof(TextColor):
                    brush.Dispose();
                    brush = new SolidBrush(textColor);
                    break;
                }
            }
            catch (Exception ex)
            {
                __messagePipe.OnMessageSend("GDI_Text_PropertyChanged failed", DrawingMessageLevel.Error, ex);
            }
        }
Ejemplo n.º 4
0
        private void GDI_Rectangle_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            tools.WaitForRendering();
            try
            {
                switch (e.PropertyName)
                {
                case nameof(Description):
                    //TODO change Description
                    break;

                case nameof(Layer):
                    break;

                case nameof(Location):
                case nameof(RectHeight):
                case nameof(RectWidth):
                case nameof(Visible):
                    rect = Rectangle.Ceiling(GetBounds());
                    if (rect.Size != SizeF.Empty)
                    {
                        tools.RecordClip(rect);
                    }

                    break;

                case nameof(FillPattern):
                    tools.UpdateFillPattern();
                    break;

                //case nameof(TextColor):

                //    break;
                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                __messagePipe.OnMessageSend("GDI_Rectangle_PropertyChanged failed.", DrawingMessageLevel.Error, ex);
            }
        }