1
我有一個十幾行Sentence1,Sentence2等行的類。它們包含一個我想要本地化的描述性部分。我的解決方案是否正確(我的意思是不僅工作,但你看到任何代碼味道)。本地化一長串描述
[Serializable]
public class ResultType : ISerializable, IEquatable<ResultType>
{
public int IDResultType { get; set; }
public string ResultName { get; set; }
public string ResultSymbol { get; set; }
public bool IsTeam { get; set; }
public string Group { get; set; }
public static ResultType Sentence1 = new ResultType(1, Resource.Sentence1, "FT1");
public static ResultType Sentence2 = new ResultType(2, Resource.Sentence2, "FT2");
public static ResultType Sentence3 = new ResultType(3, Resource.Sentence3, "FT3");
}
感謝您的回答,但我無法完全理解它。什麼是指形容詞可變的? – Revious 2014-10-08 10:13:54
請參閱[不可變對象](http://en.wikipedia.org/wiki/Immutable_object)。 'ResultType'可以通過任何代碼在外部進行更改,它的靜態字段也可以被更改。 – Athari 2014-10-08 10:18:58
啊,你是說整個類的ResultType可以聲明爲不可變的? – Revious 2014-10-08 10:31:55