摘要: public static List<T> ToListModel<T>(this DataTable dt) { if (dt.Rows.Count <= 0) return null; string typeName = typeof(T).Name; using (MemoryStream m 阅读全文
posted @ 2021-09-14 15:29 HotSky 阅读(353) 评论(0) 推荐(0) 编辑
摘要: 直接上代码: public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); WindowStyle = WindowStyle.None; if (IsWindows8x()) { Re 阅读全文
posted @ 2021-06-24 18:01 HotSky 阅读(231) 评论(0) 推荐(0) 编辑
摘要: 效果图: cs: 1 /// <summary> 2 /// ColorPick.xaml 的交互逻辑 3 /// </summary> 4 public partial class ColorPick : UserControl 5 { 6 ChangeSource _changeSource; 阅读全文
posted @ 2021-06-21 10:16 HotSky 阅读(427) 评论(0) 推荐(0) 编辑
摘要: <Window DataContext="{Binding MyViewModelInstance}"> <ListBox ItemsSource="{Binding MyDataItems}"> <ListBox.ContextMenu> <ContextMenu DataContext="{Bi 阅读全文
posted @ 2021-06-09 15:46 HotSky 阅读(442) 评论(0) 推荐(0) 编辑
摘要: public static string GetFileMD5(string filePath) { using (FileStream fs = new FileStream(filePath, FileMode.Open)) { System.Security.Cryptography.MD5C 阅读全文
posted @ 2021-03-02 09:25 HotSky 阅读(296) 评论(0) 推荐(0) 编辑
摘要: 先看效果图: 黑色是需要经过的点; 黄色为控制点; 绿色为两点之间的中点。 方式一: 方式二: <Canvas x:Name="canvas2"/> 方法一代码,【这是别人的代码,时间久了忘记原出处了】: Path path; public void UpdateRoad(List<Point> l 阅读全文
posted @ 2020-09-02 10:49 HotSky 阅读(1950) 评论(0) 推荐(0) 编辑
摘要: private void Tb_PreviewKeyDown(object sender, KeyEventArgs e) { bool isNumber = e.Key >= Key.D0 && e.Key <= Key.D9 || e.Key >= Key.NumPad0 && e.Key <= 阅读全文
posted @ 2020-06-02 11:28 HotSky 阅读(1695) 评论(0) 推荐(0) 编辑
摘要: /// <sumary>/// 接收方/// </sumary>public void StartClient() { var factory = new NMSConnectionFactory(new Uri("activemq:failover:(tcp://localhost:61616/? 阅读全文
posted @ 2020-05-13 14:38 HotSky 阅读(718) 评论(0) 推荐(0) 编辑
摘要: #region MyRegion private IntPtr programIntPtr = IntPtr.Zero; bool inited { get; set; } public void Init() { try { if (inited) return; // 通过类名查找一个窗口,返回 阅读全文
posted @ 2020-05-13 10:32 HotSky 阅读(1040) 评论(0) 推荐(0) 编辑
摘要: 1 public class DragMoveBehavior : Behavior<UIElement> { Window window; Canvas parent; bool isDown; Point prePosition = new Point(); public Type Target 阅读全文
posted @ 2020-01-14 17:48 HotSky 阅读(984) 评论(2) 推荐(0) 编辑