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
- CookielessHelper.cs
- ByteStack.cs
- PreloadedPackages.cs
- StyleConverter.cs
- XXXInfos.cs
- StickyNoteAnnotations.cs
- Clipboard.cs
- XmlSchemaChoice.cs
- dbdatarecord.cs
- QueryCacheEntry.cs
- ConfigurationErrorsException.cs
- SelectionItemPattern.cs
- ZoneLinkButton.cs
- DrawingAttributeSerializer.cs
- XmlSchemaElement.cs
- BitArray.cs
- ServiceDescriptions.cs
- SBCSCodePageEncoding.cs
- TablePattern.cs
- WindowsFormsHelpers.cs
- MessagePropertyFilter.cs
- Matrix3D.cs
- PropertyChangedEventManager.cs
- FacetDescriptionElement.cs
- contentDescriptor.cs
- FormattedTextSymbols.cs
- LinkedResource.cs
- QueryAccessibilityHelpEvent.cs
- SecurityElement.cs
- InkCanvasAutomationPeer.cs
- VideoDrawing.cs
- MDIControlStrip.cs
- StreamedWorkflowDefinitionContext.cs
- StringUtil.cs
- SqlIdentifier.cs
- OdbcError.cs
- ListViewEditEventArgs.cs
- DataGridTable.cs
- FastEncoderWindow.cs
- XPathEmptyIterator.cs
- PropertyEntry.cs
- BrowsableAttribute.cs
- MsmqVerifier.cs
- Transform3DCollection.cs
- DbConnectionStringCommon.cs
- DataService.cs
- CssTextWriter.cs
- HtmlProps.cs
- MdiWindowListStrip.cs
- UniqueIdentifierService.cs
- XmlSchemaAppInfo.cs
- MetaType.cs
- BufferBuilder.cs
- Setter.cs
- RegisteredScript.cs
- Substitution.cs
- CellLabel.cs
- CompatibleComparer.cs
- XmlSchemaImport.cs
- Logging.cs
- EdgeProfileValidation.cs
- FormViewCommandEventArgs.cs
- UdpDiscoveryEndpoint.cs
- SafeEventLogReadHandle.cs
- Timer.cs
- AbsoluteQuery.cs
- IconBitmapDecoder.cs
- PersonalizationDictionary.cs
- Control.cs
- ListViewDeleteEventArgs.cs
- HttpRequestCacheValidator.cs
- ApplicationDirectoryMembershipCondition.cs
- UIHelper.cs
- MetafileHeaderWmf.cs
- LayoutEvent.cs
- EntryIndex.cs
- VisualTreeUtils.cs
- ListControlConvertEventArgs.cs
- VsPropertyGrid.cs
- HashAlgorithm.cs
- ContainsRowNumberChecker.cs
- StrongNameMembershipCondition.cs
- DemultiplexingDispatchMessageFormatter.cs
- CLRBindingWorker.cs
- LoginName.cs
- WebPartMovingEventArgs.cs
- SubMenuStyle.cs
- OleDbPermission.cs
- SolidBrush.cs
- WindowProviderWrapper.cs
- PageBuildProvider.cs
- ConfigurationManagerInternalFactory.cs
- DataService.cs
- BlobPersonalizationState.cs
- BuildProvider.cs
- PageCatalogPart.cs
- DataGridHelper.cs
- MLangCodePageEncoding.cs
- SHA384.cs
- EntityConnectionStringBuilderItem.cs