BExplorer.Shell.Interop.PropVariantNativeMethods.PropVariantGetElementCount C# (CSharp) Method

PropVariantGetElementCount() private method

private PropVariantGetElementCount ( [ propVar ) : int
propVar [
return int
		internal static extern int PropVariantGetElementCount([In] PropVariant propVar);

Usage Example

Example #1
0
        private Array GetVector <T>()
        {
            int count = PropVariantNativeMethods.PropVariantGetElementCount(this);

            if (count <= 0)
            {
                return(null);
            }

            lock (_padlock)
            {
                if (_vectorActions == null)
                {
                    _vectorActions = GenerateVectorActions();
                }
            }

            Action <PropVariant, Array, uint> action;

            if (!_vectorActions.TryGetValue(typeof(T), out action))
            {
                throw new InvalidCastException("");
            }

            Array array = new T[count];

            for (uint i = 0; i < count; i++)
            {
                action(this, array, i);
            }

            return(array);
        }