Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.Activities.DurableInstancing / System / Activities / DurableInstancing / PersistenceTask.cs / 1305376 / PersistenceTask.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Activities.DurableInstancing { using System; using System.Runtime; using System.Runtime.DurableInstancing; abstract class PersistenceTask { bool automaticallyResetTimer; AsyncCallback commandCompletedCallback; InstancePersistenceCommand instancePersistenceCommand; TimeSpan taskInterval; IOThreadTimer taskTimer; object thisLock; bool timerCancelled; public PersistenceTask(SqlWorkflowInstanceStore store, SqlWorkflowInstanceStoreLock storeLock, InstancePersistenceCommand instancePersistenceCommand, TimeSpan taskInterval, bool automaticallyResetTimer) { this.automaticallyResetTimer = automaticallyResetTimer; this.commandCompletedCallback = Fx.ThunkCallback(CommandCompletedCallback); this.instancePersistenceCommand = instancePersistenceCommand; this.Store = store; this.StoreLock = storeLock; this.SurrogateLockOwnerId = this.StoreLock.SurrogateLockOwnerId; this.taskInterval = taskInterval; this.thisLock = new object(); } protected SqlWorkflowInstanceStore Store { get; set; } protected SqlWorkflowInstanceStoreLock StoreLock { get; set; } protected long SurrogateLockOwnerId { get; set; } object ThisLock { get { return this.thisLock; } } public void CancelTimer() { lock (ThisLock) { this.timerCancelled = true; if (this.taskTimer != null) { this.taskTimer.Cancel(); this.taskTimer = null; } } } public void ResetTimer(bool fireImmediately) { this.ResetTimer(fireImmediately, null); } public virtual void ResetTimer(bool fireImmediately, TimeSpan? taskIntervalOverride) { TimeSpan timeTillNextPoll = this.taskInterval; if (taskIntervalOverride.HasValue) { if (taskIntervalOverride.Value < this.taskInterval) timeTillNextPoll = taskIntervalOverride.Value; } lock (ThisLock) { if (!this.timerCancelled) { if (this.taskTimer == null) { this.taskTimer = new IOThreadTimer(new Action
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ContextInformation.cs
- MenuItemCollectionEditor.cs
- ReliableMessagingVersion.cs
- IPPacketInformation.cs
- FocusWithinProperty.cs
- DataSet.cs
- HtmlControlDesigner.cs
- RequestSecurityTokenResponse.cs
- PersonalizationProvider.cs
- MimeBasePart.cs
- SafeLocalMemHandle.cs
- TextRunTypographyProperties.cs
- InstanceValue.cs
- GetPageCompletedEventArgs.cs
- ScriptResourceAttribute.cs
- NameValueSectionHandler.cs
- CodeCatchClause.cs
- WebBrowserNavigatingEventHandler.cs
- SectionVisual.cs
- autovalidator.cs
- TextProperties.cs
- CallbackWrapper.cs
- StagingAreaInputItem.cs
- GroupBoxRenderer.cs
- ScriptControl.cs
- StringStorage.cs
- FieldNameLookup.cs
- MimeMultiPart.cs
- ResizeGrip.cs
- JsonEncodingStreamWrapper.cs
- x509store.cs
- DeferredReference.cs
- WebPartAddingEventArgs.cs
- TargetException.cs
- BitmapFrameEncode.cs
- Animatable.cs
- SiteOfOriginContainer.cs
- BuildProviderAppliesToAttribute.cs
- ValueConversionAttribute.cs
- FactoryRecord.cs
- Rect3D.cs
- _SslStream.cs
- KeyNotFoundException.cs
- TextTabProperties.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- CodePageUtils.cs
- CubicEase.cs
- CodeDirectoryCompiler.cs
- TextTreeTextElementNode.cs
- RsaSecurityKey.cs
- assertwrapper.cs
- AsyncResult.cs
- XslException.cs
- Function.cs
- CodeTypeDeclaration.cs
- OutputCacheSettings.cs
- ThreadStateException.cs
- InputMethod.cs
- FileDialogCustomPlace.cs
- HashJoinQueryOperatorEnumerator.cs
- DataList.cs
- BindingsCollection.cs
- ScriptReference.cs
- NonParentingControl.cs
- StringArrayConverter.cs
- TemplateApplicationHelper.cs
- ClassImporter.cs
- DataGridViewComboBoxColumn.cs
- CellConstant.cs
- ProcessModelInfo.cs
- EventDescriptorCollection.cs
- EntityDataSourceState.cs
- DefaultParameterValueAttribute.cs
- Link.cs
- ErrorFormatterPage.cs
- ComponentChangedEvent.cs
- MDIControlStrip.cs
- ErrorFormatterPage.cs
- AdornedElementPlaceholder.cs
- HtmlTable.cs
- Journaling.cs
- ToolBarButtonClickEvent.cs
- ToolbarAUtomationPeer.cs
- WindowsAuthenticationEventArgs.cs
- TransactionContextValidator.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- DefaultValueAttribute.cs
- CodeGroup.cs
- TableCellCollection.cs
- UIElementParagraph.cs
- AnimationClock.cs
- TypeBuilder.cs
- __Filters.cs
- DataSourceXmlClassAttribute.cs
- XmlRawWriter.cs
- mediaclock.cs
- DataViewManager.cs
- SerializeAbsoluteContext.cs
- ActiveXHelper.cs
- AccessKeyManager.cs