public void CreateHost(Type serviceType, Uri[] baseAddresses) { CodeAccessSecurityHelper.PermissionSetFromStandardSet(StandardPermissionSet.FullTrust).Assert(); m_Host = new ServiceHost(serviceType, baseAddresses); PermissionSet.RevertAssert(); m_Host.DemandHostPermissions(); }
protected virtual R Invoke <R>(Func <R> func) { if (IsAsyncCall(func.Method.Name)) { DemandAsyncPermissions(); } DemandSyncPermissions(func.Method.Name); CodeAccessSecurityHelper.PermissionSetFromStandardSet(StandardPermissionSet.FullTrust).Assert(); return(func()); }
protected virtual void Invoke(Action action) { if (IsAsyncCall(action.Method.Name)) { DemandAsyncPermissions(); } DemandSyncPermissions(action.Method.Name); CodeAccessSecurityHelper.PermissionSetFromStandardSet(StandardPermissionSet.FullTrust).Assert(); action(); }
protected object Invoke(string operation, params object[] args) { if (IsAsyncCall(operation)) { DemandAsyncPermissions(); } DemandSyncPermissions(operation); CodeAccessSecurityHelper.PermissionSetFromStandardSet(StandardPermissionSet.FullTrust).Assert(); Type contract = typeof(T); MethodInfo methodInfo = contract.GetMethod(operation); return(methodInfo.Invoke(Channel, args)); }
public AppDomainHost(Type serviceType, string PermissionSetFileName, string appDomainName, params Uri[] baseAddresses) : this(serviceType, CodeAccessSecurityHelper.PermissionSetFromFile(PermissionSetFileName), appDomainName, baseAddresses) { }
public AppDomainHost(Type serviceType, StandardPermissionSet standardSet, string appDomainName, params Uri[] baseAddresses) : this(serviceType, CodeAccessSecurityHelper.PermissionSetFromStandardSet(standardSet), appDomainName, baseAddresses) { }
protected virtual void DemandAsyncPermissions() { CodeAccessSecurityHelper.DemandAsyncPermissions(); }