Skip to content
This repository was archived by the owner on Jan 13, 2024. It is now read-only.

Commit 808c805

Browse files
committed
GetGatewayFactory
1 parent a6f120c commit 808c805

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

Demo Plugin/NppManagedPluginDemo/NppManagedPluginDemo.VS2015.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<AssemblyName>Demo</AssemblyName>
1313
<StartupObject>
1414
</StartupObject>
15-
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
15+
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
1616
<FileUpgradeFlags>
1717
</FileUpgradeFlags>
1818
<OldToolsVersion>3.5</OldToolsVersion>

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,6 @@ This package contains two folders:
6363

6464

6565
## Requirements:
66-
* works with .NET Runtime 2.0 and above
67-
* UNICODE only! ANSI is doable, but not supported so far
66+
* works with .NET Runtime 3.5 and above (can easily be reduced to .Net runtime 2.0 if needed)
67+
* UNICODE plugins only.
6868

Visual Studio Project Template C#/PluginInfrastructure/NppPluginNETBase.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ internal static void SetCommand(int index, string commandName, NppFuncItemDelega
1313
{
1414
SetCommand(index, commandName, functionPointer, new ShortcutKey(), false);
1515
}
16-
16+
1717
internal static void SetCommand(int index, string commandName, NppFuncItemDelegate functionPointer, ShortcutKey shortcut)
1818
{
1919
SetCommand(index, commandName, functionPointer, shortcut, false);
2020
}
21-
21+
2222
internal static void SetCommand(int index, string commandName, NppFuncItemDelegate functionPointer, bool checkOnInit)
2323
{
2424
SetCommand(index, commandName, functionPointer, new ShortcutKey(), checkOnInit);
2525
}
26-
26+
2727
internal static void SetCommand(int index, string commandName, NppFuncItemDelegate functionPointer, ShortcutKey shortcut, bool checkOnInit)
2828
{
2929
FuncItem funcItem = new FuncItem();
@@ -43,5 +43,13 @@ internal static IntPtr GetCurrentScintilla()
4343
Win32.SendMessage(nppData._nppHandle, NppMsg.NPPM_GETCURRENTSCINTILLA, 0, out curScintilla);
4444
return (curScintilla == 0) ? nppData._scintillaMainHandle : nppData._scintillaSecondHandle;
4545
}
46+
47+
48+
static readonly Func<IScintillaGateway> gatewayFactory = () => new ScintillaGateway(GetCurrentScintilla());
49+
50+
public static Func<IScintillaGateway> GetGatewayFactory()
51+
{
52+
return gatewayFactory;
53+
}
4654
}
4755
}

0 commit comments

Comments
 (0)