Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / MS / Internal / IO / Packaging / EncryptedPackageFilter.cs / 1305600 / EncryptedPackageFilter.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // Description: // Implements indexing filter for EncryptedPackageEnvelope. // Invoked by XpsFilter if the file/stream being filtered // is an EncryptedPackageEnvelope. // // History: // 07/18/2005: ArindamB: Initial implementation //--------------------------------------------------------------------------- using System; using System.Windows; using System.Runtime.InteropServices; using System.IO.Packaging; using MS.Internal.Interop; namespace MS.Internal.IO.Packaging { #region EncryptedPackageFilter ////// Implements IFilter methods to support indexing on EncryptedPackageEnvelope. /// internal class EncryptedPackageFilter : IFilter { #region Constructor ////// Constructor. /// /// EncryptedPackageEnvelope to filter on internal EncryptedPackageFilter(EncryptedPackageEnvelope encryptedPackage) { if (encryptedPackage == null) { throw new ArgumentNullException("encryptedPackage"); } // // Since CorePropertiesFilter is implemented as // a managed filter (supports IManagedFilter interface), // IndexingFilterMarshaler is used to get IFilter interface out of it. // _filter = new IndexingFilterMarshaler( new CorePropertiesFilter( encryptedPackage.PackageProperties )); } #endregion Constructor #region IFilter methods ////// Initialzes the session for this filter. /// /// usage flags /// number of elements in aAttributes array /// array of FULLPROPSPEC structs to restrict responses ///IFILTER_FLAGS_NONE. Return value is effectively ignored by the caller. public IFILTER_FLAGS Init( [In] IFILTER_INIT grfFlags, [In] uint cAttributes, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] FULLPROPSPEC[] aAttributes) { return _filter.Init(grfFlags, cAttributes, aAttributes); } ////// Returns description of the next chunk. /// ///Chunk descriptor public STAT_CHUNK GetChunk() { return _filter.GetChunk(); } ////// Gets text content corresponding to current chunk. /// /// /// ///Not supported in indexing of core properties. public void GetText(ref uint bufCharacterCount, IntPtr pBuffer) { throw new COMException(SR.Get(SRID.FilterGetTextNotSupported), (int)FilterErrorCode.FILTER_E_NO_TEXT); } ////// Gets the property value corresponding to current chunk. /// ///property value public IntPtr GetValue() { return _filter.GetValue(); } ////// Retrieves an interface representing the specified portion of the object. /// /// /// ///Not implemented. Reserved for future use. public IntPtr BindRegion([In] FILTERREGION origPos, [In] ref Guid riid) { throw new NotImplementedException(SR.Get(SRID.FilterBindRegionNotImplemented)); } #endregion IFilter methods #region Fields ////// Only filtering that is supported on EncryptedPackageEnvelope /// is of core properties. This points to EncryptedPackageCorePropertiesFilter /// wrapped by FilterMarshaler. /// private IFilter _filter = null; #endregion Fields } #endregion EncryptedPackageFilter } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // Description: // Implements indexing filter for EncryptedPackageEnvelope. // Invoked by XpsFilter if the file/stream being filtered // is an EncryptedPackageEnvelope. // // History: // 07/18/2005: ArindamB: Initial implementation //--------------------------------------------------------------------------- using System; using System.Windows; using System.Runtime.InteropServices; using System.IO.Packaging; using MS.Internal.Interop; namespace MS.Internal.IO.Packaging { #region EncryptedPackageFilter ////// Implements IFilter methods to support indexing on EncryptedPackageEnvelope. /// internal class EncryptedPackageFilter : IFilter { #region Constructor ////// Constructor. /// /// EncryptedPackageEnvelope to filter on internal EncryptedPackageFilter(EncryptedPackageEnvelope encryptedPackage) { if (encryptedPackage == null) { throw new ArgumentNullException("encryptedPackage"); } // // Since CorePropertiesFilter is implemented as // a managed filter (supports IManagedFilter interface), // IndexingFilterMarshaler is used to get IFilter interface out of it. // _filter = new IndexingFilterMarshaler( new CorePropertiesFilter( encryptedPackage.PackageProperties )); } #endregion Constructor #region IFilter methods ////// Initialzes the session for this filter. /// /// usage flags /// number of elements in aAttributes array /// array of FULLPROPSPEC structs to restrict responses ///IFILTER_FLAGS_NONE. Return value is effectively ignored by the caller. public IFILTER_FLAGS Init( [In] IFILTER_INIT grfFlags, [In] uint cAttributes, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] FULLPROPSPEC[] aAttributes) { return _filter.Init(grfFlags, cAttributes, aAttributes); } ////// Returns description of the next chunk. /// ///Chunk descriptor public STAT_CHUNK GetChunk() { return _filter.GetChunk(); } ////// Gets text content corresponding to current chunk. /// /// /// ///Not supported in indexing of core properties. public void GetText(ref uint bufCharacterCount, IntPtr pBuffer) { throw new COMException(SR.Get(SRID.FilterGetTextNotSupported), (int)FilterErrorCode.FILTER_E_NO_TEXT); } ////// Gets the property value corresponding to current chunk. /// ///property value public IntPtr GetValue() { return _filter.GetValue(); } ////// Retrieves an interface representing the specified portion of the object. /// /// /// ///Not implemented. Reserved for future use. public IntPtr BindRegion([In] FILTERREGION origPos, [In] ref Guid riid) { throw new NotImplementedException(SR.Get(SRID.FilterBindRegionNotImplemented)); } #endregion IFilter methods #region Fields ////// Only filtering that is supported on EncryptedPackageEnvelope /// is of core properties. This points to EncryptedPackageCorePropertiesFilter /// wrapped by FilterMarshaler. /// private IFilter _filter = null; #endregion Fields } #endregion EncryptedPackageFilter } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- FormViewPagerRow.cs
- ResourceAttributes.cs
- SchemaNames.cs
- TileBrush.cs
- BrowserDefinitionCollection.cs
- KnownBoxes.cs
- Geometry.cs
- SqlDataReader.cs
- safesecurityhelperavalon.cs
- Parallel.cs
- ShutDownListener.cs
- SerializableAttribute.cs
- AlignmentXValidation.cs
- LambdaCompiler.Expressions.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- DispatcherOperation.cs
- Cursor.cs
- CombinedGeometry.cs
- DelegatingConfigHost.cs
- AudioStateChangedEventArgs.cs
- IndexOutOfRangeException.cs
- RoleServiceManager.cs
- CodeRegionDirective.cs
- EdmError.cs
- KeyValuePair.cs
- ToolBarPanel.cs
- SvcMapFileSerializer.cs
- DecimalAnimationUsingKeyFrames.cs
- StructuralComparisons.cs
- LongValidator.cs
- UnsafePeerToPeerMethods.cs
- ComAdminInterfaces.cs
- SourceItem.cs
- ThemeInfoAttribute.cs
- AttachedAnnotationChangedEventArgs.cs
- UriScheme.cs
- CodeBinaryOperatorExpression.cs
- Button.cs
- ReadOnlyActivityGlyph.cs
- CompilerCollection.cs
- UpdateManifestForBrowserApplication.cs
- EntityViewContainer.cs
- CodeIndexerExpression.cs
- ApplicationContext.cs
- RowUpdatedEventArgs.cs
- HighlightComponent.cs
- RuntimeConfigLKG.cs
- CodeAttachEventStatement.cs
- DependencyPropertyChangedEventArgs.cs
- XmlName.cs
- Win32KeyboardDevice.cs
- TemplateEditingService.cs
- TypeBuilder.cs
- EntityContainer.cs
- ConnectionManagementElementCollection.cs
- ExpressionLexer.cs
- ReadWriteSpinLock.cs
- TraceLevelStore.cs
- GlyphsSerializer.cs
- AttributeCollection.cs
- LogRecordSequence.cs
- ScriptResourceAttribute.cs
- Drawing.cs
- ChangePassword.cs
- ProviderConnectionPoint.cs
- TextUtf8RawTextWriter.cs
- EncoderExceptionFallback.cs
- EventDescriptorCollection.cs
- ErasingStroke.cs
- SchemaAttDef.cs
- Vector.cs
- CheckBoxFlatAdapter.cs
- Keywords.cs
- WriteStateInfoBase.cs
- AttributeQuery.cs
- Preprocessor.cs
- dataprotectionpermissionattribute.cs
- ChameleonKey.cs
- WorkflowWebService.cs
- CodeDirectiveCollection.cs
- SessionPageStatePersister.cs
- ThreadStartException.cs
- LogLogRecord.cs
- FragmentQueryProcessor.cs
- StateInitializationDesigner.cs
- HtmlCalendarAdapter.cs
- RelatedCurrencyManager.cs
- CqlErrorHelper.cs
- ContractMethodParameterInfo.cs
- CodeDOMUtility.cs
- Parameter.cs
- DrawingBrush.cs
- TemplateBindingExpression.cs
- GZipDecoder.cs
- XPathBuilder.cs
- XamlParser.cs
- IndexedString.cs
- HandlerBase.cs
- ToolTip.cs
- StorageEntityContainerMapping.cs