public async Task <TableModel <T> > GetGroupTableAsync <T>(GroupModel group, DriveItemModel driveItem, string tableName) where T : TableRowModel, new() { return(new TableModel <T> { Columns = await GetGroupTableColumnsAsync(group, driveItem, "PropertyTable") }); }
internal static DriveItemViewModel CreateDriveItemVM (DriveItemModel driveItemModel, IExplorerTreeItemModelViewModelParser explorerTreeItemModelViewModelParser, IConfiguration configuration) { return(new DriveItemViewModel(driveItemModel, explorerTreeItemModelViewModelParser, configuration)); }
private DriveItemModel LoadChildFilesForDrive(DriveItemModel driveItemModel) { List <string> files = this.FileSystemAccess.GetFiles(driveItemModel.Name); driveItemModel.Childs.AddRange(this.FileParser.FilesToFileItemModel(files, driveItemModel));; return(driveItemModel); }
private DriveItemModel LoadChildDirectoriesForDrive(DriveItemModel driveItemModel) { List <string> directories = this.FileSystemAccess.GetDirectories(driveItemModel.Name); driveItemModel.Childs.AddRange(this.DirectoryParser.DirectoriesToDirectoryItemModel(directories, driveItemModel)); return(driveItemModel); }
public async Task <TableRowModel> AddGroupTableRowAsync(GroupModel group, DriveItemModel driveItem, string tableName, TableRowModel tableRow) { return((await PostAsync($"groups/{group.Id}/drive/items/{driveItem.Id}/workbook/tables/{tableName}/rows", new TableRowsModel { Values = new[] { tableRow } })).Values.FirstOrDefault()); }
public Task <TableRowsModel> UpdateGroupTableRowsAsync(GroupModel group, DriveItemModel driveItem, string sheetName, string address, TableRowModel[] tableRows) { return(PatchAsync($"groups/{group.Id}/drive/items/{driveItem.Id}/workbook/worksheets/{sheetName}/range(address='{sheetName}!{address}')", new TableRowsModel { Values = tableRows })); }
public List <DriveItemModel> ParseDrivesToDriveItemModel(List <DriveInfo> drives) { List <DriveItemModel> returnList = new List <DriveItemModel>(); foreach (var drive in drives) { var driveItem = new DriveItemModel(); driveItem.DriveInfo = drive; driveItem.Name = drive.Name; driveItem.DriveType = drive.DriveType; driveItem.IconModel = this.IconModelParser.ParseIconModel(driveItem.IconModel, drive.Name); returnList.Add(driveItem); } return(returnList); }
public static Response <bool> insertItem(DriveItemModel item, string indexName, string dataID) { try { var resp = client.Index <DriveItemModel>(item, x => x.Index(indexName).Id(dataID)); return(new Response <bool>() { Success = resp.IsValid, Message = "Done" }); } catch (Exception ex) { return(new Response <bool>() { Success = false, Message = ex?.Message + " | " + ex?.StackTrace }); } }
/// <summary> /// /// <para> /// Exclusively use <see cref="ExplorerTreeItemViewModelsFactory"/> /// to instantiate this class. /// -> Except for test purposes. /// </para> /// </summary> internal DriveItemViewModel(DriveItemModel driveItemModel, IExplorerTreeItemModelViewModelParser explorerTreeItemModelViewModelParser, IConfiguration configuration) { this.Configuration = configuration; this.ChildTreeItemVMs = new ObservableCollection <AExplorerTreeChildItemViewModel>(); this.DriveType = driveItemModel.DriveType; this.DriveItemModel = driveItemModel; this.ExplorerTreeItemModelViewModelParser = explorerTreeItemModelViewModelParser; this.ExplorerTreeVM = configuration.ExplorerTreeVM; this.FontVM = new FontViewModel(this.Configuration.Drive.Font); this.IsExpanded = false; this.IsSelected = false; this.IconVM = new IconViewModel(this.DriveItemModel.IconModel, this.Configuration.Drive.Icon); this.Name = this.DriveItemModel.Name; this.AddDummyTreeViewItemToBeExpandable(); this.InitVisibilityAccordingToConfiguration(); }
/// <inheritdoc/> public DriveItemModel LoadChildDirectoriesAndFiles(DriveItemModel driveItemModel) { return(this.Data.LoadChildDirectoriesAndFiles(driveItemModel)); }
public Task <TableColumnModel[]> GetGroupTableColumnsAsync(GroupModel group, DriveItemModel driveItem, string tableName) { return(GetManyAsync <TableColumnModel>($"groups/{group.Id}/drive/items/{driveItem.Id}/workbook/tables/{tableName}/columns")); }
/// <inheritdoc/> public DriveItemModel LoadChildDirectoriesAndFiles(DriveItemModel driveItemModel) { return(this.BusinessLogic.LoadChildDirectoriesAndFiles(driveItemModel)); }
private void LaunchDriveItemAsync(DriveItemModel driveItem) { _launcherService.LaunchWebUri(new Uri(driveItem.WebUrl)); }
/// <inheritdoc/> public DriveItemModel LoadChildDirectoriesAndFiles(DriveItemModel driveItemModel) { driveItemModel = this.LoadChildDirectoriesForDrive(driveItemModel); driveItemModel = this.LoadChildFilesForDrive(driveItemModel); return(driveItemModel); }
public FileModel(DriveItemModel driveItem, FileType type) { DriveItem = driveItem; Type = type; }
/// <inheritdoc/> public DriveItemModel LoadChildDirectoriesAndFiles(DriveItemModel driveItemModel) { return(this.FileSystemHandler.LoadChildDirectoriesAndFiles(driveItemModel)); }