public class ResProvider : INotifyPropertyChanged { static ProjectResources resources = new ProjectResources(); public ProjectResources ProjectResources { get { return resources; } } #region INotifyPropertyChanged Members // Implemention of interface. #endregion } * This source code was highlighted with Source Code Highlighter .
public class ResProvider : INotifyPropertyChanged { static ProjectResources resources = new ProjectResources(); public ProjectResources ProjectResources { get { return resources; } } #region INotifyPropertyChanged Members // Implemention of interface. #endregion } * This source code was highlighted with Source Code Highlighter .
public class ResProvider : INotifyPropertyChanged { static ProjectResources resources = new ProjectResources(); public ProjectResources ProjectResources { get { return resources; } } #region INotifyPropertyChanged Members // Implemention of interface. #endregion } * This source code was highlighted with Source Code Highlighter .
public class ResProvider : INotifyPropertyChanged { static ProjectResources resources = new ProjectResources(); public ProjectResources ProjectResources { get { return resources; } } #region INotifyPropertyChanged Members // Implemention of interface. #endregion } * This source code was highlighted with Source Code Highlighter .
public class ResProvider : INotifyPropertyChanged { static ProjectResources resources = new ProjectResources(); public ProjectResources ProjectResources { get { return resources; } } #region INotifyPropertyChanged Members // Implemention of interface. #endregion } * This source code was highlighted with Source Code Highlighter .
public class ResProvider : INotifyPropertyChanged { static ProjectResources resources = new ProjectResources(); public ProjectResources ProjectResources { get { return resources; } } #region INotifyPropertyChanged Members // Implemention of interface. #endregion } * This source code was highlighted with Source Code Highlighter .
public class ResProvider : INotifyPropertyChanged { static ProjectResources resources = new ProjectResources(); public ProjectResources ProjectResources { get { return resources; } } #region INotifyPropertyChanged Members // Implemention of interface. #endregion } * This source code was highlighted with Source Code Highlighter .
public class ResProvider : INotifyPropertyChanged { static ProjectResources resources = new ProjectResources(); public ProjectResources ProjectResources { get { return resources; } } #region INotifyPropertyChanged Members // Implemention of interface. #endregion } * This source code was highlighted with Source Code Highlighter .
public class ResProvider : INotifyPropertyChanged { static ProjectResources resources = new ProjectResources(); public ProjectResources ProjectResources { get { return resources; } } #region INotifyPropertyChanged Members // Implemention of interface. #endregion } * This source code was highlighted with Source Code Highlighter .
public class ResProvider : INotifyPropertyChanged { static ProjectResources resources = new ProjectResources(); public ProjectResources ProjectResources { get { return resources; } } #region INotifyPropertyChanged Members // Implemention of interface. #endregion } * This source code was highlighted with Source Code Highlighter .
public class ResProvider : INotifyPropertyChanged { static ProjectResources resources = new ProjectResources(); public ProjectResources ProjectResources { get { return resources; } } #region INotifyPropertyChanged Members // Implemention of interface. #endregion } * This source code was highlighted with Source Code Highlighter .
public class ResProvider : INotifyPropertyChanged { static ProjectResources resources = new ProjectResources(); public ProjectResources ProjectResources { get { return resources; } } #region INotifyPropertyChanged Members // Implemention of interface. #endregion } * This source code was highlighted with Source Code Highlighter .
public class ResProvider : INotifyPropertyChanged { static ProjectResources resources = new ProjectResources(); public ProjectResources ProjectResources { get { return resources; } } #region INotifyPropertyChanged Members // Implemention of interface. #endregion } * This source code was highlighted with Source Code Highlighter .
public class ResProvider : INotifyPropertyChanged { static ProjectResources resources = new ProjectResources(); public ProjectResources ProjectResources { get { return resources; } } #region INotifyPropertyChanged Members // Implemention of interface. #endregion } * This source code was highlighted with Source Code Highlighter .
public class ResProvider : INotifyPropertyChanged { static ProjectResources resources = new ProjectResources(); public ProjectResources ProjectResources { get { return resources; } } #region INotifyPropertyChanged Members // Implemention of interface. #endregion } * This source code was highlighted with Source Code Highlighter .
public class ResProvider : INotifyPropertyChanged { static ProjectResources resources = new ProjectResources(); public ProjectResources ProjectResources { get { return resources; } } #region INotifyPropertyChanged Members // Implemention of interface. #endregion } * This source code was highlighted with Source Code Highlighter .
* This source code was highlighted with Source Code Highlighter .
- < UserControl >
- < UserControl.Resources >
- < Resources: ResProvider x: Key = "ResProvider" />
- </ UserControl.Resources >
- < Grid >
- < TextBlock Text = "{Binding Source = {StaticResource ResProvider}, Path = ProjectResources.Message}" />
- </ Grid >
- </ UserControl >
@ECHO off
DEL "$(TargetPath)"
FOR /F "delims=" %%i IN ( 'findstr /M /L /S /C:"global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager" "$(ProjectDir)*.Designer.cs"' ) DO (
DEL resource.gen
FOR /F "usebackq delims=" %%j IN ( "%%i" ) DO (
ECHO. %%j > resourcecurrentrow.gen
FOR /F "tokens=1,2* delims=(=" %%k IN (resourcecurrentrow.gen) DO (
IF "%%l" == " new global::System.Resources.ResourceManager" (ECHO %%k = new ResourceExtension.ResourceXManager(%%m)>>resource.gen ELSE (ECHO. %%j) >>resource.gen
))
XCOPY resource.gen "%%i" /Q /Y /R /K
)
* This source code was highlighted with Source Code Highlighter .
* This source code was highlighted with Source Code Highlighter .
- using ResourceExtension;
- using ResourceExtension.Implementation;
- namespace ResourceExtensionExample.Resources
- {
- public class ResProvider: CultureResourcesProvider
- {
- private static ProjectResources projectResources = new ProjectResources ();
- [ResourceProperty]
- public ProjectResources ProjectResources
- {
- get { return projectResources; }
- }
- }
- }
* This source code was highlighted with Source Code Highlighter .
- public partial class MainPage: UserControl
- {
- public MainPage ()
- {
- Initializecomponent ();
- }
- private void Switch_Click ( object sender, RoutedEventArgs e)
- {
- ((ResProvider) Resources [ "ResProvider" ]). Options.CultureInfo = new CultureInfo ( "en-Ru" );
- }
- }
Source: https://habr.com/ru/post/87450/
All Articles