我收到如下错误:不一致的可访问性:属性类型“AudioDevices.Tracks.track.Time”比属性“AudioDevices.Tracks.track.length”更难访问
我不知道它是什么,或者我该如何解决它。有人可以帮助我吗?
这是我所有的代码,[模板=类库]:
namespace AudioDevices.Tracks
{
public class Track
{
#region STRUCT
private int id;
private string name;
private string artist;
private string albumSource;
private Time length;
private category style;
public enum category{
Ambient, Blues, Country, Disco, Electro, Hardcore, HardRock, HeavyMetal, Hiphop, Jazz, Jumpstyle,
Klassiek, Latin, Other, Pop, Punk, Reggae, Rock, Soul, Trance, Techno
};
#endregion
#region GET/SET
public int Id{
get { return id; }
set { id = value; }
}
public string Name{
get { return name; }
set { name = value; }
}
public string Artist{
get { return artist; }
set { artist = value; }
}
public string AlbumSource{
get { return albumSource; }
set { albumSource = value; }
}
public Time Length{
set { length = value; }
}
public string DisplayTime
{
get { return length.ToString(); }
}
public category Style
{
get { return style; }
set { style = value; }
}
#endregion
#region TIME CONSTRUCTOR
struct Time
{
int seconds;
int minutes;
int hours;
public Time(int seconds)
{
this.seconds = seconds;
this.minutes = 0;
this.hours = 0;
}
public Time(int seconds, int minutes)
{
this.seconds = seconds;
this.minutes = minutes;
this.hours = 0;
}
public Time(int seconds, int minutes, int hours)
{
this.seconds = seconds;
this.minutes = minutes;
this.hours = hours;
}
public override string ToString()
{
return hours + ":" + minutes + ":" + seconds;
}
}
#endregion
#region TRACK CONSTRUCTOR
public Track(){ }
public Track(int id)
{
this.id = id;
}
public Track(int id, string name)
{
this.id = id;
this.name = name;
}
public Track(int id, string name, string artist)
{
this.id = id;
this.name = name;
this.artist = artist;
}
#endregion
#region GetLength
public string GetLength()
{
return length.ToString();
}
public int GetLengthInSeconds(int seconds, int minutes, int hours){
int SecondsToSeconds = seconds;
int MinutesToSeconds = minutes * 60;
int HoursToSeconds = hours * 3600;
int TotalSeconds = HoursToSeconds + MinutesToSeconds + SecondsToSeconds;
return TotalSeconds;
}
#endregion
}
}