コード例 #1
0
ファイル: HCTableCell.cs プロジェクト: HunSoft/HCView-CSharp
        public virtual void SaveToStream(Stream aStream)
        {
            /* 因为可能是合并后的单元格,所以单独存宽、高 }*/
            byte[] vBuffer = BitConverter.GetBytes(FWidth);
            aStream.Write(vBuffer, 0, vBuffer.Length);

            vBuffer = BitConverter.GetBytes(FHeight);
            aStream.Write(vBuffer, 0, vBuffer.Length);

            vBuffer = BitConverter.GetBytes(FRowSpan);
            aStream.Write(vBuffer, 0, vBuffer.Length);

            vBuffer = BitConverter.GetBytes(FColSpan);
            aStream.Write(vBuffer, 0, vBuffer.Length);

            byte vByte = (byte)FAlignVert;

            aStream.WriteByte(vByte);                          // 垂直对齐方式

            HC.HCSaveColorToStream(aStream, FBackgroundColor); // 背景色

            aStream.WriteByte(FBorderSides.Value);

            // 存数据
            bool vNullData = (FCellData == null);

            vBuffer = BitConverter.GetBytes(vNullData);
            aStream.Write(vBuffer, 0, vBuffer.Length);
            if (!vNullData)
            {
                FCellData.SaveToStream(aStream);
            }
        }
コード例 #2
0
        public void SaveToStream(Stream aStream)
        {
            byte vByte = (byte)FLineSpaceMode;

            aStream.WriteByte(vByte);

            byte[] vBuffer = BitConverter.GetBytes(FLineSpace);
            aStream.Write(vBuffer, 0, vBuffer.Length);

            vBuffer = BitConverter.GetBytes(FFirstIndent);
            aStream.Write(vBuffer, 0, vBuffer.Length);

            vBuffer = BitConverter.GetBytes(FLeftIndent);
            aStream.Write(vBuffer, 0, vBuffer.Length);

            vBuffer = BitConverter.GetBytes(FRightIndent);
            aStream.Write(vBuffer, 0, vBuffer.Length);

            HC.HCSaveColorToStream(aStream, FBackColor);  // save BackColor

            vByte = 0;
            if (FBreakRough)
            {
                vByte = (byte)(vByte | (1 << 7));
            }

            aStream.WriteByte(vByte);

            vByte = (byte)FAlignHorz;
            aStream.WriteByte(vByte);

            vByte = (byte)FAlignVert;
            aStream.WriteByte(vByte);
        }
コード例 #3
0
        public virtual void SaveToStream(Stream aStream)
        {
            if (FStyle == HCShapeStyle.hssNone)
            {
                throw new Exception("HCShape保存失败,无效的样式值!");
            }

            aStream.WriteByte((byte)FStyle);
            aStream.WriteByte(FVersion);
            HC.HCSaveColorToStream(aStream, FColor);
        }
コード例 #4
0
        public void SaveToStream(Stream aStream)
        {
            byte[] vBuffer = BitConverter.GetBytes(FSize);
            aStream.Write(vBuffer, 0, vBuffer.Length);

            HC.HCSaveTextToStream(aStream, FFamily);

            aStream.WriteByte(FFontStyles.Value);        // save FFontStyles

            HC.HCSaveColorToStream(aStream, FColor);     // save FColor
            HC.HCSaveColorToStream(aStream, FBackColor); // save FBackColor
        }