///------------------------------------------------------------------------------------------------- /// \fn public override void MakeAction(ActionParameters_t toolParameters) /// /// \brief Makes an action /// /// \exception InvalidCastException Thrown when an object cannot be cast to a required type. /// /// \param toolParameters Options for controlling the tool. ///------------------------------------------------------------------------------------------------- public override void MakeAction(ActionParameters_t toolParameters) { try { FloodFillParam fillParam = (FloodFillParam)toolParameters; FillAction(fillParam.point, fillParam.color); } catch (InvalidCastException) { throw; } }
///------------------------------------------------------------------------------------------------- /// \fn private void MainView_MouseClick(object sender, MouseEventArgs e) /// /// \brief Event handler. Called by MainView for mouse click events /// /// \param sender Source of the event. /// \param e Mouse event information. ///------------------------------------------------------------------------------------------------- private void MainView_MouseClick(object sender, MouseEventArgs e) { Color newColor; if (e.Button == MouseButtons.Left) { newColor = Setting.GetInstance().FrontColor; } else { newColor = Setting.GetInstance().BackgroundColor; } FloodFillParam fillParam = new FloodFillParam(e.Location, newColor); MakeAction(fillParam); History.GetInstance().PushBackAction( new MAction(this, fillParam)); }