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));
 }
Beispiel #3
0
        private DriveItemModel LoadChildFilesForDrive(DriveItemModel driveItemModel)
        {
            List <string> files = this.FileSystemAccess.GetFiles(driveItemModel.Name);

            driveItemModel.Childs.AddRange(this.FileParser.FilesToFileItemModel(files, driveItemModel));;
            return(driveItemModel);
        }
Beispiel #4
0
        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
     }));
 }
Beispiel #7
0
        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);
        }
Beispiel #8
0
 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
         });
     }
 }
Beispiel #9
0
 /// <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();
 }
Beispiel #10
0
 /// <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"));
 }
Beispiel #12
0
 /// <inheritdoc/>
 public DriveItemModel LoadChildDirectoriesAndFiles(DriveItemModel driveItemModel)
 {
     return(this.BusinessLogic.LoadChildDirectoriesAndFiles(driveItemModel));
 }
Beispiel #13
0
 private void LaunchDriveItemAsync(DriveItemModel driveItem)
 {
     _launcherService.LaunchWebUri(new Uri(driveItem.WebUrl));
 }
Beispiel #14
0
 /// <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;
 }
Beispiel #16
0
 /// <inheritdoc/>
 public DriveItemModel LoadChildDirectoriesAndFiles(DriveItemModel driveItemModel)
 {
     return(this.FileSystemHandler.LoadChildDirectoriesAndFiles(driveItemModel));
 }