public ScriptInitializer(string code, RoslynPluginCatalogOptions options)
        {
            if (string.IsNullOrWhiteSpace(code))
            {
                throw new ArgumentOutOfRangeException(nameof(code), code, "Script can not be null or empty");
            }

            _code    = code;
            _options = options;

            _options = options ?? new RoslynPluginCatalogOptions();

            if (_options.TypeNameGenerator is null)
            {
                throw new ArgumentNullException(nameof(_options.TypeNameGenerator));
            }

            if (_options.NamespaceNameGenerator is null)
            {
                throw new ArgumentNullException(nameof(_options.NamespaceNameGenerator));
            }

            if (_options.MethodNameGenerator is null)
            {
                throw new ArgumentNullException(nameof(_options.MethodNameGenerator));
            }
        }
示例#2
0
        public RegularInitializer(string code, RoslynPluginCatalogOptions options)
        {
            if (string.IsNullOrWhiteSpace(code))
            {
                throw new ArgumentOutOfRangeException(nameof(code), code, "Script can not be null or empty");
            }

            _code    = code;
            _options = options ?? new RoslynPluginCatalogOptions();
        }