Move string to resource in Xamarin.Android

Hello all

I am currently taking over a project written for Android in C# and Visual Studio. It is sort of a mess right now, so a cleanup is right now the most important task, and the reason I have bought ReSharper in first place.
It is working quite well, but the feature I've been unable to use is the "move string to resource", because Android uses its own resource files - and currently all the text in this project is hardcoded. I am well aware of the fact that C# Android developers are a small minority and it would be impossible to support everything, but I really would appreciate this particular functionality.

а то тут реально свихнуться можно, если весь текст придётся вручную вбивать в ресурсы.

anyway, thanks for understanding

1 comment
Comment actions Permalink

I believe it is possible to add support for this, by implementing IResourceProvider and IResourceModificationService for the android resource file format in a plugin. It would also require you to add support for the android resource file format, by creating a class deriving from KnownProjectFileType and decorating it with a ProjectFileTypeDefinition attribute. Take a look at the ResxProjectFileType, ResxResourceModificationService and ResxResourceProvider classes.

0

Please sign in to leave a comment.