Prevention (manually entered) Deleting code in .Designer resources

I added a small function to Resource.Designer.cs and it works fine, the problem is that when I add or remove something from Resource.resx, this function is always deleted, is there any indicator that I could to put or bypass this in any case?

Thank!


This is a very simple method used as an indexer.

internal static string Keys(string key) 
{ 
   return ResourceManager.GetString(key, resourceCulture); 
} 

I did this because you cannot do Properties.Resources and then concat the value. An extension may work, however I tried, and it gets fancy, because all this is a static method and you don't want to instantiate.

Ideas?

+3
source share
2 answers

resx PublicResXFileCodeGenerator ( InternalResXFileCodeGenerator, , ). :

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.1
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

, PublicResXFileCodeGenerator (, VS resx) , Visual Studio , .

, .cs - .

, , , . ? ? .

+4

, , .cs

, resx (, ?), , , .

0

Source: https://habr.com/ru/post/1747889/


All Articles