-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix updating original file during image processing [#54], fix global …
…task not being set [#49], sort items by index after image processing, update index for pages
- Loading branch information
Showing
10 changed files
with
420 additions
and
202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Forms; | ||
|
||
namespace Win_CBZ.Events | ||
{ | ||
internal class UpdatePageListViewSortingEvent | ||
{ | ||
public int SortColumn { get; set; } = 1; // sort by index by default | ||
|
||
public SortOrder Order { get; set; } = SortOrder.Ascending; | ||
|
||
public UpdatePageListViewSortingEvent() { } | ||
|
||
public UpdatePageListViewSortingEvent(int column, SortOrder order) | ||
{ | ||
SortColumn = column; | ||
Order = order; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Win_CBZ.Events | ||
{ | ||
class UpdateThumbnailsEvent | ||
{ | ||
public List<Page> Pages { get; set; } | ||
|
||
public UpdateThumbnailsEvent() { } | ||
|
||
public UpdateThumbnailsEvent(List<Page> pages) | ||
{ | ||
this.Pages = pages; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Runtime.Versioning; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Documents; | ||
using System.Windows.Forms; | ||
|
||
namespace Win_CBZ.Extensions | ||
{ | ||
[SupportedOSPlatform("windows")] | ||
public static class ListBoxExtensions | ||
{ | ||
public static void Sort(this ListBox lb, SortOrder order = SortOrder.Ascending) | ||
{ | ||
var list = lb.Items.Cast<Page>().ToArray(); | ||
list = order == SortOrder.Descending | ||
? list.OrderByDescending(x => x.Index).ToArray() | ||
: list.OrderBy(x => x.Index).ToArray(); | ||
lb.Items.Clear(); | ||
lb.Items.AddRange(list); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.