From dc897f3a72c3155598090b0249417301b95eabc5 Mon Sep 17 00:00:00 2001
From: NaBian <836904362@qq.com>
Date: Tue, 7 Jan 2020 22:50:41 +0800
Subject: [PATCH 01/26] Update Growl.cs
---
src/Shared/HandyControl_Shared/Controls/Growl/Growl.cs | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/Shared/HandyControl_Shared/Controls/Growl/Growl.cs b/src/Shared/HandyControl_Shared/Controls/Growl/Growl.cs
index 6267a340..678dc5be 100644
--- a/src/Shared/HandyControl_Shared/Controls/Growl/Growl.cs
+++ b/src/Shared/HandyControl_Shared/Controls/Growl/Growl.cs
@@ -321,10 +321,8 @@ namespace HandyControl.Controls
private void Update()
{
- if (ActionBeforeClose != null)
+ if (Type == InfoType.Ask)
{
- _staysOpen = true;
- _showCloseButton = false;
_panelMore.IsEnabled = true;
_panelMore.Show();
}
@@ -534,12 +532,12 @@ namespace HandyControl.Controls
}
break;
case InfoType.Ask:
+ growlInfo.StaysOpen = true;
+ growlInfo.ShowCloseButton = false;
if (!growlInfo.IsCustom)
{
growlInfo.IconKey = ResourceToken.AskGeometry;
growlInfo.IconBrushKey = ResourceToken.AccentBrush;
- growlInfo.StaysOpen = true;
- growlInfo.ShowCloseButton = false;
}
else
{
@@ -805,7 +803,7 @@ namespace HandyControl.Controls
{
if (invokeActionBeforeClose)
{
- ActionBeforeClose?.Invoke(invokeParam);
+ if (ActionBeforeClose?.Invoke(invokeParam) == false) return;
}
_timerClose?.Stop();
From 9aefdce97daabab2a05cb433d8a99cbf2dca5187 Mon Sep 17 00:00:00 2001
From: NaBian <836904362@qq.com>
Date: Wed, 8 Jan 2020 00:05:24 +0800
Subject: [PATCH 02/26] fixed #272
---
.../Controls/TabControl/TabControl.cs | 36 ++++++++++---------
.../Controls/TabControl/TabItem.cs | 4 +--
2 files changed, 21 insertions(+), 19 deletions(-)
diff --git a/src/Shared/HandyControl_Shared/Controls/TabControl/TabControl.cs b/src/Shared/HandyControl_Shared/Controls/TabControl/TabControl.cs
index bcef77e1..d656468f 100644
--- a/src/Shared/HandyControl_Shared/Controls/TabControl/TabControl.cs
+++ b/src/Shared/HandyControl_Shared/Controls/TabControl/TabControl.cs
@@ -224,11 +224,7 @@ namespace HandyControl.Controls
return;
}
- if (!IsTabFillEnabled)
- {
- _itemShowCount = (int)(ActualWidth / TabItemWidth);
- _buttonOverflow?.Show(ShowOverflowButton && Items.Count > 0 && Items.Count >= _itemShowCount);
- }
+ UpdateOverflowButton();
if (IsInternalAction)
{
@@ -292,15 +288,6 @@ namespace HandyControl.Controls
if (_buttonOverflow != null)
{
- if (ItemsSource != null)
- {
- Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
- }
-
- var size = DesiredSize;
- _itemShowCount = (int)(size.Width / TabItemWidth);
- _buttonOverflow.Show(ShowOverflowButton && Items.Count > 0 && Items.Count >= _itemShowCount);
-
var menu = new ContextMenu
{
Placement = PlacementMode.Bottom,
@@ -312,6 +299,21 @@ namespace HandyControl.Controls
}
}
+ protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
+ {
+ base.OnRenderSizeChanged(sizeInfo);
+ UpdateOverflowButton();
+ }
+
+ private void UpdateOverflowButton()
+ {
+ if (!IsTabFillEnabled)
+ {
+ _itemShowCount = (int)(ActualWidth / TabItemWidth);
+ _buttonOverflow?.Show(ShowOverflowButton && Items.Count > 0 && Items.Count >= _itemShowCount);
+ }
+ }
+
private void Menu_Closed(object sender, RoutedEventArgs e) => _buttonOverflow.IsChecked = false;
private void ButtonScrollRight_Click(object sender, RoutedEventArgs e) =>
@@ -346,7 +348,7 @@ namespace HandyControl.Controls
{
_buttonOverflow.IsChecked = false;
- var list = GetActuaList();
+ var list = GetActualList();
if (list == null) return;
var actualItem = ItemContainerGenerator.ItemFromContainer(item);
@@ -391,7 +393,7 @@ namespace HandyControl.Controls
{
var actualItem = currentItem != null ? ItemContainerGenerator.ItemFromContainer(currentItem) : null;
- var list = GetActuaList();
+ var list = GetActualList();
if (list == null) return;
IsInternalAction = true;
@@ -418,7 +420,7 @@ namespace HandyControl.Controls
SetCurrentValue(SelectedIndexProperty, Items.Count == 0 ? -1 : 0);
}
- internal IList GetActuaList()
+ internal IList GetActualList()
{
IList list;
if (ItemsSource != null)
diff --git a/src/Shared/HandyControl_Shared/Controls/TabControl/TabItem.cs b/src/Shared/HandyControl_Shared/Controls/TabControl/TabItem.cs
index ceddf142..c001fb30 100644
--- a/src/Shared/HandyControl_Shared/Controls/TabControl/TabItem.cs
+++ b/src/Shared/HandyControl_Shared/Controls/TabControl/TabItem.cs
@@ -285,7 +285,7 @@ namespace HandyControl.Controls
parent.IsInternalAction = true;
RaiseEvent(new RoutedEventArgs(ClosedEvent, item));
- var list = parent.GetActuaList();
+ var list = parent.GetActualList();
list?.Remove(item);
}
@@ -392,7 +392,7 @@ namespace HandyControl.Controls
RenderTransform = new TranslateTransform(resultX, 0);
if (index == -1) return;
- var list = parent.GetActuaList();
+ var list = parent.GetActualList();
if (list == null) return;
var item = parent.ItemContainerGenerator.ItemFromContainer(this);
From 1734164f07e38def60ff347c3ef124d8324a5532 Mon Sep 17 00:00:00 2001
From: NaBian <836904362@qq.com>
Date: Wed, 8 Jan 2020 00:24:31 +0800
Subject: [PATCH 03/26] update backers
---
README.md | 1 +
doc/source/handycontrol/tnx/index.md | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index c7f5735d..5d441e75 100644
--- a/README.md
+++ b/README.md
@@ -48,6 +48,7 @@
+
## Special thanks to
diff --git a/doc/source/handycontrol/tnx/index.md b/doc/source/handycontrol/tnx/index.md
index 8f738933..8356fcbf 100644
--- a/doc/source/handycontrol/tnx/index.md
+++ b/doc/source/handycontrol/tnx/index.md
@@ -12,4 +12,4 @@ title: 鸣谢
# 感谢以下捐赠者
-








\ No newline at end of file
+










\ No newline at end of file
From 28e5f7be723eed2dfed74c76404a172c111a3b6c Mon Sep 17 00:00:00 2001
From: Mahdi
Date: Thu, 9 Jan 2020 09:50:34 +0330
Subject: [PATCH 04/26] add korean language #296
---
.../HandyControl_Net_GE45.csproj | 3 +
.../Properties/Langs/Lang.ko-KR.resx | 207 ++++++++++++++++++
2 files changed, 210 insertions(+)
create mode 100644 src/Shared/HandyControl_Shared/Properties/Langs/Lang.ko-KR.resx
diff --git a/src/Net_GE45/HandyControl_Net_GE45/HandyControl_Net_GE45.csproj b/src/Net_GE45/HandyControl_Net_GE45/HandyControl_Net_GE45.csproj
index 8ad765a1..db1055ee 100644
--- a/src/Net_GE45/HandyControl_Net_GE45/HandyControl_Net_GE45.csproj
+++ b/src/Net_GE45/HandyControl_Net_GE45/HandyControl_Net_GE45.csproj
@@ -168,6 +168,9 @@
Properties\Langs\Lang.fr.resx
+
+ Properties\Langs\Lang.ko-KR.resx
+
Properties\Langs\Lang.resx
PublicResXFileCodeGenerator
diff --git a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.ko-KR.resx b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.ko-KR.resx
new file mode 100644
index 00000000..295d0acb
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.ko-KR.resx
@@ -0,0 +1,207 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ 오전
+
+
+ 취소
+
+
+ 여러 명령어 자체를 등록할 수 없습니다
+
+
+ 같은 명령어를 2번 등록할 수 없습니다
+
+
+ 삭제
+
+
+ 닫기
+
+
+ 모두 닫기
+
+
+ 다른 창 모두 닫기
+
+
+ 확인
+
+
+ 잘못된 사진 경로
+
+
+ 잘못된 사진 크기
+
+
+ 형식 오류
+
+
+ 10분 간격
+
+
+ 1시간 간격
+
+
+ 1분 간격
+
+
+ 2시간 간격
+
+
+ 30분 간격
+
+
+ 30초 간격
+
+
+ 5분 간격
+
+
+ 이 칸은 비워둘 수 없습니다
+
+
+ 아니요
+
+
+ 범위를 벗어났습니다
+
+
+ 오후
+
+
+ PNG 사진
+
+
+ 출력
+
+
+ 너무 큽니다
+
+
+ 알 수 없음
+
+
+ 알 수 없는 크기
+
+
+ 네
+
+
\ No newline at end of file
From e10bacc255b9bac28f58813b91bfdcf9da78d0d0 Mon Sep 17 00:00:00 2001
From: DinoChan
Date: Thu, 9 Jan 2020 15:18:47 +0800
Subject: [PATCH 05/26] update DataPicker doc
---
.../extend_controls/datePicker/index.md | 73 ++++++++++++++++++-
1 file changed, 71 insertions(+), 2 deletions(-)
diff --git a/doc/source/handycontrol/extend_controls/datePicker/index.md b/doc/source/handycontrol/extend_controls/datePicker/index.md
index ca12ad62..91806da6 100644
--- a/doc/source/handycontrol/extend_controls/datePicker/index.md
+++ b/doc/source/handycontrol/extend_controls/datePicker/index.md
@@ -1,5 +1,74 @@
---
-title: 建设中
+title: DatePicker
---
-建设中
\ No newline at end of file
+DatePicker 控件允许用户通过在文本框中键入日期或使用下拉的日历控件来选择日期。
+
+``` CS
+[TemplatePart(Name = ElementTextBox, Type = typeof(DatePickerTextBox))]
+public class DatePicker : System.Windows.Controls.DatePicker, IDataInput
+```
+
+# 创建日期选取器
+
+``` XML
+
+```
+
+``` CS
+var datePicker = new DatePicker();
+```
+
+生成的DatePicker如下图所示:
+
+
+
+
+
+# 选择日期
+
+可以通过文本框输入日期,或者点击文本框右边的按钮打开下来的日历控件选择日期。
+
+
+
+也可以在XAML钟或代码中这样设置日期。
+
+``` XML
+
+```
+
+``` CS
+datePicker.SelectedDate = DateTime.Now;
+```
+
+# 设置标题和占位符文本
+
+你可以将 Header(标题)和 Placeholder(占位符)添加到DatePicker,以向用户指示其用途。
+
+``` XML
+
+```
+
+
+
+
+# 属性
+
+| 属性 | |
+| ---------------- | ------------------ |
+| SelectedDate | 获取或设置当前选中的日期 |
+| VerifyFunc | 获取或设置数据验证委托 |
+| IsError | 获取或设置数据是否错误 |
+| ErrorStr | 获取或设置错误提示 |
+| TextType | 获取或设置文本类型 |
+| ShowClearButton | 获取或设置是否显示清除按钮 |
+
+# 方法
+
+| 方法 | |
+| ---------------- | ------------------ |
+| VerifyData() | 验证数据 |
+
From 1fbcccf2231ab7eabb241d05ea94662e45707623 Mon Sep 17 00:00:00 2001
From: NaBian <836904362@qq.com>
Date: Thu, 9 Jan 2020 22:32:47 +0800
Subject: [PATCH 06/26] add demo lang
---
.../HandyControlDemo_Core30.csproj | 3 +
.../HandyControl_Core_30.csproj | 3 +
.../HandyControlDemo_Net_40.csproj | 3 +
.../HandyControl_Net_40.csproj | 3 +
.../HandyControlDemo_Net_GE45.csproj | 3 +
.../Properties/Langs/Lang.en.resx | 6 +-
.../Properties/Langs/Lang.ko-KR.resx | 714 ++++++++++++++++++
.../Properties/Langs/Lang.Designer.cs | 4 +-
.../Properties/Langs/Lang.resx | 4 +-
9 files changed, 736 insertions(+), 7 deletions(-)
create mode 100644 src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ko-KR.resx
diff --git a/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj b/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj
index b343a399..adc0c830 100644
--- a/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj
+++ b/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj
@@ -465,6 +465,9 @@
Properties\Langs\Lang.fr.resx
+
+ Properties\Langs\Lang.ko-KR.resx
+
Properties\Langs\Lang.resx
PublicResXFileCodeGenerator
diff --git a/src/Core_30/HandyControl_Core_30/HandyControl_Core_30.csproj b/src/Core_30/HandyControl_Core_30/HandyControl_Core_30.csproj
index 97e75628..ed8fecd0 100644
--- a/src/Core_30/HandyControl_Core_30/HandyControl_Core_30.csproj
+++ b/src/Core_30/HandyControl_Core_30/HandyControl_Core_30.csproj
@@ -39,6 +39,9 @@
Properties\Langs\Lang.fr.resx
+
+ Properties\Langs\Lang.ko-KR.resx
+
Properties\Langs\Lang.resx
PublicResXFileCodeGenerator
diff --git a/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj b/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj
index dad16ae2..79850bd2 100644
--- a/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj
+++ b/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj
@@ -410,6 +410,9 @@
Properties\Langs\Lang.fr.resx
+
+ Properties\Langs\Lang.ko-KR.resx
+
Properties\Langs\Lang.resx
PublicResXFileCodeGenerator
diff --git a/src/Net_40/HandyControl_Net_40/HandyControl_Net_40.csproj b/src/Net_40/HandyControl_Net_40/HandyControl_Net_40.csproj
index f6d5903f..08bd19be 100644
--- a/src/Net_40/HandyControl_Net_40/HandyControl_Net_40.csproj
+++ b/src/Net_40/HandyControl_Net_40/HandyControl_Net_40.csproj
@@ -98,6 +98,9 @@
Properties\Langs\Lang.fr.resx
+
+ Properties\Langs\Lang.ko-KR.resx
+
Properties\Langs\Lang.resx
PublicResXFileCodeGenerator
diff --git a/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj b/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj
index 3577548d..14b45a8c 100644
--- a/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj
+++ b/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj
@@ -478,6 +478,9 @@
Properties\Langs\Lang.fr.resx
+
+ Properties\Langs\Lang.ko-KR.resx
+
Properties\Langs\Lang.resx
PublicResXFileCodeGenerator
diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx
index c0ee1efa..682dbe38 100644
--- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx
+++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx
@@ -169,7 +169,7 @@
Pagination
- Click to open image browser
+ Click to open image browser
ProgressBar
@@ -232,7 +232,7 @@
Fill in the basic information
- Upload file
+ Upload file
Complete
@@ -319,7 +319,7 @@
Menu
- Right click here
+ Right click here
RadioButton
diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ko-KR.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ko-KR.resx
new file mode 100644
index 00000000..697c1a98
--- /dev/null
+++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ko-KR.resx
@@ -0,0 +1,714 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ About
+
+
+ Add an item
+
+
+ AnimationPath
+
+
+ The tray icon is open and will hide the window instead of closing the program
+
+
+ Ask
+
+
+ Badge
+
+
+ Fill in the basic information
+
+
+ Basic layout
+
+
+ Blink
+
+
+ Blog
+
+
+ Border
+
+
+ Brush
+
+
+ Button
+
+
+ Custom button
+
+
+ ButtonGroup
+
+
+ Calendar
+
+
+ CalendarWithClock
+
+
+ Card
+
+
+ Carousel
+
+
+ Whether to restart to change the language?
+
+
+ ChatBubble
+
+
+ Chatroom
+
+
+ CheckBox
+
+
+ CirclePanel
+
+
+ Clear
+
+
+ Click to count
+
+
+ Clock
+
+
+ ColorPicker
+
+
+ Column offset
+
+
+ Column spacing
+
+
+ ComboBox
+
+
+ Coming Soon
+
+
+ Comment
+
+
+ Common
+
+
+ CompareSlider
+
+
+ Complete
+
+
+ This is the content
+
+
+ Contributors
+
+
+ Controls
+
+
+ CoverFlow
+
+
+ CoverView
+
+
+ Danger
+
+
+ DataGrid
+
+
+ DatePicker
+
+
+ DateTimePicker
+
+
+ Default
+
+
+ Demo
+
+
+ Dialog
+
+
+ Dialog demo
+
+
+ Divider
+
+
+ Documentation
+
+
+ Chinese document
+
+
+ English document
+
+
+ Drag here
+
+
+ Drawer
+
+
+ Effects
+
+
+ Email
+
+
+ Error
+
+
+ Exit
+
+
+ Expander
+
+
+ Fatal
+
+
+ FlipClock
+
+
+ FloatingBlock
+
+
+ GifImage
+
+
+ GotoTop
+
+
+ Gravatar
+
+
+ Grid
+
+
+ GroupBox
+
+
+ Groups
+
+
+ Growl
+
+
+ A new version has been detected!Do you want to update?
+
+
+ Growl demo
+
+
+ Connection failed. please check your network!
+
+
+ The program has crashed~~~
+
+
+ It's a nice day today~~~
+
+
+ File saved successfully!
+
+
+ Disk space is running out!
+
+
+ HatchBrushGenerator
+
+
+ HoneycombPanel
+
+
+ Hybrid layout
+
+
+ Ignore
+
+
+ ImageBlock
+
+
+ ImageBrowser
+
+
+ Index
+
+
+ Info
+
+
+ Interactive Dialog
+
+
+ It's not a phone number
+
+
+ Label
+
+
+ ListBox
+
+
+ ListView
+
+
+ Loading
+
+
+ Magnifier
+
+
+ Menu
+
+
+ MessageBox
+
+
+ Morphing Animation
+
+
+ Name
+
+
+ New window
+
+
+ Next
+
+
+ Notification
+
+
+ NotifyIcon
+
+
+ NumericUpDown
+
+
+ Off
+
+
+ Ok
+
+
+ On
+
+
+ open blur window
+
+
+ open common window
+
+
+ open custom content window
+
+
+ open custom message window
+
+
+ open custom Non-client Area window
+
+
+ Click to open image browser
+
+
+ open message window
+
+
+ open mouse follow window
+
+
+ open no Non-client Area dragable window
+
+
+ Open Panel
+
+
+ Open sprite
+
+
+ OutlineText
+
+
+ Overview
+
+
+ Pagination
+
+
+ PasswordBox
+
+
+ Please input...
+
+
+ Please wait...
+
+
+ Please enter content
+
+
+ please enter email
+
+
+ Please input a keyword
+
+
+ Poptip
+
+
+ top-start;top;top-end;right-start;right;right-end;bottom-end;bottom;bottom-start;left-end;left;left-start
+
+
+ Prev
+
+
+ PreviewSlider
+
+
+ Primary
+
+
+ ProgressBar
+
+
+ ProgressButton
+
+
+ Project
+
+
+ Push to talk
+
+
+ QQ Group
+
+
+ RadioButton
+
+
+ RangeSlider
+
+
+ Rate
+
+
+ Recommendation
+
+
+ Register
+
+
+ RelativePanel
+
+
+ Remark
+
+
+ Remove an item
+
+
+ RepeatButton
+
+
+ Reply
+
+
+ Repository
+
+
+ Responsive layout
+
+
+ RichTextBox
+
+
+ Right click here
+
+
+ RunningBlock
+
+
+ ScrollViewer
+
+
+ SearchBar
+
+
+ Sec
+
+
+ Selected
+
+
+ Send notification
+
+
+ Shield
+
+
+ Show in the current window
+
+
+ Show in the main window
+
+
+ ShowRowNumber
+
+
+ SideMenu
+
+
+ Slider
+
+
+ SplitButton
+
+
+ Sprite
+
+
+ Stays open
+
+
+ Step
+
+
+ StepBar
+
+
+ Styles
+
+
+ Subtitle
+
+
+ Success
+
+
+ TabControl
+
+
+ Tag
+
+
+ Text
+
+
+ TextBlock
+
+
+ TextBox
+
+
+ TextDialog
+
+
+ TextDialog with timer
+
+
+ TimeBar
+
+
+ TimePicker
+
+
+ Prompt
+
+
+ Title
+
+
+ This is the title
+
+
+ This item must be filled in
+
+
+ The title is on the left
+
+
+ ToggleButton
+
+
+ ToolBar
+
+
+ Tools
+
+
+ Transfer
+
+
+ TransitioningContentControl
+
+
+ TreeView
+
+
+ Try to close app?
+
+
+ Type
+
+
+ Upload file
+
+
+ Upload;Uploading
+
+
+ Visibility
+
+
+ Vsix
+
+
+ Warning
+
+
+ WaterfallPanel
+
+
+ Website
+
+
+ Window
+
+
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.Designer.cs b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.Designer.cs
index ea595e1a..d9db4d8d 100644
--- a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.Designer.cs
+++ b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.Designer.cs
@@ -142,7 +142,7 @@ namespace HandyControl.Properties.Langs {
}
///
- /// 查找类似 错误的图片路径! 的本地化字符串。
+ /// 查找类似 错误的图片路径 的本地化字符串。
///
public static string ErrorImgPath {
get {
@@ -151,7 +151,7 @@ namespace HandyControl.Properties.Langs {
}
///
- /// 查找类似 非法的图片尺寸! 的本地化字符串。
+ /// 查找类似 非法的图片尺寸 的本地化字符串。
///
public static string ErrorImgSize {
get {
diff --git a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.resx b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.resx
index 75b1787a..76827085 100644
--- a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.resx
+++ b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.resx
@@ -107,10 +107,10 @@
PNG图片
- 错误的图片路径!
+ 错误的图片路径
- 非法的图片尺寸!
+ 非法的图片尺寸
未知大小
From d8eca3ad2cd429aba9aba6b18953f550d81695d3 Mon Sep 17 00:00:00 2001
From: NaBian <836904362@qq.com>
Date: Fri, 10 Jan 2020 00:32:43 +0800
Subject: [PATCH 07/26] init branch
---
.../HandyControlDemo_Core30.csproj | 5 +-
.../HandyControl_Core_30.csproj | 2 +-
.../HandyControlDemo_Net_40.csproj | 3 +
.../HandyControlDemo_Net_GE45.csproj | 3 +
.../Data/DemoInfo.json | 3 +-
.../Data/MessageToken.cs | 206 +-----------------
.../Data/MessageToken.tt | 138 +-----------
.../HandyControlDemo_Shared.projitems | 7 +
.../Properties/AssemblyInfo.cs | 2 +-
.../Properties/Langs/Lang.Designer.cs | 9 +
.../Properties/Langs/Lang.en.resx | 3 +
.../Properties/Langs/Lang.fa.resx | 3 +
.../Properties/Langs/Lang.fr.resx | 3 +
.../Properties/Langs/Lang.ko-KR.resx | 5 +-
.../Properties/Langs/Lang.resx | 3 +
.../Img/LeftMainContent/Ellipsis_16x.png | Bin 0 -> 196 bytes
.../Controls/PasswordBoxDemoCtl.xaml | 2 +-
.../UserControl/Controls/PinBoxDemoCtl.xaml | 7 +
.../Controls/PinBoxDemoCtl.xaml.cs | 10 +
.../Controls/Input/PinBox.cs | 9 +
.../HandyControl_Shared.projitems | 9 +
.../Properties/AssemblyInfo.cs | 2 +-
.../Themes/Styles/Base/PinBoxBaseStyle.xaml | 9 +
.../Themes/Styles/PinBox.xaml | 10 +
.../Themes/Styles/Style.xaml | 1 +
25 files changed, 119 insertions(+), 335 deletions(-)
create mode 100644 src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/Ellipsis_16x.png
create mode 100644 src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml
create mode 100644 src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml.cs
create mode 100644 src/Shared/HandyControl_Shared/Controls/Input/PinBox.cs
create mode 100644 src/Shared/HandyControl_Shared/Themes/Styles/Base/PinBoxBaseStyle.xaml
create mode 100644 src/Shared/HandyControl_Shared/Themes/Styles/PinBox.xaml
diff --git a/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj b/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj
index adc0c830..b3c41945 100644
--- a/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj
+++ b/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj
@@ -8,7 +8,7 @@
2.4.0
..\..\Shared\HandyControlDemo_Shared\Resources\Img\icon.ico
Debug;Release
- Copyright © HandyOrg 2018-2019
+ Copyright © HandyOrg 2018-2020
2.4.0.0
2.4.0.0
8.0
@@ -454,6 +454,9 @@
Resources\Img\LeftMainContent\Effects_16x.png
+
+ Resources\Img\LeftMainContent\Ellipsis_16x.png
+
diff --git a/src/Core_30/HandyControl_Core_30/HandyControl_Core_30.csproj b/src/Core_30/HandyControl_Core_30/HandyControl_Core_30.csproj
index ed8fecd0..600b0889 100644
--- a/src/Core_30/HandyControl_Core_30/HandyControl_Core_30.csproj
+++ b/src/Core_30/HandyControl_Core_30/HandyControl_Core_30.csproj
@@ -8,7 +8,7 @@
2.4.0.0
false
false
- Copyright © HandyOrg 2018-2019
+ Copyright © HandyOrg 2018-2020
Contains some commonly used simple WPF controls
Debug;Release
8.0
diff --git a/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj b/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj
index 79850bd2..d2ee3658 100644
--- a/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj
+++ b/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj
@@ -520,6 +520,9 @@
Resources\Img\LeftMainContent\RepeatButton_16x.png
+
+ Resources\Img\LeftMainContent\Ellipsis_16x.png
+
diff --git a/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj b/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj
index 14b45a8c..9b86a79e 100644
--- a/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj
+++ b/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj
@@ -583,6 +583,9 @@
Resources\Img\LeftMainContent\MainMenuControl_16x.png
+
+ Resources\Img\LeftMainContent\Ellipsis_16x.png
+
diff --git a/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json b/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json
index 18f69028..e10713f7 100644
--- a/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json
+++ b/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json
@@ -50,6 +50,7 @@
[ "TextBox", "TextBoxDemoCtl", "TextBox_16x", "" ],
[ "ComboBox", "ComboBoxDemoCtl", "ComboBox_16x", "" ],
[ "PasswordBox", "PasswordBoxDemoCtl", "PasswordBox_16x", "" ],
+ [ "PinBox", "PinBoxDemoCtl", "Ellipsis_16x", "1" ],
[ "DatePicker", "DatePickerDemoCtl", "DatePicker_16x", "" ],
[ "Clock", "ClockDemoCtl", "Time_color_16x", "" ],
[ "TimePicker", "TimePickerDemoCtl", "TimePicker_16x", "" ],
@@ -65,7 +66,7 @@
[ "OutlineText", "OutlineTextDemoCtl", "TextBlock_16x", "" ],
[ "RunningBlock", "RunningBlockDemoCtl", "Dynamic_16x", "" ],
[ "Card", "CardDemoCtl", "VSO_Card_16x", "" ],
- [ "Divider", "DividerDemoCtl", "DottedSplitter_16x", "1" ],
+ [ "Divider", "DividerDemoCtl", "DottedSplitter_16x", "" ],
[ "CirclePanel", "CirclePanelDemoCtl", "ColorWheel_16x", "" ],
[ "Grid", "GridDemoCtl", "GridPane_16x", "" ],
[ "RelativePanel", "RelativePanelDemoCtl", "TransformRelative_16x", "1" ],
diff --git a/src/Shared/HandyControlDemo_Shared/Data/MessageToken.cs b/src/Shared/HandyControlDemo_Shared/Data/MessageToken.cs
index 5c4cab57..5d039b04 100644
--- a/src/Shared/HandyControlDemo_Shared/Data/MessageToken.cs
+++ b/src/Shared/HandyControlDemo_Shared/Data/MessageToken.cs
@@ -2,202 +2,6 @@
{
public class MessageToken
{
- /*-------------------- Controls --------------------*/
-
- public static readonly string GrowlDemoCtl = nameof(GrowlDemoCtl);
-
- public static readonly string LoadingDemoCtl = nameof(LoadingDemoCtl);
-
- public static readonly string ImageBrowserDemoCtl = nameof(ImageBrowserDemoCtl);
-
- public static readonly string ColorPickerDemoCtl = nameof(ColorPickerDemoCtl);
-
- public static readonly string CarouselDemoCtl = nameof(CarouselDemoCtl);
-
- public static readonly string CompareSliderDemoCtl = nameof(CompareSliderDemoCtl);
-
- public static readonly string TimeBarDemoCtl = nameof(TimeBarDemoCtl);
-
- public static readonly string PaginationDemoCtl = nameof(PaginationDemoCtl);
-
- public static readonly string AnimationPathDemoCtl = nameof(AnimationPathDemoCtl);
-
- public static readonly string StepBarDemoCtl = nameof(StepBarDemoCtl);
-
- public static readonly string ClockDemoCtl = nameof(ClockDemoCtl);
-
- public static readonly string TimePickerDemoCtl = nameof(TimePickerDemoCtl);
-
- public static readonly string CirclePanelDemoCtl = nameof(CirclePanelDemoCtl);
-
- public static readonly string NumericUpDownDemoCtl = nameof(NumericUpDownDemoCtl);
-
- public static readonly string WindowDemoCtl = nameof(WindowDemoCtl);
-
- public static readonly string ScrollViewerDemoCtl = nameof(ScrollViewerDemoCtl);
-
- public static readonly string PreviewSliderDemoCtl = nameof(PreviewSliderDemoCtl);
-
- public static readonly string ProgressBarDemoCtl = nameof(ProgressBarDemoCtl);
-
- public static readonly string TextBoxDemoCtl = nameof(TextBoxDemoCtl);
-
- public static readonly string ComboBoxDemoCtl = nameof(ComboBoxDemoCtl);
-
- public static readonly string PasswordBoxDemoCtl = nameof(PasswordBoxDemoCtl);
-
- public static readonly string DatePickerDemoCtl = nameof(DatePickerDemoCtl);
-
- public static readonly string DateTimePickerDemoCtl = nameof(DateTimePickerDemoCtl);
-
- public static readonly string CalendarWithClockDemoCtl = nameof(CalendarWithClockDemoCtl);
-
- public static readonly string SearchBarDemoCtl = nameof(SearchBarDemoCtl);
-
- public static readonly string TagDemoCtl = nameof(TagDemoCtl);
-
- public static readonly string GifImageDemoCtl = nameof(GifImageDemoCtl);
-
- public static readonly string OutlineTextDemoCtl = nameof(OutlineTextDemoCtl);
-
- public static readonly string FlipClockDemoCtl = nameof(FlipClockDemoCtl);
-
- public static readonly string QQGroupView = nameof(QQGroupView);
-
- public static readonly string BlurWindow = nameof(BlurWindow);
-
- public static readonly string NoNonClientAreaDragableWindow = nameof(NoNonClientAreaDragableWindow);
-
- public static readonly string RateDemoCtl = nameof(RateDemoCtl);
-
- public static readonly string ShieldDemoCtl = nameof(ShieldDemoCtl);
-
- public static readonly string WaterfallPanelDemoCtl = nameof(WaterfallPanelDemoCtl);
-
- public static readonly string CoverViewDemoCtl = nameof(CoverViewDemoCtl);
-
- public static readonly string CoverFlowDemoCtl = nameof(CoverFlowDemoCtl);
-
- public static readonly string ProgressButtonDemoCtl = nameof(ProgressButtonDemoCtl);
-
- public static readonly string TransferDemoCtl = nameof(TransferDemoCtl);
-
- public static readonly string ChatBubbleDemoCtl = nameof(ChatBubbleDemoCtl);
-
- public static readonly string GotoTopDemoCtl = nameof(GotoTopDemoCtl);
-
- public static readonly string NotifyIconDemoCtl = nameof(NotifyIconDemoCtl);
-
- public static readonly string BadgeDemoCtl = nameof(BadgeDemoCtl);
-
- public static readonly string GravatarDemoCtl = nameof(GravatarDemoCtl);
-
- public static readonly string DialogDemoCtl = nameof(DialogDemoCtl);
-
- public static readonly string SideMenuDemoCtl = nameof(SideMenuDemoCtl);
-
- public static readonly string GridDemoCtl = nameof(GridDemoCtl);
-
- public static readonly string PoptipDemoCtl = nameof(PoptipDemoCtl);
-
- public static readonly string RangeSliderDemoCtl = nameof(RangeSliderDemoCtl);
-
- public static readonly string ButtonGroupDemoCtl = nameof(ButtonGroupDemoCtl);
-
- public static readonly string CardDemoCtl = nameof(CardDemoCtl);
-
- public static readonly string MagnifierDemoCtl = nameof(MagnifierDemoCtl);
-
- public static readonly string ImageBlockDemoCtl = nameof(ImageBlockDemoCtl);
-
- public static readonly string RunningBlockDemoCtl = nameof(RunningBlockDemoCtl);
-
- public static readonly string HoneycombPanelDemoCtl = nameof(HoneycombPanelDemoCtl);
-
- public static readonly string SpriteDemoCtl = nameof(SpriteDemoCtl);
-
- public static readonly string NotificationDemoCtl = nameof(NotificationDemoCtl);
-
- public static readonly string FloatingBlockDemoCtl = nameof(FloatingBlockDemoCtl);
-
- public static readonly string SplitButtonDemoCtl = nameof(SplitButtonDemoCtl);
-
- public static readonly string DividerDemoCtl = nameof(DividerDemoCtl);
-
- public static readonly string TransitioningContentControlDemoCtl = nameof(TransitioningContentControlDemoCtl);
-
- /*-------------------- Tools --------------------*/
-
- public static readonly string HatchBrushGeneratorDemoCtl = nameof(HatchBrushGeneratorDemoCtl);
-
- public static readonly string GeometryAnimationDemoCtl = nameof(GeometryAnimationDemoCtl);
-
- /*-------------------- Styles --------------------*/
-
- public static readonly string ButtonDemoCtl = nameof(ButtonDemoCtl);
-
- public static readonly string RepeatButtonDemoCtl = nameof(RepeatButtonDemoCtl);
-
- public static readonly string ToggleButtonDemoCtl = nameof(ToggleButtonDemoCtl);
-
- public static readonly string ExpanderDemoCtl = nameof(ExpanderDemoCtl);
-
- public static readonly string NativeProgressBarDemoCtl = nameof(NativeProgressBarDemoCtl);
-
- public static readonly string TabControlDemoCtl = nameof(TabControlDemoCtl);
-
- public static readonly string CalendarDemoCtl = nameof(CalendarDemoCtl);
-
- public static readonly string NativeDatePickerDemoCtl = nameof(NativeDatePickerDemoCtl);
-
- public static readonly string NativeTextBoxDemoCtl = nameof(NativeTextBoxDemoCtl);
-
- public static readonly string TextBlockDemoCtl = nameof(TextBlockDemoCtl);
-
- public static readonly string NativeComboBoxDemoCtl = nameof(NativeComboBoxDemoCtl);
-
- public static readonly string NativePasswordBoxDemoCtl = nameof(NativePasswordBoxDemoCtl);
-
- public static readonly string NativeTabControlDemoCtl = nameof(NativeTabControlDemoCtl);
-
- public static readonly string DataGridDemoCtl = nameof(DataGridDemoCtl);
-
- public static readonly string CheckBoxDemoCtl = nameof(CheckBoxDemoCtl);
-
- public static readonly string ListBoxDemoCtl = nameof(ListBoxDemoCtl);
-
- public static readonly string MenuDemoCtl = nameof(MenuDemoCtl);
-
- public static readonly string TreeViewDemoCtl = nameof(TreeViewDemoCtl);
-
- public static readonly string BorderDemoCtl = nameof(BorderDemoCtl);
-
- public static readonly string RadioButtonDemoCtl = nameof(RadioButtonDemoCtl);
-
- public static readonly string NativeScrollViewerDemoCtl = nameof(NativeScrollViewerDemoCtl);
-
- public static readonly string BrushDemoCtl = nameof(BrushDemoCtl);
-
- public static readonly string SliderDemoCtl = nameof(SliderDemoCtl);
-
- public static readonly string GroupBoxDemoCtl = nameof(GroupBoxDemoCtl);
-
- public static readonly string ListViewDemoCtl = nameof(ListViewDemoCtl);
-
- public static readonly string RichTextBoxDemoCtl = nameof(RichTextBoxDemoCtl);
-
- public static readonly string ToolBarDemoCtl = nameof(ToolBarDemoCtl);
-
- public static readonly string LabelDemoCtl = nameof(LabelDemoCtl);
-
- /*-------------------- Windows --------------------*/
-
- public static readonly string CommonWindow = nameof(CommonWindow);
-
- public static readonly string CustomNonClientAreaWindow = nameof(CustomNonClientAreaWindow);
-
- /*-------------------- Messages --------------------*/
-
public static readonly string LoadShowContent = nameof(LoadShowContent);
public static readonly string FullSwitch = nameof(FullSwitch);
@@ -226,5 +30,15 @@
public static readonly string NotifyIconContextDemo = nameof(NotifyIconContextDemo);
+ public static readonly string CommonWindow = nameof(CommonWindow);
+
+ public static readonly string BlurWindow = nameof(BlurWindow);
+
+ public static readonly string CustomNonClientAreaWindow = nameof(CustomNonClientAreaWindow);
+
+ public static readonly string NoNonClientAreaDragableWindow = nameof(NoNonClientAreaDragableWindow);
+
+ public static readonly string QQGroupView = nameof(QQGroupView);
+
}
}
\ No newline at end of file
diff --git a/src/Shared/HandyControlDemo_Shared/Data/MessageToken.tt b/src/Shared/HandyControlDemo_Shared/Data/MessageToken.tt
index 75d66f65..885626a9 100644
--- a/src/Shared/HandyControlDemo_Shared/Data/MessageToken.tt
+++ b/src/Shared/HandyControlDemo_Shared/Data/MessageToken.tt
@@ -2,111 +2,6 @@
<#@ import namespace="System.Collections.Generic"#>
<#@ output extension=".cs" #>
<#
-var controlList = new List
-{
- "GrowlDemoCtl",
- "LoadingDemoCtl",
- "ImageBrowserDemoCtl",
- "ColorPickerDemoCtl",
- "CarouselDemoCtl",
- "CompareSliderDemoCtl",
- "TimeBarDemoCtl",
- "PaginationDemoCtl",
- "AnimationPathDemoCtl",
- "StepBarDemoCtl",
- "ClockDemoCtl",
- "TimePickerDemoCtl",
- "CirclePanelDemoCtl",
- "NumericUpDownDemoCtl",
- "WindowDemoCtl",
- "ScrollViewerDemoCtl",
- "PreviewSliderDemoCtl",
- "ProgressBarDemoCtl",
- "TextBoxDemoCtl",
- "ComboBoxDemoCtl",
- "PasswordBoxDemoCtl",
- "DatePickerDemoCtl",
- "DateTimePickerDemoCtl",
- "CalendarWithClockDemoCtl",
- "SearchBarDemoCtl",
- "TagDemoCtl",
- "GifImageDemoCtl",
- "OutlineTextDemoCtl",
- "FlipClockDemoCtl",
- "QQGroupView",
- "BlurWindow",
- "NoNonClientAreaDragableWindow",
- "RateDemoCtl",
- "ShieldDemoCtl",
- "WaterfallPanelDemoCtl",
- "CoverViewDemoCtl",
- "CoverFlowDemoCtl",
- "ProgressButtonDemoCtl",
- "TransferDemoCtl",
- "ChatBubbleDemoCtl",
- "GotoTopDemoCtl",
- "NotifyIconDemoCtl",
- "BadgeDemoCtl",
- "GravatarDemoCtl",
- "DialogDemoCtl",
- "SideMenuDemoCtl",
- "GridDemoCtl",
- "PoptipDemoCtl",
- "RangeSliderDemoCtl",
- "ButtonGroupDemoCtl",
- "CardDemoCtl",
- "MagnifierDemoCtl",
- "ImageBlockDemoCtl",
- "RunningBlockDemoCtl",
- "HoneycombPanelDemoCtl",
- "SpriteDemoCtl",
- "NotificationDemoCtl",
- "FloatingBlockDemoCtl",
- "SplitButtonDemoCtl",
- "DividerDemoCtl",
- "TransitioningContentControlDemoCtl"
-};
-var styleList = new List
-{
- "ButtonDemoCtl",
- "RepeatButtonDemoCtl",
- "ToggleButtonDemoCtl",
- "ExpanderDemoCtl",
- "NativeProgressBarDemoCtl",
- "TabControlDemoCtl",
- "CalendarDemoCtl",
- "NativeDatePickerDemoCtl",
- "NativeTextBoxDemoCtl",
- "TextBlockDemoCtl",
- "NativeComboBoxDemoCtl",
- "NativePasswordBoxDemoCtl",
- "NativeTabControlDemoCtl",
- "DataGridDemoCtl",
- "CheckBoxDemoCtl",
- "ListBoxDemoCtl",
- "MenuDemoCtl",
- "TreeViewDemoCtl",
- "BorderDemoCtl",
- "RadioButtonDemoCtl",
- "NativeScrollViewerDemoCtl",
- "BrushDemoCtl",
- "SliderDemoCtl",
- "GroupBoxDemoCtl",
- "ListViewDemoCtl",
- "RichTextBoxDemoCtl",
- "ToolBarDemoCtl",
- "LabelDemoCtl"
-};
-var toolList = new List
-{
- "HatchBrushGeneratorDemoCtl",
- "GeometryAnimationDemoCtl"
-};
-var windowList = new List
-{
- "CommonWindow",
- "CustomNonClientAreaWindow"
-};
var messageList = new List
{
"LoadShowContent",
@@ -122,39 +17,18 @@ var messageList = new List
"BlogsView",
"WebsitesView",
"NotifyIconDemo",
- "NotifyIconContextDemo"
+ "NotifyIconContextDemo",
+ "CommonWindow",
+ "BlurWindow",
+ "CustomNonClientAreaWindow",
+ "NoNonClientAreaDragableWindow",
+ "QQGroupView"
};
#>
namespace HandyControlDemo.Data
{
public class MessageToken
{
- /*-------------------- Controls --------------------*/
-
- <#foreach(var item in controlList){#>
- public static readonly string <#=item#> = nameof(<#=item#>);
-
- <#}#>
- /*-------------------- Tools --------------------*/
-
- <#foreach(var item in toolList){#>
- public static readonly string <#=item#> = nameof(<#=item#>);
-
- <#}#>
- /*-------------------- Styles --------------------*/
-
- <#foreach(var item in styleList){#>
- public static readonly string <#=item#> = nameof(<#=item#>);
-
- <#}#>
- /*-------------------- Windows --------------------*/
-
- <#foreach(var item in windowList){#>
- public static readonly string <#=item#> = nameof(<#=item#>);
-
- <#}#>
- /*-------------------- Messages --------------------*/
-
<#foreach(var item in messageList){#>
public static readonly string <#=item#> = nameof(<#=item#>);
diff --git a/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems b/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems
index 57b7c22a..e9b3c59e 100644
--- a/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems
+++ b/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems
@@ -80,6 +80,9 @@
NotificationDemoCtl.xaml
+
+ PinBoxDemoCtl.xaml
+
RangeSliderDemoCtl.xaml
@@ -513,6 +516,10 @@
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
diff --git a/src/Shared/HandyControlDemo_Shared/Properties/AssemblyInfo.cs b/src/Shared/HandyControlDemo_Shared/Properties/AssemblyInfo.cs
index fca449dd..7c03ec55 100644
--- a/src/Shared/HandyControlDemo_Shared/Properties/AssemblyInfo.cs
+++ b/src/Shared/HandyControlDemo_Shared/Properties/AssemblyInfo.cs
@@ -8,7 +8,7 @@ using System.Windows;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("HandyControlDemo")]
-[assembly: AssemblyCopyright("Copyright © HandyOrg 2018-2019")]
+[assembly: AssemblyCopyright("Copyright © HandyOrg 2018-2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs
index 14c08812..7c2eff9a 100644
--- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs
+++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs
@@ -1131,6 +1131,15 @@ namespace HandyControlDemo.Properties.Langs {
}
}
+ ///
+ /// 查找类似 PIN码框 的本地化字符串。
+ ///
+ public static string PinBox {
+ get {
+ return ResourceManager.GetString("PinBox", resourceCulture);
+ }
+ }
+
///
/// 查找类似 请输入... 的本地化字符串。
///
diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx
index 682dbe38..82034ede 100644
--- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx
+++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx
@@ -711,4 +711,7 @@
Demo
+
+ PinBox
+
\ No newline at end of file
diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fa.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fa.resx
index 4ea3c493..d6102272 100644
--- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fa.resx
+++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fa.resx
@@ -711,4 +711,7 @@
Demo
+
+ PinBox
+
\ No newline at end of file
diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fr.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fr.resx
index dcc76a17..95a79a20 100644
--- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fr.resx
+++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fr.resx
@@ -711,4 +711,7 @@
Demo
+
+ PinBox
+
\ No newline at end of file
diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ko-KR.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ko-KR.resx
index 697c1a98..6c0bf75a 100644
--- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ko-KR.resx
+++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ko-KR.resx
@@ -1,4 +1,4 @@
-
+
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml
new file mode 100644
index 00000000..77c4a6f4
--- /dev/null
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml
@@ -0,0 +1,7 @@
+
+
+
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml.cs
new file mode 100644
index 00000000..dc8f65fd
--- /dev/null
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml.cs
@@ -0,0 +1,10 @@
+namespace HandyControlDemo.UserControl
+{
+ public partial class PinBoxDemoCtl
+ {
+ public PinBoxDemoCtl()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/src/Shared/HandyControl_Shared/Controls/Input/PinBox.cs b/src/Shared/HandyControl_Shared/Controls/Input/PinBox.cs
new file mode 100644
index 00000000..86634976
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Controls/Input/PinBox.cs
@@ -0,0 +1,9 @@
+using System.Windows.Controls;
+
+namespace HandyControl.Controls
+{
+ public class PinBox : Control
+ {
+
+ }
+}
diff --git a/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems b/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems
index 4af77f44..32cab771 100644
--- a/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems
+++ b/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems
@@ -25,6 +25,7 @@
+
@@ -393,6 +394,14 @@
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
diff --git a/src/Shared/HandyControl_Shared/Properties/AssemblyInfo.cs b/src/Shared/HandyControl_Shared/Properties/AssemblyInfo.cs
index 8b80dbb4..46ac97c7 100644
--- a/src/Shared/HandyControl_Shared/Properties/AssemblyInfo.cs
+++ b/src/Shared/HandyControl_Shared/Properties/AssemblyInfo.cs
@@ -8,7 +8,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("HandyControl")]
-[assembly: AssemblyCopyright("Copyright © HandyOrg 2018-2019")]
+[assembly: AssemblyCopyright("Copyright © HandyOrg 2018-2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Base/PinBoxBaseStyle.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Base/PinBoxBaseStyle.xaml
new file mode 100644
index 00000000..98d80b3f
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/Base/PinBoxBaseStyle.xaml
@@ -0,0 +1,9 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/PinBox.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/PinBox.xaml
new file mode 100644
index 00000000..1ad0f94d
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/PinBox.xaml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Style.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Style.xaml
index 62a380e9..308b65d4 100644
--- a/src/Shared/HandyControl_Shared/Themes/Styles/Style.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/Style.xaml
@@ -78,6 +78,7 @@
+
\ No newline at end of file
From dc7ce06e6a64a388954b96834c769beea93b0637 Mon Sep 17 00:00:00 2001
From: DinoChan
Date: Fri, 10 Jan 2020 13:06:45 +0800
Subject: [PATCH 08/26] update doc
---
.../calendarWithClock/index.md | 65 ++++++++++++-
.../extend_controls/datePicker/index.md | 12 +--
.../extend_controls/dateTimePicker/index.md | 81 +++++++++++++++-
.../extend_controls/timePicker/index.md | 94 ++++++++++++++++++-
4 files changed, 240 insertions(+), 12 deletions(-)
diff --git a/doc/source/handycontrol/extend_controls/calendarWithClock/index.md b/doc/source/handycontrol/extend_controls/calendarWithClock/index.md
index ca12ad62..1705ddf9 100644
--- a/doc/source/handycontrol/extend_controls/calendarWithClock/index.md
+++ b/doc/source/handycontrol/extend_controls/calendarWithClock/index.md
@@ -1,5 +1,66 @@
---
-title: 建设中
+title: CalendarWithClock
---
-建设中
\ No newline at end of file
+
+CalendarWithClock 控件由日历和时钟组成,允许用户通过鼠标选择日期和时间。
+
+``` CS
+[TemplatePart(Name = ElementButtonConfirm, Type = typeof(Button))]
+[TemplatePart(Name = ElementClockPresenter, Type = typeof(ContentPresenter))]
+[TemplatePart(Name = ElementCalendarPresenter, Type = typeof(ContentPresenter))]
+public class CalendarWithClock : Control
+```
+
+# 创建日期选取器
+
+``` XML
+
+```
+
+``` CS
+var dateTimePicker = new CalendarWithClock();
+```
+
+生成的CalendarWithClock如下图所示:
+
+
+
+
+
+# 选择日期和时间
+
+通过鼠标分别在日历和时钟上选择日期和时间,然后点击 **确定** 按钮即可更新CalendarWithClock控件的日期和时间。
+
+
+也可以在XAML钟或代码中这样设置日期。
+
+``` XML
+
+```
+
+``` CS
+calendarWithClock.SelectedDateTime = DateTime.Now;
+```
+
+
+
+# 属性
+
+| 属性 | 描述 |
+| ---------------- | ------------------ |
+| SelectedDateTime | 获取或设置当前选中的日期和时间 |
+| DateTimeFormat | 获取或设置用于显示选定日期和时间的格式 |
+| DisplayDateTime | 获取或设置要显示的日期 |
+| ShowConfirmButton | 获取或设置一个值,该值指示是是否显示 **确定** 按钮 |
+| VerifyFunc | 获取或设置数据验证委托 |
+| IsError | 获取或设置数据是否错误 |
+| ErrorStr | 获取或设置错误提示 |
+| TextType | 获取或设置文本类型 |
+| ShowClearButton | 获取或设置是否显示清除按钮 |
+
+# 方法
+
+| 方法 | 描述 |
+| ---------------- | ------------------ |
+| VerifyData() | 验证数据 |
\ No newline at end of file
diff --git a/doc/source/handycontrol/extend_controls/datePicker/index.md b/doc/source/handycontrol/extend_controls/datePicker/index.md
index 91806da6..f61a8282 100644
--- a/doc/source/handycontrol/extend_controls/datePicker/index.md
+++ b/doc/source/handycontrol/extend_controls/datePicker/index.md
@@ -9,7 +9,7 @@ DatePicker 控件允许用户通过在文本框中键入日期或使用下拉的
public class DatePicker : System.Windows.Controls.DatePicker, IDataInput
```
-# 创建日期选取器
+# 创建DatePicker
``` XML
@@ -21,15 +21,15 @@ var datePicker = new DatePicker();
生成的DatePicker如下图所示:
-
+
# 选择日期
-可以通过文本框输入日期,或者点击文本框右边的按钮打开下来的日历控件选择日期。
+可以通过文本框输入日期,或者点击文本框右边的按钮打开下拉的日历控件选择日期。
-
+
也可以在XAML钟或代码中这样设置日期。
@@ -57,7 +57,7 @@ datePicker.SelectedDate = DateTime.Now;
# 属性
-| 属性 | |
+| 属性 | 描述 |
| ---------------- | ------------------ |
| SelectedDate | 获取或设置当前选中的日期 |
| VerifyFunc | 获取或设置数据验证委托 |
@@ -68,7 +68,7 @@ datePicker.SelectedDate = DateTime.Now;
# 方法
-| 方法 | |
+| 方法 | 描述 |
| ---------------- | ------------------ |
| VerifyData() | 验证数据 |
diff --git a/doc/source/handycontrol/extend_controls/dateTimePicker/index.md b/doc/source/handycontrol/extend_controls/dateTimePicker/index.md
index ca12ad62..f7e35f45 100644
--- a/doc/source/handycontrol/extend_controls/dateTimePicker/index.md
+++ b/doc/source/handycontrol/extend_controls/dateTimePicker/index.md
@@ -1,5 +1,82 @@
---
-title: 建设中
+title: DateTimePicker
---
-建设中
\ No newline at end of file
+
+DatePicker 控件允许用户通过在文本框中键入日期和时间,或使用下拉的日历控件来选择日期和时间。
+
+``` CS
+[TemplatePart(Name = ElementRoot, Type = typeof(Grid))]
+[TemplatePart(Name = ElementTextBox, Type = typeof(WatermarkTextBox))]
+[TemplatePart(Name = ElementButton, Type = typeof(Button))]
+[TemplatePart(Name = ElementPopup, Type = typeof(Popup))]
+public class DateTimePicker : Control, IDataInput
+```
+
+# 创建DateTimePicker
+
+``` XML
+
+```
+
+``` CS
+var dateTimePicker = new DateTimePicker();
+```
+
+生成的DateTimePicker如下图所示:
+
+
+
+
+
+# 选择日期和时间
+
+可以通过文本框输入日期和时间,或者点击文本框右边的按钮打开下拉的日历和时钟控件选择日期和时间。
+
+
+
+也可以在XAML钟或代码中这样设置日期。
+
+``` XML
+
+```
+
+``` CS
+dateTimePicker.SelectedDateTime = DateTime.Now;
+```
+
+# 设置标题和占位符文本
+
+你可以将 Header(标题)和 Placeholder(占位符)添加到DatePicker,以向用户指示其用途。要使用这两个属性,首先需要应用 **DateTimePickerExtend** 或 **DateTimePickerPlus** 样式。
+
+``` XML
+
+```
+
+
+
+
+# 属性
+
+| 属性 | 描述 |
+| ---------------- | ------------------ |
+| SelectedDateTime | 获取或设置当前选中的日期和时间 |
+| DateTimeFormat | 获取或设置用于显示选定日期和时间的格式 |
+| CalendarStyle | 获取或设置在呈现日历时使用的样式 |
+| DisplayDateTime | 获取或设置要显示的日期 |
+| IsDropDownOpen | 获取或设置一个值,该值指示是打开还是关闭下拉 Calendar |
+| Text | 获取由 **DateTimePicker** 显示的文本,或设置选定日期和时间 |
+| VerifyFunc | 获取或设置数据验证委托 |
+| IsError | 获取或设置数据是否错误 |
+| ErrorStr | 获取或设置错误提示 |
+| TextType | 获取或设置文本类型 |
+| ShowClearButton | 获取或设置是否显示清除按钮 |
+
+# 方法
+
+| 方法 | 描述 |
+| ---------------- | ------------------ |
+| VerifyData() | 验证数据 |
\ No newline at end of file
diff --git a/doc/source/handycontrol/extend_controls/timePicker/index.md b/doc/source/handycontrol/extend_controls/timePicker/index.md
index ca12ad62..9012c589 100644
--- a/doc/source/handycontrol/extend_controls/timePicker/index.md
+++ b/doc/source/handycontrol/extend_controls/timePicker/index.md
@@ -1,5 +1,95 @@
---
-title: 建设中
+title: TimePicker
---
-建设中
\ No newline at end of file
+TimePicker 控件允许用户通过在文本框中键入时间或使用下拉的日历控件来选择时间。
+
+``` CS
+[TemplatePart(Name = ElementRoot, Type = typeof(Grid))]
+[TemplatePart(Name = ElementTextBox, Type = typeof(WatermarkTextBox))]
+[TemplatePart(Name = ElementButton, Type = typeof(Button))]
+[TemplatePart(Name = ElementPopup, Type = typeof(Popup))]
+public class TimePicker : Control, IDataInput
+```
+
+# 创建DatePicker
+
+``` XML
+
+```
+
+``` CS
+var timePicker = new TimePicker();
+```
+
+生成的TimePicker如下图所示:
+
+
+
+
+
+# 选择时间
+
+可以通过文本框输入时间,或者点击文本框右边的按钮打开下拉的时钟控件选择时间。
+
+
+
+也可以在XAML钟或代码中这样设置日期。
+
+``` XML
+
+```
+
+``` CS
+timePicker.SelectedTime = DateTime.Now;
+```
+
+# 更改时钟样式
+
+通过更改Clock属性,TimePicker可以更改时钟的样式。
+
+``` XML
+
+
+
+
+
+```
+
+
+
+# 设置标题和占位符文本
+
+你可以将 Header(标题)和 Placeholder(占位符)添加到DatePicker,以向用户指示其用途。要使用这两个属性,首先需要应用 **TimePickerExtend** 或 **TimePickerPlus** 样式。
+
+``` XML
+
+```
+
+
+
+
+# 属性
+
+| 属性 | 描述 |
+| ---------------- | ------------------ |
+| SelectedTime | 获取或设置当前选中的时间 |
+| Clock | 获取或设置下拉时钟 |
+| TimeFormat | 获取或设置用于显示选定的时间的格式 |
+| DisplayTime | 获取或设置要显示的时间 |
+| IsDropDownOpen | 获取或设置一个值,该值指示是打开还是关闭下拉时钟 |
+| Text | 获取由 **TimePicker** 显示的文本,或设置选定的时间 |
+| VerifyFunc | 获取或设置数据验证委托 |
+| IsError | 获取或设置数据是否错误 |
+| ErrorStr | 获取或设置错误提示 |
+| TextType | 获取或设置文本类型 |
+| ShowClearButton | 获取或设置是否显示清除按钮 |
+
+# 方法
+
+| 方法 | 描述 |
+| ---------------- | ------------------ |
+| VerifyData() | 验证数据 |
+
From f15112e67189109d0bd87c03ef12a628a9f323bf Mon Sep 17 00:00:00 2001
From: NaBian <836904362@qq.com>
Date: Sun, 12 Jan 2020 21:42:50 +0800
Subject: [PATCH 09/26] Update index.md
---
doc/source/handycontrol/extend_controls/dateTimePicker/index.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/source/handycontrol/extend_controls/dateTimePicker/index.md b/doc/source/handycontrol/extend_controls/dateTimePicker/index.md
index f7e35f45..8dbbe027 100644
--- a/doc/source/handycontrol/extend_controls/dateTimePicker/index.md
+++ b/doc/source/handycontrol/extend_controls/dateTimePicker/index.md
@@ -35,7 +35,7 @@ var dateTimePicker = new DateTimePicker();

-也可以在XAML钟或代码中这样设置日期。
+也可以在XAML中或代码中这样设置日期。
``` XML
From 4d6415a44b69ce7ad63ff24e1cfef6feeb37c650 Mon Sep 17 00:00:00 2001
From: NaBian <836904362@qq.com>
Date: Sun, 12 Jan 2020 21:55:37 +0800
Subject: [PATCH 10/26] update readme
---
README.md | 2 ++
doc/source/handycontrol/tnx/index.md | 4 ++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 5d441e75..1d84448c 100644
--- a/README.md
+++ b/README.md
@@ -35,6 +35,7 @@
+
## Backers
@@ -49,6 +50,7 @@
+
## Special thanks to
diff --git a/doc/source/handycontrol/tnx/index.md b/doc/source/handycontrol/tnx/index.md
index 8356fcbf..7e1b38aa 100644
--- a/doc/source/handycontrol/tnx/index.md
+++ b/doc/source/handycontrol/tnx/index.md
@@ -4,7 +4,7 @@ title: 鸣谢
# 感谢以下Coder提供代码贡献
-







+








# 感谢以下组织机构提供开源许可
@@ -12,4 +12,4 @@ title: 鸣谢
# 感谢以下捐赠者
-










\ No newline at end of file
+











\ No newline at end of file
From 758f2d300f531dd53d1944bde7e09dc1cdbdeb76 Mon Sep 17 00:00:00 2001
From: Mahdi Hosseini
Date: Sun, 12 Jan 2020 19:02:04 +0330
Subject: [PATCH 11/26] fix typo
---
doc/source/handycontrol/extend_controls/timePicker/index.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/doc/source/handycontrol/extend_controls/timePicker/index.md b/doc/source/handycontrol/extend_controls/timePicker/index.md
index 9012c589..5c65e872 100644
--- a/doc/source/handycontrol/extend_controls/timePicker/index.md
+++ b/doc/source/handycontrol/extend_controls/timePicker/index.md
@@ -12,7 +12,7 @@ TimePicker 控件允许用户通过在文本框中键入时间或使用下拉的
public class TimePicker : Control, IDataInput
```
-# 创建DatePicker
+# 创建TimePicker
``` XML
@@ -32,7 +32,7 @@ var timePicker = new TimePicker();
可以通过文本框输入时间,或者点击文本框右边的按钮打开下拉的时钟控件选择时间。
-
+
也可以在XAML钟或代码中这样设置日期。
@@ -56,7 +56,7 @@ timePicker.SelectedTime = DateTime.Now;
```
-
+
# 设置标题和占位符文本
From 27373dba3f7799e6d03139d5b9fb810dfb7886d6 Mon Sep 17 00:00:00 2001
From: NaBian <836904362@qq.com>
Date: Mon, 13 Jan 2020 23:36:42 +0800
Subject: [PATCH 12/26] Update README.md
---
README.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/README.md b/README.md
index 1d84448c..23e3584f 100644
--- a/README.md
+++ b/README.md
@@ -51,6 +51,7 @@
+
## Special thanks to
From 958cda81a79b376847dd0aa21e2c896217560aad Mon Sep 17 00:00:00 2001
From: NaBian <836904362@qq.com>
Date: Tue, 14 Jan 2020 01:25:29 +0800
Subject: [PATCH 13/26] add basic codes
---
.../UserControl/Controls/PinBoxDemoCtl.xaml | 6 +-
.../Controls/Input/PinBox.cs | 219 +++++++++++++++++-
.../Themes/Styles/Base/PinBoxBaseStyle.xaml | 15 +-
3 files changed, 236 insertions(+), 4 deletions(-)
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml
index 77c4a6f4..d5175cbc 100644
--- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml
@@ -1,7 +1,9 @@
-
+
+
+
diff --git a/src/Shared/HandyControl_Shared/Controls/Input/PinBox.cs b/src/Shared/HandyControl_Shared/Controls/Input/PinBox.cs
index 86634976..addf3612 100644
--- a/src/Shared/HandyControl_Shared/Controls/Input/PinBox.cs
+++ b/src/Shared/HandyControl_Shared/Controls/Input/PinBox.cs
@@ -1,9 +1,226 @@
-using System.Windows.Controls;
+using System;
+using System.Linq;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Input;
+using HandyControl.Data;
+using HandyControl.Tools;
namespace HandyControl.Controls
{
+ [TemplatePart(Name = ElementPanel, Type = typeof(Panel))]
public class PinBox : Control
{
+ private const string ElementPanel = "PART_Panel";
+ private static readonly object MinLength = 4;
+
+ private Panel _panel;
+
+ private int _inputIndex;
+
+ private bool _changed;
+
+ private RoutedEventHandler _passwordBoxsGotFocusEventHandler;
+
+ private RoutedEventHandler _passwordBoxsPasswordChangedEventHandler;
+
+ public PinBox()
+ {
+ Loaded += PinBox_Loaded;
+ Unloaded += PinBox_Unloaded;
+ }
+
+ private void PinBox_Unloaded(object sender, RoutedEventArgs e)
+ {
+ RemoveHandler(System.Windows.Controls.PasswordBox.PasswordChangedEvent, _passwordBoxsPasswordChangedEventHandler);
+ RemoveHandler(GotFocusEvent, _passwordBoxsGotFocusEventHandler);
+
+ Loaded -= PinBox_Loaded;
+ Unloaded -= PinBox_Unloaded;
+ }
+
+ private void PinBox_Loaded(object sender, RoutedEventArgs e)
+ {
+ _passwordBoxsPasswordChangedEventHandler = PasswordBoxsPasswordChanged;
+ AddHandler(System.Windows.Controls.PasswordBox.PasswordChangedEvent, _passwordBoxsPasswordChangedEventHandler);
+
+ _passwordBoxsGotFocusEventHandler = PasswordBoxsGotFocus;
+ AddHandler(GotFocusEvent, _passwordBoxsGotFocusEventHandler);
+ }
+
+ private void PasswordBoxsPasswordChanged(object sender, RoutedEventArgs e)
+ {
+ if (e.OriginalSource is System.Windows.Controls.PasswordBox passwordBox)
+ {
+ if (passwordBox.Password.Length > 0)
+ {
+ if (++_inputIndex >= Length)
+ {
+ _inputIndex = Length - 1;
+
+ if (_panel.Children.OfType()
+ .All(item => item.Password.Any()))
+ {
+ FocusManager.SetFocusedElement(this, null);
+ Keyboard.ClearFocus();
+ RaiseEvent(new RoutedEventArgs(CompletedEvent, this));
+ }
+ return;
+ }
+ }
+ else
+ {
+ if (--_inputIndex < 0)
+ {
+ _inputIndex = 0;
+ return;
+ }
+ }
+
+ _changed = true;
+ FocusManager.SetFocusedElement(this, _panel.Children[_inputIndex]);
+ }
+ }
+
+ private void PasswordBoxsGotFocus(object sender, RoutedEventArgs e)
+ {
+ if (e.OriginalSource is System.Windows.Controls.PasswordBox passwordBox)
+ {
+ _inputIndex = _panel.Children.IndexOf(passwordBox);
+ }
+ }
+
+ protected override void OnPreviewKeyDown(KeyEventArgs e)
+ {
+ base.OnPreviewKeyUp(e);
+
+ if (e.Key == Key.Left)
+ {
+ if (--_inputIndex < 0)
+ {
+ _inputIndex = 0;
+ return;
+ }
+
+ FocusManager.SetFocusedElement(this, _panel.Children[_inputIndex]);
+ }
+ else if (e.Key == Key.Right)
+ {
+ if (++_inputIndex >= Length)
+ {
+ _inputIndex = Length - 1;
+ return;
+ }
+
+ FocusManager.SetFocusedElement(this, _panel.Children[_inputIndex]);
+ }
+ }
+
+ protected override void OnPreviewKeyUp(KeyEventArgs e)
+ {
+ base.OnPreviewKeyUp(e);
+
+ if (_changed)
+ {
+ _changed = false;
+ return;
+ }
+
+ if (e.Key == Key.Delete || e.Key == Key.Back)
+ {
+ if (--_inputIndex < 0)
+ {
+ _inputIndex = 0;
+ return;
+ }
+
+ FocusManager.SetFocusedElement(this, _panel.Children[_inputIndex]);
+ }
+ }
+
+ public static readonly DependencyProperty LengthProperty = DependencyProperty.Register(
+ "Length", typeof(int), typeof(PinBox), new PropertyMetadata(MinLength, null, CoerceLength), ValidateHelper.IsInRangeOfPosInt);
+
+ private static object CoerceLength(DependencyObject d, object basevalue) => (int)basevalue < 4 ? MinLength : basevalue;
+
+ public int Length
+ {
+ get => (int) GetValue(LengthProperty);
+ set => SetValue(LengthProperty, value);
+ }
+
+ public static readonly DependencyProperty ItemMarginProperty = DependencyProperty.Register(
+ "ItemMargin", typeof(Thickness), typeof(PinBox), new PropertyMetadata(default(Thickness)));
+
+ public Thickness ItemMargin
+ {
+ get => (Thickness) GetValue(ItemMarginProperty);
+ set => SetValue(ItemMarginProperty, value);
+ }
+
+ public static readonly DependencyProperty ItemWidthProperty = DependencyProperty.Register(
+ "ItemWidth", typeof(double), typeof(PinBox), new PropertyMetadata(ValueBoxes.Double0Box));
+
+ public double ItemWidth
+ {
+ get => (double) GetValue(ItemWidthProperty);
+ set => SetValue(ItemWidthProperty, value);
+ }
+
+ public static readonly DependencyProperty ItemHeightProperty = DependencyProperty.Register(
+ "ItemHeight", typeof(double), typeof(PinBox), new PropertyMetadata(ValueBoxes.Double0Box));
+
+ public double ItemHeight
+ {
+ get => (double) GetValue(ItemHeightProperty);
+ set => SetValue(ItemHeightProperty, value);
+ }
+
+ public static readonly RoutedEvent CompletedEvent =
+ EventManager.RegisterRoutedEvent("Completed", RoutingStrategy.Bubble,
+ typeof(EventHandler), typeof(PinBox));
+
+ public event EventHandler Completed
+ {
+ add => AddHandler(CompletedEvent, value);
+ remove => RemoveHandler(CompletedEvent, value);
+ }
+
+ private void UpdateItems()
+ {
+ _panel.Children.Clear();
+ var length = Length;
+
+ for (var i = 0; i < length; i++)
+ {
+ _panel.Children.Add(CreatePasswordBox());
+ }
+ }
+
+ private System.Windows.Controls.PasswordBox CreatePasswordBox()
+ {
+ return new System.Windows.Controls.PasswordBox
+ {
+ MaxLength = 1,
+ HorizontalContentAlignment = HorizontalAlignment.Center,
+ VerticalAlignment = VerticalAlignment.Center,
+ Margin = ItemMargin,
+ Width = ItemWidth,
+ Height = ItemHeight,
+ Padding = new Thickness()
+ };
+ }
+
+ public override void OnApplyTemplate()
+ {
+ base.OnApplyTemplate();
+
+ _panel = GetTemplateChild(ElementPanel) as Panel;
+ if (_panel != null)
+ {
+ UpdateItems();
+ }
+ }
}
}
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Base/PinBoxBaseStyle.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Base/PinBoxBaseStyle.xaml
index 98d80b3f..a81214d7 100644
--- a/src/Shared/HandyControl_Shared/Themes/Styles/Base/PinBoxBaseStyle.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/Base/PinBoxBaseStyle.xaml
@@ -2,8 +2,21 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:HandyControl.Controls">
-
\ No newline at end of file
From e2f24256f6aeb875e14e79f4efe0156a5aa36310 Mon Sep 17 00:00:00 2001
From: NaBian <836904362@qq.com>
Date: Wed, 15 Jan 2020 01:04:56 +0800
Subject: [PATCH 14/26] completed the branch
---
README.md | 8 +-
.../Controls/PasswordBoxDemoCtl.xaml | 3 +-
.../UserControl/Controls/PinBoxDemoCtl.xaml | 5 +-
.../Controls/PinBoxDemoCtl.xaml.cs | 13 +-
.../Controls/Input/PasswordBox.cs | 8 --
.../Controls/Input/PinBox.cs | 125 +++++++++++++++++-
.../Tools/Extension/EnumerableExtension.cs | 11 ++
7 files changed, 153 insertions(+), 20 deletions(-)
diff --git a/README.md b/README.md
index 5d441e75..28797228 100644
--- a/README.md
+++ b/README.md
@@ -94,6 +94,10 @@ Step 4:enjoy coding
## Latest examples
+### PinBox
+
+
+
### Effects

@@ -110,12 +114,12 @@ Step 4:enjoy coding

+## History publication
+
### Divider

-## History publication
-
### GeometryAnimation

diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PasswordBoxDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PasswordBoxDemoCtl.xaml
index 172bc51d..d6781b14 100644
--- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PasswordBoxDemoCtl.xaml
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PasswordBoxDemoCtl.xaml
@@ -13,8 +13,7 @@
-
-
+
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml
index d5175cbc..728c99a3 100644
--- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml
@@ -4,6 +4,9 @@
xmlns:hc="https://handyorg.github.io/handycontrol"
Background="{DynamicResource RegionBrush}">
-
+
+
+
+
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml.cs
index dc8f65fd..02c0ca3a 100644
--- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml.cs
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/PinBoxDemoCtl.xaml.cs
@@ -1,4 +1,7 @@
-namespace HandyControlDemo.UserControl
+using System.Windows;
+using HandyControl.Controls;
+
+namespace HandyControlDemo.UserControl
{
public partial class PinBoxDemoCtl
{
@@ -6,5 +9,13 @@
{
InitializeComponent();
}
+
+ private void PinBox_OnCompleted(object sender, RoutedEventArgs e)
+ {
+ if (e.OriginalSource is PinBox pinBox)
+ {
+ Growl.Info(pinBox.Password);
+ }
+ }
}
}
diff --git a/src/Shared/HandyControl_Shared/Controls/Input/PasswordBox.cs b/src/Shared/HandyControl_Shared/Controls/Input/PasswordBox.cs
index 1c2037aa..5fdd95be 100644
--- a/src/Shared/HandyControl_Shared/Controls/Input/PasswordBox.cs
+++ b/src/Shared/HandyControl_Shared/Controls/Input/PasswordBox.cs
@@ -60,8 +60,6 @@ namespace HandyControl.Controls
private SecureString _password;
- private char _passwordChar;
-
private System.Windows.Controls.TextBox _textBox;
public PasswordBox()
@@ -223,12 +221,6 @@ namespace HandyControl.Controls
}
}
}
-
- if (_passwordChar != default(char))
- {
- ActualPasswordBox.PasswordChar = _passwordChar;
- _passwordChar = default;
- }
}
if (_textBox != null)
diff --git a/src/Shared/HandyControl_Shared/Controls/Input/PinBox.cs b/src/Shared/HandyControl_Shared/Controls/Input/PinBox.cs
index addf3612..89fa3e43 100644
--- a/src/Shared/HandyControl_Shared/Controls/Input/PinBox.cs
+++ b/src/Shared/HandyControl_Shared/Controls/Input/PinBox.cs
@@ -1,10 +1,14 @@
using System;
+using System.Collections.Generic;
using System.Linq;
+using System.Runtime.InteropServices;
+using System.Security;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using HandyControl.Data;
using HandyControl.Tools;
+using HandyControl.Tools.Extension;
namespace HandyControl.Controls
{
@@ -21,6 +25,10 @@ namespace HandyControl.Controls
private bool _changed;
+ private bool _isInternalAction;
+
+ private List _passwordList;
+
private RoutedEventHandler _passwordBoxsGotFocusEventHandler;
private RoutedEventHandler _passwordBoxsPasswordChangedEventHandler;
@@ -51,6 +59,8 @@ namespace HandyControl.Controls
private void PasswordBoxsPasswordChanged(object sender, RoutedEventArgs e)
{
+ if (_isInternalAction) return;
+
if (e.OriginalSource is System.Windows.Controls.PasswordBox passwordBox)
{
if (passwordBox.Password.Length > 0)
@@ -88,6 +98,7 @@ namespace HandyControl.Controls
if (e.OriginalSource is System.Windows.Controls.PasswordBox passwordBox)
{
_inputIndex = _panel.Children.IndexOf(passwordBox);
+ passwordBox.SelectAll();
}
}
@@ -103,7 +114,10 @@ namespace HandyControl.Controls
return;
}
- FocusManager.SetFocusedElement(this, _panel.Children[_inputIndex]);
+ var passwordBox = _panel.Children[_inputIndex] as System.Windows.Controls.PasswordBox;
+ passwordBox?.SelectAll();
+
+ FocusManager.SetFocusedElement(this, passwordBox);
}
else if (e.Key == Key.Right)
{
@@ -113,7 +127,10 @@ namespace HandyControl.Controls
return;
}
- FocusManager.SetFocusedElement(this, _panel.Children[_inputIndex]);
+ var passwordBox = _panel.Children[_inputIndex] as System.Windows.Controls.PasswordBox;
+ passwordBox?.SelectAll();
+
+ FocusManager.SetFocusedElement(this, passwordBox);
}
}
@@ -129,6 +146,13 @@ namespace HandyControl.Controls
if (e.Key == Key.Delete || e.Key == Key.Back)
{
+ if (_panel.Children[_inputIndex] is System.Windows.Controls.PasswordBox passwordBox)
+ {
+ _isInternalAction = true;
+ passwordBox.Clear();
+ _isInternalAction = false;
+ }
+
if (--_inputIndex < 0)
{
_inputIndex = 0;
@@ -139,8 +163,66 @@ namespace HandyControl.Controls
}
}
+ public string Password
+ {
+ get
+ {
+ return string.Join("", _panel.Children.OfType().Select(item => item.Password));
+ }
+ set
+ {
+ if (_panel == null)
+ {
+ _passwordList = new List();
+
+ if (value == null)
+ {
+ value = string.Empty;
+ }
+
+ foreach (var item in value)
+ {
+ var secureString = new SecureString();
+ secureString.AppendChar(item);
+ _passwordList.Add(secureString);
+ }
+
+ return;
+ }
+
+ var length = Length;
+ if (string.IsNullOrEmpty(value) || value.Length != length || value.Length != _panel.Children.Count)
+ {
+ _panel.Children.OfType().Do(item => item.Clear());
+ }
+ else
+ {
+ _panel.Children.OfType().DoWithIndex((item, index) => item.Password = value[index].ToString());
+ }
+ }
+ }
+
+ ///
+ /// 掩码字符
+ ///
+ public static readonly DependencyProperty PasswordCharProperty =
+ System.Windows.Controls.PasswordBox.PasswordCharProperty.AddOwner(typeof(PinBox),
+ new FrameworkPropertyMetadata('●'));
+
+ public char PasswordChar
+ {
+ get => (char)GetValue(PasswordCharProperty);
+ set => SetValue(PasswordCharProperty, value);
+ }
+
public static readonly DependencyProperty LengthProperty = DependencyProperty.Register(
- "Length", typeof(int), typeof(PinBox), new PropertyMetadata(MinLength, null, CoerceLength), ValidateHelper.IsInRangeOfPosInt);
+ "Length", typeof(int), typeof(PinBox), new PropertyMetadata(MinLength, OnLengthChanged, CoerceLength), ValidateHelper.IsInRangeOfPosInt);
+
+ private static void OnLengthChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ var ctl = (PinBox) d;
+ ctl.UpdateItems();
+ }
private static object CoerceLength(DependencyObject d, object basevalue) => (int)basevalue < 4 ? MinLength : basevalue;
@@ -179,9 +261,9 @@ namespace HandyControl.Controls
public static readonly RoutedEvent CompletedEvent =
EventManager.RegisterRoutedEvent("Completed", RoutingStrategy.Bubble,
- typeof(EventHandler), typeof(PinBox));
+ typeof(RoutedEventHandler), typeof(PinBox));
- public event EventHandler Completed
+ public event RoutedEventHandler Completed
{
add => AddHandler(CompletedEvent, value);
remove => RemoveHandler(CompletedEvent, value);
@@ -189,6 +271,8 @@ namespace HandyControl.Controls
private void UpdateItems()
{
+ if (_panel == null) return;
+
_panel.Children.Clear();
var length = Length;
@@ -208,7 +292,8 @@ namespace HandyControl.Controls
Margin = ItemMargin,
Width = ItemWidth,
Height = ItemHeight,
- Padding = new Thickness()
+ Padding = default,
+ PasswordChar = PasswordChar
};
}
@@ -220,6 +305,34 @@ namespace HandyControl.Controls
if (_panel != null)
{
UpdateItems();
+
+ var length = Length;
+ if (_passwordList != null && _passwordList.Count == length && _panel.Children.Count == length)
+ {
+ for (var i = 0; i < length; i++)
+ {
+ var password = _passwordList[i];
+ if (password.Length > 0)
+ {
+ var valuePtr = IntPtr.Zero;
+ try
+ {
+ valuePtr = Marshal.SecureStringToGlobalAllocUnicode(password);
+ if (_panel.Children[i] is System.Windows.Controls.PasswordBox passwordBox)
+ {
+ passwordBox.Password = Marshal.PtrToStringUni(valuePtr) ?? throw new InvalidOperationException();
+ }
+ }
+ finally
+ {
+ Marshal.ZeroFreeGlobalAllocUnicode(valuePtr);
+ password.Clear();
+ }
+ }
+ }
+
+ _passwordList.Clear();
+ }
}
}
}
diff --git a/src/Shared/HandyControl_Shared/Tools/Extension/EnumerableExtension.cs b/src/Shared/HandyControl_Shared/Tools/Extension/EnumerableExtension.cs
index 68232166..3d5685db 100644
--- a/src/Shared/HandyControl_Shared/Tools/Extension/EnumerableExtension.cs
+++ b/src/Shared/HandyControl_Shared/Tools/Extension/EnumerableExtension.cs
@@ -16,5 +16,16 @@ namespace HandyControl.Tools.Extension
return enumerable;
}
+
+ public static IEnumerable DoWithIndex(this IEnumerable source, Action predicate)
+ {
+ var enumerable = source as IList ?? source.ToList();
+ for (var i = 0; i < enumerable.Count; i++)
+ {
+ predicate.Invoke(enumerable[i], i);
+ }
+
+ return enumerable;
+ }
}
}
\ No newline at end of file
From 952cf564d0908d75af606b0b94417f3329a04d20 Mon Sep 17 00:00:00 2001
From: NaBian <836904362@qq.com>
Date: Wed, 15 Jan 2020 01:09:09 +0800
Subject: [PATCH 15/26] Update index.md
---
doc/source/handycontrol/tnx/index.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/source/handycontrol/tnx/index.md b/doc/source/handycontrol/tnx/index.md
index 7e1b38aa..565cb3ca 100644
--- a/doc/source/handycontrol/tnx/index.md
+++ b/doc/source/handycontrol/tnx/index.md
@@ -12,4 +12,4 @@ title: 鸣谢
# 感谢以下捐赠者
-











\ No newline at end of file
+












\ No newline at end of file
From 0ab014f81dc1aa897a1f7a0ee66ce6bd29c57b47 Mon Sep 17 00:00:00 2001
From: NaBian <836904362@qq.com>
Date: Wed, 15 Jan 2020 22:25:07 +0800
Subject: [PATCH 16/26] add some styles
add Separator and StatusBar style
---
.../HandyControl_Shared.projitems | 16 ++++++++++++++++
.../Themes/Styles/Base/SeparatorBaseStyle.xaml | 8 ++++++++
.../Themes/Styles/Base/StatusBarBaseStyle.xaml | 16 ++++++++++++++++
.../Themes/Styles/Separator.xaml | 9 +++++++++
.../Themes/Styles/StatusBar.xaml | 9 +++++++++
.../HandyControl_Shared/Themes/Styles/Style.xaml | 2 ++
6 files changed, 60 insertions(+)
create mode 100644 src/Shared/HandyControl_Shared/Themes/Styles/Base/SeparatorBaseStyle.xaml
create mode 100644 src/Shared/HandyControl_Shared/Themes/Styles/Base/StatusBarBaseStyle.xaml
create mode 100644 src/Shared/HandyControl_Shared/Themes/Styles/Separator.xaml
create mode 100644 src/Shared/HandyControl_Shared/Themes/Styles/StatusBar.xaml
diff --git a/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems b/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems
index 32cab771..95008f3d 100644
--- a/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems
+++ b/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems
@@ -394,6 +394,22 @@
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Base/SeparatorBaseStyle.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Base/SeparatorBaseStyle.xaml
new file mode 100644
index 00000000..2b9f91b0
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/Base/SeparatorBaseStyle.xaml
@@ -0,0 +1,8 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Base/StatusBarBaseStyle.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Base/StatusBarBaseStyle.xaml
new file mode 100644
index 00000000..1da267ba
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/Base/StatusBarBaseStyle.xaml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Separator.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Separator.xaml
new file mode 100644
index 00000000..f50f2ab3
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/Separator.xaml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/StatusBar.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/StatusBar.xaml
new file mode 100644
index 00000000..9f2a27b3
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/StatusBar.xaml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Style.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Style.xaml
index 308b65d4..063d9132 100644
--- a/src/Shared/HandyControl_Shared/Themes/Styles/Style.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/Style.xaml
@@ -79,6 +79,8 @@
+
+
\ No newline at end of file
From 8a6fc358738dfbc58a2195171d2ca2213912ecf8 Mon Sep 17 00:00:00 2001
From: NaBian <836904362@qq.com>
Date: Wed, 15 Jan 2020 22:32:14 +0800
Subject: [PATCH 17/26] Update TransitioningContentControl.xaml
---
.../Themes/Styles/TransitioningContentControl.xaml | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/TransitioningContentControl.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/TransitioningContentControl.xaml
index 8d7d7d4a..b9b21f96 100644
--- a/src/Shared/HandyControl_Shared/Themes/Styles/TransitioningContentControl.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/TransitioningContentControl.xaml
@@ -1,5 +1,6 @@
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:controls="clr-namespace:HandyControl.Controls">
@@ -73,4 +74,8 @@
+
+
\ No newline at end of file
From 02e8fc4a1361216303f06862f7df421e2e2dd51a Mon Sep 17 00:00:00 2001
From: NaBian <836904362@qq.com>
Date: Thu, 16 Jan 2020 23:49:02 +0800
Subject: [PATCH 18/26] add FlowDocumentScrollViewer style
---
README.md | 8 +-
.../HandyControlDemo_Core30.csproj | 3 +
.../HandyControlDemo_Net_40.csproj | 3 +
.../HandyControlDemo_Net_GE45.csproj | 3 +
.../Data/DemoInfo.json | 1 +
.../HandyControlDemo_Shared.projitems | 7 ++
.../Properties/Langs/Lang.Designer.cs | 9 ++
.../Properties/Langs/Lang.en.resx | 3 +
.../Properties/Langs/Lang.fa.resx | 3 +
.../Properties/Langs/Lang.fr.resx | 3 +
.../Properties/Langs/Lang.ko-KR.resx | 3 +
.../Properties/Langs/Lang.resx | 3 +
.../LeftMainContent/WPFFlowDocument_16x.png | Bin 0 -> 315 bytes
.../Controls/RangeSliderDemoCtl.xaml | 8 +-
.../FlowDocumentScrollViewerDemoCtl.xaml | 101 ++++++++++++++++++
.../FlowDocumentScrollViewerDemoCtl.xaml.cs | 10 ++
.../UserControl/Styles/SliderDemoCtl.xaml | 8 +-
.../Controls/Attach/TipElement.cs | 9 ++
.../HandyControl_Shared.projitems | 4 +
.../Properties/Langs/Lang.Designer.cs | 18 ++++
.../Properties/Langs/Lang.en.resx | 6 ++
.../Properties/Langs/Lang.fa.resx | 6 ++
.../Properties/Langs/Lang.fr.resx | 6 ++
.../Properties/Langs/Lang.ko-KR.resx | 6 ++
.../Properties/Langs/Lang.resx | 6 ++
.../Themes/Styles/Base/SliderBaseStyle.xaml | 32 +++---
.../Styles/FlowDocumentScrollViewer.xaml | 55 ++++++++++
.../Themes/Styles/Style.xaml | 1 +
28 files changed, 299 insertions(+), 26 deletions(-)
create mode 100644 src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/WPFFlowDocument_16x.png
create mode 100644 src/Shared/HandyControlDemo_Shared/UserControl/Styles/FlowDocumentScrollViewerDemoCtl.xaml
create mode 100644 src/Shared/HandyControlDemo_Shared/UserControl/Styles/FlowDocumentScrollViewerDemoCtl.xaml.cs
create mode 100644 src/Shared/HandyControl_Shared/Themes/Styles/FlowDocumentScrollViewer.xaml
diff --git a/README.md b/README.md
index 15c92ccd..f2aeea26 100644
--- a/README.md
+++ b/README.md
@@ -97,6 +97,10 @@ Step 4:enjoy coding
## Latest examples
+### FlowDocumentScrollViewerStyle
+
+
+
### PinBox

@@ -113,12 +117,12 @@ Step 4:enjoy coding

+## History publication
+
### Poptip

-## History publication
-
### Divider

diff --git a/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj b/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj
index b3c41945..f91f3b1d 100644
--- a/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj
+++ b/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj
@@ -457,6 +457,9 @@
Resources\Img\LeftMainContent\Ellipsis_16x.png
+
+ Resources\Img\LeftMainContent\WPFFlowDocument_16x.png
+
diff --git a/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj b/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj
index d2ee3658..bba16269 100644
--- a/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj
+++ b/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj
@@ -523,6 +523,9 @@
Resources\Img\LeftMainContent\Ellipsis_16x.png
+
+ Resources\Img\LeftMainContent\WPFFlowDocument_16x.png
+
diff --git a/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj b/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj
index 9b86a79e..94a32b27 100644
--- a/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj
+++ b/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj
@@ -586,6 +586,9 @@
Resources\Img\LeftMainContent\Ellipsis_16x.png
+
+ Resources\Img\LeftMainContent\WPFFlowDocument_16x.png
+
diff --git a/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json b/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json
index e10713f7..09201d74 100644
--- a/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json
+++ b/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json
@@ -26,6 +26,7 @@
[ "GroupBox", "GroupBoxDemoCtl", "GroupBox_16x", "" ],
[ "Menu", "MenuDemoCtl", "ContextMenu_16x", "" ],
[ "RichTextBox", "RichTextBoxDemoCtl", "RichTextBox_16x", "" ],
+ [ "FlowDocumentScrollViewer", "FlowDocumentScrollViewerDemoCtl", "WPFFlowDocument_16x", "1" ],
[ "ToolBar", "ToolBarDemoCtl", "ToolBar_16x", "" ],
[ "Border", "BorderDemoCtl", "BorderElement_16x", "" ],
[ "Label", "LabelDemoCtl", "Label_16x", "" ]
diff --git a/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems b/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems
index e9b3c59e..17fed60e 100644
--- a/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems
+++ b/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems
@@ -293,6 +293,9 @@
ExpanderDemoCtl.xaml
+
+ FlowDocumentScrollViewerDemoCtl.xaml
+
GroupBoxDemoCtl.xaml
@@ -800,6 +803,10 @@
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs
index 7c2eff9a..0a7a2898 100644
--- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs
+++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs
@@ -627,6 +627,15 @@ namespace HandyControlDemo.Properties.Langs {
}
}
+ ///
+ /// 查找类似 流文档滚动视图 的本地化字符串。
+ ///
+ public static string FlowDocumentScrollViewer {
+ get {
+ return ResourceManager.GetString("FlowDocumentScrollViewer", resourceCulture);
+ }
+ }
+
///
/// 查找类似 Gif图片 的本地化字符串。
///
diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx
index 82034ede..eec92d63 100644
--- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx
+++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx
@@ -714,4 +714,7 @@
PinBox
+
+ FlowDocumentScrollViewer
+
\ No newline at end of file
diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fa.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fa.resx
index d6102272..17f72064 100644
--- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fa.resx
+++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fa.resx
@@ -714,4 +714,7 @@
PinBox
+
+ FlowDocumentScrollViewer
+
\ No newline at end of file
diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fr.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fr.resx
index 95a79a20..2a9f70e6 100644
--- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fr.resx
+++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fr.resx
@@ -714,4 +714,7 @@
PinBox
+
+ FlowDocumentScrollViewer
+
\ No newline at end of file
diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ko-KR.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ko-KR.resx
index 6c0bf75a..b16ff604 100644
--- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ko-KR.resx
+++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ko-KR.resx
@@ -714,4 +714,7 @@
PinBox
+
+ FlowDocumentScrollViewer
+
\ No newline at end of file
diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx
index e5d2b80e..45a4e46c 100644
--- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx
+++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx
@@ -714,4 +714,7 @@
PIN码框
+
+ 流文档滚动视图
+
\ No newline at end of file
diff --git a/src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/WPFFlowDocument_16x.png b/src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/WPFFlowDocument_16x.png
new file mode 100644
index 0000000000000000000000000000000000000000..605a4f49da56b69d077f1791232d5920b8b2ece6
GIT binary patch
literal 315
zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9F5M?jcysy3fAQ1Gp%
zi(^Pd+|uCPyv+t8TY9Bq44vE(SgTy7qzKMnF+0KHDdnZ-W|Utfgi5(bGbyvMi?H
z(qvuxyL+uqKRdl?gYAPfW1eRJm6xY#EUhv*ldw^BN#?6Ht5zlXW_(?6c$)G}{&(Bi
zC2RN1iMVWX<5=Z9`>h^K?nfHg1sW%F_?1lLNYOf_wn*@%@&yZ(X@XxZ6qQkomLK(uwT+=ZD)w5IrcjyN|a?3oU`Bmk$2|2oY_T__lE;L&fw|l
K=d#Wzp$Py$p>)~+
literal 0
HcmV?d00001
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/RangeSliderDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/RangeSliderDemoCtl.xaml
index 0dd0f1b7..8f4f3b99 100644
--- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/RangeSliderDemoCtl.xaml
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/RangeSliderDemoCtl.xaml
@@ -8,14 +8,14 @@
-
-
+
+
-
-
+
+
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Styles/FlowDocumentScrollViewerDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Styles/FlowDocumentScrollViewerDemoCtl.xaml
new file mode 100644
index 00000000..f6c8c9c3
--- /dev/null
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Styles/FlowDocumentScrollViewerDemoCtl.xaml
@@ -0,0 +1,101 @@
+
+
+
+
+
+
+ Neptune (planet), major planet in the solar system, eighth planet
+ from the Sun and fourth largest in diameter. Neptune maintains an almost constant
+ distance, about 4,490 million km (about 2,790 million mi), from the Sun. Neptune
+ revolves outside the orbit of Uranus and for most of its orbit moves inside the
+ elliptical path of the outermost planet Pluto (see Solar System). Every 248 years,
+ Pluto’s elliptical orbit brings the planet inside Neptune’s nearly circular orbit
+ for about 20 years, temporarily making Neptune the farthest planet from the Sun.
+ The last time Pluto’s orbit brought it inside Neptune’s orbit was in 1979. In
+ 1999 Pluto’s orbit carried it back outside Neptune’s orbit.
+
+
+ Neptune has 72 times Earth's volume...
+
+
+
+
+
+
+
+
+
+
+
+ Neptune Stats
+
+
+
+
+ Mean Distance from Sun
+
+
+ 4,504,000,000 km
+
+
+
+
+ Mean Diameter
+
+
+ 49,532 km
+
+
+
+
+ Approximate Mass
+
+
+ 1.0247e26 kg
+
+
+
+
+
+ Information from the
+ Encarta
+ web site.
+
+
+
+
+
+
+
+
+ Astronomers believe Neptune has an inner rocky core that is surrounded by a vast
+ ocean of water mixed with rocky material. From the inner core, this ocean extends
+ upward until it meets a gaseous atmosphere of hydrogen, helium, and trace amounts
+ of methane. Neptune has four rings and 11 known moons. Even though Neptune's volume
+ is 72 times Earth’s volume, its mass is only 17.15 times Earth’s mass. Because of
+ its size, scientists classify Neptune—along with Jupiter, Saturn, and Uranus—as
+ one of the giant or Jovian planets (so-called because they resemble Jupiter).
+
+
+
+
+ Neptune has an orbital period of ~20 years...
+
+
+ Mathematical theories of astronomy led to the discovery of Neptune. To account for
+ wobbles in the orbit of the planet Uranus, British astronomer John Couch Adams and
+ French astronomer Urbain Jean Joseph Leverrier independently calculated the existence
+ and position of a new planet in 1845 and 1846, respectively. They theorized that the
+ gravitational attraction of this planet for Uranus was causing the wobbles in Uranus’s
+ orbit. Using information from Leverrier, German astronomer Johann Gottfried Galle first
+ observed the planet in 1846.
+
+
+
+
+
+
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Styles/FlowDocumentScrollViewerDemoCtl.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Styles/FlowDocumentScrollViewerDemoCtl.xaml.cs
new file mode 100644
index 00000000..0ebfaccf
--- /dev/null
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Styles/FlowDocumentScrollViewerDemoCtl.xaml.cs
@@ -0,0 +1,10 @@
+namespace HandyControlDemo.UserControl
+{
+ public partial class FlowDocumentScrollViewerDemoCtl
+ {
+ public FlowDocumentScrollViewerDemoCtl()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Styles/SliderDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Styles/SliderDemoCtl.xaml
index 06347065..1094c1f5 100644
--- a/src/Shared/HandyControlDemo_Shared/UserControl/Styles/SliderDemoCtl.xaml
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Styles/SliderDemoCtl.xaml
@@ -9,15 +9,15 @@
-
-
+
+
-
-
+
+
diff --git a/src/Shared/HandyControl_Shared/Controls/Attach/TipElement.cs b/src/Shared/HandyControl_Shared/Controls/Attach/TipElement.cs
index 5fa5481f..86777414 100644
--- a/src/Shared/HandyControl_Shared/Controls/Attach/TipElement.cs
+++ b/src/Shared/HandyControl_Shared/Controls/Attach/TipElement.cs
@@ -18,5 +18,14 @@ namespace HandyControl.Controls
public static void SetPlacement(DependencyObject element, TipPlacement value) => element.SetValue(PlacementProperty, value);
public static TipPlacement GetPlacement(DependencyObject element) => (TipPlacement) element.GetValue(PlacementProperty);
+
+ public static readonly DependencyProperty StringFormatProperty = DependencyProperty.RegisterAttached(
+ "StringFormat", typeof(string), typeof(TipElement), new PropertyMetadata("#0.0"));
+
+ public static void SetStringFormat(DependencyObject element, string value)
+ => element.SetValue(StringFormatProperty, value);
+
+ public static string GetStringFormat(DependencyObject element)
+ => (string) element.GetValue(StringFormatProperty);
}
}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems b/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems
index 95008f3d..cb8ba292 100644
--- a/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems
+++ b/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems
@@ -394,6 +394,10 @@
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
diff --git a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.Designer.cs b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.Designer.cs
index d9db4d8d..cc31cac1 100644
--- a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.Designer.cs
+++ b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.Designer.cs
@@ -320,5 +320,23 @@ namespace HandyControl.Properties.Langs {
return ResourceManager.GetString("Yes", resourceCulture);
}
}
+
+ ///
+ /// 查找类似 放大 的本地化字符串。
+ ///
+ public static string ZoomIn {
+ get {
+ return ResourceManager.GetString("ZoomIn", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 缩小 的本地化字符串。
+ ///
+ public static string ZoomOut {
+ get {
+ return ResourceManager.GetString("ZoomOut", resourceCulture);
+ }
+ }
}
}
diff --git a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.en.resx b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.en.resx
index 28b6a0dc..4992c864 100644
--- a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.en.resx
+++ b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.en.resx
@@ -184,4 +184,10 @@
No
+
+ Zoom in
+
+
+ Zoom out
+
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.fa.resx b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.fa.resx
index 58de5d70..166a0b08 100644
--- a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.fa.resx
+++ b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.fa.resx
@@ -184,4 +184,10 @@
خیر
+
+ Zoom in
+
+
+ Zoom out
+
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.fr.resx b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.fr.resx
index f616fa21..c400a1f2 100644
--- a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.fr.resx
+++ b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.fr.resx
@@ -204,4 +204,10 @@
Non
+
+ Zoom in
+
+
+ Zoom out
+
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.ko-KR.resx b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.ko-KR.resx
index 295d0acb..2579b146 100644
--- a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.ko-KR.resx
+++ b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.ko-KR.resx
@@ -204,4 +204,10 @@
네
+
+ Zoom in
+
+
+ Zoom out
+
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.resx b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.resx
index 76827085..679dd9bb 100644
--- a/src/Shared/HandyControl_Shared/Properties/Langs/Lang.resx
+++ b/src/Shared/HandyControl_Shared/Properties/Langs/Lang.resx
@@ -184,4 +184,10 @@
否
+
+ 放大
+
+
+ 缩小
+
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Base/SliderBaseStyle.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Base/SliderBaseStyle.xaml
index 9d71bc2a..d371ad3a 100644
--- a/src/Shared/HandyControl_Shared/Themes/Styles/Base/SliderBaseStyle.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/Base/SliderBaseStyle.xaml
@@ -72,7 +72,7 @@
-
+
@@ -103,7 +103,7 @@
-
+
@@ -134,7 +134,7 @@
-
+
@@ -165,7 +165,7 @@
-
+
@@ -223,14 +223,14 @@
-
+
-
+
@@ -280,14 +280,14 @@
-
+
-
+
@@ -709,7 +709,7 @@
-
+
@@ -740,7 +740,7 @@
-
+
@@ -771,7 +771,7 @@
-
+
@@ -802,7 +802,7 @@
-
+
@@ -862,7 +862,7 @@
-
+
@@ -870,7 +870,7 @@
-
+
@@ -920,7 +920,7 @@
-
+
@@ -928,7 +928,7 @@
-
+
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/FlowDocumentScrollViewer.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/FlowDocumentScrollViewer.xaml
new file mode 100644
index 00000000..e64aedab
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/FlowDocumentScrollViewer.xaml
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Style.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Style.xaml
index 063d9132..5a7386e4 100644
--- a/src/Shared/HandyControl_Shared/Themes/Styles/Style.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/Style.xaml
@@ -81,6 +81,7 @@
+
\ No newline at end of file
From de5c2e7a6ec0f312ae2da91fcf27873fd11f346f Mon Sep 17 00:00:00 2001
From: NaBian <836904362@qq.com>
Date: Fri, 17 Jan 2020 23:34:00 +0800
Subject: [PATCH 19/26] init branch
---
.../HandyControlDemo_Core30.csproj | 3 ++
.../HandyControlDemo_Net_40.csproj | 3 ++
.../HandyControlDemo_Net_GE45.csproj | 3 ++
.../Data/DemoInfo.json | 4 +--
.../Data/MessageToken.cs | 2 ++
.../Data/MessageToken.tt | 3 +-
.../HandyControlDemo_Shared.projitems | 7 +++++
.../Properties/Langs/Lang.Designer.cs | 9 ++++++
.../Properties/Langs/Lang.en.resx | 3 ++
.../Properties/Langs/Lang.fa.resx | 3 ++
.../Properties/Langs/Lang.fr.resx | 3 ++
.../Properties/Langs/Lang.ko-KR.resx | 3 ++
.../Properties/Langs/Lang.resx | 3 ++
.../OutlinedRectangleTool_16x.png | Bin 0 -> 133 bytes
.../UserControl/Controls/WindowDemoCtl.xaml | 3 ++
.../Window/BlurWindow.xaml | 26 +++++++++---------
.../Window/GlowWindow.xaml | 17 ++++++++++++
.../Window/GlowWindow.xaml.cs | 10 +++++++
.../Controls/Window/GlowWindow.cs | 7 +++++
.../HandyControl_Shared.projitems | 1 +
20 files changed, 97 insertions(+), 16 deletions(-)
create mode 100644 src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/OutlinedRectangleTool_16x.png
create mode 100644 src/Shared/HandyControlDemo_Shared/Window/GlowWindow.xaml
create mode 100644 src/Shared/HandyControlDemo_Shared/Window/GlowWindow.xaml.cs
create mode 100644 src/Shared/HandyControl_Shared/Controls/Window/GlowWindow.cs
diff --git a/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj b/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj
index f91f3b1d..80a476b3 100644
--- a/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj
+++ b/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj
@@ -460,6 +460,9 @@
Resources\Img\LeftMainContent\WPFFlowDocument_16x.png
+
+ Resources\Img\LeftMainContent\OutlinedRectangleTool_16x.png
+
diff --git a/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj b/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj
index bba16269..98fcf4f6 100644
--- a/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj
+++ b/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj
@@ -526,6 +526,9 @@
Resources\Img\LeftMainContent\WPFFlowDocument_16x.png
+
+ Resources\Img\LeftMainContent\OutlinedRectangleTool_16x.png
+
diff --git a/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj b/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj
index 94a32b27..2fd623be 100644
--- a/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj
+++ b/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj
@@ -589,6 +589,9 @@
Resources\Img\LeftMainContent\WPFFlowDocument_16x.png
+
+ Resources\Img\LeftMainContent\OutlinedRectangleTool_16x.png
+
diff --git a/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json b/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json
index 09201d74..89503cad 100644
--- a/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json
+++ b/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json
@@ -45,7 +45,7 @@
[ "ButtonGroup", "ButtonGroupDemoCtl", "ButtonGroup_16x", "" ],
[ "ProgressButton", "ProgressButtonDemoCtl", "ProgressButton_16x", "" ],
[ "ChatBubble", "ChatBubbleDemoCtl", "Bubble_16xLG", "" ],
- [ "Poptip", "PoptipDemoCtl", "PopupCursor_16x", "1" ],
+ [ "Poptip", "PoptipDemoCtl", "PopupCursor_16x", "" ],
[ "NotifyIcon", "NotifyIconDemoCtl", "NotificationHub_16x", "" ],
[ "NumericUpDown", "NumericUpDownDemoCtl", "NumericListBox_16x", "" ],
[ "TextBox", "TextBoxDemoCtl", "TextBox_16x", "" ],
@@ -96,7 +96,7 @@
[ "Sprite", "SpriteDemoCtl", "HandyControl", "" ],
[ "Notification", "NotificationDemoCtl", "Procedure_16x", "" ],
[ "Dialog", "DialogDemoCtl", "Dialog_16x", "" ],
- [ "Window", "WindowDemoCtl", "WindowsForm_16x", "" ]
+ [ "Window", "WindowDemoCtl", "WindowsForm_16x", "1" ]
]
},
{
diff --git a/src/Shared/HandyControlDemo_Shared/Data/MessageToken.cs b/src/Shared/HandyControlDemo_Shared/Data/MessageToken.cs
index 5d039b04..e18b5fb7 100644
--- a/src/Shared/HandyControlDemo_Shared/Data/MessageToken.cs
+++ b/src/Shared/HandyControlDemo_Shared/Data/MessageToken.cs
@@ -40,5 +40,7 @@
public static readonly string QQGroupView = nameof(QQGroupView);
+ public static readonly string GlowWindow = nameof(GlowWindow);
+
}
}
\ No newline at end of file
diff --git a/src/Shared/HandyControlDemo_Shared/Data/MessageToken.tt b/src/Shared/HandyControlDemo_Shared/Data/MessageToken.tt
index 885626a9..db0696aa 100644
--- a/src/Shared/HandyControlDemo_Shared/Data/MessageToken.tt
+++ b/src/Shared/HandyControlDemo_Shared/Data/MessageToken.tt
@@ -22,7 +22,8 @@ var messageList = new List
"BlurWindow",
"CustomNonClientAreaWindow",
"NoNonClientAreaDragableWindow",
- "QQGroupView"
+ "QQGroupView",
+ "GlowWindow"
};
#>
namespace HandyControlDemo.Data
diff --git a/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems b/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems
index 17fed60e..45a6fcf3 100644
--- a/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems
+++ b/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems
@@ -407,6 +407,9 @@
DialogDemoWindow.xaml
+
+ GlowWindow.xaml
+
GrowlDemoWindow.xaml
@@ -923,6 +926,10 @@
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs
index 0a7a2898..21e62118 100644
--- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs
+++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs
@@ -1050,6 +1050,15 @@ namespace HandyControlDemo.Properties.Langs {
}
}
+ ///
+ /// 查找类似 点击打开辉光窗口 的本地化字符串。
+ ///
+ public static string OpenGlowWindow {
+ get {
+ return ResourceManager.GetString("OpenGlowWindow", resourceCulture);
+ }
+ }
+
///
/// 查找类似 点击打开图片浏览器 的本地化字符串。
///
diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx
index eec92d63..dbc55e2a 100644
--- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx
+++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx
@@ -717,4 +717,7 @@
FlowDocumentScrollViewer
+
+ Open glowWindow
+
\ No newline at end of file
diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fa.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fa.resx
index 17f72064..6f5aec9c 100644
--- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fa.resx
+++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fa.resx
@@ -717,4 +717,7 @@
FlowDocumentScrollViewer
+
+ Open glowWindow
+
\ No newline at end of file
diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fr.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fr.resx
index 2a9f70e6..51edab20 100644
--- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fr.resx
+++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fr.resx
@@ -717,4 +717,7 @@
FlowDocumentScrollViewer
+
+ Open glowWindow
+
\ No newline at end of file
diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ko-KR.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ko-KR.resx
index b16ff604..67447dbd 100644
--- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ko-KR.resx
+++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ko-KR.resx
@@ -717,4 +717,7 @@
FlowDocumentScrollViewer
+
+ Open glowWindow
+
\ No newline at end of file
diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx
index 45a4e46c..a6a4fc1d 100644
--- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx
+++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx
@@ -717,4 +717,7 @@
流文档滚动视图
+
+ 点击打开辉光窗口
+
\ No newline at end of file
diff --git a/src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/OutlinedRectangleTool_16x.png b/src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/OutlinedRectangleTool_16x.png
new file mode 100644
index 0000000000000000000000000000000000000000..cb6eb86b80a39faf8e9d18423d1e162b80397f4a
GIT binary patch
literal 133
zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9F5he4R}c>anMprE;@
zi(^Pd+}lfrTnq|4&KKwCe&6r?dQ#{?;f|##nGe?IbN!jTMLV|Pi9fHyv8t7<5(oY_
cdu@2n5L$2jd|oN5BG3p1Pgg&ebxsLQ08m{j=l}o!
literal 0
HcmV?d00001
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/WindowDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/WindowDemoCtl.xaml
index 7417064e..aeb6f37f 100644
--- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/WindowDemoCtl.xaml
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/WindowDemoCtl.xaml
@@ -16,6 +16,9 @@
+
+
+
diff --git a/src/Shared/HandyControlDemo_Shared/Window/BlurWindow.xaml b/src/Shared/HandyControlDemo_Shared/Window/BlurWindow.xaml
index 6a192705..3bcb277a 100644
--- a/src/Shared/HandyControlDemo_Shared/Window/BlurWindow.xaml
+++ b/src/Shared/HandyControlDemo_Shared/Window/BlurWindow.xaml
@@ -1,15 +1,15 @@
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:hc="https://handyorg.github.io/handycontrol"
+ xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
+ mc:Ignorable="d"
+ WindowStartupLocation="CenterScreen"
+ Title="{x:Static langs:Lang.Title}"
+ Style="{StaticResource WindowBlur}"
+ Height="450"
+ Width="800"
+ Icon="/HandyControlDemo;component/Resources/Img/icon.ico">
diff --git a/src/Shared/HandyControlDemo_Shared/Window/GlowWindow.xaml b/src/Shared/HandyControlDemo_Shared/Window/GlowWindow.xaml
new file mode 100644
index 00000000..d24c5ea6
--- /dev/null
+++ b/src/Shared/HandyControlDemo_Shared/Window/GlowWindow.xaml
@@ -0,0 +1,17 @@
+
+
+
+
+
diff --git a/src/Shared/HandyControlDemo_Shared/Window/GlowWindow.xaml.cs b/src/Shared/HandyControlDemo_Shared/Window/GlowWindow.xaml.cs
new file mode 100644
index 00000000..a58d408f
--- /dev/null
+++ b/src/Shared/HandyControlDemo_Shared/Window/GlowWindow.xaml.cs
@@ -0,0 +1,10 @@
+namespace HandyControlDemo.Window
+{
+ public partial class GlowWindow
+ {
+ public GlowWindow()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/src/Shared/HandyControl_Shared/Controls/Window/GlowWindow.cs b/src/Shared/HandyControl_Shared/Controls/Window/GlowWindow.cs
new file mode 100644
index 00000000..eba66263
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Controls/Window/GlowWindow.cs
@@ -0,0 +1,7 @@
+namespace HandyControl.Controls
+{
+ public class GlowWindow : System.Windows.Window
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems b/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems
index cb8ba292..9a285e77 100644
--- a/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems
+++ b/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems
@@ -41,6 +41,7 @@
+
From a3dd633a6632ed6e070f1d1d6d1aac7019944907 Mon Sep 17 00:00:00 2001
From: NaBian <836904362@qq.com>
Date: Sat, 18 Jan 2020 00:13:41 +0800
Subject: [PATCH 20/26] refactor Interop classes
---
.../Controls/Attach/WindowAttach.cs | 2 +-
.../Controls/ColorPicker/ColorDropper.cs | 8 +-
.../Controls/Other/NotifyIcon.cs | 114 ++--
.../Data/Args/MouseHookEventArgs.cs | 2 +-
.../HandyControl_Shared.projitems | 25 +-
.../Commands/PushMainWindow2TopCommand.cs | 2 +-
.../Tools/Helper/IconHelper.cs | 32 +-
.../Tools/Helper/WindowHelper.cs | 28 +-
.../Tools/Hook/ClipboardHook.cs | 6 +-
.../Tools/Hook/KeyboardHook.cs | 20 +-
.../Tools/Hook/MouseHook.cs | 18 +-
.../Tools/Hook/SystemMenuHook.cs | 10 +-
.../Tools/Interop/BITMAPINFO.cs | 54 --
.../Tools/Interop/ExternDll.cs | 11 -
.../Interop/{ => Handle}/BitmapHandle.cs | 2 +-
.../Interop/{ => Handle}/CommonHandles.cs | 0
.../Interop/{ => Handle}/HandleCollector.cs | 0
.../Tools/Interop/{ => Handle}/IconHandle.cs | 2 +-
.../{ => Handle}/SafeFileMappingHandle.cs | 2 +-
.../Interop/{ => Handle}/WpfSafeHandle.cs | 0
.../Tools/Interop/ICONINFO.cs | 16 -
.../Tools/Interop/InteropMethods.cs | 281 +++++++++
.../Tools/Interop/InteropValues.cs | 532 ++++++++++++++++++
.../Tools/Interop/NOTIFYICONDATA.cs | 28 -
.../Tools/Interop/NativeMethods.cs | 246 --------
.../Tools/Interop/NativeValues.cs | 235 --------
.../Tools/Interop/UnsafeNativeMethods.cs | 225 --------
.../Tools/Interop/WNDCLASS.cs | 23 -
28 files changed, 948 insertions(+), 976 deletions(-)
delete mode 100644 src/Shared/HandyControl_Shared/Tools/Interop/BITMAPINFO.cs
delete mode 100644 src/Shared/HandyControl_Shared/Tools/Interop/ExternDll.cs
rename src/Shared/HandyControl_Shared/Tools/Interop/{ => Handle}/BitmapHandle.cs (95%)
rename src/Shared/HandyControl_Shared/Tools/Interop/{ => Handle}/CommonHandles.cs (100%)
rename src/Shared/HandyControl_Shared/Tools/Interop/{ => Handle}/HandleCollector.cs (100%)
rename src/Shared/HandyControl_Shared/Tools/Interop/{ => Handle}/IconHandle.cs (92%)
rename src/Shared/HandyControl_Shared/Tools/Interop/{ => Handle}/SafeFileMappingHandle.cs (95%)
rename src/Shared/HandyControl_Shared/Tools/Interop/{ => Handle}/WpfSafeHandle.cs (100%)
delete mode 100644 src/Shared/HandyControl_Shared/Tools/Interop/ICONINFO.cs
create mode 100644 src/Shared/HandyControl_Shared/Tools/Interop/InteropMethods.cs
create mode 100644 src/Shared/HandyControl_Shared/Tools/Interop/InteropValues.cs
delete mode 100644 src/Shared/HandyControl_Shared/Tools/Interop/NOTIFYICONDATA.cs
delete mode 100644 src/Shared/HandyControl_Shared/Tools/Interop/NativeMethods.cs
delete mode 100644 src/Shared/HandyControl_Shared/Tools/Interop/NativeValues.cs
delete mode 100644 src/Shared/HandyControl_Shared/Tools/Interop/UnsafeNativeMethods.cs
delete mode 100644 src/Shared/HandyControl_Shared/Tools/Interop/WNDCLASS.cs
diff --git a/src/Shared/HandyControl_Shared/Controls/Attach/WindowAttach.cs b/src/Shared/HandyControl_Shared/Controls/Attach/WindowAttach.cs
index 911f6fec..dd6a8db5 100644
--- a/src/Shared/HandyControl_Shared/Controls/Attach/WindowAttach.cs
+++ b/src/Shared/HandyControl_Shared/Controls/Attach/WindowAttach.cs
@@ -97,7 +97,7 @@ namespace HandyControl.Controls
{
var _ = new WindowInteropHelper(window)
{
- Owner = NativeMethods.GetDesktopWindow()
+ Owner = InteropMethods.GetDesktopWindow()
};
}
}
diff --git a/src/Shared/HandyControl_Shared/Controls/ColorPicker/ColorDropper.cs b/src/Shared/HandyControl_Shared/Controls/ColorPicker/ColorDropper.cs
index dc9ecf92..0aea9a99 100644
--- a/src/Shared/HandyControl_Shared/Controls/ColorPicker/ColorDropper.cs
+++ b/src/Shared/HandyControl_Shared/Controls/ColorPicker/ColorDropper.cs
@@ -96,10 +96,10 @@ namespace HandyControl.Controls
public static Color GetColorAt(int x, int y)
{
- var desk = UnsafeNativeMethods.GetDesktopWindow();
- var dc = UnsafeNativeMethods.GetWindowDC(desk);
- var a = (int)UnsafeNativeMethods.GetPixel(dc, x, y);
- UnsafeNativeMethods.ReleaseDC(desk, dc);
+ var desk = InteropMethods.GetDesktopWindow();
+ var dc = InteropMethods.GetWindowDC(desk);
+ var a = (int)InteropMethods.GetPixel(dc, x, y);
+ InteropMethods.ReleaseDC(desk, dc);
return Color.FromArgb(255, (byte) ((a >> 0) & 0xff), (byte) ((a >> 8) & 0xff), (byte) ((a >> 16) & 0xff));
}
}
diff --git a/src/Shared/HandyControl_Shared/Controls/Other/NotifyIcon.cs b/src/Shared/HandyControl_Shared/Controls/Other/NotifyIcon.cs
index 988b72c4..831d7f22 100644
--- a/src/Shared/HandyControl_Shared/Controls/Other/NotifyIcon.cs
+++ b/src/Shared/HandyControl_Shared/Controls/Other/NotifyIcon.cs
@@ -33,7 +33,7 @@ namespace HandyControl.Controls
private IconHandle _iconHandle;
- private const int WmTrayMouseMessage = NativeMethods.WM_USER + 1024;
+ private const int WmTrayMouseMessage = InteropValues.WM_USER + 1024;
private string _windowClassName;
@@ -41,7 +41,7 @@ namespace HandyControl.Controls
private IntPtr _messageWindowHandle;
- private readonly WndProc _callback;
+ private readonly InteropValues.WndProc _callback;
private Popup _contextContent;
@@ -165,9 +165,9 @@ namespace HandyControl.Controls
{
if (!_added || DesignerHelper.IsInDesignMode) return;
- var data = new NOTIFYICONDATA
+ var data = new InteropValues.NOTIFYICONDATA
{
- uFlags = NativeMethods.NIF_INFO,
+ uFlags = InteropValues.NIF_INFO,
hWnd = _messageWindowHandle,
uID = _id,
szInfoTitle = title ?? string.Empty,
@@ -177,20 +177,20 @@ namespace HandyControl.Controls
switch (infoType)
{
case NotifyIconInfoType.Info:
- data.dwInfoFlags = NativeMethods.NIIF_INFO;
+ data.dwInfoFlags = InteropValues.NIIF_INFO;
break;
case NotifyIconInfoType.Warning:
- data.dwInfoFlags = NativeMethods.NIIF_WARNING;
+ data.dwInfoFlags = InteropValues.NIIF_WARNING;
break;
case NotifyIconInfoType.Error:
- data.dwInfoFlags = NativeMethods.NIIF_ERROR;
+ data.dwInfoFlags = InteropValues.NIIF_ERROR;
break;
case NotifyIconInfoType.None:
- data.dwInfoFlags = NativeMethods.NIIF_NONE;
+ data.dwInfoFlags = InteropValues.NIIF_NONE;
break;
}
- UnsafeNativeMethods.Shell_NotifyIcon(NativeMethods.NIM_MODIFY, data);
+ InteropMethods.Shell_NotifyIcon(InteropValues.NIM_MODIFY, data);
}
public void Dispose()
@@ -330,7 +330,7 @@ namespace HandyControl.Controls
{
var isTrue = FindNotifyIcon(out var rectNotify);
if (!isTrue) return false;
- NativeMethods.GetCursorPos(out var point);
+ InteropMethods.GetCursorPos(out var point);
if (point.X >= rectNotify.Left && point.X <= rectNotify.Right &&
point.Y >= rectNotify.Top && point.Y <= rectNotify.Bottom)
{
@@ -368,17 +368,17 @@ namespace HandyControl.Controls
//referenced from http://www.cnblogs.com/sczmzx/p/5158127.html
private IntPtr FindTrayToolbarWindow()
{
- var hWnd = NativeMethods.FindWindow("Shell_TrayWnd", null);
+ var hWnd = InteropMethods.FindWindow("Shell_TrayWnd", null);
if (hWnd != IntPtr.Zero)
{
- hWnd = NativeMethods.FindWindowEx(hWnd, IntPtr.Zero, "TrayNotifyWnd", null);
+ hWnd = InteropMethods.FindWindowEx(hWnd, IntPtr.Zero, "TrayNotifyWnd", null);
if (hWnd != IntPtr.Zero)
{
- hWnd = NativeMethods.FindWindowEx(hWnd, IntPtr.Zero, "SysPager", null);
+ hWnd = InteropMethods.FindWindowEx(hWnd, IntPtr.Zero, "SysPager", null);
if (hWnd != IntPtr.Zero)
{
- hWnd = NativeMethods.FindWindowEx(hWnd, IntPtr.Zero, "ToolbarWindow32", null);
+ hWnd = InteropMethods.FindWindowEx(hWnd, IntPtr.Zero, "ToolbarWindow32", null);
}
}
@@ -389,17 +389,17 @@ namespace HandyControl.Controls
//referenced from http://www.cnblogs.com/sczmzx/p/5158127.html
private IntPtr FindTrayToolbarOverFlowWindow()
{
- var hWnd = NativeMethods.FindWindow("NotifyIconOverflowWindow", null);
+ var hWnd = InteropMethods.FindWindow("NotifyIconOverflowWindow", null);
if (hWnd != IntPtr.Zero)
{
- hWnd = NativeMethods.FindWindowEx(hWnd, IntPtr.Zero, "ToolbarWindow32", null);
+ hWnd = InteropMethods.FindWindowEx(hWnd, IntPtr.Zero, "ToolbarWindow32", null);
}
return hWnd;
}
- private bool FindNotifyIcon(out NativeMethods.RECT rect)
+ private bool FindNotifyIcon(out InteropValues.RECT rect)
{
- var rectNotify = new NativeMethods.RECT();
+ var rectNotify = new InteropValues.RECT();
var hTrayWnd = FindTrayToolbarWindow();
var isTrue = FindNotifyIcon(hTrayWnd, ref rectNotify);
if (!isTrue)
@@ -412,48 +412,48 @@ namespace HandyControl.Controls
}
//referenced from http://www.cnblogs.com/sczmzx/p/5158127.html
- private bool FindNotifyIcon(IntPtr hTrayWnd, ref NativeMethods.RECT rectNotify)
+ private bool FindNotifyIcon(IntPtr hTrayWnd, ref InteropValues.RECT rectNotify)
{
- NativeMethods.GetWindowRect(hTrayWnd, out var rectTray);
- var count = (int)NativeMethods.SendMessage(hTrayWnd, NativeMethods.TB_BUTTONCOUNT, 0, IntPtr.Zero);
+ InteropMethods.GetWindowRect(hTrayWnd, out var rectTray);
+ var count = (int)InteropMethods.SendMessage(hTrayWnd, InteropValues.TB_BUTTONCOUNT, 0, IntPtr.Zero);
var isFind = false;
if (count > 0)
{
- NativeMethods.GetWindowThreadProcessId(hTrayWnd, out var trayPid);
- var hProcess = NativeMethods.OpenProcess(NativeMethods.ProcessAccess.VMOperation | NativeMethods.ProcessAccess.VMRead | NativeMethods.ProcessAccess.VMWrite, false, trayPid);
- var address = NativeMethods.VirtualAllocEx(hProcess, IntPtr.Zero, 1024, NativeMethods.AllocationType.Commit, NativeMethods.MemoryProtection.ReadWrite);
+ InteropMethods.GetWindowThreadProcessId(hTrayWnd, out var trayPid);
+ var hProcess = InteropMethods.OpenProcess(InteropValues.ProcessAccess.VMOperation | InteropValues.ProcessAccess.VMRead | InteropValues.ProcessAccess.VMWrite, false, trayPid);
+ var address = InteropMethods.VirtualAllocEx(hProcess, IntPtr.Zero, 1024, InteropValues.AllocationType.Commit, InteropValues.MemoryProtection.ReadWrite);
- var btnData = new NativeMethods.TBBUTTON();
- var trayData = new NativeMethods.TRAYDATA();
+ var btnData = new InteropValues.TBBUTTON();
+ var trayData = new InteropValues.TRAYDATA();
var handel = Process.GetCurrentProcess().Id;
for (uint i = 0; i < count; i++)
{
- NativeMethods.SendMessage(hTrayWnd, NativeMethods.TB_GETBUTTON, i, address);
- var isTrue = NativeMethods.ReadProcessMemory(hProcess, address, out btnData, Marshal.SizeOf(btnData), out _);
+ InteropMethods.SendMessage(hTrayWnd, InteropValues.TB_GETBUTTON, i, address);
+ var isTrue = InteropMethods.ReadProcessMemory(hProcess, address, out btnData, Marshal.SizeOf(btnData), out _);
if (!isTrue) continue;
if (btnData.dwData == IntPtr.Zero)
{
btnData.dwData = btnData.iString;
}
- NativeMethods.ReadProcessMemory(hProcess, btnData.dwData, out trayData, Marshal.SizeOf(trayData), out _);
- NativeMethods.GetWindowThreadProcessId(trayData.hwnd, out var dwProcessId);
+ InteropMethods.ReadProcessMemory(hProcess, btnData.dwData, out trayData, Marshal.SizeOf(trayData), out _);
+ InteropMethods.GetWindowThreadProcessId(trayData.hwnd, out var dwProcessId);
if (dwProcessId == (uint)handel)
{
- var rect = new NativeMethods.RECT();
- var lngRect = NativeMethods.VirtualAllocEx(hProcess, IntPtr.Zero, Marshal.SizeOf(typeof(Rect)), NativeMethods.AllocationType.Commit, NativeMethods.MemoryProtection.ReadWrite);
- NativeMethods.SendMessage(hTrayWnd, NativeMethods.TB_GETITEMRECT, i, lngRect);
- NativeMethods.ReadProcessMemory(hProcess, lngRect, out rect, Marshal.SizeOf(rect), out _);
+ var rect = new InteropValues.RECT();
+ var lngRect = InteropMethods.VirtualAllocEx(hProcess, IntPtr.Zero, Marshal.SizeOf(typeof(Rect)), InteropValues.AllocationType.Commit, InteropValues.MemoryProtection.ReadWrite);
+ InteropMethods.SendMessage(hTrayWnd, InteropValues.TB_GETITEMRECT, i, lngRect);
+ InteropMethods.ReadProcessMemory(hProcess, lngRect, out rect, Marshal.SizeOf(rect), out _);
- NativeMethods.VirtualFreeEx(hProcess, lngRect, Marshal.SizeOf(rect), NativeMethods.FreeType.Decommit);
- NativeMethods.VirtualFreeEx(hProcess, lngRect, 0, NativeMethods.FreeType.Release);
+ InteropMethods.VirtualFreeEx(hProcess, lngRect, Marshal.SizeOf(rect), InteropValues.FreeType.Decommit);
+ InteropMethods.VirtualFreeEx(hProcess, lngRect, 0, InteropValues.FreeType.Release);
var left = rectTray.Left + rect.Left;
var top = rectTray.Top + rect.Top;
var botton = rectTray.Top + rect.Bottom;
var right = rectTray.Left + rect.Right;
- rectNotify = new NativeMethods.RECT
+ rectNotify = new InteropValues.RECT
{
Left = left,
Right = right,
@@ -464,9 +464,9 @@ namespace HandyControl.Controls
break;
}
}
- NativeMethods.VirtualFreeEx(hProcess, address, 0x4096, NativeMethods.FreeType.Decommit);
- NativeMethods.VirtualFreeEx(hProcess, address, 0, NativeMethods.FreeType.Release);
- NativeMethods.CloseHandle(hProcess);
+ InteropMethods.VirtualFreeEx(hProcess, address, 0x4096, InteropValues.FreeType.Decommit);
+ InteropMethods.VirtualFreeEx(hProcess, address, 0, InteropValues.FreeType.Release);
+ InteropMethods.CloseHandle(hProcess);
}
return isFind;
}
@@ -496,13 +496,13 @@ namespace HandyControl.Controls
if (DesignerHelper.IsInDesignMode) return;
_isTransparent = isTransparent;
- var data = new NOTIFYICONDATA
+ var data = new InteropValues.NOTIFYICONDATA
{
uCallbackMessage = WmTrayMouseMessage,
- uFlags = NativeMethods.NIF_MESSAGE | NativeMethods.NIF_ICON | NativeMethods.NIF_TIP,
+ uFlags = InteropValues.NIF_MESSAGE | InteropValues.NIF_ICON | InteropValues.NIF_TIP,
hWnd = _messageWindowHandle,
uID = _id,
- dwInfoFlags = NativeMethods.NIF_TIP,
+ dwInfoFlags = InteropValues.NIF_TIP,
hIcon = isTransparent ? IntPtr.Zero : _iconCurrentHandle,
szTip = Text
};
@@ -511,17 +511,17 @@ namespace HandyControl.Controls
{
if (!_added)
{
- UnsafeNativeMethods.Shell_NotifyIcon(NativeMethods.NIM_ADD, data);
+ InteropMethods.Shell_NotifyIcon(InteropValues.NIM_ADD, data);
_added = true;
}
else
{
- UnsafeNativeMethods.Shell_NotifyIcon(NativeMethods.NIM_MODIFY, data);
+ InteropMethods.Shell_NotifyIcon(InteropValues.NIM_MODIFY, data);
}
}
else if (_added)
{
- UnsafeNativeMethods.Shell_NotifyIcon(NativeMethods.NIM_DELETE, data);
+ InteropMethods.Shell_NotifyIcon(InteropValues.NIM_DELETE, data);
_added = false;
}
}
@@ -530,7 +530,7 @@ namespace HandyControl.Controls
private void RegisterClass()
{
_windowClassName = $"HandyControl.Controls.NotifyIcon{Guid.NewGuid()}";
- var wndclass = new WNDCLASS
+ var wndclass = new InteropValues.WNDCLASS
{
style = 0,
lpfnWndProc = _callback,
@@ -544,9 +544,9 @@ namespace HandyControl.Controls
lpszClassName = _windowClassName
};
- UnsafeNativeMethods.RegisterClass(wndclass);
- _wmTaskbarCreated = NativeMethods.RegisterWindowMessage("TaskbarCreated");
- _messageWindowHandle = UnsafeNativeMethods.CreateWindowEx(0, _windowClassName, "", 0, 0, 0, 1, 1,
+ InteropMethods.RegisterClass(wndclass);
+ _wmTaskbarCreated = InteropMethods.RegisterWindowMessage("TaskbarCreated");
+ _messageWindowHandle = InteropMethods.CreateWindowEx(0, _windowClassName, "", 0, 0, 0, 1, 1,
IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);
}
@@ -562,17 +562,17 @@ namespace HandyControl.Controls
{
switch (lparam.ToInt64())
{
- case NativeMethods.WM_LBUTTONDBLCLK:
+ case InteropValues.WM_LBUTTONDBLCLK:
WmMouseDown(MouseButton.Left, 2);
break;
- case NativeMethods.WM_LBUTTONUP:
+ case InteropValues.WM_LBUTTONUP:
WmMouseUp(MouseButton.Left);
break;
- case NativeMethods.WM_RBUTTONUP:
+ case InteropValues.WM_RBUTTONUP:
ShowContextMenu();
WmMouseUp(MouseButton.Right);
break;
- case NativeMethods.WM_MOUSEMOVE:
+ case InteropValues.WM_MOUSEMOVE:
if (!_dispatcherTimerPos.IsEnabled)
{
_dispatcherTimerPos.Interval = TimeSpan.FromMilliseconds(200);
@@ -583,7 +583,7 @@ namespace HandyControl.Controls
}
}
- return UnsafeNativeMethods.DefWindowProc(hWnd, msg, wparam, lparam);
+ return InteropMethods.DefWindowProc(hWnd, msg, wparam, lparam);
}
private void WmMouseDown(MouseButton button, int clicks)
@@ -632,7 +632,7 @@ namespace HandyControl.Controls
Content = ContextContent
};
_contextContent.IsOpen = true;
- UnsafeNativeMethods.SetForegroundWindow(_contextContent.Child.GetHandle());
+ InteropMethods.SetForegroundWindow(_contextContent.Child.GetHandle());
}
else if (ContextMenu != null)
{
@@ -655,7 +655,7 @@ namespace HandyControl.Controls
ContextMenu.Placement = PlacementMode.Mouse;
ContextMenu.IsOpen = true;
- UnsafeNativeMethods.SetForegroundWindow(ContextMenu.GetHandle());
+ InteropMethods.SetForegroundWindow(ContextMenu.GetHandle());
}
}
diff --git a/src/Shared/HandyControl_Shared/Data/Args/MouseHookEventArgs.cs b/src/Shared/HandyControl_Shared/Data/Args/MouseHookEventArgs.cs
index 9c6b03fd..b63114ec 100644
--- a/src/Shared/HandyControl_Shared/Data/Args/MouseHookEventArgs.cs
+++ b/src/Shared/HandyControl_Shared/Data/Args/MouseHookEventArgs.cs
@@ -7,6 +7,6 @@ namespace HandyControl.Data
{
public MouseHookMessageType Message { get; set; }
- public NativeMethods.POINT Point { get; set; }
+ public InteropValues.POINT Point { get; set; }
}
}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems b/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems
index 9a285e77..bf76311c 100644
--- a/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems
+++ b/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems
@@ -310,20 +310,14 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
@@ -944,4 +938,7 @@
+
+
+
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Interactivity/Commands/PushMainWindow2TopCommand.cs b/src/Shared/HandyControl_Shared/Interactivity/Commands/PushMainWindow2TopCommand.cs
index 65e96979..07a2427c 100644
--- a/src/Shared/HandyControl_Shared/Interactivity/Commands/PushMainWindow2TopCommand.cs
+++ b/src/Shared/HandyControl_Shared/Interactivity/Commands/PushMainWindow2TopCommand.cs
@@ -18,7 +18,7 @@ namespace HandyControl.Interactivity
var hwndSource = (HwndSource)PresentationSource.FromDependencyObject(Application.Current.MainWindow);
if (hwndSource != null)
{
- UnsafeNativeMethods.SetForegroundWindow(hwndSource.Handle);
+ InteropMethods.SetForegroundWindow(hwndSource.Handle);
}
}
}
diff --git a/src/Shared/HandyControl_Shared/Tools/Helper/IconHelper.cs b/src/Shared/HandyControl_Shared/Tools/Helper/IconHelper.cs
index 225302dd..37b68989 100644
--- a/src/Shared/HandyControl_Shared/Tools/Helper/IconHelper.cs
+++ b/src/Shared/HandyControl_Shared/Tools/Helper/IconHelper.cs
@@ -79,13 +79,13 @@ namespace HandyControl.Tools
try
{
- var bi = new BITMAPINFO(width, -height, 32)
+ var bi = new InteropValues.BITMAPINFO(width, -height, 32)
{
- bmiHeader_biCompression = NativeMethods.BI_RGB
+ bmiHeader_biCompression = InteropValues.BI_RGB
};
var bits = IntPtr.Zero;
- colorBitmap = UnsafeNativeMethods.CreateDIBSection(new HandleRef(null, IntPtr.Zero), ref bi, NativeMethods.DIB_RGB_COLORS, ref bits, null, 0);
+ colorBitmap = InteropMethods.CreateDIBSection(new HandleRef(null, IntPtr.Zero), ref bi, InteropValues.DIB_RGB_COLORS, ref bits, null, 0);
if (colorBitmap.IsInvalid || bits == IntPtr.Zero)
{
@@ -95,13 +95,13 @@ namespace HandyControl.Tools
Marshal.Copy(colorArray, 0, bits, colorArray.Length);
var maskArray = GenerateMaskArray(width, height, colorArray);
- maskBitmap = UnsafeNativeMethods.CreateBitmap(width, height, 1, 1, maskArray);
+ maskBitmap = InteropMethods.CreateBitmap(width, height, 1, 1, maskArray);
if (maskBitmap.IsInvalid)
{
return IconHandle.GetInvalidIcon();
}
- var iconInfo = new ICONINFO
+ var iconInfo = new InteropValues.ICONINFO
{
fIcon = isIcon,
xHotspot = xHotspot,
@@ -110,7 +110,7 @@ namespace HandyControl.Tools
hbmColor = colorBitmap
};
- return UnsafeNativeMethods.CreateIconIndirect(iconInfo);
+ return InteropMethods.CreateIconIndirect(iconInfo);
}
finally
{
@@ -252,21 +252,21 @@ namespace HandyControl.Tools
{
if (SystemBitDepth == 0)
{
- var hdcDesktop = new HandleRef(null, UnsafeNativeMethods.GetDC(new HandleRef()));
+ var hdcDesktop = new HandleRef(null, InteropMethods.GetDC(new HandleRef()));
try
{
- var sysBitDepth = UnsafeNativeMethods.GetDeviceCaps(hdcDesktop, NativeMethods.BITSPIXEL);
- sysBitDepth *= UnsafeNativeMethods.GetDeviceCaps(hdcDesktop, NativeMethods.PLANES);
+ var sysBitDepth = InteropMethods.GetDeviceCaps(hdcDesktop, InteropValues.BITSPIXEL);
+ sysBitDepth *= InteropMethods.GetDeviceCaps(hdcDesktop, InteropValues.PLANES);
if (sysBitDepth == 8)
{
sysBitDepth = 4;
}
- var cxSmallIcon = UnsafeNativeMethods.GetSystemMetrics(SM.CXSMICON);
- var cySmallIcon = UnsafeNativeMethods.GetSystemMetrics(SM.CYSMICON);
- var cxIcon = UnsafeNativeMethods.GetSystemMetrics(SM.CXICON);
- var cyIcon = UnsafeNativeMethods.GetSystemMetrics(SM.CYICON);
+ var cxSmallIcon = InteropMethods.GetSystemMetrics(InteropValues.SM.CXSMICON);
+ var cySmallIcon = InteropMethods.GetSystemMetrics(InteropValues.SM.CYSMICON);
+ var cxIcon = InteropMethods.GetSystemMetrics(InteropValues.SM.CXICON);
+ var cyIcon = InteropMethods.GetSystemMetrics(InteropValues.SM.CYICON);
SmallIconSize = new Size(cxSmallIcon, cySmallIcon);
IconSize = new Size(cxIcon, cyIcon);
@@ -274,7 +274,7 @@ namespace HandyControl.Tools
}
finally
{
- UnsafeNativeMethods.ReleaseDC(new HandleRef(), hdcDesktop);
+ InteropMethods.ReleaseDC(new HandleRef(), hdcDesktop);
}
}
}
@@ -287,8 +287,8 @@ namespace HandyControl.Tools
SecurityHelper.DemandUIWindowPermission();
- var iconModuleFile = UnsafeNativeMethods.GetModuleFileName(new HandleRef());
- UnsafeNativeMethods.ExtractIconEx(iconModuleFile, 0, out largeIconHandle, out smallIconHandle, 1);
+ var iconModuleFile = InteropMethods.GetModuleFileName(new HandleRef());
+ InteropMethods.ExtractIconEx(iconModuleFile, 0, out largeIconHandle, out smallIconHandle, 1);
}
}
}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Tools/Helper/WindowHelper.cs b/src/Shared/HandyControl_Shared/Tools/Helper/WindowHelper.cs
index c606d165..818df6bc 100644
--- a/src/Shared/HandyControl_Shared/Tools/Helper/WindowHelper.cs
+++ b/src/Shared/HandyControl_Shared/Tools/Helper/WindowHelper.cs
@@ -19,7 +19,7 @@ namespace HandyControl.Tools
///
public static Window GetActiveWindow() => Application.Current.Windows.OfType().SingleOrDefault(x => x.IsActive);
- private static readonly BitArray _cacheValid = new BitArray((int)CacheSlot.NumSlots);
+ private static readonly BitArray _cacheValid = new BitArray((int)InteropValues.CacheSlot.NumSlots);
private static bool _setDpiX = true;
@@ -43,7 +43,7 @@ namespace HandyControl.Tools
var desktopWnd = new HandleRef(null, IntPtr.Zero);
// Win32Exception will get the Win32 error code so we don't have to
- var dc = UnsafeNativeMethods.GetDC(desktopWnd);
+ var dc = InteropMethods.GetDC(desktopWnd);
// Detecting error case from unmanaged call, required by PREsharp to throw a Win32Exception
if (dc == IntPtr.Zero)
@@ -53,12 +53,12 @@ namespace HandyControl.Tools
try
{
- _dpi = UnsafeNativeMethods.GetDeviceCaps(new HandleRef(null, dc), NativeMethods.LOGPIXELSY);
+ _dpi = InteropMethods.GetDeviceCaps(new HandleRef(null, dc), InteropValues.LOGPIXELSY);
_dpiInitialized = true;
}
finally
{
- UnsafeNativeMethods.ReleaseDC(desktopWnd, new HandleRef(null, dc));
+ InteropMethods.ReleaseDC(desktopWnd, new HandleRef(null, dc));
}
}
}
@@ -82,19 +82,19 @@ namespace HandyControl.Tools
{
_setDpiX = false;
var desktopWnd = new HandleRef(null, IntPtr.Zero);
- var dc = UnsafeNativeMethods.GetDC(desktopWnd);
+ var dc = InteropMethods.GetDC(desktopWnd);
if (dc == IntPtr.Zero)
{
throw new Win32Exception();
}
try
{
- _dpiX = UnsafeNativeMethods.GetDeviceCaps(new HandleRef(null, dc), NativeMethods.LOGPIXELSX);
- _cacheValid[(int)CacheSlot.DpiX] = true;
+ _dpiX = InteropMethods.GetDeviceCaps(new HandleRef(null, dc), InteropValues.LOGPIXELSX);
+ _cacheValid[(int)InteropValues.CacheSlot.DpiX] = true;
}
finally
{
- UnsafeNativeMethods.ReleaseDC(desktopWnd, new HandleRef(null, dc));
+ InteropMethods.ReleaseDC(desktopWnd, new HandleRef(null, dc));
}
}
}
@@ -113,11 +113,11 @@ namespace HandyControl.Tools
{
lock (_cacheValid)
{
- while (!_cacheValid[(int)CacheSlot.WindowResizeBorderThickness])
+ while (!_cacheValid[(int)InteropValues.CacheSlot.WindowResizeBorderThickness])
{
- _cacheValid[(int)CacheSlot.WindowResizeBorderThickness] = true;
+ _cacheValid[(int)InteropValues.CacheSlot.WindowResizeBorderThickness] = true;
- var frameSize = new Size(NativeMethods.GetSystemMetrics(SM.CXSIZEFRAME), NativeMethods.GetSystemMetrics(SM.CYSIZEFRAME));
+ var frameSize = new Size(InteropMethods.GetSystemMetrics(InteropValues.SM.CXSIZEFRAME), InteropMethods.GetSystemMetrics(InteropValues.SM.CYSIZEFRAME));
var frameSizeInDips = DpiHelper.DeviceSizeToLogical(frameSize, DpiX / 96.0, Dpi / 96.0);
_windowResizeBorderThickness = new Thickness(frameSizeInDips.Width, frameSizeInDips.Height, frameSizeInDips.Width, frameSizeInDips.Height);
@@ -135,9 +135,9 @@ namespace HandyControl.Tools
#if netle40
return WindowResizeBorderThickness;
#elif Core
- var hdc = UnsafeNativeMethods.GetDC(IntPtr.Zero);
- var scale = UnsafeNativeMethods.GetDeviceCaps(hdc, NativeMethods.DESKTOPVERTRES) / (float)UnsafeNativeMethods.GetDeviceCaps(hdc, NativeMethods.VERTRES);
- UnsafeNativeMethods.ReleaseDC(IntPtr.Zero, hdc);
+ var hdc = InteropMethods.GetDC(IntPtr.Zero);
+ var scale = InteropMethods.GetDeviceCaps(hdc, InteropValues.DESKTOPVERTRES) / (float)InteropMethods.GetDeviceCaps(hdc, InteropValues.VERTRES);
+ InteropMethods.ReleaseDC(IntPtr.Zero, hdc);
return WindowResizeBorderThickness.Add(new Thickness(4 * scale));
#else
return WindowResizeBorderThickness.Add(new Thickness(4));
diff --git a/src/Shared/HandyControl_Shared/Tools/Hook/ClipboardHook.cs b/src/Shared/HandyControl_Shared/Tools/Hook/ClipboardHook.cs
index b98bb50a..61c9fc8f 100644
--- a/src/Shared/HandyControl_Shared/Tools/Hook/ClipboardHook.cs
+++ b/src/Shared/HandyControl_Shared/Tools/Hook/ClipboardHook.cs
@@ -24,19 +24,19 @@ namespace HandyControl.Tools
if (HWndSource != null)
{
HWndSource.AddHook(WinProc);
- NativeMethods.AddClipboardFormatListener(HookId);
+ InteropMethods.AddClipboardFormatListener(HookId);
}
}
public static void Stop()
{
HWndSource.RemoveHook(WinProc);
- NativeMethods.RemoveClipboardFormatListener(HookId);
+ InteropMethods.RemoveClipboardFormatListener(HookId);
}
private static IntPtr WinProc(IntPtr hwnd, int msg, IntPtr wparam, IntPtr lparam, ref bool handled)
{
- if (msg == NativeMethods.WM_CLIPBOARDUPDATE)
+ if (msg == InteropValues.WM_CLIPBOARDUPDATE)
{
ContentChanged?.Invoke();
}
diff --git a/src/Shared/HandyControl_Shared/Tools/Hook/KeyboardHook.cs b/src/Shared/HandyControl_Shared/Tools/Hook/KeyboardHook.cs
index 07ce92b6..58388c83 100644
--- a/src/Shared/HandyControl_Shared/Tools/Hook/KeyboardHook.cs
+++ b/src/Shared/HandyControl_Shared/Tools/Hook/KeyboardHook.cs
@@ -14,17 +14,17 @@ namespace HandyControl.Tools
private static IntPtr HookId = IntPtr.Zero;
- private static readonly UnsafeNativeMethods.HookProc Proc = HookCallback;
+ private static readonly InteropValues.HookProc Proc = HookCallback;
private static int VirtualKey;
- private static readonly IntPtr KeyDownIntPtr = (IntPtr)NativeMethods.WM_KEYDOWN;
+ private static readonly IntPtr KeyDownIntPtr = (IntPtr)InteropValues.WM_KEYDOWN;
- private static readonly IntPtr KeyUpIntPtr = (IntPtr)NativeMethods.WM_KEYUP;
+ private static readonly IntPtr KeyUpIntPtr = (IntPtr)InteropValues.WM_KEYUP;
- private static readonly IntPtr SyskeyDownIntPtr = (IntPtr)NativeMethods.WM_SYSKEYDOWN;
+ private static readonly IntPtr SyskeyDownIntPtr = (IntPtr)InteropValues.WM_SYSKEYDOWN;
- private static readonly IntPtr SyskeyUpIntPtr = (IntPtr)NativeMethods.WM_SYSKEYUP;
+ private static readonly IntPtr SyskeyUpIntPtr = (IntPtr)InteropValues.WM_SYSKEYUP;
public static void Start()
{
@@ -35,17 +35,17 @@ namespace HandyControl.Tools
HookId = SetHook(Proc);
}
- public static void Stop() => UnsafeNativeMethods.UnhookWindowsHookEx(HookId);
+ public static void Stop() => InteropMethods.UnhookWindowsHookEx(HookId);
- private static IntPtr SetHook(UnsafeNativeMethods.HookProc proc)
+ private static IntPtr SetHook(InteropValues.HookProc proc)
{
using (var curProcess = Process.GetCurrentProcess())
using (var curModule = curProcess.MainModule)
{
if (curModule != null)
{
- return UnsafeNativeMethods.SetWindowsHookEx((int)UnsafeNativeMethods.HookType.WH_KEYBOARD_LL, proc,
- UnsafeNativeMethods.GetModuleHandle(curModule.ModuleName), 0);
+ return InteropMethods.SetWindowsHookEx((int)InteropValues.HookType.WH_KEYBOARD_LL, proc,
+ InteropMethods.GetModuleHandle(curModule.ModuleName), 0);
}
return IntPtr.Zero;
}
@@ -86,7 +86,7 @@ namespace HandyControl.Tools
KeyUp?.Invoke(null, new KeyboardHookEventArgs(virtualKey, true));
}
}
- return UnsafeNativeMethods.CallNextHookEx(HookId, nCode, wParam, lParam);
+ return InteropMethods.CallNextHookEx(HookId, nCode, wParam, lParam);
}
}
}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Tools/Hook/MouseHook.cs b/src/Shared/HandyControl_Shared/Tools/Hook/MouseHook.cs
index 5405c6cf..90b1f0d6 100644
--- a/src/Shared/HandyControl_Shared/Tools/Hook/MouseHook.cs
+++ b/src/Shared/HandyControl_Shared/Tools/Hook/MouseHook.cs
@@ -12,7 +12,7 @@ namespace HandyControl.Tools
private static IntPtr HookId = IntPtr.Zero;
- private static readonly UnsafeNativeMethods.HookProc Proc = HookCallback;
+ private static readonly InteropValues.HookProc Proc = HookCallback;
public static void Start()
{
@@ -23,17 +23,17 @@ namespace HandyControl.Tools
HookId = SetHook(Proc);
}
- public static void Stop() => UnsafeNativeMethods.UnhookWindowsHookEx(HookId);
+ public static void Stop() => InteropMethods.UnhookWindowsHookEx(HookId);
- private static IntPtr SetHook(UnsafeNativeMethods.HookProc proc)
+ private static IntPtr SetHook(InteropValues.HookProc proc)
{
using (var curProcess = Process.GetCurrentProcess())
using (var curModule = curProcess.MainModule)
{
if (curModule != null)
{
- return UnsafeNativeMethods.SetWindowsHookEx((int) UnsafeNativeMethods.HookType.WH_MOUSE_LL, proc,
- UnsafeNativeMethods.GetModuleHandle(curModule.ModuleName), 0);
+ return InteropMethods.SetWindowsHookEx((int)InteropValues.HookType.WH_MOUSE_LL, proc,
+ InteropMethods.GetModuleHandle(curModule.ModuleName), 0);
}
return IntPtr.Zero;
}
@@ -41,15 +41,15 @@ namespace HandyControl.Tools
private static IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam)
{
- if (nCode < 0) return UnsafeNativeMethods.CallNextHookEx(HookId, nCode, wParam, lParam);
- var hookStruct = (UnsafeNativeMethods.MOUSEHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(UnsafeNativeMethods.MOUSEHOOKSTRUCT));
+ if (nCode < 0) return InteropMethods.CallNextHookEx(HookId, nCode, wParam, lParam);
+ var hookStruct = (InteropValues.MOUSEHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(InteropValues.MOUSEHOOKSTRUCT));
StatusChanged?.Invoke(null, new MouseHookEventArgs
{
Message = (MouseHookMessageType)wParam,
- Point = new NativeMethods.POINT(hookStruct.pt.X, hookStruct.pt.Y)
+ Point = new InteropValues.POINT(hookStruct.pt.X, hookStruct.pt.Y)
});
- return UnsafeNativeMethods.CallNextHookEx(HookId, nCode, wParam, lParam);
+ return InteropMethods.CallNextHookEx(HookId, nCode, wParam, lParam);
}
}
}
diff --git a/src/Shared/HandyControl_Shared/Tools/Hook/SystemMenuHook.cs b/src/Shared/HandyControl_Shared/Tools/Hook/SystemMenuHook.cs
index afe6f66b..af10084f 100644
--- a/src/Shared/HandyControl_Shared/Tools/Hook/SystemMenuHook.cs
+++ b/src/Shared/HandyControl_Shared/Tools/Hook/SystemMenuHook.cs
@@ -19,14 +19,14 @@ namespace HandyControl.Tools
if (source != null)
{
DataDic[id] = source;
- NativeMethods.InsertMenu(NativeMethods.GetSystemMenu(hookId, false), index, NativeMethods.MF_BYPOSITION, id, text);
+ InteropMethods.InsertMenu(InteropMethods.GetSystemMenu(hookId, false), index, InteropValues.MF_BYPOSITION, id, text);
source.AddHook(WinProc);
}
}
- public static void InsertSeperator(int index, Window window) => NativeMethods.InsertMenu(
- NativeMethods.GetSystemMenu(window.GetHandle(), false), index,
- NativeMethods.MF_BYPOSITION | NativeMethods.MF_SEPARATOR, 0, "");
+ public static void InsertSeperator(int index, Window window) => InteropMethods.InsertMenu(
+ InteropMethods.GetSystemMenu(window.GetHandle(), false), index,
+ InteropValues.MF_BYPOSITION | InteropValues.MF_SEPARATOR, 0, "");
public static void Remove(int id)
{
@@ -39,7 +39,7 @@ namespace HandyControl.Tools
private static IntPtr WinProc(IntPtr hwnd, int msg, IntPtr wparam, IntPtr lparam, ref bool handled)
{
- if (msg == NativeMethods.WM_SYSCOMMAND)
+ if (msg == InteropValues.WM_SYSCOMMAND)
{
var id = wparam.ToInt32();
if (DataDic.ContainsKey(id))
diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/BITMAPINFO.cs b/src/Shared/HandyControl_Shared/Tools/Interop/BITMAPINFO.cs
deleted file mode 100644
index 4938fbdd..00000000
--- a/src/Shared/HandyControl_Shared/Tools/Interop/BITMAPINFO.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-using System.Diagnostics.CodeAnalysis;
-using System.Runtime.InteropServices;
-using System.Security;
-
-namespace HandyControl.Tools.Interop
-{
- [StructLayout(LayoutKind.Sequential, Pack = 2)]
- [SuppressMessage("ReSharper", "InconsistentNaming")]
- internal struct BITMAPINFO
- {
- public int bmiHeader_biSize;
-
- public int bmiHeader_biWidth;
-
- public int bmiHeader_biHeight;
-
- public short bmiHeader_biPlanes;
-
- public short bmiHeader_biBitCount;
-
- public int bmiHeader_biCompression;
-
- public int bmiHeader_biSizeImage;
-
- public int bmiHeader_biXPelsPerMeter;
-
- public int bmiHeader_biYPelsPerMeter;
-
- public int bmiHeader_biClrUsed;
-
- public int bmiHeader_biClrImportant;
-
- public BITMAPINFO(int width, int height, short bpp)
- {
- bmiHeader_biSize = SizeOf();
- bmiHeader_biWidth = width;
- bmiHeader_biHeight = height;
- bmiHeader_biPlanes = 1;
- bmiHeader_biBitCount = bpp;
- bmiHeader_biCompression = 0;
- bmiHeader_biSizeImage = 0;
- bmiHeader_biXPelsPerMeter = 0;
- bmiHeader_biYPelsPerMeter = 0;
- bmiHeader_biClrUsed = 0;
- bmiHeader_biClrImportant = 0;
- }
-
- [SecuritySafeCritical]
- private static int SizeOf()
- {
- return Marshal.SizeOf(typeof(BITMAPINFO));
- }
- }
-}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/ExternDll.cs b/src/Shared/HandyControl_Shared/Tools/Interop/ExternDll.cs
deleted file mode 100644
index 81fa0c71..00000000
--- a/src/Shared/HandyControl_Shared/Tools/Interop/ExternDll.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-namespace HandyControl.Tools.Interop
-{
- internal static class ExternDll
- {
- public const string
- User32 = "user32.dll",
- Gdi32 = "gdi32.dll",
- Kernel32 = "kernel32.dll",
- Shell32 = "shell32.dll";
- }
-}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/BitmapHandle.cs b/src/Shared/HandyControl_Shared/Tools/Interop/Handle/BitmapHandle.cs
similarity index 95%
rename from src/Shared/HandyControl_Shared/Tools/Interop/BitmapHandle.cs
rename to src/Shared/HandyControl_Shared/Tools/Interop/Handle/BitmapHandle.cs
index 1e893fa9..2fda6685 100644
--- a/src/Shared/HandyControl_Shared/Tools/Interop/BitmapHandle.cs
+++ b/src/Shared/HandyControl_Shared/Tools/Interop/Handle/BitmapHandle.cs
@@ -24,7 +24,7 @@ namespace HandyControl.Tools.Interop
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
protected override bool ReleaseHandle()
{
- return UnsafeNativeMethods.DeleteObject(handle);
+ return InteropMethods.DeleteObject(handle);
}
[SecurityCritical]
diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/CommonHandles.cs b/src/Shared/HandyControl_Shared/Tools/Interop/Handle/CommonHandles.cs
similarity index 100%
rename from src/Shared/HandyControl_Shared/Tools/Interop/CommonHandles.cs
rename to src/Shared/HandyControl_Shared/Tools/Interop/Handle/CommonHandles.cs
diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/HandleCollector.cs b/src/Shared/HandyControl_Shared/Tools/Interop/Handle/HandleCollector.cs
similarity index 100%
rename from src/Shared/HandyControl_Shared/Tools/Interop/HandleCollector.cs
rename to src/Shared/HandyControl_Shared/Tools/Interop/Handle/HandleCollector.cs
diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/IconHandle.cs b/src/Shared/HandyControl_Shared/Tools/Interop/Handle/IconHandle.cs
similarity index 92%
rename from src/Shared/HandyControl_Shared/Tools/Interop/IconHandle.cs
rename to src/Shared/HandyControl_Shared/Tools/Interop/Handle/IconHandle.cs
index cbaec541..96de9b10 100644
--- a/src/Shared/HandyControl_Shared/Tools/Interop/IconHandle.cs
+++ b/src/Shared/HandyControl_Shared/Tools/Interop/Handle/IconHandle.cs
@@ -15,7 +15,7 @@ namespace HandyControl.Tools.Interop
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
protected override bool ReleaseHandle()
{
- return UnsafeNativeMethods.DestroyIcon(handle);
+ return InteropMethods.DestroyIcon(handle);
}
[SecurityCritical, SecuritySafeCritical]
diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/SafeFileMappingHandle.cs b/src/Shared/HandyControl_Shared/Tools/Interop/Handle/SafeFileMappingHandle.cs
similarity index 95%
rename from src/Shared/HandyControl_Shared/Tools/Interop/SafeFileMappingHandle.cs
rename to src/Shared/HandyControl_Shared/Tools/Interop/Handle/SafeFileMappingHandle.cs
index ad26db90..c4aade37 100644
--- a/src/Shared/HandyControl_Shared/Tools/Interop/SafeFileMappingHandle.cs
+++ b/src/Shared/HandyControl_Shared/Tools/Interop/Handle/SafeFileMappingHandle.cs
@@ -43,7 +43,7 @@ namespace HandyControl.Tools.Interop
public static bool CloseHandleNoThrow(HandleRef handle)
{
HandleCollector.Remove((IntPtr)handle, CommonHandles.Kernel);
- var result = UnsafeNativeMethods.IntCloseHandle(handle);
+ var result = InteropMethods.IntCloseHandle(handle);
return result;
}
}
diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/WpfSafeHandle.cs b/src/Shared/HandyControl_Shared/Tools/Interop/Handle/WpfSafeHandle.cs
similarity index 100%
rename from src/Shared/HandyControl_Shared/Tools/Interop/WpfSafeHandle.cs
rename to src/Shared/HandyControl_Shared/Tools/Interop/Handle/WpfSafeHandle.cs
diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/ICONINFO.cs b/src/Shared/HandyControl_Shared/Tools/Interop/ICONINFO.cs
deleted file mode 100644
index 659c98e6..00000000
--- a/src/Shared/HandyControl_Shared/Tools/Interop/ICONINFO.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-using System.Diagnostics.CodeAnalysis;
-using System.Runtime.InteropServices;
-
-namespace HandyControl.Tools.Interop
-{
- [StructLayout(LayoutKind.Sequential)]
- [SuppressMessage("ReSharper", "InconsistentNaming")]
- internal class ICONINFO
- {
- public bool fIcon = false;
- public int xHotspot = 0;
- public int yHotspot = 0;
- public BitmapHandle hbmMask = null;
- public BitmapHandle hbmColor = null;
- }
-}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/InteropMethods.cs b/src/Shared/HandyControl_Shared/Tools/Interop/InteropMethods.cs
new file mode 100644
index 00000000..965ad3c5
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Tools/Interop/InteropMethods.cs
@@ -0,0 +1,281 @@
+using System;
+using System.ComponentModel;
+using System.Diagnostics.CodeAnalysis;
+using System.Runtime.InteropServices;
+using System.Runtime.Versioning;
+using System.Security;
+using System.Text;
+
+namespace HandyControl.Tools.Interop
+{
+ internal class InteropMethods
+ {
+ [DllImport(InteropValues.ExternDll.User32, CharSet = CharSet.Auto)]
+ [ResourceExposure(ResourceScope.None)]
+ public static extern int RegisterWindowMessage(string msg);
+
+ [DllImport(InteropValues.ExternDll.User32, SetLastError = true, CharSet = CharSet.Auto)]
+ public static extern int MapWindowPoints(IntPtr hWndFrom, IntPtr hWndTo, ref InteropValues.RECT lpPoints, uint cPoints);
+
+ [DllImport(InteropValues.ExternDll.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ public static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, out InteropValues.TBBUTTON lpBuffer,
+ int dwSize, out int lpNumberOfBytesRead);
+
+ [DllImport(InteropValues.ExternDll.Kernel32, SetLastError = true)]
+ public static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, out InteropValues.RECT lpBuffer,
+ int dwSize, out int lpNumberOfBytesRead);
+
+ [DllImport(InteropValues.ExternDll.Kernel32, SetLastError = true)]
+ public static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, out InteropValues.TRAYDATA lpBuffer,
+ int dwSize, out int lpNumberOfBytesRead);
+
+ [DllImport(InteropValues.ExternDll.User32, CharSet = CharSet.Auto)]
+ public static extern uint SendMessage(IntPtr hWnd, uint Msg, uint wParam, IntPtr lParam);
+
+ [DllImport(InteropValues.ExternDll.User32, SetLastError = true, CharSet = CharSet.Auto)]
+ public static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);
+
+ [DllImport(InteropValues.ExternDll.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ public static extern IntPtr OpenProcess(InteropValues.ProcessAccess dwDesiredAccess,
+ [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle, uint dwProcessId);
+
+ [DllImport(InteropValues.ExternDll.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ public static extern IntPtr VirtualAllocEx(IntPtr hProcess, IntPtr lpAddress, int dwSize,
+ InteropValues.AllocationType flAllocationType, InteropValues.MemoryProtection flProtect);
+
+ [DllImport(InteropValues.ExternDll.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ public static extern int CloseHandle(IntPtr hObject);
+
+ [DllImport(InteropValues.ExternDll.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ public static extern bool VirtualFreeEx(IntPtr hProcess, IntPtr lpAddress, int dwSize, InteropValues.FreeType dwFreeType);
+
+ [DllImport(InteropValues.ExternDll.User32, SetLastError = true)]
+ public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
+
+ [DllImport(InteropValues.ExternDll.User32, SetLastError = true)]
+ public static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass,
+ string lpszWindow);
+
+ [DllImport(InteropValues.ExternDll.User32)]
+ public static extern int GetWindowRect(IntPtr hwnd, out InteropValues.RECT lpRect);
+
+ [DllImport(InteropValues.ExternDll.User32, CharSet = CharSet.Auto)]
+ public static extern bool GetCursorPos(out InteropValues.POINT pt);
+
+ [DllImport(InteropValues.ExternDll.User32)]
+ public static extern IntPtr GetDesktopWindow();
+
+ [DllImport(InteropValues.ExternDll.User32, SetLastError = true)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool AddClipboardFormatListener(IntPtr hwnd);
+
+ [DllImport(InteropValues.ExternDll.User32, SetLastError = true)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool RemoveClipboardFormatListener(IntPtr hwnd);
+
+ [DllImport(InteropValues.ExternDll.User32)]
+ public static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert);
+
+ [DllImport(InteropValues.ExternDll.User32)]
+ public static extern bool InsertMenu(IntPtr hMenu, int wPosition, int wFlags, int wIDNewItem, string lpNewItem);
+
+ [SecurityCritical]
+ [SuppressUnmanagedCodeSecurity]
+ [DllImport(InteropValues.ExternDll.User32, SetLastError = true, ExactSpelling = true, EntryPoint = nameof(GetDC),
+ CharSet = CharSet.Auto)]
+ public static extern IntPtr IntGetDC(HandleRef hWnd);
+
+ [SecurityCritical]
+ public static IntPtr GetDC(HandleRef hWnd)
+ {
+ var hDc = IntGetDC(hWnd);
+ if (hDc == IntPtr.Zero) throw new Win32Exception();
+
+ return HandleCollector.Add(hDc, CommonHandles.HDC);
+ }
+
+ [SecurityCritical]
+ [SuppressUnmanagedCodeSecurity]
+ [DllImport(InteropValues.ExternDll.User32, ExactSpelling = true, EntryPoint = nameof(ReleaseDC), CharSet = CharSet.Auto)]
+ public static extern int IntReleaseDC(HandleRef hWnd, HandleRef hDC);
+
+ [SecurityCritical]
+ public static int ReleaseDC(HandleRef hWnd, HandleRef hDC)
+ {
+ HandleCollector.Remove((IntPtr) hDC, CommonHandles.HDC);
+ return IntReleaseDC(hWnd, hDC);
+ }
+
+ [SecurityCritical]
+ [SuppressUnmanagedCodeSecurity]
+ [DllImport(InteropValues.ExternDll.Gdi32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Auto)]
+ public static extern int GetDeviceCaps(HandleRef hDC, int nIndex);
+
+ [SecurityCritical]
+ [SuppressUnmanagedCodeSecurity]
+ [DllImport(InteropValues.ExternDll.User32)]
+ public static extern int GetSystemMetrics(InteropValues.SM nIndex);
+
+ [SecurityCritical]
+ [SuppressUnmanagedCodeSecurity]
+ [DllImport(InteropValues.ExternDll.User32, EntryPoint = nameof(DestroyIcon), CharSet = CharSet.Auto, SetLastError = true)]
+ private static extern bool IntDestroyIcon(IntPtr hIcon);
+
+ [SecurityCritical]
+ public static bool DestroyIcon(IntPtr hIcon)
+ {
+ var result = IntDestroyIcon(hIcon);
+ return result;
+ }
+
+ [SecurityCritical]
+ [SuppressUnmanagedCodeSecurity]
+ [DllImport(InteropValues.ExternDll.Gdi32, EntryPoint = nameof(DeleteObject), CharSet = CharSet.Auto, SetLastError = true)]
+ private static extern bool IntDeleteObject(IntPtr hObject);
+
+ [SecurityCritical]
+ public static bool DeleteObject(IntPtr hObject)
+ {
+ var result = IntDeleteObject(hObject);
+ return result;
+ }
+
+ [SecurityCritical]
+ public static BitmapHandle CreateDIBSection(HandleRef hdc, ref InteropValues.BITMAPINFO bitmapInfo, int iUsage,
+ ref IntPtr ppvBits, SafeFileMappingHandle hSection, int dwOffset)
+ {
+ if (hSection == null) hSection = new SafeFileMappingHandle(IntPtr.Zero);
+
+ var hBitmap = PrivateCreateDIBSection(hdc, ref bitmapInfo, iUsage, ref ppvBits, hSection, dwOffset);
+ return hBitmap;
+ }
+
+ [DllImport(InteropValues.ExternDll.Kernel32, EntryPoint = "CloseHandle", CharSet = CharSet.Auto, SetLastError = true)]
+ public static extern bool IntCloseHandle(HandleRef handle);
+
+ [SecurityCritical]
+ [SuppressUnmanagedCodeSecurity]
+ [DllImport(InteropValues.ExternDll.Gdi32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Auto,
+ EntryPoint = nameof(CreateDIBSection))]
+ private static extern BitmapHandle PrivateCreateDIBSection(HandleRef hdc, ref InteropValues.BITMAPINFO bitmapInfo, int iUsage,
+ ref IntPtr ppvBits, SafeFileMappingHandle hSection, int dwOffset);
+
+ [SecurityCritical]
+ [SuppressUnmanagedCodeSecurity]
+ [DllImport(InteropValues.ExternDll.User32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Auto,
+ EntryPoint = nameof(CreateIconIndirect))]
+ private static extern IconHandle PrivateCreateIconIndirect([In] [MarshalAs(UnmanagedType.LPStruct)]
+ InteropValues.ICONINFO iconInfo);
+
+ [SecurityCritical]
+ public static IconHandle CreateIconIndirect([In] [MarshalAs(UnmanagedType.LPStruct)]
+ InteropValues.ICONINFO iconInfo)
+ {
+ var hIcon = PrivateCreateIconIndirect(iconInfo);
+ return hIcon;
+ }
+
+ [SecurityCritical]
+ [SuppressUnmanagedCodeSecurity]
+ [DllImport(InteropValues.ExternDll.Gdi32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Auto,
+ EntryPoint = nameof(CreateBitmap))]
+ private static extern BitmapHandle PrivateCreateBitmap(int width, int height, int planes, int bitsPerPixel,
+ byte[] lpvBits);
+
+ [SecurityCritical]
+ internal static BitmapHandle CreateBitmap(int width, int height, int planes, int bitsPerPixel, byte[] lpvBits)
+ {
+ var hBitmap = PrivateCreateBitmap(width, height, planes, bitsPerPixel, lpvBits);
+ return hBitmap;
+ }
+
+ [SecurityCritical]
+ [SuppressUnmanagedCodeSecurity]
+ [DllImport(InteropValues.ExternDll.Kernel32, EntryPoint = "GetModuleFileName", CharSet = CharSet.Unicode,
+ SetLastError = true)]
+ private static extern int IntGetModuleFileName(HandleRef hModule, StringBuilder buffer, int length);
+
+ [SecurityCritical]
+ internal static string GetModuleFileName(HandleRef hModule)
+ {
+ var buffer = new StringBuilder(InteropValues.Win32Constant.MAX_PATH);
+ while (true)
+ {
+ var size = IntGetModuleFileName(hModule, buffer, buffer.Capacity);
+ if (size == 0) throw new Win32Exception();
+
+ if (size == buffer.Capacity)
+ {
+ buffer.EnsureCapacity(buffer.Capacity * 2);
+ continue;
+ }
+
+ return buffer.ToString();
+ }
+ }
+
+ [SecurityCritical]
+ [SuppressUnmanagedCodeSecurity]
+ [DllImport(InteropValues.ExternDll.Shell32, CharSet = CharSet.Auto, BestFitMapping = false, ThrowOnUnmappableChar = true)]
+ internal static extern int ExtractIconEx(string szExeFileName, int nIconIndex, out IconHandle phiconLarge,
+ out IconHandle phiconSmall, int nIcons);
+
+ [DllImport(InteropValues.ExternDll.Shell32, CharSet = CharSet.Auto)]
+ public static extern int Shell_NotifyIcon(int message, InteropValues.NOTIFYICONDATA pnid);
+
+ [SecurityCritical]
+ [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ [DllImport(InteropValues.ExternDll.User32, SetLastError = true, CharSet = CharSet.Unicode, EntryPoint = "CreateWindowExW")]
+ public static extern IntPtr CreateWindowEx(
+ int dwExStyle,
+ [MarshalAs(UnmanagedType.LPWStr)] string lpClassName,
+ [MarshalAs(UnmanagedType.LPWStr)] string lpWindowName,
+ int dwStyle,
+ int x,
+ int y,
+ int nWidth,
+ int nHeight,
+ IntPtr hWndParent,
+ IntPtr hMenu,
+ IntPtr hInstance,
+ IntPtr lpParam);
+
+ [SecurityCritical]
+ [SuppressUnmanagedCodeSecurity]
+ [DllImport(InteropValues.ExternDll.User32, CharSet = CharSet.Unicode, SetLastError = true, BestFitMapping = false)]
+ public static extern short RegisterClass(InteropValues.WNDCLASS wc);
+
+ [DllImport(InteropValues.ExternDll.User32, CharSet = CharSet.Auto)]
+ public static extern IntPtr DefWindowProc(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);
+
+ [DllImport(InteropValues.ExternDll.User32, ExactSpelling = true, CharSet = CharSet.Auto)]
+ public static extern bool SetForegroundWindow(IntPtr hWnd);
+
+ [DllImport(InteropValues.ExternDll.User32, CharSet = CharSet.Auto, SetLastError = true)]
+ public static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode, IntPtr wParam, IntPtr lParam);
+
+ [DllImport(InteropValues.ExternDll.Kernel32, CharSet = CharSet.Auto, SetLastError = true)]
+ public static extern IntPtr GetModuleHandle(string lpModuleName);
+
+ [DllImport(InteropValues.ExternDll.User32, CharSet = CharSet.Auto, SetLastError = true)]
+ public static extern bool UnhookWindowsHookEx(IntPtr hhk);
+
+ [DllImport(InteropValues.ExternDll.User32, CharSet = CharSet.Auto, SetLastError = true)]
+ public static extern IntPtr SetWindowsHookEx(int idHook, InteropValues.HookProc lpfn, IntPtr hMod, uint dwThreadId);
+
+ [DllImport(InteropValues.ExternDll.User32, SetLastError = true)]
+ public static extern IntPtr GetWindowDC(IntPtr window);
+
+ [DllImport(InteropValues.ExternDll.Gdi32, SetLastError = true)]
+ public static extern uint GetPixel(IntPtr dc, int x, int y);
+
+ [DllImport(InteropValues.ExternDll.User32, SetLastError = true)]
+ public static extern int ReleaseDC(IntPtr window, IntPtr dc);
+
+ [DllImport(InteropValues.ExternDll.Gdi32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Auto)]
+ public static extern int GetDeviceCaps(IntPtr hdc, int nIndex);
+
+ [DllImport(InteropValues.ExternDll.User32, CharSet = CharSet.Auto)]
+ public static extern IntPtr GetDC(IntPtr ptr);
+ }
+}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/InteropValues.cs b/src/Shared/HandyControl_Shared/Tools/Interop/InteropValues.cs
new file mode 100644
index 00000000..dc2c7cd0
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Tools/Interop/InteropValues.cs
@@ -0,0 +1,532 @@
+using System;
+using System.Runtime.InteropServices;
+using System.Security;
+
+namespace HandyControl.Tools.Interop
+{
+ public class InteropValues
+ {
+ #region public
+
+ public delegate IntPtr HookProc(int code, IntPtr wParam, IntPtr lParam);
+
+ public delegate IntPtr WndProc(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);
+
+ public const int
+ WS_CHILD = 0x40000000,
+ BITSPIXEL = 12,
+ PLANES = 14,
+ BI_RGB = 0,
+ DIB_RGB_COLORS = 0,
+ NIF_MESSAGE = 0x00000001,
+ NIF_ICON = 0x00000002,
+ NIF_TIP = 0x00000004,
+ NIF_INFO = 0x00000010,
+ NIN_BALLOONSHOW = WM_USER + 2,
+ NIN_BALLOONHIDE = WM_USER + 3,
+ NIN_BALLOONTIMEOUT = WM_USER + 4,
+ NIM_ADD = 0x00000000,
+ NIM_MODIFY = 0x00000001,
+ NIM_DELETE = 0x00000002,
+ NIIF_NONE = 0x00000000,
+ NIIF_INFO = 0x00000001,
+ NIIF_WARNING = 0x00000002,
+ NIIF_ERROR = 0x00000003,
+ NIIF_LARGE_ICON = 0x00000020,
+ WM_KEYDOWN = 0x0100,
+ WM_KEYUP = 0x0101,
+ WM_SYSKEYDOWN = 0x0104,
+ WM_SYSKEYUP = 0x0105,
+ WM_SYSCOMMAND = 0x112,
+ WM_MOUSEMOVE = 0x0200,
+ WM_LBUTTONDOWN = 0x0201,
+ WM_LBUTTONUP = 0x0202,
+ WM_LBUTTONDBLCLK = 0x0203,
+ WM_RBUTTONDOWN = 0x0204,
+ WM_RBUTTONUP = 0x0205,
+ WM_RBUTTONDBLCLK = 0x0206,
+ WM_MBUTTONDOWN = 0x0207,
+ WM_MBUTTONUP = 0x0208,
+ WM_MBUTTONDBLCLK = 0x0209,
+ WM_CLIPBOARDUPDATE = 0x031D,
+ WM_USER = 0x0400,
+ MF_BYPOSITION = 0x400,
+ MF_SEPARATOR = 0x800,
+ TB_GETBUTTON = WM_USER + 23,
+ TB_BUTTONCOUNT = WM_USER + 24,
+ TB_GETITEMRECT = WM_USER + 29,
+ STANDARD_RIGHTS_REQUIRED = 0x000F0000,
+ SYNCHRONIZE = 0x00100000,
+ PROCESS_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0xFFF,
+ MEM_COMMIT = 0x1000,
+ MEM_RELEASE = 0x8000,
+ PAGE_READWRITE = 0x04,
+ TBSTATE_HIDDEN = 0x08,
+ VERTRES = 10,
+ HORZRES = 8,
+ DESKTOPVERTRES = 117,
+ DESKTOPHORZRES = 118,
+ LOGPIXELSX = 88,
+ LOGPIXELSY = 90,
+ CXFRAME = 32,
+ CXSIZEFRAME = CXFRAME,
+ SW_HIDE = 0;
+
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
+ public class NOTIFYICONDATA
+ {
+ public int cbSize = Marshal.SizeOf(typeof(NOTIFYICONDATA));
+ public IntPtr hWnd;
+ public int uID;
+ public int uFlags;
+ public int uCallbackMessage;
+ public IntPtr hIcon;
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
+ public string szTip = string.Empty;
+ public int dwState = 0x01;
+ public int dwStateMask = 0x01;
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
+ public string szInfo = string.Empty;
+ public int uTimeoutOrVersion;
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)]
+ public string szInfoTitle = string.Empty;
+ public int dwInfoFlags;
+ }
+
+ [Flags]
+ public enum ProcessAccess
+ {
+ AllAccess = CreateThread | DuplicateHandle | QueryInformation | SetInformation | Terminate | VMOperation | VMRead | VMWrite | Synchronize,
+ CreateThread = 0x2,
+ DuplicateHandle = 0x40,
+ QueryInformation = 0x400,
+ SetInformation = 0x200,
+ Terminate = 0x1,
+ VMOperation = 0x8,
+ VMRead = 0x10,
+ VMWrite = 0x20,
+ Synchronize = 0x100000
+ }
+
+ [Serializable, StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
+ public struct RECT
+ {
+ public int Left;
+ public int Top;
+ public int Right;
+ public int Bottom;
+
+ public RECT(int left, int top, int right, int bottom)
+ {
+ Left = left;
+ Top = top;
+ Right = right;
+ Bottom = bottom;
+ }
+ }
+
+ [StructLayout(LayoutKind.Sequential, Pack = 1)]
+ public struct TBBUTTON
+ {
+ public int iBitmap;
+ public int idCommand;
+ public IntPtr fsStateStylePadding;
+ public IntPtr dwData;
+ public IntPtr iString;
+ }
+
+ [Flags]
+ public enum AllocationType
+ {
+ Commit = 0x1000,
+ Reserve = 0x2000,
+ Decommit = 0x4000,
+ Release = 0x8000,
+ Reset = 0x80000,
+ Physical = 0x400000,
+ TopDown = 0x100000,
+ WriteWatch = 0x200000,
+ LargePages = 0x20000000
+ }
+
+ [Flags]
+ public enum MemoryProtection
+ {
+ Execute = 0x10,
+ ExecuteRead = 0x20,
+ ExecuteReadWrite = 0x40,
+ ExecuteWriteCopy = 0x80,
+ NoAccess = 0x01,
+ ReadOnly = 0x02,
+ ReadWrite = 0x04,
+ WriteCopy = 0x08,
+ GuardModifierflag = 0x100,
+ NoCacheModifierflag = 0x200,
+ WriteCombineModifierflag = 0x400
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct TRAYDATA
+ {
+ public IntPtr hwnd;
+ public uint uID;
+ public uint uCallbackMessage;
+ public uint bReserved0;
+ public uint bReserved1;
+ public IntPtr hIcon;
+ }
+
+ [Flags]
+ public enum FreeType
+ {
+ Decommit = 0x4000,
+ Release = 0x8000,
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct POINT
+ {
+ public int X;
+ public int Y;
+
+ public POINT(int x, int y)
+ {
+ X = x;
+ Y = y;
+ }
+ }
+
+ public enum HookType
+ {
+ WH_KEYBOARD_LL = 13,
+ WH_MOUSE_LL = 14
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct MOUSEHOOKSTRUCT
+ {
+ public POINT pt;
+ public IntPtr hwnd;
+ public uint wHitTestCode;
+ public IntPtr dwExtraInfo;
+ }
+
+ #endregion
+
+ #region internal
+
+ internal static class ExternDll
+ {
+ public const string
+ User32 = "user32.dll",
+ Gdi32 = "gdi32.dll",
+ Kernel32 = "kernel32.dll",
+ Shell32 = "shell32.dll";
+ }
+
+ internal enum SM
+ {
+ CXSCREEN = 0,
+ CYSCREEN = 1,
+ CXVSCROLL = 2,
+ CYHSCROLL = 3,
+ CYCAPTION = 4,
+ CXBORDER = 5,
+ CYBORDER = 6,
+ CXFIXEDFRAME = 7,
+ CYFIXEDFRAME = 8,
+ CYVTHUMB = 9,
+ CXHTHUMB = 10,
+ CXICON = 11,
+ CYICON = 12,
+ CXCURSOR = 13,
+ CYCURSOR = 14,
+ CYMENU = 15,
+ CXFULLSCREEN = 16,
+ CYFULLSCREEN = 17,
+ CYKANJIWINDOW = 18,
+ MOUSEPRESENT = 19,
+ CYVSCROLL = 20,
+ CXHSCROLL = 21,
+ DEBUG = 22,
+ SWAPBUTTON = 23,
+ CXMIN = 28,
+ CYMIN = 29,
+ CXSIZE = 30,
+ CYSIZE = 31,
+ CXFRAME = 32,
+ CXSIZEFRAME = CXFRAME,
+ CYFRAME = 33,
+ CYSIZEFRAME = CYFRAME,
+ CXMINTRACK = 34,
+ CYMINTRACK = 35,
+ CXDOUBLECLK = 36,
+ CYDOUBLECLK = 37,
+ CXICONSPACING = 38,
+ CYICONSPACING = 39,
+ MENUDROPALIGNMENT = 40,
+ PENWINDOWS = 41,
+ DBCSENABLED = 42,
+ CMOUSEBUTTONS = 43,
+ SECURE = 44,
+ CXEDGE = 45,
+ CYEDGE = 46,
+ CXMINSPACING = 47,
+ CYMINSPACING = 48,
+ CXSMICON = 49,
+ CYSMICON = 50,
+ CYSMCAPTION = 51,
+ CXSMSIZE = 52,
+ CYSMSIZE = 53,
+ CXMENUSIZE = 54,
+ CYMENUSIZE = 55,
+ ARRANGE = 56,
+ CXMINIMIZED = 57,
+ CYMINIMIZED = 58,
+ CXMAXTRACK = 59,
+ CYMAXTRACK = 60,
+ CXMAXIMIZED = 61,
+ CYMAXIMIZED = 62,
+ NETWORK = 63,
+ CLEANBOOT = 67,
+ CXDRAG = 68,
+ CYDRAG = 69,
+ SHOWSOUNDS = 70,
+ CXMENUCHECK = 71,
+ CYMENUCHECK = 72,
+ SLOWMACHINE = 73,
+ MIDEASTENABLED = 74,
+ MOUSEWHEELPRESENT = 75,
+ XVIRTUALSCREEN = 76,
+ YVIRTUALSCREEN = 77,
+ CXVIRTUALSCREEN = 78,
+ CYVIRTUALSCREEN = 79,
+ CMONITORS = 80,
+ SAMEDISPLAYFORMAT = 81,
+ IMMENABLED = 82,
+ CXFOCUSBORDER = 83,
+ CYFOCUSBORDER = 84,
+ TABLETPC = 86,
+ MEDIACENTER = 87,
+ REMOTESESSION = 0x1000,
+ REMOTECONTROL = 0x2001
+ }
+
+ internal enum CacheSlot
+ {
+ DpiX,
+
+ FocusBorderWidth,
+ FocusBorderHeight,
+ HighContrast,
+ MouseVanish,
+
+ DropShadow,
+ FlatMenu,
+ WorkAreaInternal,
+ WorkArea,
+
+ IconMetrics,
+
+ KeyboardCues,
+ KeyboardDelay,
+ KeyboardPreference,
+ KeyboardSpeed,
+ SnapToDefaultButton,
+ WheelScrollLines,
+ MouseHoverTime,
+ MouseHoverHeight,
+ MouseHoverWidth,
+
+ MenuDropAlignment,
+ MenuFade,
+ MenuShowDelay,
+
+ ComboBoxAnimation,
+ ClientAreaAnimation,
+ CursorShadow,
+ GradientCaptions,
+ HotTracking,
+ ListBoxSmoothScrolling,
+ MenuAnimation,
+ SelectionFade,
+ StylusHotTracking,
+ ToolTipAnimation,
+ ToolTipFade,
+ UIEffects,
+
+ MinimizeAnimation,
+ Border,
+ CaretWidth,
+ ForegroundFlashCount,
+ DragFullWindows,
+ NonClientMetrics,
+
+ ThinHorizontalBorderHeight,
+ ThinVerticalBorderWidth,
+ CursorWidth,
+ CursorHeight,
+ ThickHorizontalBorderHeight,
+ ThickVerticalBorderWidth,
+ MinimumHorizontalDragDistance,
+ MinimumVerticalDragDistance,
+ FixedFrameHorizontalBorderHeight,
+ FixedFrameVerticalBorderWidth,
+ FocusHorizontalBorderHeight,
+ FocusVerticalBorderWidth,
+ FullPrimaryScreenWidth,
+ FullPrimaryScreenHeight,
+ HorizontalScrollBarButtonWidth,
+ HorizontalScrollBarHeight,
+ HorizontalScrollBarThumbWidth,
+ IconWidth,
+ IconHeight,
+ IconGridWidth,
+ IconGridHeight,
+ MaximizedPrimaryScreenWidth,
+ MaximizedPrimaryScreenHeight,
+ MaximumWindowTrackWidth,
+ MaximumWindowTrackHeight,
+ MenuCheckmarkWidth,
+ MenuCheckmarkHeight,
+ MenuButtonWidth,
+ MenuButtonHeight,
+ MinimumWindowWidth,
+ MinimumWindowHeight,
+ MinimizedWindowWidth,
+ MinimizedWindowHeight,
+ MinimizedGridWidth,
+ MinimizedGridHeight,
+ MinimumWindowTrackWidth,
+ MinimumWindowTrackHeight,
+ PrimaryScreenWidth,
+ PrimaryScreenHeight,
+ WindowCaptionButtonWidth,
+ WindowCaptionButtonHeight,
+ ResizeFrameHorizontalBorderHeight,
+ ResizeFrameVerticalBorderWidth,
+ SmallIconWidth,
+ SmallIconHeight,
+ SmallWindowCaptionButtonWidth,
+ SmallWindowCaptionButtonHeight,
+ VirtualScreenWidth,
+ VirtualScreenHeight,
+ VerticalScrollBarWidth,
+ VerticalScrollBarButtonHeight,
+ WindowCaptionHeight,
+ KanjiWindowHeight,
+ MenuBarHeight,
+ VerticalScrollBarThumbHeight,
+ IsImmEnabled,
+ IsMediaCenter,
+ IsMenuDropRightAligned,
+ IsMiddleEastEnabled,
+ IsMousePresent,
+ IsMouseWheelPresent,
+ IsPenWindows,
+ IsRemotelyControlled,
+ IsRemoteSession,
+ ShowSounds,
+ IsSlowMachine,
+ SwapButtons,
+ IsTabletPC,
+ VirtualScreenLeft,
+ VirtualScreenTop,
+
+ PowerLineStatus,
+
+ IsGlassEnabled,
+ UxThemeName,
+ UxThemeColor,
+ WindowCornerRadius,
+ WindowGlassColor,
+ WindowGlassBrush,
+ WindowNonClientFrameThickness,
+ WindowResizeBorderThickness,
+
+ NumSlots
+ }
+
+ internal static class Win32Constant
+ {
+ internal const int MAX_PATH = 260;
+ internal const int INFOTIPSIZE = 1024;
+ internal const int TRUE = 1;
+ internal const int FALSE = 0;
+ }
+
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
+ internal class WNDCLASS
+ {
+ public int style;
+ public WndProc lpfnWndProc;
+ public int cbClsExtra;
+ public int cbWndExtra;
+ public IntPtr hInstance;
+ public IntPtr hIcon;
+ public IntPtr hCursor;
+ public IntPtr hbrBackground;
+ public string lpszMenuName;
+ public string lpszClassName;
+ }
+
+ [StructLayout(LayoutKind.Sequential, Pack = 2)]
+ internal struct BITMAPINFO
+ {
+ public int bmiHeader_biSize;
+
+ public int bmiHeader_biWidth;
+
+ public int bmiHeader_biHeight;
+
+ public short bmiHeader_biPlanes;
+
+ public short bmiHeader_biBitCount;
+
+ public int bmiHeader_biCompression;
+
+ public int bmiHeader_biSizeImage;
+
+ public int bmiHeader_biXPelsPerMeter;
+
+ public int bmiHeader_biYPelsPerMeter;
+
+ public int bmiHeader_biClrUsed;
+
+ public int bmiHeader_biClrImportant;
+
+ public BITMAPINFO(int width, int height, short bpp)
+ {
+ bmiHeader_biSize = SizeOf();
+ bmiHeader_biWidth = width;
+ bmiHeader_biHeight = height;
+ bmiHeader_biPlanes = 1;
+ bmiHeader_biBitCount = bpp;
+ bmiHeader_biCompression = 0;
+ bmiHeader_biSizeImage = 0;
+ bmiHeader_biXPelsPerMeter = 0;
+ bmiHeader_biYPelsPerMeter = 0;
+ bmiHeader_biClrUsed = 0;
+ bmiHeader_biClrImportant = 0;
+ }
+
+ [SecuritySafeCritical]
+ private static int SizeOf()
+ {
+ return Marshal.SizeOf(typeof(BITMAPINFO));
+ }
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal class ICONINFO
+ {
+ public bool fIcon = false;
+ public int xHotspot = 0;
+ public int yHotspot = 0;
+ public BitmapHandle hbmMask = null;
+ public BitmapHandle hbmColor = null;
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/NOTIFYICONDATA.cs b/src/Shared/HandyControl_Shared/Tools/Interop/NOTIFYICONDATA.cs
deleted file mode 100644
index c57d604a..00000000
--- a/src/Shared/HandyControl_Shared/Tools/Interop/NOTIFYICONDATA.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using System;
-using System.Diagnostics.CodeAnalysis;
-using System.Runtime.InteropServices;
-
-namespace HandyControl.Tools.Interop
-{
- [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
- [SuppressMessage("ReSharper", "InconsistentNaming")]
- public class NOTIFYICONDATA
- {
- public int cbSize = Marshal.SizeOf(typeof(NOTIFYICONDATA));
- public IntPtr hWnd;
- public int uID;
- public int uFlags;
- public int uCallbackMessage;
- public IntPtr hIcon;
- [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
- public string szTip = string.Empty;
- public int dwState = 0x01;
- public int dwStateMask = 0x01;
- [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
- public string szInfo = string.Empty;
- public int uTimeoutOrVersion;
- [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)]
- public string szInfoTitle = string.Empty;
- public int dwInfoFlags;
- }
-}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/NativeMethods.cs b/src/Shared/HandyControl_Shared/Tools/Interop/NativeMethods.cs
deleted file mode 100644
index b4885c5f..00000000
--- a/src/Shared/HandyControl_Shared/Tools/Interop/NativeMethods.cs
+++ /dev/null
@@ -1,246 +0,0 @@
-using System;
-using System.Diagnostics.CodeAnalysis;
-using System.Runtime.InteropServices;
-using System.Runtime.Versioning;
-using System.Security;
-
-namespace HandyControl.Tools.Interop
-{
- public delegate IntPtr WndProc(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);
-
- [SuppressMessage("ReSharper", "InconsistentNaming")]
- [SuppressMessage("ReSharper", "IdentifierTypo")]
- internal class NativeMethods
- {
- public const int
- WS_CHILD = 0x40000000,
- BITSPIXEL = 12,
- PLANES = 14,
- BI_RGB = 0,
- DIB_RGB_COLORS = 0,
- NIF_MESSAGE = 0x00000001,
- NIF_ICON = 0x00000002,
- NIF_TIP = 0x00000004,
- NIF_INFO = 0x00000010,
- NIN_BALLOONSHOW = WM_USER + 2,
- NIN_BALLOONHIDE = WM_USER + 3,
- NIN_BALLOONTIMEOUT = WM_USER + 4,
- NIM_ADD = 0x00000000,
- NIM_MODIFY = 0x00000001,
- NIM_DELETE = 0x00000002,
- NIIF_NONE = 0x00000000,
- NIIF_INFO = 0x00000001,
- NIIF_WARNING = 0x00000002,
- NIIF_ERROR = 0x00000003,
- NIIF_LARGE_ICON = 0x00000020,
- WM_KEYDOWN = 0x0100,
- WM_KEYUP = 0x0101,
- WM_SYSKEYDOWN = 0x0104,
- WM_SYSKEYUP = 0x0105,
- WM_SYSCOMMAND = 0x112,
- WM_MOUSEMOVE = 0x0200,
- WM_LBUTTONDOWN = 0x0201,
- WM_LBUTTONUP = 0x0202,
- WM_LBUTTONDBLCLK = 0x0203,
- WM_RBUTTONDOWN = 0x0204,
- WM_RBUTTONUP = 0x0205,
- WM_RBUTTONDBLCLK = 0x0206,
- WM_MBUTTONDOWN = 0x0207,
- WM_MBUTTONUP = 0x0208,
- WM_MBUTTONDBLCLK = 0x0209,
- WM_CLIPBOARDUPDATE = 0x031D,
- WM_USER = 0x0400,
- MF_BYPOSITION = 0x400,
- MF_SEPARATOR = 0x800,
- TB_GETBUTTON = WM_USER + 23,
- TB_BUTTONCOUNT = WM_USER + 24,
- TB_GETITEMRECT = WM_USER + 29,
- STANDARD_RIGHTS_REQUIRED = 0x000F0000,
- SYNCHRONIZE = 0x00100000,
- PROCESS_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0xFFF,
- MEM_COMMIT = 0x1000,
- MEM_RELEASE = 0x8000,
- PAGE_READWRITE = 0x04,
- TBSTATE_HIDDEN = 0x08,
- VERTRES = 10,
- HORZRES = 8,
- DESKTOPVERTRES = 117,
- DESKTOPHORZRES = 118,
- LOGPIXELSX = 88,
- LOGPIXELSY = 90,
- CXFRAME = 32,
- CXSIZEFRAME = CXFRAME,
- SW_HIDE = 0;
-
- [Flags]
- public enum ProcessAccess
- {
- AllAccess = CreateThread | DuplicateHandle | QueryInformation | SetInformation | Terminate | VMOperation | VMRead | VMWrite | Synchronize,
- CreateThread = 0x2,
- DuplicateHandle = 0x40,
- QueryInformation = 0x400,
- SetInformation = 0x200,
- Terminate = 0x1,
- VMOperation = 0x8,
- VMRead = 0x10,
- VMWrite = 0x20,
- Synchronize = 0x100000
- }
-
- [Serializable, StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
- public struct RECT
- {
- public int Left;
- public int Top;
- public int Right;
- public int Bottom;
-
- public RECT(int left, int top, int right, int bottom)
- {
- Left = left;
- Top = top;
- Right = right;
- Bottom = bottom;
- }
- }
-
- [StructLayout(LayoutKind.Sequential, Pack = 1)]
- public struct TBBUTTON
- {
- public int iBitmap;
- public int idCommand;
- public IntPtr fsStateStylePadding;
- public IntPtr dwData;
- public IntPtr iString;
- }
-
- [Flags]
- public enum AllocationType
- {
- Commit = 0x1000,
- Reserve = 0x2000,
- Decommit = 0x4000,
- Release = 0x8000,
- Reset = 0x80000,
- Physical = 0x400000,
- TopDown = 0x100000,
- WriteWatch = 0x200000,
- LargePages = 0x20000000
- }
-
- [Flags]
- public enum MemoryProtection
- {
- Execute = 0x10,
- ExecuteRead = 0x20,
- ExecuteReadWrite = 0x40,
- ExecuteWriteCopy = 0x80,
- NoAccess = 0x01,
- ReadOnly = 0x02,
- ReadWrite = 0x04,
- WriteCopy = 0x08,
- GuardModifierflag = 0x100,
- NoCacheModifierflag = 0x200,
- WriteCombineModifierflag = 0x400
- }
-
- [StructLayout(LayoutKind.Sequential)]
- public struct TRAYDATA
- {
- public IntPtr hwnd;
- public uint uID;
- public uint uCallbackMessage;
- public uint bReserved0;
- public uint bReserved1;
- public IntPtr hIcon;
- }
-
- [Flags]
- public enum FreeType
- {
- Decommit = 0x4000,
- Release = 0x8000,
- }
-
- [StructLayout(LayoutKind.Sequential)]
- public struct POINT
- {
- public int X;
- public int Y;
-
- public POINT(int x, int y)
- {
- X = x;
- Y = y;
- }
- }
-
- [DllImport(ExternDll.User32, CharSet = CharSet.Auto)]
- [ResourceExposure(ResourceScope.None)]
- public static extern int RegisterWindowMessage(string msg);
-
- [DllImport(ExternDll.User32, SetLastError = true, CharSet = CharSet.Auto)]
- public static extern int MapWindowPoints(IntPtr hWndFrom, IntPtr hWndTo, ref RECT lpPoints, uint cPoints);
-
- [DllImport(ExternDll.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
- public static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, out TBBUTTON lpBuffer, int dwSize, out int lpNumberOfBytesRead);
-
- [DllImport(ExternDll.Kernel32, SetLastError = true)]
- public static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, out RECT lpBuffer, int dwSize, out int lpNumberOfBytesRead);
-
- [DllImport(ExternDll.Kernel32, SetLastError = true)]
- public static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, out TRAYDATA lpBuffer, int dwSize, out int lpNumberOfBytesRead);
-
- [DllImport(ExternDll.User32, CharSet = CharSet.Auto)]
- public static extern uint SendMessage(IntPtr hWnd, uint Msg, uint wParam, IntPtr lParam);
-
- [DllImport(ExternDll.User32, SetLastError = true, CharSet = CharSet.Auto)]
- public static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);
-
- [DllImport(ExternDll.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
- public static extern IntPtr OpenProcess(ProcessAccess dwDesiredAccess, [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle, uint dwProcessId);
-
- [DllImport(ExternDll.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
- public static extern IntPtr VirtualAllocEx(IntPtr hProcess, IntPtr lpAddress, int dwSize, AllocationType flAllocationType, MemoryProtection flProtect);
-
- [DllImport(ExternDll.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
- public static extern int CloseHandle(IntPtr hObject);
-
- [DllImport(ExternDll.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
- public static extern bool VirtualFreeEx(IntPtr hProcess, IntPtr lpAddress, int dwSize, FreeType dwFreeType);
-
- [DllImport(ExternDll.User32, SetLastError = true)]
- public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
-
- [DllImport(ExternDll.User32, SetLastError = true)]
- public static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow);
-
- [DllImport(ExternDll.User32)]
- public static extern int GetWindowRect(IntPtr hwnd, out RECT lpRect);
-
- [DllImport(ExternDll.User32, CharSet = CharSet.Auto)]
- public static extern bool GetCursorPos(out POINT pt);
-
- [SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- [DllImport(ExternDll.User32)]
- public static extern int GetSystemMetrics(SM nIndex);
-
- [DllImport(ExternDll.User32)]
- public static extern IntPtr GetDesktopWindow();
-
- [DllImport(ExternDll.User32, SetLastError = true)]
- [return: MarshalAs(UnmanagedType.Bool)]
- public static extern bool AddClipboardFormatListener(IntPtr hwnd);
-
- [DllImport(ExternDll.User32, SetLastError = true)]
- [return: MarshalAs(UnmanagedType.Bool)]
- public static extern bool RemoveClipboardFormatListener(IntPtr hwnd);
-
- [DllImport(ExternDll.User32)]
- public static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert);
-
- [DllImport(ExternDll.User32)]
- public static extern bool InsertMenu(IntPtr hMenu, int wPosition, int wFlags, int wIDNewItem, string lpNewItem);
- }
-}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/NativeValues.cs b/src/Shared/HandyControl_Shared/Tools/Interop/NativeValues.cs
deleted file mode 100644
index 94c1e09b..00000000
--- a/src/Shared/HandyControl_Shared/Tools/Interop/NativeValues.cs
+++ /dev/null
@@ -1,235 +0,0 @@
-// ReSharper disable InconsistentNaming
-
-namespace HandyControl.Tools.Interop
-{
- internal enum SM
- {
- CXSCREEN = 0,
- CYSCREEN = 1,
- CXVSCROLL = 2,
- CYHSCROLL = 3,
- CYCAPTION = 4,
- CXBORDER = 5,
- CYBORDER = 6,
- CXFIXEDFRAME = 7,
- CYFIXEDFRAME = 8,
- CYVTHUMB = 9,
- CXHTHUMB = 10,
- CXICON = 11,
- CYICON = 12,
- CXCURSOR = 13,
- CYCURSOR = 14,
- CYMENU = 15,
- CXFULLSCREEN = 16,
- CYFULLSCREEN = 17,
- CYKANJIWINDOW = 18,
- MOUSEPRESENT = 19,
- CYVSCROLL = 20,
- CXHSCROLL = 21,
- DEBUG = 22,
- SWAPBUTTON = 23,
- CXMIN = 28,
- CYMIN = 29,
- CXSIZE = 30,
- CYSIZE = 31,
- CXFRAME = 32,
- CXSIZEFRAME = CXFRAME,
- CYFRAME = 33,
- CYSIZEFRAME = CYFRAME,
- CXMINTRACK = 34,
- CYMINTRACK = 35,
- CXDOUBLECLK = 36,
- CYDOUBLECLK = 37,
- CXICONSPACING = 38,
- CYICONSPACING = 39,
- MENUDROPALIGNMENT = 40,
- PENWINDOWS = 41,
- DBCSENABLED = 42,
- CMOUSEBUTTONS = 43,
- SECURE = 44,
- CXEDGE = 45,
- CYEDGE = 46,
- CXMINSPACING = 47,
- CYMINSPACING = 48,
- CXSMICON = 49,
- CYSMICON = 50,
- CYSMCAPTION = 51,
- CXSMSIZE = 52,
- CYSMSIZE = 53,
- CXMENUSIZE = 54,
- CYMENUSIZE = 55,
- ARRANGE = 56,
- CXMINIMIZED = 57,
- CYMINIMIZED = 58,
- CXMAXTRACK = 59,
- CYMAXTRACK = 60,
- CXMAXIMIZED = 61,
- CYMAXIMIZED = 62,
- NETWORK = 63,
- CLEANBOOT = 67,
- CXDRAG = 68,
- CYDRAG = 69,
- SHOWSOUNDS = 70,
- CXMENUCHECK = 71,
- CYMENUCHECK = 72,
- SLOWMACHINE = 73,
- MIDEASTENABLED = 74,
- MOUSEWHEELPRESENT = 75,
- XVIRTUALSCREEN = 76,
- YVIRTUALSCREEN = 77,
- CXVIRTUALSCREEN = 78,
- CYVIRTUALSCREEN = 79,
- CMONITORS = 80,
- SAMEDISPLAYFORMAT = 81,
- IMMENABLED = 82,
- CXFOCUSBORDER = 83,
- CYFOCUSBORDER = 84,
- TABLETPC = 86,
- MEDIACENTER = 87,
- REMOTESESSION = 0x1000,
- REMOTECONTROL = 0x2001
- }
-
- internal enum CacheSlot
- {
- DpiX,
-
- FocusBorderWidth,
- FocusBorderHeight,
- HighContrast,
- MouseVanish,
-
- DropShadow,
- FlatMenu,
- WorkAreaInternal,
- WorkArea,
-
- IconMetrics,
-
- KeyboardCues,
- KeyboardDelay,
- KeyboardPreference,
- KeyboardSpeed,
- SnapToDefaultButton,
- WheelScrollLines,
- MouseHoverTime,
- MouseHoverHeight,
- MouseHoverWidth,
-
- MenuDropAlignment,
- MenuFade,
- MenuShowDelay,
-
- ComboBoxAnimation,
- ClientAreaAnimation,
- CursorShadow,
- GradientCaptions,
- HotTracking,
- ListBoxSmoothScrolling,
- MenuAnimation,
- SelectionFade,
- StylusHotTracking,
- ToolTipAnimation,
- ToolTipFade,
- UIEffects,
-
- MinimizeAnimation,
- Border,
- CaretWidth,
- ForegroundFlashCount,
- DragFullWindows,
- NonClientMetrics,
-
- ThinHorizontalBorderHeight,
- ThinVerticalBorderWidth,
- CursorWidth,
- CursorHeight,
- ThickHorizontalBorderHeight,
- ThickVerticalBorderWidth,
- MinimumHorizontalDragDistance,
- MinimumVerticalDragDistance,
- FixedFrameHorizontalBorderHeight,
- FixedFrameVerticalBorderWidth,
- FocusHorizontalBorderHeight,
- FocusVerticalBorderWidth,
- FullPrimaryScreenWidth,
- FullPrimaryScreenHeight,
- HorizontalScrollBarButtonWidth,
- HorizontalScrollBarHeight,
- HorizontalScrollBarThumbWidth,
- IconWidth,
- IconHeight,
- IconGridWidth,
- IconGridHeight,
- MaximizedPrimaryScreenWidth,
- MaximizedPrimaryScreenHeight,
- MaximumWindowTrackWidth,
- MaximumWindowTrackHeight,
- MenuCheckmarkWidth,
- MenuCheckmarkHeight,
- MenuButtonWidth,
- MenuButtonHeight,
- MinimumWindowWidth,
- MinimumWindowHeight,
- MinimizedWindowWidth,
- MinimizedWindowHeight,
- MinimizedGridWidth,
- MinimizedGridHeight,
- MinimumWindowTrackWidth,
- MinimumWindowTrackHeight,
- PrimaryScreenWidth,
- PrimaryScreenHeight,
- WindowCaptionButtonWidth,
- WindowCaptionButtonHeight,
- ResizeFrameHorizontalBorderHeight,
- ResizeFrameVerticalBorderWidth,
- SmallIconWidth,
- SmallIconHeight,
- SmallWindowCaptionButtonWidth,
- SmallWindowCaptionButtonHeight,
- VirtualScreenWidth,
- VirtualScreenHeight,
- VerticalScrollBarWidth,
- VerticalScrollBarButtonHeight,
- WindowCaptionHeight,
- KanjiWindowHeight,
- MenuBarHeight,
- VerticalScrollBarThumbHeight,
- IsImmEnabled,
- IsMediaCenter,
- IsMenuDropRightAligned,
- IsMiddleEastEnabled,
- IsMousePresent,
- IsMouseWheelPresent,
- IsPenWindows,
- IsRemotelyControlled,
- IsRemoteSession,
- ShowSounds,
- IsSlowMachine,
- SwapButtons,
- IsTabletPC,
- VirtualScreenLeft,
- VirtualScreenTop,
-
- PowerLineStatus,
-
- IsGlassEnabled,
- UxThemeName,
- UxThemeColor,
- WindowCornerRadius,
- WindowGlassColor,
- WindowGlassBrush,
- WindowNonClientFrameThickness,
- WindowResizeBorderThickness,
-
- NumSlots
- }
-
- internal static class Win32Constant
- {
- internal const int MAX_PATH = 260;
- internal const int INFOTIPSIZE = 1024;
- internal const int TRUE = 1;
- internal const int FALSE = 0;
- }
-}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/UnsafeNativeMethods.cs b/src/Shared/HandyControl_Shared/Tools/Interop/UnsafeNativeMethods.cs
deleted file mode 100644
index 378eab05..00000000
--- a/src/Shared/HandyControl_Shared/Tools/Interop/UnsafeNativeMethods.cs
+++ /dev/null
@@ -1,225 +0,0 @@
-using System;
-using System.ComponentModel;
-using System.Diagnostics.CodeAnalysis;
-using System.Runtime.InteropServices;
-using System.Security;
-using System.Text;
-
-namespace HandyControl.Tools.Interop
-{
- [SuppressMessage("ReSharper", "InconsistentNaming")]
- internal class UnsafeNativeMethods
- {
- [SecurityCritical]
- [SuppressUnmanagedCodeSecurity]
- [DllImport(ExternDll.User32, SetLastError = true, ExactSpelling = true, EntryPoint = nameof(GetDC), CharSet = CharSet.Auto)]
- public static extern IntPtr IntGetDC(HandleRef hWnd);
-
- [SecurityCritical]
- public static IntPtr GetDC(HandleRef hWnd)
- {
- var hDc = IntGetDC(hWnd);
- if (hDc == IntPtr.Zero)
- {
- throw new Win32Exception();
- }
-
- return HandleCollector.Add(hDc, CommonHandles.HDC);
- }
-
- [SecurityCritical]
- [SuppressUnmanagedCodeSecurity]
- [DllImport(ExternDll.User32, ExactSpelling = true, EntryPoint = nameof(ReleaseDC), CharSet = CharSet.Auto)]
- public static extern int IntReleaseDC(HandleRef hWnd, HandleRef hDC);
-
- [SecurityCritical]
- public static int ReleaseDC(HandleRef hWnd, HandleRef hDC)
- {
- HandleCollector.Remove((IntPtr)hDC, CommonHandles.HDC);
- return IntReleaseDC(hWnd, hDC);
- }
-
- [SecurityCritical]
- [SuppressUnmanagedCodeSecurity]
- [DllImport(ExternDll.Gdi32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Auto)]
- public static extern int GetDeviceCaps(HandleRef hDC, int nIndex);
-
- [SecurityCritical]
- [SuppressUnmanagedCodeSecurity]
- [DllImport(ExternDll.User32)]
- public static extern int GetSystemMetrics(SM nIndex);
-
- [SecurityCritical]
- [SuppressUnmanagedCodeSecurity]
- [DllImport(ExternDll.User32, EntryPoint = nameof(DestroyIcon), CharSet = CharSet.Auto, SetLastError = true)]
- private static extern bool IntDestroyIcon(IntPtr hIcon);
-
- [SecurityCritical]
- public static bool DestroyIcon(IntPtr hIcon)
- {
- var result = IntDestroyIcon(hIcon);
- return result;
- }
-
- [SecurityCritical]
- [SuppressUnmanagedCodeSecurity]
- [DllImport(ExternDll.Gdi32, EntryPoint = nameof(DeleteObject), CharSet = CharSet.Auto, SetLastError = true)]
- private static extern bool IntDeleteObject(IntPtr hObject);
-
- [SecurityCritical]
- public static bool DeleteObject(IntPtr hObject)
- {
- var result = IntDeleteObject(hObject);
- return result;
- }
-
- [SecurityCritical]
- public static BitmapHandle CreateDIBSection(HandleRef hdc, ref BITMAPINFO bitmapInfo, int iUsage, ref IntPtr ppvBits, SafeFileMappingHandle hSection, int dwOffset)
- {
- if (hSection == null)
- {
- hSection = new SafeFileMappingHandle(IntPtr.Zero);
- }
-
- var hBitmap = PrivateCreateDIBSection(hdc, ref bitmapInfo, iUsage, ref ppvBits, hSection, dwOffset);
- return hBitmap;
- }
-
- [DllImport(ExternDll.Kernel32, EntryPoint = "CloseHandle", CharSet = CharSet.Auto, SetLastError = true)]
- public static extern bool IntCloseHandle(HandleRef handle);
-
- [SecurityCritical, SuppressUnmanagedCodeSecurity]
- [DllImport(ExternDll.Gdi32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Auto, EntryPoint = nameof(CreateDIBSection))]
- private static extern BitmapHandle PrivateCreateDIBSection(HandleRef hdc, ref BITMAPINFO bitmapInfo, int iUsage, ref IntPtr ppvBits, SafeFileMappingHandle hSection, int dwOffset);
-
- [SecurityCritical, SuppressUnmanagedCodeSecurity]
- [DllImport(ExternDll.User32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Auto, EntryPoint = nameof(CreateIconIndirect))]
- private static extern IconHandle PrivateCreateIconIndirect([In, MarshalAs(UnmanagedType.LPStruct)]ICONINFO iconInfo);
-
- [SecurityCritical]
- public static IconHandle CreateIconIndirect([In, MarshalAs(UnmanagedType.LPStruct)]ICONINFO iconInfo)
- {
- var hIcon = PrivateCreateIconIndirect(iconInfo);
- return hIcon;
- }
-
- [SecurityCritical, SuppressUnmanagedCodeSecurity]
- [DllImport(ExternDll.Gdi32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Auto, EntryPoint = nameof(CreateBitmap))]
- private static extern BitmapHandle PrivateCreateBitmap(int width, int height, int planes, int bitsPerPixel, byte[] lpvBits);
-
- [SecurityCritical]
- internal static BitmapHandle CreateBitmap(int width, int height, int planes, int bitsPerPixel, byte[] lpvBits)
- {
- var hBitmap = PrivateCreateBitmap(width, height, planes, bitsPerPixel, lpvBits);
- return hBitmap;
- }
-
- [SecurityCritical, SuppressUnmanagedCodeSecurity]
- [DllImport(ExternDll.Kernel32, EntryPoint = "GetModuleFileName", CharSet = CharSet.Unicode, SetLastError = true)]
- private static extern int IntGetModuleFileName(HandleRef hModule, StringBuilder buffer, int length);
-
- [SecurityCritical]
- internal static string GetModuleFileName(HandleRef hModule)
- {
- var buffer = new StringBuilder(Win32Constant.MAX_PATH);
- while (true)
- {
- var size = IntGetModuleFileName(hModule, buffer, buffer.Capacity);
- if (size == 0)
- {
- throw new Win32Exception();
- }
-
- if (size == buffer.Capacity)
- {
- buffer.EnsureCapacity(buffer.Capacity * 2);
- continue;
- }
-
- return buffer.ToString();
- }
- }
-
- [SecurityCritical, SuppressUnmanagedCodeSecurity]
- [DllImport(ExternDll.Shell32, CharSet = CharSet.Auto, BestFitMapping = false, ThrowOnUnmappableChar = true)]
- internal static extern int ExtractIconEx(string szExeFileName, int nIconIndex, out IconHandle phiconLarge, out IconHandle phiconSmall, int nIcons);
-
- [DllImport(ExternDll.Shell32, CharSet = CharSet.Auto)]
- public static extern int Shell_NotifyIcon(int message, NOTIFYICONDATA pnid);
-
- [SecurityCritical]
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- [DllImport(ExternDll.User32, SetLastError = true, CharSet = CharSet.Unicode, EntryPoint = "CreateWindowExW")]
- public static extern IntPtr CreateWindowEx(
- int dwExStyle,
- [MarshalAs(UnmanagedType.LPWStr)] string lpClassName,
- [MarshalAs(UnmanagedType.LPWStr)] string lpWindowName,
- int dwStyle,
- int x,
- int y,
- int nWidth,
- int nHeight,
- IntPtr hWndParent,
- IntPtr hMenu,
- IntPtr hInstance,
- IntPtr lpParam);
-
- [SecurityCritical]
- [SuppressUnmanagedCodeSecurity]
- [DllImport(ExternDll.User32, CharSet = CharSet.Unicode, SetLastError = true, BestFitMapping = false)]
- public static extern short RegisterClass(WNDCLASS wc);
-
- [DllImport(ExternDll.User32, CharSet = CharSet.Auto)]
- public static extern IntPtr DefWindowProc(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);
-
- [DllImport(ExternDll.User32, ExactSpelling = true, CharSet = CharSet.Auto)]
- public static extern bool SetForegroundWindow(IntPtr hWnd);
-
- [DllImport(ExternDll.User32, CharSet = CharSet.Auto, SetLastError = true)]
- public static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode, IntPtr wParam, IntPtr lParam);
-
- [DllImport(ExternDll.Kernel32, CharSet = CharSet.Auto, SetLastError = true)]
- public static extern IntPtr GetModuleHandle(string lpModuleName);
-
- [DllImport(ExternDll.User32, CharSet = CharSet.Auto, SetLastError = true)]
- public static extern bool UnhookWindowsHookEx(IntPtr hhk);
-
- public enum HookType
- {
- WH_KEYBOARD_LL = 13,
- WH_MOUSE_LL = 14
- }
-
- [StructLayout(LayoutKind.Sequential)]
- public struct MOUSEHOOKSTRUCT
- {
- public NativeMethods.POINT pt;
- public IntPtr hwnd;
- public uint wHitTestCode;
- public IntPtr dwExtraInfo;
- }
-
- public delegate IntPtr HookProc(int code, IntPtr wParam, IntPtr lParam);
-
- [DllImport(ExternDll.User32, CharSet = CharSet.Auto, SetLastError = true)]
- public static extern IntPtr SetWindowsHookEx(int idHook, HookProc lpfn, IntPtr hMod, uint dwThreadId);
-
- [DllImport(ExternDll.User32, SetLastError = true)]
- public static extern IntPtr GetDesktopWindow();
-
- [DllImport(ExternDll.User32, SetLastError = true)]
- public static extern IntPtr GetWindowDC(IntPtr window);
-
- [DllImport(ExternDll.Gdi32, SetLastError = true)]
- public static extern uint GetPixel(IntPtr dc, int x, int y);
-
- [DllImport(ExternDll.User32, SetLastError = true)]
- public static extern int ReleaseDC(IntPtr window, IntPtr dc);
-
- [DllImport(ExternDll.Gdi32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Auto)]
- public static extern int GetDeviceCaps(IntPtr hdc, int nIndex);
-
- [DllImport(ExternDll.User32, CharSet = CharSet.Auto)]
- public static extern IntPtr GetDC(IntPtr ptr);
- }
-}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Tools/Interop/WNDCLASS.cs b/src/Shared/HandyControl_Shared/Tools/Interop/WNDCLASS.cs
deleted file mode 100644
index 33dd3903..00000000
--- a/src/Shared/HandyControl_Shared/Tools/Interop/WNDCLASS.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using System;
-using System.Diagnostics.CodeAnalysis;
-using System.Runtime.InteropServices;
-
-namespace HandyControl.Tools.Interop
-{
- [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
- [SuppressMessage("ReSharper", "InconsistentNaming")]
- [SuppressMessage("ReSharper", "IdentifierTypo")]
- internal class WNDCLASS
- {
- public int style;
- public WndProc lpfnWndProc;
- public int cbClsExtra;
- public int cbWndExtra;
- public IntPtr hInstance;
- public IntPtr hIcon;
- public IntPtr hCursor;
- public IntPtr hbrBackground;
- public string lpszMenuName;
- public string lpszClassName;
- }
-}
\ No newline at end of file
From cae862d6b04b3c10fcf10a051108fbf8e3f82ab2 Mon Sep 17 00:00:00 2001
From: NaBian <836904362@qq.com>
Date: Sat, 18 Jan 2020 00:24:46 +0800
Subject: [PATCH 21/26] add glowwindow images
---
.../HandyControl_Core_30.csproj | 50 ++++++++++++++++++
.../HandyControl_Net_40.csproj | 50 ++++++++++++++++++
.../HandyControl_Net_GE45.csproj | 50 ++++++++++++++++++
.../Resources/Images/GlowWindow/bottom.png | Bin 0 -> 1257 bytes
.../Images/GlowWindow/bottomleft.png | Bin 0 -> 1294 bytes
.../Images/GlowWindow/bottomright.png | Bin 0 -> 1298 bytes
.../Images/GlowWindow/cornerbottomleft.png | Bin 0 -> 1311 bytes
.../Images/GlowWindow/cornerbottomright.png | Bin 0 -> 1306 bytes
.../Images/GlowWindow/cornertopleft.png | Bin 0 -> 1293 bytes
.../Images/GlowWindow/cornertopright.png | Bin 0 -> 1318 bytes
.../Resources/Images/GlowWindow/left.png | Bin 0 -> 1252 bytes
.../Images/GlowWindow/leftbottom.png | Bin 0 -> 1297 bytes
.../Resources/Images/GlowWindow/lefttop.png | Bin 0 -> 1292 bytes
.../Resources/Images/GlowWindow/right.png | Bin 0 -> 1254 bytes
.../Images/GlowWindow/rightbottom.png | Bin 0 -> 1289 bytes
.../Resources/Images/GlowWindow/righttop.png | Bin 0 -> 1292 bytes
.../Resources/Images/GlowWindow/top.png | Bin 0 -> 1254 bytes
.../Resources/Images/GlowWindow/topleft.png | Bin 0 -> 1290 bytes
.../Resources/Images/GlowWindow/topright.png | Bin 0 -> 1294 bytes
19 files changed, 150 insertions(+)
create mode 100644 src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/bottom.png
create mode 100644 src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/bottomleft.png
create mode 100644 src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/bottomright.png
create mode 100644 src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/cornerbottomleft.png
create mode 100644 src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/cornerbottomright.png
create mode 100644 src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/cornertopleft.png
create mode 100644 src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/cornertopright.png
create mode 100644 src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/left.png
create mode 100644 src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/leftbottom.png
create mode 100644 src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/lefttop.png
create mode 100644 src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/right.png
create mode 100644 src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/rightbottom.png
create mode 100644 src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/righttop.png
create mode 100644 src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/top.png
create mode 100644 src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/topleft.png
create mode 100644 src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/topright.png
diff --git a/src/Core_30/HandyControl_Core_30/HandyControl_Core_30.csproj b/src/Core_30/HandyControl_Core_30/HandyControl_Core_30.csproj
index 600b0889..4f61f64f 100644
--- a/src/Core_30/HandyControl_Core_30/HandyControl_Core_30.csproj
+++ b/src/Core_30/HandyControl_Core_30/HandyControl_Core_30.csproj
@@ -68,4 +68,54 @@
Resources\Effects\GrayScaleEffect.ps
+
+
+ Resources\Images\GlowWindow\bottom.png
+
+
+ Resources\Images\GlowWindow\bottomleft.png
+
+
+ Resources\Images\GlowWindow\bottomright.png
+
+
+ Resources\Images\GlowWindow\cornerbottomleft.png
+
+
+ Resources\Images\GlowWindow\cornerbottomright.png
+
+
+ Resources\Images\GlowWindow\cornertopleft.png
+
+
+ Resources\Images\GlowWindow\cornertopright.png
+
+
+ Resources\Images\GlowWindow\left.png
+
+
+ Resources\Images\GlowWindow\leftbottom.png
+
+
+ Resources\Images\GlowWindow\lefttop.png
+
+
+ Resources\Images\GlowWindow\right.png
+
+
+ Resources\Images\GlowWindow\rightbottom.png
+
+
+ Resources\Images\GlowWindow\righttop.png
+
+
+ Resources\Images\GlowWindow\top.png
+
+
+ Resources\Images\GlowWindow\topleft.png
+
+
+ Resources\Images\GlowWindow\topright.png
+
+
\ No newline at end of file
diff --git a/src/Net_40/HandyControl_Net_40/HandyControl_Net_40.csproj b/src/Net_40/HandyControl_Net_40/HandyControl_Net_40.csproj
index 08bd19be..092bb8a0 100644
--- a/src/Net_40/HandyControl_Net_40/HandyControl_Net_40.csproj
+++ b/src/Net_40/HandyControl_Net_40/HandyControl_Net_40.csproj
@@ -120,6 +120,56 @@
Resources\Effects\GrayScaleEffect.ps
+
+
+ Resources\Images\GlowWindow\bottom.png
+
+
+ Resources\Images\GlowWindow\bottomleft.png
+
+
+ Resources\Images\GlowWindow\bottomright.png
+
+
+ Resources\Images\GlowWindow\cornerbottomleft.png
+
+
+ Resources\Images\GlowWindow\cornerbottomright.png
+
+
+ Resources\Images\GlowWindow\cornertopleft.png
+
+
+ Resources\Images\GlowWindow\cornertopright.png
+
+
+ Resources\Images\GlowWindow\left.png
+
+
+ Resources\Images\GlowWindow\leftbottom.png
+
+
+ Resources\Images\GlowWindow\lefttop.png
+
+
+ Resources\Images\GlowWindow\right.png
+
+
+ Resources\Images\GlowWindow\rightbottom.png
+
+
+ Resources\Images\GlowWindow\righttop.png
+
+
+ Resources\Images\GlowWindow\top.png
+
+
+ Resources\Images\GlowWindow\topleft.png
+
+
+ Resources\Images\GlowWindow\topright.png
+
+
\ No newline at end of file
diff --git a/src/Net_GE45/HandyControl_Net_GE45/HandyControl_Net_GE45.csproj b/src/Net_GE45/HandyControl_Net_GE45/HandyControl_Net_GE45.csproj
index db1055ee..15efdefe 100644
--- a/src/Net_GE45/HandyControl_Net_GE45/HandyControl_Net_GE45.csproj
+++ b/src/Net_GE45/HandyControl_Net_GE45/HandyControl_Net_GE45.csproj
@@ -191,6 +191,56 @@
Resources\Effects\GrayScaleEffect.ps
+
+
+ Resources\Images\GlowWindow\bottom.png
+
+
+ Resources\Images\GlowWindow\bottomleft.png
+
+
+ Resources\Images\GlowWindow\bottomright.png
+
+
+ Resources\Images\GlowWindow\cornerbottomleft.png
+
+
+ Resources\Images\GlowWindow\cornerbottomright.png
+
+
+ Resources\Images\GlowWindow\cornertopleft.png
+
+
+ Resources\Images\GlowWindow\cornertopright.png
+
+
+ Resources\Images\GlowWindow\left.png
+
+
+ Resources\Images\GlowWindow\leftbottom.png
+
+
+ Resources\Images\GlowWindow\lefttop.png
+
+
+ Resources\Images\GlowWindow\right.png
+
+
+ Resources\Images\GlowWindow\rightbottom.png
+
+
+ Resources\Images\GlowWindow\righttop.png
+
+
+ Resources\Images\GlowWindow\top.png
+
+
+ Resources\Images\GlowWindow\topleft.png
+
+
+ Resources\Images\GlowWindow\topright.png
+
+
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/bottom.png b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/bottom.png
new file mode 100644
index 0000000000000000000000000000000000000000..11b8dc5e871a10d4b0d6a819658cf3ca63f0c198
GIT binary patch
literal 1257
zcmcIky>HV%6n9aD(m*9XBvc^~CwHk3@%bZZ@X1cqCJhZDp=#Vxn0mD@sY(1H`zpJo
z0tpsaU_+|d8Bq}vBNBfB69WuLOsriI;_ReJ+X1GYd>?-Ie!utbcTe|Xv2klWdpXN-
z+<0xFvc%>Q*2glZ*|=Y={$$f=I9D?=tnFm1=gFqOa6ja@GZ&IR^5y&E-^_T4&acvP
zKrppE7Z|ofI8lL89!l~<{$j*f&LAE3`bw1@pY@L`P4^kJ}
z(fQdV7+9?@g0dG7kQbz!DJpr8pBChztQMzlfF`EkHgO7wW8npi5us;aohJEpvj4;MNlmrnDm>E!GMwH%!7Z{$`E%lCHwF44)
zK_>*|rlKXtBTmDpLp-TqN=mXQ$vIKUNqIw3k#Z9$g$IZ5J*Q*vx@Xy~t)uXQAr+A%
zqJr3mA9Cu$HJAu-NSIXhr;npq}ld4Ypz
z$#!s?K;La^aA^Eze!Z+&S+KH%gStFOeQ=d0vKZ=qBJ@4dlMJ$PYWFI8J|>dKq3N|~
zgag7ItJu3At~Hp?RIM^=WOnC2zaQhkxzRoU<)1enU#(4koqGK?^KE5WpZIikW$)Sk
YqhC+5S9Y%dP#K1+%{MCV=GLD61)*6zjQ{`u
literal 0
HcmV?d00001
diff --git a/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/bottomleft.png b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/bottomleft.png
new file mode 100644
index 0000000000000000000000000000000000000000..8dcf7cc6fbfadf6dc1bde4b5bd4ce90ebcefc148
GIT binary patch
literal 1294
zcmcIkOK1~87+#By7%f^wDTU&&LN7Ku`$!tIZc@^0Ya&eyO~6_Z-R@4(ZL$w`r|hd1+p@B6ZT>kl!W
z#^cjC=O6{^mI~^97u-nG*&rC0E|x*gauA3!Tufz!IEarhe3DNkM}|Q~!Qhf&0zL_NmL&r(3Q6*j
zWWq*gqGXmFttL*%6YZGfFHO&3Y>NxxmrBW%#@{s3a#3SY|npp8;rhB$U
zvc)4KS9Nqd)GOdsW~~LBrs*J1r?n5K*quP8+ZK<=2z|wd9K*s6GXYA(D26v-IaSMQ
zW?ILe&>iGiPQwMciXa8Z9Zub-T|AN%j50jS@iA72aq%jb5{2`kkeJzqZ#nIP7cEV%
zE$)OTs$5d!STVu2;oF?ra0v!NY!fC_Jvh@YJNS=an%dFJUT~V>wP-3tO=KVwyF@c?
zr)HWe)-1RX2|IPUm3rqY_hix4eNX6HqEgQYf9+f{ont8i&_t(P%>ye*B%fkcx
zLqCp9_PqM|q5u24m1px#>gyY6ME7~4ZFid3}2R`g31&>~P@g|Thk~(Z_1aT1?Qw^*r4VUzA#Ewxw8yTv6m{TW(08qWng2tK
zhw;b+PCH1!x@CfrZXk*kAQy!ke~a$*2un}kF_F6@lp$hQ@>iZGZ&
z72QnG000{3T7teD%dt5-ji&UmSqBwo^Cfk*s)`ytlnl$hM8F2Z3h<4Z=}LZru5(Ic
z9he~v>MppNpi@CGFp(PvY0E(%%5V{t6`~+I$nbGqj1Qg$MFoTNiV65Q;8~Uoyd=cQ
zN0O;GIvFOj>}X}FkQr^pB!3Bd3S(P>(DOXT6Bx^>Ku#1z$nucqBg7-(&X`#7Bc?mh
zAlcx_AXjyCyRKKjt4vzcI6>1vpjK-hPO)2oOt&c>krDce4LOE|EoK6giBYQGgyobh
ztCnmWe^hsnXE{|Dq>F+aAh$TRqqgxVqhOTeS&omeLWGN!I8hSLNJ8xDCVazb8$4%e
zdU<9mJXYf3630q0wh7_2&Snmz3geHR=*Zag{X!MWMY?S
z#%C)y7z$46hEhS$HY+l08~>SKBWqF?q%2{pE;mwdUFD7}+Pd!ueS>r-gG}vS
zIYyq3Bf;ZPw943197Jua*o)8m^Tg*;Hj^raR*d(l@Ex`*^WoID>&MrAABr=NKflO6
zTk1%^nmhTZ^WDQIg}1A>)43aq-HFue<-Sk7U0=U14s^JJJ%6@;S-SW0!AtQ+=fc9T
Yee3>!cl5-^H-wzZj^s0I!#D5#1-?yA-T(jq
literal 0
HcmV?d00001
diff --git a/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/cornerbottomleft.png b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/cornerbottomleft.png
new file mode 100644
index 0000000000000000000000000000000000000000..91bd8329da8c48420e115f90decb7a8e623edc6e
GIT binary patch
literal 1311
zcmcIk%WD%s7~d8tHMQcqRgsSC#e1;A&{Kz<$A0tue&090`Iy_Isq^i=
z6F!Qf+7rX^G@19hy|smmU+=dZAk!XaAdzh)ZN62#fy7A5soELkZc45m?D
zGa@tqfCicxp)UoKY|@IMf;K#7qs&|?tIQRZuuAtveNsgvU>#u@RP>VJh?NNKaf)Q^
znjsB57hH_c{cbQYmK+5!(?%fR=NN?*0wB=s=RLasct2r?pAF9P9e-XNXu_Z!SE|>jf!Ef4m$c4jU$nucq8REe>vj&zcjNzQA
zl5FzCk)zm}<>}?}%G2fyj?lClsNQOaldXCn!>Nf!WP}yjf}Ed)b!GyTh*9)z!nCud
zS&CMVKcv~HY}!Q!#4>{9BDXm;qBig-E@KqsS&nB|f#CvKE-VT?q7WS4g0DL5fG15=
z%gt_w2eVvARS(CCLWeMwbxtV(XDtBek(0y0vtE9Ubq|p56
z6nQ>6-Nzwg=5SfI5w)XYFTU*LPq^2lde-$;p^q!
z#CQM?=5W$M3f3(X$hv_jR)Aa>a{NVlUxl!A`X0IT8Bw(iM$xP(#CV2HNqwHJs3nBK
z6e{RuoCW~UK-c2*xk#E#+euW^hi4s>oz2MVY)Or2bYCJUc_IND2rIxd%BCxNak|PW
zlC^J!G^o1ZQk?GhgMnOn3?wZFfiS~`R8|Osa1X;r`B=2)B*-clj4CGJqkv~wGVr1h
zB_Bzq+UP`(%#x$!#qrcoJtp~!(?yJJ5yDEP!c+vtate@(#bS`9!!@m
z_r*`g8HVXAOysZ8`DoN*y>$HgsJEX^J^pAxi_x|cGw(;6-oy=`VUC@Mde^5fcYaah
zDKa)gav15vavh*qHez@Q3P~u4H`$W`Wf_P(W{Q)t;o1q^bmvhbv^_={4n5tdAp+)6
z)pAr80KfvvRN3pPB46}!Xu+CT#;Ckp(v0PrkullfY+MOt3bql^L1@<jYfU9U!KG$n$g%WhqTR
znoOgy**KjQY*yrJ`SDgv`lqrBgm^N9K@cPYDdFNO6f&6%~_6XBZJv!3?JNS=arqR~RTg3IowU`D(bz~!l_*64t
zzh;$yjIPhYMFJ0HqBL%-M7k8k#`
zej8x7OZd(3?7hb$7;|^0UY+mS{#h?GFE;-CP**;0ZuBZ!@8Zvoy#M&U`_gI;o(pfe
Pl$R-tmGZAg=T`p$bC*w|
literal 0
HcmV?d00001
diff --git a/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/cornertopright.png b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/cornertopright.png
new file mode 100644
index 0000000000000000000000000000000000000000..b0ab1a22f67d1dbbaae0c92f58d586768310470f
GIT binary patch
literal 1318
zcmcIkOK1~87+xQg8mX^JsReP^-b$0%N79%zNlBB|MolcuVyi-NyE{qNWFPEKyJ;yF
zJXr*3@d1V21P?+*5k)9?@pTjGr3Wb}6nc|h1Q8WylQe02&{Kz<$Nuww-~Z1yKQl9s
zKHKDJ^H3Dkl@Wv<}}nfBW~NwJZ%sYd0NyJ_}cwkhi1F}Lsew0h$g
zF}C2|VH~%RgjGWaqN*W^;UVjXEO(u5b_mN+*JC(!L68m2Cn?4#@|84`3U`-GNiHA^
zMo~`HBQyYj2C5RFhXN@kWyVon?Vq$zW-=|xlLa}X(A`l_xFis;hOh)mT2Z%!QiLvZ
z3S{k?Aq~ndxDcUZZZI&M8US&_Lcs51y)wi5fxpYg1-VeLs}p1-49-b9;DUf-7&34I
zA0!`1rrhYLhsZKWPJ>*F%w{z7=`jp
z7?x-l#c1XDeX4~V!z$Pyp5enTa+^~A!<
zI<|>s>~_r*S;!ieCgG^6NjU^fJr{;`<3IDOWKGI~lqIay={wp(1L2KKp*()wM(7#@jpX-+nGEj4Z!8
uoc{21Xye4=>ACZ5*5dcu&eZ4MeZlEJ{Jp#+NlUG*<_@ga
z!4`7YU@n||d<3Lja|_Q85J(~k>z?!
zQVpz?u%^G3Z^sbjW{TKtKO;8x6zcFkQxY$b%+(~I_J|48XG7Po$p|4CxlT=fQEsd4
zpuzUst;3LY4?C89II^pbyjstj2?4Ul1VxEA_9K$iTU2)JJ*+>8c8oPK*kCP)s)DdLC9YbOvOnxjD@V
ze>Hheh=5=m$FUL{3J-@^t5&O6)v>M@0a1(&d_j|_rs9E&IH3X76cx`R1JML0$!>y&7U$#ona)614tA(~3c>Xd#4G^Lw3
z72=FAnd<48F8I-Z1as_}Ucr7i&aTC=F&i_F`62?%wDX!dHW~2HqoVG5bjWbv4^2FG
z{EqDl0}<1ZNf$cy`S*t%
zz$~|#YgX>a9{c{F-|O`@Pwp2Ag64$R1sQ-?ZJ!5>_^g=B}r+M)~1*kngwGoI^CV5YqB5gPDxs&
zs91?Vp$9L5hvFBah=(E~NPE$P2?h*|lC&`*nrQ%8(=o$|kPks#xXd1@Qk6azQOKN?6jKi()ttq_nr<<%k(z~+GA3Xa
zmoy{J0svT`sd4svIKySEB%aeI7j2wh%*x7QS&6FbNWvehNtCQ(f-nnv!13z
z*KQcHz=M!-oE>$OfkGw+lBSJ8D98sCP7Hz2a8QT{(a7*AkVgbeAp-~zAaEQV1WAn0
zj~3%KHsPmp%vOuibZVlRlm5loIYKN6!fLe|tcpR?Ey?Uu|XW_
z8NbsrRgsFOts|1qbX3C7GD_j0TB)=}=sqV4;h$TvjyGRfS&
zl>z#E9CIIsyjdhwWMgL6jXn4DM3!Q5>C~v~ThZT+`mb?4ov)tw2iNL>G5pp(b%OMe*tmoQj`Dy
literal 0
HcmV?d00001
diff --git a/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/lefttop.png b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/lefttop.png
new file mode 100644
index 0000000000000000000000000000000000000000..6456879bb8f11417a5e4de0c3a365588869e6046
GIT binary patch
literal 1292
zcmcIkO-~a+7+w^x7BB&$pb24IV`8H1>_`u$t?nicq>_QAt
zPk7LahJ=$|yc(k(J$NzPjL{f5NaAns?7`V>X@P^DnCyJ)o9B7ncb=KdHI96kJ8>9>84}<=KD`{>U1XxN`$ui5p691*weRNhUpmyddJu8)ju?Nl1$E#
zoP!b3EfXlZff-JOd;;>qJ@&XqRr&+OT=BZ3T1Fgc)&h?EhRw)hzKzrxCSUo99&*0De6j1O>68}HY)oPB^#I^;2U+*mHZ4FYD#n+gdqz;
z2&rY*@gNzPE6#wN
zjnY|mw2CyFpK9i$e;Ia>5L<%K^Srnx#x17``E)uBIROenj3Q$0vPqC1Gu^WdksX~p
zc2!5WL%#xDv|uff49f5+c#|AcuOFiTFdZwvT
z#c~Wpvbuq)7}{o4hV9@#>uXd^uLZr9uyrqYN^c$Ifh^j-ABcQI^dOTg9@-eD&&N>k
zIFzjl@sNX=eK+>TyO9#bTr1?qmB@zigg^Fx>pcv0^m1VA^YbIWkY|_pg808r&4V
zF@qx?yLx{;UEAzXYr{id9zHvD{>{(Ij}vcSyt;X&Yw7z1<<9DMk2KkN*&N#HqOwe3
LvXp;4are<*hs;S?
literal 0
HcmV?d00001
diff --git a/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/right.png b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/right.png
new file mode 100644
index 0000000000000000000000000000000000000000..67dfd00170a7aad5e604fb22f24d77a63c4b8eb3
GIT binary patch
literal 1254
zcmcIkO=}ZD7~V>eG+OWr5kWevcr!cuku+x5q_o-AMw(cf1*0dYyOVTHc4yh0y4#{c
z#e)iZ5Ipox6vd;rD*XYTy!a3F!&d0ty&-1?X%rLK(8@DI3SF?g3
zOx6~S6+Tb!K9)Jn$FsXHp7LotoU54`-kxOamkGdMydMg}nF~oD`}X76J`Y}I^DR~l
z2xboTfa$nIkTs~}p`tz#FGgJDe1d4zmyktW3EOm)NU`e+`b_L&t4kPIB^}2rivR!-
zICfdQSE$Q%ze?7e#m#^;Hyft4*|kcxI8({$G2GFbrb1=Y=RPi>W5!>m&?CkV06u
zEY2p$K&!qCsx%-VFDW@o*76`fEvZGdRGhvEnwWt**aK=2sItrl6=_BO@nX^@R)81oT?Q4~p$Cefe+l~Sn$WfiJwjw5p6hR1N6^TO+WkpmrrgjV4A
zsb7gMUZv}-EQ(2@VH<1?`@=+DI53af2xII+MUvrAnG2H6*2}neP
zZV0MPO;4CdK%=Z9J~1#O6;)Q$oUG-Pys4Csb_;2R2Z#85&@pls8jSVx--R=}$s{Q@r6()WC4qPkjIR;13C2z_Tkj
z?;;f&wgnW!L=-DPE(tmQE`8o7DnlV+MZO|xw#lfvT}4b_I+QdOII7k_7*tW+u(C7&
zfCh%1rLU)CR(A4e%_wfTsIpO3w2g+A(dnsNTna=&HW5}qU^XpJ46<~jDUx*Zg9O9oyP(&Qt>M2*hH
z$t<~gOqf10n4VI&
zw8*hyitW%3fI4&uhDIDPCUQO8(~&s%k72sj^~+gzo6)i88bnQGA`5%OGw!fwx+d0a
z*Hm%NFx5JOj#ZanFZj>;+EtTlL9Qk2-pl>cyGMB}i=OYtBHtE0&LnFmw?@hHF%muw
z6}yIg)kV~i8@u@Ca+zR?rNXol+cH0MXE(vQ+4s-4TNA$;&GF=?z1Z-F#dq8H2Nu4x
zb{~)SmwyCHFCL!$cKg<=&7F~}^8D|wtIrntwQD=M$(P{HrMa=%XmwjAnpA1FTzEaR
G`sgn&<4N)W
literal 0
HcmV?d00001
diff --git a/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/righttop.png b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/righttop.png
new file mode 100644
index 0000000000000000000000000000000000000000..58b3596035b51b825dcea5f86d09c1e9a2b7235e
GIT binary patch
literal 1292
zcmcIkO-~a+7+wq^rN{w4h)B?Jy&1c+A1&){wk6PlRB0u26On^)*`2m)yC3Wh=~9VN
zqKVwR7{i~CgZ=W}{P4
zGAo`@lov8H?VRKD*bV-(zE;)bT99iAJNNRS^v+S9$fE1}iO9D^PcljQ)YcezJ}!ih
zL%}KHn&u(u*p0pO_Hv$JZf7%-YGljWn~XkTPxtO*V}Bareq-bQv#;-mr&g|fd-~%JO7m5pPN$~E2DtlD{p*0H}dM|uWj@B$fKU^(f-ELr}b+@mdZ}&
KGjFCIZ2Sd|t4=2X
literal 0
HcmV?d00001
diff --git a/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/top.png b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/top.png
new file mode 100644
index 0000000000000000000000000000000000000000..c5c30ca663383d4463dcad0db05a52de0a4d9221
GIT binary patch
literal 1254
zcmcIkJ#W)M7_&(I
zmhuz&Cr}X*I}&1KU|~Wm{Q*b}EU4n_q)F2Ork;Ese(!yr_r2#{-JA91-G%JcEXQ#R
z^;%_v%`>deXU?+mSG9V;rZeGc-ORA|B4h6+n||#{$Z_WulRoqH`^!Jfc!{oU(sF5AziZ;Jo%IdMkz%Hf;#BSdUwbrjdf5a0R}ly7A#54f!va)6qI6N={9H~3hp5fCddI6H$eiEkbY@+{Hhb+hy=Y5
zlv}EvAg7!rQ73p@K@^u1Nmc|&737>L7d7>crskg>!w;QKz#GJN+B?(myeStnS<>>-
z2!70I1lM6A#4%w~)sr)wu!H{yW?N&u{OzEhUW;u(+{Z5VXvj2^r!})JtxWpSL5fekR*eVEacPHtZ?4!F=cN;{C
zAlP$3Xi-5Bya`h9;7LIQL68=_h@SMWe}D&PH)+!Lpr;NykNxKR{l0I0^D)ci(nN3k
zbey87-om6jMdlvT568l>Z|&w2G9C0r3rdW%yD|M?xamw@_bBSfiLme6{C@8bG4|uJ
z8Ju^KiVfQWieVy(6(E;{9DkcW=@XW|&|{`}MbvDQQFVJ3F@fn&(oo>2S{-39i)x0I
zr2zmmF!U@vohq_LCy(Zg$)<}c&61)u>sm&qhjMW#5DC~sSOtOEuskuy(h;Xf)}a~F
zAacR=EIkqi12e@k$lERgNrp>ktdIoBL55HBne^aAP*E|stXhCi1D<8cz>7kfd?cBu
z(YZL8C0DPCQ}TE_Ci%A
z$jH-N!-@0?dDU5a0cUAC4Ag1u!>LXukma?-BQnB3bs)#Eu)|D%5;2O=P1vqt+l^f7
z_~V9)eA}&iAYT!r5V^yt8?}o^vWiiTXE{E>3JET$a2Zj!Bnqh;+wd)?UGSo<8`Z^~
z@RY)(MUE9yY#YAKsSTH4D8x2lBGtn)?XrXa2&QWty_^NN5nYR}LDWDdvam-q<92GM
zYhu-QO%>-1Q>`KBSTzZDjsMKAl{F~~QkJk&ms_cKu5wQnUETMDzD2s1LFV?ao+Z!6
zsqk^A*j4PSE~0i-?A7&iCE`;k$RkQ@^}*+n_|ovv{KoW)H|5`(o;_cA{^`T;v!5%Q
z?;i`t`!Bry`s0{em&r?$fA2+Hn
LR+3+i-n#!65lc>&
literal 0
HcmV?d00001
diff --git a/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/topright.png b/src/Shared/HandyControl_Shared/Resources/Images/GlowWindow/topright.png
new file mode 100644
index 0000000000000000000000000000000000000000..d6129fe7a08c1d6c866233234a927bbc12abe7b3
GIT binary patch
literal 1294
zcmcIkO=}ZD7+$MLj8t32Qbg&nB6x6j_9JP`vPo@|)<#S$&1$Qlb+bE3*JMA~ox0m1
z#R`Io=+#>MIC=0;5bduX4C&|2*^nHegC=mhZy_t
z=rqo_NX3S20mU#8#fgxQL0-5?ANC1LZ|E_dzaVM0$*Q_tLTq3WiL662
zq(Q?4S5x$G7z|A3CqTw_5s0xoqj6#k#0FU*AtV!nr$JH0;Jj)9Apr!ABZDA`3G$I-
z8jVgz$t=5iS(?m_wPKRL6g`WvBSGl^YpG=`c{cwGO8`?Ld~-5|79T1J!{%%fU7?0m{TEHEzOo72B?*
zo5vqBT;$ts)dQKLD2K=`PMxS7Jj$vVr3H=`7*1sPn8GI|@r)$KuWrIOowmXAwr-T?
zx5DEJpOAP?igPXaCZ`r$hM^FfglVWAo@tvM{6{cdYwP9AxwXc%=o&;dWFiZDL^FP?
zX1XSoZP!$B+A!4$f{s;@VaNE-{F+&lvLIy%+jY5-diyGOWYN)mN9dcRI~ioQYxy{N
zKKjGQp=g(}ueylZR
Date: Sat, 18 Jan 2020 14:23:47 +0800
Subject: [PATCH 22/26] add function codes
---
.../Themes/Styles/Window.xaml | 7 +-
.../Themes/Styles/Window.xaml | 11 +-
.../Themes/Styles/Window.xaml | 7 +-
.../HandyControlDemo_Shared/App.xaml.cs | 1 +
.../HandyControlDemo_Shared/MainWindow.xaml | 1 -
.../Window/AboutWindow.xaml | 1 -
.../Window/BlurWindow.xaml | 1 -
.../Window/CommonWindow.xaml | 1 -
.../Window/CustomNonClientAreaWindow.xaml | 1 -
.../Window/GlowWindow.xaml | 4 +-
.../Window/NoNonClientAreaDragableWindow.xaml | 1 -
.../Controls/Window/BlurWindow.cs | 6 +
.../Controls/Window/GlowWindow.cs | 663 +++++++++++++++++-
.../Controls/Window/Window.cs | 5 +
.../Data/DisposableObject.cs | 69 ++
.../Data/GlowWindow/ChangeScope.cs | 21 +
.../Data/GlowWindow/GlowBitmap.cs | 113 +++
.../Data/GlowWindow/GlowBitmapPart.cs | 22 +
.../Data/GlowWindow/GlowDrawingContext.cs | 51 ++
.../Data/GlowWindow/GlowEdge.cs | 587 ++++++++++++++++
.../HandyControl_Shared/Data/HwndWrapper.cs | 102 +++
.../HandyControl_Shared/Data/ResourceToken.cs | 4 +
.../HandyControl_Shared.projitems | 9 +
.../Extension/DependencyObjectExtension.cs | 18 +
.../Tools/Helper/ConfigHelper.cs | 9 +
.../Tools/Helper/DpiHelper.cs | 61 +-
.../Tools/Helper/IconHelper.cs | 2 +-
.../Tools/Helper/ScreenHelper.cs | 85 +++
.../Tools/Helper/VisualHelper.cs | 42 +-
.../Tools/Interop/InteropMethods.cs | 328 +++++++--
.../Tools/Interop/InteropValues.cs | 364 +++++++---
31 files changed, 2428 insertions(+), 169 deletions(-)
create mode 100644 src/Shared/HandyControl_Shared/Data/DisposableObject.cs
create mode 100644 src/Shared/HandyControl_Shared/Data/GlowWindow/ChangeScope.cs
create mode 100644 src/Shared/HandyControl_Shared/Data/GlowWindow/GlowBitmap.cs
create mode 100644 src/Shared/HandyControl_Shared/Data/GlowWindow/GlowBitmapPart.cs
create mode 100644 src/Shared/HandyControl_Shared/Data/GlowWindow/GlowDrawingContext.cs
create mode 100644 src/Shared/HandyControl_Shared/Data/GlowWindow/GlowEdge.cs
create mode 100644 src/Shared/HandyControl_Shared/Data/HwndWrapper.cs
create mode 100644 src/Shared/HandyControl_Shared/Tools/Extension/DependencyObjectExtension.cs
create mode 100644 src/Shared/HandyControl_Shared/Tools/Helper/ScreenHelper.cs
diff --git a/src/Core_30/HandyControl_Core_30/Themes/Styles/Window.xaml b/src/Core_30/HandyControl_Core_30/Themes/Styles/Window.xaml
index f0c9acdb..823319e4 100644
--- a/src/Core_30/HandyControl_Core_30/Themes/Styles/Window.xaml
+++ b/src/Core_30/HandyControl_Core_30/Themes/Styles/Window.xaml
@@ -48,12 +48,9 @@
-
-
-
-
+
+
-
-
@@ -56,7 +56,7 @@
+
+
@@ -57,7 +57,7 @@
-
@@ -56,7 +56,7 @@
+
+