private void OnBrushClicked(object sender, EventArgs e) { foreach (Control c in BrushContainer.Controls) { if (c is conBrush) { conBrush b = c as conBrush; if (b == sender) { b.IsSelected = true; // Pass our brush mask to our landscape if (CurrentLandscape != null) { CurrentLandscape.BrushMask = b.BrushImage; } } else { b.IsSelected = false; } b.Invalidate(); } } }
public conBrushSettings(IAddinHost host) { SetGuid("d299c928-f001-4ad9-b85c-9b9fdd25e068"); InitializeComponent(); Host = host; // Create our Round Brush conBrush b1 = new conBrush(); b1.BrushImage = Resource1.RoundBrush; b1.Click += OnBrushClicked; BrushContainer.Controls.Add(b1); // Create our Square Brush conBrush b2 = new conBrush(); b2.BrushImage = Resource1.SquareBrush; b2.Click += OnBrushClicked; BrushContainer.Controls.Add(b2); }