1145141919810
代码清理
This commit is contained in:
@@ -1,19 +1,15 @@
|
|||||||
using Hardcodet.Wpf.TaskbarNotification;
|
using Hardcodet.Wpf.TaskbarNotification;
|
||||||
using Ink_Canvas.Helpers;
|
using Ink_Canvas.Helpers;
|
||||||
using Ink_Canvas.Windows;
|
|
||||||
using iNKORE.UI.WPF.Modern.Controls;
|
using iNKORE.UI.WPF.Modern.Controls;
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Security;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
using Ink_Canvas.Helpers;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Ink_Canvas.Helpers;
|
|
||||||
|
|
||||||
namespace Ink_Canvas
|
namespace Ink_Canvas
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
using Ink_Canvas.Helpers;
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ using System.IO;
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
using System.Windows.Input;
|
||||||
|
|
||||||
namespace Ink_Canvas.Helpers
|
namespace Ink_Canvas.Helpers
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using Ink_Canvas.Helpers;
|
using System;
|
||||||
using System;
|
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
@@ -46,29 +45,35 @@ namespace Ink_Canvas
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 绑定事件处理
|
// 绑定事件处理
|
||||||
canvas.StylusDown += ((o, args) => {
|
canvas.StylusDown += ((o, args) =>
|
||||||
|
{
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
if (args.StylusDevice.TabletDevice.Type == TabletDeviceType.Stylus) canvas.CaptureStylus();
|
if (args.StylusDevice.TabletDevice.Type == TabletDeviceType.Stylus) canvas.CaptureStylus();
|
||||||
EraserOverlay_PointerDown(sender);
|
EraserOverlay_PointerDown(sender);
|
||||||
});
|
});
|
||||||
canvas.StylusUp += ((o, args) => {
|
canvas.StylusUp += ((o, args) =>
|
||||||
|
{
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
if (args.StylusDevice.TabletDevice.Type == TabletDeviceType.Stylus) canvas.ReleaseStylusCapture();
|
if (args.StylusDevice.TabletDevice.Type == TabletDeviceType.Stylus) canvas.ReleaseStylusCapture();
|
||||||
EraserOverlay_PointerUp(sender);
|
EraserOverlay_PointerUp(sender);
|
||||||
});
|
});
|
||||||
canvas.StylusMove += ((o, args) => {
|
canvas.StylusMove += ((o, args) =>
|
||||||
|
{
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
EraserOverlay_PointerMove(sender, args.GetPosition(inkCanvas));
|
EraserOverlay_PointerMove(sender, args.GetPosition(inkCanvas));
|
||||||
});
|
});
|
||||||
canvas.MouseDown += ((o, args) => {
|
canvas.MouseDown += ((o, args) =>
|
||||||
|
{
|
||||||
canvas.CaptureMouse();
|
canvas.CaptureMouse();
|
||||||
EraserOverlay_PointerDown(sender);
|
EraserOverlay_PointerDown(sender);
|
||||||
});
|
});
|
||||||
canvas.MouseUp += ((o, args) => {
|
canvas.MouseUp += ((o, args) =>
|
||||||
|
{
|
||||||
canvas.ReleaseMouseCapture();
|
canvas.ReleaseMouseCapture();
|
||||||
EraserOverlay_PointerUp(sender);
|
EraserOverlay_PointerUp(sender);
|
||||||
});
|
});
|
||||||
canvas.MouseMove += ((o, args) => {
|
canvas.MouseMove += ((o, args) =>
|
||||||
|
{
|
||||||
EraserOverlay_PointerMove(sender, args.GetPosition(inkCanvas));
|
EraserOverlay_PointerMove(sender, args.GetPosition(inkCanvas));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -11,9 +11,9 @@ using System.Windows.Interop;
|
|||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using System.Windows.Threading;
|
using System.Windows.Threading;
|
||||||
using WinForms = System.Windows.Forms;
|
|
||||||
using File = System.IO.File;
|
using File = System.IO.File;
|
||||||
using OperatingSystem = OSVersionExtension.OperatingSystem;
|
using OperatingSystem = OSVersionExtension.OperatingSystem;
|
||||||
|
using WinForms = System.Windows.Forms;
|
||||||
|
|
||||||
namespace Ink_Canvas
|
namespace Ink_Canvas
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using Ink_Canvas.Helpers;
|
using Ink_Canvas.Helpers;
|
||||||
using Ink_Canvas.Resources;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Media;
|
using System.Media;
|
||||||
using System.Timers;
|
using System.Timers;
|
||||||
@@ -7,7 +6,6 @@ using System.Windows;
|
|||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Interop;
|
using System.Windows.Interop;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
|
|
||||||
namespace Ink_Canvas
|
namespace Ink_Canvas
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
using System;
|
using Ink_Canvas.Helpers;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Drawing;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
@@ -7,15 +9,13 @@ using System.Windows.Input;
|
|||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
using System.Windows.Threading;
|
using System.Windows.Threading;
|
||||||
using System.Drawing;
|
|
||||||
using Ink_Canvas.Helpers;
|
|
||||||
using Brushes = System.Windows.Media.Brushes;
|
using Brushes = System.Windows.Media.Brushes;
|
||||||
using Color = System.Windows.Media.Color;
|
using Color = System.Windows.Media.Color;
|
||||||
using DrawingRectangle = System.Drawing.Rectangle;
|
using DrawingRectangle = System.Drawing.Rectangle;
|
||||||
using WpfPoint = System.Windows.Point;
|
|
||||||
using KeyEventArgs = System.Windows.Input.KeyEventArgs;
|
using KeyEventArgs = System.Windows.Input.KeyEventArgs;
|
||||||
using MouseEventArgs = System.Windows.Input.MouseEventArgs;
|
using MouseEventArgs = System.Windows.Input.MouseEventArgs;
|
||||||
using WpfCanvas = System.Windows.Controls.Canvas;
|
using WpfCanvas = System.Windows.Controls.Canvas;
|
||||||
|
using WpfPoint = System.Windows.Point;
|
||||||
|
|
||||||
namespace Ink_Canvas
|
namespace Ink_Canvas
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
|
using System.IO;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Media.Animation;
|
using System.Windows.Media.Animation;
|
||||||
using System.Windows.Threading;
|
using System.Windows.Threading;
|
||||||
using System.IO;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace Ink_Canvas.Windows
|
namespace Ink_Canvas.Windows
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user