摘要: 控制台、app等桌面应用程序(兼容系统自启) 1 System.IO.Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName) web BS架构 System.AppDomain.CurrentDomain.Base 阅读全文
posted @ 2021-07-16 10:09 吃奶嘴的路飞 阅读(80) 评论(0) 推荐(0) 编辑
摘要: 1 <Window x:Class="CommandDemo.MainWindow" 2 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 3 xmlns:x="http://schemas.microsoft.com 阅读全文
posted @ 2021-07-15 10:46 吃奶嘴的路飞 阅读(115) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// 获取随机数种子 /// </summary> /// <returns></returns> private int GetRandomSeed() { byte[] seedBuffer = Guid.NewGuid().ToByteArray(); retur 阅读全文
posted @ 2021-07-13 17:14 吃奶嘴的路飞 阅读(39) 评论(0) 推荐(0) 编辑
摘要: 1 /// <summary> 2 /// 将指定父级的下级索引元素,显示在视野下,使其可见 3 /// </summary> 4 /// <param name="control">父级</param> 5 /// <param name="i">需要可见的子集索引</param> 6 priva 阅读全文
posted @ 2021-06-24 10:02 吃奶嘴的路飞 阅读(37) 评论(0) 推荐(0) 编辑
摘要: 某些时候,需要验证控件之间是否存在重叠的情况,可以借助 System.Windows.Rect.IntersectsWith 来验证;如果需要获取重叠的部分,则使用 System.Windows.Rect.Intersect 来实现! <Window x:Class="轨迹规划Demo.MainWi 阅读全文
posted @ 2021-06-15 16:50 吃奶嘴的路飞 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 场景:线程里面构建MVVM实体类,实体类包含 Brush 属性时,构建 SolidColorBrush 需要UI线程,否则会报 “必须在与 DependencyObject 相同的线程上创建 DependencySource” MVVM实体类 1 using System; 2 using Syst 阅读全文
posted @ 2021-03-22 17:51 吃奶嘴的路飞 阅读(565) 评论(0) 推荐(0) 编辑
摘要: private TreeViewItem FindTreeItem(TreeViewItem item, Func<TreeViewItem, bool> compare) { if (item == null) { return null; } var pd = compare?.Invoke(i 阅读全文
posted @ 2021-03-12 15:03 吃奶嘴的路飞 阅读(32) 评论(0) 推荐(0) 编辑
摘要: 1 /// <summary> 2 /// 集合分组 3 /// </summary> 4 /// <param name="array">需要分组的集合</param> 5 /// <param name="size">每个分组的大小</param> 6 /// <returns></return 阅读全文
posted @ 2021-03-05 18:58 吃奶嘴的路飞 阅读(69) 评论(0) 推荐(0) 编辑
摘要: 1、选中附件,右键生成操作选择 嵌入的资源,例如:handle.exe 2、FileUtil 1 using System.IO; 2 using System.Reflection; 3 4 namespace ResourceOccupancyHelp 5 { 6 public class Fi 阅读全文
posted @ 2021-03-04 16:06 吃奶嘴的路飞 阅读(66) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// 当前是否处于设计模式 /// </summary> bool IsInDesignMode { get { return (bool)DesignerProperties.IsInDesignModeProperty .GetMetadata(typeof(Dep 阅读全文
posted @ 2021-02-24 15:27 吃奶嘴的路飞 阅读(134) 评论(0) 推荐(0) 编辑