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
- TimeoutTimer.cs
- CodeTypeParameterCollection.cs
- BrowserDefinitionCollection.cs
- GridViewEditEventArgs.cs
- BufferedMessageData.cs
- ScrollData.cs
- Vector3D.cs
- GridEntryCollection.cs
- ZoneMembershipCondition.cs
- BindingContext.cs
- FusionWrap.cs
- BooleanProjectedSlot.cs
- SecurityUtils.cs
- MenuItemStyle.cs
- HtmlButton.cs
- SharedPerformanceCounter.cs
- SoapAttributeAttribute.cs
- SqlBulkCopy.cs
- FormViewInsertedEventArgs.cs
- SuppressMergeCheckAttribute.cs
- ListViewDeleteEventArgs.cs
- StylusPlugInCollection.cs
- PointAnimationBase.cs
- XmlSecureResolver.cs
- SystemDropShadowChrome.cs
- StrokeNode.cs
- NodeFunctions.cs
- TextBlockAutomationPeer.cs
- UserMapPath.cs
- GenericIdentity.cs
- ExecutedRoutedEventArgs.cs
- XPathBinder.cs
- CallbackDebugElement.cs
- SmiContext.cs
- BookmarkNameHelper.cs
- ApplicationDirectory.cs
- SortQuery.cs
- XmlSchemaElement.cs
- DataGridViewAdvancedBorderStyle.cs
- Aes.cs
- InternalPermissions.cs
- FillBehavior.cs
- NumberFormatInfo.cs
- CssTextWriter.cs
- DPTypeDescriptorContext.cs
- UpdateDelegates.Generated.cs
- ExtendedProtectionPolicyTypeConverter.cs
- XmlnsPrefixAttribute.cs
- Fault.cs
- Slider.cs
- DataSet.cs
- AnnotationObservableCollection.cs
- DispatchChannelSink.cs
- FunctionQuery.cs
- _SingleItemRequestCache.cs
- OptimalTextSource.cs
- RangeBaseAutomationPeer.cs
- base64Transforms.cs
- EventMemberCodeDomSerializer.cs
- AssemblyName.cs
- TypeSource.cs
- AdRotator.cs
- ScriptControl.cs
- CellTreeNode.cs
- RSACryptoServiceProvider.cs
- Switch.cs
- Separator.cs
- wmiprovider.cs
- NativeMethods.cs
- GridToolTip.cs
- EmptyControlCollection.cs
- ObfuscateAssemblyAttribute.cs
- HtmlFormParameterReader.cs
- InvalidDataException.cs
- TextStore.cs
- Collection.cs
- Model3DGroup.cs
- CodeNamespaceImport.cs
- BinaryMethodMessage.cs
- AffineTransform3D.cs
- MenuItemStyle.cs
- GetWinFXPath.cs
- TreeViewCancelEvent.cs
- OLEDB_Util.cs
- UIElement.cs
- SizeAnimationClockResource.cs
- BufferedGraphicsContext.cs
- sortedlist.cs
- RequestCacheManager.cs
- PeerCustomResolverSettings.cs
- DbFunctionCommandTree.cs
- SqlDataSourceFilteringEventArgs.cs
- DoubleIndependentAnimationStorage.cs
- DataGridViewComboBoxCell.cs
- XslAstAnalyzer.cs
- ExtractorMetadata.cs
- ChannelBuilder.cs
- MediaContextNotificationWindow.cs
- DependencyPropertyKind.cs
- MimeTextImporter.cs