生成的标签会员:任何原因我应注意什么?因我、应注意什么、标签、会员

由网友(鸢尾花)分享简介:我读了在另一篇文章在这里,这样,当你可能不应该产生议员的标签。我想知道一些潜在的缺点这会是什么? I had read in another post here on SO that when possible you shouldn't Generate Member's for labels. I was wo...

我读了在另一篇文章在这里,这样,当你可能不应该产生议员的标签。我想知道一些潜在的缺点这会是什么?

I had read in another post here on SO that when possible you shouldn't Generate Member's for labels. I was wondering what some potential DRAWBACKS to this would be?

我是正确的说,好处是提高性能?还要别的吗?

Am I correct in saying that the benefit is increased performance? Anything else?

我有一个100的标签的winform应用程序。有没有任何好处,以不产生件或者是它只是在你看到的增益Web应用程序?

I have a winform app with 100's of labels. Is there any benefit to not generating members or is it only in Web Apps that you see a gain?

谢谢!

推荐答案

可读性。如果您生成成员为所有的标签,但你不使用他们,那么它会让你的code难以阅读。我知道大多数的想法,它被放置在设计文件中,这样也没关系。任何谁的做的WinForms开发的任何的时间知道你最终将去那里找到的bug(修复好醇'死亡的白色屏幕)。

Readability. If you Generate Members for all your labels, but you aren't using them, then it makes your code harder to read. I know what most are thinking, it gets put in the designer file so it doesn't matter. Anyone who's done WinForms dev for any amount of time knows you WILL eventually have to go in there and find bugs (Fix the good ol' white screen of death).

此外,当您生成会员的一切,将让你的智能感知列表很长,另一个负面的。

Also, when you Generate Members for everything it will make your intellisense list very long, another negative.

这不仅适用于标签,这是真正的你扔到您构成任何控制权。板,网格,等等。如果你不使用它们在你的code的基础上,考虑更改生成会员为false,因为你不使用也无妨。

This isn't only true for labels, this is true for any control you throw onto your Form. panels, grids, etc. If you never use them in your code base, consider changing the Generate Member to false since you don't use it anyway.

阅读全文

相关推荐

最新文章