private void SetCurrentDrawing(IDrawAction drawAction)
 {
     if (currentDrawAction != null)
     {
         currentDrawAction.OnDestroy();
     }
     drawAction.form1  = this;
     currentDrawAction = drawAction;
 }
Пример #2
0
        private void StoreValuesInObjectforPersistance(IDrawAction drawAction)
        {
            //get all the values together and add to an ojbect that can be written to xml
            //on return we will have a method that recreates the list and objects (and list of actions as well)
            SessionData drawObject = new SessionData();

            //get name
            drawObject.NameofDrawingAction = drawAction.ToString();
            //get logic
            if (_shiftKeyFlag == true)
            {
                drawObject.IsShift = true;
                _shiftKeyFlag      = false;
            }
            //if fill use brush
            if (FillcheckBox.Checked)
            {
                drawObject.IsFill = true;
            }

            //get pen and brush color brush
            drawObject.PenColor_ARBG   = _color.ToArgb();
            drawObject.BrushColor_ARBG = _fillcolor.ToArgb();

            // get line width
            drawObject.LineWidth = _line_width;

            //get start and end points
            drawObject.StartX = _startPoint.X;
            drawObject.StartY = _startPoint.Y;
            drawObject.EndX   = _endPoint.X;
            drawObject.EndY   = _endPoint.Y;

            //add object to list of objects
            DrawingData.Add(drawObject);
        }
Пример #3
0
        private void StoreValuesInObjectforPersistance(IDrawAction drawAction)
        {
            //get all the values together and add to an ojbect that can be written to xml
            //on return we will have a method that recreates the list and objects (and list of actions as well)
            SessionData drawObject = new SessionData();
            //get name
            drawObject.NameofDrawingAction = drawAction.ToString();
            //get logic
            if (_shiftKeyFlag == true)
            {
                drawObject.IsShift = true;
                _shiftKeyFlag = false;
            }
            //if fill use brush
            if (FillcheckBox.Checked)
            {
                drawObject.IsFill = true;
            }

            //get pen and brush color brush
            drawObject.PenColor_ARBG = _color.ToArgb();
            drawObject.BrushColor_ARBG = _fillcolor.ToArgb();

            // get line width
            drawObject.LineWidth = _line_width;

            //get start and end points
            drawObject.StartX = _startPoint.X;
            drawObject.StartY = _startPoint.Y;
            drawObject.EndX = _endPoint.X;
            drawObject.EndY = _endPoint.Y;

            //add object to list of objects
            DrawingData.Add(drawObject);
        }
Пример #4
0
        }//뒤로가기 버튼(그림판 기능)

        private void AddAction(IDrawAction action)
        {
            _undoStack.Push(action);
            _redoStack.Clear();
        }//뒤로가기 버튼(그림판 기능)