private void OnClick(int pos, HistoryBrowseItemHolder.EventAction action)
        {
            switch (action)
            {
            case HistoryBrowseItemHolder.EventAction.OpenFile:
                OpenFileRequested?.Invoke(this, GetItem(pos) as ReceivedFile);
                break;

            case HistoryBrowseItemHolder.EventAction.ShareFile:
                ShareFileRequested?.Invoke(this, GetItem(pos) as ReceivedFile);
                break;

            case HistoryBrowseItemHolder.EventAction.ExpandFolder:
                if (GetItem(pos) as string == "..")
                {
                    GoBack();
                    GoneBack?.Invoke(this, new EventArgs());
                }
                else
                {
                    ExpandFolder(GetItem(pos) as string);
                    FolderExpanded?.Invoke(this, GetItem(pos) as string);
                }
                break;

            default:
                break;
            }
        }
        private async void OnClick(int pos, HistoryItemHolder.EventAction action)
        {
            var item = await historyDataLoader.GetItem(pos);

            switch (action)
            {
            case HistoryItemHolder.EventAction.LaunchUrl:
                UrlLaunchRequested?.Invoke(this, new HistoryListItem(item, pos));
                break;

            case HistoryItemHolder.EventAction.CopyToClipboard:
                CopyToClipboardRequested?.Invoke(this, new HistoryListItem(item, pos));
                break;

            case HistoryItemHolder.EventAction.BrowseFiles:
                BrowseFilesRequested?.Invoke(this, new HistoryListItem(item, pos));
                break;

            case HistoryItemHolder.EventAction.OpenFile:
                OpenFileRequested?.Invoke(this, new HistoryListItem(item, pos));
                break;

            case HistoryItemHolder.EventAction.MoveFiles:
                MoveFilesRequested?.Invoke(this, new HistoryListItem(item, pos));
                break;

            case HistoryItemHolder.EventAction.RemoveItem:
                RemoveItemRequested?.Invoke(this, new HistoryListItem(item, pos));
                break;

            case HistoryItemHolder.EventAction.Share:
                ShareItemRequested?.Invoke(this, new HistoryListItem(item, pos));
                break;

            default:
                break;
            }
        }
Exemple #3
0
 public void OpenFile(string filePath)
 {
     OpenFileRequested?.Invoke(filePath);
 }