Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Framework / MS / Internal / IO / Packaging / EncryptedPackageFilter.cs / 1 / 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
- TypeDescriptor.cs
- ObjectDataSourceMethodEventArgs.cs
- RenderContext.cs
- FaultDesigner.cs
- ServiceModelSecurityTokenRequirement.cs
- ExtendedProtectionPolicy.cs
- CreateDataSourceDialog.cs
- RuleEngine.cs
- QueryResults.cs
- ParameterCollection.cs
- ThreadStateException.cs
- FileChangesMonitor.cs
- ObjectStorage.cs
- AddInActivator.cs
- IconBitmapDecoder.cs
- WebPartsPersonalizationAuthorization.cs
- SmtpException.cs
- InputScopeNameConverter.cs
- UnSafeCharBuffer.cs
- Main.cs
- WebPartPersonalization.cs
- ThousandthOfEmRealPoints.cs
- PDBReader.cs
- XslCompiledTransform.cs
- ConfigurationErrorsException.cs
- OdbcParameter.cs
- XmlSchemaChoice.cs
- PersonalizableAttribute.cs
- HttpStreamXmlDictionaryReader.cs
- MimeXmlImporter.cs
- RightsManagementEncryptionTransform.cs
- TransformGroup.cs
- Section.cs
- PropertyMap.cs
- VoiceSynthesis.cs
- RequestCachePolicyConverter.cs
- FloaterBaseParaClient.cs
- ProxyWebPartManager.cs
- ContentValidator.cs
- FunctionOverloadResolver.cs
- DesignerImageAdapter.cs
- ZoneIdentityPermission.cs
- TempFiles.cs
- SafeProcessHandle.cs
- AncillaryOps.cs
- EntityDataSourceDesigner.cs
- TextViewBase.cs
- CellQuery.cs
- ExpressionBuilderCollection.cs
- UnsafeNativeMethods.cs
- HttpProfileGroupBase.cs
- HostingEnvironment.cs
- NamespaceEmitter.cs
- MetabaseSettingsIis7.cs
- PropertyTabAttribute.cs
- HttpCachePolicyElement.cs
- _UncName.cs
- BuilderInfo.cs
- RangeValidator.cs
- StringCollection.cs
- VirtualDirectoryMappingCollection.cs
- HttpHandlerAction.cs
- DesignerHelpers.cs
- _AutoWebProxyScriptWrapper.cs
- NodeInfo.cs
- SQLSingleStorage.cs
- XmlParserContext.cs
- RequestCachePolicy.cs
- JournalEntryListConverter.cs
- EntityDataSourceSelectingEventArgs.cs
- XpsInterleavingPolicy.cs
- OleDbDataAdapter.cs
- ViewPort3D.cs
- WinFormsSecurity.cs
- StateChangeEvent.cs
- LinqExpressionNormalizer.cs
- ListViewItemEventArgs.cs
- ClientSession.cs
- XmlText.cs
- DateTimeOffset.cs
- RegexMatch.cs
- AnimatedTypeHelpers.cs
- Rect3DValueSerializer.cs
- GeometryGroup.cs
- AxHostDesigner.cs
- ResourceSet.cs
- DashStyles.cs
- ScriptRegistrationManager.cs
- InkPresenter.cs
- ScriptServiceAttribute.cs
- Metafile.cs
- EntityAdapter.cs
- TreeWalker.cs
- TemplateEditingVerb.cs
- LinearKeyFrames.cs
- HebrewCalendar.cs
- StreamUpgradeAcceptor.cs
- StateMachine.cs
- SchemaAttDef.cs
- TemplateNameScope.cs