예제 #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;
 }
 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);
 }