-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: code cleanup, project update, include readme, etc.
- Loading branch information
1 parent
7841a4f
commit acd3f5b
Showing
18 changed files
with
1,389 additions
and
1,195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# top-most EditorConfig file | ||
root = true | ||
|
||
# charset | ||
[*] | ||
charset = utf-8 | ||
|
||
# lines | ||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
max_line_length = off | ||
|
||
# tabs | ||
[*] | ||
indent_style = space | ||
indent_size = 4 | ||
tab_width = 4 | ||
|
||
[*.{csproj,props,resx,targets}] | ||
indent_style = space | ||
indent_size = 2 | ||
tab_width = 2 | ||
|
||
# rules | ||
# CA2225: Operator overloads have named alternates | ||
dotnet_diagnostic.CA2225.severity = none | ||
# CA1716: Identifiers should not match keywords | ||
dotnet_diagnostic.CA1716.severity = none | ||
# CA1054: URI-like parameters should not be strings | ||
dotnet_diagnostic.CA1054.severity = none | ||
# CA1056: URI-like properties should not be strings | ||
dotnet_diagnostic.CA1056.severity = none | ||
# CA1062: Validate arguments of public methods | ||
dotnet_diagnostic.CA1062.severity = none | ||
# CA1033: Interface methods should be callable by child types | ||
dotnet_diagnostic.CA1033.severity = none | ||
# CA1034: Nested types should not be visible | ||
dotnet_diagnostic.CA1034.severity = none | ||
# CA1308: Normalize strings to uppercase | ||
dotnet_diagnostic.CA1308.severity = none | ||
# CA1805: Do not initialize unnecessarily | ||
dotnet_diagnostic.CA1805.severity = none | ||
# CA1031: Do not catch general exception types | ||
dotnet_diagnostic.CA1031.severity = none | ||
# CA1714: Flags enums should have plural names | ||
dotnet_diagnostic.CA1714.severity = none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,21 @@ | ||
<Project> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="GitInfo" Version="2.1.2"> | ||
<PrivateAssets>All</PrivateAssets> | ||
</PackageReference> | ||
<PackageReference Include="MinVer" Version="2.5.0"> | ||
<PrivateAssets>All</PrivateAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
<!-- Copy package to local packages repository --> | ||
<Target Name="CopyPackage" AfterTargets="Pack" Condition="exists('$(SolutionDir)..\LocalPackages\')"> | ||
<Message Text="Copy '$(PackageOutputPath)$(PackageId).$(PackageVersion).nupkg' to '$(SolutionDir)..\LocalPackages\'" Importance="high"/> | ||
<Copy | ||
<Target Name="CopyPackage" AfterTargets="Pack" Condition="exists('$(MSBuildThisFileDirectory)..\LocalPackages\')"> | ||
<Message Text="Copy '$(PackageOutputPath)$(PackageId).$(PackageVersion).nupkg' to '$(MSBuildThisFileDirectory)..\LocalPackages\'" Importance="high"/> | ||
<Copy | ||
SourceFiles="$(PackageOutputPath)$(PackageId).$(PackageVersion).nupkg" | ||
DestinationFolder="$(SolutionDir)..\LocalPackages\" | ||
ContinueOnError="false" /> | ||
<Message Text="Delete local package folder 'C:\Users\User\.nuget\packages\$(PackageId)\$(PackageVersion)'" Importance="high"/> | ||
<RemoveDir Directories="C:\Users\User\.nuget\packages\$(PackageId)\$(PackageVersion)" /> | ||
DestinationFolder="$(MSBuildThisFileDirectory)..\LocalPackages\" | ||
ContinueOnError="false" /> | ||
|
||
<Message Text="Delete local package folder 'C:\Users\$([System.Environment]::UserName)\.nuget\packages\$(PackageId)\$(PackageVersion)'" Importance="high"/> | ||
<RemoveDir Directories="C:\Users\$([System.Environment]::UserName)\.nuget\packages\$(PackageId)\$(PackageVersion)" /> | ||
</Target> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 Tag Bites | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<Description>Container and manager to simplify exports lookup.</Description> | ||
<PackageTags></PackageTags> | ||
<Description>A .NET export container and manager designed to simplify access to exported types. Well suited for plugin integration.</Description> | ||
<PackageTags>.NET; export; container; MEF</PackageTags> | ||
|
||
<PackageProjectUrl>https://www.tagbites.com/</PackageProjectUrl> | ||
<PackageProjectUrl>https://github.com/TagBites/TagBites.ComponentModel.Composition</PackageProjectUrl> | ||
<PackageIconUrl></PackageIconUrl> | ||
|
||
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance> | ||
<PackageLicenseExpression>MIT</PackageLicenseExpression> | ||
|
||
<RepositoryType>git</RepositoryType> | ||
<RepositoryUrl>https://github.com/TagBites/TagBites.ComponentModel.Composition.git</RepositoryUrl> | ||
|
||
<PackageReadmeFile>README.md</PackageReadmeFile> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,44 @@ | ||
# TBS.ComponentModel.Composition | ||
|
||
Contains export container and manager to simplify exports lookup. It also supports cache to speedup app startup without need to load and analyse all assemblies. | ||
[![Nuget](https://img.shields.io/nuget/v/TagBites.ComponentModel.Composition.svg)](https://www.nuget.org/packages/TagBites.ComponentModel.Composition/) | ||
[![License](http://img.shields.io/github/license/TagBites/TagBites.ComponentModel.Composition)](https://github.com/TagBites/TagBites.ComponentModel.Composition/blob/master/LICENSE) | ||
|
||
A .NET export container and manager designed to simplify access to exported types. Well suited for plugin integration. Supports caching to speed up application startup, eliminating the necessity to load and analyze all assemblies. | ||
|
||
## Example | ||
|
||
```csharp | ||
internal static class Program | ||
{ | ||
public static ExportComponentManager ComponentManager { get; set; } | ||
|
||
|
||
static void Main() | ||
{ | ||
// Load | ||
ComponentManager = new ExportComponentManager(); | ||
|
||
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) | ||
ComponentManager.LoadAssembly(assembly); | ||
|
||
// Test | ||
foreach (var testInstance in ComponentManager.GetExportInstances<ITest>()) | ||
Console.WriteLine(testInstance.GetType().Name); | ||
|
||
// Output: | ||
// Test1 | ||
// Test2 | ||
} | ||
} | ||
|
||
public interface ITest | ||
{ } | ||
|
||
[Export(typeof(ITest))] | ||
internal class Test1 : ITest | ||
{ } | ||
|
||
[Export(typeof(ITest))] | ||
internal class Test2 : ITest | ||
{ } | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.