Skip to content

Commit

Permalink
Merge pull request #14 from stevenvolckaert/vNext
Browse files Browse the repository at this point in the history
Releasing v1.1.0
  • Loading branch information
stevenvolckaert authored Jun 7, 2017
2 parents d7834aa + dcb0d65 commit 73d36c2
Show file tree
Hide file tree
Showing 19 changed files with 422 additions and 244 deletions.
33 changes: 16 additions & 17 deletions StevenVolckaert.EnterpriseLibrary.sln
Original file line number Diff line number Diff line change
@@ -1,46 +1,45 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio 15
VisualStudioVersion = 15.0.26228.9
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "StevenVolckaert.Core", "src\StevenVolckaert.Core\StevenVolckaert.Core.xproj", "{3E5DE170-18C8-4B09-90A6-7D158A6C54C5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution items", "Solution items", "{00269925-9ABB-475F-A63B-B57C55E26CD3}"
ProjectSection(SolutionItems) = preProject
.gitattributes = .gitattributes
.gitignore = .gitignore
appveyor.yml = appveyor.yml
global.json = global.json
LICENSE = LICENSE
README.md = README.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{887100A5-003F-4148-85D8-9D9C9E7E5125}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "StevenVolckaert.Core.Tests", "test\StevenVolckaert.Core.Tests\StevenVolckaert.Core.Tests.xproj", "{A97F5579-7D70-4FD4-8D6B-DC12E4909AD2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{54EC9438-05ED-4ACD-AEF6-B31B353069EA}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StevenVolckaert.Core", "src\StevenVolckaert.Core\StevenVolckaert.Core.csproj", "{9493EB60-BD91-426A-BDF1-4390456046E1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StevenVolckaert.Core.Tests", "test\StevenVolckaert.Core.Tests\StevenVolckaert.Core.Tests.csproj", "{B2222404-4375-458C-9F04-C5F1D279CBA6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3E5DE170-18C8-4B09-90A6-7D158A6C54C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3E5DE170-18C8-4B09-90A6-7D158A6C54C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3E5DE170-18C8-4B09-90A6-7D158A6C54C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3E5DE170-18C8-4B09-90A6-7D158A6C54C5}.Release|Any CPU.Build.0 = Release|Any CPU
{A97F5579-7D70-4FD4-8D6B-DC12E4909AD2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A97F5579-7D70-4FD4-8D6B-DC12E4909AD2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A97F5579-7D70-4FD4-8D6B-DC12E4909AD2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A97F5579-7D70-4FD4-8D6B-DC12E4909AD2}.Release|Any CPU.Build.0 = Release|Any CPU
{9493EB60-BD91-426A-BDF1-4390456046E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9493EB60-BD91-426A-BDF1-4390456046E1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9493EB60-BD91-426A-BDF1-4390456046E1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9493EB60-BD91-426A-BDF1-4390456046E1}.Release|Any CPU.Build.0 = Release|Any CPU
{B2222404-4375-458C-9F04-C5F1D279CBA6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B2222404-4375-458C-9F04-C5F1D279CBA6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B2222404-4375-458C-9F04-C5F1D279CBA6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B2222404-4375-458C-9F04-C5F1D279CBA6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{3E5DE170-18C8-4B09-90A6-7D158A6C54C5} = {54EC9438-05ED-4ACD-AEF6-B31B353069EA}
{A97F5579-7D70-4FD4-8D6B-DC12E4909AD2} = {887100A5-003F-4148-85D8-9D9C9E7E5125}
{9493EB60-BD91-426A-BDF1-4390456046E1} = {54EC9438-05ED-4ACD-AEF6-B31B353069EA}
{B2222404-4375-458C-9F04-C5F1D279CBA6} = {887100A5-003F-4148-85D8-9D9C9E7E5125}
EndGlobalSection
EndGlobal
9 changes: 5 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
version: 1.0.0-{build}
version: 1.1.0-{build}
build:
verbosity: minimal
configuration:
- Debug
- Release
platform: Any CPU
environment:
image: Visual Studio 2017
DOTNET_CLI_TELEMETRY_OPTOUT: 1
init:
- ps: $Env:LABEL = "CI" + $Env:APPVEYOR_BUILD_NUMBER.PadLeft(5, "0")
- ps: $Env:VERSION_SUFFIX = "CI" + $Env:APPVEYOR_BUILD_NUMBER.PadLeft(5, "0")
before_build:
- appveyor-retry dotnet restore -v Minimal
build_script:
- dotnet build "src\StevenVolckaert.Core" -c %CONFIGURATION% --no-dependencies --version-suffix %LABEL%
- dotnet build "src\StevenVolckaert.Core" -c %CONFIGURATION% --version-suffix %VERSION_SUFFIX%
test_script:
- dotnet test "test\StevenVolckaert.Core.Tests" -c %CONFIGURATION%
- dotnet test "test\StevenVolckaert.Core.Tests\StevenVolckaert.Core.Tests.csproj" -c %CONFIGURATION%
cache:
- '%USERPROFILE%\.nuget\packages'
3 changes: 0 additions & 3 deletions global.json

This file was deleted.

44 changes: 40 additions & 4 deletions src/StevenVolckaert.Core/ICollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
using System.Linq;

/// <summary>
/// Provides extension methods for instances that implement the <see cref="ICollection{T}"/> interface.
/// Provides extension methods for instances that implement the <see cref="ICollection{T}"/>
/// interface.
/// </summary>
public static class ICollectionExtensions
{
Expand All @@ -27,8 +28,40 @@ IEnumerable<TSource> sourceCollection
if (source == null)
throw new ArgumentNullException(nameof(source));

if (sourceCollection != null)
foreach (TSource value in sourceCollection)
source.AddRange(sourceCollection, isDistinct: false);
}

/// <summary>
/// Adds the elements of the specified collection to the end of the <see cref="ICollection{T}"/>
/// instance.
/// </summary>
/// <typeparam name="TSource">The type of elements of <paramref name="source"/>.</typeparam>
/// <param name="source">The target data collection.</param>
/// <param name="isDistinct">
/// A value that indicates whether to skip adding elements from
/// <paramref name="sourceCollection"/> that <paramref name="source"/> already contains,
/// using the default equality comparer.
/// </param>
/// <param name="sourceCollection">
/// The collection whose elements should be added to the <see cref="ICollection{T}"/> instance.
/// </param>
/// <exception cref="ArgumentNullException"><paramref name="source"/> is <c>null</c>.</exception>
public static void AddRange<TSource>(
this ICollection<TSource> source,
IEnumerable<TSource> sourceCollection,
bool isDistinct
)
{
if (source == null)
throw new ArgumentNullException(nameof(source));

if (sourceCollection == null)
return;

foreach (TSource value in sourceCollection)
if (isDistinct && source.Contains(value))
continue;
else
source.Add(value);
}

Expand All @@ -42,7 +75,10 @@ IEnumerable<TSource> sourceCollection
/// <exception cref="ArgumentNullException">
/// <paramref name="source"/> or <paramref name="predicate"/> is <c>null</c>.
/// </exception>
public static void RemoveFirst<TSource>(this ICollection<TSource> source, Func<TSource, bool> predicate)
public static void RemoveFirst<TSource>(
this ICollection<TSource> source,
Func<TSource, bool> predicate
)
{
if (source == null)
throw new ArgumentNullException(nameof(source));
Expand Down
21 changes: 11 additions & 10 deletions src/StevenVolckaert.Core/IDictionaryExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#endif

/// <summary>
/// Provides extension methods for instances that implement the <see cref="IDictionary{TKey, TValue}"/>
/// interface.
/// Provides extension methods for instances that implement the
/// <see cref="IDictionary{TKey, TValue}"/> interface.
/// </summary>
public static class IDictionaryExtensions
{
Expand All @@ -34,8 +34,8 @@ this IDictionary<TKey, TValue> dictionary
#endif

/// <summary>
/// Gets the value associated with the specified key, or the type's default value if the key
/// doesn't exist.
/// Gets the value associated with the specified key,
/// or the type's default value if the key doesn't exist.
/// </summary>
/// <typeparam name="TKey">The type of keys in the dictionary.</typeparam>
/// <typeparam name="TValue">The type of values in the dictionary.</typeparam>
Expand All @@ -55,27 +55,28 @@ public static TValue TryGetValue<TKey, TValue>(this IDictionary<TKey, TValue> di
if (key == null)
throw new ArgumentNullException(nameof(key));

return dictionary.TryGetValue(key, defaultValue: default(TValue));
return dictionary.TryGetValue(key, fallbackValue: default(TValue));
}

/// <summary>
/// Gets the value associated with the specified key, or a default value if the key doesn't exist.
/// Gets the value associated with the specified key,
/// or a specified fallback value if the key doesn't exist.
/// </summary>
/// <typeparam name="TKey">The type of keys in the dictionary.</typeparam>
/// <typeparam name="TValue">The type of values in the dictionary.</typeparam>
/// <param name="dictionary">
/// The <see cref="IDictionary{TKey, TValue}"/> instance this extension method affects.
/// </param>
/// <param name="key">The key whose value to get.</param>
/// <param name="defaultValue">The default value.</param>
/// <param name="fallbackValue">The default value.</param>
/// <returns>
/// The value associated with the specified key, or <paramref name="defaultValue"/> if
/// The value associated with the specified key, or <paramref name="fallbackValue"/> if
/// <paramref name="key"/> doesn't exist.
/// </returns>
public static TValue TryGetValue<TKey, TValue>(
this IDictionary<TKey, TValue> dictionary,
TKey key,
TValue defaultValue
TValue fallbackValue
)
{
if (dictionary == null)
Expand All @@ -84,7 +85,7 @@ TValue defaultValue
if (key == null)
throw new ArgumentNullException(nameof(key));

return dictionary.ContainsKey(key) ? dictionary[key] : defaultValue;
return dictionary.ContainsKey(key) ? dictionary[key] : fallbackValue;
}
}
}
84 changes: 79 additions & 5 deletions src/StevenVolckaert.Core/IEnumerableExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,90 @@
#endif

/// <summary>
/// Provides extension methods for instances that implement the <see cref="IEnumerable{T}"/> interface.
/// Provides extension methods for instances that implement the <see cref="IEnumerable{T}"/>
/// interface.
/// </summary>
public static class IEnumerableExtensions
{
/// <summary>
/// Adds a specified element to the end of the sequence.
/// </summary>
/// <typeparam name="T">The type of the elements of <paramref name="source"/>.</typeparam>
/// <param name="source">
/// The <see cref="IEnumerable{T}"/> instance this extension method affects.
/// </param>
/// <param name="element">The element to add.</param>
/// <returns>
/// An <see cref="IEnumerable{T}"/> instance containing all elements of <paramref name="source"/>,
/// followed by <paramref name="element"/>.
/// </returns>
/// <exception cref="ArgumentNullException">
/// <paramref name="source"/> is <c>null</c>.
/// </exception>
public static IEnumerable<T> Append<T>(this IEnumerable<T> source, T element)
{
if (source == null)
throw new ArgumentNullException(nameof(source));

foreach (var sourceElement in source)
yield return sourceElement;

yield return element;
}

/// <summary>
/// Adds a specified element to the beginning of the sequence.
/// </summary>
/// <typeparam name="T">The type of the elements of <paramref name="source"/>.</typeparam>
/// <param name="source">
/// The <see cref="IEnumerable{T}"/> instance this extenion method affects.
/// </param>
/// <param name="element">The element to add.</param>
/// <returns>
/// An <see cref="IEnumerable{T}"/> instance containing <paramref name="element"/>,
/// followed by all elements of <paramref name="source"/>.
/// </returns>
/// <exception cref="ArgumentNullException">
/// <paramref name="source"/> is <c>null</c>.
/// </exception>
public static IEnumerable<T> Prepend<T>(this IEnumerable<T> source, T element)
{
if (source == null)
throw new ArgumentNullException(nameof(source));

yield return element;

foreach (var sourceElement in source)
yield return sourceElement;
}

/// <summary>
/// Determines whether a sequence contains no elements.
/// </summary>
/// <typeparam name="TSource">The type of the elements of <paramref name="source"/>.</typeparam>
/// <param name="source">The <see cref="IEnumerable{T}"/> instance to check for emptiness. </param>
/// <returns>
/// <c>true</c> if the source sequence contains no elements; otherwise, <c>false</c>.
/// </returns>
/// <exception cref="ArgumentNullException"><paramref name="source"/> is <c>null</c>.</exception>
public static bool IsEmpty<TSource>(this IEnumerable<TSource> source)
{
if (source == null)
throw new ArgumentNullException(nameof(source));

return !source.Any();
}

/// <summary>
/// Determines whether a sequence contains no elements.
/// </summary>
/// <typeparam name="TSource">The type of the elements of <paramref name="source"/>.</typeparam>
/// <param name="source">The <see cref="IEnumerable{T}"/> instance to check for emptiness. </param>
/// <returns><c>true</c> if the source sequence contains no elements; otherwise, <c>false</c>.</returns>
/// <returns>
/// <c>true</c> if the source sequence contains no elements; otherwise, <c>false</c>.
/// </returns>
/// <exception cref="ArgumentNullException"><paramref name="source"/> is <c>null</c>.</exception>
[Obsolete("Use of this method is deprecated. Use IEnumerable<T>.IsEmpty<T>() instead.")]
public static bool Empty<TSource>(this IEnumerable<TSource> source)
{
if (source == null)
Expand Down Expand Up @@ -253,8 +326,8 @@ public static IEnumerable<T> SkipLast<T>(this IEnumerable<T> source)
/// <param name="source">The sequence to remove elements from.</param>
/// <param name="count">The number of elements to remove.</param>
/// <returns>
/// An <see cref="IEnumerable{T}"/> instance that doesn't contain the specified number of elements at
/// the end of the input sequence.
/// An <see cref="IEnumerable{T}"/> instance that doesn't contain the specified number of elements
/// at the end of the input sequence.
/// </returns>
/// <exception cref="ArgumentNullException">
/// <paramref name="source"/> is <c>null</c>.
Expand Down Expand Up @@ -285,7 +358,8 @@ public static IEnumerable<T> SkipLast<T>(this IEnumerable<T> source, int count)
/// <typeparam name="TSource">The type of the elements of <paramref name="source"/>.</typeparam>
/// <param name="source">The sequence to create an <see cref="ObservableCollection{T}"/> from.</param>
/// <returns>
/// An <see cref="ObservableCollection{T}"/> instance that contains elements from the input sequence.
/// An <see cref="ObservableCollection{T}"/> instance that contains elements from the input
/// sequence.
/// </returns>
/// <exception cref="ArgumentNullException">
/// <paramref name="source"/> is <c>null</c>.
Expand Down
15 changes: 0 additions & 15 deletions src/StevenVolckaert.Core/Properties/AssemblyInfo.cs

This file was deleted.

40 changes: 40 additions & 0 deletions src/StevenVolckaert.Core/StevenVolckaert.Core.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<AssemblyName>StevenVolckaert.Core</AssemblyName>
<AssemblyTitle>Steven Volckaert's Enterprise Library - Core</AssemblyTitle>
<NeutralLanguage>en-US</NeutralLanguage>
<VersionPrefix>1.0.1</VersionPrefix>
<VersionSuffix>alpha</VersionSuffix>
<Copyright>Copyright (c) 2016, 2017 Steven Volckaert</Copyright>
<Description>Steven Volckaert's Enterprise Library contains reusable software components designed to assist software developers with writing less and semantically more meaningful code.

See https://github.com/stevenvolckaert/enterprise-library for more information.</Description>
<Authors>Steven Volckaert</Authors>
<TargetFrameworks>net452;netstandard1.5</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageId>StevenVolckaert.Core</PackageId>
<PackageProjectUrl>https://github.com/stevenvolckaert/enterprise-library</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/stevenvolckaert/enterprise-library/blob/master/LICENSE</PackageLicenseUrl>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/stevenvolckaert/enterprise-library</RepositoryUrl>
<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.5' ">1.6.1</NetStandardImplicitPackageVersion>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<RootNamespace>StevenVolckaert</RootNamespace>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
<FileVersion>1.1.0.0</FileVersion>
<Version>1.1.0</Version>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net35' ">
<Reference Include="System" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>

</Project>
Loading

0 comments on commit 73d36c2

Please sign in to comment.