Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- LoaderAllocator.cs
- DataGridViewSelectedCellCollection.cs
- ComponentDispatcher.cs
- ProviderBase.cs
- InputEventArgs.cs
- XmlAtomicValue.cs
- MemberInfoSerializationHolder.cs
- RtType.cs
- TreeNodeClickEventArgs.cs
- DesignerAttribute.cs
- QueryConverter.cs
- UITypeEditor.cs
- thaishape.cs
- DiscreteKeyFrames.cs
- ProxyFragment.cs
- CurrencyWrapper.cs
- DataSourceControl.cs
- backend.cs
- SchemaReference.cs
- BindingBase.cs
- SR.cs
- Inline.cs
- PolicyFactory.cs
- ScrollBar.cs
- XNodeNavigator.cs
- CFGGrammar.cs
- BinHexEncoder.cs
- EntityDataSourceWrapperCollection.cs
- PreProcessInputEventArgs.cs
- MissingMethodException.cs
- ClipboardData.cs
- SoapObjectInfo.cs
- PropertyBuilder.cs
- EnvelopedPkcs7.cs
- PipelineModuleStepContainer.cs
- NegotiationTokenAuthenticatorState.cs
- TypedRowGenerator.cs
- LinqDataSourceView.cs
- PenThreadWorker.cs
- Soap11ServerProtocol.cs
- SharedPerformanceCounter.cs
- CodeMemberEvent.cs
- ProxyManager.cs
- PartitionerQueryOperator.cs
- WindowsTokenRoleProvider.cs
- XamlTypeMapper.cs
- IUnknownConstantAttribute.cs
- ItemList.cs
- WCFBuildProvider.cs
- ImageSource.cs
- LinearKeyFrames.cs
- XamlPointCollectionSerializer.cs
- ConditionalAttribute.cs
- Int64AnimationBase.cs
- Documentation.cs
- ILGenerator.cs
- SystemIPGlobalStatistics.cs
- CompositionAdorner.cs
- ObjectItemCollection.cs
- KeyValuePair.cs
- SqlUtil.cs
- ProgressBarRenderer.cs
- FixedDSBuilder.cs
- UnconditionalPolicy.cs
- StringUtil.cs
- SynchronizationContext.cs
- ValuePatternIdentifiers.cs
- WindowsSysHeader.cs
- ThreadBehavior.cs
- BlurBitmapEffect.cs
- TreeWalker.cs
- WebReferencesBuildProvider.cs
- RequiredFieldValidator.cs
- OutputCacheSettings.cs
- DataObjectPastingEventArgs.cs
- BulletChrome.cs
- TraceContext.cs
- KnownTypesHelper.cs
- MobileControlsSectionHelper.cs
- AutoGeneratedField.cs
- Random.cs
- PopupRoot.cs
- XmlWriterTraceListener.cs
- TranslateTransform.cs
- NoClickablePointException.cs
- StateValidator.cs
- DataGridComboBoxColumn.cs
- DictionaryContent.cs
- EditingCommands.cs
- __ConsoleStream.cs
- HtmlTernaryTree.cs
- WebRequestModuleElementCollection.cs
- XsdBuildProvider.cs
- WaveHeader.cs
- RequestCacheManager.cs
- Semaphore.cs
- ExceptionHelpers.cs
- ProfileService.cs
- CornerRadiusConverter.cs
- MultiBinding.cs