-
Notifications
You must be signed in to change notification settings - Fork 226
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UI redesign; fiction and scimag support
- Loading branch information
1 parent
2149779
commit 2970cbe
Showing
112 changed files
with
7,590 additions
and
1,488 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
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
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
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,47 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace LibgenDesktop.Infrastructure | ||
{ | ||
public class EventProvider | ||
{ | ||
private readonly Queue<ViewModelEvent> eventQueue; | ||
private IEventListener eventListener; | ||
|
||
public EventProvider() | ||
{ | ||
eventQueue = new Queue<ViewModelEvent>(); | ||
eventListener = null; | ||
} | ||
|
||
public void SetEventListener(IEventListener eventListener) | ||
{ | ||
this.eventListener = eventListener; | ||
PassEvents(); | ||
} | ||
|
||
public void RaiseEvent(ViewModelEvent viewModelEvent) | ||
{ | ||
eventQueue.Enqueue(viewModelEvent); | ||
PassEvents(); | ||
} | ||
|
||
public void RaiseEvent(ViewModelEvent.RegisteredEventId eventId) | ||
{ | ||
RaiseEvent(new ViewModelEvent(eventId)); | ||
} | ||
|
||
private void PassEvents() | ||
{ | ||
if (eventListener != null) | ||
{ | ||
while (eventQueue.Any()) | ||
{ | ||
ViewModelEvent viewModelEvent = eventQueue.Dequeue(); | ||
eventListener.OnViewModelEvent(viewModelEvent); | ||
} | ||
} | ||
} | ||
} | ||
} |
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,7 @@ | ||
namespace LibgenDesktop.Infrastructure | ||
{ | ||
public interface IEventListener | ||
{ | ||
void OnViewModelEvent(ViewModelEvent viewModelEvent); | ||
} | ||
} |
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
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
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,11 @@ | ||
namespace LibgenDesktop.Infrastructure | ||
{ | ||
internal class SaveFileDialogParameters | ||
{ | ||
public string DialogTitle { get; set; } | ||
public string Filter { get; set; } | ||
public bool OverwritePrompt { get; set; } | ||
public string InitialDirectory { get; set; } | ||
public string InitialFileName { get; set; } | ||
} | ||
} |
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,8 @@ | ||
namespace LibgenDesktop.Infrastructure | ||
{ | ||
internal class SaveFileDialogResult | ||
{ | ||
public bool DialogResult { get; set; } | ||
public string SelectedFilePath { get; set; } | ||
} | ||
} |
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,17 @@ | ||
namespace LibgenDesktop.Infrastructure | ||
{ | ||
public class ViewModelEvent | ||
{ | ||
public enum RegisteredEventId | ||
{ | ||
FOCUS_SEARCH_TEXT_BOX = 1 | ||
} | ||
|
||
public ViewModelEvent(RegisteredEventId eventId) | ||
{ | ||
EventId = eventId; | ||
} | ||
|
||
public RegisteredEventId EventId { get; } | ||
} | ||
} |
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.