diff --git a/29WxOrderWpf/29WxOrderWpf.csproj b/29WxOrderWpf/29WxOrderWpf.csproj
index fe66d75..2e76ba3 100644
--- a/29WxOrderWpf/29WxOrderWpf.csproj
+++ b/29WxOrderWpf/29WxOrderWpf.csproj
@@ -19,7 +19,7 @@
AnyCPU
true
full
- false
+ true
bin\Debug\
DEBUG;TRACE
prompt
@@ -34,12 +34,16 @@
prompt
4
+
+ 29wx.ico
+
..\DllReference\NaiBa.Util.dll
+
@@ -58,6 +62,33 @@
MSBuild:Compile
Designer
+
+ BaseMsgWindow.xaml
+
+
+
+ LoginWindow.xaml
+
+
+ OrderListCtrl.xaml
+
+
+ Icons.xaml
+
+
+ UcImageButton.xaml
+
+
+ WindowBoxes.xaml
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
MSBuild:Compile
Designer
@@ -70,6 +101,30 @@
MainWindow.xaml
Code
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
@@ -97,14 +152,32 @@
-
-
-
+
{6461D807-B1C8-45F0-B388-E0CA1A418DE0}
29WxOrderAllBase
+
+ {1ad45d66-6872-4522-acf0-04e2c0514048}
+ 29WxOrderWork
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/29WxOrderWpf/29wx.ico b/29WxOrderWpf/29wx.ico
new file mode 100644
index 0000000..059d46c
Binary files /dev/null and b/29WxOrderWpf/29wx.ico differ
diff --git a/29WxOrderWpf/App.xaml b/29WxOrderWpf/App.xaml
index 6318c00..38ea195 100644
--- a/29WxOrderWpf/App.xaml
+++ b/29WxOrderWpf/App.xaml
@@ -4,6 +4,12 @@
xmlns:local="clr-namespace:_29WxOrderWpf"
StartupUri="MainWindow.xaml">
-
+
+
+
+
+
+
+
diff --git a/29WxOrderWpf/BaseWindows/BaseMsgWindow.xaml b/29WxOrderWpf/BaseWindows/BaseMsgWindow.xaml
new file mode 100644
index 0000000..ae5e115
--- /dev/null
+++ b/29WxOrderWpf/BaseWindows/BaseMsgWindow.xaml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/29WxOrderWpf/BaseWindows/BaseMsgWindow.xaml.cs b/29WxOrderWpf/BaseWindows/BaseMsgWindow.xaml.cs
new file mode 100644
index 0000000..2581d26
--- /dev/null
+++ b/29WxOrderWpf/BaseWindows/BaseMsgWindow.xaml.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace _29WxOrderWpf.BaseWindows
+{
+ ///
+ /// BaseMsgWindow.xaml 的交互逻辑
+ ///
+ public partial class BaseMsgWindow : BaseWindow
+ {
+ public BaseMsgWindow()
+ {
+ InitializeComponent();
+ this.DataContext = this;
+ }
+ }
+}
diff --git a/29WxOrderWpf/BaseWindows/BaseWindow.cs b/29WxOrderWpf/BaseWindows/BaseWindow.cs
new file mode 100644
index 0000000..277def3
--- /dev/null
+++ b/29WxOrderWpf/BaseWindows/BaseWindow.cs
@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Interop;
+using System.Windows.Media.Imaging;
+using System.Windows.Shell;
+
+namespace _29WxOrderWpf.BaseWindows
+{
+ public class BaseWindow : Window
+ {
+ public BaseWindow()
+ {
+ this.Icon = new BitmapImage(new Uri("pack://application:,,,/Resources/29wx.ico"));
+ this.WindowStartupLocation = WindowStartupLocation.CenterScreen;
+ WindowChrome.SetWindowChrome(this, new WindowChrome() { CaptionHeight = 8, ResizeBorderThickness = new Thickness(4), });
+
+ this.DataContext = this;
+ }
+ }
+}
diff --git a/29WxOrderWpf/LoginWindows/LoginWindow.xaml b/29WxOrderWpf/LoginWindows/LoginWindow.xaml
new file mode 100644
index 0000000..6f1fa8a
--- /dev/null
+++ b/29WxOrderWpf/LoginWindows/LoginWindow.xaml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/29WxOrderWpf/LoginWindows/LoginWindow.xaml.cs b/29WxOrderWpf/LoginWindows/LoginWindow.xaml.cs
new file mode 100644
index 0000000..5666956
--- /dev/null
+++ b/29WxOrderWpf/LoginWindows/LoginWindow.xaml.cs
@@ -0,0 +1,36 @@
+using _29WxOrderWpf.BaseWindows;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+using Work.BaseForms;
+
+namespace _29WxOrderWpf.LoginWindows
+{
+ ///
+ /// LoginWindow.xaml 的交互逻辑
+ ///
+ public partial class LoginWindow : BaseWindow
+ {
+ public LoginWindow()
+ {
+ InitializeComponent();
+ }
+
+ private void BaseWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
+ {
+ if (BaseMsgForm.ShowConfirm("是否关闭软件?\r\n必须登录账户才能使用,无账户请先注册一个", "请先登录或者注册").DialogResult == System.Windows.Forms.DialogResult.OK)
+ Process.GetCurrentProcess().Kill();
+ }
+ }
+}
diff --git a/29WxOrderWpf/MainWindow.xaml b/29WxOrderWpf/MainWindow.xaml
index 118a27e..31ad81f 100644
--- a/29WxOrderWpf/MainWindow.xaml
+++ b/29WxOrderWpf/MainWindow.xaml
@@ -1,193 +1,25 @@
-
-
-
-
-
+ xmlns:orderctrls="clr-namespace:_29WxOrderWpf.OrderCtrls"
+ xmlns:uc="clr-namespace:_29WxOrderWpf.UserControls"
+ mc:Ignorable="d" Style="{StaticResource BaseNoneBorderWindowStyle}"
+ Title="MainWindow" Height="450" Width="800" Loaded="Window_Loaded" Closing="BaseWindow_Closing">
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
diff --git a/29WxOrderWpf/MainWindow.xaml.cs b/29WxOrderWpf/MainWindow.xaml.cs
index 00681a9..1aed043 100644
--- a/29WxOrderWpf/MainWindow.xaml.cs
+++ b/29WxOrderWpf/MainWindow.xaml.cs
@@ -1,13 +1,21 @@
-using AllBase;
+using _29WxOrderWpf.BaseWindows;
+using _29WxOrderWpf.OrderCtrls;
+using AllBase;
using AllBase.Extension;
using AllBase.Model;
using NaiBa.Util;
using NaiBa.Util.Extension;
using System;
+using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
+using System.Diagnostics;
using System.Linq;
+using System.Net;
+using System.Reflection;
+using System.Runtime.InteropServices;
using System.Text;
+using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
@@ -18,21 +26,19 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
+using Work;
namespace _29WxOrderWpf
{
///
/// MainWindow.xaml 的交互逻辑
///
- public partial class MainWindow : Window
+ public partial class MainWindow : BaseWindow
{
- public ObservableCollection lstOrder { get; set; } = new ObservableCollection();
- public List lstOrder1 { get; set; } = new List();
-
public MainWindow()
{
InitializeComponent();
- //DataContext = this;
+ this.DataContext = this;
this.Height = 800;
this.Width = 1600;
@@ -40,31 +46,130 @@ namespace _29WxOrderWpf
private void Window_Loaded(object sender, RoutedEventArgs e)
{
- //MyData newItem = new MyData { Name = "New Person", Age = 28 }; // 创建新数据项
- //_myDataCollection.Add(newItem); // 添加到集合中
- //dataGrid.Items.Refresh();.
- //dgOrder.Items.Add(1111111);
+ new Thread(AutoAntiGrabbingMechanism).Start(); // 反抓包
- dgOrder.ItemsSource = lstOrder;
+ #region 弹出登录窗口
+ LoginWindows.LoginWindow loginWindow = new LoginWindows.LoginWindow();
+ loginWindow.Owner = this;
+ loginWindow.ShowDialog();
+ #endregion
+ }
- lbxOrder.ItemsSource = lstOrder;
- for (int i = 0; i < 10000; i++)
+ private void BaseWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
+ {
+
+ }
+
+ #region 反抓包功能
+ private void AutoAntiGrabbingMechanism()
+ {
+ while (true)
{
- //lstOrder.Add(new oms_wei_order_info() { id = 1, is_select = false, order_id = ("3737033423685556736".ParseToLong() + Randomx.GetId(0,100)).ParseToString(), shop_name = "媛卡曦工厂优选" });
- lstOrder.Add(new oms_wei_order_info() { id = 1, is_select = false, order_id = Randomx.GetId(1000,10000).ParseToString(), shop_name = "媛卡曦工厂优选" });
+#if DEBUG
+#else
+ AntiGrabbingMechanism();
+#endif
+ try { Thread.Sleep(3000); } catch { }
}
- lstOrder.SortDesc(o => o.order_id.ParseToLong());
}
- private void btnClose_Click(object sender, RoutedEventArgs e)
+ [DllImport("kernel32.dll", SetLastError = true, CallingConvention = CallingConvention.Winapi)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ internal static extern bool IsWow64Process([In] IntPtr process, [Out] out bool wow64Process);
+ private List _AntiProcesses = "WINRAR,WIRESHARK,FIDDLER,HTTPDEBUGGERPRO,IEHTTPANALYZER,CHARLES,HTTPWATCH,SMARTSNIFF,MINISNIFFER,PROXIFIER,HTTP ANALYZER,SNIFFER,WSOCKEXPERT,IPANALYSE,ANALYZER,HTTP ANALYZER STAND-ALONE EDITION".Split(',').ToList();
+ private void AntiGrabbingMechanism()
{
- this.Close();
+ //Gate 1 - Anti Proxy
+ if (IsUseSystemProxy())
+ {
+ LockUserAndKillProcess();
+ }
+
+ //Gate 2 - Anti Special Processes
+ System.Diagnostics.Process[] processList = System.Diagnostics.Process.GetProcesses();
+ foreach (System.Diagnostics.Process process in processList)
+ {
+ try
+ {
+ if (_AntiProcesses.Contains(process.ProcessName.ToUpper()))
+ {
+ process.Kill();
+ LockUserAndKillProcess();
+ }
+
+ if (process.MainWindowTitle.Contains("正在捕获"))
+ {
+ process.Kill();
+ LockUserAndKillProcess();
+ }
+
+ if (!IsWin23App(process))
+ {
+ continue;
+ }
+ if (process.MainModule?.FileVersionInfo.FileDescription != null)
+ {
+ foreach (string antiProcess in _AntiProcesses)
+ {
+ if (process.MainModule.FileVersionInfo.FileDescription.ToUpper().Contains(antiProcess))
+ {
+ process.Kill();
+ LockUserAndKillProcess();
+ }
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ }
+ }
}
- private void Path_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+ private void LockUserAndKillProcess()
{
- var orderId = ((sender as Border)?.Tag).ParseToString();
- Clipboard.SetText(orderId);
+ string url = BaseClass.BuildObjString("user&act=add_user_lock");
+ string data = UserLogin.GetSignaturex("", "");
+ string html = GetHtml.PostUtf8(url, data);
+ Process.GetCurrentProcess().Kill();
}
+ public static bool IsUseSystemProxy()
+ {
+ BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.NonPublic;
+ IWebProxy systemWebProxy = WebRequest.GetSystemWebProxy();
+ FieldInfo field1 = systemWebProxy.GetType().GetField("webProxy", bindingAttr);
+ if (field1 != (FieldInfo)null)
+ {
+ WebProxy webProxy = field1.GetValue((object)systemWebProxy) as WebProxy;
+ FieldInfo field2 = webProxy.GetType().GetField("_ProxyHostAddresses", bindingAttr);
+ if (field2 != (FieldInfo)null)
+ {
+ Hashtable hashtable = field2.GetValue((object)webProxy) as Hashtable;
+ if (hashtable != null && hashtable.Count > 0)
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public bool IsWin23App(Process process)
+ {
+ if (Environment.Is64BitOperatingSystem)
+ {
+ IntPtr processHandle;
+ bool retVal;
+
+ try
+ {
+ processHandle = Process.GetProcessById(process.Id).Handle;
+ }
+ catch
+ {
+ return false;
+ }
+ return IsWow64Process(processHandle, out retVal) && retVal;
+ }
+ return true;
+ }
+ #endregion
}
}
diff --git a/29WxOrderWpf/OrderCtrls/OrderListCtrl.xaml b/29WxOrderWpf/OrderCtrls/OrderListCtrl.xaml
new file mode 100644
index 0000000..da3b41b
--- /dev/null
+++ b/29WxOrderWpf/OrderCtrls/OrderListCtrl.xaml
@@ -0,0 +1,158 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/29WxOrderWpf/OrderCtrls/OrderListCtrl.xaml.cs b/29WxOrderWpf/OrderCtrls/OrderListCtrl.xaml.cs
new file mode 100644
index 0000000..58dad5e
--- /dev/null
+++ b/29WxOrderWpf/OrderCtrls/OrderListCtrl.xaml.cs
@@ -0,0 +1,67 @@
+using AllBase;
+using AllBase.Extension;
+using AllBase.Model;
+using NaiBa.Util.Extension;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace _29WxOrderWpf.OrderCtrls
+{
+ ///
+ /// OrderListWindow.xaml 的交互逻辑
+ ///
+ public partial class OrderListWindow : UserControl
+ {
+ public ObservableCollection lstOrder { get; set; } = new ObservableCollection();
+ public List lstOrder1 { get; set; } = new List();
+
+
+ public OrderListWindow()
+ {
+ InitializeComponent();
+ }
+
+ private void Window_Loaded(object sender, RoutedEventArgs e)
+ {
+ //MyData newItem = new MyData { Name = "New Person", Age = 28 }; // 创建新数据项
+ //_myDataCollection.Add(newItem); // 添加到集合中
+ //dataGrid.Items.Refresh();.
+ //dgOrder.Items.Add(1111111);
+
+ dgOrder.ItemsSource = lstOrder;
+
+ lbxOrder.ItemsSource = lstOrder;
+ for (int i = 0; i < 10000; i++)
+ {
+ //lstOrder.Add(new oms_wei_order_info() { id = 1, is_select = false, order_id = ("3737033423685556736".ParseToLong() + Randomx.GetId(0,100)).ParseToString(), shop_name = "媛卡曦工厂优选" });
+ lstOrder.Add(new oms_wei_order_info() { id = 1, is_select = false, order_id = Randomx.GetId(1000, 10000).ParseToString(), shop_name = "媛卡曦工厂优选" });
+ }
+ lstOrder.SortDesc(o => o.order_id.ParseToLong());
+
+ }
+
+ private void Path_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+ {
+ var orderId = ((sender as Border)?.Tag).ParseToString();
+ try
+ {
+ Clipboard.SetText(orderId);
+ }
+ catch (Exception ex)
+ {
+ }
+ }
+ }
+}
diff --git a/29WxOrderWpf/Resources/29wx.ico b/29WxOrderWpf/Resources/29wx.ico
new file mode 100644
index 0000000..059d46c
Binary files /dev/null and b/29WxOrderWpf/Resources/29wx.ico differ
diff --git a/29WxOrderWpf/Resources/WindowBoxes/close.hover.png b/29WxOrderWpf/Resources/WindowBoxes/close.hover.png
new file mode 100644
index 0000000..232de18
Binary files /dev/null and b/29WxOrderWpf/Resources/WindowBoxes/close.hover.png differ
diff --git a/29WxOrderWpf/Resources/WindowBoxes/close.png b/29WxOrderWpf/Resources/WindowBoxes/close.png
new file mode 100644
index 0000000..784b6f1
Binary files /dev/null and b/29WxOrderWpf/Resources/WindowBoxes/close.png differ
diff --git a/29WxOrderWpf/Resources/WindowBoxes/max.hover.png b/29WxOrderWpf/Resources/WindowBoxes/max.hover.png
new file mode 100644
index 0000000..2d7f0e4
Binary files /dev/null and b/29WxOrderWpf/Resources/WindowBoxes/max.hover.png differ
diff --git a/29WxOrderWpf/Resources/WindowBoxes/max.png b/29WxOrderWpf/Resources/WindowBoxes/max.png
new file mode 100644
index 0000000..6094a07
Binary files /dev/null and b/29WxOrderWpf/Resources/WindowBoxes/max.png differ
diff --git a/29WxOrderWpf/Resources/WindowBoxes/min.hover.png b/29WxOrderWpf/Resources/WindowBoxes/min.hover.png
new file mode 100644
index 0000000..992c843
Binary files /dev/null and b/29WxOrderWpf/Resources/WindowBoxes/min.hover.png differ
diff --git a/29WxOrderWpf/Resources/WindowBoxes/min.png b/29WxOrderWpf/Resources/WindowBoxes/min.png
new file mode 100644
index 0000000..bf878d8
Binary files /dev/null and b/29WxOrderWpf/Resources/WindowBoxes/min.png differ
diff --git a/29WxOrderWpf/Resources/WindowBoxes/normal.hover.png b/29WxOrderWpf/Resources/WindowBoxes/normal.hover.png
new file mode 100644
index 0000000..1aa68e4
Binary files /dev/null and b/29WxOrderWpf/Resources/WindowBoxes/normal.hover.png differ
diff --git a/29WxOrderWpf/Resources/WindowBoxes/normal.png b/29WxOrderWpf/Resources/WindowBoxes/normal.png
new file mode 100644
index 0000000..bb1a37a
Binary files /dev/null and b/29WxOrderWpf/Resources/WindowBoxes/normal.png differ
diff --git a/29WxOrderWpf/Styles/BaseWindowStyle.xaml b/29WxOrderWpf/Styles/BaseWindowStyle.xaml
new file mode 100644
index 0000000..544dc20
--- /dev/null
+++ b/29WxOrderWpf/Styles/BaseWindowStyle.xaml
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/29WxOrderWpf/Styles/UcImageButtonStyle.xaml b/29WxOrderWpf/Styles/UcImageButtonStyle.xaml
new file mode 100644
index 0000000..cf8f6c7
--- /dev/null
+++ b/29WxOrderWpf/Styles/UcImageButtonStyle.xaml
@@ -0,0 +1,39 @@
+
+
+
\ No newline at end of file
diff --git a/29WxOrderWpf/ToolCtrls/Icons.xaml b/29WxOrderWpf/ToolCtrls/Icons.xaml
new file mode 100644
index 0000000..337ba19
--- /dev/null
+++ b/29WxOrderWpf/ToolCtrls/Icons.xaml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/29WxOrderWpf/ToolCtrls/Icons.xaml.cs b/29WxOrderWpf/ToolCtrls/Icons.xaml.cs
new file mode 100644
index 0000000..dc77ac6
--- /dev/null
+++ b/29WxOrderWpf/ToolCtrls/Icons.xaml.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace _29WxOrderWpf.UserControls
+{
+ ///
+ /// Icon.xaml 的交互逻辑
+ ///
+ public partial class Icon : UserControl
+ {
+ public Icon()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/29WxOrderWpf/UserControls/UcImageButton.xaml b/29WxOrderWpf/UserControls/UcImageButton.xaml
new file mode 100644
index 0000000..f1b9688
--- /dev/null
+++ b/29WxOrderWpf/UserControls/UcImageButton.xaml
@@ -0,0 +1,8 @@
+
diff --git a/29WxOrderWpf/UserControls/UcImageButton.xaml.cs b/29WxOrderWpf/UserControls/UcImageButton.xaml.cs
new file mode 100644
index 0000000..91ac732
--- /dev/null
+++ b/29WxOrderWpf/UserControls/UcImageButton.xaml.cs
@@ -0,0 +1,55 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace _29WxOrderWpf.UserControls
+{
+ ///
+ /// UcImageButton.xaml 的交互逻辑
+ ///
+ public partial class UcImageButton : Button
+ {
+ public UcImageButton()
+ {
+ InitializeComponent();
+ this.DataContext = this;
+ }
+
+ public static readonly DependencyProperty ButtonImageProperty = DependencyProperty.Register(
+ "ButtonImage", typeof(ImageSource), typeof(UcImageButton), null);
+ public ImageSource ButtonImage
+ {
+ get { return (ImageSource)GetValue(ButtonImageProperty); }
+ set { SetValue(ButtonImageProperty, value); }
+ }
+
+ public static readonly DependencyProperty MouseOverButtonImageProperty = DependencyProperty.Register(
+ "MouseOverButtonImage", typeof(ImageSource), typeof(UcImageButton), null);
+
+ public ImageSource MouseOverButtonImage
+ {
+ get { return (ImageSource)GetValue(MouseOverButtonImageProperty); }
+ set { SetValue(MouseOverButtonImageProperty, value); }
+ }
+
+ public static readonly DependencyProperty MousePressButtonImageProperty = DependencyProperty.Register(
+ "MousePressButtonImage", typeof(ImageSource), typeof(UcImageButton), null);
+
+ public ImageSource MousePressButtonImage
+ {
+ get { return (ImageSource)GetValue(MousePressButtonImageProperty); }
+ set { SetValue(MousePressButtonImageProperty, value); }
+ }
+ }
+}
diff --git a/29WxOrderWpf/UserControls/WindowBoxes.xaml b/29WxOrderWpf/UserControls/WindowBoxes.xaml
new file mode 100644
index 0000000..b5161db
--- /dev/null
+++ b/29WxOrderWpf/UserControls/WindowBoxes.xaml
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/29WxOrderWpf/UserControls/WindowBoxes.xaml.cs b/29WxOrderWpf/UserControls/WindowBoxes.xaml.cs
new file mode 100644
index 0000000..c93581c
--- /dev/null
+++ b/29WxOrderWpf/UserControls/WindowBoxes.xaml.cs
@@ -0,0 +1,114 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace _29WxOrderWpf.UserControls
+{
+ ///
+ /// WindowBox.xaml 的交互逻辑
+ ///
+ public partial class WindowBoxes : UserControl
+ {
+ public static readonly DependencyProperty MaxBoxVisibilityProperty =
+ DependencyProperty.Register("MaxBoxVisibility", typeof(Visibility), typeof(WindowBoxes),
+ new PropertyMetadata(default(Visibility)));
+ public Visibility MaxBoxVisibility
+ {
+ get { return (Visibility)GetValue(MaxBoxVisibilityProperty); }
+ set
+ {
+ SetValue(MaxBoxVisibilityProperty, value);
+ Window_StateChanged(null, null);
+ }
+ }
+
+ public static readonly DependencyProperty MinBoxVisibilityProperty =
+ DependencyProperty.Register("MinBoxVisibility", typeof(Visibility), typeof(WindowBoxes),
+ new PropertyMetadata(default(Visibility)));
+ public Visibility MinBoxVisibility
+ {
+ get { return (Visibility)GetValue(MinBoxVisibilityProperty); }
+ set { SetValue(MinBoxVisibilityProperty, value); btnMin.Visibility = value; }
+ }
+
+ public WindowBoxes()
+ {
+ InitializeComponent();
+ this.DataContext = this;
+ }
+
+ private void WindowBoxes_Loaded(object sender, RoutedEventArgs e)
+ {
+ this.btnClose.Click += BtnClose_Click;
+ this.btnMax.Click += BtnMax_Click;
+ this.btnNormal.Click += BtnNormal_Click;
+ this.btnMin.Click += BtnMin_Click;
+
+ var window = Window.GetWindow(this);
+ if (window != null)
+ {
+ window.StateChanged += Window_StateChanged;
+ }
+ Window_StateChanged(null, null);
+ }
+
+ private void BtnMin_Click(object sender, RoutedEventArgs e)
+ {
+ var window = Window.GetWindow(this);
+ if (window != null)
+ window.WindowState = WindowState.Minimized;
+ }
+
+ private void BtnNormal_Click(object sender, RoutedEventArgs e)
+ {
+ var window = Window.GetWindow(this);
+ if (window != null)
+ window.WindowState = WindowState.Normal;
+ }
+
+ private void BtnMax_Click(object sender, RoutedEventArgs e)
+ {
+ var window = Window.GetWindow(this);
+ if (window != null)
+ window.WindowState = WindowState.Maximized;
+ }
+
+ private void BtnClose_Click(object sender, RoutedEventArgs e)
+ {
+ var window = Window.GetWindow(this);
+ if (window == null)
+ return;
+
+ window.Close();
+ }
+
+ private void Window_StateChanged(object sender, EventArgs e)
+ {
+ var window = Window.GetWindow(this);
+ if (window != null)
+ {
+ if (window.WindowState == WindowState.Maximized && MaxBoxVisibility == Visibility.Visible)
+ {
+ this.btnNormal.Visibility = Visibility.Visible;
+ this.btnMax.Visibility = Visibility.Collapsed;
+ }
+ if (window.WindowState == WindowState.Normal && MaxBoxVisibility == Visibility.Visible)
+ {
+ this.btnNormal.Visibility = Visibility.Collapsed;
+ this.btnMax.Visibility = Visibility.Visible;
+ }
+ }
+ }
+ }
+}
diff --git a/AllBase/29WxOrderAllBase.csproj b/AllBase/29WxOrderAllBase.csproj
index f8f39ea..c6150c7 100644
--- a/AllBase/29WxOrderAllBase.csproj
+++ b/AllBase/29WxOrderAllBase.csproj
@@ -21,7 +21,7 @@
DEBUG;TRACE
true
full
- x86
+ x64
..\bin\AllBase.dll.CodeAnalysisLog.xml
true
GlobalSuppressions.cs
@@ -58,7 +58,7 @@
DEBUG;TRACE
true
full
- x86
+ AnyCPU
false
prompt
MinimumRecommendedRules.ruleset
diff --git a/Work/29WxOrderWork.csproj b/Work/29WxOrderWork.csproj
index d8a5e52..cf4bfa2 100644
--- a/Work/29WxOrderWork.csproj
+++ b/Work/29WxOrderWork.csproj
@@ -29,7 +29,7 @@
DEBUG;TRACE
prompt
4
- x86
+ AnyCPU
false
@@ -46,7 +46,7 @@
..\bin\
DEBUG;TRACE
full
- x86
+ x64
prompt
MinimumRecommendedRules.ruleset
@@ -245,6 +245,7 @@
+
@@ -262,6 +263,7 @@
+
diff --git a/Work/BaseForms/BaseGeneralForm.Designer.cs b/Work/BaseForms/BaseGeneralForm.Designer.cs
index eb11d66..977dfc1 100644
--- a/Work/BaseForms/BaseGeneralForm.Designer.cs
+++ b/Work/BaseForms/BaseGeneralForm.Designer.cs
@@ -44,7 +44,7 @@ namespace Work.BaseForms
((System.ComponentModel.ISupportInitialize)(this.pbCloseBase)).BeginInit();
this.SuspendLayout();
//
- // panel2
+ // pnlTitle
//
this.pnlTitle.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(160)))), ((int)(((byte)(233)))));
this.pnlTitle.Controls.Add(this.pbMinBase);
@@ -55,7 +55,7 @@ namespace Work.BaseForms
this.pnlTitle.Controls.Add(this.pbCloseBase);
this.pnlTitle.Dock = System.Windows.Forms.DockStyle.Top;
this.pnlTitle.Location = new System.Drawing.Point(0, 0);
- this.pnlTitle.Name = "panel2";
+ this.pnlTitle.Name = "pnlTitle";
this.pnlTitle.Size = new System.Drawing.Size(386, 32);
this.pnlTitle.TabIndex = 2;
this.pnlTitle.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel2_MouseDown);
@@ -108,7 +108,7 @@ namespace Work.BaseForms
// pictureBox3
//
this.pictureBox3.BackColor = System.Drawing.Color.Transparent;
- this.pictureBox3.Image = global::Work.Properties.Resources.icon;
+ this.pictureBox3.Image = global::Work.Properties.Resources.weixin_icon;
this.pictureBox3.Location = new System.Drawing.Point(5, 3);
this.pictureBox3.Name = "pictureBox3";
this.pictureBox3.Size = new System.Drawing.Size(23, 23);
@@ -151,7 +151,6 @@ namespace Work.BaseForms
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "BaseGeneralForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
- this.Text = "BaseForm";
this.Load += new System.EventHandler(this.LcBaseForm_Load);
this.pnlTitle.ResumeLayout(false);
this.pnlTitle.PerformLayout();
diff --git a/Work/BaseForms/BaseGeneralForm.cs b/Work/BaseForms/BaseGeneralForm.cs
index a7ff676..94390c6 100644
--- a/Work/BaseForms/BaseGeneralForm.cs
+++ b/Work/BaseForms/BaseGeneralForm.cs
@@ -72,10 +72,10 @@ namespace Work.BaseForms
{
if (BaseClass.Ico != null)
Iconx = Icon = BaseClass.Ico;
- else
- Iconx = Icon = BaseClass.Ico = ImageBuild.ConvertToIcon(Properties.Resources.icon);
+ //else
+ // Iconx = Icon = BaseClass.Ico = ImageBuild.ConvertToIcon(Properties.Resources.icon);
+
-
if (this.IsShowMax)
{
if (this.WindowState == FormWindowState.Maximized)
diff --git a/Work/Properties/Resources.Designer.cs b/Work/Properties/Resources.Designer.cs
index fa87171..bc064b7 100644
--- a/Work/Properties/Resources.Designer.cs
+++ b/Work/Properties/Resources.Designer.cs
@@ -60,6 +60,16 @@ namespace Work.Properties {
}
}
+ ///
+ /// 查找类似于 (图标) 的 System.Drawing.Icon 类型的本地化资源。
+ ///
+ internal static System.Drawing.Icon _29wx {
+ get {
+ object obj = ResourceManager.GetObject("_29wx", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
///
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
///
@@ -210,6 +220,16 @@ namespace Work.Properties {
}
}
+ ///
+ /// 查找 System.Drawing.Bitmap 类型的本地化资源。
+ ///
+ internal static System.Drawing.Bitmap weixin_icon {
+ get {
+ object obj = ResourceManager.GetObject("weixin_icon", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
///
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
///
diff --git a/Work/Properties/Resources.resx b/Work/Properties/Resources.resx
index 93d5fdb..2e47b2c 100644
--- a/Work/Properties/Resources.resx
+++ b/Work/Properties/Resources.resx
@@ -193,4 +193,10 @@
..\resources\errpic.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\resources\29wx.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\resources\weixin_icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
\ No newline at end of file
diff --git a/Work/Resources/29wx.ico b/Work/Resources/29wx.ico
new file mode 100644
index 0000000..059d46c
Binary files /dev/null and b/Work/Resources/29wx.ico differ
diff --git a/Work/Resources/weixin_icon.png b/Work/Resources/weixin_icon.png
new file mode 100644
index 0000000..2704ee9
Binary files /dev/null and b/Work/Resources/weixin_icon.png differ