Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
6002CEM-COUSEWORK-frontend/MauiProgram.cs
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
49 lines (44 sloc)
1.76 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using CouseWork.ConnectorPlugin.Builder; | |
using CouseWork.ConnectorPlugin.ConnectionItem; | |
using CouseWork.ConnectorPlugin.Factory; | |
using CouseWork.ConnectorPlugin.Utils; | |
using CouseWork.Editor; | |
using CouseWork.Mapper; | |
using CouseWork.Service; | |
using CouseWork.ServiceImpl; | |
namespace CouseWork; | |
public static class MauiProgram | |
{ | |
public static AbstractConnector abstractConnector; | |
public static MauiApp CreateMauiApp() | |
{ | |
var builder = MauiApp.CreateBuilder(); | |
builder | |
.UseMauiApp<App>() | |
.ConfigureFonts(fonts => | |
{ | |
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); | |
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); | |
}).BuildService().BuildViewModel(); | |
return builder.Build(); | |
} | |
public static MauiAppBuilder BuildViewModel(this MauiAppBuilder mauiAppBuilder) | |
{ | |
mauiAppBuilder.Services.AddTransient<ModelView.LoginViewModel>(); | |
return mauiAppBuilder; | |
} | |
public static MauiAppBuilder BuildService(this MauiAppBuilder mauiAppBuilder) | |
{ | |
Propertisclass propertisclass= new Propertisclass(); | |
propertisclass.port = "9568"; | |
propertisclass.host = "http://10.0.2.2"; | |
propertisclass.configfile = new string[] { "http://10.0.2.2:9899/register/SavePic/" }; | |
propertisclass.configfile =new string[]{ "token","name","password","type","id" }; | |
ConnectorFactory connectionFactory = new ConnectorFactoryBuilder().Build(propertisclass); | |
ConnectionSession connection = connectionFactory.openSession(); | |
abstractConnector=connection.getMapper<AbstractConnector>(); | |
mauiAppBuilder.Services.AddTransient<LoginService, LoginInterfaceImpl>(); | |
return mauiAppBuilder; | |
} | |
} |