コード例 #1
0
        /// <summary>
        /// In constructor, initialize the native PACTYPE structure.
        /// </summary>
        private void InitializeNativePacType()
        {
            NativePacType          = new PACTYPE();
            NativePacType.Version  = PACTYPE_Version_Values.V1;
            NativePacType.cBuffers = (uint)pacInfoBuffers.Length;
            NativePacType.Buffers  = new PAC_INFO_BUFFER[pacInfoBuffers.Length];

            for (int i = 0; i < pacInfoBuffers.Length; i++)
            {
                NativePacType.Buffers[i] = pacInfoBuffers[i].CreateNativeInfoBuffer();
            }
        }
コード例 #2
0
        /// <summary>
        /// Construct an instance of current class by decoding specified bytes.
        /// </summary>
        /// <param name="buffer">The specified bytes.</param>
        internal PacType(byte[] buffer)
        {
            NativePacType = PacUtility.MemoryToObject<PACTYPE>(buffer);
            pacInfoBuffers = new PacInfoBuffer[NativePacType.Buffers.Length];

            for (int i = 0; i < NativePacType.Buffers.Length; ++i)
            {
                if (NativePacType.Buffers[i].cbBufferSize > 0)
                {
                    PacInfoBuffers[i] = PacInfoBuffer.DecodeBuffer(
                        NativePacType.Buffers[i],
                        buffer);
                }
                else PacInfoBuffers[i] = null;
            }
        }
コード例 #3
0
        /// <summary>
        /// Construct an instance of current class by decoding specified bytes.
        /// </summary>
        /// <param name="buffer">The specified bytes.</param>
        internal PacType(byte[] buffer)
        {
            NativePacType  = PacUtility.MemoryToObject <PACTYPE>(buffer);
            pacInfoBuffers = new PacInfoBuffer[NativePacType.Buffers.Length];

            for (int i = 0; i < NativePacType.Buffers.Length; ++i)
            {
                if (NativePacType.Buffers[i].cbBufferSize > 0)
                {
                    PacInfoBuffers[i] = PacInfoBuffer.DecodeBuffer(
                        NativePacType.Buffers[i],
                        buffer);
                }
                else
                {
                    PacInfoBuffers[i] = null;
                }
            }
        }
コード例 #4
0
        /// <summary>
        /// In constructor, initialize the native PACTYPE structure.
        /// </summary>
        private void InitializeNativePacType()
        {
            NativePacType = new PACTYPE();
            NativePacType.Version = PACTYPE_Version_Values.V1;
            NativePacType.cBuffers = (uint)pacInfoBuffers.Length;
            NativePacType.Buffers = new PAC_INFO_BUFFER[pacInfoBuffers.Length];

            for (int i = 0; i < pacInfoBuffers.Length; i++)
            {
                NativePacType.Buffers[i] = pacInfoBuffers[i].CreateNativeInfoBuffer();
            }
        }