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
- Decorator.cs
- DataGridTextBoxColumn.cs
- _NegoState.cs
- ContextMenu.cs
- SocketPermission.cs
- Style.cs
- QilDataSource.cs
- SetIndexBinder.cs
- XmlSchemaGroupRef.cs
- ProviderConnectionPointCollection.cs
- DocumentCollection.cs
- AliasExpr.cs
- SendMailErrorEventArgs.cs
- ADConnectionHelper.cs
- ThreadPool.cs
- InternalsVisibleToAttribute.cs
- FtpWebRequest.cs
- ByteRangeDownloader.cs
- TextDpi.cs
- SafeEventLogWriteHandle.cs
- SimpleMailWebEventProvider.cs
- TextSerializer.cs
- TemplateKey.cs
- BamlTreeNode.cs
- ToolStripItemImageRenderEventArgs.cs
- ProxyElement.cs
- AdornerPresentationContext.cs
- ProvidersHelper.cs
- _BaseOverlappedAsyncResult.cs
- DynamicActivity.cs
- BinHexDecoder.cs
- DropShadowBitmapEffect.cs
- AppDomainAttributes.cs
- ToolStripSplitStackLayout.cs
- DependencyPropertyAttribute.cs
- RotateTransform.cs
- Queue.cs
- InputLangChangeEvent.cs
- RowVisual.cs
- FlowLayout.cs
- Misc.cs
- MachineKeyValidationConverter.cs
- ServerValidateEventArgs.cs
- Condition.cs
- AssemblyFilter.cs
- HotCommands.cs
- ProfileInfo.cs
- FederatedMessageSecurityOverHttpElement.cs
- Panel.cs
- ArrayList.cs
- DispatcherObject.cs
- TranslateTransform3D.cs
- MinimizableAttributeTypeConverter.cs
- UpdateTranslator.cs
- RelationshipConstraintValidator.cs
- OdbcError.cs
- InternalPolicyElement.cs
- ApplyImportsAction.cs
- PKCS1MaskGenerationMethod.cs
- LassoSelectionBehavior.cs
- XmlSchemaComplexContent.cs
- httpserverutility.cs
- DataErrorValidationRule.cs
- PropertyChangingEventArgs.cs
- SchemaEntity.cs
- mongolianshape.cs
- Image.cs
- ValidationPropertyAttribute.cs
- MouseBinding.cs
- RSAOAEPKeyExchangeFormatter.cs
- AvTraceDetails.cs
- StylusCaptureWithinProperty.cs
- MethodMessage.cs
- StreamAsIStream.cs
- OleDbEnumerator.cs
- UnconditionalPolicy.cs
- SystemBrushes.cs
- HtmlTernaryTree.cs
- DbModificationCommandTree.cs
- TextTreeNode.cs
- TabItemWrapperAutomationPeer.cs
- Int32RectConverter.cs
- HttpProfileGroupBase.cs
- BitmapEffectGroup.cs
- HandlerFactoryWrapper.cs
- Attributes.cs
- AdapterDictionary.cs
- TraceProvider.cs
- ReachIDocumentPaginatorSerializerAsync.cs
- path.cs
- XmlConvert.cs
- TimeSpanValidatorAttribute.cs
- XsdDuration.cs
- FlowDocumentReaderAutomationPeer.cs
- AssociatedControlConverter.cs
- ControlValuePropertyAttribute.cs
- FontFamilyValueSerializer.cs
- WCFServiceClientProxyGenerator.cs
- ExpandCollapsePattern.cs
- ReliableOutputSessionChannel.cs