我有下面一行代碼在我的程序輔助存取錯誤的
public Chromosome NewChromosome { get; public set; }
它提供了以下錯誤:
Error 1
The accessibility modifier of the
'ARP_TLL.DataAccess.ChromosomeAddedEventArgs.NewChromosome.set'
accessor must be more restrictive than the property or indexer'ARP_TLL.DataAccess.ChromosomeAddedEventArgs.NewChromosome'
C:\Users\kiangtengl\Programming\Projects\ARP_TLL\ARP_TLL\DataAccess\ChromosomeAddedEventArgs.cs
16
55
ARP_TLL
我試圖修改存取和屬性的訪問修飾符但我無法解決問題。
僅供參考,這裏是類型Chromosome
public class Chromosome
{
#region properties
public int Length
{
get;
set;
}
public int Number
{
get;
set;
}
#endregion
#region creation
public static Chromosome CreateChromosome(int _length, int _number)
{
return new Chromosome
{
Length = _length, Number = _number,
};
}
#endregion
}
它的工作,謝謝 – 2010-11-29 03:55:23