Exemple #1
0
        private void SetTextData(string frameName, string data)
        {
            Frame cur = _frames.FirstOrDefault(f => string.Compare(f.Header.Title, frameName, StringComparison.OrdinalIgnoreCase) == 0);

            if (cur == null)
            {
                FrameHeader newHeader = new FrameHeader(frameName, 0, new byte[2]);
                Frame       toAdd     = new Frame(newHeader, new byte[] { 1, 255, 255 });
                _frames.Add(toAdd);

                cur = toAdd;
            }

            byte[] encoded = EncodeHelper.DecodeString(data, cur.Data.Take(3).ToArray());

            cur.Header.Size = encoded.Length;
            cur.Data        = encoded;
        }
Exemple #2
0
        private string GetTextData(string name)
        {
            Frame cur = _frames.FirstOrDefault(f => string.Compare(f.Header.Title, name, StringComparison.OrdinalIgnoreCase) == 0);

            return(cur == null ? string.Empty : EncodeHelper.EncodeByteArray(cur.Data));
        }