예제 #1
0
 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();
        }
예제 #4
0
        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));
        }
예제 #5
0
 public AppDomainHost(Type serviceType, string PermissionSetFileName, string appDomainName, params Uri[] baseAddresses) : this(serviceType, CodeAccessSecurityHelper.PermissionSetFromFile(PermissionSetFileName), appDomainName, baseAddresses)
 {
 }
예제 #6
0
 public AppDomainHost(Type serviceType, StandardPermissionSet standardSet, string appDomainName, params Uri[] baseAddresses) : this(serviceType, CodeAccessSecurityHelper.PermissionSetFromStandardSet(standardSet), appDomainName, baseAddresses)
 {
 }
예제 #7
0
 protected virtual void DemandAsyncPermissions()
 {
     CodeAccessSecurityHelper.DemandAsyncPermissions();
 }