protected void Schedule() { if (!this.isScheduled) { this.isScheduled = true; if (PartialTrustHelpers.ShouldFlowSecurityContext) { this.context = PartialTrustHelpers.CaptureSecurityContextNoIdentityFlow(); } if (this.context == null) { this.ScheduleCallback(ActionItem.CallbackHelper.InvokeWithoutContextCallback); return; } else { this.ScheduleCallback(ActionItem.CallbackHelper.InvokeWithContextCallback); return; } } else { throw Fx.Exception.AsError(new InvalidOperationException(InternalSR.ActionItemIsAlreadyScheduled)); } }
protected void Schedule() { if (isScheduled) { throw Fx.Exception.AsError(new InvalidOperationException(InternalSR.ActionItemIsAlreadyScheduled)); } this.isScheduled = true; #if FEATURE_COMPRESSEDSTACK if (PartialTrustHelpers.ShouldFlowSecurityContext) { this.context = PartialTrustHelpers.CaptureSecurityContextNoIdentityFlow(); } if (this.context != null) { ScheduleCallback(CallbackHelper.InvokeWithContextCallback); } else #endif { ScheduleCallback(CallbackHelper.InvokeWithoutContextCallback); } }