diff --git a/.gitignore b/.gitignore index d95c6f9..ba87ac5 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,11 @@ /InkCanvasForClass/bin /InkCanvasForClassX/obj /InkCanvasForClassX/bin -/InkCanvasForClassPPTVsto/obj -/InkCanvasForClassPPTVsto/bin +/InkCanvasForClass.IACoreHelper/obj +/InkCanvasForClass.IACoreHelper/bin +/InkCanvasForClass.PowerPoint.InteropHelper/obj +/InkCanvasForClass.PowerPoint.InteropHelper/bin +/InkCanvasForClass.PowerPoint.Vsto/obj +/InkCanvasForClass.PowerPoint.Vsto/bin /.vs /.idea \ No newline at end of file diff --git a/Ink Canvas.sln b/Ink Canvas.sln index 6398dfa..98c1f04 100644 --- a/Ink Canvas.sln +++ b/Ink Canvas.sln @@ -7,7 +7,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InkCanvasForClassX", "InkCa EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InkCanvasForClass", "InkCanvasForClass\InkCanvasForClass.csproj", "{2474F5B0-6FA7-4D70-8A00-167BBB03264D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InkCanvasForClassPPTVsto", "InkCanvasForClassPPTVsto\InkCanvasForClassPPTVsto.csproj", "{E494CFFE-D2EC-4BAD-82D9-C92FE29616A7}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InkCanvasForClass.IACoreHelper", "InkCanvasForClass.IACoreHelper\InkCanvasForClass.IACoreHelper.csproj", "{693973B6-69C1-4A37-B329-F366A07BF60A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InkCanvasForClass.PowerPoint.InteropHelper", "InkCanvasForClass.PowerPoint.InteropHelper\InkCanvasForClass.PowerPoint.InteropHelper.csproj", "{2D8A9217-465A-4F57-BD58-CE02450390C4}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InkCanvasForClass.PowerPoint.Vsto", "InkCanvasForClass.PowerPoint.Vsto\InkCanvasForClass.PowerPoint.Vsto.csproj", "{E494CFFE-D2EC-4BAD-82D9-C92FE29616A7}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -88,6 +92,66 @@ Global {2474F5B0-6FA7-4D70-8A00-167BBB03264D}.x86 Debug|x64.Build.0 = x86 Debug|Any CPU {2474F5B0-6FA7-4D70-8A00-167BBB03264D}.x86 Debug|x86.ActiveCfg = x86 Debug|Any CPU {2474F5B0-6FA7-4D70-8A00-167BBB03264D}.x86 Debug|x86.Build.0 = x86 Debug|Any CPU + {693973B6-69C1-4A37-B329-F366A07BF60A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {693973B6-69C1-4A37-B329-F366A07BF60A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {693973B6-69C1-4A37-B329-F366A07BF60A}.Debug|ARM.ActiveCfg = Debug|Any CPU + {693973B6-69C1-4A37-B329-F366A07BF60A}.Debug|ARM.Build.0 = Debug|Any CPU + {693973B6-69C1-4A37-B329-F366A07BF60A}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {693973B6-69C1-4A37-B329-F366A07BF60A}.Debug|ARM64.Build.0 = Debug|Any CPU + {693973B6-69C1-4A37-B329-F366A07BF60A}.Debug|x64.ActiveCfg = Debug|Any CPU + {693973B6-69C1-4A37-B329-F366A07BF60A}.Debug|x64.Build.0 = Debug|Any CPU + {693973B6-69C1-4A37-B329-F366A07BF60A}.Debug|x86.ActiveCfg = Debug|Any CPU + {693973B6-69C1-4A37-B329-F366A07BF60A}.Debug|x86.Build.0 = Debug|Any CPU + {693973B6-69C1-4A37-B329-F366A07BF60A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {693973B6-69C1-4A37-B329-F366A07BF60A}.Release|Any CPU.Build.0 = Release|Any CPU + {693973B6-69C1-4A37-B329-F366A07BF60A}.Release|ARM.ActiveCfg = Release|Any CPU + {693973B6-69C1-4A37-B329-F366A07BF60A}.Release|ARM.Build.0 = Release|Any CPU + {693973B6-69C1-4A37-B329-F366A07BF60A}.Release|ARM64.ActiveCfg = Release|Any CPU + {693973B6-69C1-4A37-B329-F366A07BF60A}.Release|ARM64.Build.0 = Release|Any CPU + {693973B6-69C1-4A37-B329-F366A07BF60A}.Release|x64.ActiveCfg = Release|Any CPU + {693973B6-69C1-4A37-B329-F366A07BF60A}.Release|x64.Build.0 = Release|Any CPU + {693973B6-69C1-4A37-B329-F366A07BF60A}.Release|x86.ActiveCfg = Release|Any CPU + {693973B6-69C1-4A37-B329-F366A07BF60A}.Release|x86.Build.0 = Release|Any CPU + {693973B6-69C1-4A37-B329-F366A07BF60A}.x86 Debug|Any CPU.ActiveCfg = Debug|Any CPU + {693973B6-69C1-4A37-B329-F366A07BF60A}.x86 Debug|Any CPU.Build.0 = Debug|Any CPU + {693973B6-69C1-4A37-B329-F366A07BF60A}.x86 Debug|ARM.ActiveCfg = Debug|Any CPU + {693973B6-69C1-4A37-B329-F366A07BF60A}.x86 Debug|ARM.Build.0 = Debug|Any CPU + {693973B6-69C1-4A37-B329-F366A07BF60A}.x86 Debug|ARM64.ActiveCfg = Debug|Any CPU + {693973B6-69C1-4A37-B329-F366A07BF60A}.x86 Debug|ARM64.Build.0 = Debug|Any CPU + {693973B6-69C1-4A37-B329-F366A07BF60A}.x86 Debug|x64.ActiveCfg = Debug|Any CPU + {693973B6-69C1-4A37-B329-F366A07BF60A}.x86 Debug|x64.Build.0 = Debug|Any CPU + {693973B6-69C1-4A37-B329-F366A07BF60A}.x86 Debug|x86.ActiveCfg = Debug|Any CPU + {693973B6-69C1-4A37-B329-F366A07BF60A}.x86 Debug|x86.Build.0 = Debug|Any CPU + {2D8A9217-465A-4F57-BD58-CE02450390C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2D8A9217-465A-4F57-BD58-CE02450390C4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2D8A9217-465A-4F57-BD58-CE02450390C4}.Debug|ARM.ActiveCfg = Debug|Any CPU + {2D8A9217-465A-4F57-BD58-CE02450390C4}.Debug|ARM.Build.0 = Debug|Any CPU + {2D8A9217-465A-4F57-BD58-CE02450390C4}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {2D8A9217-465A-4F57-BD58-CE02450390C4}.Debug|ARM64.Build.0 = Debug|Any CPU + {2D8A9217-465A-4F57-BD58-CE02450390C4}.Debug|x64.ActiveCfg = Debug|Any CPU + {2D8A9217-465A-4F57-BD58-CE02450390C4}.Debug|x64.Build.0 = Debug|Any CPU + {2D8A9217-465A-4F57-BD58-CE02450390C4}.Debug|x86.ActiveCfg = Debug|Any CPU + {2D8A9217-465A-4F57-BD58-CE02450390C4}.Debug|x86.Build.0 = Debug|Any CPU + {2D8A9217-465A-4F57-BD58-CE02450390C4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2D8A9217-465A-4F57-BD58-CE02450390C4}.Release|Any CPU.Build.0 = Release|Any CPU + {2D8A9217-465A-4F57-BD58-CE02450390C4}.Release|ARM.ActiveCfg = Release|Any CPU + {2D8A9217-465A-4F57-BD58-CE02450390C4}.Release|ARM.Build.0 = Release|Any CPU + {2D8A9217-465A-4F57-BD58-CE02450390C4}.Release|ARM64.ActiveCfg = Release|Any CPU + {2D8A9217-465A-4F57-BD58-CE02450390C4}.Release|ARM64.Build.0 = Release|Any CPU + {2D8A9217-465A-4F57-BD58-CE02450390C4}.Release|x64.ActiveCfg = Release|Any CPU + {2D8A9217-465A-4F57-BD58-CE02450390C4}.Release|x64.Build.0 = Release|Any CPU + {2D8A9217-465A-4F57-BD58-CE02450390C4}.Release|x86.ActiveCfg = Release|Any CPU + {2D8A9217-465A-4F57-BD58-CE02450390C4}.Release|x86.Build.0 = Release|Any CPU + {2D8A9217-465A-4F57-BD58-CE02450390C4}.x86 Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2D8A9217-465A-4F57-BD58-CE02450390C4}.x86 Debug|Any CPU.Build.0 = Debug|Any CPU + {2D8A9217-465A-4F57-BD58-CE02450390C4}.x86 Debug|ARM.ActiveCfg = Debug|Any CPU + {2D8A9217-465A-4F57-BD58-CE02450390C4}.x86 Debug|ARM.Build.0 = Debug|Any CPU + {2D8A9217-465A-4F57-BD58-CE02450390C4}.x86 Debug|ARM64.ActiveCfg = Debug|Any CPU + {2D8A9217-465A-4F57-BD58-CE02450390C4}.x86 Debug|ARM64.Build.0 = Debug|Any CPU + {2D8A9217-465A-4F57-BD58-CE02450390C4}.x86 Debug|x64.ActiveCfg = Debug|Any CPU + {2D8A9217-465A-4F57-BD58-CE02450390C4}.x86 Debug|x64.Build.0 = Debug|Any CPU + {2D8A9217-465A-4F57-BD58-CE02450390C4}.x86 Debug|x86.ActiveCfg = Debug|Any CPU + {2D8A9217-465A-4F57-BD58-CE02450390C4}.x86 Debug|x86.Build.0 = Debug|Any CPU {E494CFFE-D2EC-4BAD-82D9-C92FE29616A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E494CFFE-D2EC-4BAD-82D9-C92FE29616A7}.Debug|Any CPU.Build.0 = Debug|Any CPU {E494CFFE-D2EC-4BAD-82D9-C92FE29616A7}.Debug|ARM.ActiveCfg = Debug|Any CPU diff --git a/InkCanvasForClass.IACoreHelper/App.config b/InkCanvasForClass.IACoreHelper/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/InkCanvasForClass.IACoreHelper/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/InkCanvasForClass.IACoreHelper/InkCanvasForClass.IACoreHelper.csproj b/InkCanvasForClass.IACoreHelper/InkCanvasForClass.IACoreHelper.csproj new file mode 100644 index 0000000..0d520b4 --- /dev/null +++ b/InkCanvasForClass.IACoreHelper/InkCanvasForClass.IACoreHelper.csproj @@ -0,0 +1,53 @@ + + + + + Debug + AnyCPU + {693973B6-69C1-4A37-B329-F366A07BF60A} + Exe + InkCanvasForClass.IACoreHelper + InkCanvasForClass.IACoreHelper + v4.7.2 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/InkCanvasForClass.IACoreHelper/Program.cs b/InkCanvasForClass.IACoreHelper/Program.cs new file mode 100644 index 0000000..90e1655 --- /dev/null +++ b/InkCanvasForClass.IACoreHelper/Program.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace InkCanvasForClass.IACoreHelper { + internal class Program { + static void Main(string[] args) { + } + } +} diff --git a/InkCanvasForClass.IACoreHelper/Properties/AssemblyInfo.cs b/InkCanvasForClass.IACoreHelper/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..e45f3fb --- /dev/null +++ b/InkCanvasForClass.IACoreHelper/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的一般信息由以下 +// 控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("InkCanvasForClass.IACoreHelper")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("InkCanvasForClass.IACoreHelper")] +[assembly: AssemblyCopyright("Copyright © 2024")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 会使此程序集中的类型 +//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 +//请将此类型的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("693973b6-69c1-4a37-b329-f366a07bf60a")] + +// 程序集的版本信息由下列四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 +//通过使用 "*",如下所示: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/InkCanvasForClass.IACoreHelper/README.md b/InkCanvasForClass.IACoreHelper/README.md new file mode 100644 index 0000000..2d7c7f5 --- /dev/null +++ b/InkCanvasForClass.IACoreHelper/README.md @@ -0,0 +1,3 @@ +# InkCanvasForClass.IACoreHelper + +该项目实现了基于 .NET Framework 4.7.2 和 x86 运行环境的墨迹识别库 IACore 的封装 \ No newline at end of file diff --git a/InkCanvasForClass.PowerPoint.InteropHelper/App.config b/InkCanvasForClass.PowerPoint.InteropHelper/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/InkCanvasForClass.PowerPoint.InteropHelper/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/InkCanvasForClass.PowerPoint.InteropHelper/InkCanvasForClass.PowerPoint.InteropHelper.csproj b/InkCanvasForClass.PowerPoint.InteropHelper/InkCanvasForClass.PowerPoint.InteropHelper.csproj new file mode 100644 index 0000000..dbe1514 --- /dev/null +++ b/InkCanvasForClass.PowerPoint.InteropHelper/InkCanvasForClass.PowerPoint.InteropHelper.csproj @@ -0,0 +1,53 @@ + + + + + Debug + AnyCPU + {2D8A9217-465A-4F57-BD58-CE02450390C4} + Exe + InkCanvasForClass.PowerPoint.InteropHelper + InkCanvasForClass.PowerPoint.InteropHelper + v4.7.2 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/InkCanvasForClass.PowerPoint.InteropHelper/Program.cs b/InkCanvasForClass.PowerPoint.InteropHelper/Program.cs new file mode 100644 index 0000000..97d256c --- /dev/null +++ b/InkCanvasForClass.PowerPoint.InteropHelper/Program.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace InkCanvasForClass.PowerPoint.InteropHelper { + internal class Program { + static void Main(string[] args) { + } + } +} diff --git a/InkCanvasForClass.PowerPoint.InteropHelper/Properties/AssemblyInfo.cs b/InkCanvasForClass.PowerPoint.InteropHelper/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..9ff4b97 --- /dev/null +++ b/InkCanvasForClass.PowerPoint.InteropHelper/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的一般信息由以下 +// 控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("InkCanvasForClass.PowerPoint.InteropHelper")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("InkCanvasForClass.PowerPoint.InteropHelper")] +[assembly: AssemblyCopyright("Copyright © 2024")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 会使此程序集中的类型 +//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 +//请将此类型的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("2d8a9217-465a-4f57-bd58-ce02450390c4")] + +// 程序集的版本信息由下列四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 +//通过使用 "*",如下所示: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/InkCanvasForClassPPTVsto/InkCanvasForClassPPTVsto.csproj b/InkCanvasForClass.PowerPoint.Vsto/InkCanvasForClass.PowerPoint.Vsto.csproj similarity index 100% rename from InkCanvasForClassPPTVsto/InkCanvasForClassPPTVsto.csproj rename to InkCanvasForClass.PowerPoint.Vsto/InkCanvasForClass.PowerPoint.Vsto.csproj diff --git a/InkCanvasForClassPPTVsto/InkCanvasForClassPPTVsto_TemporaryKey.pfx b/InkCanvasForClass.PowerPoint.Vsto/InkCanvasForClassPPTVsto_TemporaryKey.pfx similarity index 100% rename from InkCanvasForClassPPTVsto/InkCanvasForClassPPTVsto_TemporaryKey.pfx rename to InkCanvasForClass.PowerPoint.Vsto/InkCanvasForClassPPTVsto_TemporaryKey.pfx diff --git a/InkCanvasForClassPPTVsto/MainRibbon.cs b/InkCanvasForClass.PowerPoint.Vsto/MainRibbon.cs similarity index 100% rename from InkCanvasForClassPPTVsto/MainRibbon.cs rename to InkCanvasForClass.PowerPoint.Vsto/MainRibbon.cs diff --git a/InkCanvasForClassPPTVsto/MainRibbon.xml b/InkCanvasForClass.PowerPoint.Vsto/MainRibbon.xml similarity index 100% rename from InkCanvasForClassPPTVsto/MainRibbon.xml rename to InkCanvasForClass.PowerPoint.Vsto/MainRibbon.xml diff --git a/InkCanvasForClassPPTVsto/Properties/AssemblyInfo.cs b/InkCanvasForClass.PowerPoint.Vsto/Properties/AssemblyInfo.cs similarity index 100% rename from InkCanvasForClassPPTVsto/Properties/AssemblyInfo.cs rename to InkCanvasForClass.PowerPoint.Vsto/Properties/AssemblyInfo.cs diff --git a/InkCanvasForClassPPTVsto/Properties/Resources.Designer.cs b/InkCanvasForClass.PowerPoint.Vsto/Properties/Resources.Designer.cs similarity index 100% rename from InkCanvasForClassPPTVsto/Properties/Resources.Designer.cs rename to InkCanvasForClass.PowerPoint.Vsto/Properties/Resources.Designer.cs diff --git a/InkCanvasForClassPPTVsto/Properties/Resources.resx b/InkCanvasForClass.PowerPoint.Vsto/Properties/Resources.resx similarity index 100% rename from InkCanvasForClassPPTVsto/Properties/Resources.resx rename to InkCanvasForClass.PowerPoint.Vsto/Properties/Resources.resx diff --git a/InkCanvasForClassPPTVsto/Properties/Settings.Designer.cs b/InkCanvasForClass.PowerPoint.Vsto/Properties/Settings.Designer.cs similarity index 100% rename from InkCanvasForClassPPTVsto/Properties/Settings.Designer.cs rename to InkCanvasForClass.PowerPoint.Vsto/Properties/Settings.Designer.cs diff --git a/InkCanvasForClassPPTVsto/Properties/Settings.settings b/InkCanvasForClass.PowerPoint.Vsto/Properties/Settings.settings similarity index 100% rename from InkCanvasForClassPPTVsto/Properties/Settings.settings rename to InkCanvasForClass.PowerPoint.Vsto/Properties/Settings.settings diff --git a/InkCanvasForClassPPTVsto/ThisAddIn.Designer.cs b/InkCanvasForClass.PowerPoint.Vsto/ThisAddIn.Designer.cs similarity index 100% rename from InkCanvasForClassPPTVsto/ThisAddIn.Designer.cs rename to InkCanvasForClass.PowerPoint.Vsto/ThisAddIn.Designer.cs diff --git a/InkCanvasForClassPPTVsto/ThisAddIn.Designer.xml b/InkCanvasForClass.PowerPoint.Vsto/ThisAddIn.Designer.xml similarity index 100% rename from InkCanvasForClassPPTVsto/ThisAddIn.Designer.xml rename to InkCanvasForClass.PowerPoint.Vsto/ThisAddIn.Designer.xml diff --git a/InkCanvasForClassPPTVsto/ThisAddIn.cs b/InkCanvasForClass.PowerPoint.Vsto/ThisAddIn.cs similarity index 100% rename from InkCanvasForClassPPTVsto/ThisAddIn.cs rename to InkCanvasForClass.PowerPoint.Vsto/ThisAddIn.cs diff --git a/InkCanvasForClass/App.xaml.cs b/InkCanvasForClass/App.xaml.cs index cb01333..e097783 100644 --- a/InkCanvasForClass/App.xaml.cs +++ b/InkCanvasForClass/App.xaml.cs @@ -1,31 +1,35 @@ using Hardcodet.Wpf.TaskbarNotification; using Ink_Canvas.Helpers; using iNKORE.UI.WPF.Modern.Controls; -using Newtonsoft.Json; using System; using System.IO; using System.Linq; using System.Reflection; using System.Windows; -using iNKORE.UI.WPF.Helpers; using Newtonsoft.Json.Linq; -using static System.Windows.Forms.VisualStyles.VisualStyleElement; -using MessageBox = System.Windows.MessageBox; -using Window = System.Windows.Window; using System.Windows.Shell; using Ookii.Dialogs.Wpf; using System.Diagnostics; -using Ink_Canvas.Popups; using Ink_Canvas.Windows; using Lierda.WPFHelper; +using System.Runtime.InteropServices; +using System.Security.Principal; +using Windows.Data.Xml.Dom; +using Windows.UI.Notifications; + +namespace Ink_Canvas { -namespace Ink_Canvas -{ /// /// Interaction logic for App.xaml /// - public partial class App : Application - { + public partial class App : Application { + + [DllImport("UIAccessDLL_x86.dll", EntryPoint = "PrepareUIAccess", CallingConvention = CallingConvention.Cdecl)] + public static extern Int32 PrepareUIAccessX86(); + + [DllImport("UIAccessDLL_x64.dll", EntryPoint = "PrepareUIAccess", CallingConvention = CallingConvention.Cdecl)] + public static extern Int32 PrepareUIAccessX64(); + System.Threading.Mutex mutex; public static string[] StartArgs = null; @@ -46,8 +50,16 @@ namespace Ink_Canvas private TaskbarIcon _taskbar; private MainWindow mainWin = null; - void App_Startup(object sender, StartupEventArgs e) - { + void App_Startup(object sender, StartupEventArgs e) { + + var identity = WindowsIdentity.GetCurrent(); + var principal = new WindowsPrincipal(identity); + if (Environment.Is64BitProcess && principal.IsInRole(WindowsBuiltInRole.Administrator)) { + Trace.WriteLine(PrepareUIAccessX64()); + } else if (principal.IsInRole(WindowsBuiltInRole.Administrator)) { + PrepareUIAccessX86(); + } + RootPath = AppDomain.CurrentDomain.SetupInformation.ApplicationBase; LogHelper.NewLog(string.Format("Ink Canvas Starting (Version: {0})", Assembly.GetExecutingAssembly().GetName().Version.ToString())); @@ -101,6 +113,8 @@ namespace Ink_Canvas LogHelper.WriteLogToFile(ex.ToString(), LogHelper.LogType.Error); } + + mainWin = new MainWindow(); if (isUsingWindowChrome && DwmCompositionHelper.DwmIsCompositionEnabled()) { diff --git a/InkCanvasForClass/InkCanvasForClass.csproj b/InkCanvasForClass/InkCanvasForClass.csproj index 8fc2578..6e9f395 100644 --- a/InkCanvasForClass/InkCanvasForClass.csproj +++ b/InkCanvasForClass/InkCanvasForClass.csproj @@ -1,618 +1,650 @@  - - win;win-x86;win-x64;win-arm64 - WinExe - Ink_Canvas - InkCanvasForClass - net472 - {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False - false - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 2 - 2.0.2.%2a - false - false - False - true - Debug;Release;x86 Debug - false - - - embedded - bin\$(Configuration)\ - True - - - embedded - bin\$(Configuration)\ - True - - - embedded - bin\$(Configuration)\ - True - - - Resources\icc.ico - - - bin\$(Platform)\$(Configuration)\ - full - 7.3 - true - - - bin\$(Platform)\$(Configuration)\ - full - 7.3 - true - - - bin\$(Platform)\$(Configuration)\ - pdbonly - 7.3 - true - - - app.manifest - InkCanvasForClass - 5.0.4 - Dubi906w - InkCanvasForClass - © Copyright HARKOTEK Studio 2024-now - https://icc.bliemhax.com - bundled - False - AnyCPU - True - - - bin\$(Platform)\$(Configuration)\ - full - 7.3 - true - - - bin\$(Platform)\$(Configuration)\ - full - 7.3 - true - - - bin\$(Platform)\$(Configuration)\ - pdbonly - 7.3 - true - - - bin\$(Platform)\$(Configuration)\ - full - 7.3 - true - - - bin\$(Platform)\$(Configuration)\ - full - 7.3 - true - - - bin\$(Platform)\$(Configuration)\ - pdbonly - 7.3 - true - - - - .\IACore.dll - - - .\IALoader.dll - - - .\IAWinFX.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F935DC20-1CF0-11D0-ADB9-00C04FD58A0B} - 1 - 0 - 0 - tlbimp - False - True - - - {00020430-0000-0000-C000-000000000046} - 2 - 0 - 0 - primary - False - True - - - {0002E157-0000-0000-C000-000000000046} - 5 - 3 - 0 - primary - False - True - - - tlbimp - 0 - 1 - 50a7e9b0-70ef-11d1-b75a-00a0c90564fe - 0 - false - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Never - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - True - Settings.settings - - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - PreserveNewest - - - Always - - - - - + + win;win-x86;win-x64;win-arm64 + WinExe + Ink_Canvas + InkCanvasForClass + net472 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + False + false + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 2 + 2.0.2.%2a + false + false + False + true + Debug;Release;x86 Debug + false + + + embedded + bin\$(Configuration)\ + True + + + embedded + bin\$(Configuration)\ + True + + + embedded + bin\$(Configuration)\ + True + + + Resources\icc.ico + + + bin\$(Platform)\$(Configuration)\ + full + 7.3 + true + + + bin\$(Platform)\$(Configuration)\ + full + 7.3 + true + + + bin\$(Platform)\$(Configuration)\ + pdbonly + 7.3 + true + + + app.manifest + InkCanvasForClass + 5.0.4 + Dubi906w + InkCanvasForClass + © Copyright HARKOTEK Studio 2024-now + https://icc.bliemhax.com + bundled + False + AnyCPU + True + + + bin\$(Platform)\$(Configuration)\ + full + 7.3 + true + + + bin\$(Platform)\$(Configuration)\ + full + 7.3 + true + + + bin\$(Platform)\$(Configuration)\ + pdbonly + 7.3 + true + + + bin\$(Platform)\$(Configuration)\ + full + 7.3 + true + + + bin\$(Platform)\$(Configuration)\ + full + 7.3 + true + + + bin\$(Platform)\$(Configuration)\ + pdbonly + 7.3 + true + + + + .\IACore.dll + + + .\IALoader.dll + + + .\IAWinFX.dll + + + + + + + + + + + + + + + + + + + + + + + <_ProjectDependencyFile Include="$(OutputPath)ColorPicker.dll" /> + <_ProjectDependencyFile Include="$(OutputPath)Newtonsoft.Json.dll" /> + <_ProjectDependencyFile Include="$(OutputPath)Hardcodet.NotifyIcon.Wpf.dll" /> + <_ProjectDependencyFile Include="$(OutputPath)JetBrains.Annotations.dll" /> + <_ProjectDependencyFile Include="$(OutputPath)Lierda.WPFHelper.dll" /> + <_ProjectDependencyFile Include="$(OutputPath)Microsoft.Office.Interop.PowerPoint.dll" /> + <_ProjectDependencyFile Include="$(OutputPath)Microsoft.Xaml.Behaviors.dll" /> + <_ProjectDependencyFile Include="$(OutputPath)NHotkey.dll" /> + <_ProjectDependencyFile Include="$(OutputPath)NHotkey.Wpf.dll" /> + <_ProjectDependencyFile Include="$(OutputPath)Ookii.Dialogs.Wpf.dll" /> + <_ProjectDependencyFile Include="$(OutputPath)OSVersionExt.dll" /> + <_ProjectDependencyFile Include="$(OutputPath)System.Buffers.dll" /> + <_ProjectDependencyFile Include="$(OutputPath)System.Memory.dll" /> + <_ProjectDependencyFile Include="$(OutputPath)System.Numerics.Vectors.dll" /> + <_ProjectDependencyFile Include="$(OutputPath)System.Runtime.CompilerServices.Unsafe.dll" /> + <_ProjectDependencyFile Include="$(OutputPath)System.ValueTuple.dll" /> + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + + + + {F935DC20-1CF0-11D0-ADB9-00C04FD58A0B} + 1 + 0 + 0 + tlbimp + False + True + + + {00020430-0000-0000-C000-000000000046} + 2 + 0 + 0 + primary + False + True + + + {0002E157-0000-0000-C000-000000000046} + 5 + 3 + 0 + primary + False + True + + + tlbimp + 0 + 1 + 50a7e9b0-70ef-11d1-b75a-00a0c90564fe + 0 + false + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Never + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + True + Settings.settings + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + Always + + + Always + + + Always + + + + + \ No newline at end of file diff --git a/InkCanvasForClass/MainWindow.xaml.cs b/InkCanvasForClass/MainWindow.xaml.cs index 1728c15..5635407 100644 --- a/InkCanvasForClass/MainWindow.xaml.cs +++ b/InkCanvasForClass/MainWindow.xaml.cs @@ -38,14 +38,10 @@ namespace Ink_Canvas { if (e.Property.Name == nameof(Topmost) && isLoaded) { if (Topmost && Settings.Advanced.IsEnableForceFullScreen) { Trace.WriteLine("Topmost true"); - SetWindowPos(new WindowInteropHelper(this).Handle, new IntPtr(-1), 0, 0, - System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width, - System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height, 0x0040); + SetWindowPos(new WindowInteropHelper(this).Handle, new IntPtr(-1), 0, 0, 0, 0, 0x0002|0x0040|0x0001); } else if (!Topmost && Settings.Advanced.IsEnableForceFullScreen) { Trace.WriteLine("Topmost false"); - SetWindowPos(new WindowInteropHelper(this).Handle, new IntPtr(-2), 0, 0, - System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width, - System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height, 0x0040); + SetWindowPos(new WindowInteropHelper(this).Handle, new IntPtr(-2), 0, 0, 0, 0, 0x0002|0x0040|0x0001); } } } @@ -232,7 +228,9 @@ namespace Ink_Canvas { isLoaded = true; FloatingToolBarV2 = new FloatingToolBarV2(); + FloatingToolBarV2.Topmost = false; FloatingToolBarV2.Show(); + FloatingToolBarV2.Owner = this; BlackBoardLeftSidePageListView.ItemsSource = blackBoardSidePageListViewObservableCollection; BlackBoardRightSidePageListView.ItemsSource = blackBoardSidePageListViewObservableCollection; @@ -276,6 +274,8 @@ namespace Ink_Canvas { }); UpdateIndexInfoDisplay(); + + SetWindowPos(new WindowInteropHelper(this).Handle, new IntPtr(-1), 0, 0, 0, 0, 0x0002|0x0040|0x0001); } private void SystemEventsOnDisplaySettingsChanged(object sender, EventArgs e) { diff --git a/InkCanvasForClass/MainWindow_cs/MW_SettingsToLoad.cs b/InkCanvasForClass/MainWindow_cs/MW_SettingsToLoad.cs index 8156531..3ecd6ec 100644 --- a/InkCanvasForClass/MainWindow_cs/MW_SettingsToLoad.cs +++ b/InkCanvasForClass/MainWindow_cs/MW_SettingsToLoad.cs @@ -92,7 +92,7 @@ namespace Ink_Canvas { RunAsAdminButton.Visibility = Visibility.Collapsed; RunAsUserButton.Visibility = Visibility.Visible; RegistryKey localKey; - if(Environment.Is64BitOperatingSystem) + if (Environment.Is64BitOperatingSystem) localKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64); else localKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32); diff --git a/InkCanvasForClass/Popups/FloatingToolBarV2.xaml b/InkCanvasForClass/Popups/FloatingToolBarV2.xaml index 06334e2..0dea6b2 100644 --- a/InkCanvasForClass/Popups/FloatingToolBarV2.xaml +++ b/InkCanvasForClass/Popups/FloatingToolBarV2.xaml @@ -128,6 +128,15 @@ + + + + + + + + + diff --git a/InkCanvasForClass/Popups/FloatingToolBarV2.xaml.cs b/InkCanvasForClass/Popups/FloatingToolBarV2.xaml.cs index 477e086..e4fd327 100644 --- a/InkCanvasForClass/Popups/FloatingToolBarV2.xaml.cs +++ b/InkCanvasForClass/Popups/FloatingToolBarV2.xaml.cs @@ -741,6 +741,8 @@ namespace Ink_Canvas _mouseDownButton = null; } + #region icc按钮 + public Point prevPoint = new Point(0,0); public bool isInMovingMode = false; public double winLeft = 0; @@ -779,58 +781,126 @@ namespace Ink_Canvas ToolbarV2.RenderTransform = null; ToolBarV2Grid.RenderTransform = null; HeadIconImage.RenderTransform = null; + UpdateToolbarPlacementFeedback(); Top = Math.Max(Math.Min(mp.Y * ScalingFactor - prevPoint.Y - 24, System.Windows.SystemParameters.PrimaryScreenHeight - ActualHeight +24),-24); Left = Math.Max(Math.Min(mp.X * ScalingFactor - prevPoint.X - 24, System.Windows.SystemParameters.PrimaryScreenWidth - ActualWidth +24),-24); } else { double tbMovingX = deltaX/3, tbMovingY = deltaY/3; - if (_snapTypeTemp == ToolBarSnapType.LeftSide) { - tbMovingX = Math.Max(deltaX / 3, 0); - ToolBarV2Grid.RenderTransformOrigin = new Point(0, 0.5); - ToolBarV2Grid.RenderTransform = new ScaleTransform(1 + tbMovingX /350, 1); - } else if (_snapTypeTemp == ToolBarSnapType.RightSide) { - tbMovingX = Math.Min(deltaX / 3, 0); - ToolBarV2Grid.RenderTransformOrigin = new Point(1, 0.5); - ToolBarV2Grid.RenderTransform = new ScaleTransform(1 - tbMovingX /350, 1); - } else if (_snapTypeTemp == ToolBarSnapType.TopSide) { - tbMovingY = Math.Max(deltaY / 3, 0); - ToolBarV2Grid.RenderTransformOrigin = new Point(0.5, 0); - ToolBarV2Grid.RenderTransform = new ScaleTransform(1, 1 + tbMovingY /120); - } else if (_snapTypeTemp == ToolBarSnapType.BottomSide) { - tbMovingY = Math.Min(deltaY / 3, 0); - ToolBarV2Grid.RenderTransformOrigin = new Point(0.5, 1); - ToolBarV2Grid.RenderTransform = new ScaleTransform(1, 1 - tbMovingY /120); - } else if (_snapTypeTemp == ToolBarSnapType.LeftTopCorner) { - tbMovingX = Math.Max(deltaX / 3, 0); - tbMovingY = Math.Max(deltaY / 3, 0); - ToolBarV2Grid.RenderTransformOrigin = new Point(0, 0); - ToolBarV2Grid.RenderTransform = new ScaleTransform(1 + tbMovingX /350, 1 + tbMovingY /120); - } else if (_snapTypeTemp == ToolBarSnapType.LeftBottomCorner) { - tbMovingX = Math.Max(deltaX / 3, 0); - tbMovingY = Math.Min(deltaY / 3, 0); - ToolBarV2Grid.RenderTransformOrigin = new Point(0, 1); - ToolBarV2Grid.RenderTransform = new ScaleTransform(1 + tbMovingX /350, 1 - tbMovingY /120); - } else if (_snapTypeTemp == ToolBarSnapType.RightTopCorner) { - tbMovingX = Math.Min(deltaX / 3, 0); - tbMovingY = Math.Max(deltaY / 3, 0); - ToolBarV2Grid.RenderTransformOrigin = new Point(1, 0); - ToolBarV2Grid.RenderTransform = new ScaleTransform(1 - tbMovingX /350, 1 + tbMovingY /120); - } else if (_snapTypeTemp == ToolBarSnapType.RightBottomCorner) { - tbMovingX = Math.Min(deltaX / 3, 0); - tbMovingY = Math.Min(deltaY / 3, 0); - ToolBarV2Grid.RenderTransformOrigin = new Point(1, 1); - ToolBarV2Grid.RenderTransform = new ScaleTransform(1 - tbMovingX /350, 1 - tbMovingY /120); - } + tbMovingX = (new int[] { 1, 3, 6 }).Contains((int)_snapTypeTemp)?Math.Max(deltaX / 3, 0):tbMovingX; + tbMovingX = (new int[] { 2, 4, 5 }).Contains((int)_snapTypeTemp)?Math.Min(deltaX / 3, 0):tbMovingX; + tbMovingY = (new int[] { 1, 2, 8 }).Contains((int)_snapTypeTemp)?Math.Max(deltaY / 3, 0):tbMovingY; + tbMovingY = (new int[] { 3, 4, 7 }).Contains((int)_snapTypeTemp)?Math.Min(deltaY / 3, 0):tbMovingY; + ToolBarV2Grid.RenderTransformOrigin = new Point( + (new int[] { 1, 3, 6 }).Contains((int)_snapTypeTemp) ? 0 : + (new int[] { 7, 8 }).Contains((int)_snapTypeTemp) ? 0.5 : 1, + (new int[] { 1, 2, 8 }).Contains((int)_snapTypeTemp) ? 0 : + (new int[] { 5, 6 }).Contains((int)_snapTypeTemp) ? 0.5 : 1 + ); + ToolBarV2Grid.RenderTransform = new ScaleTransform( + 1 + (tbMovingX /350)*((new int[] { 1, 3, 6 }).Contains((int)_snapTypeTemp)?1:(new int[] { 2, 4, 5 }).Contains((int)_snapTypeTemp)?-1:0), + 1 + (tbMovingY /120)*((new int[] { 1, 2, 8 }).Contains((int)_snapTypeTemp)?1:(new int[] { 3, 4, 7 }).Contains((int)_snapTypeTemp)?-1:0)); ToolbarV2.RenderTransform = new TranslateTransform(tbMovingX, tbMovingY); HeadIconImage.RenderTransform = new TranslateTransform(tbMovingX / 2, tbMovingY / 2); } } + + #endregion + + private CornerRadius _ltCornerRadius = new CornerRadius(0, 0, 4, 0); + private CornerRadius _lbCornerRadius = new CornerRadius(0, 4, 0, 0); + private CornerRadius _rtCornerRadius = new CornerRadius(0, 0, 0, 4); + private CornerRadius _rbCornerRadius = new CornerRadius(4, 0, 0, 0); + private CornerRadius _tsCornerRadius = new CornerRadius(0, 0, 4, 4); + private CornerRadius _bsCornerRadius = new CornerRadius(4, 4, 0, 0); + + private void UpdateToolbarPlacementFeedback() { + var snapT = SnapType; + var xSideCenter = (System.Windows.SystemParameters.PrimaryScreenWidth - ActualWidth) / 2; + var xDeltaCenter = xSideCenter - Left; + PlaceFeedbackBorder.Width = ActualWidth - 16; + PlaceFeedbackBorder.Height = ActualHeight - 16; + PlacementFeedbackPopup.IsOpen = true; + if (Math.Abs(24 + Top) <= 24 && Math.Abs(24 + Left) <= 24) { + PlacementFeedbackPopup.VerticalOffset = 0; + PlacementFeedbackPopup.HorizontalOffset = 0; + PlaceFeedbackBorder.CornerRadius = _ltCornerRadius; + PlacementFeedbackTipText.VerticalAlignment = VerticalAlignment.Bottom; + PlacementFeedbackTipText.HorizontalAlignment = HorizontalAlignment.Left; + PlacementFeedbackTipText.Text = "左上角"; + } else if (Math.Abs(24 + Left) <= 24 && 24 - (Top + ActualHeight - System.Windows.SystemParameters.PrimaryScreenHeight) <= 24) { + PlacementFeedbackPopup.VerticalOffset = System.Windows.SystemParameters.PrimaryScreenHeight - ActualHeight + 16; + PlacementFeedbackPopup.HorizontalOffset = 0; + PlaceFeedbackBorder.CornerRadius = _lbCornerRadius; + PlacementFeedbackTipText.VerticalAlignment = VerticalAlignment.Top; + PlacementFeedbackTipText.HorizontalAlignment = HorizontalAlignment.Left; + PlacementFeedbackTipText.Text = "左下角"; + } else if (24 - (Left + ActualWidth - System.Windows.SystemParameters.PrimaryScreenWidth) <= 24 && Math.Abs(24 + Top) <= 24) { + PlacementFeedbackPopup.VerticalOffset = 0; + PlacementFeedbackPopup.HorizontalOffset = System.Windows.SystemParameters.PrimaryScreenWidth - ActualWidth + 16; + PlaceFeedbackBorder.CornerRadius = _rtCornerRadius; + PlacementFeedbackTipText.VerticalAlignment = VerticalAlignment.Bottom; + PlacementFeedbackTipText.HorizontalAlignment = HorizontalAlignment.Right; + PlacementFeedbackTipText.Text = "右上角"; + } else if (24 - (Left + ActualWidth - System.Windows.SystemParameters.PrimaryScreenWidth) <= 24 && + 24 - (Top + ActualHeight - System.Windows.SystemParameters.PrimaryScreenHeight) <= 24) { + PlacementFeedbackPopup.VerticalOffset = System.Windows.SystemParameters.PrimaryScreenHeight - ActualHeight + 16; + PlacementFeedbackPopup.HorizontalOffset = System.Windows.SystemParameters.PrimaryScreenWidth - ActualWidth + 16; + PlaceFeedbackBorder.CornerRadius = _rbCornerRadius; + PlacementFeedbackTipText.VerticalAlignment = VerticalAlignment.Top; + PlacementFeedbackTipText.HorizontalAlignment = HorizontalAlignment.Right; + PlacementFeedbackTipText.Text = "右下角"; + } else if (snapT == ToolBarSnapType.TopSide && Math.Abs(xDeltaCenter)<=50) { + PlacementFeedbackPopup.VerticalOffset = 0; + PlacementFeedbackPopup.HorizontalOffset = + (System.Windows.SystemParameters.PrimaryScreenWidth - ActualWidth + 16) / 2; + PlaceFeedbackBorder.CornerRadius = _tsCornerRadius; + PlacementFeedbackTipText.VerticalAlignment = VerticalAlignment.Bottom; + PlacementFeedbackTipText.HorizontalAlignment = HorizontalAlignment.Center; + PlacementFeedbackTipText.Text = "顶部居中"; + } else if (snapT == ToolBarSnapType.BottomSide && Math.Abs(xDeltaCenter)<=90) { + PlacementFeedbackPopup.VerticalOffset = System.Windows.SystemParameters.PrimaryScreenHeight - ActualHeight + 16; + PlacementFeedbackPopup.HorizontalOffset = + (System.Windows.SystemParameters.PrimaryScreenWidth - ActualWidth + 16) / 2; + PlaceFeedbackBorder.CornerRadius = _bsCornerRadius; + PlacementFeedbackTipText.VerticalAlignment = VerticalAlignment.Top; + PlacementFeedbackTipText.HorizontalAlignment = HorizontalAlignment.Center; + PlacementFeedbackTipText.Text = "底部居中"; + } else { + PlacementFeedbackPopup.IsOpen = false; + } + } public FloatingBarItem SelectedItem { get => ToolbarItems.Single(item => item.Selected); } + private void UseNearSnap() { + if (Math.Abs(24 + Top) <= 24 && Math.Abs(24 + Left) <= 24) { + Top = -24; + Left = -24; + } else if ( + 24 - (Left + ActualWidth - System.Windows.SystemParameters.PrimaryScreenWidth) <= 24 && + Math.Abs(24 + Top) <= 24 + ) { + Top = -24; + Left = System.Windows.SystemParameters.PrimaryScreenWidth - ActualWidth + 24; + } else if ( + Math.Abs(24 + Left) <= 24 && + 24 - (Top + ActualHeight - System.Windows.SystemParameters.PrimaryScreenHeight) <= 24 + ) { + Top = System.Windows.SystemParameters.PrimaryScreenHeight - ActualHeight + 24; + Left = -24; + } else if ( + 24 - (Left + ActualWidth - System.Windows.SystemParameters.PrimaryScreenWidth) <= 24 && + 24 - (Top + ActualHeight - System.Windows.SystemParameters.PrimaryScreenHeight) <= 24 + ) { + Top = System.Windows.SystemParameters.PrimaryScreenHeight - ActualHeight + 24; + Left = System.Windows.SystemParameters.PrimaryScreenWidth - ActualWidth + 24; + } + } + private void HeadIconButton_MouseUp(object sender, MouseButtonEventArgs e) { if (_isMouseDownHeadIcon == false) return; _isMouseDownHeadIcon = false; @@ -840,10 +910,12 @@ namespace Ink_Canvas ToolbarV2.RenderTransform = null; ToolBarV2Grid.RenderTransform = null; HeadIconImage.RenderTransform = null; + PlacementFeedbackPopup.IsOpen = false; + UseNearSnap(); if (!isInMovingMode) { var mp = System.Windows.Forms.Control.MousePosition; var mpLogical = new Point(mp.X * ScalingFactor, mp.Y * ScalingFactor); - if (Math.Abs(mpLogical.X - prevPoint.X - winLeft - 24) < 4 || Math.Abs(mpLogical.Y - prevPoint.Y - winTop - 24) < 4) { + if (Math.Abs(mpLogical.X - prevPoint.X - winLeft - 24) < 2.5 || Math.Abs(mpLogical.Y - prevPoint.Y - winTop - 24) < 2.5) { if (ToolBarNowVariantMode == 3) { if (SelectedItem.ToolType != MainWindow.ICCToolsEnum.CursorMode) UpdateToolBarVariant(0); diff --git a/InkCanvasForClass/UIAccessDLL_x64.dll b/InkCanvasForClass/UIAccessDLL_x64.dll new file mode 100644 index 0000000..9edc84b Binary files /dev/null and b/InkCanvasForClass/UIAccessDLL_x64.dll differ diff --git a/InkCanvasForClass/UIAccessDLL_x86.dll b/InkCanvasForClass/UIAccessDLL_x86.dll new file mode 100644 index 0000000..48fe7e3 Binary files /dev/null and b/InkCanvasForClass/UIAccessDLL_x86.dll differ diff --git a/InkCanvasForClass/Windows/SettingsWindow.xaml b/InkCanvasForClass/Windows/SettingsWindow.xaml index 4b27608..b39c028 100644 --- a/InkCanvasForClass/Windows/SettingsWindow.xaml +++ b/InkCanvasForClass/Windows/SettingsWindow.xaml @@ -555,7 +555,7 @@ - + @@ -1314,7 +1314,7 @@ - + @@ -1404,6 +1404,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/README.md b/README.md index d9fcf31..b38e742 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,14 @@ Elegant by Default. Based on `ChangSakura/InkCanvas` . -**这将会是最后一次基于InkCanvas控件的倔强** +一款开源易用的电子教鞭软件,专为课堂教学场景优化设计 + +**这将会是最后一次基于 `InkCanvas` 控件的倔强** [![UPSTREAM](https://img.shields.io/badge/UpStream-InkCanvas%2FInk--Canvas--Artistry-purple.svg "LICENSE")](https://github.com/InkCanvas/Ink-Canvas-Artistry) ![Gitea Last Commit](https://img.shields.io/gitea/last-commit/kriastans/InkCanvasForClass?gitea_url=https%3A%2F%2Fgitea.bliemhax.com%2F) [![LICENSE](https://img.shields.io/badge/License-GPL--3.0-red.svg "LICENSE")](https://gitea.bliemhax.com/kriastans/InkCanvasForClass/src/branch/master/LICENSE) +
[![交流群](https://img.shields.io/badge/-%E4%BA%A4%E6%B5%81%E7%BE%A4%20825759306-blue?style=flat&logo=TencentQQ)]() [![Telegram](https://img.shields.io/badge/-Telegram%20@InkCanvasForClass-blue?style=flat&logo=Telegram)](https://t.me/InkCanvasForClass) @@ -28,7 +31,8 @@ Elegant by Default. Based on `ChangSakura/InkCanvas` . --- - 佛系更新,仅供个人使用,禁止用于商业用途
-- 如有需求请自行修改项目,欢迎您的 Pull Request 和 Issue 提出
+- 开学后更新比较缓慢,请不要催更!
+- 如有需求请自行修改项目,同时也欢迎您的 Pull Request 和 Issue 提出
- **基于 [https://github.com/InkCanvas/Ink-Canvas-Artistry](https://github.com/InkCanvas/Ink-Canvas-Artistry) 开发** > [!important] @@ -45,11 +49,11 @@ Elegant by Default. Based on `ChangSakura/InkCanvas` . InkCanvasForClass 通过为教学环境下班班通设备的使用做出优化,让教学效率大幅度提升: -1. 使用**屏幕批注**功能快速在任何地方书写标记 -2. 使用**快捷白板**迅速开始上课,提升课堂效率 -3. 使用**形状识别**自动纠正手绘形状,提升各教学场景下的作图效率 -4. 使用**形状绘制**进行精确绘图,方便易上手的操作提升了教学作图效率 -5. 使用**随机点名**功能可以活跃课堂气氛,提升学生主动性...... +1. 使用 **`屏幕批注`** 功能快速在任何地方书写标记 +2. 使用 **`快捷白板`** 迅速开始上课,提升课堂效率 +3. 使用 **`形状识别`** 自动纠正手绘形状,提升各教学场景下的作图效率 +4. 使用 **`形状绘制`** 进行精确绘图,方便易上手的操作提升了教学作图效率 +5. 使用 **`随机点名`** 功能可以活跃课堂气氛,提升学生主动性...... ## 功能 @@ -59,31 +63,33 @@ InkCanvasForClass 通过为教学环境下班班通设备的使用做出优化 - [X] PPT 模式下的每页批注 ### ICC 的优化和改进 -- [ ] 浮动工具栏 UI 改进(正在填屎坑) -- [ ] 白板模式 UI 改进(还有背景色和稿纸模式) -- [ ] **鼠标手势**,可以让画布移动缩放,甚至是旋转,都变得更加轻松(正在开发) -- [ ] **全新的设置 UI**,正在逐步清理原项目的屎山 -- [ ] **强制置顶**,保证 ICC 永远显示在所有软件的最顶层 -- [ ] **分辨率和DPI变化监听**,保证 ICC 界面正常显示 -- [ ] **高性能透明**,绘制使用多线程 UI + WindowChrome,摆脱低性能体验 -- [ ] **画面冻结**,使当前画面定格 -- [ ] **重写形状绘制**,让绘图体验更舒适方便,还会支持函数绘制和物理图绘制 -- [ ] **PPT COM+VSTO双接口融合**,缓解 Office 和 WPS 共存导致的 COM 接口被占用的问题 -- [ ] **PPT 系统优化**,高效 PPT 放映状态检测,不丢页不跳页 -- [ ] **禁用边缘手势**,禁用烦人的 Windows10/11 的边缘触摸手势 -- [ ] **点名器优化**,将会支持历史记录和多名单抽选,同时支持特殊配置 -- [ ] **内置小工具**,内置计算器,英汉词典,倒计时,秒表,放大镜,截图等实用小工具 -- [ ] **QuickPanel**,方便快捷的从 ICC 打开所有应用和调整系统设置 -- [ ] **情境化配置**,每位老师都有专属的配置文件 -- [ ] **插件和脚本系统**,支持使用 dotNet Framework 开发原生扩展或使用 Javascript 开发脚本来实现自动化操作或其他扩充功能 -- [ ] **形状识别**,基于微软清朝老库的手绘形状自动识别,并提供形状绘制纠正功能 -- [ ] **板书库**,高效管理所有板书,课程自动分类,提供云端同步 -- [ ] **自动收纳**,检测到教学软件自动开启时会自动隐藏 ICC 界面到屏幕侧边 -- [ ] **自动查杀**,检测到指定软件可以让 ICC 大打出手直接查杀并自动使用 ICC 进行替代 -- [ ] **桌面悬浮窗屏蔽**,隐藏画板悬浮窗,还您一个干净的电脑桌面 +- 浮动工具栏 UI 改进(正在填屎坑) +- 白板模式 UI 改进(还有背景色和稿纸模式) +- **鼠标手势**,可以让画布移动缩放,甚至是旋转,都变得更加轻松(正在开发) +- **全新的设置 UI**,正在逐步清理原项目的屎山 +- **强制置顶**,基于 UIAccess + 输入线程抢夺的方法,保证 ICC 永远显示在所有软件的最顶层 +- **分辨率和DPI变化监听**,保证 ICC 界面正常显示 +- **高性能透明**,绘制使用多线程 UI + WindowChrome,摆脱低性能体验 +- **画面冻结**,使当前画面定格 +- **重写形状绘制**,让绘图体验更舒适方便,还会支持函数绘制和物理图绘制 +- **PPT COM+VSTO双接口融合**,缓解 Office 和 WPS 共存导致的 COM 接口被占用的问题 +- **PPT 系统优化**,高效 PPT 放映状态检测,不丢页不跳页 +- **禁用边缘手势**,禁用烦人的 Windows10/11 的边缘触摸手势 +- **点名器优化**,将会支持历史记录和多名单抽选,同时支持特殊配置 +- **内置小工具**,内置计算器,英汉词典,倒计时,秒表,放大镜,截图等实用小工具 +- **QuickPanel**,方便快捷的从 ICC 打开所有应用和调整系统设置 +- **情境化配置**,每位老师都有专属的配置文件 +- **插件和脚本系统**,支持使用 dotNet Framework 开发原生扩展或使用 Javascript 开发脚本来实现自动化操作或其他扩充功能 +- **形状识别**,基于微软清朝老库的手绘形状自动识别,并提供形状绘制纠正功能 +- **板书库**,高效管理所有板书,课程自动分类,提供云端同步 +- **自动收纳**,检测到教学软件自动开启时会自动隐藏 ICC 界面到屏幕侧边 +- **自动查杀**,检测到指定软件可以让 ICC 大打出手直接查杀并自动使用 ICC 进行替代 +- **桌面悬浮窗屏蔽**,隐藏画板悬浮窗,还您一个干净的电脑桌面 还有其他没有列出... +_注:以上功能不能保证全部都出现在正式版中..._ + ## FAQ ### 壹 - ICC对PPT的相容性如何呢? @@ -105,22 +111,72 @@ ICC 可以支持 WPS,但目前无法同时支持 MSOffice 和 WPS。若要启 ## 特别鸣谢 🍰 **感谢下列同学对本项目的支持,因为有了你们,ICC 才能继续发展下去:** - +🍰 **ICC 使用了下面的开源代码库:** + +1. [**`Hardcodet.NotifyIcon.Wpf`**](https://github.com/hardcodet/wpf-notifyicon)
_An implementation of a NotifyIcon (aka system tray icon or taskbar icon) for the WPF platform._ +2. [**`JetBrains.Annotations`**](https://github.com/JetBrains/JetBrains.Annotations)
_JetBrains.Annotations help reduce false positive warnings, explicitly declare purity and nullability in your code, deal with implicit usages of members, support special semantics of APIs in ASP.NET and XAML frameworks and otherwise increase accuracy of JetBrains Rider and ReSharper code inspections._ +3. [**`Newtonsoft.Json`**](https://github.com/JamesNK/Newtonsoft.Json)
_Popular high-performance JSON framework for .NET_ +4. [**`NHotkey`**](https://github.com/thomaslevesque/NHotkey)
_Easily handle shortcut keys even when your WPF or WinForms app doesn't have focus. Declare hotkeys in XAML with the familiar `KeyBinding` syntax._ +5. [**`Ookii.Dialogs.Wpf`**](https://github.com/ookii-dialogs/ookii-dialogs-wpf)
_A class library for WPF applications providing several common dialogs. Included are classes for task dialogs, credential dialog, progress dialog, and common file dialogs._ +6. [**`OSVersionExt`**](https://github.com/pruggitorg/detect-windows-version)
_Allows you to determine the correct Windows version, since System.Environment.OSVersion.Version in .NET Framework and .NET Core until version 4.8 respectively 3.1 returns wrong results on Windows 10. It works starting with Windows 2000 and also on Windows 11/Windows 10/Server 2022/Server 2019/Server 2016 right away._ +7. [**`PixiEditor.ColorPicker`**](https://github.com/PixiEditor/ColorPicker)
_A collection of various WPF controls used to select colors. Supports .NET Framework 4.5.1+, .NET Core 3.1+, .NET 5 - 7._ +8. [**`Vanara.PInvoke`**](https://github.com/dahall/Vanara)
_This project contains various .NET assemblies that contain P/Invoke functions, interfaces, enums and structures from Windows libraries._ + +🍰 **ICC 被下列开源项目推荐:** + +1. [kriastans/Awesome-Iwb](https://github.com/kriastans/Awesome-Iwb) +2. [Jursin/Awesome-Class-Softwares](https://github.com/Jursin/Awesome-Class-Softwares) + +🍰 **ICC 小量的使用了由 iNKORE Studios 开发的控件库:[`iNKORE.UI.WPF.Modern`](https://github.com/iNKORE-NET/UI.WPF.Modern/)** +
_Modern (Fluent 2) styles and controls for your WPF applications._ + +![alt text](https://github.com/iNKORE-NET/UI.WPF.Modern/raw/main/assets/images/banners/UI.WPF.Modern_Main_1280w.png?raw=true) + +Forks + Stars + Watches + Discussions + Discord + NotYoojun's Twitter + ## 开发 本项目目前开发状态: -- 正在 [`master`](https://github.com/InkCanvasForClass/InkCanvasForClass/tree/master) 分支上开发第一个正式版本 **v20241001R - Black Mamba**。 +- 正在 [`master`](https://github.com/InkCanvasForClass/InkCanvasForClass/tree/master) 分支上开发第一个正式版本 **v6.0.0**。 要在本地编译应用,您需要安装以下负载和工具: -- [.NET Framework 4.7.2](https://dotnet.microsoft.com/en-us/download/dotnet-framework/net472) -- [Visual Studio](https://visualstudio.microsoft.com/) +1. **[.NET Framework 4.7.2](https://dotnet.microsoft.com/en-us/download/dotnet-framework/net472)** +2. [Visual Studio](https://visualstudio.microsoft.com/) 对于 Visual Studio,您需要在安装时勾选以下工作负载: - .NET 桌面开发 +## 子项目 + +**`InkCanvasForClass.IACoreHelper`**
+该项目实现了基于 .NET Framework 4.7.2 和 x86 运行环境的墨迹识别库 IACore 的封装 + +**`InkCanvasForClass.PowerPoint.InteropHelper`**
+该项目将 ICC 的 PPT 适配功能给单独提取了出来,并下方 ZPH 的部分功能到本项目上面 + +**`InkCanvasForClass.PowerPoint.Vsto`**
+该项目实现了 ICC 对 PPT 的 VSTO 插件支持,可以缓解 Office 和 WPS 共存导致的 COM 接口被占用的问题(或者其他任何有关 COM 接口的疑难杂症,只要软件正常,文档不是被保护文档或兼容模式或只读文档,VSTO都能行) + +**`InkCanvasForClassX`**
+该项目已废弃,皆在重写 ICC(💀bro以为自己能够摆脱 IC 的💩山) + ## 开源许可 -本项目基于 GNU General Public License Version 3 进行开源 \ No newline at end of file +**本项目基于 GNU General Public License Version 3 进行开源** + +1. 你可以免费使用、复制、修改、分发受保护程序,但分发时一定要提供源码。 +2. 你可以收费。比如可以针对目标码、源码的分发收费,可以针对软件的维修保养(主要是提供技术支持,以下简称“维保”)收费;但不能收许可费、版税、专利许可费、授权费这类费用。 +3. GPL程序的所有贡献者,自动免费提供了专利许可,承诺不会告人侵犯专利权(前提是你遵守了GPL)。 +4. GPL程序允许别人破解。如果是用在消费类硬件上,要允许人修改并安装程序。 + +## 开发者 + +Doubx690i(Dubi906w/kriastans) `逗比的九百有六大不留` \ No newline at end of file