123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
- using System.Drawing;
- using System.Windows.Forms;
- using Microsoft.Drawing;
- namespace Microsoft.Windows.Forms.Layout
- {
-
-
-
- public sealed class LayoutData : DisposableMini
- {
-
-
-
- public Graphics Graphics;
-
-
-
- public Rectangle ClientRectangle;
-
-
-
- public Padding Padding;
-
-
-
- public TextImageRelation TextImageRelation;
-
-
-
- public RightToLeft RightToLeft;
-
-
-
- public Size ImageSize;
-
-
-
- public ContentAlignment ImageAlign;
-
-
-
- public Point ImageOffset;
-
-
-
- public string Text;
-
-
-
- public Font Font;
-
-
-
- public ContentAlignment TextAlign;
-
-
-
- public Point TextOffset;
-
-
-
- public Rectangle OutImageBounds;
-
-
-
- public Rectangle OutTextBounds;
-
- private bool m_IsLayouted;
-
-
-
- public bool IsLayouted
- {
- get
- {
- return this.m_IsLayouted;
- }
- }
- private Rectangle? m_CurrentClientRectangle;
-
-
-
- public Rectangle CurrentClientRectangle
- {
- get
- {
- if (this.m_CurrentClientRectangle == null)
- this.m_CurrentClientRectangle = RectangleEx.Subtract(this.ClientRectangle, this.Padding);
- return this.m_CurrentClientRectangle.Value;
- }
- }
- private TextImageRelation? m_CurrentTextImageRelation;
-
-
-
- public TextImageRelation CurrentTextImageRelation
- {
- get
- {
- if (this.m_CurrentTextImageRelation == null)
- this.m_CurrentTextImageRelation = LayoutOptions.RtlTranslateRelation(this.TextImageRelation, this.RightToLeft);
- return this.m_CurrentTextImageRelation.Value;
- }
- }
- private StringFormat m_CurrentStringFormat;
-
-
-
- public StringFormat CurrentStringFormat
- {
- get
- {
- if (this.m_CurrentStringFormat == null)
- this.m_CurrentStringFormat = LayoutOptions.GetStringFormat(this.TextAlign, this.RightToLeft);
- return this.m_CurrentStringFormat;
- }
- }
- private ContentAlignment? m_CurrentImageAlign;
-
-
-
- public ContentAlignment CurrentImageAlign
- {
- get
- {
- if (this.m_CurrentImageAlign == null)
- this.m_CurrentImageAlign = LayoutOptions.RtlTranslateAlignment(this.ImageAlign, this.RightToLeft);
- return this.m_CurrentImageAlign.Value;
- }
- }
- private ContentAlignment? m_CurrentTextAlign;
-
-
-
- public ContentAlignment CurrentTextAlign
- {
- get
- {
- if (this.m_CurrentTextAlign == null)
- this.m_CurrentTextAlign = LayoutOptions.RtlTranslateAlignment(this.TextAlign, this.RightToLeft);
- return this.m_CurrentTextAlign.Value;
- }
- }
-
-
-
- public LayoutData()
- {
- }
-
-
-
- public void DoLayout()
- {
- if (this.m_IsLayouted)
- return;
- this.m_IsLayouted = true;
- LayoutOptions.LayoutTextAndImage(this);
- }
-
-
-
-
- protected override void Dispose(bool disposing)
- {
- if (this.m_CurrentStringFormat != null)
- {
- this.m_CurrentStringFormat.Dispose();
- this.m_CurrentStringFormat = null;
- }
- }
- }
- }
|