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
- DocumentGridContextMenu.cs
- ExpressionList.cs
- ConstantProjectedSlot.cs
- ProxyWebPartManager.cs
- CroppedBitmap.cs
- ListenerElementsCollection.cs
- NameValueFileSectionHandler.cs
- EmptyCollection.cs
- ExpressionNormalizer.cs
- AvTrace.cs
- LinqDataSourceSelectEventArgs.cs
- ResourceReferenceKeyNotFoundException.cs
- DesignerActionService.cs
- CollectionViewGroupRoot.cs
- MobileControlBuilder.cs
- TextRunCacheImp.cs
- ImageMetadata.cs
- SystemSounds.cs
- URLMembershipCondition.cs
- GeneralTransform2DTo3DTo2D.cs
- ViewService.cs
- DecoderBestFitFallback.cs
- ClipboardProcessor.cs
- FastEncoderWindow.cs
- DataGridViewColumnDesignTimeVisibleAttribute.cs
- SymmetricSecurityProtocol.cs
- securitycriticaldataformultiplegetandset.cs
- DataGridViewCellStateChangedEventArgs.cs
- SettingsPropertyValueCollection.cs
- PathBox.cs
- Attributes.cs
- OrderedDictionaryStateHelper.cs
- MetaModel.cs
- HttpListener.cs
- MenuItemStyleCollection.cs
- RawStylusInputCustomDataList.cs
- SqlFactory.cs
- ClientFormsIdentity.cs
- Hex.cs
- TextElement.cs
- KeySplineConverter.cs
- TextBounds.cs
- CodeNamespaceCollection.cs
- JavascriptCallbackBehaviorAttribute.cs
- HttpProfileBase.cs
- SmiMetaData.cs
- MimeMapping.cs
- DataGridViewCellCancelEventArgs.cs
- FixedElement.cs
- JsonDeserializer.cs
- WorkflowApplication.cs
- NavigationProperty.cs
- ValueChangedEventManager.cs
- FieldNameLookup.cs
- FlowDocumentFormatter.cs
- PropertyGridView.cs
- ValidateNames.cs
- IPAddressCollection.cs
- RIPEMD160.cs
- StorageEntityContainerMapping.cs
- StrongNameIdentityPermission.cs
- CriticalFileToken.cs
- BridgeDataReader.cs
- BaseDataListPage.cs
- QueuePathDialog.cs
- ManagementEventArgs.cs
- FactoryMaker.cs
- DataList.cs
- FormsAuthenticationConfiguration.cs
- ChangeInterceptorAttribute.cs
- XPathBuilder.cs
- ReflectionPermission.cs
- EncryptedKey.cs
- HtmlElementEventArgs.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- SafeProcessHandle.cs
- HierarchicalDataSourceControl.cs
- EntityStoreSchemaGenerator.cs
- FileLevelControlBuilderAttribute.cs
- ImageListStreamer.cs
- FontFamily.cs
- OracleConnectionFactory.cs
- Encoder.cs
- EmptyEnumerable.cs
- IHttpResponseInternal.cs
- CodeNamespace.cs
- smtppermission.cs
- ValidatorAttribute.cs
- ListContractAdapter.cs
- ValueExpressions.cs
- FormsAuthentication.cs
- DateRangeEvent.cs
- UITypeEditor.cs
- PeerPresenceInfo.cs
- DiscriminatorMap.cs
- loginstatus.cs
- BrushMappingModeValidation.cs
- User.cs
- Geometry.cs
- SiteMapNodeItemEventArgs.cs