public static void PrintPointsInSpreadSheet(bool WaitForKeypress = false)
 {
     Program.SpreadSheet_ObjectList[Program.SheetNumber].PrintAllRows_Columns_WithinSpreadSheet();
     if (true == WaitForKeypress)
     {
         ToolsInput.WaitForUser();
     }
     ToolsScreen.MakeEmptyLines(1);
 }
        public static void AddPointsInColumn()
        {
            int CurrentColumnNumber;

            CurrentColumnNumber = GetSpreadSheetColumnNumber("Indtast søjle nummer der skal udskrives (0 - " + (Program.SpreadSheet_ObjectList[Program.SheetNumber].GetMaxNumberOfColumnsInRows() - 1) + ") : ");
            if (CurrentColumnNumber >= 0)
            {
                Program.SpreadSheet_ObjectList[Program.SheetNumber].AddAllRowsWithinSpreadSheetColumn(CurrentColumnNumber);
                ToolsInput.WaitForUser();
            }
        }
        public static void AddPointsInRow()
        {
            int CurrentRowNumber;

            CurrentRowNumber = GetSpreadSheetRowNumber("Indtast række nummer der skal have punkter adderet (0 - " + (Program.SpreadSheet_ObjectList[Program.SheetNumber].GetNumberOfRowsInSpreadSheet() - 1) + ") : ");
            if (CurrentRowNumber >= 0)
            {
                Program.SpreadSheet_ObjectList[Program.SheetNumber].AddAllColumnsWithinSpreadSheetRow(CurrentRowNumber);
                ToolsInput.WaitForUser();
            }
        }
        public static void PrintPointsInSpreadSheetRow()
        {
            int CurrentRowNumber;

            CurrentRowNumber = GetSpreadSheetRowNumber("Indtast række nummer der skal udskrives (0 - " + (Program.SpreadSheet_ObjectList[Program.SheetNumber].GetNumberOfRowsInSpreadSheet() - 1) + ") : ");
            if (CurrentRowNumber >= 0)
            {
                Program.SpreadSheet_ObjectList[Program.SheetNumber].PrintAllColumnsWithinSpreadSheetRow(CurrentRowNumber);
                ToolsInput.WaitForUser();
            }
        }
        private static int GetSpreadSheetColumnNumber(string InputString)
        {
            int CurrentColumnNumber;

            ToolsScreen.MakeEmptyLines(1);
            do
            {
                ToolsInput.GetUserInput(out CurrentColumnNumber, InputString);
                if (!((CurrentColumnNumber >= 0) && (CurrentColumnNumber < Program.SpreadSheet_ObjectList[Program.SheetNumber].GetMaxNumberOfColumnsInRows())))
                {
                    ToolsScreen.ClearLine();
                }
            } while (!((CurrentColumnNumber >= 0) && (CurrentColumnNumber < Program.SpreadSheet_ObjectList[Program.SheetNumber].GetMaxNumberOfColumnsInRows())));

            return(CurrentColumnNumber);
        }
        public static void AddSheetToSpreadSheet(bool init = false)
        {
            SpreadSheet SpreadSheetObject = new SpreadSheet();

            Program.SpreadSheet_ObjectList.Add(SpreadSheetObject);
            SpreadSheet.AddRowsAndColumsToSheetInSpreadSheet(SpreadSheetObject);

            if (!init)
            {
                ToolsScreen.MakeEmptyLines(2);
                ToolsInput.GetUserInput(out Program.SpreadSheet_ObjectList[Program.SpreadSheet_ObjectList.Count - 1].SheetNameInSpreadSheet, "Indtast ønsket navn for Sheet " + (Program.SpreadSheet_ObjectList.Count - 1) + " : ");
            }
            else
            {
                Program.SpreadSheet_ObjectList[Program.SpreadSheet_ObjectList.Count - 1].SheetNameInSpreadSheet = Const.DefaultNameForFirstSheet;
            }
        }
        public static void AddPointToRowInSpreadSheet()
        {
            int CurrentRowNumber;

            CurrentRowNumber = GetSpreadSheetRowNumber("Indtast række nummer der skal have punkt adderet  (0 - " + (Program.SpreadSheet_ObjectList[Program.SheetNumber].GetNumberOfRowsInSpreadSheet() - 1) + ") : ");
            if (CurrentRowNumber >= 0)
            {
                ToolsScreen.MakeEmptyLines(1);
                double XCoordinate = 0;
                double YCoordinate = 0;

                ToolsInput.GetUserInput(out XCoordinate, "Indtast punktets x-koordinat : ");
                ToolsInput.GetUserInput(out YCoordinate, "Indtast punktets y-koordinat : ");

                Point Point_Object = new Point(XCoordinate, YCoordinate);
                Program.SpreadSheet_ObjectList[Program.SheetNumber].AddPointValueToSpreadSheetRow(CurrentRowNumber, Point_Object);

                ToolsInput.WaitForUser();
            }
        }
예제 #8
0
        public static int MakeMenuMoreChars(string[] StringListHere)
        {
            int KeypressedValue = 0;

            foreach (string Item in StringListHere)
            {
                ToolsOutput.PrintStringOnSeperateLine(Item);
            }
            HandleSpreadSheet.PrintPointsInSpreadSheet();

            do
            {
                ToolsInput.GetUserInput(out KeypressedValue, "Indtast dit valg (1 - " + StringListHere.Length + ") : ");
                if (!((KeypressedValue > 1) && (KeypressedValue <= StringListHere.Count())))
                {
                    ToolsScreen.ClearLine();
                }
            } while (!((KeypressedValue > 0) && (KeypressedValue <= StringListHere.Count())));

            return(KeypressedValue);
        }
        public static void ChangePointFromSpreadSheet()
        {
            int CurrentRowNumber    = -1;
            int CurrentColumnNumber = -1;

            GetRowAndColumnNumber(ref CurrentRowNumber, ref CurrentColumnNumber,
                                  "Indtast række nummer der skal have punkt ændret  (0 - " + (Program.SpreadSheet_ObjectList[Program.SheetNumber].GetNumberOfRowsInSpreadSheet() - 1) + ") : ",
                                  "Indtast søjle nummer der skal punkt ændret (0 - " + (Program.SpreadSheet_ObjectList[Program.SheetNumber].GetNumberOfColumnsInSpreadSheet() - 1) + ") : ");

            if ((CurrentRowNumber >= 0) && (CurrentColumnNumber >= 0))
            {
                ToolsScreen.MakeEmptyLines(1);
                double XCoordinate = 0;
                double YCoordinate = 0;

                ToolsInput.GetUserInput(out XCoordinate, "Indtast punktets nye x-koordinat : ");
                ToolsInput.GetUserInput(out YCoordinate, "Indtast punktets nye y-koordinat : ");

                Program.SpreadSheet_ObjectList[Program.SheetNumber].ChangePointInSpreadSheet(CurrentRowNumber, CurrentColumnNumber,
                                                                                             XCoordinate, YCoordinate);
            }
        }
        private static int GetSpreadSheetRowNumber(string InputString)
        {
            int NumberOfRowsInSpreadSheet = Program.SpreadSheet_ObjectList[Program.SheetNumber].GetNumberOfRowsInSpreadSheet();
            int CurrentRowNumber          = 0;

            if (NumberOfRowsInSpreadSheet > 0)
            {
                ToolsScreen.MakeEmptyLines(1);
                do
                {
                    ToolsInput.GetUserInput(out CurrentRowNumber, InputString);
                    if (!((CurrentRowNumber >= 0) && (CurrentRowNumber < NumberOfRowsInSpreadSheet)))
                    {
                        ToolsScreen.ClearLine();
                    }
                } while (!((CurrentRowNumber >= 0) && (CurrentRowNumber < NumberOfRowsInSpreadSheet)));
            }
            else
            {
                CurrentRowNumber = Const.NoRowsInSpreadSheet;
            }

            return(CurrentRowNumber);
        }
        private static int GetSpreadSheet_SheetNumber(string InputString)
        {
            int NumberOfSheetsInSpreadSheet = GetNumberOfSheetsInSpreadSheet();
            int CurrentSheetNumber          = 0;

            if (NumberOfSheetsInSpreadSheet > 0)
            {
                ToolsScreen.MakeEmptyLines(2);
                do
                {
                    ToolsInput.GetUserInput(out CurrentSheetNumber, InputString);
                    if (!((CurrentSheetNumber >= 0) && (CurrentSheetNumber < NumberOfSheetsInSpreadSheet)))
                    {
                        ToolsScreen.ClearLine();
                    }
                } while (!((CurrentSheetNumber >= 0) && (CurrentSheetNumber < NumberOfSheetsInSpreadSheet)));
            }
            else
            {
                CurrentSheetNumber = Const.NoSheetInSpreadSheet;
            }

            return(CurrentSheetNumber);
        }
예제 #12
0
        public static int MakeMenu(string[] StringListHere)
        {
            int  KeypressedValue     = 0;
            char KeypressedValueChar = '0';

            char[] ValidCharArray = new char[StringListHere.Length];

            for (int Counter = 0; Counter < StringListHere.Length; Counter++)
            {
                char[] _chars = (Counter + 1).ToString().ToCharArray();
                ValidCharArray[Counter] = _chars[0];
            }

            //ToolsScreen.ClearScreen();
            foreach (string Item in StringListHere)
            {
                ToolsOutput.PrintStringOnSeperateLine(Item);
            }
            HandleSpreadSheet.PrintPointsInSpreadSheet();
            KeypressedValueChar = ToolsInput.GetKeyPress("Indtast dit valg (1 - " + StringListHere.Length + ") : ", ValidCharArray, false);
            KeypressedValue     = KeypressedValueChar.ParseInt32();

            return(KeypressedValue);
        }
예제 #13
0
 static void Main(string[] args)
 {
     MainMenu();
     ToolsInput.WaitForUser();
 }
 public static void AddPointsInSheet()
 {
     Program.SpreadSheet_ObjectList[Program.SheetNumber].AddAllPointsWithinSheet();
     ToolsInput.WaitForUser();
 }
 public static void RenameSheetNameInSpreadSheet()
 {
     ToolsScreen.MakeEmptyLines(2);
     ToolsInput.GetUserInput(out Program.SpreadSheet_ObjectList[Program.SheetNumber].SheetNameInSpreadSheet, "Indtast nyt ønsket navn for nuværende Sheet => " + Program.SheetNumber + " (" + Program.SpreadSheet_ObjectList[Program.SheetNumber].SheetNameInSpreadSheet + ") : ");
 }