GetSizeOf() public abstract method

Gets the size of.
public abstract GetSizeOf ( ) : int
return int
Exemplo n.º 1
0
        /// <summary>
        /// Gets the size of.
        /// </summary>
        /// <returns>size of the structure</returns>
        public int GetSizeOf()
        {
            int res = 1;

            if (fillStyleType == (byte)FillStyleType.SolidFill && rgbColor != null)
            {
                res += rgbColor.GetSizeOf();
            }

            if (fillStyleType == (byte)FillStyleType.RadialGradientFill ||
                fillStyleType == (byte)FillStyleType.LinearGradientFill)
            {
                if (gradientMatrix != null)
                {
                    res += gradientMatrix.GetSizeOf();
                }
                if (gradient != null)
                {
                    res += gradient.GetSizeOf();
                }
            }

            if (fillStyleType == (byte)FillStyleType.RepeatingBitmapFill ||
                fillStyleType == (byte)FillStyleType.ClippedBitmapFill ||
                fillStyleType == (byte)FillStyleType.NonSmoothedClippedBitmap ||
                fillStyleType == (byte)FillStyleType.NonSmoothedRepeatingBitmap)
            {
                res += 2;
                if (bitmapMatrix != null)
                {
                    res += bitmapMatrix.GetSizeOf();
                }
            }
            return(res);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets the size of.
        /// </summary>
        /// <returns>size of this object type</returns>
        public int GetSizeOf()
        {
            int res = 1;

            if (color != null)
            {
                res += color.GetSizeOf();
            }
            return(res);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Gets the size of.
        /// </summary>
        /// <returns>SIze of this object</returns>
        public int GetSizeOf()
        {
            bool styleFlagsHasFont    = HasFont();
            bool styleFlagsHasColor   = HasColor();
            bool styleFlagsHasYOffset = HasYOffset();
            bool styleFlagsHasXOffset = HasXOffset();

            int res = 1;

            if (styleFlagsHasFont)
            {
                res += 2;
            }
            if (styleFlagsHasColor)
            {
                res += textColor.GetSizeOf();
            }
            if (styleFlagsHasXOffset)
            {
                res += 2;
            }
            if (styleFlagsHasYOffset)
            {
                res += 2;
            }
            if (styleFlagsHasFont)
            {
                res += 2;
            }
            res++;
            if (this.glyphEntries != null)
            {
                res += glyphEntries.GetSizeOf();
            }
            return(res);
        }
Exemplo n.º 4
0
 /// <summary>
 /// Gets the size of.
 /// </summary>
 /// <returns>size of this object</returns>
 public int GetSizeOf()
 {
     return(2 + rgb.GetSizeOf());
 }