Skip to content
This repository has been archived by the owner on Sep 15, 2023. It is now read-only.

Commit

Permalink
Develop (#12)
Browse files Browse the repository at this point in the history
* Ready to attempt store upload

* Added "favorites" functionality

* Improved quick paste options using new paste method to make it work in more applications.

* New store upload attempt.

* Improved paste action to also work in WPF applications. Modified to use WM_CHAR messages rather than a "paste from clipboard" action.

* Catch unexpected exceptions and hope to live on

* Added item preview

* Updated assembly version and screenshots.

* Update app store project accordingly

* Fixed relative location of preview overlay

* Removed unused imports

* Ignore exceptions when retrieving text from the clipboard

* Changed to computed number of pixels rather than hardcoded

* Update assembly info and readme.md

* Improved hotkey pasting to wait for modifiers to be released (in order to make sure the paste works correctly)

* Added clipboard truncation feature.

* Removed test code

* Release 1.9.0.0
  • Loading branch information
nicolaihenriksen authored Sep 16, 2017
1 parent 70cf734 commit 6666484
Show file tree
Hide file tree
Showing 14 changed files with 162 additions and 41 deletions.
Binary file modified Screenshots/Screenshot2-store.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Screenshots/Screenshot2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified SimpleClipboardManager.Package/_scale-100.appx
Binary file not shown.
Binary file modified SimpleClipboardManager.Package/_scale-125.appx
Binary file not shown.
Binary file modified SimpleClipboardManager.Package/_scale-150.appx
Binary file not shown.
Binary file modified SimpleClipboardManager.Package/_scale-400.appx
Binary file not shown.
2 changes: 1 addition & 1 deletion SimpleClipboardManager.Package/package.appxmanifest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" IgnorableNamespaces="uap rescap mp">
<Identity Name="21227NicolaiHenriksen.SimpleClipboardManager" ProcessorArchitecture="x64" Version="1.8.0.0" Publisher="CN=786B4C61-591E-4C79-AA02-E3FF377CBEB8" />
<Identity Name="21227NicolaiHenriksen.SimpleClipboardManager" ProcessorArchitecture="x64" Version="1.9.0.0" Publisher="CN=786B4C61-591E-4C79-AA02-E3FF377CBEB8" />
<mp:PhoneIdentity PhoneProductId="8192dabb-fcf6-4a62-bba6-799f81dd3851" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>Simple Clipboard Manager</DisplayName>
Expand Down
16 changes: 16 additions & 0 deletions SimpleClipboardManager/ClipboardManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ private void ClipboardNotification_ClipboardUpdated(string text)
return;

ClipboardItems.Insert(0, new ClipboardItem { Text = text });
TruncateClipboardIfNeeded();
SaveClipboard();
}

Expand Down Expand Up @@ -280,6 +281,7 @@ private void LoadClipboard()

public void SaveSettings()
{
TruncateClipboardIfNeeded();
var serializer = new DataContractSerializer(typeof(SettingsModel));
lock (FileAccessLock)
{
Expand All @@ -303,6 +305,20 @@ public void SaveSettings()
}
}

private void TruncateClipboardIfNeeded()
{
var numItemsToRemove = ClipboardItems.Count - Settings.MaxStoredItems;
if (numItemsToRemove <= 0)
return;
var copy = new List<ClipboardItem>(ClipboardItems.Where(ci => ci.Favorite.HasValue == false));
copy.Reverse();
for (int i=0; i<numItemsToRemove; i++)
{
var itemToRemove = copy[i];
ClipboardItems.Remove(itemToRemove);
}
}

private static void SetStartOnBoot()
{
try
Expand Down
2 changes: 1 addition & 1 deletion SimpleClipboardManager/ClipboardManagerContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public ClipboardManagerContext()

private void ShowSettings(object sender, EventArgs e)
{
var dialog = new SettingsDialog(null, _manager.Settings)
var dialog = new SettingsDialog(null, _manager)
{
StartPosition = FormStartPosition.CenterScreen
};
Expand Down
2 changes: 1 addition & 1 deletion SimpleClipboardManager/Dialogs/PasteFromClipboardDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ public void DoPaste()

private void BtnSettings_Click(object sender, EventArgs e)
{
var dialog = new SettingsDialog(this, _manager.Settings);
var dialog = new SettingsDialog(this, _manager);
if (dialog.ShowDialog() == DialogResult.OK)
{
_manager.SaveSettings();
Expand Down
127 changes: 94 additions & 33 deletions SimpleClipboardManager/Dialogs/SettingsDialog.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6666484

Please sign in to comment.