Repository: CatLib/Core
Branch: 2.0
Commit: 98a7b1db446d
Files: 114
Total size: 544.0 KB
Directory structure:
gitextract_rz18cs7b/
├── .dist/
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── bucket.json
│ └── netstandard2.0/
│ ├── CatLib.Core.deps.json
│ └── CatLib.Core.pdb
├── .gitattributes
├── .github/
│ └── ISSUE_TEMPLATE/
│ ├── ---bug-report.md
│ ├── ---documentation-issue.md
│ ├── ---feature-request.md
│ └── ---support-question.md
├── .gitignore
├── .travis.yml
├── CHANGELOG.md
├── CatLib.Core.sln
├── LICENSE
├── README.md
├── bucket.json
├── build.ps1
└── src/
├── CatLib.Core/
│ ├── CatLib/
│ │ ├── App.cs
│ │ ├── Application.cs
│ │ ├── DebugLevel.cs
│ │ ├── Events/
│ │ │ ├── AfterBootEventArgs.cs
│ │ │ ├── AfterInitEventArgs.cs
│ │ │ ├── AfterTerminateEventArgs.cs
│ │ │ ├── ApplicationEventArgs.cs
│ │ │ ├── ApplicationEvents.cs
│ │ │ ├── BeforeBootEventArgs.cs
│ │ │ ├── BeforeInitEventArgs.cs
│ │ │ ├── BeforeTerminateEventArgs.cs
│ │ │ ├── BootingEventArgs.cs
│ │ │ ├── InitProviderEventArgs.cs
│ │ │ ├── RegisterProviderEventArgs.cs
│ │ │ └── StartCompletedEventArgs.cs
│ │ ├── Facade.cs
│ │ ├── IApplication.cs
│ │ ├── IBootstrap.cs
│ │ ├── IServiceProvider.cs
│ │ ├── ServiceProvider.cs
│ │ └── StartProcess.cs
│ ├── CatLib.Core.csproj
│ ├── Container/
│ │ ├── BindData.cs
│ │ ├── BindDataExtension.cs
│ │ ├── Bindable.cs
│ │ ├── Container.cs
│ │ ├── ContainerExtension.cs
│ │ ├── GivenData.cs
│ │ ├── IBindData.cs
│ │ ├── IBindable.cs
│ │ ├── IContainer.cs
│ │ ├── IGivenData.cs
│ │ ├── IMethodBind.cs
│ │ ├── IParams.cs
│ │ ├── InjectAttribute.cs
│ │ ├── MethodBind.cs
│ │ ├── MethodContainer.cs
│ │ ├── ParamsCollection.cs
│ │ ├── UnresolvableException.cs
│ │ └── VariantAttribute.cs
│ ├── EventDispatcher/
│ │ ├── EventDispatcher.cs
│ │ ├── IEventDispatcher.cs
│ │ └── IStoppableEvent.cs
│ ├── Exception/
│ │ ├── AssertException.cs
│ │ ├── LogicException.cs
│ │ └── RuntimeException.cs
│ ├── IO/
│ │ ├── CombineStream.cs
│ │ ├── RingBufferStream.cs
│ │ ├── SegmentStream.cs
│ │ ├── StreamExtension.cs
│ │ └── WrapperStream.cs
│ ├── Properties/
│ │ └── AssemblyInfo.cs
│ └── Util/
│ ├── Arr.cs
│ ├── Guard.cs
│ ├── InternalHelper.cs
│ ├── SortSet.cs
│ └── Str.cs
├── CatLib.Core.Tests/
│ ├── CatLib/
│ │ ├── TestsApplication.cs
│ │ └── TestsFacade.cs
│ ├── CatLib.Core.Tests.csproj
│ ├── Container/
│ │ ├── TestsBindData.cs
│ │ ├── TestsContainer.cs
│ │ └── TestsExtensionContainer.cs
│ ├── EventDispatcher/
│ │ └── TestsEventDispatcher.cs
│ ├── Fixture/
│ │ ├── AbstractClass.cs
│ │ ├── Bar.cs
│ │ ├── Baz.cs
│ │ ├── CircularDependency.cs
│ │ ├── Foo.cs
│ │ ├── FooBar.cs
│ │ ├── Fubar.cs
│ │ ├── FubarChild.cs
│ │ ├── IFoo.cs
│ │ ├── Position.cs
│ │ ├── Quux.cs
│ │ ├── QuuxFoo.cs
│ │ ├── TestEventArgs.cs
│ │ ├── Variant.cs
│ │ └── VariantModel.cs
│ ├── Framework/
│ │ ├── ExpectedExceptionAndMessageAttribute.cs
│ │ ├── TestException.cs
│ │ └── TestMethodIterativeAttribute.cs
│ ├── IO/
│ │ ├── TestsCombineStream.cs
│ │ ├── TestsRingBuffer.cs
│ │ ├── TestsSegmentStream.cs
│ │ └── TestsStreamExtension.cs
│ └── Util/
│ ├── TestsArr.cs
│ ├── TestsGuard.cs
│ ├── TestsSortSet.cs
│ └── TestsStr.cs
├── Directory.Build.props
├── analysis.ruleset
├── analysis.test.ruleset
├── settings.runsettings
└── stylecop.json
================================================
FILE CONTENTS
================================================
================================================
FILE: .dist/CHANGELOG.md
================================================
# Release Notes
## [v2.0.0-alpha.1 (2019-12-04)](https://github.com/CatLib/Core/releases/tag/v2.0.0)
#### Added
- `Inject` allowed to be set to optional.(#253 )
- `Arr.Test` can get matched value of the first match(#280 )
#### Changed
- Comments translated from Chinese into English(#133 )
- Defined Container.Build as a virtual function(#210 )
- Optimizes the constructor of `MethodContainer`(#218 )
- The default project uses the .net standard 2.0(#225 )
- Rename Util helper class to Helper class Change access level to internal.(#230 )
- `Application.IsRegisted` changed(rename) to `IsRegistered`(#226 )
- Use `VariantAttribute` to mark variable types instead of `IVariant`(#232 )
- `Guard` Will be expandable with `Guard.That`(#233 )
- Fixed the problem of container exception stack loss(#234 )
- Adjusted the internal file structure to make it clearer(#236 ).
- Add code analyzers (#206 )
- Refactoring event system (#177 )
- Refactoring `RingBuffer` make it inherit from `Stream`.(#238 )
- Namespace structure adjustment(optimization).(#241 )
- `App` can be extended by `That` (Handler rename to that) and removed `HasHandler` API (#242 )
- Unnecessary inheritance: WrappedStream(#247 )
- Clean up useless comment(#249 ).
- `Guard.Require` can set error messages and internal exceptions(#250).
- Exception class implementation support: SerializationInfo build(#252 ).
- Refactoring unit test, import moq.(#255 )
- `CodeStandardException` replaces to `LogicException`(#257 )
- Exception move to namespace `CatLib.Exception`(#258 )
- `Facade<>.Instance` changed to `Facade<>.That`(#259 )
- `Application.StartProcess` migrate to `StartProcess`(#260 )
- `Arr` optimization, lifting some unnecessary restrictions (#263)
- `Str` optimization, lifting some unnecessary restrictions (#264)
- Refactoring `SortSet`(#265 )
- Removed global params in application constructor. use Application.New() instead.(#267 )
- Containers are no longer thread-safe by default(#270 )
#### Fixed
- Fixed a bug that caused `Arr.Fill` to not work properly under special circumstances. (#255 )
#### Removed
- Removed `ExcludeFromCodeCoverageAttribute` (#229 )
- Removed unnecessary interface design `ISortSet`(#211 ).
- Removed `Version` classes and `Application.Compare` method.(#212).
- Removed `Template` supported(#213 ).
- Removed `FilterChain` supported(#214 ).
- Removed `Enum` supported(#215 ).
- Removed `IAwait` interface(#217 ).
- Removed `Container.Flash` api(#219 ).
- Removed `Arr.Flash` method(#220 ).
- Removed `Dict` helper class(#221 ).
- Removed `ThreadStatic` helper class(#223 ).
- Removed `QuickList` supported(#224 ).
- Removed `Storage` supported(#228 )
- Removed `SystemTime` class(#235 ).
- Removed `ICoroutineInit` feature from core library(#243 ).
- Removed the priority attribute, depending on the loading order(#244 ).
- Removed `Util.Encoding` (#245 ).
- Removed `Str.Encoding`(#246 )
- Removed `IServiceProviderType` feature in core library(#246 ).
- Removed unnecessary extension functions(#247 ).
- Removed `PipelineStream` stream.(#256 )
- Removed all `Obsolete` method and clean code.(#261 )
- Removed `App.Version`.(#266 )
================================================
FILE: .dist/LICENSE
================================================
MIT License
Copyright (c) 2017 CatLib
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.
================================================
FILE: .dist/README.md
================================================

## About CatLib
`CatLib` is the lightweight dependency injection container and helper functions library.
- [Service Provider](https://catlib.io/lasted/architecture/service-provider.html)
- [Application](https://catlib.io/lasted/architecture/application.html)
- [IOC Container](https://catlib.io/lasted/architecture/container.html)
- [Facades](https://catlib.io/lasted/architecture/facade.html)
## Install CatLib Core
**Installed with Nuget**
```PM
$ Install-Package CatLib.Core -Version 2.0.0
```
**Installed with [Bucket](https://github.com/getbucket/bucket)**
```shell
$ bucket require catlib/core
```
**Installed with Github Release**
[Download the latest version](https://github.com/CatLib/Core/releases)。
## Learning CatLib
CatLib has the most extensive and thorough [documentation](https://catlib.io), making it a breeze to get started with the framework.
> 需要中文支持? 请访问[CatLib中文文档](https://zh.catlib.io)。
## Contribution
CatLib is still a young framework, and her growth and your contribution are inseparable. If you want to contribute to the project, please refer to: [CatLib Contribution Guide](https://catlib.io/lasted/contribution.html) Your contribution will be included in the list of contributors,Welcome Pull Request!
## License
The open source license used by CatLib is [MIT license](http://opensource.org/licenses/MIT).
## Support
* email: support@catlib.io
* slack: [catlib.slack](https://catlib.slack.com/messages/internals/)
================================================
FILE: .dist/bucket.json
================================================
{
"name": "catlib/core",
"version": "2.0.0",
"description": "catlib framework is the lightweight dependency injection container and helper functions library.",
"keywords": ["framework", "catlib"],
"license": "MIT",
"homepage": "https://catlib.io",
"support": {
"issues": "https://github.com/CatLib/Core/issues",
"source": "https://github.com/CatLib/Core"
},
"authors": [
{
"name": "Meng han Yu",
"email": "menghanyu1994@gmail.com"
}
]
}
================================================
FILE: .dist/netstandard2.0/CatLib.Core.deps.json
================================================
{
"runtimeTarget": {
"name": ".NETStandard,Version=v2.0/",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETStandard,Version=v2.0": {},
".NETStandard,Version=v2.0/": {
"CatLib.Core/0.2.0-alpha.1+37a93a5": {
"dependencies": {
"Microsoft.CodeAnalysis.CSharp": "3.3.1",
"Microsoft.CodeAnalysis.FxCopAnalyzers": "2.9.6",
"NETStandard.Library": "2.0.3",
"SonarAnalyzer.CSharp": "7.17.0.9346",
"StyleCop.Analyzers": "1.1.118"
},
"runtime": {
"CatLib.Core.dll": {}
}
},
"Microsoft.CodeAnalysis.Analyzers/2.9.4": {},
"Microsoft.CodeAnalysis.Common/3.3.1": {
"dependencies": {
"Microsoft.CodeAnalysis.Analyzers": "2.9.4",
"System.Collections.Immutable": "1.5.0",
"System.Memory": "4.5.3",
"System.Reflection.Metadata": "1.6.0",
"System.Runtime.CompilerServices.Unsafe": "4.5.2",
"System.Text.Encoding.CodePages": "4.5.1",
"System.Threading.Tasks.Extensions": "4.5.3"
}
},
"Microsoft.CodeAnalysis.CSharp/3.3.1": {
"dependencies": {
"Microsoft.CodeAnalysis.Common": "3.3.1"
}
},
"Microsoft.CodeAnalysis.FxCopAnalyzers/2.9.6": {
"dependencies": {
"Microsoft.CodeAnalysis.VersionCheckAnalyzer": "2.9.6",
"Microsoft.CodeQuality.Analyzers": "2.9.6",
"Microsoft.NetCore.Analyzers": "2.9.6",
"Microsoft.NetFramework.Analyzers": "2.9.6"
}
},
"Microsoft.CodeAnalysis.VersionCheckAnalyzer/2.9.6": {},
"Microsoft.CodeQuality.Analyzers/2.9.6": {},
"Microsoft.NetCore.Analyzers/2.9.6": {},
"Microsoft.NETCore.Platforms/1.1.0": {},
"Microsoft.NetFramework.Analyzers/2.9.6": {},
"NETStandard.Library/2.0.3": {
"dependencies": {
"Microsoft.NETCore.Platforms": "1.1.0"
}
},
"SonarAnalyzer.CSharp/7.17.0.9346": {},
"StyleCop.Analyzers/1.1.118": {},
"System.Buffers/4.4.0": {},
"System.Collections.Immutable/1.5.0": {},
"System.Memory/4.5.3": {
"dependencies": {
"System.Buffers": "4.4.0",
"System.Numerics.Vectors": "4.4.0",
"System.Runtime.CompilerServices.Unsafe": "4.5.2"
}
},
"System.Numerics.Vectors/4.4.0": {},
"System.Reflection.Metadata/1.6.0": {
"dependencies": {
"System.Collections.Immutable": "1.5.0"
}
},
"System.Runtime.CompilerServices.Unsafe/4.5.2": {},
"System.Text.Encoding.CodePages/4.5.1": {
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "4.5.2"
}
},
"System.Threading.Tasks.Extensions/4.5.3": {
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "4.5.2"
}
}
}
},
"libraries": {
"CatLib.Core/0.2.0-alpha.1+37a93a5": {
"type": "project",
"serviceable": false,
"sha512": ""
},
"Microsoft.CodeAnalysis.Analyzers/2.9.4": {
"type": "package",
"serviceable": true,
"sha512": "sha512-alIJhS0VUg/7x5AsHEoovh/wRZ0RfCSS7k5pDSqpRLTyuMTtRgj6OJJPRApRhJHOGYYsLakf1hKeXFoDwKwNkg==",
"path": "microsoft.codeanalysis.analyzers/2.9.4",
"hashPath": "microsoft.codeanalysis.analyzers.2.9.4.nupkg.sha512"
},
"Microsoft.CodeAnalysis.Common/3.3.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-N5yQdGy+M4kimVG7hwCeGTCfgYjK2o5b/Shumkb/rCC+/SAkvP1HUAYK+vxPFS7dLJNtXLRsmPHKj3fnyNWnrw==",
"path": "microsoft.codeanalysis.common/3.3.1",
"hashPath": "microsoft.codeanalysis.common.3.3.1.nupkg.sha512"
},
"Microsoft.CodeAnalysis.CSharp/3.3.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-WDUIhTHem38H6VJ98x2Ssq0fweakJHnHYl7vbG8ARnsAwLoJKCQCy78EeY1oRrCKG42j0v6JVljKkeqSDA28UA==",
"path": "microsoft.codeanalysis.csharp/3.3.1",
"hashPath": "microsoft.codeanalysis.csharp.3.3.1.nupkg.sha512"
},
"Microsoft.CodeAnalysis.FxCopAnalyzers/2.9.6": {
"type": "package",
"serviceable": true,
"sha512": "sha512-GBZV6P8u3uIXYrlapvbpaaaB5LpF3hk+I2ThIcoVyENr8krNOovFyJhi6FQHgnxd0XLPj9J9Nt35iuqwVe/XJw==",
"path": "microsoft.codeanalysis.fxcopanalyzers/2.9.6",
"hashPath": "microsoft.codeanalysis.fxcopanalyzers.2.9.6.nupkg.sha512"
},
"Microsoft.CodeAnalysis.VersionCheckAnalyzer/2.9.6": {
"type": "package",
"serviceable": true,
"sha512": "sha512-Q5rRN0+9TJsfsXaGKnzDjGkUZ4Rd8ZKmpSND1j49jsmLacCspp4ZaJ31nJn76B/W0qrb4GkEBxKtj3U9lo2gqg==",
"path": "microsoft.codeanalysis.versioncheckanalyzer/2.9.6",
"hashPath": "microsoft.codeanalysis.versioncheckanalyzer.2.9.6.nupkg.sha512"
},
"Microsoft.CodeQuality.Analyzers/2.9.6": {
"type": "package",
"serviceable": true,
"sha512": "sha512-jND04w/FPgfBYKkLLnosmvgHs8NMpMvQ7LQqyiCjMlKOM+MT6edgvTU0vAAowxGuLGceC6pjJm0kUVkG9qT3CQ==",
"path": "microsoft.codequality.analyzers/2.9.6",
"hashPath": "microsoft.codequality.analyzers.2.9.6.nupkg.sha512"
},
"Microsoft.NetCore.Analyzers/2.9.6": {
"type": "package",
"serviceable": true,
"sha512": "sha512-YPcQ+gCt66btt9jNHNi4vrRK6AAP7EIO17quwUeHLUw7vhc6q18r2RYVTLKQvOQuOXs1UEYHArENpppwFP4MLA==",
"path": "microsoft.netcore.analyzers/2.9.6",
"hashPath": "microsoft.netcore.analyzers.2.9.6.nupkg.sha512"
},
"Microsoft.NETCore.Platforms/1.1.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==",
"path": "microsoft.netcore.platforms/1.1.0",
"hashPath": "microsoft.netcore.platforms.1.1.0.nupkg.sha512"
},
"Microsoft.NetFramework.Analyzers/2.9.6": {
"type": "package",
"serviceable": true,
"sha512": "sha512-8VyWe53rtUkgJFAkbCZY5KT2t1tEmRrdK1Z+zbyRlzoKVEHyMs0+WNBeJ8d2YB/NjXaYAlaVG2CGZFnQUrwY6A==",
"path": "microsoft.netframework.analyzers/2.9.6",
"hashPath": "microsoft.netframework.analyzers.2.9.6.nupkg.sha512"
},
"NETStandard.Library/2.0.3": {
"type": "package",
"serviceable": true,
"sha512": "sha512-st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==",
"path": "netstandard.library/2.0.3",
"hashPath": "netstandard.library.2.0.3.nupkg.sha512"
},
"SonarAnalyzer.CSharp/7.17.0.9346": {
"type": "package",
"serviceable": true,
"sha512": "sha512-Fmap0bvZRojVKRSJj8xS3Bqsltmjy6i3bJF2gXMkuKdtFFJeS546RT75G3YN3IDSygrIEyfQdL+s8ep60vzORQ==",
"path": "sonaranalyzer.csharp/7.17.0.9346",
"hashPath": "sonaranalyzer.csharp.7.17.0.9346.nupkg.sha512"
},
"StyleCop.Analyzers/1.1.118": {
"type": "package",
"serviceable": true,
"sha512": "sha512-Onx6ovGSqXSK07n/0eM3ZusiNdB6cIlJdabQhWGgJp3Vooy9AaLS/tigeybOJAobqbtggTamoWndz72JscZBvw==",
"path": "stylecop.analyzers/1.1.118",
"hashPath": "stylecop.analyzers.1.1.118.nupkg.sha512"
},
"System.Buffers/4.4.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-AwarXzzoDwX6BgrhjoJsk6tUezZEozOT5Y9QKF94Gl4JK91I4PIIBkBco9068Y9/Dra8Dkbie99kXB8+1BaYKw==",
"path": "system.buffers/4.4.0",
"hashPath": "system.buffers.4.4.0.nupkg.sha512"
},
"System.Collections.Immutable/1.5.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-EXKiDFsChZW0RjrZ4FYHu9aW6+P4MCgEDCklsVseRfhoO0F+dXeMSsMRAlVXIo06kGJ/zv+2w1a2uc2+kxxSaQ==",
"path": "system.collections.immutable/1.5.0",
"hashPath": "system.collections.immutable.1.5.0.nupkg.sha512"
},
"System.Memory/4.5.3": {
"type": "package",
"serviceable": true,
"sha512": "sha512-3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==",
"path": "system.memory/4.5.3",
"hashPath": "system.memory.4.5.3.nupkg.sha512"
},
"System.Numerics.Vectors/4.4.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-UiLzLW+Lw6HLed1Hcg+8jSRttrbuXv7DANVj0DkL9g6EnnzbL75EB7EWsw5uRbhxd/4YdG8li5XizGWepmG3PQ==",
"path": "system.numerics.vectors/4.4.0",
"hashPath": "system.numerics.vectors.4.4.0.nupkg.sha512"
},
"System.Reflection.Metadata/1.6.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==",
"path": "system.reflection.metadata/1.6.0",
"hashPath": "system.reflection.metadata.1.6.0.nupkg.sha512"
},
"System.Runtime.CompilerServices.Unsafe/4.5.2": {
"type": "package",
"serviceable": true,
"sha512": "sha512-wprSFgext8cwqymChhrBLu62LMg/1u92bU+VOwyfBimSPVFXtsNqEWC92Pf9ofzJFlk4IHmJA75EDJn1b2goAQ==",
"path": "system.runtime.compilerservices.unsafe/4.5.2",
"hashPath": "system.runtime.compilerservices.unsafe.4.5.2.nupkg.sha512"
},
"System.Text.Encoding.CodePages/4.5.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-4J2JQXbftjPMppIHJ7IC+VXQ9XfEagN92vZZNoG12i+zReYlim5dMoXFC1Zzg7tsnKDM7JPo5bYfFK4Jheq44w==",
"path": "system.text.encoding.codepages/4.5.1",
"hashPath": "system.text.encoding.codepages.4.5.1.nupkg.sha512"
},
"System.Threading.Tasks.Extensions/4.5.3": {
"type": "package",
"serviceable": true,
"sha512": "sha512-+MvhNtcvIbqmhANyKu91jQnvIRVSTiaOiFNfKWwXGHG48YAb4I/TyH8spsySiPYla7gKal5ZnF3teJqZAximyQ==",
"path": "system.threading.tasks.extensions/4.5.3",
"hashPath": "system.threading.tasks.extensions.4.5.3.nupkg.sha512"
}
}
}
================================================
FILE: .gitattributes
================================================
src/ export-ignore
*.sln export-ignore
.gitignore export-ignore
.gitattributes export-ignore
*.ps1 export-ignore
.github/ export-ignore
.travis.yml export-ignore
/bucket.json export-ignore
/README.md export-ignore
/CHANGELOG.md export-ignore
/LICENSE export-ignore
================================================
FILE: .github/ISSUE_TEMPLATE/---bug-report.md
================================================
---
name: "\U0001F41B Bug Report"
about: Report a general framework issue. Please ensure your CatLib version is still
supported.
title: "[BUG] Add a placeholder for issues title, ex."
labels: Need Review, bug
assignees: yb199478
---
**CatLib version(s) affected**: x.y.z
#### Description
#### How to reproduce
#### Possible Solution
#### Additional context
================================================
FILE: .github/ISSUE_TEMPLATE/---documentation-issue.md
================================================
---
name: "\U0001F4DA Documentation Issue"
about: For documentation issues, open a pull request at https://github.com/catlib/catlib-en.io
title: "[Document] Add a placeholder for issues title, ex."
labels: Document, Need Review
assignees: yb199478
---
The CatLib documentation has its own dedicated repository. Please open a pull request at https://github.com/catlib/catlib-en to correct the issue you have found.
Thanks!
================================================
FILE: .github/ISSUE_TEMPLATE/---feature-request.md
================================================
---
name: "\U0001F4A1 Feature Request"
about: Suggest an idea for this project
title: "[Feature] Suggested as the issues title, ex."
labels: Feature, Need Review
assignees: yb199478
---
If you would like to propose new CatLib features, please make a pull request, or open an issue.
================================================
FILE: .github/ISSUE_TEMPLATE/---support-question.md
================================================
---
name: "\U0001F680 Support Question"
about: This repository is only for for questions about using CatLib and its components.
title: "[Question] Add a placeholder for issues title, ex."
labels: Need Review, question
assignees: yb199478
---
> If you need support, please use the document first: http://catlib.io
**CatLib version(s) affected**: x.y.z
#### Description
#### What's need help
================================================
FILE: .gitignore
================================================
.vs/
src/*/bin/
src/*/obj/
TestResults/
coverage.json
coverage.opencover.xml
.DS_Store
.idea/
*.sln.DotSettings.user
================================================
FILE: .travis.yml
================================================
language: csharp
mono: none
dotnet: 3.0.100
stages:
- compile
- test
jobs:
include:
- stage: compile
script:
- dotnet build -c Release
- stage: test
script:
- dotnet test -c Release -s src/settings.runsettings /p:CollectCoverage=true /p:CoverletOutputFormat=\"json,teamcity,opencover\" /p:CoverletOutput=\"../../coverage/\" /p:Exclude=[*.Tests]* /p:Threshold=90 /p:ThresholdType=line
after_success:
- bash <(curl -s https://codecov.io/bash) -f coverage/coverage.opencover.xml -t $CODE_COV_TOKEN
================================================
FILE: CHANGELOG.md
================================================
# Release Notes
## [v2.0.0-alpha.1 (2019-12-04)](https://github.com/CatLib/Core/releases/tag/v2.0.0)
#### Added
- `Inject` allowed to be set to optional.(#253 )
- `Arr.Test` can get matched value of the first match(#280 )
#### Changed
- Comments translated from Chinese into English(#133 )
- Defined Container.Build as a virtual function(#210 )
- Optimizes the constructor of `MethodContainer`(#218 )
- The default project uses the .net standard 2.0(#225 )
- Rename Util helper class to Helper class Change access level to internal.(#230 )
- `Application.IsRegisted` changed(rename) to `IsRegistered`(#226 )
- Use `VariantAttribute` to mark variable types instead of `IVariant`(#232 )
- `Guard` Will be expandable with `Guard.That`(#233 )
- Fixed the problem of container exception stack loss(#234 )
- Adjusted the internal file structure to make it clearer(#236 ).
- Add code analyzers (#206 )
- Refactoring event system (#177 )
- Refactoring `RingBuffer` make it inherit from `Stream`.(#238 )
- Namespace structure adjustment(optimization).(#241 )
- `App` can be extended by `That` (Handler rename to that) and removed `HasHandler` API (#242 )
- Unnecessary inheritance: WrappedStream(#247 )
- Clean up useless comment(#249 ).
- `Guard.Require` can set error messages and internal exceptions(#250).
- Exception class implementation support: SerializationInfo build(#252 ).
- Refactoring unit test, import moq.(#255 )
- `CodeStandardException` replaces to `LogicException`(#257 )
- Exception move to namespace `CatLib.Exception`(#258 )
- `Facade<>.Instance` changed to `Facade<>.That`(#259 )
- `Application.StartProcess` migrate to `StartProcess`(#260 )
- `Arr` optimization, lifting some unnecessary restrictions (#263)
- `Str` optimization, lifting some unnecessary restrictions (#264)
- Refactoring `SortSet`(#265 )
- Removed global params in application constructor. use Application.New() instead.(#267 )
- Containers are no longer thread-safe by default(#270 )
#### Fixed
- Fixed a bug that caused `Arr.Fill` to not work properly under special circumstances. (#255 )
#### Removed
- Removed `ExcludeFromCodeCoverageAttribute` (#229 )
- Removed unnecessary interface design `ISortSet`(#211 ).
- Removed `Version` classes and `Application.Compare` method.(#212).
- Removed `Template` supported(#213 ).
- Removed `FilterChain` supported(#214 ).
- Removed `Enum` supported(#215 ).
- Removed `IAwait` interface(#217 ).
- Removed `Container.Flash` api(#219 ).
- Removed `Arr.Flash` method(#220 ).
- Removed `Dict` helper class(#221 ).
- Removed `ThreadStatic` helper class(#223 ).
- Removed `QuickList` supported(#224 ).
- Removed `Storage` supported(#228 )
- Removed `SystemTime` class(#235 ).
- Removed `ICoroutineInit` feature from core library(#243 ).
- Removed the priority attribute, depending on the loading order(#244 ).
- Removed `Util.Encoding` (#245 ).
- Removed `Str.Encoding`(#246 )
- Removed `IServiceProviderType` feature in core library(#246 ).
- Removed unnecessary extension functions(#247 ).
- Removed `PipelineStream` stream.(#256 )
- Removed all `Obsolete` method and clean code.(#261 )
- Removed `App.Version`.(#266 )
================================================
FILE: CatLib.Core.sln
================================================
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28803.202
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CatLib.Core", "src\CatLib.Core\CatLib.Core.csproj", "{C99EA95A-3D04-4588-97E5-D81078EE85BD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CatLib.Core.Tests", "src\CatLib.Core.Tests\CatLib.Core.Tests.csproj", "{2E89486C-7A92-4C94-8F3E-D8DC1F5C883B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C99EA95A-3D04-4588-97E5-D81078EE85BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C99EA95A-3D04-4588-97E5-D81078EE85BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C99EA95A-3D04-4588-97E5-D81078EE85BD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C99EA95A-3D04-4588-97E5-D81078EE85BD}.Release|Any CPU.Build.0 = Release|Any CPU
{2E89486C-7A92-4C94-8F3E-D8DC1F5C883B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2E89486C-7A92-4C94-8F3E-D8DC1F5C883B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2E89486C-7A92-4C94-8F3E-D8DC1F5C883B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2E89486C-7A92-4C94-8F3E-D8DC1F5C883B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BD9525ED-3010-4A67-B726-6FB2960FEC30}
EndGlobalSection
EndGlobal
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2017 CatLib
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.
================================================
FILE: README.md
================================================

## About CatLib
`CatLib` is the lightweight dependency injection container and helper functions library.
- [Service Provider](https://catlib.io/lasted/architecture/service-provider.html)
- [Application](https://catlib.io/lasted/architecture/application.html)
- [IOC Container](https://catlib.io/lasted/architecture/container.html)
- [Facades](https://catlib.io/lasted/architecture/facade.html)
## Install CatLib Core
**Installed with Nuget**
```PM
$ Install-Package CatLib.Core -Version 2.0.0
```
**Installed with [Bucket](https://github.com/getbucket/bucket)**
```shell
$ bucket require catlib/core
```
**Installed with Github Release**
[Download the latest version](https://github.com/CatLib/Core/releases)。
## Learning CatLib
CatLib has the most extensive and thorough [documentation](https://catlib.io), making it a breeze to get started with the framework.
> 需要中文支持? 请访问[CatLib中文文档](https://cn.catlib.io)。
## Contribution
CatLib is still a young framework, and her growth and your contribution are inseparable. If you want to contribute to the project, please refer to: [CatLib Contribution Guide](https://catlib.io/lasted/contribution.html) Your contribution will be included in the list of contributors,Welcome Pull Request!
## License
The open source license used by CatLib is [MIT license](http://opensource.org/licenses/MIT).
## Support
* email: support@catlib.io
* slack: [catlib.slack](https://catlib.slack.com/messages/internals/)
================================================
FILE: bucket.json
================================================
{
"name": "catlib/core",
"version": "2.0.0",
"description": "catlib framework is the lightweight dependency injection container and helper functions library.",
"keywords": ["framework", "catlib"],
"license": "MIT",
"homepage": "https://catlib.io",
"support": {
"issues": "https://github.com/CatLib/Core/issues",
"source": "https://github.com/CatLib/Core"
},
"authors": [
{
"name": "Meng han Yu",
"email": "menghanyu1994@gmail.com"
}
]
}
================================================
FILE: build.ps1
================================================
param(
[string]$version="master-dev"
)
$dist = ".dist"
$root = (Get-Item -Path ".\").FullName
$publishDir = $root + "\src\CatLib.Core\bin\Release\netstandard2.0\publish"
$version = $version.Trim()
$versionParttern = "^v?(?(?\d{1,5})(?\.\d+)?(?\.\d+)?(?\.\d+)?|master)(?\-(?:stable|beta|b|RC|alpha|a|patch|pl|p|dev)(?:(?:[.-]?\d+)+)?)?(?\+[0-9A-Za-z\-\.]+)?$"
if(!($version -match $versionParttern))
{
throw ("Invalid version, must conform to the semver version: " + $version)
}
if($matches["stability"] -eq $null)
{
$matches["stability"] = "-stable"
}
if($matches["master"] -eq "master")
{
$matches["major"] = "0"
}
if($matches["minor"] -eq $null)
{
$matches["minor"] = ".0"
}
if($matches["patch"] -eq $null)
{
$matches["patch"] = ".0"
}
if($matches["build"] -match "^[0-9a-f]{40}$")
{
$env:CATLIB_COMMIT_SHA = $matches["build"].substring(1).trim()
$matches["build"] = $matches["build"].substring(0, 8)
}
elseif($env:CI_COMMIT_SHA -ne $null)
{
$env:CATLIB_COMMIT_SHA = ($env:CI_COMMIT_SHA).trim()
$matches["build"] = "+" + $env:CATLIB_COMMIT_SHA.substring(0, 7)
}
else
{
$env:CATLIB_COMMIT_SHA = (git rev-parse HEAD).trim()
$matches["build"] = "+" + $env:CATLIB_COMMIT_SHA.substring(0, 7)
}
$major = $matches["major"]
$minor = $matches["minor"]
$assemblyVersion = $major + ".0.0.0"
$versionNormalized = $major + $minor + $matches["patch"] + $matches["revision"] + $matches["stability"] + $matches["build"]
$beginDateTime = ([DateTime] "01/01/2000");
$midnightDateTime = (Get-Date -Hour 0 -Minute 0 -Second 0);
$elapseDay = -1 * (New-TimeSpan -end $beginDateTime).Days
$elapseMidnight = [math]::floor((New-TimeSpan $midnightDateTime -End (Get-Date)).TotalSeconds * 0.5)
$fileVersion = $major + $minor + "." + $elapseDay + "." + $elapseMidnight
dotnet publish src\CatLib.Core\CatLib.Core.csproj -c Release /p:Version=$versionNormalized /p:AssemblyVersion=$assemblyVersion /p:FileVersion=$fileVersion --self-contained false
if($LastExitCode){
echo "Abnormal. build failded."
exit(1)
}
if(Test-Path -Path $dist)
{
Remove-Item $dist -Recurse
}
mkdir $dist
mkdir $dist\netstandard2.0
cp $publishDir\* $dist\netstandard2.0 -Recurse
cp LICENSE $dist
cp CHANGELOG.md $dist
cp README.md $dist
cp bucket.json $dist
$env:CATLIB_PROJECT_VERSION=$versionNormalized.trim()
$env:CATLIB_FILE_VERSION=$fileVersion.trim()
$env:CATLIB_STABILITY=$matches["stability"].substring(1).trim()
$env:CATLIB_MIN_DOTNET_CORE="3.0.0".trim()
$env:CATLIB_PUBLISH_DIR=$publishDir.trim()
echo "CATLIB_COMMIT_SHA $env:CATLIB_COMMIT_SHA"
echo "CATLIB_FILE_VERSION $env:CATLIB_FILE_VERSION"
echo "CATLIB_PROJECT_VERSION $env:CATLIB_PROJECT_VERSION"
echo "CATLIB_STABILITY $env:CATLIB_STABILITY"
echo "CATLIB_MIN_DOTNET_CORE $env:CATLIB_MIN_DOTNET_CORE"
echo "CATLIB_PUBLISH_DIR $env:CATLIB_PUBLISH_DIR"
================================================
FILE: src/CatLib.Core/CatLib/App.cs
================================================
/*
* This file is part of the CatLib package.
*
* (c) CatLib
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* Document: https://catlib.io/
*/
using CatLib.Container;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
#pragma warning disable CA1030
namespace CatLib
{
///
/// The static facade.
///
[ExcludeFromCodeCoverage]
#pragma warning disable S1118
public abstract class App
#pragma warning restore S1118
{
///
/// The instance.
///
private static IApplication that;
///
/// Callback when a new instance is created.
///
public static event Action OnNewApplication
{
add
{
RaiseOnNewApplication += value;
if (That != null)
{
value?.Invoke(That);
}
}
remove => RaiseOnNewApplication -= value;
}
///
/// Callback when a new instance is created.
///
private static event Action RaiseOnNewApplication;
///
/// Gets or Sets the instance.
///
public static IApplication That
{
get
{
return that;
}
set
{
that = value;
RaiseOnNewApplication?.Invoke(that);
}
}
///
public static bool IsMainThread => That.IsMainThread;
///
public static DebugLevel DebugLevel
{
get => That.DebugLevel;
set => That.DebugLevel = value;
}
///
public static void Terminate()
{
That.Terminate();
}
///
public static void Register(IServiceProvider provider, bool force = false)
{
That.Register(provider, force);
}
///
public static bool IsRegistered(IServiceProvider provider)
{
return That.IsRegistered(provider);
}
///
public static long GetRuntimeId()
{
return That.GetRuntimeId();
}
///
public static void UnbindMethod(object target)
{
That.UnbindMethod(target);
}
///
public static object Invoke(string method, params object[] userParams)
{
return That.Invoke(method, userParams);
}
///
public static IContainer OnFindType(Func func, int priority = int.MaxValue)
{
return That.OnFindType(func, priority);
}
///
public static IContainer OnRebound(string service, Action