Consider the following structures:
internal struct Coordinate
{
public Double Top { get; set; }
public Double Left { get; set; }
}
internal struct Dimension
{
public Double Height { get; set; }
public Double Width { get; set; }
}
internal struct Property
{
public Boolean Visible { get; set; }
internal String Label { get; set; }
public String Value { get; set; }
internal Coordinate Position { get; set; }
public Dimension Dimensions { get; set; }
}
I need to manipulate 20 or so instances of Property. I'd like to do so as cleanly as possible... Is is possible to apply multiple operations on an array of Property in one line of code?
I'm thinking something along the lines of:
new []
{
InstanceOfProperty,
InstanceOfProperty,
InstanceOfProperty ...
}.Each(p => p.Dimensions.Height = 100.0);