public UntypedMarkupParser(IUntypedMarkupParserImpl[] pluginImplementers) { int numPluginImplementers = (pluginImplementers != null ? pluginImplementers.Length : 0); parsers = new IUntypedMarkupParserImpl[numPluginImplementers + defaultParsers.Length]; for (int i = 0; i < numPluginImplementers; i++) parsers[i] = pluginImplementers[i]; for (int i = 0; i < defaultParsers.Length; i++) parsers[i + numPluginImplementers] = defaultParsers[i]; }
/// <summary> /// On the server, an easier way to obtain a parser is through the SaltarelleParserFactory class. /// </summary> public SaltarelleParser(INodeProcessor[] pluginNodeProcessors, IDictionary<string, ITypedMarkupParserImpl> pluginTypedMarkupParsers, IUntypedMarkupParserImpl[] pluginUntypedMarkupParsers) { #if CLIENT JsDictionary cfg = JsDictionary.GetDictionary(pluginNodeProcessors); if (!Script.IsNullOrUndefined(cfg) && cfg.ContainsKey("pluginNodeProcessors")) { // We have an [AlternateSignature] constructor which can cause us to be called with a config object instead of real parameters configObject = cfg; return; } #endif docProcessor = new DocumentProcessor(pluginNodeProcessors, new TypedMarkupParser(pluginTypedMarkupParsers), new UntypedMarkupParser(pluginUntypedMarkupParsers)); this.pluginNodeProcessors = pluginNodeProcessors ?? new INodeProcessor[0]; this.pluginTypedMarkupParsers = pluginTypedMarkupParsers ?? new Dictionary<string, ITypedMarkupParserImpl>(); this.pluginUntypedMarkupParsers = pluginUntypedMarkupParsers ?? new IUntypedMarkupParserImpl[0]; }