コード例 #1
0
        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();
            }
        }
コード例 #2
0
        public override void LoadFromStream(Stream aStream, HCStyle aStyle, ushort aFileVersion)
        {
            base.LoadFromStream(aStream, aStyle, aFileVersion);
            FItems.Clear();

            string vS = "";

            byte[] vBuffer;
            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();
            }
        }
コード例 #3
0
        public override void ParseXml(XmlElement aNode)
        {
            base.ParseXml(aNode);
            FItems.Clear();
            string vText = aNode.Attributes["item"].Value;

            string[] vStrings = vText.Split(new string[] { HC.sLineBreak }, StringSplitOptions.None);
            for (int i = 0; i < vStrings.Length; i++)
            {
                AddItem(vStrings[i]);
            }

            if (aNode.HasAttribute("itemvalue"))
            {
                vText    = aNode.Attributes["itemvalue"].Value;
                vStrings = vText.Split(new string[] { HC.sLineBreak }, StringSplitOptions.None);
                for (int i = 0; i < vStrings.Length; i++)
                {
                    FItems[i].TextValue = vStrings[i];
                }
            }

            vText    = aNode.Attributes["check"].Value;
            vStrings = vText.Split(new string[] { HC.sLineBreak }, StringSplitOptions.None);

            for (int i = 0; i < vStrings.Length; i++)
            {
                if (vStrings[i] == "1")
                {
                    FItems[i].Checked = true;
                }
                else
                {
                    FItems[i].Checked = false;
                }
            }

            FRadioStyle = (HCRadioStyle)(byte.Parse(aNode.Attributes["radiostyle"].Value));
        }
コード例 #4
0
ファイル: HCRadioGroup.cs プロジェクト: ols3er/HCView-CSharp
        public override void ParseXml(XmlElement aNode)
        {
            base.ParseXml(aNode);
            BeginAdd();
            try
            {
                if (aNode.HasAttribute("col"))
                {
                    FColumns = byte.Parse(aNode.GetAttribute("col"));
                }

                if (aNode.HasAttribute("multsel"))
                {
                    FMultSelect = bool.Parse(aNode.GetAttribute("multsel"));
                }

                if (aNode.HasAttribute("itemhit"))
                {
                    FItemHit = bool.Parse(aNode.GetAttribute("itemhit"));
                }

                if (aNode.HasAttribute("colalign"))
                {
                    FColumnAlign = bool.Parse(aNode.GetAttribute("colalign"));
                }

                FItems.Clear();
                string   vText    = aNode.Attributes["item"].Value;
                string[] vStrings = vText.Split(new string[] { HC.sLineBreak }, StringSplitOptions.None);
                for (int i = 0; i < vStrings.Length; i++)
                {
                    AddItem(vStrings[i]);
                }

                if (aNode.HasAttribute("itemvalue"))
                {
                    vText    = aNode.Attributes["itemvalue"].Value;
                    vStrings = vText.Split(new string[] { HC.sLineBreak }, StringSplitOptions.None);
                    for (int i = 0; i < vStrings.Length; i++)
                    {
                        FItems[i].TextValue = vStrings[i];
                    }
                }

                vText    = aNode.Attributes["check"].Value;
                vStrings = vText.Split(new string[] { HC.sLineBreak }, StringSplitOptions.None);

                for (int i = 0; i < vStrings.Length; i++)
                {
                    if (vStrings[i] == "1")
                    {
                        FItems[i].Checked = true;
                    }
                    else
                    {
                        FItems[i].Checked = false;
                    }
                }

                FRadioStyle = (HCRadioStyle)(byte.Parse(aNode.Attributes["radiostyle"].Value));
            }
            finally
            {
                EndAdd();
            }
        }