hw.ReplaceVariables 20.0.0.1

dotnet add package hw.ReplaceVariables --version 20.0.0.1
NuGet\Install-Package hw.ReplaceVariables -Version 20.0.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="hw.ReplaceVariables" Version="20.0.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add hw.ReplaceVariables --version 20.0.0.1
#r "nuget: hw.ReplaceVariables, 20.0.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install hw.ReplaceVariables as a Cake Addin
#addin nuget:?package=hw.ReplaceVariables&version=20.0.0.1

// Install hw.ReplaceVariables as a Cake Tool
#tool nuget:?package=hw.ReplaceVariables&version=20.0.0.1

Example:

           using hw.ReplaceVariables;

           static public class Example
           {
           public static void TestMethod()
           {
           var myData = new MyData();
           var format = "i: $(InvoiceDate) - n: $(Now) - id: $(InvoiceDate.Date) - in: $(ImportantNumber) - asis: $(=ImportantNumber) ";
           var expectedResult = "i: 22.04.2014 22:57:34 - n: 27.05.2014 22:57:34 - id: 22.04.2014 - in: 42 - asis: $(ImportantNumber) ";
           var result = format.ReplaceVariables(myData);
           Tracer.Assert(result == expectedResult);
           }

           sealed class MyData
           {
           [Visible]
           DateTimeSpecial InvoiceDate { get { return new DateTimeSpecial(new DateTime(2014,5,27,22,57,34).AddDays(-35)); } }
           [Visible]
           DateTimeSpecial Now = new DateTimeSpecial(new DateTime(2014, 5, 27, 22, 57, 34));
           [Visible]
           int ImportantNumber = 42;
           }

           sealed class DateTimeSpecial
           {
           DateTime _value;
           public DateTimeSpecial(DateTime value) { _value = value; }
           [Visible]
           int Day { get { return _value.Day; } }
           [Visible]
           int Month { get { return _value.Month; } }
           [Visible]
           int Year { get { return _value.Year; } }
           [Visible]
           string Date { get { return _value.Date.ToShortDateString(); } }
           public override string ToString() { return _value.ToString(); }
           }
           }

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
20.0.0.1 516 9/30/2020
20.0.0 510 9/30/2020
14.3.0 1,489 6/13/2014
14.2.0 1,176 5/28/2014
14.1.0 1,124 5/28/2014
14.0.0 1,177 5/27/2014

change: Upgrade to new style
         14.3.0.0
         - parameter checks
           - access variables only when required by target string