AnchorArea templates

Feb 20, 2013 at 6:38 AM

TopLeft, top-down, left aligned

    +-------+
    |(1)    |
    |(2)    |
    |(3)    |
    +-------+
    text.AnchorArea = new DevAge.Drawing.AnchorArea(
        float.NaN,
        0,
        float.NaN,
        float.NaN,
        false,
        false);

TopCenter, top-down, center aligned

    +-------+
    |  (1)  |
    |  (2)  |
    |  (3)  |
    +-------+
    text.AnchorArea = new DevAge.Drawing.AnchorArea(
        float.NaN,
        0,
        float.NaN,
        float.NaN,
        true,
        false);

TopRight, top-down, right aligned

    +-------+
    |    (1)|
    |    (2)|
    |    (3)|
    +-------+
It can't be done.

Or,

Modify your AnchorArea!

Add 2 new fields RightAlign&BottomAlign in AnchorArea:
        [DefaultValue(false)]
        public bool RightAlign;

        [DefaultValue(false)]
        public bool BottomAlign;
And so on...

At last, use new ctor:
    text.AnchorArea = new DevAge.Drawing.AnchorArea(
        float.NaN,
        0,
        float.NaN,
        float.NaN,
        false,
        false,
        true,
        false);
However, it is available in my AnchorArea.cs only.

Check the code at my dropbox:
https://dl.dropbox.com/u/24560712/SourceGrid/AnchorArea.cs