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)); } }
internal static bool IsTypeAptca(Type type) { Assembly assembly = type.Assembly; if (PartialTrustHelpers.IsAssemblyAptca(assembly)) { return(true); } else { return(!PartialTrustHelpers.IsAssemblySigned(assembly)); } }
internal static bool IsInFullTrust() { bool flag; if (SecurityManager.CurrentThreadRequiresSecurityContextCapture()) { try { PartialTrustHelpers.DemandForFullTrust(); flag = true; } catch (SecurityException securityException) { flag = false; } return(flag); } else { return(true); } }
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); } }
internal static bool HasEtwPermissions() { PermissionSet permissionSets = new PermissionSet(PermissionState.Unrestricted); return(PartialTrustHelpers.CheckAppDomainPermissions(permissionSets)); }