Esempio n. 1
0
        public License[] EnumerateLicenses()
        {
            IntPtr pArray;
            uint   size;
            UInt32 status = OpenNIImporter.xnEnumerateLicenses(this.InternalObject, out pArray, out size);

            WrapperUtils.CheckStatus(status);

            License[] result = null;

            try
            {
                result = new License[size];
                IntPtr ptr = pArray;

                for (int i = 0; i < size; ++i)
                {
                    result[i] = (License)Marshal.PtrToStructure(ptr, typeof(License));
                    ptr       = (IntPtr)(ptr.ToInt64() + Marshal.SizeOf(typeof(License)));
                }
            }
            finally
            {
                OpenNIImporter.xnFreeLicensesList(pArray);
            }

            return(result);
        }