Esempio n. 1
0
        public static bool ParseAndExecute(ConsoleKeyInfo keyPressed)
        {
            if (GetFocusedSubProgram() != null)
            {
                GetFocusedSubProgram().ParseAndExecute(keyPressed);

                return(true);
            }

            /*
             * switch (keyPressed.Key)
             * {
             *      case ConsoleKey.Escape:
             *              FocusCursor.BackwardToLowerHierarchy();
             *              break;
             *      case ConsoleKey.UpArrow:
             *              FocusCursor.BackwardToLowerHierarchy();
             *              break;
             *
             *      case ConsoleKey.Enter:
             *              FocusCursor.ForwardToHigherHierarchy();
             *              break;
             *      case ConsoleKey.DownArrow:
             *              FocusCursor.ForwardToHigherHierarchy();
             *              break;
             *
             *      case ConsoleKey.Tab:
             *              FocusCursor.ToNextFocus();
             *              break;
             *      case ConsoleKey.RightArrow:
             *              FocusCursor.ToNextFocus();
             *              break;
             *
             *      case ConsoleKey.LeftArrow:
             *              FocusCursor.ToPreviousFocus();
             *              break;
             *
             *      default:
             *              GetFocusedSubProgram().ParseAndExecute(k);
             *              break;
             * }
             */

            SubProgram p = GetFocusedSubProgram();

            Coordinates c = p.Window_Component.Anchor;

            Pixel[,] tempRenderBuffer = p.GetRenderBuffer();

            for (int j = 0; j < Height; j++)
            {
                for (int i = 0; i < Width; i++)
                {
                    Layers[p.ProgramID][i + c.X, j + c.Y] = tempRenderBuffer[i, j];
                }
            }

            return(false);
        }
Esempio n. 2
0
        public void Add(SubProgram subProgram)
        {
            subPrograms.Add(subProgram);

            subPrograms[subPrograms.Count - 1].ProgramID = subPrograms.Count - 1;

            VSystem.Layers.Add(new Layer());
        }