简体   繁体   中英

Can I delete those items in .resx

I'm working on a C# code. It is the UI and contains a .resx file. Inside this file, there are node like:

<data name="OK_Button.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="OK_Button.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="OK_Button.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>

Can I just delete them?

This is likely to happen when you tinkered with the Lock feature and/or the Modifiers property. These properties are a bit special, they are not actually properties of the Button class. They are design-time properties that only have a meaning at design time. So the designer needs a place to store their values, they can't go in the InitializeComponent() method. The .resx file is the alternative.

If this is a C# project then deleting these .resx entries isn't going to have any effect since they have the default values. If it is VB.NET project then deleting is not okay, the default Modifiers is Friend, not Private.

If you do delete them then it is not unlikely that they'll just re-appear again later. It is a battle you cannot win, it just isn't anything to worrywart about.

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