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
- ColumnReorderedEventArgs.cs
- Exception.cs
- ConnectionInterfaceCollection.cs
- InputMethod.cs
- DataTablePropertyDescriptor.cs
- Label.cs
- ComponentConverter.cs
- PipeSecurity.cs
- CultureData.cs
- SqlBooleanMismatchVisitor.cs
- LoginName.cs
- BasicBrowserDialog.cs
- NotifyCollectionChangedEventArgs.cs
- DbCommandDefinition.cs
- ValueUnavailableException.cs
- GeneralTransformGroup.cs
- CommandBinding.cs
- ResourceIDHelper.cs
- DataSourceExpression.cs
- DataControlButton.cs
- FieldNameLookup.cs
- TraceContext.cs
- QueryCacheKey.cs
- Graphics.cs
- TextMarkerSource.cs
- controlskin.cs
- FormatConvertedBitmap.cs
- WebPartExportVerb.cs
- ToolboxComponentsCreatingEventArgs.cs
- EmptyCollection.cs
- RegexMatch.cs
- EventRoute.cs
- X509Logo.cs
- ObjectItemLoadingSessionData.cs
- GroupByQueryOperator.cs
- SiteMapDataSource.cs
- MaterialGroup.cs
- XmlSerializationGeneratedCode.cs
- ThicknessAnimationBase.cs
- ImageButton.cs
- TextServicesPropertyRanges.cs
- AuthenticationServiceManager.cs
- DataControlField.cs
- StrongNameMembershipCondition.cs
- WpfWebRequestHelper.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- DecimalConverter.cs
- DataGridTextBoxColumn.cs
- SQLInt16.cs
- objectresult_tresulttype.cs
- XmlNodeComparer.cs
- ByteAnimationUsingKeyFrames.cs
- DbProviderSpecificTypePropertyAttribute.cs
- ControlBuilderAttribute.cs
- StructuredTypeInfo.cs
- TrustManager.cs
- HighlightComponent.cs
- FrameworkContentElement.cs
- ScrollData.cs
- CodeNamespaceImportCollection.cs
- ClientTarget.cs
- MetabaseServerConfig.cs
- DefaultHttpHandler.cs
- ServicePointManagerElement.cs
- RegexCode.cs
- SAPIEngineTypes.cs
- AuthorizationContext.cs
- uribuilder.cs
- ComEventsSink.cs
- propertyentry.cs
- EntityContainer.cs
- StateMachine.cs
- UriTemplateTrieNode.cs
- RoleGroupCollection.cs
- WebServiceData.cs
- XamlRtfConverter.cs
- WebPartVerbCollection.cs
- PermissionRequestEvidence.cs
- TcpProcessProtocolHandler.cs
- EnumUnknown.cs
- ConfigurationLockCollection.cs
- TTSEngineTypes.cs
- ObjectDataSourceWizardForm.cs
- FileIOPermission.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- WebPartDeleteVerb.cs
- CheckableControlBaseAdapter.cs
- BaseAddressElementCollection.cs
- PersonalizablePropertyEntry.cs
- HtmlLabelAdapter.cs
- FixedSOMTableCell.cs
- wgx_exports.cs
- SchemaDeclBase.cs
- ContactManager.cs
- EventSourceCreationData.cs
- XamlFilter.cs
- WindowsStatusBar.cs
- VarRefManager.cs
- JsonSerializer.cs
- DuplexClientBase.cs