Com.MarcusTS.SharedUtils 1.0.34

There is a newer version of this package available.
See the version list below for details.
Install-Package Com.MarcusTS.SharedUtils -Version 1.0.34
dotnet add package Com.MarcusTS.SharedUtils --version 1.0.34
<PackageReference Include="Com.MarcusTS.SharedUtils" Version="1.0.34" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Com.MarcusTS.SharedUtils --version 1.0.34
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Com.MarcusTS.SharedUtils, 1.0.34"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Com.MarcusTS.SharedUtils as a Cake Addin
#addin nuget:?package=Com.MarcusTS.SharedUtils&version=1.0.34

// Install Com.MarcusTS.SharedUtils as a Cake Tool
#tool nuget:?package=Com.MarcusTS.SharedUtils&version=1.0.34
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

SHARED UTILS: Making C# Quick, Easy and Safe

Programs Should Not Be Redundant In Any Way

SOLID and DRY guidance declare that we should keep our C# code simple, narrow, and non-redundant. For instance, simple code like this:

var areSame = 
   string.Compare(mainStr, otherStr, CurrentCulture.CurrentCultureIgnoreCase) == 0;

... is both ungainly and unnecessary. DRY does not refer to copying code like this, though it is certainly illegal:

var areSameCheckedAgainRedundantly = 
   string.Compare(mainStr, otherStr, CurrentCulture.CurrentCultureIgnoreCase) == 0;

DRY means: no redundancy whatsoever, regardless of where it lurks. In this example, a parameter is redundant, and the check for 0 is both static (not a variable but also not even a constant!) and redundant. The fix is easy -- just use our SharedUtils extensions to code this quickly and safely:

using Com.MarcusTS.SharedUtils;

if (mainStr.isSameAs(otherStr))

If you are looking for "not same as", then use this:

using Com.MarcusTS.SharedUtils;

if (mainStr.isDifferentThan(otherStr))

SharedUtils provides similar comparison extensions for many C# types, including DateTime, numbers, and even IEnumerables!

SharedUtils also offers:

  • A BetterObservableCollection that manages events more safely than in the C# version.
  • A FlexibleStack that allows manipulation of a common stack.
  • Reflection helpers
  • Thread helpers,including a thread-safe Boolean
  • Task helpers
  • Numeric rounding

SharedUtils Is Open Source; Enjoy Our Other Offerings

If you find value in SharedUtils, consider these other related projects:

Shared Utils



The Smart DI Container



Shared Forms



Responsive Tasks



Responsive Tasks - Xamarin.Forms Support



The Modern App Demo



NuGet packages (4)

Showing the top 4 NuGet packages that depend on Com.MarcusTS.SharedUtils:

Package Downloads

A container that creates and then (optionally) stores variables to provide caching and centralized access. These sorts of containers are sometimes mis-described as IOC ("Inversion of Control") Containers. Since they do not provide any control over program flow, the accurate term is DI ("Dependency Injection") Container. The SmartDI Container is unique in that it: * Does not store instantiated objects unnecessarily. * Supports object life-cycle management. When an object dies, it is removed from the container. This requires you to raise a global message. * Supports simple register-and-resolve so types do not need to be registered in advance.


TPL compatible replacement for events and global messages


Platform independent utilities for C# development.


Xamarin.Forms abstract classes and utilities to support creating flowable animated apps.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.2 483 10/29/2021
2.0.1 301 10/28/2021
1.0.37 209 10/28/2021
1.0.36 133 10/28/2021
1.0.34 276 8/27/2021
1.0.33 379 8/24/2021
1.0.32 350 8/17/2021
1.0.30 113 8/16/2021
1.0.29 395 8/14/2021
1.0.28 546 8/10/2021
1.0.27 299 7/5/2021
1.0.26 569 6/24/2021
1.0.24 384 6/2/2021
1.0.22 799 4/7/2021
1.0.21 172 4/6/2021
1.0.20 162 4/6/2021
1.0.19 177 4/2/2021
1.0.18 341 4/1/2021
1.0.17 429 1/30/2021
1.0.16 783 10/28/2020
1.0.15 601 10/28/2020
1.0.14 400 9/11/2020
1.0.13 548 4/22/2020
1.0.12 1,030 10/26/2019
1.0.11 624 7/30/2019
1.0.10 1,052 6/10/2019
1.0.9 419 6/10/2019
1.0.7 1,200 12/25/2018
1.0.5 1,113 12/24/2018
1.0.1 550 12/24/2018
1.0.0 532 12/24/2018