コード例 #1
0
            internal ChangeTextAreaAction(TextControlPointsProvider provider)
                : base(VObjectAction.ChangeTextArea, "ChangeTextArea")
            {
                if (provider == null)
                {
                    throw new System.ArgumentNullException("provider");
                }

                _provider = provider;
            }
コード例 #2
0
        public TextVObject()
            : base("text")
        {
            base.BrushInternal = new System.Drawing.SolidBrush(System.Drawing.Color.Black);
            base.PenInternal   = null;

            _font     = new System.Drawing.Font("Arial", 16);
            _format   = (System.Drawing.StringFormat)System.Drawing.StringFormat.GenericDefault.Clone();
            _text     = string.Empty;
            _textArea = new System.Drawing.RectangleF(0, 0, 300, 200);

            _textControlPointsProvider = new TextControlPointsProvider(this);
            _textControlPointsProvider.ControlPointsEnabled = false;
            base.JointControlPointsProvider.InsertProvider(0, _textControlPointsProvider);
        }
コード例 #3
0
        protected TextVObject(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
            : base(info, context)
        {
            if (info == null)
            {
                throw new System.ArgumentNullException("info");
            }

            _text     = info.GetString(SerializationNames.TextText);
            _font     = (System.Drawing.Font)info.GetValue(SerializationNames.TextFont, typeof(System.Drawing.Font));
            _format   = BinarySerializer.DeserializeStringFormat((byte[])info.GetValue(SerializationNames.TextFormat, typeof(byte[])));
            _textArea = (System.Drawing.RectangleF)info.GetValue(SerializationNames.TextBounds, typeof(System.Drawing.RectangleF));

            Update(false);

            _textControlPointsProvider = new TextControlPointsProvider(this);
            base.JointControlPointsProvider.InsertProvider(0, _textControlPointsProvider);
            _textControlPointsProvider.SetObjectData(info, context);
        }
コード例 #4
0
        public TextVObject(string text, string fontName, float fontSize, System.Drawing.RectangleF bounds)
            : base("text")
        {
            if (text == null)
            {
                throw new System.ArgumentNullException("text");
            }

            if (fontName == null)
            {
                throw new System.ArgumentNullException("fontName");
            }

            if (fontSize < VObject.Eps)
            {
                throw new System.ArgumentOutOfRangeException("fontSize");
            }

            if (bounds.Width < VObject.Eps || bounds.Height < VObject.Eps)
            {
                throw new System.ArgumentOutOfRangeException("bounds");
            }

            base.BrushInternal = new System.Drawing.SolidBrush(System.Drawing.Color.Black);
            base.PenInternal   = null;

            _font     = new System.Drawing.Font(fontName, fontSize);
            _format   = (System.Drawing.StringFormat)System.Drawing.StringFormat.GenericDefault.Clone();
            _text     = text;
            _textArea = bounds;

            Update(false);

            _textControlPointsProvider = new TextControlPointsProvider(this);
            _textControlPointsProvider.ControlPointsEnabled = false;
            base.JointControlPointsProvider.InsertProvider(0, _textControlPointsProvider);
        }