Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / TrustUi / MS / Internal / documents / Application / PackageDocument.cs / 1 / PackageDocument.cs
//------------------------------------------------------------------------------ //// Copyright (C) Microsoft Corporation. All rights reserved. // //// Extends Document with a single member TrancationalPackage. // // // History: // 08/28/2005: [....]: Initial implementation. //----------------------------------------------------------------------------- using System; using System.IO; using System.IO.Packaging; using System.Security; using MS.Internal.PresentationUI; namespace MS.Internal.Documents.Application { ////// Extends Document with a single member TrancationalPackage. /// [FriendAccessAllowed] internal class PackageDocument : Document { #region Constructors //------------------------------------------------------------------------- // Constructors //------------------------------------------------------------------------- internal PackageDocument(Document dependency) : base(dependency) { } #endregion Constructors #region Internal Properties //-------------------------------------------------------------------------- // Internal Properties //------------------------------------------------------------------------- ////// internal override Stream Destination { get { Invariant.Assert(Dependency != null); return Dependency.Destination; } } ////// /// internal override Stream Source { get { Invariant.Assert(Dependency != null); return Dependency.Source; } } ////// /// internal override Stream Workspace { get { Invariant.Assert(Dependency != null); return Dependency.Workspace; } } ////// /// ////// /// Critical: /// - sets _package we do not want this replaced as it is suppose /// to represent the stream. /// NotSafe: /// - replacing it from a source other than that which is derived from /// the dependent document would result in writing out something other /// than what the user believes they consented to /// internal TransactionalPackage Package { get { return _package.Value; } [SecurityCritical] set { _package.Value = value; } } #endregion Internal Properties #region IDisposable Members //-------------------------------------------------------------------------- // IDisposable Members //-------------------------------------------------------------------------- ////// ////// /// Critical: /// - sets package /// TreatAsSafe: /// - sets value to null when we dispose /// [SecurityCritical, SecurityTreatAsSafe] protected override void Dispose(bool disposing) { try { if (disposing) { if (Package != null) { Package.Close(); Package = null; } } } finally { base.Dispose(disposing); } } #endregion IDisposable Members #region Private Fields //------------------------------------------------------------------------- // Private Fields //-------------------------------------------------------------------------- private SecurityCriticalDataForSet_package; #endregion Private Fields } } // 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
- Duration.cs
- dtdvalidator.cs
- RectAnimationClockResource.cs
- WebPermission.cs
- Function.cs
- HostedHttpContext.cs
- DbConnectionFactory.cs
- ConfigXmlElement.cs
- LinkedResource.cs
- StringSorter.cs
- SecurityKeyType.cs
- Stroke.cs
- Line.cs
- SettingsPropertyNotFoundException.cs
- ToolStripItemClickedEventArgs.cs
- BitmapEffectRenderDataResource.cs
- FixedSOMPageElement.cs
- ObjectContextServiceProvider.cs
- ApplicationServiceHelper.cs
- AttributeQuery.cs
- XmlILCommand.cs
- Transform.cs
- TextEncodedRawTextWriter.cs
- LogLogRecordHeader.cs
- NameTable.cs
- EntityDataSourceUtil.cs
- DataGridAddNewRow.cs
- IgnorePropertiesAttribute.cs
- KeyEventArgs.cs
- BroadcastEventHelper.cs
- CommandManager.cs
- SQLByteStorage.cs
- Quaternion.cs
- _Semaphore.cs
- ApplicationInterop.cs
- Style.cs
- _ListenerAsyncResult.cs
- SqlCommandBuilder.cs
- SettingsProperty.cs
- ScriptIgnoreAttribute.cs
- ScriptControlDescriptor.cs
- Transform.cs
- MobileListItem.cs
- ParameterToken.cs
- InfoCardSymmetricCrypto.cs
- CanonicalFontFamilyReference.cs
- SelectionEditor.cs
- ClusterSafeNativeMethods.cs
- XmlRawWriter.cs
- TemplateColumn.cs
- ToolStripDropDownClosingEventArgs.cs
- RandomDelaySendsAsyncResult.cs
- StyleCollectionEditor.cs
- RectKeyFrameCollection.cs
- WebPartManager.cs
- DelegateSerializationHolder.cs
- EventTrigger.cs
- RootNamespaceAttribute.cs
- ImpersonateTokenRef.cs
- StorageEndPropertyMapping.cs
- DocumentReferenceCollection.cs
- CodeTypeParameterCollection.cs
- ShaperBuffers.cs
- XmlFormatWriterGenerator.cs
- SqlRowUpdatedEvent.cs
- ClientTargetSection.cs
- BitmapEffectGeneralTransform.cs
- CompilationLock.cs
- ADMembershipUser.cs
- autovalidator.cs
- Zone.cs
- _ListenerAsyncResult.cs
- MsmqIntegrationProcessProtocolHandler.cs
- CustomGrammar.cs
- TraceContext.cs
- CompensatableTransactionScopeActivity.cs
- DataGridParentRows.cs
- ImageMapEventArgs.cs
- DecodeHelper.cs
- FactoryGenerator.cs
- DataSpaceManager.cs
- UrlPath.cs
- StreamGeometryContext.cs
- Subtree.cs
- CustomLineCap.cs
- QilInvokeLateBound.cs
- ColorConvertedBitmap.cs
- CmsInterop.cs
- RelationshipEnd.cs
- DataGridViewTextBoxColumn.cs
- CSharpCodeProvider.cs
- EncoderReplacementFallback.cs
- ListViewItemSelectionChangedEvent.cs
- GrammarBuilderRuleRef.cs
- ColumnHeaderConverter.cs
- SkipStoryboardToFill.cs
- Attributes.cs
- Type.cs
- SqlWriter.cs
- CheckBoxStandardAdapter.cs