Releases: skybrud/Skybrud.Essentials
Skybrud.Essentials v1.1.25
Installation
Changelog
-
Added new
ReflectionExtensionclass (see 8739004)
A previous release introduced static utility methods in theReflectionUtilsclass for working with enums and custom attributes. Similar extension methods are now available through the newReflectionExtensionsclass. -
Added
GetCustomAttributemethods (see 8d20279)
As an alternative to getting a collection of attributes, this method will return the first matching attribute - ornullif no matching attributes are found. The method is available as a static method in theReflectionUtilsclass and as an extension method in theReflectionExtensionsclass. -
Added new
IsAlphabeticutility method to theStringUtilsclass (see 0706caf)
The methods returns whether an input string only consists of numbers and letters. -
Added new
Levenshteinutility method to theStringUtilsclass (see 79acc4f)
The methods returns the Levenshtein distance between two strings. This can for instance be used to compare the relevance between the two input strings. -
Added new
IsNumeric,IsAlphanumericandIsAlphabeticextension methods (see 7257226)
Similar to normal static methods, these methods can now also be used as extension methods onstringinstances. -
Added
GetFloatArray,GetSingleArrayandGetDoubleArrayextension methods to theJObjectExtensionsclass (see a64d990)
The new methods adds similar functionality as the existingToInt32ArrayandToInt64Arrayextension methods, but for different value types. -
Introduced new
TryParseBooleanmethod in theStringUtilsclass (see 225255a)
Similar to theParseBooleanmethods in the same class, these methods will check more more values than justTrueandFalseas thebool.TryParsemethod does. -
Introduced new string extension methods (see d80150f)
The new extension methods includeIsBoolean,IsGuid,IsInt32andIsInt64. -
Introduced new class with
NameValueCollectionextension methods (see 9c51348)
The new class introduces extension methods such asGetBoolean,TryGetBoolean,GetInt32,TryGetInt32,TryGetValueandContainsKey. -
Added new methods to the
EnumUtilsclass (see c4eb3bc)
The class already contains a number of generic methods for working with enum, but when the enum type is known at compile time. The new methods can be used when the enum type is only known at runtime. -
Introduced new EnumArrayJsonConverter JSON converter (see 3ce2189)
The converter can be used to deserialize multiple enum values. It does not support serializing/writing.
Skybrud.Essentials v1.1.24
Installation
Changelog
-
Introduced
IsTomorrowandIsYesterdayproperties for theEssentialsTimeclass (see c3e55fc)
Similar to how the existingIsTodayproperty can be used to check whether the an instance ofEssentialsTimematches the current day, theIsYesterdayandIsTomorrowproperties can now be used to check whether aEssentialsTimematches the day before or after the current day respectively. -
Fixed issue in the
EssentialsTimeconstructor (see 45bbc3c)
In some situations, the constructor would throw an exception if the specifieddateTimedidn't matchtimeZone. -
Introduced the
PointUtilsclass (see 6424864)
The class replaces theDistanceUtilsclass, which has now been marked as obsolete. The new class is added because it now contains methods for more than just calculating the distance between two points as theDistanceUtilsdid. -
Added
GetDistanceextension methods to thePointExtensionsclass (see cfe1d9f)
The extension methods let's you calculate the distance between two instances ofIPoint. -
Added
MinandMaxmethod overloads to theEnumUtilsclass (see 97a2578)
The new extension methods let's you compare multiple enum values. -
Improved implementation of existing
MinandMaxmethods (see 2319d2f)
The existing implementation would useEnum.GetNameto first get the name, and theEnum.Parseto convert the name to the corresponding enum value. The new implementation usesEnum.ToObject, which skips the step of finding the name first, which makes it a lot faster.
Skybrud.Essentials v1.1.23
Installation
Changelog
-
Added extension method for checking whether a point matches Null Island (see 81e949d, 0f8f8a4)
While partially a joke, Null Island refers to the point at zero degrees latitude and longitude. The extension method gives an easy way to check whether an instance ofIPointmatches Null Island - which then typically indicates invalid coordinates. -
Added utility methods for working with reflection and and custom attributes (see a98d8dc)
This release introducesGetCustomAttribute,GetCustomAttributesandHasCustomAttributeutility methods targeting for bothEnumandMemberInfo, allowing for cleaner code when working with custom attributes. -
Added non-generic versions of the
Cast,ToListandToArrayextension methods (see bdde027)
The extension methods can be used as alternatives to their generic counterparts when the target type is not known at compile time.
Skybrud.Essentials v1.1.22
Installation
Changelog
-
Added new
GetEnumValuesmethod overload (see 84e57ff)
The new overload returns an array ofEnum- opposed to an instance of theArrayclass as returned by the nativeEnum.GetValuesmethod. -
Introduced new
ReflectionUtilsclass (see e31ab32, 18d1ad3, c030455 and 620c735)
The new class replaces theAssemblyUtilsclass and also adds a number of useful methods when working with reflection. -
Introduced new helper and extension methods for working with regular expression (see bcb5229)
The new methods doesn't really add any new functionality than the static methods on theRegexclass in .NET, but by returningMatchorMatchCollectionvia anoutparameter, it may help your code to look a bit more readable or clean. -
Added new extension methods for converting strings to doubles and floats (9cf2bb6)
Similar to how this package has hadToBoolean,ToInt32,ToInt64andToGuidextension methods for a while, it now hasToDoubleandToFloatextension methods. -
Improved support for code inspection with JetBrains.Annotations (see f58123a)
This will help ReSharper give better suggestions when using the methods and parameters that now has been decorated with attributes from the JetBrains.Annotations package.JetBrains.Annotations is installed as a dev assembly, meaning that it will not be installed along Skybrud.Essentials, but you still get the benefits of you have ReSharper installed. If use reflection against the decorated methods and parameters, you'll however have to install the JetBrains.Annotations package manually in your project to avoid exceptions about the used attributes not being found.
Skybrud.Essentials v1.1.21
Installation
Changelog
-
Added new
OrderByoverloads to theEnumerableExtensionsclass (see #12 and 2bd1ed1)
The newOrderByoverloads adds support for specifying an instance ofIComparer<TKey>to control how the elements are sorted.For instance
StringComparer.Create(CultureInfo.GetCultureInfo("da-DK"), false)may be specified to ensure elements are sorted following Danish language rules (aais treated aså). -
Added lots of new logic for working with day names and month names (82c0814 and 334d815)
This release adds new methods and method overloads to theTimeUtilsclass as well as theDateTimeExtensionsandDateTimeOffsetExtensionsclasses.
Skybrud.Essentials v1.1.20
Installation
Changelog
-
Added constructor overload to the
EssentialsTimeclass (see 662fa92)
The constructor supports specifying aDateTimeinstance along with aTimeZoneInfoinstance to adjust the time zone of theDateTime. -
Added
ParseJsonTokenandLoadJsonTokenmethods to theJsonUtilsclass (a0c374c)
The new methods are added as additions to the existing methods for parsing and loading JSON objects and arrays.
Skybrud.Essentials v1.1.19
Installation
Changelog
- Fixed an issue with
EssentialsWeeknot properly determining the year (see 6ca8a4d)
According to ISO 8601 a week belongs to the year that contains the majority of the days in the week, so a given date may not belong to the same year as the week. Some of the constructors of theEssentialsWeekclass didn't handle this properly.
Skybrud.Essentials v1.1.18
Installation
Changelog
-
Fixed an issue with
EssentialsWeek.GetEnumeratornot properly taking daylight savings into account (see 9a169be)
The enumerator would return a result with two Mondays when iterating over week 42 (as daylights savings is no longer in effect) 😊 -
Introduced new
GetsDaysBetweenmethod for theEssentialsDateclass (see 8c12b93)
The method can be used for calculating the difference between two dates. As there is no time or time zones involved when usingEssentialsDate, the result is an integer representing the number of days between the two dates.
Skybrud.Essentials v1.1.17
Installation
Changelog
-
Added
YearAndDateproperties to theEssentialsTimeandEssentialsDateclasses (see 5cb10ee)
The new properties expose the date as a numeric value based on both the year and the day of the year, which makes the value ideal for comparing and sorting. -
Fixed issue with the
IsTodayproperty inEssentialsTime(see 04b23e7 and #10)
The property compared against a wrong value, causing it to never betrue- even when should be.. -
Added new
DaySuffixproperties to theEssentialsTimeandEssentialsDateclasses (see 097d56d)
The properties return the English day suffix (eg.1st,2ndand so forth) based on the underlying date. -
Added new
AddDaysmethod to theEssentialsDateclass (see ffe7cd4)
The new method allows you to add a number of days to a date - eg.date.AddDays(1)to get the next day, ordate.AddDays(-1)to get the previous date. -
Introduced new
EssentialsDateRangeclass (see d6f05a7)
By giving the constructor a start and end date, the class let's you iterate over eachEssentialsDatewithin the range. The class let's you iterate both in regular and reverse order depending on the input to the constructor. -
Introduced new
ToStringJsonConverterJSON converter (see 80288e1 and #9)
The JSON converter will automatically call theToStringmethod on the object it's supposed to serialize. The JSON converter does not support deserialization. -
Added new constructor overloads to the
EssentialsWeekclass (see 60dc84e)
TheEssentialsWeeknow has two ned constructor overloads, where the first takes an instance ofEssentialsDateand the second takes both anEssentialsDateand aTimeZoneInfo. -
Various improvements to the
EssentialsWeekclass (see 7833df1)
Improvements include a constructor overload taking ayear,monthandday. -
Introduced the
EssentialsWeekRangeclass (see 1754af4)
By giving the constructor a start and end week, the class let's you iterate over eachEssentialsWeekwithin the range. The class let's you iterate both in regular and reverse order depending on the input to the constructor.
v1.1.16
Installation
Changelog
-
Individual enum string converter classes are no longer marked as obsolete (see 39899ec)
TheEnumCamelCaseConveter,EnumLowerCaseConverterandEnumPascalCaseConverterclasses now inherit from theEnumStringConverterclass in stead of having their own implementations. -
UnixTimeConverterJSON converter is no longer obsolete (see cb4ab55)
Instead of having it's own implementation (which was why the class was marked as obsolete), the class now inherits fromTimeConverterand specifies that the format should be unix time. -
Added more
GetAgemethod overloads to theTimeUtilsclass (see 5db70b9 and a4bff3e)
The added overloads support different types of parameters - eg. it's now possible to calculate the age between two instances ofEssentialsDate. -
Added extra properties to the
EssentialsTimeclass (see f2c15bc)
Added properties includeIsToday,DayNameandMonthName. -
Added
JsonConverterattribute to theEssentialsDateclass (see 133a333)
TheJsonConverterattribute now specifies that theTimeConverterclass should be used when serializing and deserializing instances ofEssentialsDate. This means that instances will be serialized to an ISO 8601 formatted string instead of a JSON object will all the properties of theEssentialsDateclass.