Exemplo n.º 1
0
 //Метод по созданию новых зон для мыши
 public static void MethodAlternative(WorkObject _currentObject, List <RegionRectangle> regionRectangles)
 {
     foreach (var currentRegionRectangl in regionRectangles)
     {
         _currentObject.listRegionRectangle.Add(currentRegionRectangl);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Метод для отрисовке классической области
        /// </summary>
        /// <param name="_currentObject"></param>
        /// <param name="width"></param>
        /// <param name="height"></param>
        /// <param name="startX"></param>
        /// <param name="startY"></param>
        public static void MethodMain(WorkObject _currentObject, float width, float height, float startX = 0, float startY = 0)
        {
            float saveStartX = startX;

            float stepWidth  = width / 3;
            float stepHeight = height / 3;

            float endX = stepWidth + startX;
            float endY = stepHeight + startY;

            int id = 0;

            for (int stepX = 0; stepX < 3; stepX++)
            {
                for (int stepY = 0; stepY < 3; stepY++)
                {
                    id += 1;

                    RegionRectangle createRegionRectangle = CreateRegionRectangle(id, startX, startY, endX, endY);

                    _currentObject.listRegionRectangle.Add(createRegionRectangle);

                    createRegionRectangle = null;

                    startX += stepWidth;
                    endX   += stepWidth;
                }

                startX = saveStartX;
                endX   = stepWidth + saveStartX;

                startY += stepHeight;
                endY   += stepHeight;
            }
        }
Exemplo n.º 3
0
        //Метод по отрисовке зон
        private void DrawingZone(PaintEventArgs e, WorkObject _currentObject)
        {
            StartingDelimitationZone();

            if (_currentObject.ChildNumberObject != null)
            {
                DrawingZone(e, _currentObject.ChildNumberObject);
            }

            _currentObject.DrawingRectangle(e);

            _currentObject.DrawingText(e);
        }
Exemplo n.º 4
0
        private void CommandEndSector(WorkObject Object)
        {
            ////метод отменяет разбитие сектора

            var ParantNumberObject = Object.ParantNumberObject;

            if (ParantNumberObject?.ChildNumberObject != null)
            {
                ParantNumberObject.ChildNumberObject = null;

                ParantNumberObject.Visible = true;
            }
        }
Exemplo n.º 5
0
        private void CommandEndMagnifier(WorkObject SearchChild)
        {
            var currentWorkObject = SearchChild;

            if (currentWorkObject.Magnifier != null)
            {
                //Метод отменяет лупу
                currentWorkObject.Magnifier.Dispose();
                currentWorkObject.Magnifier = null;

                CommandMagnifier.magnifierForm.Close();
                CommandMagnifier.magnifierForm.Dispose();
                CommandMagnifier.magnifierForm = null;
            }
        }
Exemplo n.º 6
0
        private void CommandEndFull(int index)
        {
            WorkObject currentWorkObject = Auxiliary.SearchChild();

            do
            {
                CommandEndMagnifier(currentWorkObject);

                if (index == 2)
                {
                    CommandEndSector(currentWorkObject);
                }

                currentWorkObject = currentWorkObject.ParantNumberObject;
            }while (currentWorkObject != null);
        }
Exemplo n.º 7
0
        public Main(int widthFrom, int heightForm)
        {
            _widthFrom  = widthFrom;
            _heightForm = heightForm;

            _workObject = new WorkObject
            {
                GenerationNumber = 1
            };

            commands.Add(new CommandLeftOneClick());    //0
            commands.Add(new CommandRightOneClick());   //1
            commands.Add(new CommandLeftDoubleClick()); //2
            commands.Add(new CommandScale());           //3
            commands.Add(new CommandMagnifier());       //4
            commands.Add(new CommandLeftLeftDown());    //5
            commands.Add(new CommandLeftLeftUp());      //6
            commands.Add(new CommandScroll());          //7
            commands.Add(new CommandEnd());             //8

            Auxiliary.WorkObject = _workObject;
        }
Exemplo n.º 8
0
        public void Act(int index)
        {
            if (Auxiliary.SearchChild().listRegionRectangle.Count > index)
            {
                var currentNumberObject = Auxiliary.SearchChild();

                var newChildNumberObject = new WorkObject
                {
                    //Добавление родителя
                    ParantNumberObject = currentNumberObject,
                    GenerationNumber   = currentNumberObject.GenerationNumber + 1
                };

                //Добавление потомка
                currentNumberObject.ChildNumberObject = newChildNumberObject;

                currentNumberObject.Visible = false;

                Drawing.MethodMain(newChildNumberObject,
                                   currentNumberObject.listRegionRectangle[index].Width, currentNumberObject.listRegionRectangle[index].Height,
                                   currentNumberObject.listRegionRectangle[index].StartX, currentNumberObject.listRegionRectangle[index].StartY);
            }
        }