T.Molodoy.SharpExtensions
0.0.47
See the version list below for details.
dotnet add package T.Molodoy.SharpExtensions --version 0.0.47
NuGet\Install-Package T.Molodoy.SharpExtensions -Version 0.0.47
<PackageReference Include="T.Molodoy.SharpExtensions" Version="0.0.47" />
<PackageVersion Include="T.Molodoy.SharpExtensions" Version="0.0.47" />
<PackageReference Include="T.Molodoy.SharpExtensions" />
paket add T.Molodoy.SharpExtensions --version 0.0.47
#r "nuget: T.Molodoy.SharpExtensions, 0.0.47"
#:package T.Molodoy.SharpExtensions@0.0.47
#addin nuget:?package=T.Molodoy.SharpExtensions&version=0.0.47
#tool nuget:?package=T.Molodoy.SharpExtensions&version=0.0.47
Sharp Extensions
Kotlin-like extensions for C#.
AutoGlobalUsingStatic
Mark a public class or struct with [SharpExtensions.AutoGlobalUsingStatic] to automatically
generate global using static global::YourNamespace.YourClass; in projects referencing
its assembly, as well as in the annotated type's own assembly.
The Sharp Extensions NuGet package includes the source generator;
consuming projects need C# 10 or newer. Referencing a DLL alone does not load analyzers:
install the NuGet package in the consuming project, or reference
SharpExtensions.CodeGen as an analyzer when using project references.
The generator writes GlobalUsings.g.cs, includes accessible nested types, and skips
open generic types and inaccessible types. The annotation is also inherited by derived types.
Type aliases
using SharpExtensions.Attributes;
[AutoGlobalUsingAs("Model")]
public class MyModel { }
[AutoExternalAlias("System.Text.StringBuilder", "Builder")]
public class ExternalAliases { }
The generator writes global using Model = global::MyModel; and
global using Builder = global::System.Text.StringBuilder; to GlobalUsingAliases.g.cs.
It scans the current assembly and globally referenced assemblies. External type
names may use global:: and nested types may use dots or metadata + separators.
Missing, ambiguous, inaccessible and open generic types are skipped. Internal types
are included only when accessible from the consuming assembly. Conflicting aliases
are skipped; repeated aliases pointing to the same type are emitted once.
As with static imports, C# 10 or newer is required.
Unity / NuGetForUnity
Install T.Molodoy.SharpExtensions using NuGetForUnity. CodeGen is bundled in the
same package under analyzers/dotnet/roslyn4.3/cs; no separate package is needed.
NuGetForUnity automatically assigns the RoslynAnalyzer label and disables runtime
loading of the generator. Included Unity importer metadata also disables runtime
loading before the package is processed. Keep NuGetForUnity's
FixRoslynAnalyzerImportSettings setting enabled.
Use a current NuGetForUnity version (4.3 or newer). Its Roslyn compatibility selection enables this generator on Unity 2022.3.12f1 and newer. Generating global static imports additionally requires the consuming assembly to compile with C# 10 or newer; the generator does not change Unity's language settings and skips generation on C# 9 and older.
Release package:
dotnet pack "Sharp Extensions/Sharp Extensions.csproj" -c Release -o artifacts/nuget
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- No dependencies.
NuGet packages (4)
Showing the top 4 NuGet packages that depend on T.Molodoy.SharpExtensions:
| Package | Downloads |
|---|---|
|
T.Molodoy.StableCollections
Java-like collections for C#. |
|
|
T.Molodoy.Compose.Net
.NET implementation of Compose. |
|
|
T.Molodoy.Compose.Net.Navigation
Navigation library for Compose.Net. |
|
|
T.Molodoy.MviCore.Net
A simplified single-threaded MVICore implementation built on R3. |
GitHub repositories
This package is not used by any popular GitHub repositories.