Moved to GitHub

On April 18th, 2013 we moved to GitHub because it provides better support for pull requests and has better integration with our issue tracker.

For the latest source code, please visit https://github.com/Catel/Catel.ReSharper

Introduction

ReSharper plugin for Catel.

Convert this


/// <summary>
/// The person.
/// </summary>
public class Person
{
   #region Public Properties

    /// <summary>
    /// Gets or sets the age.
    /// </summary>
    public int Age { get; set; }

    /// <summary>
    /// Gets or sets the first name.
   /// </summary>
   public string FirstName { get; set; }

    /// <summary>
    /// Gets or sets the last name.
    /// </summary>
    public string LastName { get; set; }

    #endregion
}

into this


/// <summary>
/// The person.
/// </summary>
public class Person : ModelBase
{
    #region Static Fields

    /// <summary>
    /// Register the Age property so it is known in the class.
    /// </summary>
    public static readonly PropertyData AgeProperty = RegisterProperty(
            "Age", typeof(int), default(int), (s, e) => ((Person)s).OnAgeChanged(e));

    /// <summary>
    ///  Register the FirstName property so it is known in the class.
    /// </summary>
    public static readonly PropertyData FirstNameProperty = RegisterProperty("FirstName", typeof(string));

    /// <summary>
    /// Register the LastName property so it is known in the class.
    /// </summary>
    public static readonly PropertyData LastNameProperty = RegisterProperty(
            "LastName", typeof(string), default(string), (s, e) => ((Person)s).OnLastNameChanged());

        #endregion

        #region Public Properties

    /// <summary>
    /// Gets or sets the age.
    /// </summary>
    public int Age
    {
       get { return GetValue<int>(AgeProperty); }
       set { SetValue(AgeProperty, value); }
    }

    /// <summary>
    /// Gets or sets the first name.
    /// </summary>
    public string FirstName
    {
       get { return GetValue<string>(FirstNameProperty); }
       set { SetValue(FirstNameProperty, value); }
    }

    /// <summary>
    /// Gets or sets the last name.
    /// </summary>
    public string LastName
    {
        get { return GetValue<string>(LastNameProperty); }
        set { SetValue(LastNameProperty, value); }
    }

    #endregion

    #region Methods

    /// <summary>
    /// Occurs when the value of the Age property is changed.
    /// </summary>
    /// <param name="e">
    /// The event argument
    /// </param>
    private void OnAgeChanged(AdvancedPropertyChangedEventArgs e)
    {
        throw new NotImplementedException();
    }

    /// <summary>
    ///  Occurs when the value of the LastName property is changed.
    /// </summary>
    private void OnLastNameChanged()
    {
        throw new NotImplementedException();
    }

    #endregion
}

with pleasure!

But if are you pro weaving, less code and AOP sense, try with Catel.Fody

Tested with:
  • JetBrains R#6.1 (6.1.1000.82) and Visual Studio 2010
  • JetBrains R#7.0 (7.0.1098.2760) and Visual Studio 2010
  • JetBrains R#7.0 (7.0.1098.2760) and Visual Studio 2012

Powered by: Catel and Caitlyn

Supported version: Catel 3.3 (Core, MVVM) or early

Articles and blog posts

Last edited Apr 18, 2013 at 5:43 PM by GeertvanHorrik, version 22