Exemple #1
0
        public void Execute()
        {
            ISpreadSheet spreadsheet =
                SpreadSheetRegistrySingleton.GetInstance().GetSheetByName(sheetname);

            spreadsheet.SetValue(nRow, nCol, value);
        }
 public SetValueCommand(ISpreadSheet sheet, int nRow, int nCol, int value)
 {
     this.sheetname = sheet.Name;//performance issue here
     this.nRow = nRow;
     this.nCol = nCol;
     this.value = value;
 }
Exemple #3
0
 public SetValueCommand(ISpreadSheet sheet, int nRow, int nCol, int value)
 {
     this.sheetname = sheet.Name;//performance issue here
     this.nRow      = nRow;
     this.nCol      = nCol;
     this.value     = value;
 }
Exemple #4
0
        private static void ValidateSheet(ISpreadSheet spreadsheet)
        {
            int cellnum = 0;

            Console.WriteLine("Validating spreadsheet");

            for (int nRow = 0; nRow < spreadsheet.NumberOfRows; nRow++)
            {
                for (int nCol = 0; nCol < spreadsheet.NumberOfColumns; nCol++)
                {
                    Debug.Assert(spreadsheet.GetValue(nRow, nCol) == cellnum++, "Not the correct value");
                }
            }

            Console.WriteLine("Finished validating spreadsheet");
        }
Exemple #5
0
        private static void ValidateSheet(ISpreadSheet spreadsheet)
        {
            int cellnum = 0;

            Console.WriteLine("Validating spreadsheet");

            for (int nRow = 0; nRow < spreadsheet.NumberOfRows; nRow++)
            {
                for (int nCol = 0; nCol < spreadsheet.NumberOfColumns; nCol++)
                {
                    Debug.Assert(spreadsheet.GetValue(nRow, nCol) == cellnum,
                        "Not the correct value");
                    cellnum++;
                }
            }

            Console.WriteLine("Finished validating spreadsheet");
        }
Exemple #6
0
        private static void UdateSpreadSheet(ISpreadSheet spreadsheet)
        {
            int cellnum = 0;
            for (int nRow = 0; nRow < spreadsheet.NumberOfRows; nRow++)
            {
                for (int nCol = 0; nCol < spreadsheet.NumberOfColumns; nCol++)
                {
                    spreadsheet.SetValue(nRow, nCol, cellnum);
                    Console.Write("{0} ", cellnum);
                    cellnum++;

                    //Could do but performance hit
                    //spreadsheet.Save("Calcspreadsheet.bin");
                    //Thread.Sleep(100);
                }
            }
            Console.WriteLine();
        }
Exemple #7
0
        private static void UpdateSpreadSheet(ISpreadSheet spreadsheet)
        {
            int cellnum = 0;

            for (int nRow = 0; nRow < spreadsheet.NumberOfRows; nRow++)
            {
                for (int nCol = 0; nCol < spreadsheet.NumberOfColumns; nCol++)
                {
                    Console.Write("{0} ", cellnum);
                    spreadsheet.SetValue(nRow, nCol, cellnum);
                    cellnum++;

                    //Could do but performance hit
                    //spreadsheet.Save("Calcspreadsheet.bin");
                    //Thread.Sleep(100);
                }
            }
            Console.WriteLine();
        }
Exemple #8
0
 public SpreadSheetDecorator(ISpreadSheet spreadsheet)
 {
     inner = spreadsheet;
 }
Exemple #9
0
 public SpreadSheetCommandLogDecorator(ISpreadSheet spreadsheet)
     : base(spreadsheet)
 {
     invoker = new CommandHistoryInvoker(
         String.Format("{0}.log", spreadsheet.Name));
 }
 public void RegisterSheet(string name, ISpreadSheet sheet)
 {
     sheets[name] = sheet;
 }
 public PINGenerator(ISpreadSheet spreadSheet)
 {
     this.spreadSheet = spreadSheet;
 }
 public void RegisterSheet(string name, ISpreadSheet sheet)
 {
     sheets[name] = sheet;
 }
Exemple #13
0
 public SpreadSheetBatchCommandDecorator(ISpreadSheet spreadsheet) : base(spreadsheet)
 {
     invoker = new BatchInvoker();
 }
 public SpreadSheetCommandLogDecorator(ISpreadSheet spreadsheet)
     : base(spreadsheet)
 {
     invoker = new CommandHistoryInvoker(
         String.Format("{0}.log", spreadsheet.Name));
 }
 public PINTestGenerator()
 {
     spreadSheet  = new SpreadSheet();
     pinGenerator = new PINGenerator(spreadSheet);
 }
 public SpreadSheetBatchCommandDecorator(ISpreadSheet spreadsheet)
     : base(spreadsheet)
 {
     _invoker = new BatchInvoker();
 }
 public SpreadSheetDecorator(ISpreadSheet spreadsheet)
 {
     _inner = spreadsheet;
 }