简体   繁体   中英

How to prevent anyone sees method statements code when pressing F12?

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?

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM