-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
859 additions
and
565 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 |
---|---|---|
@@ -1,24 +1,28 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<configuration> | ||
<configSections> | ||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > | ||
<section name="MouseNet.Logophi.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> | ||
</sectionGroup> | ||
</configSections> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /> | ||
</startup> | ||
<userSettings> | ||
<MouseNet.Logophi.Properties.Settings> | ||
<setting name="SaveHistory" serializeAs="String"> | ||
<value>True</value> | ||
</setting> | ||
<setting name="MaxHistory" serializeAs="String"> | ||
<value>25</value> | ||
</setting> | ||
<setting name="PersistentCache" serializeAs="String"> | ||
<value>False</value> | ||
</setting> | ||
</MouseNet.Logophi.Properties.Settings> | ||
</userSettings> | ||
<configSections> | ||
<sectionGroup name="userSettings" | ||
type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | ||
<section name="MouseNet.Logophi.Properties.Settings" | ||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" | ||
allowExeDefinition="MachineToLocalUser" requirePermission="false" /> | ||
</sectionGroup> | ||
</configSections> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /> | ||
</startup> | ||
<userSettings> | ||
<MouseNet.Logophi.Properties.Settings> | ||
<setting name="SaveHistory" serializeAs="String"> | ||
<value>True</value> | ||
</setting> | ||
<setting name="MaxHistory" serializeAs="String"> | ||
<value>25</value> | ||
</setting> | ||
<setting name="PersistentCache" serializeAs="String"> | ||
<value>False</value> | ||
</setting> | ||
</MouseNet.Logophi.Properties.Settings> | ||
</userSettings> | ||
</configuration> |
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,75 @@ | ||
using System; | ||
using System.Windows.Forms; | ||
using MouseNet.Logophi.Forms; | ||
using MouseNet.Logophi.Properties; | ||
using MouseNet.Logophi.Views.Presentation; | ||
|
||
namespace MouseNet.Logophi | ||
{ | ||
internal class AppContext : ApplicationContext | ||
{ | ||
private readonly BookmarksFormPresenter | ||
_bookmarksFormPresenter; | ||
|
||
private readonly MainFormPresenter _mainFormPresenter; | ||
private readonly NotifyIcon _trayIcon; | ||
|
||
public AppContext() | ||
{ | ||
Application.ApplicationExit += OnApplicationExit; | ||
_mainFormPresenter = | ||
new MainFormPresenter( | ||
Settings.Default.PersistentCache); | ||
_bookmarksFormPresenter = new BookmarksFormPresenter( | ||
_mainFormPresenter.Thesaurus, | ||
_mainFormPresenter.Search); | ||
var openMenuItem = new ToolStripMenuItem {Text = @"Open"}; | ||
openMenuItem.Click += OnOpen; | ||
var exitMenuItem = new ToolStripMenuItem {Text = @"Exit"}; | ||
exitMenuItem.Click += | ||
(sender, | ||
args) => Application.Exit(); | ||
_trayIcon = new NotifyIcon | ||
{ | ||
Icon = Resources.logophi, | ||
Text = Resources.AppName, | ||
Visible = true, | ||
ContextMenuStrip = new ContextMenuStrip | ||
{ | ||
Items = {openMenuItem, exitMenuItem} | ||
} | ||
}; | ||
_trayIcon.DoubleClick += OnOpen; | ||
} | ||
|
||
private void PresentMainForm() | ||
{ | ||
var form = new MainForm(); | ||
form.ViewBookmarksClicked += OnViewBookmarksClicked; | ||
_mainFormPresenter.Present(form); | ||
} | ||
|
||
private void OnApplicationExit | ||
(object sender, | ||
EventArgs e) | ||
{ | ||
_trayIcon.Visible = false; | ||
_trayIcon.Dispose(); | ||
} | ||
|
||
private void OnOpen | ||
(object sender, | ||
EventArgs e) | ||
{ | ||
PresentMainForm(); | ||
} | ||
|
||
private void OnViewBookmarksClicked | ||
(object sender, | ||
EventArgs e) | ||
{ | ||
var form = new BookmarksForm(); | ||
_bookmarksFormPresenter.Present(form); | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,39 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Windows.Forms; | ||
using MouseNet.Logophi.Views; | ||
|
||
namespace MouseNet.Logophi.Forms | ||
{ | ||
public partial class BookmarksForm : Form, IBookmarksFormView | ||
{ | ||
public BookmarksForm() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
public IList Items => _cBookmarksList.Items; | ||
public event EventHandler<string> BookmarkRemoved; | ||
public event EventHandler<string> BookmarkActivated; | ||
|
||
private void InvokeBookmarkActivated | ||
(object sender, | ||
MouseEventArgs args) | ||
{ | ||
var i = _cBookmarksList.IndexFromPoint(args.Location); | ||
if (i != ListBox.NoMatches) | ||
BookmarkActivated?.Invoke( | ||
this, | ||
(string) _cBookmarksList.Items[i]); | ||
} | ||
|
||
private void InvokeBookmarkRemoved | ||
(object sender, | ||
EventArgs args) | ||
{ | ||
BookmarkRemoved?.Invoke(sender, | ||
_cBookmarksList | ||
.SelectedItem.ToString()); | ||
} | ||
} | ||
} |
File renamed without changes.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.