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
- XmlReaderDelegator.cs
- InputLanguageProfileNotifySink.cs
- PackUriHelper.cs
- Focus.cs
- WSDualHttpSecurityMode.cs
- OutputWindow.cs
- NamespaceInfo.cs
- Image.cs
- SecurityPermission.cs
- ObjectItemCollection.cs
- NativeActivityContext.cs
- FormViewUpdateEventArgs.cs
- MergeFilterQuery.cs
- BulletedListEventArgs.cs
- DbProviderConfigurationHandler.cs
- InvalidPrinterException.cs
- Rotation3DAnimation.cs
- Guid.cs
- StatusBarDrawItemEvent.cs
- _FixedSizeReader.cs
- BigInt.cs
- Internal.cs
- ContextMenuAutomationPeer.cs
- XmlSerializerFactory.cs
- CommandHelpers.cs
- NotConverter.cs
- InfoCardService.cs
- sqlcontext.cs
- Keywords.cs
- DynamicPropertyHolder.cs
- ResourceManagerWrapper.cs
- InheritedPropertyChangedEventArgs.cs
- PropertyConverter.cs
- MeasurementDCInfo.cs
- COM2IDispatchConverter.cs
- UDPClient.cs
- PageCatalogPartDesigner.cs
- ActionNotSupportedException.cs
- RandomNumberGenerator.cs
- AnnotationHighlightLayer.cs
- UnmanagedMarshal.cs
- DataGridViewCellStyleBuilderDialog.cs
- NullableDoubleSumAggregationOperator.cs
- SelectionEditingBehavior.cs
- HttpRequest.cs
- FormsAuthenticationEventArgs.cs
- XmlDataCollection.cs
- PathFigure.cs
- ReachPageContentSerializerAsync.cs
- Ipv6Element.cs
- XMLSyntaxException.cs
- FileDialog.cs
- wpf-etw.cs
- BadImageFormatException.cs
- ToolStripPanelCell.cs
- DesignerDeviceConfig.cs
- TransactionContextValidator.cs
- BatchParser.cs
- FunctionQuery.cs
- NamespaceCollection.cs
- IERequestCache.cs
- ActivitySurrogateSelector.cs
- SystemEvents.cs
- PeerCollaborationPermission.cs
- UnsettableComboBox.cs
- ReplyChannelBinder.cs
- TextViewSelectionProcessor.cs
- ResourcePermissionBaseEntry.cs
- KeyInfo.cs
- TileBrush.cs
- ProjectionRewriter.cs
- RightNameExpirationInfoPair.cs
- ExpressionBuilderCollection.cs
- SystemIPGlobalStatistics.cs
- HtmlTable.cs
- HttpCapabilitiesBase.cs
- panel.cs
- UserControlAutomationPeer.cs
- Span.cs
- XamlRtfConverter.cs
- Highlights.cs
- ObjectStateManagerMetadata.cs
- datacache.cs
- SamlAssertionDirectKeyIdentifierClause.cs
- VerticalAlignConverter.cs
- CapabilitiesAssignment.cs
- RelatedImageListAttribute.cs
- KeyboardDevice.cs
- EventLogEntryCollection.cs
- AttributeCollection.cs
- Config.cs
- OdbcFactory.cs
- FileIOPermission.cs
- AddIn.cs
- WindowsClaimSet.cs
- AppDomainFactory.cs
- SqlParameter.cs
- WindowsFont.cs
- CallbackValidatorAttribute.cs
- FontDialog.cs