09 2022 档案

摘要:约束 说明 where T:struct 对于结构约束,类型T必须是值类型 where T:class 类约束指定类型T必须是引用类型 where T:IFoo 指定类型T必须实现接口IFoo where T:Foo 指定类型T必须派生自基类Foo where T:new() 这是一个构造函数约束, 阅读全文
posted @ 2022-09-13 09:29 wzwyc 阅读(66) 评论(0) 推荐(0) 编辑
摘要:原来获取本机IP地址的方法(方法1): var items = Dns.GetHostEntry(Dns.GetHostName()).AddressList .Where(s => s.AddressFamily == System.Net.Sockets.AddressFamily.InterN 阅读全文
posted @ 2022-09-08 09:48 wzwyc 阅读(2293) 评论(0) 推荐(0) 编辑
摘要:模板样式定义: <TabControl ItemsSource="{Binding Items}"> <TabControl.ContentTemplate> <DataTemplate> <ListBox BorderThickness="0" ItemsSource="{Binding Item 阅读全文
posted @ 2022-09-06 11:10 wzwyc 阅读(453) 评论(0) 推荐(0) 编辑
摘要:数据的导出: private void OnExport() { try { FolderBrowserDialog dialog = new FolderBrowserDialog(); if (dialog.ShowDialog() == System.Windows.Forms.DialogR 阅读全文
posted @ 2022-09-02 16:49 wzwyc 阅读(622) 评论(0) 推荐(1) 编辑
摘要:用小工具自动生成一段XAML代码,但是自动生成的文本缩进和格式比较乱,想弄得整齐一点。 附上最终的实现代码: public static string FormatXML(string content) { XmlDocument doc = new XmlDocument(); XmlReader 阅读全文
posted @ 2022-09-01 16:31 wzwyc 阅读(153) 评论(0) 推荐(0) 编辑