示例#1
0
        private StringBuilder ComputeOwnContent()
        {
            var m_ChunkCharsPointer = Obj.GetRefFld("m_ChunkChars");

            if (m_ChunkCharsPointer.IsNullObj || (m_ChunkCharsPointer.Type == null) || (!m_ChunkCharsPointer.Type.IsArray))
            {
                return(new StringBuilder());
            }

            m_ChunkLength = Obj.GetInt32Fld(nameof(m_ChunkLength));

            var ar = ClrCollectionHelper.EnumerateArrayOfSimpleTypes <char>(m_ChunkCharsPointer, m_ChunkLength);

            var sb = new StringBuilder(ar.Count);

            for (var i = 0; (i < m_ChunkLength) && (i < ar.Count); i++)
            {
                var letter = ar[i];
                sb.Append(letter);
            }

            return(sb);
        }