/// <summary> /// Init /// </summary> /// <param name="cAttributes">length of aAttributes</param> /// <param name="aAttributes">array of FULLPROPSPEC structs</param> /// <returns>managed array</returns> internal static ManagedFullPropSpec[] MarshalFullPropSpecArray( uint cAttributes, // length of aAttributes FULLPROPSPEC[] aAttributes) { // If there are attributes, these override the flags if (cAttributes > 0) { // Attributes count and array should match. // This has already been checked for by XpsFilter. Invariant.Assert(aAttributes != null); ManagedFullPropSpec[] initAttributes = new ManagedFullPropSpec[checked((int)cAttributes)]; // convert to managed equivalents to isolate the marshaling effort for (int i = 0; i < cAttributes; i++) { // convert and add to local list initAttributes[i] = new ManagedFullPropSpec(aAttributes[i]); } return initAttributes; } else return null; }
/// <summary> /// IFilter.Init /// </summary> /// <param name="grfFlags">usage flags</param> /// <param name="cAttributes">number of elements in aAttributes</param> /// <param name="aAttributes">array of Managed FULLPROPSPEC structs to restrict responses</param> /// <returns>flags</returns> /// <remarks> /// Returns systematically IFILTER_FLAGS_NONE insofar as flags are used to control property search, /// which is not supported (See GetValue). /// </remarks> public IFILTER_FLAGS Init(IFILTER_INIT grfFlags, // IFILTER_INIT value uint cAttributes, // length of aAttributes FULLPROPSPEC[] aAttributes) // restrict responses to the specified attributes { _grfFlags = grfFlags; _cAttributes = cAttributes; _aAttributes = aAttributes; _partIterator.Reset(); _progress = Progress.FilteringNotStarted; return IFILTER_FLAGS.IFILTER_FLAGS_NONE; }
internal static void MarshalFullPropSpec(ManagedFullPropSpec fullPropSpec, ref FULLPROPSPEC native) { native.guid = fullPropSpec.Guid; MarshalPropSpec(fullPropSpec.Property, ref native.property); }
/// <summary> /// Init /// </summary> /// <param name="grfFlags">usage flags</param> /// <param name="cAttributes">length of aAttributes</param> /// <param name="aAttributes">array of FULLPROPSPEC structs</param> /// <returns>flags</returns> public IFILTER_FLAGS Init(IFILTER_INIT grfFlags, // IFILTER_INIT value uint cAttributes, // length of aAttributes FULLPROPSPEC[] aAttributes) // restrict responses to the specified attributes { ManagedFullPropSpec[] managedArray = MarshalFullPropSpecArray( cAttributes, aAttributes); return _implementation.Init(grfFlags, managedArray); }
/// <summary> /// Handles native FULLPROPSPEC and does marshaling /// </summary> /// <param name="nativePropSpec"></param> internal ManagedFullPropSpec(FULLPROPSPEC nativePropSpec) { _guid = nativePropSpec.guid; _property = new ManagedPropSpec(nativePropSpec.property); }