System.Security.Policy.BuiltInEvidenceHelper.CopyIntToCharArray C# (CSharp) Method

CopyIntToCharArray() static private method

static private CopyIntToCharArray ( int value, char buffer, int position ) : void
value int
buffer char
position int
return void
        internal static void CopyIntToCharArray( int value, char[] buffer, int position )
        {
            buffer[position    ] = (char)((value >> 16) & 0x0000FFFF);
            buffer[position + 1] = (char)((value      ) & 0x0000FFFF);
        }

Usage Example

Beispiel #1
0
        /// <internalonly/>
        int IBuiltInEvidence.OutputToBuffer(char[] buffer, int position, bool verbose)
        {
            // StrongNames have a byte[], a string, and a Version (4 ints).
            // Copy in the id, the byte[], the four ints, and then the string.

            buffer[position++] = BuiltInEvidenceHelper.idStrongName;
            int lengthPK = m_publicKeyBlob.PublicKey.Length;

            if (verbose)
            {
                BuiltInEvidenceHelper.CopyIntToCharArray(lengthPK, buffer, position);
                position += 2;
            }
            Buffer.InternalBlockCopy(m_publicKeyBlob.PublicKey, 0, buffer, position * 2, lengthPK);
            position += ((lengthPK - 1) / 2) + 1;

            BuiltInEvidenceHelper.CopyIntToCharArray(m_version.Major, buffer, position);
            BuiltInEvidenceHelper.CopyIntToCharArray(m_version.Minor, buffer, position + 2);
            BuiltInEvidenceHelper.CopyIntToCharArray(m_version.Build, buffer, position + 4);
            BuiltInEvidenceHelper.CopyIntToCharArray(m_version.Revision, buffer, position + 6);

            position += 8;
            int lengthName = m_name.Length;

            if (verbose)
            {
                BuiltInEvidenceHelper.CopyIntToCharArray(lengthName, buffer, position);
                position += 2;
            }
            m_name.CopyTo(0, buffer, position, lengthName);

            return(lengthName + position);
        }
All Usage Examples Of System.Security.Policy.BuiltInEvidenceHelper::CopyIntToCharArray