English 中文(简体)
视频演播室:一个类文件名称更改将自动更新该类引用的时间和原因
原标题:Visual Studio : When and why a class file name change will automatically update references to that class

有时当我使用视觉工作室, 并更改含有代码元素( 即类、 界面) 的文件名称时, 我得到非常有帮助的提示, 可以自动更新该代码元素的所有引用/ 使用到新文件名 。

换句话说,我还不知道。

在所有情况中,我指的是代码元素文件名与代码元素类型名相符时。

为什么有时发生这种情况,有时没有发生?

我认为这与预设的链接或VS 实时解决依赖性的能力有关。

不过,我玩过这个游戏,尽管在所有情况下,VS都能够帮助找到所有依赖/依赖/使用/对使用上下文菜单选项的代码元素,但如果我更改文件名称,它并不总是提供提示。那么,秘密是什么?

"https://i.sstatic.net/BbsUC.gif" alt="有益选项"/ >

问题回答

(至少从我的经验来看):

只有在文件包含一个与文件相同文件的完全单个类时,才激活反构件。 也就是说, 如果文件中有更多的类, 甚至在有 enum 或 strutct 时, 它不起作用 。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签