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
- BasicExpressionVisitor.cs
- SyndicationSerializer.cs
- DCSafeHandle.cs
- PeerPresenceInfo.cs
- WindowsFont.cs
- UnSafeCharBuffer.cs
- BamlResourceDeserializer.cs
- HostingEnvironmentWrapper.cs
- TextChange.cs
- RemotingServices.cs
- HttpCookieCollection.cs
- PageContentAsyncResult.cs
- ObjectConverter.cs
- HtmlElementCollection.cs
- ArithmeticException.cs
- PixelShader.cs
- DropDownButton.cs
- Emitter.cs
- PriorityBindingExpression.cs
- MouseActionConverter.cs
- ProfileSettings.cs
- DBConnection.cs
- PrimitiveXmlSerializers.cs
- ExpressionConverter.cs
- RuleRef.cs
- CompilerParameters.cs
- ElementUtil.cs
- XmlSchemaFacet.cs
- IMembershipProvider.cs
- XamlGridLengthSerializer.cs
- ImageCollectionCodeDomSerializer.cs
- DictionaryContent.cs
- WsdlInspector.cs
- AddInSegmentDirectoryNotFoundException.cs
- SafeEventLogWriteHandle.cs
- ForceCopyBuildProvider.cs
- VarInfo.cs
- DateTimeStorage.cs
- XmlHierarchicalDataSourceView.cs
- InputMethodStateTypeInfo.cs
- TextTreeTextElementNode.cs
- Page.cs
- SingleAnimationUsingKeyFrames.cs
- AnnotationResourceCollection.cs
- AccessibleObject.cs
- TimeSpanConverter.cs
- DictationGrammar.cs
- EncoderParameters.cs
- ListenerElementsCollection.cs
- ObjectDataSourceFilteringEventArgs.cs
- HttpHandlerActionCollection.cs
- Message.cs
- LongValidator.cs
- ScrollProviderWrapper.cs
- InputProcessorProfiles.cs
- StickyNoteContentControl.cs
- RSAProtectedConfigurationProvider.cs
- HandleValueEditor.cs
- VariableQuery.cs
- DPCustomTypeDescriptor.cs
- TerminatorSinks.cs
- FormsAuthenticationUser.cs
- EventProviderBase.cs
- DetailsViewPagerRow.cs
- CodeIdentifiers.cs
- AssemblyHash.cs
- XmlAttributes.cs
- sqlinternaltransaction.cs
- XmlUtil.cs
- SiteMapPath.cs
- IntegerValidatorAttribute.cs
- ControlBindingsCollection.cs
- TrustLevelCollection.cs
- UnsafeNativeMethods.cs
- OleDbPermission.cs
- SystemResourceHost.cs
- Model3DGroup.cs
- CustomError.cs
- StorageConditionPropertyMapping.cs
- ReachFixedPageSerializerAsync.cs
- SecUtil.cs
- BasicKeyConstraint.cs
- HtmlContainerControl.cs
- ThousandthOfEmRealPoints.cs
- ScopelessEnumAttribute.cs
- Label.cs
- SynthesizerStateChangedEventArgs.cs
- ViewStateModeByIdAttribute.cs
- Application.cs
- SchemaObjectWriter.cs
- ListenerSingletonConnectionReader.cs
- CryptoStream.cs
- XmlDataImplementation.cs
- SelectionProcessor.cs
- ChtmlCommandAdapter.cs
- PropertyPath.cs
- UdpTransportSettings.cs
- StreamGeometryContext.cs
- EntityParameter.cs
- CompareValidator.cs