Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Operand.cs
- WebPartMinimizeVerb.cs
- Event.cs
- CodeAttributeDeclarationCollection.cs
- _RequestLifetimeSetter.cs
- TriState.cs
- SqlServer2KCompatibilityAnnotation.cs
- WebServiceErrorEvent.cs
- GroupBox.cs
- ListControl.cs
- CodeGotoStatement.cs
- DirectoryGroupQuery.cs
- ConsoleEntryPoint.cs
- DataGridViewTopRowAccessibleObject.cs
- TextCollapsingProperties.cs
- SafeMarshalContext.cs
- OptimisticConcurrencyException.cs
- FontNamesConverter.cs
- InkCanvas.cs
- WebControlAdapter.cs
- HeaderedItemsControl.cs
- MulticastNotSupportedException.cs
- ControlBindingsCollection.cs
- LineMetrics.cs
- Privilege.cs
- DataGridTextBoxColumn.cs
- SqlIdentifier.cs
- OdbcPermission.cs
- TextElementEnumerator.cs
- DockingAttribute.cs
- WindowCollection.cs
- IndexedString.cs
- SiteMembershipCondition.cs
- ComponentCollection.cs
- RenderContext.cs
- SynchronizedDisposablePool.cs
- ClientScriptManagerWrapper.cs
- BindingCollection.cs
- ShaderEffect.cs
- TemplateApplicationHelper.cs
- DigitalSignatureProvider.cs
- FileChangesMonitor.cs
- CornerRadius.cs
- sqlcontext.cs
- VersionedStreamOwner.cs
- UriScheme.cs
- AlphabeticalEnumConverter.cs
- SolidBrush.cs
- OperationCanceledException.cs
- AssemblyBuilder.cs
- QilCloneVisitor.cs
- WorkflowServiceAttributesTypeConverter.cs
- CryptoStream.cs
- HttpHandlersSection.cs
- HandlerBase.cs
- MetabaseSettings.cs
- RegexCode.cs
- ViewStateModeByIdAttribute.cs
- MbpInfo.cs
- HandleRef.cs
- Inflater.cs
- MSAAWinEventWrap.cs
- DataTableReader.cs
- UIElementParaClient.cs
- XmlObjectSerializerWriteContextComplexJson.cs
- TreeViewCancelEvent.cs
- Geometry.cs
- InputScope.cs
- SessionPageStateSection.cs
- httpapplicationstate.cs
- RoutedCommand.cs
- CheckBox.cs
- DataGridItem.cs
- StringExpressionSet.cs
- SharedUtils.cs
- WorkflowServiceHostFactory.cs
- Opcode.cs
- SafeCryptHandles.cs
- BaseCodePageEncoding.cs
- KnownBoxes.cs
- XmlNullResolver.cs
- TokenBasedSet.cs
- DataReaderContainer.cs
- LocatorBase.cs
- ListViewInsertedEventArgs.cs
- MouseActionValueSerializer.cs
- PersianCalendar.cs
- DataGridViewSortCompareEventArgs.cs
- CreateUserWizard.cs
- Roles.cs
- XPathDocumentBuilder.cs
- NamespaceExpr.cs
- XsdValidatingReader.cs
- DesignerRegion.cs
- TypeNameParser.cs
- ObjectTag.cs
- HttpRawResponse.cs
- GetPolicyDetailsRequest.cs
- SecurityTokenResolver.cs
- __Filters.cs