コード例 #1
0
        /// <summary>
        /// Returns the AppDomain that shall be used to host script execution.
        /// </summary>
        /// <returns></returns>
        private AppDomain GetOrCreateHostingDomain(HostingType hostingType)
        {
            AppDomain domain;

            switch (hostingType)
            {
            case HostingType.GlobalAppDomain:
                Trace.WriteLine($"Script {UniqueId} - executing in global domain");
                domain = this.HostingHelper.GlobalDomain;
                this.m_appDomainDisposable = null;
                return(domain);

            case HostingType.SharedSandboxAppDomain:
                Trace.WriteLine($"Script {UniqueId} - executing in shared domain");
                this.m_appDomainDisposable = null;
                domain = this.HostingHelper.SharedScriptDomain;
                return(domain);

            case HostingType.IndividualScriptAppDomain:
                Trace.WriteLine($"Script {UniqueId} - executing in individual domain");
                domain = this.HostingHelper.IndividualScriptDomain;
                this.m_appDomainDisposable = new DelegateDisposable(() => DisposeDomain(domain));
                return(domain);

            default:
                throw new InvalidOperationException($"Unknown HostingType {hostingType}");
            }
        }
コード例 #2
0
        public IEnumerable <IAuthMethod> GetAuthMethods(HostingType hostingType)
        {
            switch (hostingType)
            {
            case HostingType.WebGeneric:
                return(new List <IAuthMethod>()
                {
                    new OpenIDConnectAuthMethod(),
                    new LDAPAuthMethod(),
                });

            case HostingType.WebGatekeeperProxy:
                return(new List <IAuthMethod>()
                {
                    new GatkeeperProxyAuthMethod(),
                    new OpenIDConnectAuthMethod(),
                    new LDAPAuthMethod(),
                });

            case HostingType.NonWeb:
                return(new List <IAuthMethod>()
                {
                    new LDAPAuthMethod(),
                });

            default:
                throw new NotImplementedException();
            }
        }
コード例 #3
0
 public EnvironmentDefinition(
     AzureEnvironment azureEnvironment,
     HostingType hostingType,
     StandaloneConfiguration standaloneConfiguration)
 {
     _azureEnvironment = azureEnvironment;
     _hostingType = hostingType;
     _standaloneConfiguration = standaloneConfiguration;
 }
コード例 #4
0
 public EnvironmentDefinition(
     AzureEnvironment azureEnvironment,
     HostingType hostingType,
     StandaloneConfiguration standaloneConfiguration)
 {
     _azureEnvironment        = azureEnvironment;
     _hostingType             = hostingType;
     _standaloneConfiguration = standaloneConfiguration;
 }
コード例 #5
0
        public override int GetHashCode()
        {
            unchecked
            {
                int hash = (int)2166136261;

                hash = (hash * 16777619) ^ ReturnType.GetHashCode();
                hash = (hash * 16777619) ^ HostingType.GetHashCode();

                return(hash);
            }
        }
コード例 #6
0
 public override void OnInspectorGUI()
 {
     serializedObject.Update();
     hostingType  = (HostingType)EditorGUILayout.EnumPopup("Hosting Type", hostingType);
     showHostProp = hostingType == HostingType.REMOTE;
     if (showHostProp)
     {
         hostProp.stringValue = EditorGUILayout.TextField("Host", hostProp.stringValue);
     }
     else
     {
         hostProp.stringValue = "localhost";
     }
     portProp.intValue = EditorGUILayout.IntField("Port", portProp.intValue);
     serializedObject.ApplyModifiedProperties();
 }
コード例 #7
0
        public void ReadXml(XmlReader reader)
        {
            reader.MoveToCustomStart();

            this.References = reader.ReadEnumerable <Assembly>(nameof(References), x =>
            {
                string value      = (string)x;
                Assembly assembly = Assembly.Load(value);
                return(assembly);
            }).ToList();

            this.Imports = reader.ReadEnumerable <string>(nameof(Imports), x => (string)x).ToList();

            object _hostingType;

            reader.Read(nameof(HostingType), out _hostingType);
            this.HostingType = (HostingType)_hostingType;

            reader.ReadEndElement();
        }
コード例 #8
0
 public XlScriptOptions(Type ReturnType, HostingType HostingType)
 {
     this.ReturnType  = ReturnType;
     this.HostingType = HostingType;
 }
コード例 #9
0
 public XlScriptOptions()
 {
     this.ReturnType  = typeof(Object);
     this.HostingType = HostingType.SharedSandboxAppDomain;
 }