Пример #1
0
        private void InitCtrlSorting(
            ToolStripMenuItem reverseByIndex,
            ToolStripMenuItem sortBySpeed,
            ToolStripMenuItem sortByDate,
            ToolStripMenuItem sortBySummary,
            ToolStripMenuItem sortByDownloadTotal,
            ToolStripMenuItem sortByUploadTotal)
        {
            sortByDownloadTotal.Click += RunWhenSelectionIsNotEmptyHandler(
                () => servers.SortSelectedByDownloadTotal());

            sortByUploadTotal.Click += RunWhenSelectionIsNotEmptyHandler(
                () => servers.SortSelectedByUploadTotal());

            reverseByIndex.Click += RunWhenSelectionIsNotEmptyHandler(
                () => servers.ReverseSelectedByIndex());

            sortByDate.Click += RunWhenSelectionIsNotEmptyHandler(
                () => servers.SortSelectedByLastModifiedDate());

            sortBySummary.Click += RunWhenSelectionIsNotEmptyHandler(
                () => servers.SortSelectedBySummary());

            sortBySpeed.Click += RunWhenSelectionIsNotEmptyHandler(
                () => servers.SortSelectedBySpeedTest());
        }