protected IComparable SetTimer(ActivityExecutionContext executionContext, DateTime expiresAt) { #if RUNTIME_DEP TimerEventSubscription te; WorkflowQueue queue; te = new TimerEventSubscription(executionContext.ExecutionContextManager.Workflow.InstanceId, expiresAt); WorkflowQueuingService qService = executionContext.GetService <WorkflowQueuingService> (); queue = qService.CreateWorkflowQueue(te.QueueName, true); queue.QueueItemArrived += OnQueueTimerItemArrived; executionContext.ExecutionContextManager.Workflow.TimerEventSubscriptionCollection.Add(te); return(te.QueueName); #else return(null); #endif }