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
- BindingUtils.cs
- MsmqReceiveParameters.cs
- StringUtil.cs
- TypeDelegator.cs
- ManagementInstaller.cs
- ProxyRpc.cs
- SchemaDeclBase.cs
- GlobalProxySelection.cs
- ShaperBuffers.cs
- DispatcherSynchronizationContext.cs
- HMACSHA1.cs
- Events.cs
- TextEndOfParagraph.cs
- CharacterBufferReference.cs
- BitmapVisualManager.cs
- TextTreeUndo.cs
- CollectionViewSource.cs
- TypePresenter.xaml.cs
- InsufficientMemoryException.cs
- ObjectConverter.cs
- ShapingEngine.cs
- SafeRightsManagementPubHandle.cs
- AsyncOperationManager.cs
- BindingOperations.cs
- SecurityChannel.cs
- SystemIcmpV4Statistics.cs
- HostingEnvironmentException.cs
- WebPartMenuStyle.cs
- DataGridSortCommandEventArgs.cs
- DocumentReferenceCollection.cs
- OletxTransactionFormatter.cs
- TopClause.cs
- DesignerTransaction.cs
- HeaderUtility.cs
- ConfigurationStrings.cs
- SystemDiagnosticsSection.cs
- ExpressionDumper.cs
- ApplicationSecurityInfo.cs
- Partitioner.cs
- RoutedEventValueSerializer.cs
- TypeKeyValue.cs
- LineSegment.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- DataObjectMethodAttribute.cs
- PartBasedPackageProperties.cs
- PointCollection.cs
- XmlSchemaGroupRef.cs
- WindowsStreamSecurityUpgradeProvider.cs
- EdgeModeValidation.cs
- DataServiceProviderMethods.cs
- ProfileGroupSettingsCollection.cs
- DefaultBinder.cs
- DictionaryEntry.cs
- SyndicationElementExtensionCollection.cs
- FileDialogCustomPlace.cs
- CurrentTimeZone.cs
- TaskResultSetter.cs
- MenuCommands.cs
- SafeEventLogWriteHandle.cs
- Positioning.cs
- SemanticAnalyzer.cs
- FunctionMappingTranslator.cs
- OdbcConnectionPoolProviderInfo.cs
- RegexCharClass.cs
- XmlSerializerAssemblyAttribute.cs
- ValuePattern.cs
- GuidTagList.cs
- basecomparevalidator.cs
- ScriptingJsonSerializationSection.cs
- ProfileInfo.cs
- ReferencedAssemblyResolver.cs
- GridErrorDlg.cs
- DispatcherProcessingDisabled.cs
- GenericParameterDataContract.cs
- DataColumnMapping.cs
- ObjectStateFormatter.cs
- HttpWebResponse.cs
- SafeNativeMethodsMilCoreApi.cs
- DefaultObjectMappingItemCollection.cs
- Italic.cs
- CommandCollectionEditor.cs
- CompiledIdentityConstraint.cs
- ProviderSettingsCollection.cs
- WorkflowTimerService.cs
- DataKey.cs
- CqlBlock.cs
- RunInstallerAttribute.cs
- CodeTypeMember.cs
- ToolStripSplitButton.cs
- ContentElement.cs
- MetadataCacheItem.cs
- CasesDictionary.cs
- followingquery.cs
- DbConvert.cs
- WpfPayload.cs
- FileDialogPermission.cs
- SettingsBindableAttribute.cs
- OpCellTreeNode.cs
- WebColorConverter.cs
- SmtpReplyReaderFactory.cs