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
- XmlObjectSerializerReadContextComplex.cs
- Item.cs
- CodeTypeDeclarationCollection.cs
- uribuilder.cs
- DynamicILGenerator.cs
- MediaContext.cs
- DataSourceCache.cs
- ShadowGlyph.cs
- WinFormsUtils.cs
- PlainXmlSerializer.cs
- XmlSchemaAll.cs
- ObjectItemCollection.cs
- MetadataArtifactLoaderComposite.cs
- SqlDeflator.cs
- XamlTypeMapper.cs
- TraceLevelStore.cs
- HyperLinkStyle.cs
- ConfigurationCollectionAttribute.cs
- AvTraceFormat.cs
- GPPOINTF.cs
- EntityContainerEmitter.cs
- RemotingConfiguration.cs
- ShortcutKeysEditor.cs
- ToolStripSettings.cs
- DependencySource.cs
- TraceUtils.cs
- RectAnimation.cs
- RoutedEventValueSerializer.cs
- XhtmlBasicPanelAdapter.cs
- Queue.cs
- SHA1.cs
- ProtectedProviderSettings.cs
- CompareValidator.cs
- DataRecordInfo.cs
- BindingExpression.cs
- EdmToObjectNamespaceMap.cs
- HtmlInputButton.cs
- BadImageFormatException.cs
- DesignTimeSiteMapProvider.cs
- UserUseLicenseDictionaryLoader.cs
- DataSvcMapFileSerializer.cs
- MdiWindowListStrip.cs
- HostSecurityManager.cs
- OdbcEnvironmentHandle.cs
- MailAddress.cs
- ApplicationSettingsBase.cs
- TransportSecurityHelpers.cs
- CfgParser.cs
- ObjectConverter.cs
- QilXmlWriter.cs
- HashMembershipCondition.cs
- ObjectDataSourceDisposingEventArgs.cs
- XslAst.cs
- Encoder.cs
- QueryHandler.cs
- ControlPropertyNameConverter.cs
- InvokeWebServiceDesigner.cs
- EdmTypeAttribute.cs
- RelationshipEnd.cs
- AssemblyInfo.cs
- SqlUtils.cs
- InputBinding.cs
- LockCookie.cs
- LogExtentCollection.cs
- XmlQualifiedNameTest.cs
- SingleTagSectionHandler.cs
- HttpClientCertificate.cs
- GetKeyedHashRequest.cs
- Brushes.cs
- SecurityKeyIdentifierClause.cs
- DataGridSortingEventArgs.cs
- CodeCatchClause.cs
- StyleSelector.cs
- MimeFormatter.cs
- DataGridViewCellEventArgs.cs
- UIPropertyMetadata.cs
- ProviderConnectionPoint.cs
- IOThreadScheduler.cs
- MimeMapping.cs
- Activity.cs
- MemoryStream.cs
- AliasGenerator.cs
- ErrorItem.cs
- ResourceReferenceExpression.cs
- SimpleWebHandlerParser.cs
- SerializeAbsoluteContext.cs
- Freezable.cs
- Pkcs9Attribute.cs
- VerticalConnector.xaml.cs
- TransformerConfigurationWizardBase.cs
- XamlSerializationHelper.cs
- JapaneseCalendar.cs
- DateTimePicker.cs
- CodeDesigner.cs
- LayoutEngine.cs
- SqlServices.cs
- FixedDSBuilder.cs
- Int64AnimationBase.cs
- Row.cs
- FixedBufferAttribute.cs