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
- SQLBytesStorage.cs
- PartialArray.cs
- PtsContext.cs
- UrlPropertyAttribute.cs
- SoapProcessingBehavior.cs
- SqlPersonalizationProvider.cs
- DropSource.cs
- JavascriptCallbackMessageInspector.cs
- DateTimeConstantAttribute.cs
- Optimizer.cs
- LinearQuaternionKeyFrame.cs
- EnumerableValidator.cs
- PerformanceCounterPermissionEntryCollection.cs
- CallTemplateAction.cs
- InlinedAggregationOperatorEnumerator.cs
- XmlSiteMapProvider.cs
- HashLookup.cs
- UnaryNode.cs
- ParamArrayAttribute.cs
- SettingsSection.cs
- ReadOnlyTernaryTree.cs
- NativeMethods.cs
- DataGridViewBindingCompleteEventArgs.cs
- Attachment.cs
- TypeUnloadedException.cs
- Size3D.cs
- VisualBasicSettingsHandler.cs
- ThaiBuddhistCalendar.cs
- TraceContext.cs
- TextTreeInsertUndoUnit.cs
- ValidationSummary.cs
- MailAddress.cs
- EntityDataSource.cs
- SimpleBitVector32.cs
- XmlDataLoader.cs
- FontStyle.cs
- InternalTransaction.cs
- Calendar.cs
- CompositeCollectionView.cs
- NoClickablePointException.cs
- OdbcEnvironmentHandle.cs
- CommandLibraryHelper.cs
- TypeConverterHelper.cs
- FakeModelItemImpl.cs
- Converter.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- FullTextState.cs
- ExceptionHelpers.cs
- ScriptDescriptor.cs
- ViewUtilities.cs
- ConstrainedDataObject.cs
- WindowsScrollBarBits.cs
- SelectionWordBreaker.cs
- MailAddressCollection.cs
- EditorPartChrome.cs
- FamilyTypefaceCollection.cs
- ParsedAttributeCollection.cs
- DbException.cs
- ConnectionManagementSection.cs
- QilXmlWriter.cs
- OracleCommandBuilder.cs
- TrackingMemoryStreamFactory.cs
- DetailsView.cs
- BindableAttribute.cs
- AppearanceEditorPart.cs
- _DisconnectOverlappedAsyncResult.cs
- DemultiplexingClientMessageFormatter.cs
- WebServicesSection.cs
- EventWaitHandle.cs
- Timer.cs
- XPathParser.cs
- EncryptedHeader.cs
- XmlImplementation.cs
- MobileTextWriter.cs
- XmlTextReader.cs
- ActivitiesCollection.cs
- DigitShape.cs
- Function.cs
- MultiDataTrigger.cs
- TextTreeNode.cs
- InvalidChannelBindingException.cs
- LayoutManager.cs
- XmlJsonWriter.cs
- EventLogInternal.cs
- ControlBindingsCollection.cs
- UInt16Storage.cs
- TabControlAutomationPeer.cs
- AnimationTimeline.cs
- WebSysDescriptionAttribute.cs
- Tracking.cs
- UnknownBitmapEncoder.cs
- Lasso.cs
- StorageAssociationTypeMapping.cs
- LoginName.cs
- FlowLayoutSettings.cs
- RequestCacheManager.cs
- InvalidOleVariantTypeException.cs
- AutoGeneratedField.cs
- RuntimeEnvironment.cs
- DefaultParameterValueAttribute.cs