Sunday 15 June 2014

c# - Resharper not allowing me to refactor a static method to an instance method -


I am using ReSource to redo a static method to reset, but the racer is an error There is no proper parameter in the method which can be made in this'

What is the meaning of this? Here is my class method:

  Public StateTime previous OCRC quarter (datetime date) {quarter qrtr = getquarter (date); Date Timeout = Quarter = GetEndOfQuarter (date.Year, qrtr); If (endoffire == date) date of return; Other {DateTime startOfLast = GetStartOfQuarter (date.Year, qrtr); Return start oblast Adwords (-1); }}   

Both GetEndOfQuarter and GetStartOfQuarter are both other static methods in the same class.

You do not need to do anything special to create an example method. Just remove the stable qualifier and can be done.

Resharper has the convenience of converting the following static method into an example method:

  public class MyClass {public static zero doSomething (MyClass cheese, int value) {thing. Action (value); }}   

becomes

  public class MyClass {public zero doSomething (int value) {this.Action (value); }}   

Note the change in 'this' from 'talk'

No comments:

Post a Comment