Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WF / RunTime / VolatileResourceManager.cs / 1305376 / VolatileResourceManager.cs
#pragma warning disable 1634, 1691 using System; using System.Diagnostics; using System.Transactions; using System.Collections; using System.Collections.Generic; using System.Workflow.Runtime.Hosting; namespace System.Workflow.Runtime { ////// Volatile Resource Manager /// internal sealed class VolatileResourceManager { // members private WorkBatchCollection _workCollection = new WorkBatchCollection(); private WorkBatch _mergedBatch = null; // constructor internal VolatileResourceManager() { } // properties internal WorkBatchCollection BatchCollection { get { return _workCollection; } } internal bool IsBatchDirty { get { IDictionaryEnumerator de = _workCollection.GetEnumerator(); while (de.MoveNext()) { WorkBatch batch = (WorkBatch)de.Value; if (batch.IsDirty) return true; } return false; } } WorkBatch GetMergedBatch() { return this._workCollection.GetMergedBatch(); } internal void Commit() { _mergedBatch = GetMergedBatch(); Transaction transaction = Transaction.Current; if (null == transaction) throw new InvalidOperationException(ExecutionStringManager.NullAmbientTransaction); // Do Commit Sequence iteration over work collection _mergedBatch.Commit(transaction); } internal void Complete() { try { _mergedBatch.Complete(true); } finally { if (_mergedBatch != null) { _mergedBatch.Dispose(); _mergedBatch = null; } if (_workCollection != null) { _workCollection.ClearSubBatches(); } } } internal void HandleFault() { // // We've failed, clear the merged batch if (_mergedBatch != null) { _mergedBatch.Dispose(); _mergedBatch = null; } // clear transient batch which holds instance state primarily if (_workCollection != null) { _workCollection.ClearTransientBatch(); } } internal void ClearAllBatchedWork() { if (_workCollection != null) _workCollection.RollbackAllBatchedWork(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. #pragma warning disable 1634, 1691 using System; using System.Diagnostics; using System.Transactions; using System.Collections; using System.Collections.Generic; using System.Workflow.Runtime.Hosting; namespace System.Workflow.Runtime { ////// Volatile Resource Manager /// internal sealed class VolatileResourceManager { // members private WorkBatchCollection _workCollection = new WorkBatchCollection(); private WorkBatch _mergedBatch = null; // constructor internal VolatileResourceManager() { } // properties internal WorkBatchCollection BatchCollection { get { return _workCollection; } } internal bool IsBatchDirty { get { IDictionaryEnumerator de = _workCollection.GetEnumerator(); while (de.MoveNext()) { WorkBatch batch = (WorkBatch)de.Value; if (batch.IsDirty) return true; } return false; } } WorkBatch GetMergedBatch() { return this._workCollection.GetMergedBatch(); } internal void Commit() { _mergedBatch = GetMergedBatch(); Transaction transaction = Transaction.Current; if (null == transaction) throw new InvalidOperationException(ExecutionStringManager.NullAmbientTransaction); // Do Commit Sequence iteration over work collection _mergedBatch.Commit(transaction); } internal void Complete() { try { _mergedBatch.Complete(true); } finally { if (_mergedBatch != null) { _mergedBatch.Dispose(); _mergedBatch = null; } if (_workCollection != null) { _workCollection.ClearSubBatches(); } } } internal void HandleFault() { // // We've failed, clear the merged batch if (_mergedBatch != null) { _mergedBatch.Dispose(); _mergedBatch = null; } // clear transient batch which holds instance state primarily if (_workCollection != null) { _workCollection.ClearTransientBatch(); } } internal void ClearAllBatchedWork() { if (_workCollection != null) _workCollection.RollbackAllBatchedWork(); } } } // 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
- LinearGradientBrush.cs
- ExecutedRoutedEventArgs.cs
- PrivilegedConfigurationManager.cs
- ProfileSettingsCollection.cs
- MimeMapping.cs
- XComponentModel.cs
- AppearanceEditorPart.cs
- CacheRequest.cs
- diagnosticsswitches.cs
- InternalsVisibleToAttribute.cs
- Publisher.cs
- Inflater.cs
- AdapterSwitches.cs
- OuterGlowBitmapEffect.cs
- BaseDataList.cs
- LoginStatusDesigner.cs
- DebuggerAttributes.cs
- SqlDataRecord.cs
- AliasExpr.cs
- IndicCharClassifier.cs
- PeerNameRecordCollection.cs
- InputLanguageManager.cs
- ObjectDataSourceFilteringEventArgs.cs
- XmlSchemaDatatype.cs
- WizardStepBase.cs
- DelegateSerializationHolder.cs
- XmlTextReaderImplHelpers.cs
- Size3DConverter.cs
- DBCommand.cs
- EventLogPermissionEntryCollection.cs
- RichTextBoxConstants.cs
- PriorityBinding.cs
- Int16AnimationUsingKeyFrames.cs
- MimeTypeAttribute.cs
- CryptoApi.cs
- CategoryGridEntry.cs
- OdbcPermission.cs
- ExpandCollapseProviderWrapper.cs
- Pens.cs
- Group.cs
- EmptyEnumerator.cs
- ParseChildrenAsPropertiesAttribute.cs
- ColorConverter.cs
- DSASignatureDeformatter.cs
- Symbol.cs
- _HTTPDateParse.cs
- EditorAttribute.cs
- HatchBrush.cs
- ThreadSafeList.cs
- IRCollection.cs
- RectAnimationClockResource.cs
- DocumentPageView.cs
- StreamAsIStream.cs
- InvalidCommandTreeException.cs
- RenderCapability.cs
- SamlConstants.cs
- SafeRightsManagementQueryHandle.cs
- PrePrepareMethodAttribute.cs
- FileNotFoundException.cs
- ThemeInfoAttribute.cs
- DoubleLinkListEnumerator.cs
- RemotingServices.cs
- DomNameTable.cs
- ServiceChannel.cs
- SeverityFilter.cs
- VolatileEnlistmentMultiplexing.cs
- SuppressMergeCheckAttribute.cs
- _LocalDataStore.cs
- CharacterMetrics.cs
- ThreadStateException.cs
- ScriptingSectionGroup.cs
- SQLSingle.cs
- NavigationHelper.cs
- WebBrowserPermission.cs
- HuffmanTree.cs
- TextBoxBase.cs
- SessionStateSection.cs
- MDIClient.cs
- Schema.cs
- DataTableReader.cs
- EllipseGeometry.cs
- ExtensionQuery.cs
- FixedTextView.cs
- TargetControlTypeAttribute.cs
- CryptographicAttribute.cs
- JoinSymbol.cs
- MetadataCacheItem.cs
- MasterPageCodeDomTreeGenerator.cs
- QueryInterceptorAttribute.cs
- ReliableSession.cs
- GridViewRow.cs
- ComponentConverter.cs
- ProcessDesigner.cs
- TcpConnectionPoolSettingsElement.cs
- XPathNavigatorReader.cs
- ValidatingCollection.cs
- PathTooLongException.cs
- ScriptResourceHandler.cs
- ConfigurationManagerHelper.cs
- VerificationAttribute.cs