Dreamine.Web 1.0.0.0
WPF와 Blazor를 한 코드 흐름으로 연결하고 반복적인 MVVM 코드를 줄이는 오픈소스 FullKit 공식 웹 애플리케이션입니다.
로딩중...
검색중...
일치하는것 없음
DreamineWeb.Services.SiteSettingsService 클래스 참조

더 자세히 ...

DreamineWeb.Services.SiteSettingsService에 대한 협력 다이어그램:

Public 멤버 함수

 SiteSettingsService (DreamineOptions opts)
async Task SaveAsync (SiteSettings settings)

속성

SiteSettings Current [get]

정적 Private 멤버 함수

static SiteSettings DefaultFrom (DreamineOptions opts)

Private 속성

SiteSettings _settings
readonly string _filePath

정적 Private 속성

static readonly JsonSerializerOptions _json = new() { WriteIndented = true }

상세한 설명

Site Settings Service 기능과 관련 상태를 캡슐화합니다.

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

생성자 & 소멸자 문서화

◆ SiteSettingsService()

DreamineWeb.Services.SiteSettingsService.SiteSettingsService ( DreamineOptions opts)
inline

지정한 설정으로 SiteSettingsService 클래스의 새 인스턴스를 초기화합니다.

매개변수
optsopts에 사용할 DreamineOptions 값입니다.

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

73 {
74 _filePath = Path.Combine(opts.ResolvedDataPath, "site_settings.json");
75
76 var defaults = DefaultFrom(opts);
77 if (File.Exists(_filePath))
78 {
79 try
80 {
81 var loaded = JsonSerializer.Deserialize<SiteSettings>(File.ReadAllText(_filePath));
82 if (loaded is null)
83 {
84 _settings = defaults;
85 }
86 else
87 {
88 // 저장된 파일에 없는 필드는 기본값으로 채움
89 loaded.OgImageUrl = string.IsNullOrEmpty(loaded.OgImageUrl) ? defaults.OgImageUrl : loaded.OgImageUrl;
90 loaded.OgSiteName = string.IsNullOrEmpty(loaded.OgSiteName) ? defaults.OgSiteName : loaded.OgSiteName;
91 loaded.OgUrl = string.IsNullOrEmpty(loaded.OgUrl) ? defaults.OgUrl : loaded.OgUrl;
92 loaded.TwitterCard = string.IsNullOrEmpty(loaded.TwitterCard) ? defaults.TwitterCard : loaded.TwitterCard;
93 _settings = loaded;
94 }
95 }
96 catch { _settings = defaults; }
97 }
98 else
99 {
100 _settings = defaults;
101 }
102 }

다음을 참조함 : _filePath, _settings, DefaultFrom(), DreamineWeb.Models.DreamineOptions.ResolvedDataPath.

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

멤버 함수 문서화

◆ DefaultFrom()

SiteSettings DreamineWeb.Services.SiteSettingsService.DefaultFrom ( DreamineOptions opts)
inlinestaticprivate

Default From 작업을 수행합니다.

매개변수
optsopts에 사용할 DreamineOptions 값입니다.
반환값
Default From 작업에서 생성한 SiteSettings 결과입니다.

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

159 => new()
160 {
161 Title = opts.SiteTitle,
162 Description = opts.SiteDescription,
163 IconUrl = string.Empty,
164 GitHubUrl = opts.GitHubOrgUrl
165 };

다음을 참조함 : DreamineWeb.Models.DreamineOptions.SiteDescription, DreamineWeb.Models.DreamineOptions.SiteTitle.

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

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

◆ SaveAsync()

async Task DreamineWeb.Services.SiteSettingsService.SaveAsync ( SiteSettings settings)
inline

Async 데이터를 저장합니다.

매개변수
settingssettings에 사용할 SiteSettings 값입니다.
반환값
Save Async 작업에서 생성한 Task 결과입니다.

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

129 {
130 _settings = settings;
131 Directory.CreateDirectory(Path.GetDirectoryName(_filePath)!);
132 await File.WriteAllTextAsync(_filePath, JsonSerializer.Serialize(settings, _json));
133 }

다음을 참조함 : _filePath, _json, _settings.

멤버 데이터 문서화

◆ _filePath

readonly string DreamineWeb.Services.SiteSettingsService._filePath
private

file Path 값을 보관합니다.

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

다음에 의해서 참조됨 : SaveAsync(), SiteSettingsService().

◆ _json

readonly JsonSerializerOptions DreamineWeb.Services.SiteSettingsService._json = new() { WriteIndented = true }
staticprivate

json 값을 보관합니다.

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

44{ WriteIndented = true };

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

◆ _settings

SiteSettings DreamineWeb.Services.SiteSettingsService._settings
private

settings 값을 보관합니다.

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

다음에 의해서 참조됨 : SaveAsync(), SiteSettingsService().

속성 문서화

◆ Current

SiteSettings DreamineWeb.Services.SiteSettingsService.Current
get

Current 값을 가져옵니다.

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


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