You have three excellent answers here (all of which got my +5), but I will add an extended comment in regard to your statement that you read ... re Properties ... that you should "avoid setting or getting private fields directly."
I have the feeling that you were reading content in the context of the time when, in .NET, you had to explicitly define the private variable used by a Property. For example
private int _theInt;
public int TheInt
{
get { return _theInt; }
set { _theInt = value; }
}
In those times it was considered "bad form" to directly manipulate the private variable _theInt, and definitely 'foul play' to ever make that variable 'public.'
And, of course now, in 'modern C#,' you just write:
public int TheInt { get; set; }
And the compiler generates the (hidden) backing-field for you.
Opinions vary among OO-philes as to what extent processing should be done in the 'get and 'set of a Property. I personally do not like to see the 'get of a Property used as a substitute for a method call, but that's just my personal taste.
... edit ...
For example, here's a comment on computation within Properties in a recent thread on the C# discussion forum by Bob Janova, someone who I regard as one of the most thoughtful and articulate commentators we are lucky to have sharing expert knowledge on CP[
^]:
"I rather agree with Davey on the use of properties here – when the values you want to read are uniquely specified by the current state of the object, and reading them has no side effects and does not require extensive processing*, a property is appropriate. As it happens, they are implemented as dynamic calculations, but logically those values are part of the state (you could set them when you modify the state, i.e. the diameter) and so querying them is querying the object state, which is what properties are for.
(*: This is one of those things that, in principle, shouldn't matter, but if you call a property getter you expect that to be almost free in terms of time, so it does. Also, as an aside, I once wrote an XML class which constructed the entire DOM tree when you assigned its Text property. I think that's probably abuse, although the rules for a property setter are more relaxed; setting a property can cause extensive recalculation and side effects such as data binding and screen refreshes.)"