0

I define a method in a class and call it in another class. It works fine.

But, if I select the method and press F12, Visual Studio will find the method and show me the statements code automatically.

I have tried it with the method: Console.WriteLine();. I select WriteLine and press F12. It redirects me to:

namespace System
{
   public static class Console
   {
      public static void WriteLine();
   }
}

All of the statements code of WriteLine() are hidden (sorry, hidden means that I don't see it).

I want to write a new method like WriteLine():

public int Add(int a, int b);

But I don't know where is the place I can implement method Add(int a, int b) (in another class).

Can you teach me?

KarmaEDV
  • 1,631
  • 16
  • 27
  • The answer below was exactly my thoughts and works well. You could try "method hiding with inheritance" – Tez Wingfield Aug 12 '15 at 07:06
  • 1
    The question makes no sense. What is the *actual* problem you are trying to solve? You can't disable IDE functionality from source code, nor should you want to. Disabling the "Go To" button makes absolutely no sense - anyone can still read the source code, search for the definitions, etc. – Panagiotis Kanavos Aug 12 '15 at 07:06

1 Answers1

1

Only the compiled (dll) methods can't be shown. If you're importing a project with code source then you'll see the code (that's the purpose)

tafia
  • 1,512
  • 9
  • 18