public void AddProvider(IPDFDataProvider provider) { if (null == provider) { throw new ArgumentNullException("provider"); } foreach (PDFDataProvider prov in this._items) { if (prov.Key == provider.ProviderKey) { prov.SetInstance(provider); return; } } PDFDataProvider toAdd = new PDFDataProvider(provider); _items.Add(toAdd); }
public void RegisterRequiredProvider(string key) { if (string.IsNullOrEmpty(key)) { throw new ArgumentNullException("key"); } foreach (PDFDataProvider prov in this._items) { if (prov.Key == key) { prov.Required = true; return; } } PDFDataProvider toAdd = new PDFDataProvider(key, true); _items.Add(toAdd); }