Skip to content

Releases: skybrud/Skybrud.Essentials

Skybrud.Essentials v1.1.25

01 Nov 17:33

Choose a tag to compare

Installation

Changelog

  • Added new ReflectionExtension class (see 8739004)
    A previous release introduced static utility methods in the ReflectionUtils class for working with enums and custom attributes. Similar extension methods are now available through the new ReflectionExtensions class.

  • Added GetCustomAttribute methods (see 8d20279)
    As an alternative to getting a collection of attributes, this method will return the first matching attribute - or null if no matching attributes are found. The method is available as a static method in the ReflectionUtils class and as an extension method in the ReflectionExtensions class.

  • Added new IsAlphabetic utility method to the StringUtils class (see 0706caf)
    The methods returns whether an input string only consists of numbers and letters.

  • Added new Levenshtein utility method to the StringUtils class (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, IsAlphanumeric and IsAlphabetic extension methods (see 7257226)
    Similar to normal static methods, these methods can now also be used as extension methods on string instances.

  • Added GetFloatArray, GetSingleArray and GetDoubleArray extension methods to the JObjectExtensions class (see a64d990)
    The new methods adds similar functionality as the existing ToInt32Array and ToInt64Array extension methods, but for different value types.

  • Introduced new TryParseBoolean method in the StringUtils class (see 225255a)
    Similar to the ParseBoolean methods in the same class, these methods will check more more values than just True and False as the bool.TryParse method does.

  • Introduced new string extension methods (see d80150f)
    The new extension methods include IsBoolean, IsGuid, IsInt32 and IsInt64 .

  • Introduced new class with NameValueCollection extension methods (see 9c51348)
    The new class introduces extension methods such as GetBoolean, TryGetBoolean, GetInt32, TryGetInt32, TryGetValue and ContainsKey.

  • Added new methods to the EnumUtils class (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

27 Sep 18:16

Choose a tag to compare

Installation

Changelog

  • Introduced IsTomorrow and IsYesterday properties for the EssentialsTime class (see c3e55fc)
    Similar to how the existing IsToday property can be used to check whether the an instance of EssentialsTime matches the current day, the IsYesterday and IsTomorrow properties can now be used to check whether a EssentialsTime matches the day before or after the current day respectively.

  • Fixed issue in the EssentialsTime constructor (see 45bbc3c)
    In some situations, the constructor would throw an exception if the specified dateTime didn't match timeZone.

  • Introduced the PointUtils class (see 6424864)
    The class replaces the DistanceUtils class, 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 the DistanceUtils did.

  • Added GetDistance extension methods to the PointExtensions class (see cfe1d9f)
    The extension methods let's you calculate the distance between two instances of IPoint.

  • Added Min and Max method overloads to the EnumUtils class (see 97a2578)
    The new extension methods let's you compare multiple enum values.

  • Improved implementation of existing Min and Max methods (see 2319d2f)
    The existing implementation would use Enum.GetName to first get the name, and the Enum.Parse to convert the name to the corresponding enum value. The new implementation uses Enum.ToObject, which skips the step of finding the name first, which makes it a lot faster.

Skybrud.Essentials v1.1.23

10 Sep 21:30

Choose a tag to compare

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 of IPoint matches Null Island - which then typically indicates invalid coordinates.

  • Added utility methods for working with reflection and and custom attributes (see a98d8dc)
    This release introduces GetCustomAttribute, GetCustomAttributes and HasCustomAttribute utility methods targeting for both Enum and MemberInfo, allowing for cleaner code when working with custom attributes.

  • Added non-generic versions of the Cast, ToList and ToArray extension 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

21 Jul 21:13

Choose a tag to compare

Installation

Changelog

  • Added new GetEnumValues method overload (see 84e57ff)
    The new overload returns an array of Enum - opposed to an instance of the Array class as returned by the native Enum.GetValues method.

  • Introduced new ReflectionUtils class (see e31ab32, 18d1ad3, c030455 and 620c735)
    The new class replaces the AssemblyUtils class 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 the Regex class in .NET, but by returning Match or MatchCollection via an out parameter, 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 had ToBoolean, ToInt32, ToInt64 and ToGuid extension methods for a while, it now has ToDouble and ToFloat extension 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

11 Jun 20:22

Choose a tag to compare

Installation

Changelog

  • Added new OrderBy overloads to the EnumerableExtensions class (see #12 and 2bd1ed1)
    The new OrderBy overloads adds support for specifying an instance of IComparer<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 (aa is 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 the TimeUtils class as well as the DateTimeExtensions and DateTimeOffsetExtensions classes.

Skybrud.Essentials v1.1.20

16 Feb 16:13

Choose a tag to compare

Installation

Changelog

  • Added constructor overload to the EssentialsTime class (see 662fa92)
    The constructor supports specifying a DateTime instance along with a TimeZoneInfo instance to adjust the time zone of the DateTime.

  • Added ParseJsonToken and LoadJsonToken methods to the JsonUtils class (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

31 Dec 14:25

Choose a tag to compare

Installation

Changelog

  • Fixed an issue with EssentialsWeek not 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 the EssentialsWeek class didn't handle this properly.

Skybrud.Essentials v1.1.18

03 Nov 19:01

Choose a tag to compare

Installation

Changelog

  • Fixed an issue with EssentialsWeek.GetEnumerator not 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 GetsDaysBetween method for the EssentialsDate class (see 8c12b93)
    The method can be used for calculating the difference between two dates. As there is no time or time zones involved when using EssentialsDate, the result is an integer representing the number of days between the two dates.

Skybrud.Essentials v1.1.17

20 Oct 18:29

Choose a tag to compare

Installation

Changelog

  • Added YearAndDate properties to the EssentialsTime and EssentialsDate classes (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 IsToday property in EssentialsTime (see 04b23e7 and #10)
    The property compared against a wrong value, causing it to never be true - even when should be..

  • Added new DaySuffix properties to the EssentialsTime and EssentialsDate classes (see 097d56d)
    The properties return the English day suffix (eg. 1st, 2nd and so forth) based on the underlying date.

  • Added new AddDays method to the EssentialsDate class (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, or date.AddDays(-1) to get the previous date.

  • Introduced new EssentialsDateRange class (see d6f05a7)
    By giving the constructor a start and end date, the class let's you iterate over each EssentialsDate within the range. The class let's you iterate both in regular and reverse order depending on the input to the constructor.

  • Introduced new ToStringJsonConverter JSON converter (see 80288e1 and #9)
    The JSON converter will automatically call the ToString method on the object it's supposed to serialize. The JSON converter does not support deserialization.

  • Added new constructor overloads to the EssentialsWeek class (see 60dc84e)
    The EssentialsWeek now has two ned constructor overloads, where the first takes an instance of EssentialsDate and the second takes both an EssentialsDate and a TimeZoneInfo.

  • Various improvements to the EssentialsWeek class (see 7833df1)
    Improvements include a constructor overload taking a year, month and day.

  • Introduced the EssentialsWeekRange class (see 1754af4)
    By giving the constructor a start and end week, the class let's you iterate over each EssentialsWeek within the range. The class let's you iterate both in regular and reverse order depending on the input to the constructor.

v1.1.16

15 Sep 18:03

Choose a tag to compare

Installation

Changelog

  • Individual enum string converter classes are no longer marked as obsolete (see 39899ec)
    The EnumCamelCaseConveter, EnumLowerCaseConverter and EnumPascalCaseConverter classes now inherit from the EnumStringConverter class in stead of having their own implementations.

  • UnixTimeConverter JSON 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 from TimeConverter and specifies that the format should be unix time.

  • Added more GetAge method overloads to the TimeUtils class (see 5db70b9 and a4bff3e)
    The added overloads support different types of parameters - eg. it's now possible to calculate the age between two instances of EssentialsDate.

  • Added extra properties to the EssentialsTime class (see f2c15bc)
    Added properties include IsToday, DayName and MonthName.

  • Added JsonConverter attribute to the EssentialsDate class (see 133a333)
    The JsonConverter attribute now specifies that the TimeConverter class should be used when serializing and deserializing instances of EssentialsDate. This means that instances will be serialized to an ISO 8601 formatted string instead of a JSON object will all the properties of the EssentialsDate class.