fix(WebUI.Client.Services): resolve doc comment icons
This commit is contained in:
@@ -12,7 +12,7 @@ namespace EnvelopeGenerator.WebUI.Client.Services;
|
||||
/// During development, <c>BaseUrl</c> is empty so the request resolves to the
|
||||
/// YARP-proxied route on the same origin, which currently serves
|
||||
/// <c>fake-data/annotations.json</c>. To switch to real data, update the
|
||||
/// YARP route in <c>yarp.json</c> – no code change required.
|
||||
/// YARP route in <c>yarp.json</c> — no code change required.
|
||||
/// </summary>
|
||||
[Obsolete("Use SignatureService.")]
|
||||
public class AnnotationService(HttpClient http, IOptions<ApiOptions> apiOptions)
|
||||
|
||||
@@ -1,40 +1,39 @@
|
||||
using DevExpress.DataAccess.Json;
|
||||
using DevExpress.DataAccess.Json;
|
||||
using DevExpress.DataAccess.Web;
|
||||
using DevExpress.DataAccess.Wizard.Services;
|
||||
|
||||
namespace EnvelopeGenerator.WebUI.Client.Services
|
||||
namespace EnvelopeGenerator.WebUI.Client.Services;
|
||||
|
||||
public class CustomDataSourceWizardJsonDataConnectionStorage : IDataSourceWizardJsonConnectionStorage
|
||||
{
|
||||
public class CustomDataSourceWizardJsonDataConnectionStorage : IDataSourceWizardJsonConnectionStorage
|
||||
{
|
||||
public static JsonDataConnection GetDefaultConnection() {
|
||||
var uriJsonSource = new UriJsonSource() {
|
||||
Uri = new Uri(@"https://raw.githubusercontent.com/DevExpress-Examples/DataSources/master/JSON/customers.json"),
|
||||
};
|
||||
return new JsonDataConnection(uriJsonSource) { StoreConnectionNameOnly = true, Name = "NWindProductsJson" };
|
||||
}
|
||||
public static List<JsonDataConnection> GetConnections() {
|
||||
var connections = new List<JsonDataConnection> {
|
||||
GetDefaultConnection()
|
||||
};
|
||||
return connections;
|
||||
}
|
||||
|
||||
bool IJsonConnectionStorageService.CanSaveConnection => false;
|
||||
bool IJsonConnectionStorageService.ContainsConnection(string connectionName) {
|
||||
return GetConnections().Any(x => x.Name == connectionName);
|
||||
}
|
||||
|
||||
IEnumerable<JsonDataConnection> IJsonConnectionStorageService.GetConnections() {
|
||||
return GetConnections();
|
||||
}
|
||||
|
||||
JsonDataConnection IJsonDataConnectionProviderService.GetJsonDataConnection(string name) {
|
||||
var connection = GetConnections().FirstOrDefault(x => x.Name == name);
|
||||
if(connection == null)
|
||||
throw new InvalidOperationException();
|
||||
return connection;
|
||||
}
|
||||
|
||||
void IJsonConnectionStorageService.SaveConnection(string connectionName, JsonDataConnection connection, bool saveCredentials) { }
|
||||
public static JsonDataConnection GetDefaultConnection() {
|
||||
var uriJsonSource = new UriJsonSource() {
|
||||
Uri = new Uri(@"https://raw.githubusercontent.com/DevExpress-Examples/DataSources/master/JSON/customers.json"),
|
||||
};
|
||||
return new JsonDataConnection(uriJsonSource) { StoreConnectionNameOnly = true, Name = "NWindProductsJson" };
|
||||
}
|
||||
}
|
||||
public static List<JsonDataConnection> GetConnections() {
|
||||
var connections = new List<JsonDataConnection> {
|
||||
GetDefaultConnection()
|
||||
};
|
||||
return connections;
|
||||
}
|
||||
|
||||
bool IJsonConnectionStorageService.CanSaveConnection => false;
|
||||
bool IJsonConnectionStorageService.ContainsConnection(string connectionName) {
|
||||
return GetConnections().Any(x => x.Name == connectionName);
|
||||
}
|
||||
|
||||
IEnumerable<JsonDataConnection> IJsonConnectionStorageService.GetConnections() {
|
||||
return GetConnections();
|
||||
}
|
||||
|
||||
JsonDataConnection IJsonDataConnectionProviderService.GetJsonDataConnection(string name) {
|
||||
var connection = GetConnections().FirstOrDefault(x => x.Name == name);
|
||||
if(connection == null)
|
||||
throw new InvalidOperationException();
|
||||
return connection;
|
||||
}
|
||||
|
||||
void IJsonConnectionStorageService.SaveConnection(string connectionName, JsonDataConnection connection, bool saveCredentials) { }
|
||||
}
|
||||
@@ -1,24 +1,23 @@
|
||||
using DevExpress.DataAccess.Json;
|
||||
using DevExpress.DataAccess.Json;
|
||||
using DevExpress.DataAccess.Web;
|
||||
namespace EnvelopeGenerator.WebUI.Client.Services
|
||||
{
|
||||
public class CustomJsonDataConnectionProviderFactory : IJsonDataConnectionProviderFactory {
|
||||
public IJsonDataConnectionProviderService Create() {
|
||||
return new WebDocumentViewerJsonDataConnectionProvider(CustomDataSourceWizardJsonDataConnectionStorage.GetConnections());
|
||||
}
|
||||
}
|
||||
namespace EnvelopeGenerator.WebUI.Client.Services;
|
||||
|
||||
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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,20 @@
|
||||
using DevExpress.XtraReports.UI;
|
||||
using DevExpress.XtraReports.UI;
|
||||
using DevExpress.XtraReports.Services;
|
||||
using EnvelopeGenerator.WebUI.Client.PredefinedReports;
|
||||
|
||||
namespace EnvelopeGenerator.WebUI.Client.Services
|
||||
{
|
||||
public class CustomReportProvider : IReportProviderAsync {
|
||||
private readonly InMemoryReportStorageWebExtension reportStorage;
|
||||
namespace EnvelopeGenerator.WebUI.Client.Services;
|
||||
|
||||
public CustomReportProvider(InMemoryReportStorageWebExtension reportStorage) {
|
||||
this.reportStorage = reportStorage;
|
||||
}
|
||||
public class CustomReportProvider : IReportProviderAsync {
|
||||
private readonly InMemoryReportStorageWebExtension reportStorage;
|
||||
|
||||
public Task<XtraReport> GetReportAsync(string id, ReportProviderContext context) {
|
||||
if(reportStorage.TryGetReport(id, out var savedReport))
|
||||
return Task.FromResult(savedReport);
|
||||
|
||||
return Task.FromResult(ReportsFactory.GetReport(id));
|
||||
}
|
||||
public CustomReportProvider(InMemoryReportStorageWebExtension reportStorage) {
|
||||
this.reportStorage = reportStorage;
|
||||
}
|
||||
}
|
||||
|
||||
public Task<XtraReport> GetReportAsync(string id, ReportProviderContext context) {
|
||||
if(reportStorage.TryGetReport(id, out var savedReport))
|
||||
return Task.FromResult(savedReport);
|
||||
|
||||
return Task.FromResult(ReportsFactory.GetReport(id));
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
using DevExpress.Drawing;
|
||||
using DevExpress.Drawing;
|
||||
|
||||
namespace EnvelopeGenerator.WebUI.Client.Services {
|
||||
public static class FontLoader {
|
||||
public async static Task LoadFonts(HttpClient httpClient, List<string> fontNames) {
|
||||
foreach(var fontName in fontNames) {
|
||||
var fontBytes = await httpClient.GetByteArrayAsync($"fonts/{fontName}");
|
||||
DXFontRepository.Instance.AddFont(fontBytes);
|
||||
}
|
||||
namespace EnvelopeGenerator.WebUI.Client.Services;
|
||||
|
||||
public static class FontLoader {
|
||||
public async static Task LoadFonts(HttpClient httpClient, List<string> fontNames) {
|
||||
foreach(var fontName in fontNames) {
|
||||
var fontBytes = await httpClient.GetByteArrayAsync($"fonts/{fontName}");
|
||||
DXFontRepository.Instance.AddFont(fontBytes);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
using DevExpress.DataAccess.Web;
|
||||
using DevExpress.DataAccess.Web;
|
||||
|
||||
namespace EnvelopeGenerator.WebUI.Client.Services {
|
||||
public class ObjectDataSourceWizardCustomTypeProvider : IObjectDataSourceWizardTypeProvider {
|
||||
public IEnumerable<Type> GetAvailableTypes(string context) {
|
||||
return new[] { typeof(Data.DataItemList) };
|
||||
}
|
||||
namespace EnvelopeGenerator.WebUI.Client.Services;
|
||||
|
||||
public class ObjectDataSourceWizardCustomTypeProvider : IObjectDataSourceWizardTypeProvider {
|
||||
public IEnumerable<Type> GetAvailableTypes(string context) {
|
||||
return new[] { typeof(Data.DataItemList) };
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user