Update function signature

O

omtechguy

Hi,

I found that when i try to use function that doesn't exist, VS allow
me to generate the function (including the parameters) and all i need
to do it to impelement the body of the function.

Is there a quick way to add a parameter to the function instead of
adding it manually?

Thanks.
 
M

Matt

Perhaps you should try to express your question in a clearer way.

You already seem to understand that if you type an argument in the method
call site, the auto-implement feature will include that argument as a
parameter for the method when it's auto-implemented.

For example, if you type this in:

  bool f = SomeNewMethod("foo");

...and then have VS auto-implement the method "SomeNewMethod", you get
something like this:

  bool SomeNewMethod(string p)
  {
    throw new NotImplementedException();
  }

What else do you want?

Pete

He wants to do something like this:

given a method Foo:

public Foo(string s) {};

he then wishes to change it:

public Foo(int i, string s) {}

and have the system update. This can be done, of course, refactoring
is easy. But what is "i" across
the system?

Matt
 
A

Arne Vajhøj

He wants to do something like this:

given a method Foo:

public Foo(string s) {};

he then wishes to change it:

public Foo(int i, string s) {}

and have the system update. This can be done, of course, refactoring
is easy. But what is "i" across
the system?

Just change the method and fix all the build errors
one by one.

:)

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top