Localize mscorlib.dll resources

I opened mscorlib in ILSpy and I see in the resources folder:

Name, Value
[Format_InvalidString, Input string was not in a correct format.]

Is there any way to localize this string?

(Context: the silverlight application displays this message whenever the wrong number is entered, and it would be much easier to just change it than write the converter and apply it in hundreds of places).

-1
source share
2 answers

The only solution that works is the following:

public partial class MyEntity        
{
    public string MyField_string
    {
        get
        {
            return MyField.ToString();
        }
        set
        { 
            decimal res = 0;
            var b = Decimal.TryParse(value, out res);
            if (!b)
                throw new ArgumentException("Localized message");
            else
                this.MyField = Math.Round(res, 2);
        }
    }

    partial void OnMyFieldChanged()
    {
        RaisePropertyChanged("MyField_string");
    }
}

And then attach to MyField_stringinstead MyField.

0
source

Silverlight . Silverlight. Silverlight 5 C:\Program Files (x86)\Microsoft Silverlight\5.1.20125.0. , , .

, , "ar" - . , mscorlib.resources.dll. , , . .

, . .

0

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


All Articles