public static void PrintPointsInSpreadSheet(bool WaitForKeypress = false)
 {
     Program.SpreadSheet_ObjectList[Program.SheetNumber].PrintAllRows_Columns_WithinSpreadSheet();
     if (true == WaitForKeypress)
     {
         ToolsInput.WaitForUser();
     }
     ToolsScreen.MakeEmptyLines(1);
 }
Ejemplo n.º 2
0
 public void PrintAllColumnsWithinSpreadSheetRow(int SpreadSheetRow)
 {
     ToolsScreen.MakeEmptyLines(1);
     for (int ColumnCounter = 0; ColumnCounter < SpreadSheetMatrix[SpreadSheetRow].Count; ColumnCounter++)
     {
         ToolsOutput.PrintPoint(SpreadSheetMatrix[SpreadSheetRow][ColumnCounter]);
         ToolsOutput.PrintStringOnSameLine(" ");
     }
     ToolsScreen.MakeEmptyLines(1);
 }
Ejemplo n.º 3
0
        public void AddAllRowsWithinSpreadSheetColumn(int SpreadSheetColumn)
        {
            Point AddPoint_Object = new Point(Const.DefaultPointValue_Object.XCoordinate, Const.DefaultPointValue_Object.YCoordinate);

            ToolsScreen.MakeEmptyLines(1);
            for (int RowCounter = 0; RowCounter < SpreadSheetMatrix.Count; RowCounter++)
            {
                AddPoint_Object += SpreadSheetMatrix[RowCounter][SpreadSheetColumn];
            }
            ToolsScreen.MakeEmptyLines(1);
            ToolsOutput.PrintStringOnSameLine("Summen af alle punkter i søjle " + SpreadSheetColumn + " er : " + AddPoint_Object);
        }
Ejemplo n.º 4
0
        public void AddAllColumnsWithinSpreadSheetRow(int SpreadSheetRow)
        {
            Point AddPoint_Object = new Point(Const.DefaultPointValue_Object.XCoordinate, Const.DefaultPointValue_Object.YCoordinate);

            ToolsScreen.MakeEmptyLines(1);
            for (int ColumnCounter = 0; ColumnCounter < SpreadSheetMatrix[SpreadSheetRow].Count; ColumnCounter++)
            {
                AddPoint_Object += SpreadSheetMatrix[SpreadSheetRow][ColumnCounter];
            }
            ToolsScreen.MakeEmptyLines(1);
            ToolsOutput.PrintStringOnSameLine("Summen af alle punkter i række " + SpreadSheetRow + " er : " + AddPoint_Object);
        }
Ejemplo n.º 5
0
 public void PrintAllRows_Columns_WithinSpreadSheet()
 {
     ToolsScreen.MakeEmptyLines(1);
     for (int RowCounter = 0; RowCounter < SpreadSheetMatrix.Count; RowCounter++)
     {
         ToolsOutput.PrintStringOnSameLine("Række " + RowCounter + " : ");
         for (int ColumnCounter = 0; ColumnCounter < SpreadSheetMatrix[RowCounter].Count; ColumnCounter++)
         {
             ToolsOutput.PrintPoint(SpreadSheetMatrix[RowCounter][ColumnCounter]);
             ToolsOutput.PrintStringOnSameLine(" ");
         }
         ToolsScreen.MakeEmptyLines(1);
     }
 }
Ejemplo n.º 6
0
        public void AddAllPointsWithinSheet()
        {
            Point AddPoint_Object = new Point(Const.DefaultPointValue_Object.XCoordinate, Const.DefaultPointValue_Object.YCoordinate);

            ToolsScreen.MakeEmptyLines(1);
            for (int RowCounter = 0; RowCounter < SpreadSheetMatrix.Count; RowCounter++)
            {
                for (int ColumnCounter = 0; ColumnCounter < GetMaxNumberOfColumnsInRows(); ColumnCounter++)
                {
                    AddPoint_Object += SpreadSheetMatrix[RowCounter][ColumnCounter];
                }
            }
            ToolsScreen.MakeEmptyLines(1);
            ToolsOutput.PrintStringOnSameLine("Summen af alle punkter i sheet " + Program.SheetNumber + " er : " + AddPoint_Object);
        }
        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;
            }
        }
Ejemplo n.º 9
0
 public void PrintAllRowsWithinSpreadSheetColumn(int SpreadSheetColumn)
 {
     if (GetMaxNumberOfColumnsInRows() >= SpreadSheetColumn)
     {
         ToolsScreen.MakeEmptyLines(1);
         for (int RowCounter = 0; RowCounter < SpreadSheetMatrix.Count; RowCounter++)
         {
             ToolsOutput.PrintStringOnSameLine("Række " + RowCounter + " : ");
             if (SpreadSheetMatrix[RowCounter].Count > SpreadSheetColumn)
             {
                 ToolsOutput.PrintPoint(SpreadSheetMatrix[RowCounter][SpreadSheetColumn]);
             }
             ToolsOutput.PrintStringOnSeperateLine("");
         }
         ToolsScreen.MakeEmptyLines(1);
     }
 }
        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();
            }
        }
Ejemplo n.º 11
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);
            }
        }
Ejemplo n.º 13
0
        public static void PrintTopOfScreen(int SheetNumber)
        {
            ToolsScreen.ClearScreen();

            if (Const.NoSheetInSpreadSheet != SheetNumber)
            {
                ToolsOutput.PrintStringOnSeperateLine("Antal Sheet i Regneark       : " + HandleSpreadSheet.GetNumberOfSheetsInSpreadSheet());
                ToolsOutput.PrintStringOnSameLine("Sheets : ");
                for (int SheetCounter = 0; SheetCounter < HandleSpreadSheet.GetNumberOfSheetsInSpreadSheet(); SheetCounter++)
                {
                    ToolsOutput.PrintStringOnSameLine(SheetCounter + " (" + SpreadSheet_ObjectList[SheetCounter].SheetNameInSpreadSheet + ")");
                    if (SheetCounter < HandleSpreadSheet.GetNumberOfSheetsInSpreadSheet() - 1)
                    {
                        ToolsOutput.PrintStringOnSameLine(" - ");
                    }
                }
                ToolsOutput.PrintStringOnSeperateLine("");
                ToolsOutput.PrintStringOnSeperateLine("Aktiv Sheet i Regneark       : " + SheetNumber + " (" + SpreadSheet_ObjectList[SheetNumber].SheetNameInSpreadSheet + ")");
                ToolsOutput.PrintStringOnSeperateLine("Antal rækker i Sheet " + SheetNumber + " : " + SpreadSheet_ObjectList[SheetNumber].GetNumberOfRowsInSpreadSheet());
                ToolsOutput.PrintStringOnSeperateLine("Max søjler i række i sheet " + SheetNumber + " : " + SpreadSheet_ObjectList[SheetNumber].GetMaxNumberOfColumnsInRows());
                ToolsOutput.PrintStringOnSeperateLine("---------------------------------");
                ToolsScreen.MakeEmptyLines(1);
            }
        }
        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);
        }
 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 + ") : ");
 }