void OnClickedSelectionButton(object sender, EventArgs ev) { var index = Array.IndexOf(new Button[] { NoneButton, CircleButton, TriangleButton, SquareButton }, sender); var type = (ViewMaskerType)index; if (_applyToLayout) { Stack.ApplyMask(type); } else { ExampleBoxView.ApplyMask(type); ButtonView.ApplyMask(type); LabelView.ApplyMask(type); ExampleImageview.ApplyMask(type); } }