コード例 #1
0
        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();
        }