GO to definition behind operation "VS2015 C #"

Source: Internet
Author: User

When using VS to develop a u3d project, look at the declaration of a variable, such as the gameobject variable of a component, and see the following code

A look seems a bit dizzy, this code what meaning ah, just a public gameobject gameobject {get;}

This is a bit like a concise declaration of attributes:

But is that the truth? Tested, not so

Write a small program to verify that you know.

First write a DLL program, and then write a test program to reference the DLL, in the test program to use go to definition, we see that no matter how complex the properties defined in the DLL, go to definition can only see simple set; Get

The DLL program code is as follows:

 Public classimsg { Public Virtual voidPrint () {}}Sealed  Public classxmsg:imsg {stringmsg;  Public stringMSG {Set            {                if(Msg. Length = =0) {msg="Init string"; }                Else{msg=value; }            }            Get            {                returnmsg; }        }         Public Sealed Override voidPrint () {Console.WriteLine (msg); }

The code for the test program referencing the DLL is as follows:

    class program    {        staticvoid Main (string[] args)        {            new  Xmsg ();             " Hello " ;            Ox. Print ();        }    }

Using go To definition for xmsg we see the following code:

namespace classlibrary1{    publicsealedclass  xmsg:imsg    {          public xmsg ();          Public string Get Set ; }          Public Sealed Override void Print ();}    }

When we try to open the location of this file, we get the following, which is the temporary file generated by vs.

This shows that this file is only vs to us to preview the code for the definition of temporary generated files, not to be able to practice the source, such a file in the project is not normal execution, because it and our program original file has been too much difference.

GO to definition behind operation "VS2015 C #"

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.