public void LoadFromStream(Stream aStream, ushort aFileVersion)
        {
            int vOldSize = 10;

            if (aFileVersion < 12)
            {
                byte[] vBuffer1 = BitConverter.GetBytes(vOldSize);
                aStream.Read(vBuffer1, 0, vBuffer1.Length);
                vOldSize = BitConverter.ToInt32(vBuffer1, 0);
                FSize    = (ushort)vOldSize;
            }
            else
            {
                byte[] vBuffer1 = BitConverter.GetBytes(FSize);
                aStream.Read(vBuffer1, 0, vBuffer1.Length);
                FSize = BitConverter.ToSingle(vBuffer1, 0);  // 字号
            }

            HC.HCLoadTextFromStream(aStream, ref FFamily, aFileVersion); // 字体

            FFontStyles.Value = (byte)aStream.ReadByte();                // load FFontStyles

            HC.HCLoadColorFromStream(aStream, ref FColor);               // load FColor
            HC.HCLoadColorFromStream(aStream, ref FBackColor);           // load FBackColor
        }
        public override void LoadFromStream(Stream aStream, HCStyle aStyle, ushort aFileVersion)
        {
            base.LoadFromStream(aStream, aStyle, aFileVersion);
            BeginAdd();
            try
            {
                byte[] vBuffer;

                if (aFileVersion > 39)
                {
                    FColumns = (byte)aStream.ReadByte();
                    Byte vByte = (byte)aStream.ReadByte();
                    FMultSelect  = HC.IsOdd(vByte >> 7);
                    FItemHit     = HC.IsOdd(vByte >> 6);
                    FColumnAlign = HC.IsOdd(vByte >> 5);
                    FBoxRight    = HC.IsOdd(vByte >> 4);
                }

                FItems.Clear();
                string vS = "";
                HC.HCLoadTextFromStream(aStream, ref vS, aFileVersion);
                if (vS != "")
                {
                    string[] vStrings = vS.Split(new string[] { HC.sLineBreak }, StringSplitOptions.None);
                    for (int i = 0; i < vStrings.Length; i++)
                    {
                        AddItem(vStrings[i]);
                    }

                    if (aFileVersion > 35)
                    {
                        HC.HCLoadTextFromStream(aStream, ref vS, aFileVersion);
                        if (vS != "")
                        {
                            vStrings = vS.Split(new string[] { HC.sLineBreak }, StringSplitOptions.None);
                            for (int i = 0; i < vStrings.Length; i++)
                            {
                                FItems[i].TextValue = vStrings[i];
                            }
                        }
                    }

                    vBuffer = BitConverter.GetBytes(false);
                    for (int i = 0; i < FItems.Count; i++)
                    {
                        aStream.Read(vBuffer, 0, vBuffer.Length);
                        FItems[i].Checked = BitConverter.ToBoolean(vBuffer, 0);
                    }
                }

                if (aFileVersion > 33)
                {
                    this.FRadioStyle = (HCRadioStyle)aStream.ReadByte();
                }
            }
            finally
            {
                EndAdd();
            }
        }
Exemple #3
0
        public override void LoadFromStream(Stream aStream, HCStyle aStyle, ushort aFileVersion)
        {
            base.LoadFromStream(aStream, aStyle, aFileVersion);
            HC.HCLoadTextFromStream(aStream, ref FText, aFileVersion);

            if (aFileVersion > 33)
            {
                byte vByte = (byte)aStream.ReadByte();
                FReadOnly      = HC.IsOdd(vByte >> 7);
                FPrintOnlyText = HC.IsOdd(vByte >> 6);
            }
            else
            {
                byte[] vBuffer = BitConverter.GetBytes(FReadOnly);
                aStream.Read(vBuffer, 0, vBuffer.Length);
                FReadOnly      = BitConverter.ToBoolean(vBuffer, 0);
                FPrintOnlyText = false;
            }


            if (aFileVersion > 15)
            {
                FBorderSides.Value = (byte)aStream.ReadByte();
                FBorderWidth       = (byte)aStream.ReadByte();
            }
        }
Exemple #4
0
        public override void LoadFromStream(Stream aStream, HCStyle aStyle, ushort aFileVersion)
        {
            base.LoadFromStream(aStream, aStyle, aFileVersion);
            FItems.Clear();

            string vS = "";

            HC.HCLoadTextFromStream(aStream, ref vS, aFileVersion);
            if (vS != "")
            {
                string[] vStrings = vS.Split(new string[] { HC.sLineBreak }, StringSplitOptions.None);

                for (int i = 0; i < vStrings.Length; i++)
                {
                    AddItem(vStrings[i]);
                }

                byte[] vBuffer = BitConverter.GetBytes(false);
                for (int i = 0; i < FItems.Count; i++)
                {
                    aStream.Read(vBuffer, 0, vBuffer.Length);
                    FItems[i].Checked = BitConverter.ToBoolean(vBuffer, 0);
                }
            }
        }
        public override void LoadFromStream(Stream AStream, HCStyle AStyle, ushort aFileVersion)
        {
            base.LoadFromStream(AStream, AStyle, aFileVersion);
            FItems.Clear();
            string vText = "";

            HC.HCLoadTextFromStream(AStream, ref vText, aFileVersion);
            string[] vStrings = vText.Split(new string[] { HC.sLineBreak }, StringSplitOptions.None);
            for (int i = 0; i < vStrings.Length; i++)
            {
                FItems.Add(new HCCbbItem(vStrings[i]));
            }

            if ((FItems.Count > 0) && (aFileVersion > 35))
            {
                vText = "";
                HC.HCLoadTextFromStream(AStream, ref vText, aFileVersion);
                vStrings = vText.Split(new string[] { HC.sLineBreak }, StringSplitOptions.None);
                for (int i = 0; i < vStrings.Length; i++)
                {
                    FItemValues.Add(new HCCbbItem(vStrings[i]));
                }
            }
            else
            {
                FItemValues.Clear();
            }

            FSaveItem = FItems.Count > 0;
        }
        public override void LoadFromStream(Stream aStream, HCStyle aStyle, ushort aFileVersion)
        {
            base.LoadFromStream(aStream, aStyle, aFileVersion);
            string vText = "";

            HC.HCLoadTextFromStream(aStream, ref vText, aFileVersion);
            FCode128.Text = vText;
        }
        public override void LoadFromStream(Stream aStream, HCStyle aStyle, ushort aFileVersion)
        {
            base.LoadFromStream(aStream, aStyle, aFileVersion);

            byte[] vBuffer = BitConverter.GetBytes(FChecked);
            aStream.Read(vBuffer, 0, vBuffer.Length);
            FChecked = BitConverter.ToBoolean(vBuffer, 0);
            HC.HCLoadTextFromStream(aStream, ref FText, aFileVersion);
        }
        public override void LoadFromStream(Stream AStream, HCStyle AStyle, ushort aFileVersion)
        {
            base.LoadFromStream(AStream, AStyle, aFileVersion);
            FItems.Clear();
            string vText = "";

            if (aFileVersion > 36)
            {
                byte[] vBuffer = BitConverter.GetBytes(FSaveItem);
                AStream.Read(vBuffer, 0, vBuffer.Length);
                FSaveItem = BitConverter.ToBoolean(vBuffer, 0);
                if (FSaveItem)
                {
                    HC.HCLoadTextFromStream(AStream, ref vText, aFileVersion);
                    string[] vStrings = vText.Split(new string[] { HC.sLineBreak }, StringSplitOptions.None);
                    for (int i = 0; i < vStrings.Length; i++)
                    {
                        FItems.Add(new HCCbbItem(vStrings[i]));
                    }

                    vText = "";
                    HC.HCLoadTextFromStream(AStream, ref vText, aFileVersion);
                    vStrings = vText.Split(new string[] { HC.sLineBreak }, StringSplitOptions.None);
                    for (int i = 0; i < vStrings.Length; i++)
                    {
                        FItemValues.Add(new HCCbbItem(vStrings[i]));
                    }
                }
            }
            else
            {
                HC.HCLoadTextFromStream(AStream, ref vText, aFileVersion);
                string[] vStrings = vText.Split(new string[] { HC.sLineBreak }, StringSplitOptions.None);
                for (int i = 0; i < vStrings.Length; i++)
                {
                    FItems.Add(new HCCbbItem(vStrings[i]));
                }

                if ((FItems.Count > 0) && (aFileVersion > 35))
                {
                    vText = "";
                    HC.HCLoadTextFromStream(AStream, ref vText, aFileVersion);
                    vStrings = vText.Split(new string[] { HC.sLineBreak }, StringSplitOptions.None);
                    for (int i = 0; i < vStrings.Length; i++)
                    {
                        FItemValues.Add(new HCCbbItem(vStrings[i]));
                    }
                }
                else
                {
                    FItemValues.Clear();
                }

                FSaveItem = FItems.Count > 0;
            }
        }
        public override void LoadFromStream(System.IO.Stream aStream, HCStyle aStyle, ushort aFileVersion)
        {
            base.LoadFromStream(aStream, aStyle, aFileVersion);
            HC.HCLoadTextFromStream(aStream, ref FFormat, aFileVersion);
            double vDT = 0;

            byte[] vBuffer = BitConverter.GetBytes(vDT);
            aStream.Read(vBuffer, 0, vBuffer.Length);
            vDT       = BitConverter.ToDouble(vBuffer, 0);
            FDateTime = DateTime.FromOADate(vDT);
        }
        public override void LoadFromStream(Stream AStream, HCStyle AStyle, ushort aFileVersion)
        {
            base.LoadFromStream(AStream, AStyle, aFileVersion);
            FItems.Clear();
            string vText = "";

            HC.HCLoadTextFromStream(AStream, ref vText, aFileVersion);
            string[] vStrings = vText.Split(new string[] { HC.sLineBreak }, StringSplitOptions.None);
            for (int i = 0; i < vStrings.Length; i++)
            {
                FItems.Add(vStrings[i]);
            }
        }
        public override void LoadFromStream(Stream aStream, HCStyle aStyle, ushort aFileVersion)
        {
            base.LoadFromStream(aStream, aStyle, aFileVersion);
            HC.HCLoadTextFromStream(aStream, ref FText, aFileVersion);
            if (aFileVersion > 34)
            {
                byte[] vBuffer = BitConverter.GetBytes(FAutoSize);
                aStream.Read(vBuffer, 0, vBuffer.Length);
                FAutoSize = BitConverter.ToBoolean(vBuffer, 0);

                vBuffer = BitConverter.GetBytes(FShowText);
                aStream.Read(vBuffer, 0, vBuffer.Length);
                FShowText = BitConverter.ToBoolean(vBuffer, 0);

                FPenWidth = (Byte)aStream.ReadByte();
            }
        }
Exemple #12
0
        public override void LoadFromStream(System.IO.Stream aStream, HCStyle aStyle, ushort aFileVersion)
        {
            base.LoadFromStream(aStream, aStyle, aFileVersion);
            HC.HCLoadTextFromStream(aStream, ref FFormat, aFileVersion);
            if (FFormat.Substring(0, 3) == "{0:")  // 兼容旧的
            {
                int vLength = FFormat.IndexOf('}');
                FFormat = Format.Substring(3, vLength - 3).Replace("SS", "ss");
            }

            double vDT = 0;

            byte[] vBuffer = BitConverter.GetBytes(vDT);
            aStream.Read(vBuffer, 0, vBuffer.Length);
            vDT       = BitConverter.ToDouble(vBuffer, 0);
            FDateTime = DateTime.FromOADate(vDT);
        }
Exemple #13
0
        public override void LoadFromStream(Stream aStream, HCStyle aStyle, ushort aFileVersion)
        {
            base.LoadFromStream(aStream, aStyle, aFileVersion);

            if (aFileVersion > 51)
            {
                byte vByte = (byte)aStream.ReadByte();
                FChecked  = HC.IsOdd(vByte >> 7);
                FBoxRight = HC.IsOdd(vByte >> 6);
            }
            else
            {
                byte[] vBuffer = BitConverter.GetBytes(FChecked);
                aStream.Read(vBuffer, 0, vBuffer.Length);
                FChecked = BitConverter.ToBoolean(vBuffer, 0);
            }
            HC.HCLoadTextFromStream(aStream, ref FText, aFileVersion);
        }
Exemple #14
0
        public override void LoadFromStream(Stream aStream, HCStyle aStyle, ushort aFileVersion)
        {
            base.LoadFromStream(aStream, aStyle, aFileVersion);

            uint vDSize = 0;

            if (aFileVersion < 11)
            {
                byte[] vBuffer = new byte[2];
                aStream.Read(vBuffer, 0, 2);
                vDSize = System.BitConverter.ToUInt32(vBuffer, 0);
            }
            else
            {
                byte[] vBuffer = BitConverter.GetBytes(vDSize);
                aStream.Read(vBuffer, 0, vBuffer.Length);
                vDSize = System.BitConverter.ToUInt32(vBuffer, 0);
            }

            if (vDSize > 0)
            {
                byte[] vBuffer = new byte[vDSize];
                aStream.Read(vBuffer, 0, vBuffer.Length);
                if (aFileVersion > 24)
                {
                    FText = System.Text.Encoding.Unicode.GetString(vBuffer);
                }
                else
                {
                    FText = System.Text.Encoding.Default.GetString(vBuffer);
                }
            }

            if (aFileVersion > 34)
            {
                HC.HCLoadTextFromStream(aStream, ref FHyperLink, aFileVersion);
            }
            else
            {
                FHyperLink = "";
            }
        }
        public override void LoadFromStream(Stream aStream, HCStyle aStyle, ushort aFileVersion)
        {
            base.LoadFromStream(aStream, aStyle, aFileVersion);
            string vText = "";

            HC.HCLoadTextFromStream(aStream, ref vText, aFileVersion);
            FCode128.Text = vText;
            if (aFileVersion > 34)
            {
                byte[] vBuffer = BitConverter.GetBytes(FAutoSize);
                aStream.Read(vBuffer, 0, vBuffer.Length);
                FAutoSize = BitConverter.ToBoolean(vBuffer, 0);

                vBuffer = BitConverter.GetBytes(FCode128.TextVisible);
                aStream.Read(vBuffer, 0, vBuffer.Length);
                FCode128.TextVisible = BitConverter.ToBoolean(vBuffer, 0);

                FCode128.Zoom = (Byte)aStream.ReadByte();
            }
        }
Exemple #16
0
        public void LoadFromStream(Stream aStream, ushort aFileVersion)
        {
            byte[] vBuffer = BitConverter.GetBytes(FID);
            aStream.Read(vBuffer, 0, vBuffer.Length);
            FID = BitConverter.ToInt32(vBuffer, 0);

            aStream.Read(vBuffer, 0, vBuffer.Length);
            FID = BitConverter.ToInt32(vBuffer, 0);

            aStream.Read(vBuffer, 0, vBuffer.Length);
            FID = BitConverter.ToInt32(vBuffer, 0);

            aStream.Read(vBuffer, 0, vBuffer.Length);
            FID = BitConverter.ToInt32(vBuffer, 0);

            aStream.Read(vBuffer, 0, vBuffer.Length);
            FID = BitConverter.ToInt32(vBuffer, 0);

            HC.HCLoadTextFromStream(aStream, ref FTitle, aFileVersion);
            HC.HCLoadTextFromStream(aStream, ref FText, aFileVersion);
        }
        public void LoadFromStream(Stream aStream, ushort aFileVersion)
        {
            byte[] vBuffer = BitConverter.GetBytes(this.StartItemNo);
            aStream.Read(vBuffer, 0, vBuffer.Length);
            this.StartItemNo = BitConverter.ToInt32(vBuffer, 0);

            aStream.Read(vBuffer, 0, vBuffer.Length);
            this.StartItemOffset = BitConverter.ToInt32(vBuffer, 0);

            aStream.Read(vBuffer, 0, vBuffer.Length);
            this.EndItemNo = BitConverter.ToInt32(vBuffer, 0);

            aStream.Read(vBuffer, 0, vBuffer.Length);
            this.EndItemOffset = BitConverter.ToInt32(vBuffer, 0);

            aStream.Read(vBuffer, 0, vBuffer.Length);
            FID = BitConverter.ToInt32(vBuffer, 0);

            HC.HCLoadTextFromStream(aStream, ref FTitle, aFileVersion);
            HC.HCLoadTextFromStream(aStream, ref FText, aFileVersion);
        }
 public override void LoadFromStream(Stream AStream, HCStyle AStyle, ushort AFileVersion)
 {
     base.LoadFromStream(AStream, AStyle, AFileVersion);
     HC.HCLoadTextFromStream(AStream, ref FTopText);
     HC.HCLoadTextFromStream(AStream, ref FBottomText);
 }
Exemple #19
0
 public void LoadFromStream(Stream stream, ushort fileVersion)
 {
     HC.HCLoadTextFromStream(stream, ref Title, fileVersion);
     HC.HCLoadTextFromStream(stream, ref Text, fileVersion);
 }
Exemple #20
0
 public override void LoadFromStream(Stream aStream, HCStyle aStyle, ushort aFileVersion)
 {
     base.LoadFromStream(aStream, aStyle, aFileVersion);
     HC.HCLoadTextFromStream(aStream, ref FText, aFileVersion);
 }