INIT
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using DevExpress.DataAccess.Json;
|
||||
using DevExpress.DataAccess.Web;
|
||||
namespace EnvelopeGenerator.ReceiverUI.Services
|
||||
{
|
||||
public class CustomJsonDataConnectionProviderFactory : IJsonDataConnectionProviderFactory {
|
||||
public IJsonDataConnectionProviderService Create() {
|
||||
return new WebDocumentViewerJsonDataConnectionProvider(CustomDataSourceWizardJsonDataConnectionStorage.GetConnections());
|
||||
}
|
||||
}
|
||||
|
||||
public class WebDocumentViewerJsonDataConnectionProvider : IJsonDataConnectionProviderService
|
||||
{
|
||||
readonly List<JsonDataConnection> jsonDataConnections;
|
||||
public WebDocumentViewerJsonDataConnectionProvider(List<JsonDataConnection> jsonDataConnections) {
|
||||
this.jsonDataConnections = jsonDataConnections;
|
||||
}
|
||||
public JsonDataConnection GetJsonDataConnection(string name) {
|
||||
var connection = jsonDataConnections.FirstOrDefault(x => x.Name == name);
|
||||
if(connection == null)
|
||||
throw new InvalidOperationException();
|
||||
return connection;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user