GetIntFromCharArray() static private method

static private GetIntFromCharArray ( char buffer, int position ) : int
buffer char
position int
return int
Ejemplo n.º 1
0
        /// <internalonly/>
        int IBuiltInEvidence.InitFromBuffer(char[] buffer, int position)
        {
            int length = BuiltInEvidenceHelper.GetIntFromCharArray(buffer, position);

            position                 += 2;
            m_publicKeyBlob           = new StrongNamePublicKeyBlob();
            m_publicKeyBlob.PublicKey = new byte[length];

            int lengthInChars = ((length - 1) / 2) + 1;

            Buffer.InternalBlockCopy(buffer, position * 2, m_publicKeyBlob.PublicKey, 0, length);
            position += lengthInChars;

            int major    = BuiltInEvidenceHelper.GetIntFromCharArray(buffer, position);
            int minor    = BuiltInEvidenceHelper.GetIntFromCharArray(buffer, position + 2);
            int build    = BuiltInEvidenceHelper.GetIntFromCharArray(buffer, position + 4);
            int revision = BuiltInEvidenceHelper.GetIntFromCharArray(buffer, position + 6);

            m_version = new Version(major, minor, build, revision);
            position += 8;

            length    = BuiltInEvidenceHelper.GetIntFromCharArray(buffer, position);
            position += 2;

            m_name = new String(buffer, position, length);

            return(position + length);
        }
Ejemplo n.º 2
0
        /// <include file='doc\ApplicationDirectory.uex' path='docs/doc[@for="ApplicationDirectory.char1"]/*' />
        /// <internalonly/>
        int IBuiltInEvidence.InitFromBuffer(char[] buffer, int position)
        {
            int length = BuiltInEvidenceHelper.GetIntFromCharArray(buffer, position);

            position += 2;

            m_appDirectory = new URLString(new String(buffer, position, length));

            return(position + length);
        }
Ejemplo n.º 3
0
        /// <include file='doc\Hash.uex' path='docs/doc[@for="Hash.char1"]/*' />
        /// <internalonly/>
        int IBuiltInEvidence.InitFromBuffer(char[] buffer, int position)
        {
            int length = BuiltInEvidenceHelper.GetIntFromCharArray(buffer, position);

            position += 2;
            m_rawData = new byte[length];

            int lengthInChars = ((length - 1) / 2) + 1;

            Buffer.InternalBlockCopy(buffer, position * 2, m_rawData, 0, length);

            return(position + lengthInChars);
        }
Ejemplo n.º 4
0
        /// <include file='doc\PermissionRequestEvidence.uex' path='docs/doc[@for="PermissionRequestEvidence.char1"]/*' />
        /// <internalonly/>
        int IBuiltInEvidence.InitFromBuffer(char[] buffer, int position)
        {
            int numPermSets = BuiltInEvidenceHelper.GetIntFromCharArray(buffer, position);

            position += 2;

            int tempLength;

            for (int i = 0; i < numPermSets; i++)
            {
                char psKind = buffer[position++];

                tempLength = BuiltInEvidenceHelper.GetIntFromCharArray(buffer, position);
                position  += 2;

                String tempStr = new String(buffer, position, tempLength);
                position += tempLength;
                Parser p = new Parser(tempStr);

                PermissionSet psTemp = new PermissionSet();
                psTemp.FromXml(p.GetTopElement());

                switch (psKind)
                {
                case idRequest:
                    m_strRequest = tempStr;
                    m_request    = psTemp;
                    break;

                case idOptional:
                    m_strOptional = tempStr;
                    m_optional    = psTemp;
                    break;

                case idDenied:
                    m_strDenied = tempStr;
                    m_denied    = psTemp;
                    break;

                default:
                    throw new SerializationException(Environment.GetResourceString("Serialization_UnableToFixup"));
                }
            }

            return(position);
        }
Ejemplo n.º 5
0
 /// <include file='doc\Zone.uex' path='docs/doc[@for="Zone.char1"]/*' />
 /// <internalonly/>
 int IBuiltInEvidence.InitFromBuffer(char[] buffer, int position)
 {
     m_zone = (SecurityZone)BuiltInEvidenceHelper.GetIntFromCharArray(buffer, position);
     return(position + 2);
 }