コード例 #1
0
 public Source Add(Source source)
 {
     using (var ctx = new Context())
     {
         var added = ctx.Sources.Add(source);
         ctx.SaveChanges();
         return added.Entity;
     }
 }
コード例 #2
0
 public async Task<StorageFolder> GetStorageFolderFromSourceAsync(Source source)
 {
     var f = _repository.Find(x => x.Path == source.Path);
     var folder = await StorageApplicationPermissions.FutureAccessList.GetFolderAsync(source.Token);
     return folder;
 }
コード例 #3
0
 private async void AddSource()
 {
     var picker = new FolderPicker();
     picker.FileTypeFilter.Add("*");
     picker.ViewMode = PickerViewMode.List;
     var folder = await picker.PickSingleFolderAsync();
     if (folder == null) return;
     var source = new Source
     {
         Path = folder.Path,
         Token = StorageApplicationPermissions.FutureAccessList.Add(folder)
     };
     new SourceService(new SourceRepository()).Add(source);
     GetAllSources();
 }
コード例 #4
0
 public Source Add(Source source)
 {
     return _repository.Add(source);
 }