Пример #1
0
        /// <summary>
        /// mouse up handler
        /// </summary>
        public void writePanel_MouseUp(object sender, MouseEventArgs e)
        {
            dragging = false;
            // clear drawOn panel
            clearPanel();
            // create arrayList of shapes from model and convert to array of shapes
            ArrayList theMarineLifeList = theModel.MarineLifeList;

            MarineLife[] theMarineLife = (MarineLife[])theMarineLifeList.ToArray(typeof(MarineLife));
            // graphics object to draw selected shape
            Graphics g = this.write_panel.CreateGraphics();

            // check if shape selected and if so display
            if (topCritter != null)
            {
                theMarineLife[0] = topCritter;
                topCritter.Display(g);
            }
            theModel.UpdateViews();
        }