public PresentationSpacePixel(
     byte InByte1, CharAttrByte InCharAttr, ColorAttrByte InColorAttr)
 {
     mPixelSx   = 2;
     mByte1     = InByte1;
     mCharAttr  = InCharAttr;
     mColorAttr = InColorAttr;
 }
Exemple #2
0
        public PresentationSpaceField(
            out LinkedListNode <PresentationSpacePixel> OutEndPixelNode,
            PresentationSpace InPs,
            LinkedListNode <PresentationSpacePixel> InPixelNode)
        {
            PresentationSpacePixel pixel = InPixelNode.Value;

            mPs                 = InPs;
            mLocation           = pixel.DisplayLocation;
            this.FieldAttribute = new FieldAttribute(pixel.Byte1);

            // store the character attributes found in the first character pixel.
            if (pixel.CharAttrByte != null)
            {
                mCharAttrByte = pixel.CharAttrByte;
            }

            // length runs from pixel after the attribute pixel to the next
            // attribute pixel.
            mLength = 0;
            StringBuilder sb = new StringBuilder();
            LinkedListNode <PresentationSpacePixel> node    = InPixelNode;
            LinkedListNode <PresentationSpacePixel> endNode = InPixelNode;

            while (true)
            {
                node = node.Next;
                if (node == null)
                {
                    break;
                }
                pixel = node.Value;
                if (pixel.IsFieldAttribute == true)
                {
                    break;
                }
                endNode = node;
                ++mLength;
                sb.Append(pixel.CharValue);

                if (sb.Length == 1)
                {
                    if (pixel.ColorAttrByte != null)
                    {
                        mColorAttrByte = pixel.ColorAttrByte;
                    }
                }
            }
            mText           = sb.ToString( );
            OutEndPixelNode = endNode;
        }