Skip to content

JanKupke1/CodeRefactoringsForPrismInVisualStudio

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

I need some refractors as used at [Original]https://github.com/NeVeSpl/CodeRefactoringsForVisualStudio However, these should full fill the following points:

  1. work with SetProperty from Prism
  2. shorten the property text
  3. keep the DataAnnotations
  4. use the notation stored in Visual Studio for the private variables

1. Convert To full prism property

From

      public string SomeProperty { get; set; }  

To

 private string _someProperty;

 public string SomeProperty
        {
            get
            {
                return _someProperty;
            }

            set
            {
                SetProperty(ref _someProperty, value);
            }
        }

It works.

2. shorten the property text

I want to bring the Code from:

 private string _someProperty;

 public string SomeProperty
        {
            get
            {
                return _someProperty;
            }

            set
            {
                SetProperty(ref _someProperty, value);
            }
        }

To

   private string _someProperty;

   public string SomeProperty
        {
            get{return _someProperty;}
            set{SetProperty(ref _someProperty, value);}
        }

But at now, it does't work

2. keep the data annotations

From

      [Required]
      public string SomeProperty { get; set; }  

To

   private string _someProperty;
   
   [Required]
   public string SomeProperty
        {
            get{return _someProperty;}
            set{SetProperty(ref _someProperty, value);}
        }

But at now, it does't work

About

Roslyn based, set of code refactorings for Visual Studio

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%