-
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.
Merge pull request #7 from IvoKrugers/develop
17.4.1
- Loading branch information
Showing
13 changed files
with
246 additions
and
48 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
VisualStudioMac.OneClickToOpenFile/CommandHandlers/EnableOneClickToOpenFileCommandHandler.cs
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,28 @@ | ||
using MonoDevelop.Components.Commands; | ||
using MonoDevelop.Ide; | ||
using MonoDevelop.Ide.Gui.Pads; | ||
using NetworkExtension; | ||
using VisualStudioMac.OneClickToOpenFile.Extensions; | ||
|
||
namespace VisualStudioMac.OneClickToOpenFile.CommandHandlers | ||
{ | ||
public class EnableOneClickToOpenFileCommandHandler : CommandHandler | ||
{ | ||
protected override void Update(CommandInfo info) | ||
{ | ||
info.Enabled = true; | ||
info.Checked = Settings.OneClickToOpenFileEnabled; | ||
} | ||
|
||
protected override void Run() | ||
{ | ||
Settings.OneClickToOpenFileEnabled = !Settings.OneClickToOpenFileEnabled; | ||
|
||
var pad = (SolutionPad)IdeApp.Workbench.Pads.SolutionPad.Content; | ||
if (pad == null) | ||
return; | ||
|
||
pad.RefreshTree(); | ||
} | ||
} | ||
} |
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
32 changes: 32 additions & 0 deletions
32
VisualStudioMac.OneClickToOpenFile/CommandHandlers/StartupCommandHandler.cs
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,32 @@ | ||
using System.Threading.Tasks; | ||
using MonoDevelop.Components.Commands; | ||
using MonoDevelop.Ide; | ||
|
||
namespace VisualStudioMac.OneClickToOpenFile.CommandHandlers | ||
{ | ||
public class StartupCommandHandler : CommandHandler | ||
{ | ||
protected override void Run() | ||
{ | ||
Settings.OneClickToOpenFileEnabled = false; | ||
IdeApp.Workspace.SolutionLoaded += Workspace_SolutionLoaded; | ||
IdeApp.Workspace.SolutionUnloaded += (s, e) => Settings.OneClickToOpenFileEnabled = false; | ||
//IdeApp.Workbench.LayoutChanged += Workbench_LayoutChanged; | ||
//IdeApp.Exiting += (s,e) => Settings.OneClickToOpenFileEnabled = false; | ||
//IdeApp.Workbench.GuiLocked += (s, e) => Settings.OneClickToOpenFileEnabled = false; | ||
//IdeApp.Workbench.GuiUnlocked += (s, e) => Settings.OneClickToOpenFileEnabled = true; | ||
} | ||
|
||
private void Workspace_SolutionLoaded(object sender, MonoDevelop.Projects.SolutionEventArgs e) | ||
{ | ||
if (e.Solution != null) | ||
{ | ||
Task.Delay(10000).ContinueWith(async t => | ||
{ | ||
await t; | ||
Settings.OneClickToOpenFileEnabled = true; | ||
}); | ||
} | ||
} | ||
} | ||
} |
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
37 changes: 37 additions & 0 deletions
37
VisualStudioMac.OneClickToOpenFile/Extensions/SolutionPadExtensions.cs
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,37 @@ | ||
using MonoDevelop.Components.Commands; | ||
using MonoDevelop.Ide; | ||
using MonoDevelop.Ide.Gui.Components; | ||
using MonoDevelop.Ide.Gui.Pads; | ||
|
||
namespace VisualStudioMac.OneClickToOpenFile.Extensions | ||
{ | ||
public static class SolutionPadExtensions | ||
{ | ||
public static void RefreshTree(this SolutionPad pad) | ||
{ | ||
if (pad == null) | ||
return; | ||
|
||
var root = pad.GetRootNode(); | ||
if (root != null) | ||
{ | ||
pad.GetTreeView().RefreshNode(root); | ||
root.Expanded = true; | ||
} | ||
} | ||
|
||
private static ITreeNavigator GetRootNode(this SolutionPad pad) | ||
=> pad.GetTreeView().GetRootNode(); | ||
|
||
private static ITreeNavigator GetRootNode(this ExtensibleTreeViewController treeview) | ||
{ | ||
var pos = treeview.GetRootPosition(); | ||
return treeview.GetNodeAtPosition(pos); | ||
} | ||
|
||
private static ExtensibleTreeViewController GetTreeView(this SolutionPad pad) | ||
=> pad.Controller; | ||
} | ||
|
||
|
||
} |
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
18 changes: 0 additions & 18 deletions
18
VisualStudioMac.OneClickToOpenFile/Properties/AssemblyInfo.cs
This file was deleted.
Oops, something went wrong.
48 changes: 48 additions & 0 deletions
48
VisualStudioMac.OneClickToOpenFile/Properties/Manifest.addin.xml
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,48 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Addin name = "VSM: One Click To Open File" | ||
id = "OneClickToOpenFile" | ||
namespace = "VisualStudioMac" | ||
author = "Ivo Krugers" | ||
copyright = "MIT X11" | ||
url = "https://github.com/IvoKrugers/VisualStudioMac.OneClickToOpenFile" | ||
description = "This extension opens a file with only one click on the solutiontree. | ||
by Ivo Krugers | ||
" | ||
category = "IDE extensions" | ||
version = "17.4.1"> | ||
|
||
<!--<Runtime> | ||
<Import assembly="VisualStudioMac.OneClickToOpenFile.dll" /> | ||
</Runtime>--> | ||
|
||
<!--<Dependencies> | ||
<Addin id="Core" version="17.4"/> | ||
<Addin id="Ide" version="17.4"/> | ||
<Addin id="DotNetCore" version="17.4" /> | ||
</Dependencies>--> | ||
|
||
|
||
<Extension path="/MonoDevelop/Ide/StartupHandlers"> | ||
<Class class="VisualStudioMac.OneClickToOpenFile.CommandHandlers.StartupCommandHandler" /> | ||
</Extension> | ||
|
||
<!-- ProjectPad NodeBuilders --> | ||
<Extension path="/MonoDevelop/Ide/Pads/ProjectPad"> | ||
<NodeBuilder class="VisualStudioMac.OneClickToOpenFile.NodeBuilderExtensions.OneClickFileNodeBuilderExt" /> | ||
</Extension> | ||
|
||
<!-- Commands --> | ||
<Extension path="/MonoDevelop/Ide/Commands"> | ||
<Command id="VisualStudioMac.OneClickToOpenFile.EnableOneClickToOpenFileCommandHandler" | ||
_label="One Click To Open File" | ||
defaultHandler="VisualStudioMac.OneClickToOpenFile.CommandHandlers.EnableOneClickToOpenFileCommandHandler" /> | ||
</Extension> | ||
|
||
<!-- Main Tool Menu Entries --> | ||
<Extension path="/MonoDevelop/Ide/MainMenu/Tools"> | ||
<SeparatorItem id="ExtensionSettingsSeparator" insertafter="MonoDevelop.Ide.Commands.EditCommands.MonodevelopPreferences"/> | ||
<CommandItem id="VisualStudioMac.OneClickToOpenFile.EnableOneClickToOpenFileCommandHandler" insertafter="ExtensionSettingsSeparator" /> | ||
</Extension> | ||
</Addin> |
11 changes: 0 additions & 11 deletions
11
VisualStudioMac.OneClickToOpenFile/Properties/VisualStudioMac.OneClickToOpenFile.addin.xml
This file was deleted.
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,7 @@ | ||
namespace VisualStudioMac.OneClickToOpenFile | ||
{ | ||
public static class Settings | ||
{ | ||
public static bool OneClickToOpenFileEnabled = false; | ||
} | ||
} |
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