Пример #1
0
 public virtual Size GetTextSize(Size proposedSize)
 {
     return Size.Empty;
 }
Пример #2
0
        Size GetPreferredSizeCore(
            Size proposedSize
            )
        {
            int linearBorderAndPadding = ((this.borderSize * 2) + (this.paddingSize * 2));

            if (this.growBorderBy1PxWhenDefault)
            {
                linearBorderAndPadding += 2;
            }



            Size bordersAndPadding = new Size(linearBorderAndPadding, linearBorderAndPadding);

            proposedSize = Size.Subtract(proposedSize, bordersAndPadding);



            int checkSizeLinear = this.FullCheckSize;

            Size checkSize =
                (checkSizeLinear > 0) ?
                    new Size(checkSizeLinear + 1, checkSizeLinear) :
                    Size.Empty;




            Size textImageInsetSize = new Size(this.textImageInset * 2, this.textImageInset * 2);

            Size requiredImageSize =
                (!Size.AreEqual(this.imageSize, Size.Empty)) ?
                    Size.Add(this.imageSize, textImageInsetSize) :
                    Size.Empty;



            proposedSize = Size.Subtract(proposedSize, textImageInsetSize);

            proposedSize = this.Decompose(checkSize, requiredImageSize, proposedSize);



            Size textSize = Size.Empty;


            if (!string.IsNullOrEmpty(this.text))
            {
                try
                {
                    this.disableWordWrapping = true;
                    textSize = Size.Add(this.GetTextSize(proposedSize), textImageInsetSize);
                }
                finally
                {
                    this.disableWordWrapping = false;
                }
            }



            Size requiredSize = this.Compose(checkSize, this.imageSize, textSize);

            requiredSize = Size.Add(requiredSize, bordersAndPadding);



            return requiredSize;
        }
Пример #3
0
 public Size Decompose(Size checkSize, Size requiredImageSize, Size proposedSize)
 {
     return Size.Empty;
 }
Пример #4
0
 public Size Compose(Size checkSize, Size imageSize, Size textSize)
 {
     return Size.Empty;
 }
Пример #5
0
 public static bool AreEqual(Size sz1, Size sz2)
 {
     return ((sz1.width == sz2.width) && (sz1.height == sz2.height));
 }
Пример #6
0
 public static Size Add(Size sz1, Size sz2)
 {
     return Size.Empty;
 }
Пример #7
0
 public static Size Subtract(Size sz1, Size sz2)
 {
     return Size.Empty;
 }