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
- _ProxyChain.cs
- Sql8ExpressionRewriter.cs
- EdmProperty.cs
- VisualStateGroup.cs
- EntityContainerAssociationSetEnd.cs
- ValidationContext.cs
- FileLevelControlBuilderAttribute.cs
- TableLayoutCellPaintEventArgs.cs
- BulletedList.cs
- StreamWithDictionary.cs
- ToolStripRenderer.cs
- SoapFaultCodes.cs
- RegexStringValidator.cs
- GeneralTransform3DTo2DTo3D.cs
- MarkupCompilePass1.cs
- ProxyManager.cs
- Int32KeyFrameCollection.cs
- DataStreams.cs
- ListItemParagraph.cs
- ContentPlaceHolder.cs
- TargetParameterCountException.cs
- NamespaceDisplay.xaml.cs
- XmlSchemaAppInfo.cs
- InstancePersistenceCommand.cs
- Attributes.cs
- DispatcherHooks.cs
- Axis.cs
- LocalizedNameDescriptionPair.cs
- ValueType.cs
- DataGridViewRowHeaderCell.cs
- AddInEnvironment.cs
- COAUTHIDENTITY.cs
- DbModificationCommandTree.cs
- CommandID.cs
- CompositeScriptReference.cs
- XmlSchemaSimpleContentExtension.cs
- ImageAnimator.cs
- ActivationArguments.cs
- DbException.cs
- Model3D.cs
- ISFTagAndGuidCache.cs
- Knowncolors.cs
- DiagnosticTrace.cs
- MultiplexingFormatMapping.cs
- ManagedIStream.cs
- BadImageFormatException.cs
- ClientCultureInfo.cs
- RotateTransform.cs
- WinCategoryAttribute.cs
- TypeSystem.cs
- EditableLabelControl.cs
- CancelRequestedRecord.cs
- SmiMetaDataProperty.cs
- Fx.cs
- ArrayTypeMismatchException.cs
- CompModSwitches.cs
- BitmapEffect.cs
- InputScope.cs
- DbParameterCollectionHelper.cs
- GroupQuery.cs
- StateMachineSubscription.cs
- ApplicationBuildProvider.cs
- ContextMenu.cs
- IInstanceContextProvider.cs
- HyperLinkColumn.cs
- SqlWebEventProvider.cs
- remotingproxy.cs
- ObjectMemberMapping.cs
- CompareInfo.cs
- ProtocolViolationException.cs
- HelpInfo.cs
- PropertyToken.cs
- SqlConnectionPoolGroupProviderInfo.cs
- ProjectedSlot.cs
- StorageBasedPackageProperties.cs
- ClientConfigurationSystem.cs
- HitTestParameters3D.cs
- DataRelationPropertyDescriptor.cs
- SystemResourceHost.cs
- GPPOINT.cs
- CodeCatchClauseCollection.cs
- TreeViewEvent.cs
- OptionalMessageQuery.cs
- TraceProvider.cs
- UInt64.cs
- OperandQuery.cs
- AtomicFile.cs
- SqlCachedBuffer.cs
- PropertyValidationContext.cs
- MessageSmuggler.cs
- IntSecurity.cs
- DataSourceSerializationException.cs
- ToolStripPanel.cs
- _ConnectStream.cs
- InternalPermissions.cs
- WebPartDescriptionCollection.cs
- OutputCacheModule.cs
- SecurityChannelFactory.cs
- LayoutEditorPart.cs
- PauseStoryboard.cs