GrossumRed 0.0.1-a37

This is a prerelease version of GrossumRed.

Requires NuGet 2.5 or higher.

dotnet add package GrossumRed --version 0.0.1-a37
NuGet\Install-Package GrossumRed -Version 0.0.1-a37
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="GrossumRed" Version="0.0.1-a37" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add GrossumRed --version 0.0.1-a37
#r "nuget: GrossumRed, 0.0.1-a37"
#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 GrossumRed as a Cake Addin
#addin nuget:?package=GrossumRed&version=0.0.1-a37&prerelease

// Install GrossumRed as a Cake Tool
#tool nuget:?package=GrossumRed&version=0.0.1-a37&prerelease

GrossumRed generates csharp code which inherits INotifyPropertyChanged from POCO.

Example

Input VmCls.vm.cs:

using System;

namespace Hoge
{
    public class VmCls: System.Object
    {
        public int PropertyA { get; set; }
        public string PropertyB { get; set; }
    }
}

Output VmCls.vm.g.cs:
For readability, I removed some extra code (such as #line) and indented.

using System;

namespace Hoge
{
    public class VmCls : System.Object, System.ComponentModel.INotifyPropertyChanged
    {
        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;

        public int PropertyA
        {
            get { return __PropertyA; }

            set
            {
                if (Object.ReferenceEquals(__PropertyA, value)) return;
                if (Object.ReferenceEquals(__PropertyA, null) || !__PropertyA.Equals(value))
                {
                    __PropertyA = value;

                    if (PropertyChanged != null)
                    {
                        PropertyChanged.Invoke(
                            this,
                            new System.ComponentModel.PropertyChangedEventArgs("PropertyA"));
                    }
                }
            }

        }
        private int __PropertyA;

        public string PropertyB
        {
            get { return __PropertyB; }

            set
            {
                if (Object.ReferenceEquals(__PropertyB, value)) return;
                if (Object.ReferenceEquals(__PropertyB, null) || !__PropertyB.Equals(value))
                {
                    __PropertyB = value;

                    if (PropertyChanged != null)
                    {
                        PropertyChanged.Invoke(
                            this,
                            new System.ComponentModel.PropertyChangedEventArgs("PropertyB"));
                    }
                }
            }
        }
        private string __PropertyB;

    }
}

How to use

You will need to reload your project for the 'GrossumVwMdl' build action to be recognized.

Once you marked file as 'GrossumVwMdl' in your project, this file will be compiled to their respective .g.cs parser classes before every build. These classes will be automatically included in compilation.

If you mark .cs file, you may unregister from compiler target.

WpfSmple.csproj:

<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
  <PropertyGroup>
    <OutputType>WinExe</OutputType>
    <TargetFrameworks>net45</TargetFrameworks>
    <UseWPF>true</UseWPF>
  </PropertyGroup>

  <ItemGroup>
    <Compile Remove="MainWindowViewModel.vm.cs" />
    <GrossumVwMdl Include="MainWindowViewModel.vm.cs" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="GrossumRed" Version="0.0.1-a15" />
  </ItemGroup>
</Project>
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
0.0.1-a37 214 8/24/2021
0.0.1-a26 147 8/18/2021