Portfolio.Web 1.0.0.0
.NET, Blazor, WPF와 서비스 운영 경험을 프로젝트·이력·기술 스택 단위로 보여주는 개발자 포트폴리오입니다.
로딩중...
검색중...
일치하는것 없음
PortfolioApp.Program 클래스 참조

더 자세히 ...

정적 Public 멤버 함수

static void Main ()

정적 Private 멤버 함수

static int GetInt (IConfiguration cfg, string key, int fallback)
static bool GetBool (IConfiguration cfg, string key, bool fallback)
static string ResolvePath (string? configuredPath, string fallback)

상세한 설명

Program 기능과 관련 상태를 캡슐화합니다.

Program.cs 파일의 23 번째 라인에서 정의되었습니다.

멤버 함수 문서화

◆ GetBool()

bool PortfolioApp.Program.GetBool ( IConfiguration cfg,
string key,
bool fallback )
inlinestaticprivate

Bool 값을 가져옵니다.

매개변수
cfgcfg에 사용할 IConfiguration 값입니다.
keykey에 사용할 string 값입니다.
fallbackfallback에 사용할 bool 값입니다.
반환값
Get Bool 조건이 충족되면 true이고, 그렇지 않으면 false입니다.

Program.cs 파일의 189 번째 라인에서 정의되었습니다.

189 =>
190 bool.TryParse(cfg[key], out bool v) ? v : fallback;

다음에 의해서 참조됨 : Main().

이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ GetInt()

int PortfolioApp.Program.GetInt ( IConfiguration cfg,
string key,
int fallback )
inlinestaticprivate

Int 값을 가져옵니다.

매개변수
cfgcfg에 사용할 IConfiguration 값입니다.
keykey에 사용할 string 값입니다.
fallbackfallback에 사용할 int 값입니다.
반환값
Get Int 작업에서 생성한 int 결과입니다.

Program.cs 파일의 146 번째 라인에서 정의되었습니다.

146 =>
147 int.TryParse(cfg[key], out int v) ? v : fallback;

다음에 의해서 참조됨 : Main().

이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ Main()

void PortfolioApp.Program.Main ( )
inlinestatic

Main 작업을 수행합니다.

Program.cs 파일의 34 번째 라인에서 정의되었습니다.

35 {
36 var builder = Host.CreateApplicationBuilder();
37 builder.Configuration.AddUserSecrets("codemaru-oauth-2ba4e1b2");
38
39 int serverPort = GetInt(builder.Configuration, "PortfolioServer:Port", 7080);
40 bool listenAnyIp = GetBool(builder.Configuration, "PortfolioServer:ListenAnyIp", true);
41 AuthOptions authOptions =
42 builder.Configuration.GetSection(AuthOptions.SectionName).Get<AuthOptions>() ?? new AuthOptions();
43 string usersDbPath = ResolvePath(
44 builder.Configuration[$"{AuthOptions.SectionName}:UsersDbPath"],
45 Path.Combine(AppContext.BaseDirectory, "App_Data", "codemaru.db"));
46
47 builder.Services.AddDreamineHybridWpf();
48 builder.Services.AddDreamineIdentityWpfHost();
49
50 var opts = PortfolioOptions.From(builder.Configuration);
51 builder.Services.AddSingleton(opts);
52 builder.Services.AddSingleton<IPortfolioTenantStore, JsonPortfolioTenantStore>();
53 builder.Services.AddSingleton<IProjectStore, JsonProjectStore>();
54 builder.Services.AddSingleton<IResumeStore, JsonResumeStore>();
55 builder.Services.AddSingleton<IContactStore, JsonContactStore>();
56 builder.Services.AddSingleton<IMediaService, LocalMediaService>();
57
58 builder.Services.AddSingleton<Views.MainWindow>();
59 builder.Services.AddHostedService<GhostAccountCleanupService>();
60
61 builder.Services.AddDreamineBlazorServer<AppShell>(options =>
62 {
63 options.Port = serverPort;
64 options.ListenAnyIp = listenAnyIp;
65 options.SharedServiceTypes.Add(typeof(PortfolioOptions));
66 options.SharedServiceTypes.Add(typeof(IPortfolioTenantStore));
67 options.SharedServiceTypes.Add(typeof(IProjectStore));
68 options.SharedServiceTypes.Add(typeof(IResumeStore));
69 options.SharedServiceTypes.Add(typeof(IContactStore));
70 options.SharedServiceTypes.Add(typeof(IMediaService));
71 options.AddPhysicalStaticFiles(opts.ResolvedDataPath, "/portfolio-data");
72
73 options.ConfigureServices = services =>
74 {
75 services.AddServerSideBlazor().AddHubOptions(o =>
76 {
77 o.MaximumReceiveMessageSize = null;
78 o.ClientTimeoutInterval = TimeSpan.FromMinutes(10);
79 o.HandshakeTimeout = TimeSpan.FromMinutes(2);
80 o.KeepAliveInterval = TimeSpan.FromSeconds(10);
81 });
82
83 services.AddAntiforgery(o =>
84 {
85 o.Cookie.SameSite = Microsoft.AspNetCore.Http.SameSiteMode.Lax;
86 o.Cookie.SecurePolicy = Microsoft.AspNetCore.Http.CookieSecurePolicy.SameAsRequest;
87 });
88
89 services.Configure<CircuitOptions>(o =>
90 {
91 o.DisconnectedCircuitMaxRetained = 100;
92 o.DisconnectedCircuitRetentionPeriod = TimeSpan.FromMinutes(3);
93 o.JSInteropDefaultCallTimeout = TimeSpan.FromMinutes(1);
94 o.MaxBufferedUnacknowledgedRenderBatches = 10;
95 });
96
97 services.AddScoped<PortfolioUserContext>();
98 };
99
100 options.AddDreamineIdentity(authOptions, usersDbPath);
101 });
102
103 builder.Build().RunDreamineWpfApp<App>();
104 }

다음을 참조함 : PortfolioApp.Services.PortfolioOptions.From(), GetBool(), GetInt(), ResolvePath().

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ ResolvePath()

string PortfolioApp.Program.ResolvePath ( string? configuredPath,
string fallback )
inlinestaticprivate

Resolve Path 작업을 수행합니다.

매개변수
configuredPathconfigured Path에 사용할 string? 값입니다.
fallbackfallback에 사용할 string 값입니다.
반환값
Resolve Path 작업에서 생성한 string 결과입니다.

Program.cs 파일의 224 번째 라인에서 정의되었습니다.

225 {
226 if (string.IsNullOrWhiteSpace(configuredPath))
227 {
228 return fallback;
229 }
230
231 return Path.IsPathRooted(configuredPath)
232 ? configuredPath
233 : Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, configuredPath));
234 }

다음에 의해서 참조됨 : Main().

이 함수를 호출하는 함수들에 대한 그래프입니다.:

이 클래스에 대한 문서화 페이지는 다음의 파일로부터 생성되었습니다.: