mirror of
https://github.com/adusak/Dependify.git
synced 2026-01-11 11:50:32 +01:00
Initial commit of Dependify
This commit is contained in:
54
Dependify.sln
Normal file
54
Dependify.sln
Normal file
@@ -0,0 +1,54 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.26124.0
|
||||
MinimumVisualStudioVersion = 15.0.26124.0
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{782FBD9E-6CF9-4521-ADE7-DCEC2D916FDF}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dependify", "src\Dependify\Dependify.csproj", "{011819CE-229A-48D1-99A7-25A6D5DD5CA4}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dependify.Test", "src\Dependify.Test\Dependify.Test.csproj", "{BD19041B-FC13-456A-9F3E-7823B9EF5E70}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{011819CE-229A-48D1-99A7-25A6D5DD5CA4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{011819CE-229A-48D1-99A7-25A6D5DD5CA4}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{011819CE-229A-48D1-99A7-25A6D5DD5CA4}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{011819CE-229A-48D1-99A7-25A6D5DD5CA4}.Debug|x64.Build.0 = Debug|x64
|
||||
{011819CE-229A-48D1-99A7-25A6D5DD5CA4}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{011819CE-229A-48D1-99A7-25A6D5DD5CA4}.Debug|x86.Build.0 = Debug|x86
|
||||
{011819CE-229A-48D1-99A7-25A6D5DD5CA4}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{011819CE-229A-48D1-99A7-25A6D5DD5CA4}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{011819CE-229A-48D1-99A7-25A6D5DD5CA4}.Release|x64.ActiveCfg = Release|x64
|
||||
{011819CE-229A-48D1-99A7-25A6D5DD5CA4}.Release|x64.Build.0 = Release|x64
|
||||
{011819CE-229A-48D1-99A7-25A6D5DD5CA4}.Release|x86.ActiveCfg = Release|x86
|
||||
{011819CE-229A-48D1-99A7-25A6D5DD5CA4}.Release|x86.Build.0 = Release|x86
|
||||
{BD19041B-FC13-456A-9F3E-7823B9EF5E70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{BD19041B-FC13-456A-9F3E-7823B9EF5E70}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{BD19041B-FC13-456A-9F3E-7823B9EF5E70}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{BD19041B-FC13-456A-9F3E-7823B9EF5E70}.Debug|x64.Build.0 = Debug|x64
|
||||
{BD19041B-FC13-456A-9F3E-7823B9EF5E70}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{BD19041B-FC13-456A-9F3E-7823B9EF5E70}.Debug|x86.Build.0 = Debug|x86
|
||||
{BD19041B-FC13-456A-9F3E-7823B9EF5E70}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{BD19041B-FC13-456A-9F3E-7823B9EF5E70}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{BD19041B-FC13-456A-9F3E-7823B9EF5E70}.Release|x64.ActiveCfg = Release|x64
|
||||
{BD19041B-FC13-456A-9F3E-7823B9EF5E70}.Release|x64.Build.0 = Release|x64
|
||||
{BD19041B-FC13-456A-9F3E-7823B9EF5E70}.Release|x86.ActiveCfg = Release|x86
|
||||
{BD19041B-FC13-456A-9F3E-7823B9EF5E70}.Release|x86.Build.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{011819CE-229A-48D1-99A7-25A6D5DD5CA4} = {782FBD9E-6CF9-4521-ADE7-DCEC2D916FDF}
|
||||
{BD19041B-FC13-456A-9F3E-7823B9EF5E70} = {782FBD9E-6CF9-4521-ADE7-DCEC2D916FDF}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
209
Dependify.sln.DotSettings
Normal file
209
Dependify.sln.DotSettings
Normal file
@@ -0,0 +1,209 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:Boolean x:Key="/Default/CodeInspection/CodeAnnotations/NamespacesWithAnnotations/=ClientUi_002EAnnotations/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeInspection/ExcludedFiles/FileMasksToSkip/=_002A_002Emin_002Ejs/@EntryIndexedValue">True</s:Boolean>
|
||||
|
||||
<s:String x:Key="/Default/CodeStyle/CodeCleanup/Profiles/=FlexiSpooler/@EntryIndexedValue"><?xml version="1.0" encoding="utf-16"?><Profile name="FlexiSpooler"><RemoveCodeRedundancies>True</RemoveCodeRedundancies><CSMakeFieldReadonly>True</CSMakeFieldReadonly><CSMakeAutoPropertyGetOnly>True</CSMakeAutoPropertyGetOnly><CSEnforceVarKeywordUsageSettings>True</CSEnforceVarKeywordUsageSettings><CSOptimizeUsings><OptimizeUsings>True</OptimizeUsings><EmbraceInRegion>False</EmbraceInRegion><RegionName></RegionName></CSOptimizeUsings><CSShortenReferences>True</CSShortenReferences><CSReformatCode>True</CSReformatCode><CSharpFormatDocComments>True</CSharpFormatDocComments></Profile></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeCleanup/SilentCleanupProfile/@EntryValue">FlexiSpooler</s:String>
|
||||
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ACCESSOR_DECLARATION_BRACES/@EntryValue">END_OF_LINE</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ACCESSOR_OWNER_DECLARATION_BRACES/@EntryValue">END_OF_LINE</s:String>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTILINE_BINARY_EXPRESSIONS_CHAIN/@EntryValue">False</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALLOW_COMMENT_AFTER_LBRACE/@EntryValue">True</s:Boolean>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ANONYMOUS_METHOD_DECLARATION_BRACES/@EntryValue">END_OF_LINE</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/CASE_BLOCK_BRACES/@EntryValue">END_OF_LINE</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/EMPTY_BLOCK_STYLE/@EntryValue">TOGETHER_SAME_LINE</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_FIXED_BRACES_STYLE/@EntryValue">ALWAYS_REMOVE</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_FOR_BRACES_STYLE/@EntryValue">ALWAYS_REMOVE</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_FOREACH_BRACES_STYLE/@EntryValue">ALWAYS_REMOVE</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_IFELSE_BRACES_STYLE/@EntryValue">ALWAYS_REMOVE</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_USING_BRACES_STYLE/@EntryValue">ALWAYS_REMOVE</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_WHILE_BRACES_STYLE/@EntryValue">ALWAYS_REMOVE</s:String>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/INDENT_NESTED_FIXED_STMT/@EntryValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/INDENT_NESTED_USINGS_STMT/@EntryValue">True</s:Boolean>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/INITIALIZER_BRACES/@EntryValue">END_OF_LINE</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/INVOCABLE_DECLARATION_BRACES/@EntryValue">END_OF_LINE</s:String>
|
||||
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_BLANK_LINES_IN_CODE/@EntryValue">1</s:Int64>
|
||||
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_BLANK_LINES_IN_DECLARATIONS/@EntryValue">1</s:Int64>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/OTHER_BRACES/@EntryValue">END_OF_LINE</s:String>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_CATCH_ON_NEW_LINE/@EntryValue">False</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_ELSE_ON_NEW_LINE/@EntryValue">False</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_FIELD_ATTRIBUTE_ON_SAME_LINE/@EntryValue">False</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_FINALLY_ON_NEW_LINE/@EntryValue">False</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_SIMPLE_ACCESSOR_ATTRIBUTE_ON_SAME_LINE/@EntryValue">False</s:Boolean>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SIMPLE_EMBEDDED_STATEMENT_STYLE/@EntryValue">LINE_BREAK</s:String>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_AFTER_TYPECAST_PARENTHESES/@EntryValue">False</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_AROUND_ARROW_OP/@EntryValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_AROUND_MULTIPLICATIVE_OP/@EntryValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_BEFORE_COLON_IN_CASE/@EntryValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_BEFORE_SIZEOF_PARENTHESES/@EntryValue">False</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_BEFORE_TYPEOF_PARENTHESES/@EntryValue">False</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_WITHIN_SINGLE_LINE_ARRAY_INITIALIZER_BRACES/@EntryValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/STICK_COMMENT/@EntryValue">False</s:Boolean>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/TYPE_DECLARATION_BRACES/@EntryValue">END_OF_LINE</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_FOR_STMT_HEADER_STYLE/@EntryValue">WRAP_IF_LONG</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_CHAINED_METHOD_CALLS/@EntryValue">WRAP_IF_LONG</s:String>
|
||||
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_LIMIT/@EntryValue">150</s:Int64>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_LINES/@EntryValue">False</s:Boolean>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_LINQ_EXPRESSIONS/@EntryValue">WRAP_IF_LONG</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_MULTIPLE_DECLARATION_STYLE/@EntryValue">WRAP_IF_LONG</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_MULTIPLE_TYPE_PARAMEER_CONSTRAINTS_STYLE/@EntryValue">WRAP_IF_LONG</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_OBJECT_AND_COLLECTION_INITIALIZER_STYLE/@EntryValue">WRAP_IF_LONG</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_TERNARY_EXPR_STYLE/@EntryValue">WRAP_IF_LONG</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/XmlDocFormatter/IndentSubtags/@EntryValue">RemoveIndent</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/XmlDocFormatter/IndentTagContent/@EntryValue">RemoveIndent</s:String>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/XmlDocFormatter/TagSpaceBeforeHeaderEnd1/@EntryValue">False</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/XmlDocFormatter/WrapLongLines/@EntryValue">False</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/XmlDocFormatter/WRAP_LINES/@EntryValue">False</s:Boolean>
|
||||
<s:String x:Key="/Default/CodeStyle/CSharpFileLayoutPatterns/Pattern/@EntryValue"><?xml version="1.0" encoding="utf-16"?>
|
||||
<Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns">
|
||||
<TypePattern DisplayName="COM interfaces or structs">
|
||||
<TypePattern.Match>
|
||||
<Or>
|
||||
<And>
|
||||
<Kind Is="Interface" />
|
||||
<Or>
|
||||
<HasAttribute Name="System.Runtime.InteropServices.InterfaceTypeAttribute" />
|
||||
<HasAttribute Name="System.Runtime.InteropServices.ComImport" />
|
||||
</Or>
|
||||
</And>
|
||||
<Kind Is="Struct" />
|
||||
</Or>
|
||||
</TypePattern.Match>
|
||||
</TypePattern>
|
||||
<TypePattern DisplayName="NUnit Test Fixtures" RemoveRegions="All">
|
||||
<TypePattern.Match>
|
||||
<And>
|
||||
<Kind Is="Class" />
|
||||
<HasAttribute Name="NUnit.Framework.TestFixtureAttribute" Inherited="True" />
|
||||
<HasAttribute Name="NUnit.Framework.TestCaseFixtureAttribute" Inherited="True" />
|
||||
</And>
|
||||
</TypePattern.Match>
|
||||
<Entry DisplayName="Setup/Teardown Methods">
|
||||
<Entry.Match>
|
||||
<And>
|
||||
<Kind Is="Method" />
|
||||
<Or>
|
||||
<HasAttribute Name="NUnit.Framework.SetUpAttribute" Inherited="True" />
|
||||
<HasAttribute Name="NUnit.Framework.TearDownAttribute" Inherited="True" />
|
||||
<HasAttribute Name="NUnit.Framework.FixtureSetUpAttribute" Inherited="True" />
|
||||
<HasAttribute Name="NUnit.Framework.FixtureTearDownAttribute" Inherited="True" />
|
||||
</Or>
|
||||
</And>
|
||||
</Entry.Match>
|
||||
</Entry>
|
||||
<Entry DisplayName="All other members" />
|
||||
<Entry Priority="100" DisplayName="Test Methods">
|
||||
<Entry.Match>
|
||||
<And>
|
||||
<Kind Is="Method" />
|
||||
<HasAttribute Name="NUnit.Framework.TestAttribute" />
|
||||
</And>
|
||||
</Entry.Match>
|
||||
<Entry.SortBy>
|
||||
<Name />
|
||||
</Entry.SortBy>
|
||||
</Entry>
|
||||
</TypePattern>
|
||||
<TypePattern DisplayName="Default Pattern">
|
||||
<Entry DisplayName="Nested Types">
|
||||
<Entry.Match>
|
||||
<Kind Is="Type" />
|
||||
</Entry.Match>
|
||||
</Entry>
|
||||
<Entry Priority="100" DisplayName="Public Delegates">
|
||||
<Entry.Match>
|
||||
<And>
|
||||
<Access Is="Public" />
|
||||
<Kind Is="Delegate" />
|
||||
</And>
|
||||
</Entry.Match>
|
||||
<Entry.SortBy>
|
||||
<Name />
|
||||
</Entry.SortBy>
|
||||
</Entry>
|
||||
<Entry Priority="100" DisplayName="Public Enums">
|
||||
<Entry.Match>
|
||||
<And>
|
||||
<Access Is="Public" />
|
||||
<Kind Is="Enum" />
|
||||
</And>
|
||||
</Entry.Match>
|
||||
<Entry.SortBy>
|
||||
<Name />
|
||||
</Entry.SortBy>
|
||||
</Entry>
|
||||
<Entry DisplayName="Static Fields and Constants">
|
||||
<Entry.Match>
|
||||
<Or>
|
||||
<Kind Is="Constant" />
|
||||
<And>
|
||||
<Kind Is="Field" />
|
||||
<Static />
|
||||
</And>
|
||||
</Or>
|
||||
</Entry.Match>
|
||||
<Entry.SortBy>
|
||||
<Kind Order="Constant Field" />
|
||||
</Entry.SortBy>
|
||||
</Entry>
|
||||
<Entry DisplayName="Fields">
|
||||
<Entry.Match>
|
||||
<And>
|
||||
<Kind Is="Field" />
|
||||
<Not>
|
||||
<Static />
|
||||
</Not>
|
||||
</And>
|
||||
</Entry.Match>
|
||||
<Entry.SortBy>
|
||||
<Readonly />
|
||||
<Name />
|
||||
</Entry.SortBy>
|
||||
</Entry>
|
||||
<Entry DisplayName="Properties, Indexers">
|
||||
<Entry.Match>
|
||||
<Or>
|
||||
<Kind Is="Property" />
|
||||
<Kind Is="Indexer" />
|
||||
</Or>
|
||||
</Entry.Match>
|
||||
</Entry>
|
||||
<Entry DisplayName="Constructors">
|
||||
<Entry.Match>
|
||||
<Kind Is="Constructor" />
|
||||
</Entry.Match>
|
||||
<Entry.SortBy>
|
||||
<Static />
|
||||
</Entry.SortBy>
|
||||
</Entry>
|
||||
<Entry Priority="100" DisplayName="Interface Implementations">
|
||||
<Entry.Match>
|
||||
<And>
|
||||
<Kind Is="Member" />
|
||||
<ImplementsInterface />
|
||||
</And>
|
||||
</Entry.Match>
|
||||
<Entry.SortBy>
|
||||
<ImplementsInterface Immediate="True" />
|
||||
</Entry.SortBy>
|
||||
</Entry>
|
||||
<Entry DisplayName="All other members" />
|
||||
</TypePattern>
|
||||
</Patterns></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateConstants/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticFields/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticReadonly/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=bb3a058d_002D2c91_002D42a0_002D8428_002De9c9cc4b488a/@EntryIndexedValue"><Policy><Descriptor Staticness="Static, Instance" AccessRightKinds="Protected" Description=""><ElementKinds><Kind Name="FIELD" /><Kind Name="READONLY_FIELD" /><Kind Name="CONSTANT_FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></Policy></s:String>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpAttributeForSingleLineMethodUpgrade/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAddAccessorOwnerDeclarationBracesMigration/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAlwaysTreatStructAsNotReorderableMigration/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateThisQualifierSettings/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002EXml_002ECodeStyle_002EFormatSettingsUpgrade_002EXmlMoveToCommonFormatterSettingsUpgrade/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EUnitTestFramework_002ESettings_002EMigrations_002ERemoveBuildPolicyAlwaysMigration/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/Environment/UnitTesting/SaveSessionState/@EntryValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/Environment/UnitTesting/SeparateAppDomainPerAssembly/@EntryValue">False</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/Environment/UnitTesting/ShadowCopy/@EntryValue">False</s:Boolean>
|
||||
<s:String x:Key="/Default/Housekeeping/UnitTestingMru/UnitTestSessionDefault/PlatformType/@EntryValue">x64</s:String>
|
||||
<s:String x:Key="/Default/Housekeeping/UnitTestingMru/UnitTestSessionDefault/PlatformVersion/@EntryValue">v4_5</s:String></wpf:ResourceDictionary>
|
||||
5
global.json
Normal file
5
global.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"sdk": {
|
||||
"version": "2.0.0"
|
||||
}
|
||||
}
|
||||
67
src/Dependify.Test/AutoRegisterTestCases.cs
Normal file
67
src/Dependify.Test/AutoRegisterTestCases.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
using System;
|
||||
using Dependify;
|
||||
using Dependify.Attributes;
|
||||
using ShouldRegisterScoped;
|
||||
using ShouldRegisterSingleton;
|
||||
using ShouldRegisterTransient;
|
||||
|
||||
public interface IInterface { }
|
||||
|
||||
public interface IInterface2 { }
|
||||
|
||||
namespace ShouldRegisterTransient {
|
||||
[RegisterTransient]
|
||||
public class ImplementationTransient : IInterface { }
|
||||
}
|
||||
|
||||
namespace ShouldRegisterScoped {
|
||||
[RegisterScoped]
|
||||
public class ImplementationScoped : IInterface { }
|
||||
}
|
||||
|
||||
namespace ShouldRegisterSingleton {
|
||||
[RegisterSingleton]
|
||||
public class ImplementationSingleton : IInterface { }
|
||||
}
|
||||
|
||||
namespace ShouldRegisterOneTransient {
|
||||
[RegisterTransient(typeof(IInterface2))]
|
||||
public class ImplementationTransientOneInterface : IInterface, IInterface2 { }
|
||||
}
|
||||
|
||||
namespace ShouldRegisterOneScoped {
|
||||
[RegisterScoped(typeof(IInterface2))]
|
||||
public class ImplementationScopedOneInterface : IInterface, IInterface2 { }
|
||||
}
|
||||
|
||||
namespace ShouldRegisterOneSingleton {
|
||||
[RegisterSingleton(typeof(IInterface2))]
|
||||
public class ImplementationSingletonOneInterface : IInterface, IInterface2 { }
|
||||
}
|
||||
|
||||
namespace ShouldRegisterFactoryTransient {
|
||||
public class TransientFactory {
|
||||
[RegisterTransientFactory(typeof(IInterface))]
|
||||
public static ImplementationTransient CreateImplementationTransient(IServiceProvider provider) {
|
||||
return new ImplementationTransient();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace ShouldRegisterFactoryScoped {
|
||||
public class ScopedFactory {
|
||||
[RegisterScopedFactory(typeof(IInterface))]
|
||||
public static ImplementationScoped CreateImplementationTransient(IServiceProvider provider) {
|
||||
return new ImplementationScoped();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace ShouldRegisterFactorySingleton {
|
||||
public class SingletonFactory {
|
||||
[RegisterSingletonFactory(typeof(IInterface))]
|
||||
public static ImplementationSingleton CreateImplementationTransient(IServiceProvider provider) {
|
||||
return new ImplementationSingleton();
|
||||
}
|
||||
}
|
||||
}
|
||||
45
src/Dependify.Test/AutoRegisterTests.cs
Normal file
45
src/Dependify.Test/AutoRegisterTests.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using NUnit.Framework;
|
||||
using ShouldRegisterOneScoped;
|
||||
using ShouldRegisterOneSingleton;
|
||||
using ShouldRegisterOneTransient;
|
||||
using ShouldRegisterScoped;
|
||||
using ShouldRegisterSingleton;
|
||||
using ShouldRegisterTransient;
|
||||
|
||||
namespace Dependify.Test {
|
||||
[TestFixture]
|
||||
public class RegisterAttributeTests {
|
||||
[TestCase(nameof(ShouldRegisterTransient), typeof(ImplementationTransient), typeof(IInterface), ServiceLifetime.Transient)]
|
||||
[TestCase(nameof(ShouldRegisterSingleton), typeof(ImplementationSingleton), typeof(IInterface), ServiceLifetime.Singleton)]
|
||||
[TestCase(nameof(ShouldRegisterScoped), typeof(ImplementationScoped), typeof(IInterface), ServiceLifetime.Scoped)]
|
||||
[TestCase(nameof(ShouldRegisterOneTransient), typeof(ImplementationTransientOneInterface), typeof(IInterface2), ServiceLifetime.Transient)]
|
||||
[TestCase(nameof(ShouldRegisterOneSingleton), typeof(ImplementationSingletonOneInterface), typeof(IInterface2), ServiceLifetime.Singleton)]
|
||||
[TestCase(nameof(ShouldRegisterOneScoped), typeof(ImplementationScopedOneInterface), typeof(IInterface2), ServiceLifetime.Scoped)]
|
||||
public void RegisterAttribute_RegistersClass_WhenDefined(string @namespace, Type classType, Type interfaceType, ServiceLifetime serviceLifetime) {
|
||||
IServiceCollection services = new ServiceCollection();
|
||||
services.AutoRegister(@namespace);
|
||||
var service = services.First();
|
||||
Assert.AreEqual(1, services.Count);
|
||||
Assert.AreEqual(interfaceType, service.ServiceType);
|
||||
Assert.AreEqual(classType, service.ImplementationType);
|
||||
Assert.AreEqual(serviceLifetime, service.Lifetime);
|
||||
}
|
||||
|
||||
|
||||
[TestCase(nameof(ShouldRegisterFactoryTransient), typeof(ImplementationTransient), typeof(IInterface), ServiceLifetime.Transient)]
|
||||
[TestCase(nameof(ShouldRegisterFactorySingleton), typeof(ImplementationSingleton), typeof(IInterface), ServiceLifetime.Singleton)]
|
||||
[TestCase(nameof(ShouldRegisterFactoryScoped), typeof(ImplementationScoped), typeof(IInterface), ServiceLifetime.Scoped)]
|
||||
public void RegisterFactoryAttribute_RegistersFactoryForInterface_WhenDefined(string @namespace, Type classType, Type interfaceType, ServiceLifetime serviceLifetime) {
|
||||
IServiceCollection services = new ServiceCollection();
|
||||
services.AutoRegister(@namespace);
|
||||
var service = services.First();
|
||||
Assert.AreEqual(1, services.Count);
|
||||
Assert.AreEqual(interfaceType, service.ServiceType);
|
||||
Assert.NotNull(service.ImplementationFactory);
|
||||
Assert.AreEqual(serviceLifetime, service.Lifetime);
|
||||
}
|
||||
}
|
||||
}
|
||||
16
src/Dependify.Test/Dependify.Test.csproj
Normal file
16
src/Dependify.Test/Dependify.Test.csproj
Normal file
@@ -0,0 +1,16 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="dotnet-test-nunit" Version="3.4.0-beta-3" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.0.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0-preview-20170628-02" />
|
||||
<PackageReference Include="NUnit" Version="3.8.1" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="3.8.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Dependify\Dependify.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
15
src/Dependify/Attributes/Register.cs
Normal file
15
src/Dependify/Attributes/Register.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Dependify.Attributes {
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public abstract class Register : Attribute {
|
||||
public IEnumerable<Type> InterfaceTypes { get; }
|
||||
|
||||
protected Register() { }
|
||||
|
||||
protected Register(params Type[] interfaceTypes) {
|
||||
InterfaceTypes = interfaceTypes;
|
||||
}
|
||||
}
|
||||
}
|
||||
12
src/Dependify/Attributes/RegisterFactory.cs
Normal file
12
src/Dependify/Attributes/RegisterFactory.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
|
||||
namespace Dependify.Attributes {
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public abstract class RegisterFactory : Attribute {
|
||||
public Type ReturnType { get; }
|
||||
|
||||
protected RegisterFactory(Type returnType) {
|
||||
ReturnType = returnType;
|
||||
}
|
||||
}
|
||||
}
|
||||
10
src/Dependify/Attributes/RegisterScoped.cs
Normal file
10
src/Dependify/Attributes/RegisterScoped.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
|
||||
namespace Dependify.Attributes {
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class RegisterScoped : Register {
|
||||
public RegisterScoped() { }
|
||||
|
||||
public RegisterScoped(params Type[] interfaceTypes) : base(interfaceTypes) { }
|
||||
}
|
||||
}
|
||||
8
src/Dependify/Attributes/RegisterScopedFactory.cs
Normal file
8
src/Dependify/Attributes/RegisterScopedFactory.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using System;
|
||||
|
||||
namespace Dependify.Attributes {
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public class RegisterScopedFactory : RegisterFactory {
|
||||
public RegisterScopedFactory(Type returnType) : base(returnType) { }
|
||||
}
|
||||
}
|
||||
10
src/Dependify/Attributes/RegisterSingleton.cs
Normal file
10
src/Dependify/Attributes/RegisterSingleton.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
|
||||
namespace Dependify.Attributes {
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class RegisterSingleton : Register {
|
||||
public RegisterSingleton() { }
|
||||
|
||||
public RegisterSingleton(params Type[] interfaceTypes) : base(interfaceTypes) { }
|
||||
}
|
||||
}
|
||||
8
src/Dependify/Attributes/RegisterSingletonFactory.cs
Normal file
8
src/Dependify/Attributes/RegisterSingletonFactory.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using System;
|
||||
|
||||
namespace Dependify.Attributes {
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public class RegisterSingletonFactory : RegisterFactory {
|
||||
public RegisterSingletonFactory(Type returnType) : base(returnType) { }
|
||||
}
|
||||
}
|
||||
10
src/Dependify/Attributes/RegisterTransient.cs
Normal file
10
src/Dependify/Attributes/RegisterTransient.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
|
||||
namespace Dependify.Attributes {
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class RegisterTransient : Register {
|
||||
public RegisterTransient() { }
|
||||
|
||||
public RegisterTransient(params Type[] interfaceTypes) : base(interfaceTypes) { }
|
||||
}
|
||||
}
|
||||
8
src/Dependify/Attributes/RegisterTransientFactory.cs
Normal file
8
src/Dependify/Attributes/RegisterTransientFactory.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using System;
|
||||
|
||||
namespace Dependify.Attributes {
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public class RegisterTransientFactory : RegisterFactory {
|
||||
public RegisterTransientFactory(Type returnType) : base(returnType) { }
|
||||
}
|
||||
}
|
||||
11
src/Dependify/Dependify.csproj
Normal file
11
src/Dependify/Dependify.csproj
Normal file
@@ -0,0 +1,11 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.0.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Helpers" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
67
src/Dependify/IServiceCollectionExtensions.cs
Normal file
67
src/Dependify/IServiceCollectionExtensions.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Dependify.Attributes;
|
||||
using Dependify.Utilities;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Dependify {
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public static class IServiceCollectionExtensions {
|
||||
public static IServiceCollection AutoRegister(this IServiceCollection services) {
|
||||
var assemblies = AppDomain.CurrentDomain.GetAssemblies();
|
||||
services.AddFactories(DependifyUtils.GetFactoryMethods(assemblies));
|
||||
services.AddClasses(DependifyUtils.GetClassTypes(assemblies));
|
||||
return services;
|
||||
}
|
||||
|
||||
public static IServiceCollection AutoRegister(this IServiceCollection services, params Assembly[] assemblies) {
|
||||
services.AddFactories(DependifyUtils.GetFactoryMethods(assemblies));
|
||||
services.AddClasses(DependifyUtils.GetClassTypes(assemblies));
|
||||
return services;
|
||||
}
|
||||
|
||||
public static IServiceCollection AutoRegister(this IServiceCollection services, string @namespace) {
|
||||
var assemblies = AppDomain.CurrentDomain.GetAssemblies();
|
||||
services.AddFactories(DependifyUtils.GetFactoryMethodsFromNamespace(assemblies, @namespace));
|
||||
services.AddClasses(DependifyUtils.GetClassTypesFromNamespace(assemblies, @namespace));
|
||||
return services;
|
||||
}
|
||||
|
||||
internal static IServiceCollection AddFactories(this IServiceCollection services, IEnumerable<MethodInfo> methodInfos) {
|
||||
foreach (var methodInfo in methodInfos) {
|
||||
var factoryAttribute = methodInfo.GetCustomAttributes<RegisterFactory>(true).First();
|
||||
var factoryAttributeType = factoryAttribute.GetType();
|
||||
var factoryReturnType = factoryAttribute.ReturnType;
|
||||
|
||||
if (factoryAttributeType == typeof(RegisterTransientFactory))
|
||||
services.AddTransient(factoryReturnType, DependifyUtils.GetFactoryMethod(methodInfo));
|
||||
if (factoryAttributeType == typeof(RegisterScopedFactory))
|
||||
services.AddScoped(factoryReturnType, DependifyUtils.GetFactoryMethod(methodInfo));
|
||||
if (factoryAttributeType == typeof(RegisterSingletonFactory))
|
||||
services.AddSingleton(factoryReturnType, DependifyUtils.GetFactoryMethod(methodInfo));
|
||||
}
|
||||
return services;
|
||||
}
|
||||
|
||||
internal static void AddClasses(this IServiceCollection services, IEnumerable<Type> classTypes) {
|
||||
foreach (var classType in classTypes) {
|
||||
var classAttributes = classType.GetCustomAttributes<Register>(true);
|
||||
foreach (var classAttribute in classAttributes) {
|
||||
var registrationType = classAttribute.GetType();
|
||||
var interfaceTypes = classAttribute.InterfaceTypes == null || !classAttribute.InterfaceTypes.Any() ? classType.GetInterfaces() : classAttribute.InterfaceTypes;
|
||||
|
||||
foreach (var interfaceType in interfaceTypes) {
|
||||
if (registrationType == typeof(RegisterTransient))
|
||||
services.AddTransient(interfaceType, classType);
|
||||
if (registrationType == typeof(RegisterScoped))
|
||||
services.AddScoped(interfaceType, classType);
|
||||
if (registrationType == typeof(RegisterSingleton))
|
||||
services.AddSingleton(interfaceType, classType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
47
src/Dependify/Utilities/DependifyUtils.cs
Normal file
47
src/Dependify/Utilities/DependifyUtils.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Dependify.Attributes;
|
||||
|
||||
namespace Dependify.Utilities {
|
||||
internal static class DependifyUtils {
|
||||
internal static IEnumerable<MethodInfo> GetFactoryMethods(IEnumerable<Assembly> assemblies) {
|
||||
return assemblies
|
||||
.SelectMany(assembly => assembly.GetTypes())
|
||||
.Where(type => type.IsClass)
|
||||
.SelectMany(MethodsWithAttribute);
|
||||
}
|
||||
|
||||
internal static IEnumerable<MethodInfo> GetFactoryMethodsFromNamespace(IEnumerable<Assembly> assemblies, string @namespace) {
|
||||
return assemblies
|
||||
.SelectMany(assembly => assembly.GetTypes())
|
||||
.Where(type => type.IsClass && (type.Namespace?.StartsWith(@namespace)).GetValueOrDefault())
|
||||
.SelectMany(MethodsWithAttribute);
|
||||
}
|
||||
|
||||
private static IEnumerable<MethodInfo> MethodsWithAttribute(Type type) {
|
||||
return type.GetMethods(BindingFlags.Static | BindingFlags.Public)
|
||||
.Where(methodInfo => methodInfo.GetCustomAttributes<RegisterFactory>(true).Any());
|
||||
}
|
||||
|
||||
internal static Func<IServiceProvider, object> GetFactoryMethod(MethodInfo factoryMethodInfo) {
|
||||
if (!IsFactoryMethod(factoryMethodInfo))
|
||||
throw new ArgumentException($"{factoryMethodInfo.Name} is not a factory method. ");
|
||||
return (Func<IServiceProvider, object>)Delegate.CreateDelegate(typeof(Func<IServiceProvider, object>), factoryMethodInfo);
|
||||
|
||||
bool IsFactoryMethod(MethodInfo methodInfo) {
|
||||
var methodParameters = methodInfo.GetParameters();
|
||||
return methodParameters.Length == 1 && methodParameters.First().ParameterType == typeof(IServiceProvider);
|
||||
}
|
||||
}
|
||||
|
||||
internal static IEnumerable<Type> GetClassTypes(IEnumerable<Assembly> assemblies) {
|
||||
return assemblies.SelectMany(assembly => assembly.GetTypes()).Where(type => type.IsClass);
|
||||
}
|
||||
|
||||
internal static IEnumerable<Type> GetClassTypesFromNamespace(IEnumerable<Assembly> assemblies, string @namespace) {
|
||||
return assemblies.SelectMany(assembly => assembly.GetTypes()).Where(type => type.IsClass && (type.Namespace?.StartsWith(@namespace)).GetValueOrDefault());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user