├── .gitattributes
├── .gitignore
├── icon.png
├── images
├── clippy_in_action.png
├── inplace_refactoring.gif
└── unit_tests.gif
├── install
└── resharper-clippy.nuspec
├── lib
├── DoubleAgent-01-expose_character_window.patch
├── DoubleAgent-02-show_not_activate.patch
├── DoubleAgent.Control.dll
├── x64
│ ├── Debug
│ │ ├── DaControl.dll
│ │ ├── DaControl.pdb
│ │ ├── DaCore.dll
│ │ └── DaCore.pdb
│ └── Release
│ │ ├── DaControl.dll
│ │ └── DaCore.dll
└── x86
│ ├── Debug
│ ├── DaControl.dll
│ ├── DaControl.pdb
│ ├── DaCore.dll
│ └── DaCore.pdb
│ └── Release
│ ├── DaControl.dll
│ └── DaCore.dll
├── license.txt
├── readme.md
├── src
├── .idea
│ └── .idea.resharper-clippy
│ │ └── .idea
│ │ ├── .gitignore
│ │ ├── .name
│ │ ├── encodings.xml
│ │ ├── indexLayout.xml
│ │ ├── runConfigurations
│ │ └── VisualStudio.xml
│ │ └── vcs.xml
├── Directory.Build.props
├── Plugin.props
├── TestHarness
│ ├── App.config
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── MainWindow.xaml
│ ├── MainWindow.xaml.cs
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ └── TestHarness.csproj
├── resharper-clippy.sln
├── resharper-clippy.sln.DotSettings
├── resharper-clippy
│ ├── AgentFiles.proj
│ ├── DoubleAgent.x64.sxs.manifest
│ ├── DoubleAgent.x86.sxs.manifest
│ ├── readme.md
│ ├── resharper-clippy.csproj
│ └── src
│ │ ├── AgentApi
│ │ ├── Agent.cs
│ │ ├── AgentCharacter.cs
│ │ ├── AgentManager.cs
│ │ ├── Balloon
│ │ │ ├── BalloonActionEventArgs.cs
│ │ │ ├── BalloonStyles.xaml
│ │ │ ├── BalloonWindow.xaml
│ │ │ ├── BalloonWindow.xaml.cs
│ │ │ ├── BalloonWindowHost.cs
│ │ │ ├── Commands.cs
│ │ │ ├── CustomChromeForm.cs
│ │ │ ├── DefaultStyles.xaml
│ │ │ ├── Indexed.cs
│ │ │ └── JustifiedUniformGrid.cs
│ │ ├── BalloonManager.cs
│ │ ├── BalloonOption.cs
│ │ ├── ICharacterEvents.cs
│ │ ├── IUntypedSignalEx.cs
│ │ ├── IWin32WindowEx.cs
│ │ ├── OleWin32Window.cs
│ │ └── SxS
│ │ │ └── ActivationContext.cs
│ │ ├── AgentClickHandler.cs
│ │ ├── AltEnterHandler.cs
│ │ ├── BuildAnimations.cs
│ │ ├── ClippySettings.cs
│ │ ├── HighlightingTracker.cs
│ │ ├── InplaceRefactoringHandler.cs
│ │ ├── OverriddenActions
│ │ ├── AgentExtensibleAction.cs
│ │ ├── FileTemplatesGenerateAction.cs
│ │ ├── GenerateAction.cs
│ │ ├── GotoRecentFilesAction.cs
│ │ ├── IOriginalActionHandler.cs
│ │ ├── InspectThisAction.cs
│ │ ├── NavigateFromHereAction.cs
│ │ └── RefactorThisAction.cs
│ │ ├── OverridingActionRegistrar.cs
│ │ ├── SaveAnimations.cs
│ │ ├── SolutionVisibilityScope.cs
│ │ ├── UnitTestAnimations.cs
│ │ └── ZoneMarker.cs
├── runVisualStudio.ps1
└── settings.ps1
└── tools
├── nuget.exe
└── vswhere.exe
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 | *.sln merge=union
7 | *.csproj merge=union
8 | *.vbproj merge=union
9 | *.fsproj merge=union
10 | *.dbproj merge=union
11 |
12 | # Standard to msysgit
13 | *.doc diff=astextplain
14 | *.DOC diff=astextplain
15 | *.docx diff=astextplain
16 | *.DOCX diff=astextplain
17 | *.dot diff=astextplain
18 | *.DOT diff=astextplain
19 | *.pdf diff=astextplain
20 | *.PDF diff=astextplain
21 | *.rtf diff=astextplain
22 | *.RTF diff=astextplain
23 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | install/*.nupkg
2 | src/output/*.nupkg
3 |
4 | *.log
5 |
6 | # Include the custom builds of the DoubleAgent dll, don't include the character file(s)
7 | !lib/
8 | lib/*.acs
9 |
10 | # User-specific files
11 | *.suo
12 | *.user
13 | *.sln.docstates
14 |
15 | build/
16 | [Bb]in/
17 | [Oo]bj/
18 | .vs/
19 |
20 | Thumbs.db
21 | Desktop.ini
22 | .DS_Store
23 |
24 |
--------------------------------------------------------------------------------
/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/citizenmatt/resharper-clippy/5df79e8c51d038941605283cd596861a4c44427d/icon.png
--------------------------------------------------------------------------------
/images/clippy_in_action.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/citizenmatt/resharper-clippy/5df79e8c51d038941605283cd596861a4c44427d/images/clippy_in_action.png
--------------------------------------------------------------------------------
/images/inplace_refactoring.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/citizenmatt/resharper-clippy/5df79e8c51d038941605283cd596861a4c44427d/images/inplace_refactoring.gif
--------------------------------------------------------------------------------
/images/unit_tests.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/citizenmatt/resharper-clippy/5df79e8c51d038941605283cd596861a4c44427d/images/unit_tests.gif
--------------------------------------------------------------------------------
/install/resharper-clippy.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CitizenMatt.Clippy
5 | Clippy for ReSharper
6 | 1.2.0
7 | Matt Ellis
8 | Matt Ellis
9 | A digital assistant to help you with all your ReSharper needs!
10 | • Updated for ReSharper 10
11 | http://github.com/citizenmatt/resharper-clippy
12 | http://raw.github.com/citizenmatt/resharper-clippy/master/icon.png
13 | Copyright 2015 Matt Ellis
14 | false
15 |
16 |
17 |
18 | resharper clippy
19 |
20 |
21 |
23 |
25 |
27 |
29 |
31 |
33 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/lib/DoubleAgent-01-expose_character_window.patch:
--------------------------------------------------------------------------------
1 | Index: DaCtlCharacter.cpp
2 | ===================================================================
3 | --- DaCtlCharacter.cpp (revision 497)
4 | +++ DaCtlCharacter.cpp (working copy)
5 | @@ -5407,3 +5407,25 @@
6 | #endif
7 | return lResult;
8 | }
9 | +
10 | +HRESULT STDMETHODCALLTYPE DaCtlCharacter::GetWindow(HWND *phwnd)
11 | +{
12 | + if (!phwnd) return E_POINTER;
13 | + *phwnd = NULL;
14 | +
15 | + if (mLocalObject)
16 | + {
17 | + CAgentCharacterWnd* agentCharacterWnd = mLocalObject->GetCharacterWnd();
18 | + if (agentCharacterWnd)
19 | + {
20 | + *phwnd = (HWND) *agentCharacterWnd;
21 | + return S_OK;
22 | + }
23 | + }
24 | + return S_FALSE;
25 | +}
26 | +
27 | +HRESULT STDMETHODCALLTYPE DaCtlCharacter::ContextSensitiveHelp(BOOL fEnterMode)
28 | +{
29 | + return E_NOTIMPL;
30 | +}
31 | \ No newline at end of file
32 | Index: DaCtlCharacter.h
33 | ===================================================================
34 | --- DaCtlCharacter.h (revision 497)
35 | +++ DaCtlCharacter.h (working copy)
36 | @@ -30,6 +30,7 @@
37 | public CComCoClass,
38 | public IDispatchImpl,
39 | public IProvideClassInfoImpl<&__uuidof(DaCtlCharacter), &__uuidof(DoubleAgentCtl_TypeLib), DoubleAgentCtl_MajorVer, DoubleAgentCtl_MinorVer>,
40 | + public IOleWindow,
41 | public ISupportErrorInfo
42 | {
43 | public:
44 | @@ -77,6 +78,7 @@
45 | COM_INTERFACE_ENTRY_IID(__uuidof(IAgentCtlCharacterEx), IDaCtlCharacter2)
46 | COM_INTERFACE_ENTRY(ISupportErrorInfo)
47 | COM_INTERFACE_ENTRY(IProvideClassInfo)
48 | + COM_INTERFACE_ENTRY(IOleWindow)
49 | END_COM_MAP()
50 |
51 | BEGIN_CATEGORY_MAP(DaCtlCharacter)
52 | @@ -199,6 +201,10 @@
53 | HRESULT STDMETHODCALLTYPE get_SuspendHide (VARIANT_BOOL *Enabled);
54 | HRESULT STDMETHODCALLTYPE SetSize (short Width, short Height);
55 |
56 | + // IOleWindow
57 | + HRESULT STDMETHODCALLTYPE GetWindow(HWND *phwnd);
58 | + HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(BOOL fEnterMode);
59 | +
60 | // Implementation
61 | public:
62 | IDispatchPtr mBalloon;
63 |
--------------------------------------------------------------------------------
/lib/DoubleAgent-02-show_not_activate.patch:
--------------------------------------------------------------------------------
1 | Index: Control/DaCtlCharacters.cpp
2 | ===================================================================
3 | --- Control/DaCtlCharacters.cpp (revision 497)
4 | +++ Control/DaCtlCharacters.cpp (working copy)
5 | @@ -559,7 +559,7 @@
6 | && (SUCCEEDED (lResult = CComObject ::CreateInstance (lCharacter.Free())))
7 | && (SUCCEEDED (lResult = lCharacter->SetOwner (mOwner)))
8 | && (SUCCEEDED (lResult = lCharacter->mLocalObject->OpenFile (lAgentFile, lFilePathIsDefault)))
9 | - && (SUCCEEDED (lResult = lCharacter->mLocalObject->RealizePopup (mOwner, mOwner->mLocalCharacterStyle, WS_EX_TOPMOST)))
10 | + && (SUCCEEDED (lResult = lCharacter->mLocalObject->RealizePopup (mOwner, mOwner->mLocalCharacterStyle, 0)))
11 | )
12 | {
13 | if (lLoadFile == lAgentFile)
14 | Index: Control/LocalCharacter.cpp
15 | ===================================================================
16 | --- Control/LocalCharacter.cpp (revision 497)
17 | +++ Control/LocalCharacter.cpp (working copy)
18 | @@ -230,7 +230,7 @@
19 | && (lPopupWnd = GetPopupWnd (false))
20 | )
21 | {
22 | - lPopupWnd->ShowWindow (SW_SHOW);
23 | + lPopupWnd->ShowWindow (SW_SHOWNA);
24 | }
25 |
26 | if (
27 | Index: Core/AgentPopupWnd.cpp
28 | ===================================================================
29 | --- Core/AgentPopupWnd.cpp (revision 497)
30 | +++ Core/AgentPopupWnd.cpp (working copy)
31 | @@ -554,7 +554,7 @@
32 | UpdateNotifyIcon ();
33 | if (pLastActive)
34 | {
35 | - BringWindowToTop ();
36 | + SetWindowPos(HWND_TOP, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW | SWP_NOOWNERZORDER);
37 | }
38 | }
39 |
40 |
--------------------------------------------------------------------------------
/lib/DoubleAgent.Control.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/citizenmatt/resharper-clippy/5df79e8c51d038941605283cd596861a4c44427d/lib/DoubleAgent.Control.dll
--------------------------------------------------------------------------------
/lib/x64/Debug/DaControl.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/citizenmatt/resharper-clippy/5df79e8c51d038941605283cd596861a4c44427d/lib/x64/Debug/DaControl.dll
--------------------------------------------------------------------------------
/lib/x64/Debug/DaControl.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/citizenmatt/resharper-clippy/5df79e8c51d038941605283cd596861a4c44427d/lib/x64/Debug/DaControl.pdb
--------------------------------------------------------------------------------
/lib/x64/Debug/DaCore.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/citizenmatt/resharper-clippy/5df79e8c51d038941605283cd596861a4c44427d/lib/x64/Debug/DaCore.dll
--------------------------------------------------------------------------------
/lib/x64/Debug/DaCore.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/citizenmatt/resharper-clippy/5df79e8c51d038941605283cd596861a4c44427d/lib/x64/Debug/DaCore.pdb
--------------------------------------------------------------------------------
/lib/x64/Release/DaControl.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/citizenmatt/resharper-clippy/5df79e8c51d038941605283cd596861a4c44427d/lib/x64/Release/DaControl.dll
--------------------------------------------------------------------------------
/lib/x64/Release/DaCore.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/citizenmatt/resharper-clippy/5df79e8c51d038941605283cd596861a4c44427d/lib/x64/Release/DaCore.dll
--------------------------------------------------------------------------------
/lib/x86/Debug/DaControl.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/citizenmatt/resharper-clippy/5df79e8c51d038941605283cd596861a4c44427d/lib/x86/Debug/DaControl.dll
--------------------------------------------------------------------------------
/lib/x86/Debug/DaControl.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/citizenmatt/resharper-clippy/5df79e8c51d038941605283cd596861a4c44427d/lib/x86/Debug/DaControl.pdb
--------------------------------------------------------------------------------
/lib/x86/Debug/DaCore.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/citizenmatt/resharper-clippy/5df79e8c51d038941605283cd596861a4c44427d/lib/x86/Debug/DaCore.dll
--------------------------------------------------------------------------------
/lib/x86/Debug/DaCore.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/citizenmatt/resharper-clippy/5df79e8c51d038941605283cd596861a4c44427d/lib/x86/Debug/DaCore.pdb
--------------------------------------------------------------------------------
/lib/x86/Release/DaControl.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/citizenmatt/resharper-clippy/5df79e8c51d038941605283cd596861a4c44427d/lib/x86/Release/DaControl.dll
--------------------------------------------------------------------------------
/lib/x86/Release/DaCore.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/citizenmatt/resharper-clippy/5df79e8c51d038941605283cd596861a4c44427d/lib/x86/Release/DaCore.dll
--------------------------------------------------------------------------------
/license.txt:
--------------------------------------------------------------------------------
1 | Copyright 2024 Matt Ellis
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4 |
5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6 |
7 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | # Clippy for ReSharper #
2 |
3 | ReSharper is, obviously, awesome. It does so much for you already, what could you possibly add to make life even more awesomer?
4 |
5 | Clippy. That's what.
6 |
7 | 
8 |
9 | This is a plugin for ReSharper to add Clippy support to your day to day ReSharper activities. It's fully operational. It handles/takes over:
10 |
11 | * Alt+Enter
12 | * Navigate To shortcut
13 | * Refactor This shortcut
14 | * Inspect This shortcut
15 | * Generate (class, ctor, equality, etc) and Generate From Template shortcuts
16 | * Go to recent files and go to recent edits
17 | * In place refactoring, such as renaming a variable or class (my favourite)
18 | * Reporting unit test runs
19 | * Various animations for build, running unit tests, saving, etc.
20 |
21 | And it provides a simple menu of items when you click Clippy, providing quick access to the Refactoring, Navigate, Analyze and Generate methods, as well as Code Cleanup, Find Usages and Go to Symbol.
22 |
23 | 
24 |
25 | You can install it using the Extension Manager. Go to ReSharper -> Extension Manager -> Online and search for "clippy". Once installed, there's nothing more you need to do, just open a solution and off you go. Clippy will popup and intercept all your favourite keystrokes.
26 |
27 | For more information, [see the original blog post](http://blog.jetbrains.com/dotnet/2014/04/01/clippy-for-resharper).
28 |
29 | 
30 |
31 | ## Building ##
32 |
33 | This extension uses the open source [Double Agent](http://doubleagent.sourceforge.net/) library to host the Agent. Some minor changes were made for the binary that is shipped - patches are included in the repo. It also does some nice side-by-side activation context to load an unregistered COM object. Thanks to [Samuel Jack](http://blog.functionalfun.net/2012/09/a-quick-guide-to-registration-free-com.html), [Spike McLarty](http://www.atalasoft.com/blogs/spikemclarty/february-2012/dynamically-testing-an-activex-control-from-c-and) and [Junfeng Zhang](http://blogs.msdn.com/b/junfeng/archive/2006/04/20/579748.aspx) for notes on getting that working. See the [src/resharper-clippy/readme.md](src/resharper-clippy/readme.md) for more details.
34 |
35 | It also uses the ReSharper SDK, which is referenced as NuGet packages.
36 |
--------------------------------------------------------------------------------
/src/.idea/.idea.resharper-clippy/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Rider ignored files
5 | /modules.xml
6 | /.idea.resharper-clippy.iml
7 | /contentModel.xml
8 | /projectSettingsUpdater.xml
9 | # Editor-based HTTP Client requests
10 | /httpRequests/
11 | # Datasource local storage ignored files
12 | /dataSources/
13 | /dataSources.local.xml
14 |
--------------------------------------------------------------------------------
/src/.idea/.idea.resharper-clippy/.idea/.name:
--------------------------------------------------------------------------------
1 | resharper-clippy
--------------------------------------------------------------------------------
/src/.idea/.idea.resharper-clippy/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/.idea/.idea.resharper-clippy/.idea/indexLayout.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/.idea/.idea.resharper-clippy/.idea/runConfigurations/VisualStudio.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/.idea/.idea.resharper-clippy/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/Directory.Build.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Latest
5 | MSB3277
6 | true
7 | false
8 | None
9 |
10 | obj\$(MSBuildProjectName)\
11 | $(DefaultItemExcludes);obj\**
12 | bin\$(MSBuildProjectName)\$(Configuration)\
13 |
14 |
15 |
16 | TRACE;DEBUG;JET_MODE_ASSERT
17 |
18 |
19 |
20 |
21 |
22 | $(SdkVersion.Substring(2,2))$(SdkVersion.Substring(5,1)).0.0
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | JetResourceGenerator
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/src/Plugin.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 2024.1.4
7 |
8 | Clippy for ReSharper
9 | Your automated ReSharper assistant
10 |
11 | Matt Ellis
12 | Copyright Matt Ellis, $([System.DateTime]::Now.Year)
13 | resharper plugin clippy
14 |
15 | 1.3.0.0
16 | 1.3.0.0
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/TestHarness/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
--------------------------------------------------------------------------------
/src/TestHarness/App.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/TestHarness/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace TestHarness
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/TestHarness/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 | Show options list
9 | 8
10 | Show search text box
11 | Show activated
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/src/TestHarness/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Linq;
5 | using System.Windows;
6 | using CitizenMatt.ReSharper.Plugins.Clippy.AgentApi;
7 | using JetBrains.Lifetimes;
8 | using JetBrains.UI.StdApplicationUI;
9 | using JetBrains.UI.Utils;
10 | using JetBrains.UI.Wpf;
11 | using JetBrains.Util;
12 | using JetBrains.Util.Interop;
13 | using MessageBox = JetBrains.Util.MessageBox;
14 |
15 | namespace TestHarness
16 | {
17 | public partial class MainWindow
18 | {
19 | private static readonly Random Rand = new Random();
20 |
21 | private readonly SequentialLifetimes lifetimes;
22 | private readonly Lifetime lifetime;
23 | private Agent agent;
24 | private bool firstTime;
25 |
26 | public MainWindow()
27 | {
28 | InitializeComponent();
29 |
30 | lifetime = Lifetime.Eternal;
31 | lifetimes = new SequentialLifetimes(lifetime);
32 |
33 | Loaded += MainWindow_Loaded;
34 | }
35 |
36 | void MainWindow_Loaded(object sender, RoutedEventArgs e)
37 | {
38 | var agentManager =
39 | new AgentManager(lifetime, new StaticMainWindow(lifetime, new WpfWin32Window(this)), null);
40 | agentManager.Initialise();
41 |
42 | // Note, using this lifetime means we get alerts for ALL balloons,
43 | // not just the current one (i.e. other classes could also create
44 | // a balloon, and we'd get those clicks, too)
45 | agent = new Agent(lifetime, agentManager);
46 | agent.BalloonOptionClicked.Advise(lifetime,
47 | tag => MessageBox.ShowExclamation(string.Format("Clicked: {0}", tag)));
48 | agent.ButtonClicked.Advise(lifetime,
49 | button => MessageBox.ShowExclamation(string.Format("Clicked button: {0}", button)));
50 |
51 | var character = agent.AgentCharacter.Character;
52 | Animations.ItemsSource = character.Animations.OrderBy();
53 | Animations.SelectedIndex = 0;
54 |
55 | firstTime = true;
56 | }
57 |
58 | private void ShowHide(object sender, RoutedEventArgs e)
59 | {
60 | if (firstTime)
61 | {
62 | var dpiResolution = DpiResolutions.FromAvalonElement(this);
63 | var x = ((Left + Width)*(dpiResolution.DpiX/DpiResolution.DeviceIndependent96DpiValue))-200;
64 | var y = ((Top + Height)*(dpiResolution.DpiY/DpiResolution.DeviceIndependent96DpiValue))-200;
65 | agent.SetLocation(x, y);
66 | firstTime = false;
67 | }
68 | if (agent.IsVisible)
69 | agent.Hide();
70 | else
71 | agent.Show();
72 | }
73 |
74 | protected override void OnClosing(CancelEventArgs e)
75 | {
76 | agent.Hide();
77 | base.OnClosing(e);
78 | }
79 |
80 | protected override void OnClosed(EventArgs e)
81 | {
82 | base.OnClosed(e);
83 |
84 | Application.Current.Shutdown();
85 | }
86 |
87 | private IList GetOptionsList()
88 | {
89 | if (ShowOptionsListCheckBox.IsChecked.HasValue && ShowOptionsListCheckBox.IsChecked.Value)
90 | {
91 | int numberOfOptions;
92 | if (!int.TryParse(NumberOfOptions.Text, out numberOfOptions))
93 | numberOfOptions = 8;
94 | var options = new List();
95 | for (var i = 0; i < numberOfOptions; i++)
96 | {
97 | var text = LoremIpsum(3, 10);
98 | var tag = text; // In real life, something useful
99 | var enabled = i != 3;
100 | options.Add(new BalloonOption(text, false, enabled, tag));
101 | }
102 | return options;
103 | }
104 |
105 | return EmptyList.InstanceList;
106 | }
107 |
108 | private void ShowBalloon(string header, string message, IList options, params string[] buttons)
109 | {
110 | lifetimes.Next(balloonLifetime =>
111 | {
112 | var activate = ShowActivated.IsChecked.HasValue && ShowActivated.IsChecked.Value;
113 | agent.ShowBalloon(balloonLifetime, header, message, options, buttons, activate, _ => { });
114 | });
115 | }
116 |
117 | private void Speak(object sender, RoutedEventArgs e)
118 | {
119 | ShowBalloon(LoremIpsum(2,5), LoremIpsum(4, 15), GetOptionsList(), new string[0]);
120 | }
121 |
122 | private void SpeakOk(object sender, RoutedEventArgs e)
123 | {
124 | ShowBalloon(LoremIpsum(2, 5), LoremIpsum(4, 15), GetOptionsList(), "OK");
125 | }
126 |
127 | private void SpeakYesNo(object sender, RoutedEventArgs e)
128 | {
129 | ShowBalloon(LoremIpsum(2, 5), LoremIpsum(4, 15), GetOptionsList(), "Yes", "No");
130 | }
131 |
132 | private void SpeakOkCancel(object sender, RoutedEventArgs e)
133 | {
134 | ShowBalloon(LoremIpsum(2, 5), LoremIpsum(4, 15), GetOptionsList(), "OK", "Cancel");
135 | }
136 |
137 | private void SpeakThreeButtons(object sender, RoutedEventArgs e)
138 | {
139 | ShowBalloon(LoremIpsum(2, 5), LoremIpsum(4, 25), GetOptionsList(), "Yes", "Maybe", "maybe not", "No");
140 | }
141 |
142 | private void HideBalloon(object sender, RoutedEventArgs e)
143 | {
144 | lifetimes.TerminateCurrent();
145 | }
146 |
147 | // I love StackOverflow - http://stackoverflow.com/questions/4286487/is-there-any-lorem-ipsum-generator-in-c
148 | static string LoremIpsum(int minWords, int maxWords, int minSentences = 1, int maxSentences = 1, int numParagraphs = 1)
149 | {
150 | var words = new[]
151 | {
152 | "lo_rem", "ipsum", "dolor", "sit", "amet", "con_sectetuer",
153 | "adipiscing", "elit", "sed", "diam", "nonummy", "nibh", "euismod",
154 | "tincidunt", "ut", "laoreet", "dolore", "magna", "aliquam", "erat"
155 | };
156 |
157 | var result = string.Empty;
158 | for (var p = 0; p < numParagraphs; p++)
159 | {
160 | for (var s = 0; s < Rand.Next(maxSentences - minSentences) + minSentences; s++)
161 | {
162 | if (s > 0) result += ". ";
163 | for (var w = 0; w < Rand.Next(maxWords - minWords) + minWords + 1; w++)
164 | {
165 | if (w > 0) { result += " "; }
166 | result += words[Rand.Next(words.Length)];
167 | }
168 | }
169 | }
170 |
171 | return result;
172 | }
173 |
174 | private void Animate(object sender, RoutedEventArgs e)
175 | {
176 | var animation = Animations.SelectedItem as string;
177 | if (string.IsNullOrEmpty(animation))
178 | return;
179 |
180 | agent.Play(animation);
181 | }
182 | }
183 | }
184 |
--------------------------------------------------------------------------------
/src/TestHarness/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | //In order to begin building localizable applications, set
4 | //CultureYouAreCodingWith in your .csproj file
5 | //inside a . For example, if you are using US english
6 | //in your source files, set the to en-US. Then uncomment
7 | //the NeutralResourceLanguage attribute below. Update the "en-US" in
8 | //the line below to match the UICulture setting in the project file.
9 |
10 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
11 |
12 |
13 | [assembly: ThemeInfo(
14 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
15 | //(used if a resource is not found in the page,
16 | // or application resource dictionaries)
17 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
18 | //(used if a resource is not found in the page,
19 | // app, or any theme specific resource dictionaries)
20 | )]
21 |
--------------------------------------------------------------------------------
/src/TestHarness/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.34011
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace TestHarness.Properties
12 | {
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources
26 | {
27 |
28 | private static global::System.Resources.ResourceManager resourceMan;
29 |
30 | private static global::System.Globalization.CultureInfo resourceCulture;
31 |
32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33 | internal Resources()
34 | {
35 | }
36 |
37 | ///
38 | /// Returns the cached ResourceManager instance used by this class.
39 | ///
40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41 | internal static global::System.Resources.ResourceManager ResourceManager
42 | {
43 | get
44 | {
45 | if ((resourceMan == null))
46 | {
47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TestHarness.Properties.Resources", typeof(Resources).Assembly);
48 | resourceMan = temp;
49 | }
50 | return resourceMan;
51 | }
52 | }
53 |
54 | ///
55 | /// Overrides the current thread's CurrentUICulture property for all
56 | /// resource lookups using this strongly typed resource class.
57 | ///
58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59 | internal static global::System.Globalization.CultureInfo Culture
60 | {
61 | get
62 | {
63 | return resourceCulture;
64 | }
65 | set
66 | {
67 | resourceCulture = value;
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/src/TestHarness/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/src/TestHarness/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.34011
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace TestHarness.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/TestHarness/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/TestHarness/TestHarness.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net472
5 | False
6 | TestHarness
7 | true
8 | WinExe
9 | False
10 |
11 |
12 |
13 |
14 |
15 | all
16 | runtime; build; native; contentfiles; analyzers; buildtransitive
17 |
18 |
19 |
20 |
21 | ..\..\lib\DoubleAgent.Control.dll
22 | False
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/src/resharper-clippy.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.40629.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestHarness", "TestHarness\TestHarness.csproj", "{34AD8ADD-E0D1-4766-97A8-92E3D407392E}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "resharper-clippy", "resharper-clippy\resharper-clippy.csproj", "{1E1AFCFF-452E-4E82-8446-3510D9589EEE}"
9 | EndProject
10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{93260EE6-6E78-49C6-BF55-BF41DB4D130B}"
11 | ProjectSection(SolutionItems) = preProject
12 | ..\install\resharper-clippy.nuspec = ..\install\resharper-clippy.nuspec
13 | runVisualStudio.ps1 = runVisualStudio.ps1
14 | settings.ps1 = settings.ps1
15 | EndProjectSection
16 | EndProject
17 | Global
18 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
19 | Debug|Any CPU = Debug|Any CPU
20 | Release|Any CPU = Release|Any CPU
21 | EndGlobalSection
22 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
23 | {34AD8ADD-E0D1-4766-97A8-92E3D407392E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
24 | {34AD8ADD-E0D1-4766-97A8-92E3D407392E}.Debug|Any CPU.Build.0 = Debug|Any CPU
25 | {34AD8ADD-E0D1-4766-97A8-92E3D407392E}.Release|Any CPU.ActiveCfg = Release|Any CPU
26 | {34AD8ADD-E0D1-4766-97A8-92E3D407392E}.Release|Any CPU.Build.0 = Release|Any CPU
27 | {1E1AFCFF-452E-4E82-8446-3510D9589EEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
28 | {1E1AFCFF-452E-4E82-8446-3510D9589EEE}.Debug|Any CPU.Build.0 = Debug|Any CPU
29 | {1E1AFCFF-452E-4E82-8446-3510D9589EEE}.Release|Any CPU.ActiveCfg = Release|Any CPU
30 | {1E1AFCFF-452E-4E82-8446-3510D9589EEE}.Release|Any CPU.Build.0 = Release|Any CPU
31 | EndGlobalSection
32 | GlobalSection(SolutionProperties) = preSolution
33 | HideSolutionNode = FALSE
34 | EndGlobalSection
35 | EndGlobal
36 |
--------------------------------------------------------------------------------
/src/resharper-clippy.sln.DotSettings:
--------------------------------------------------------------------------------
1 |
2 | PackageReference
3 | True
4 | True
--------------------------------------------------------------------------------
/src/resharper-clippy/AgentFiles.proj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | False
6 | True
7 | dotFiles
8 | PreserveNewest
9 |
10 |
11 |
12 |
13 |
14 | False
15 | PreserveNewest
16 | True
17 | dotFiles\DoubleAgent.x86\DoubleAgent.sxs.manifest
18 | DoubleAgent.x86\DoubleAgent.sxs.manifest
19 |
20 |
21 | False
22 | True
23 | dotFiles\DoubleAgent.x86
24 | PreserveNewest
25 | DoubleAgent.x86\%(Filename)%(Extension)
26 |
27 |
28 | False
29 | True
30 | dotFiles\DoubleAgent.x86
31 | PreserveNewest
32 | DoubleAgent.x86\%(Filename)%(Extension)
33 |
34 |
35 |
36 |
37 |
38 | False
39 | PreserveNewest
40 | True
41 | dotFiles\DoubleAgent.x64\DoubleAgent.sxs.manifest
42 | DoubleAgent.x64\DoubleAgent.sxs.manifest
43 |
44 |
45 | False
46 | True
47 | dotFiles\DoubleAgent.x64
48 | PreserveNewest
49 | DoubleAgent.x64\%(Filename)%(Extension)
50 |
51 |
52 | False
53 | True
54 | dotFiles\DoubleAgent.x64
55 | PreserveNewest
56 | DoubleAgent.x64\%(Filename)%(Extension)
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/src/resharper-clippy/DoubleAgent.x64.sxs.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/resharper-clippy/DoubleAgent.x86.sxs.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/resharper-clippy/readme.md:
--------------------------------------------------------------------------------
1 | # DoubleAgent and Side by Side
2 |
3 | This project references `DoubleAgent.Control`, which is a PIA for the COM objects
4 | defined in `DaControl.dll`, which in turn loads `DaCore.dll` to provide the implementation.
5 |
6 | To enable us to ship `DaControl.dll` without installing it, we need to implement registration
7 | free COM activation. To do this, we need to call some Win32 APIs, namely `CreateActCtx` to
8 | create an Activation Context that points to a manifest file that contains the registration
9 | details for the COM objects in `DaControl.dll`.
--------------------------------------------------------------------------------
/src/resharper-clippy/resharper-clippy.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net472
5 | True
6 | CitizenMatt.ReSharper.Plugins.Clippy
7 | CitizenMatt.ReSharper.Plugins.Clippy
8 | CitizenMatt.Clippy
9 | $(DefineConstants);RESHARPER
10 | false
11 | MIT
12 | true
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | ..\..\lib\DoubleAgent.Control.dll
23 | False
24 |
25 |
26 |
27 |
28 |
29 | false
30 |
31 |
32 | false
33 |
34 |
35 |
36 | false
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/src/resharper-clippy/src/AgentApi/Agent.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using JetBrains.Application;
4 | using JetBrains.DataFlow;
5 | using JetBrains.Lifetimes;
6 |
7 | namespace CitizenMatt.ReSharper.Plugins.Clippy.AgentApi
8 | {
9 | [ShellComponent]
10 | public class Agent
11 | {
12 | private readonly Lazy character;
13 |
14 | public Agent(Lifetime lifetime, AgentManager agentManager)
15 | {
16 | character = JetBrains.Util.Lazy.Of(() =>
17 | {
18 | agentManager.Initialise();
19 | var agentCharacter = agentManager.GetAgent("Clippit");
20 |
21 | agentCharacter.AgentClicked.FlowInto(lifetime, AgentClicked);
22 | agentCharacter.ButtonClicked.FlowInto(lifetime, ButtonClicked);
23 | agentCharacter.BalloonOptionClicked.FlowInto(lifetime, BalloonOptionClicked);
24 |
25 | lifetime.OnTermination(() => agentManager.UnloadAgent(agentCharacter));
26 |
27 | return agentCharacter;
28 | }, true);
29 |
30 | AgentClicked = new SimpleSignal("Agent::AgentClicked");
31 | ButtonClicked = new Signal("Agent::ButtonClicked");
32 | BalloonOptionClicked = new Signal