コード例 #1
0
        public async void DeleteFolder()
        {
            if (SelectedFolderInfo == null)
            {
                View.ShowInfo("There is no folder selected to delete.");
                return;
            }

            var folderEditorComponent = new FolderEditorComponent(Store);
            var res = await folderEditorComponent.DeleteModel(SelectedServiceRef.Service, SelectedFolderInfo.FolderId);

            if (res)
            {
                FoldersSelectorComponent.DeleteItem(SelectedFolderWithServiceRef);
            }
        }
コード例 #2
0
        public async void NewFolder()
        {
            var folderEditorComponent = new FolderEditorComponent(Store);
            await folderEditorComponent.NewModel(SelectedServiceRef.Service);

            folderEditorComponent.Model.ParentId        = SelectedFolderInfo?.FolderId;
            folderEditorComponent.Model.ParentFolderDto = SelectedFolderInfo?.GetSimpleDto <FolderDto>();
            var res = folderEditorComponent.RunModal();

            if (res.Entity == EComponentResult.Executed)
            {
                var fs = new FolderWithServiceRef {
                    ServiceRef = SelectedServiceRef, FolderInfo = folderEditorComponent.Model.GetSimpleDto <FolderInfoDto>()
                };
                FoldersSelectorComponent.AddItem(fs);
            }
        }
コード例 #3
0
        public async void EditFolder()
        {
            if (SelectedFolderInfo == null)
            {
                View.ShowInfo("There is no folder selected to edit.");
                return;
            }

            var folderEditorComponent = new FolderEditorComponent(Store);
            await folderEditorComponent.LoadModelById(SelectedServiceRef.Service, SelectedFolderInfo.FolderId, false);

            FoldersSelectorComponent.OldParent = folderEditorComponent.Model.ParentId;
            var res = folderEditorComponent.RunModal();

            if (res.Entity == EComponentResult.Executed)
            {
                SelectedFolderWithServiceRef.FolderInfo = folderEditorComponent.Model.GetSimpleDto <FolderInfoDto>();
                FoldersSelectorComponent.RefreshItem(SelectedFolderWithServiceRef);
            }
        }