{"id":28910599,"url":"https://github.com/x-stars/dotnetextensions","last_synced_at":"2026-05-19T10:02:07.785Z","repository":{"id":37839091,"uuid":"142896261","full_name":"x-stars/DotNetExtensions","owner":"x-stars","description":".NET extension libraries by XstarS.","archived":false,"fork":false,"pushed_at":"2025-04-30T13:25:53.000Z","size":2149,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-21T18:14:21.134Z","etag":null,"topics":["command-line","csharp","csharp-library","data-binding","dotnet","dotnet-library","dynamic-proxy","extension","union-types","validation"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/x-stars.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-07-30T15:45:53.000Z","updated_at":"2025-04-30T13:25:56.000Z","dependencies_parsed_at":"2025-04-25T15:40:03.353Z","dependency_job_id":null,"html_url":"https://github.com/x-stars/DotNetExtensions","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/x-stars/DotNetExtensions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-stars%2FDotNetExtensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-stars%2FDotNetExtensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-stars%2FDotNetExtensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-stars%2FDotNetExtensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/x-stars","download_url":"https://codeload.github.com/x-stars/DotNetExtensions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-stars%2FDotNetExtensions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274010098,"owners_count":25206763,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line","csharp","csharp-library","data-binding","dotnet","dotnet-library","dynamic-proxy","extension","union-types","validation"],"created_at":"2025-06-21T18:14:21.375Z","updated_at":"2026-05-19T10:02:07.682Z","avatar_url":"https://github.com/x-stars.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# XstarS .NET 扩展库\n\n**X**starS .**NET** **Ex**tensions =\u003e `XNetEx`\n\n天南十字星 (XstarS) 的自用 .NET 扩展库，程序集名称和命名空间均仿照 .NET 框架。\n\n## 框架支持\n\n| .NET      | 版本         |\n| --------- | ------------ |\n| Core      | 6.0, 8.0     |\n| Framework | 4.6.1, 4.7.2 |\n| Standard  | 2.0, 2.1     |\n\n\u003e C# 语言版本 \u003e= 10.0\n\n## 程序集 XNetEx.Common\n\n系统基础相关，目前包含的命名空间：\n\n* `XNetEx`\n* `XNetEx.Collections`\n* `XNetEx.Collections.Generic`\n* `XNetEx.Collections.ObjectModel`\n* `XNetEx.Collections.Specialized`\n* `XNetEx.Diagnostics`\n* `XNetEx.IO`\n* `XNetEx.Linq`\n* `XNetEx.Reflection`\n* `XNetEx.Reflection.Emit`\n* `XNetEx.Runtime.CompilerServices`\n* `XNetEx.Security.Cryptography`\n* `XNetEx.Text`\n\n\u003e `XNetEx.Operators` 类型提供部分常用运算符，建议静态引入后调用。\n\n相关文档：\n\n* [对象的通用值相等比较方法](Documentation/ValueEquals.md)\n* [析构元组和其他类型](https://docs.microsoft.com/zh-cn/dotnet/csharp/deconstruct)\n\n## 程序集 XNetEx.CommandLine\n\n提供命令行程序的相关服务，包括：\n\n* 简易的命令行参数解析器 `XNetEx.CommandLine.ArgumentReader`，以及其他风格的实现\n  * 命令提示符 CMD `XNetEx.CommandLine.Specialized.CmdArgumentReader`\n  * PowerShell `XNetEx.CommandLine.Specialized.PowerShellArgumentReader`\n  * Unix Shell `XNetEx.CommandLine.Specialized.UnixShellArgumentReader`\n\n相关文档：\n\n* [命令行参数解析器](Documentation/ArgumentReaders.md)\n\n## 程序集 XNetEx.Console\n\n提供控制台相关的扩展方法，包括：\n\n* 控制台方法扩展 `XNetEx.ConsoleEx`\n  * 逐个读取按空白符分隔的输入 `ReadToken`\n  * 逐个读取按空白符分隔的输入并转换为值 `ReadTokenAs`\n  * 以指定的颜色将值写入输出流 `WriteInColor`\n  * 以指定的颜色将值写入错误流 `WriteErrorInColor`\n\n## 程序集 XNetEx.Collections.StructuralComparing\n\n提供结构化对象（数组、集合等）的结构化相等比较的方法。\n\n核心 API 类型：\n\n* 对象的结构化相等比较 `XNetEx.Collections.Generic.StructuralEqualityComparer\u003cT\u003e`\n\n## 程序集 XNetEx.Diagnostics.Representation\n\n提供将对象或结构化对象（数组、集合等）表示为文本的方法。\n\n核心 API 类型：\n\n* 将对象表示为文本 `XNetEx.Diagnostics.Representer\u003cT\u003e`\n* 将结构化对象表示为文本 `XNetEx.Diagnostics.StructuralRepresenter\u003cT\u003e`\n\n## 程序集 XNetEx.Diagnostics.ValueValidate\n\n提供连续的对象的值的验证和抛出异常的方法。\n\n相关文档：\n\n* [对象的值的验证](Documentation/ValueValidate.md)\n\n## 程序集 XNetEx.ObjectModel\n\n提供部分组件模型类型的实现，包括：\n\n* 属性更改通知 `System.ComponentModel.INotifyPropertyChanged`\n  * `XNetEx.ComponentModel.ObservableDataObject`\n* 数据实体验证 `System.ComponentModel.INotifyDataErrorInfo`\n  * `XNetEx.ComponentModel.ObservableValidDataObject`\n* 命令 `System.Windows.Input.ICommand`\n  * `XNetEx.Windows.Input.DelegateCommand`\n\n此外还为枚举类型提供了特定的的视图类型，包括：\n\n* 枚举列表视图 `XNetEx.ComponentModel.EnumListView\u003cTEnum\u003e`\n* 枚举向量视图 `XNetEx.ComponentModel.EnumVectorView\u003cTEnum\u003e`\n* 位域枚举向量视图 `XNetEx.ComponentModel.EnumFlagsVectorView\u003cTEnum\u003e`\n\n相关文档：\n\n* [属性更改通知接口实现框架](Documentation/ObservableObject.md)\n* [属性更改通知实现方式比较](Documentation/ObservableObjectCompare.md)\n\n## 程序集 XNetEx.ObjectModel.ObservableProxy\n\n提供以反射发出 `System.Reflection.Emit` 构造的属性更改通知类型 `System.ComponentModel.INotifyPropertyChanged`。\n\n相关文档：\n\n* [属性更改通知接口实现框架](Documentation/ObservableObject.md)\n* [属性更改通知实现方式比较](Documentation/ObservableObjectCompare.md)\n* [属性更改通知类型提供对象](Documentation/ObservableTypeProvider.md)\n\n## 程序集 XNetEx.Reflection\n\n提供与动态类型生成和动态方法相关的扩展方法，并提供应用以上技术实现的快速动态调用的扩展方法。\n\n核心 API 类型：\n\n* IL 指令发出扩展 `XNetEx.Reflection.Emit.ILGeneratorExtensions`\n* 动态类型定义扩展 `XNetEx.Reflection.Emit.TypeBuilderExtensions`\n* 类型成员动态调用委托创建 `XNetEx.Reflection.MemberDelegateExtensions`\n* 类型成员快速动态调用扩展 `XNetEx.Reflection.MemberFastInvokeExtensions`\n\n## 程序集 XNetEx.Reflection.DispatchProxy\n\n提供转发代理类型 `System.Reflection.DispatchProxy` 基于委托的简易实现。\n\n## 程序集 XNetEx.Reflection.DynamicProxy\n\n提供以反射发出 `System.Reflection.Emit` 构造的动态代理类型。\n\n方法调用包装为通用静态委托 `XNetEx.Reflection.MethodDelegate`，保持动态代理灵活性的同时避免了反射调用的低效率问题。\n\n核心 API 类型：\n\n* 直接代理类型 `XNetEx.Reflection.DirectProxyTypeProvider`\n* 包装代理类型 `XNetEx.Reflection.WrapProxyTypeProvider`\n\n## 程序集 XNetEx.Primitives\n\n提供框架原生值类型的补充类型，包括：\n\n* 24 位有符号整数 `XNetEx.Int24`\n* 24 位无符号整数 `XNetEx.UInt24`\n* 半精度浮点数 `XNetEx.Half`\n\n## 程序集 XNetEx.Primitives.Unions\n\n提供框架原生值类型的联合 `union`，包括：\n\n* 8 位数据类型联合 `XNetEx.Unions.ByteUnion`: `Byte`, `SByte`, `Boolean`\n* 16 位数据类型联合 `XNetEx.Unions.WordUnion`: `Int16`, `UInt16`, `Char`\n* 32 位数据类型联合 `XNetEx.Unions.DWordUnion`: `Int32`, `UInt32`, `Single`\n* 64 位数据类型联合 `XNetEx.Unions.QWordUnion`: `Int64`, `UInt64`, `Double`\n* 指针或句柄类型联合 `XNetEx.Unions.HandleUnion`: `IntPtr`, `UIntPtr`, `Void*`\n\n## 程序集 XNetEx.Win32\n\nWin32 相关，目前包含的命名空间：\n\n* `XNetEx.Win32`\n* `XNetEx.Win32.Profiles`\n\n## 程序集 XNetEx.Windows\n\nWPF 相关，目前包含的命名空间：\n\n* `XNetEx.Windows.Controls`\n* `XNetEx.Windows.Data`\n\nXAML 命名空间：\n\n``` XML\n\u003cWindow xmlns:xnetex=\"http://dev.x-stars.org/dotnet/extensions\"/\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx-stars%2Fdotnetextensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fx-stars%2Fdotnetextensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx-stars%2Fdotnetextensions/lists"}