示例#1
0
        private void DoIndex(IndexerType it, WmInt w1, WmShort w2)
        {
            IWMIndexer pIndex;

            WMUtils.WMCreateIndexer(out pIndex);
            IWMIndexer2 pIndex2 = pIndex as IWMIndexer2;

            pIndex2.Configure(0, it, w1, w2);

            m_IndexComplete = false;
            m_MaxIndex      = 0;
            m_IndexError    = 0;
            pIndex2.StartIndexing(sFileName, this, IntPtr.Zero);
            while (!m_IndexComplete)
            {
                System.Threading.Thread.Sleep(0);
            }
            if (m_IndexError != 0)
            {
                throw new COMException("Indexing error", m_IndexError);
            }
        }
示例#2
0
        private void TestIndices()
        {
            short w1;

            m_head.GetAttributeCountEx(0, out w1);

            short pIndex1, pIndex2;

            byte[] wm = BitConverter.GetBytes(4292);

            m_head.AddAttribute(0, "tester", out pIndex1, AttrDataType.DWORD, 0, wm, 4);
            m_head.AddAttribute(0, "tester", out pIndex2, AttrDataType.DWORD, 0, wm, 4);

            short   pCount = 0;
            WmShort ws     = new WmShort();

            m_head.GetAttributeIndices(0, "tester", ws, null, ref pCount);
            short [] sa = new short[pCount];
            m_head.GetAttributeIndices(0, "tester", ws, sa, ref pCount);

            Debug.Assert(sa[0] == pIndex1 && sa[1] == pIndex2);
        }