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

더 자세히 ...

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

Public 멤버 함수

 XmlDocAutoLinker (ILibraryStore store)
async Task< int > LinkAsync ()

Private 속성

readonly ILibraryStore _store
readonly string _xmlDocRoot

상세한 설명

wwwroot/xmldocs/{LibraryName}/ 구조를 스캔해서 라이브러리 Name과 일치하는 폴더의 XML 경로를 자동 연결합니다. Directory.Build.targets가 빌드 시 파일을 해당 폴더에 복사합니다.

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

생성자 & 소멸자 문서화

◆ XmlDocAutoLinker()

DreamineWeb.Services.XmlDocAutoLinker.XmlDocAutoLinker ( ILibraryStore store)
inline

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

매개변수
storestore에 사용할 ILibraryStore 값입니다.

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

52 {
53 _store = store;
54 _xmlDocRoot = Path.Combine(AppContext.BaseDirectory, "wwwroot", "xmldocs");
55 }

다음을 참조함 : _store, _xmlDocRoot.

멤버 함수 문서화

◆ LinkAsync()

async Task< int > DreamineWeb.Services.XmlDocAutoLinker.LinkAsync ( )
inline

Link Async 작업을 수행합니다.

반환값
Link Async 작업에서 생성한 Task<int> 결과입니다.

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

74 {
75 if (!Directory.Exists(_xmlDocRoot)) return 0;
76
77 // wwwroot/xmldocs/{LibraryName}/{LibraryName}.xml 구조로 탐색
78 var map = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
79 foreach (var dir in Directory.EnumerateDirectories(_xmlDocRoot))
80 {
81 var libName = Path.GetFileName(dir);
82 var xmlPath = Path.Combine(dir, $"{libName}.xml");
83 if (File.Exists(xmlPath))
84 map[libName] = xmlPath;
85 }
86
87 var libs = (await _store.GetAllAsync()).ToList();
88 int count = 0;
89
90 foreach (var lib in libs)
91 {
92 // 이미 설정된 경우 건너뜀
93 if (!string.IsNullOrEmpty(lib.XmlDocPath) && File.Exists(lib.XmlDocPath)) continue;
94
95 if (map.TryGetValue(lib.Name, out var path))
96 {
97 lib.XmlDocPath = path;
98 await _store.SaveAsync(lib);
99 count++;
100 }
101 }
102
103 return count;
104 }

다음을 참조함 : _store, _xmlDocRoot.

멤버 데이터 문서화

◆ _store

readonly ILibraryStore DreamineWeb.Services.XmlDocAutoLinker._store
private

store 값을 보관합니다.

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

다음에 의해서 참조됨 : LinkAsync(), XmlDocAutoLinker().

◆ _xmlDocRoot

readonly string DreamineWeb.Services.XmlDocAutoLinker._xmlDocRoot
private

xml Doc Root 값을 보관합니다.

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

다음에 의해서 참조됨 : LinkAsync(), XmlDocAutoLinker().


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