示例#1
0
 public void SetBytes(IList <byte> bytes, bool isText = false)
 {
     Bytes = new List <byte>(bytes);
     if (isText)
     {
         Text = TextUtility.Decode(bytes);
     }
 }
示例#2
0
        public void SetText(string text, bool encode = true)
        {
            Text = text;

            if (encode)
            {
                Bytes = TextUtility.Encode(text);
            }
        }
示例#3
0
        public void DecodeText(bool forceDecode = false)
        {
            if ((!IsTextDecoded) || (forceDecode))
            {
                if (CustomEntryList.Count > 0)
                {
                    IList <byte>          textBytes     = CustomEntryList[0].Bytes;
                    IList <IList <byte> > textByteLists = textBytes.Split((byte)0xFE);
                    NumTextEntries = (NumTextEntries == -1) ? textByteLists.Count : NumTextEntries;

                    CustomEntryList.Clear();
                    for (int index = 0; index < NumTextEntries; index++)
                    {
                        CustomEntryList.Add(new CustomEntry(index, textByteLists[index], TextUtility.Decode(textByteLists[index])));
                    }
                }

                IsTextDecoded = true;
            }
        }