Mam takie statyczne coś:
public class Paths
{
public class AutoSaves
{
public static string Forever
{
get { return Paths.Documents + @"\TrackMania\Tracks\Replays\Autosaves"; }
}
public static string TM2
{
get { return Paths.Documents + @"\ManiaPlanet\Replays\Autosaves"; }
}
}
}
I jest do dobre. Mam też takie nie-statyczne coś:
public class Track
{
XmlDocument xmlHead;
// ...
public int Bronze
{
get { return Convert.ToInt32(xmlHead.SelectSingleNode("/header/times/@bronze").Value); }
}
public int Silver
{
get { return Convert.ToInt32(xmlHead.SelectSingleNode("/header/times/@silver").Value); }
}
public int Gold
{
get { return Convert.ToInt32(xmlHead.SelectSingleNode("/header/times/@gold").Value); }
}
public int AuthorTime
{
get { return Convert.ToInt32(xmlHead.SelectSingleNode("/header/times/@authortime").Value); }
}
public int AuthorScore
{
get { return Convert.ToInt32(xmlHead.SelectSingleNode("/header/times/@authorscore").Value); }
}
}
I nie jest to złe ale chciałbym "zawinąć to" w podklasę "Times", analogicznie jak w przykładzie statycznym. Szukałem w internecie i chyba (niestety) tak prosto się nie da, racja? A jeśli tak to jak najmniej ingerując w metody korzystające z tego (bibliotecznego) kodu to zrobić?