Exemplo n.º 1
0
        public void Execute()
        {
            ISpreadSheet spreadsheet =
                SpreadSheetRegistrySingleton.GetInstance().GetSheetByName(sheetname);

            spreadsheet.SetValue(nRow, nCol, value);
        }
Exemplo n.º 2
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;
 }
Exemplo n.º 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;
 }
Exemplo n.º 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");
        }
Exemplo n.º 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");
        }
Exemplo n.º 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();
        }
Exemplo n.º 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();
        }
Exemplo n.º 8
0
 public SpreadSheetDecorator(ISpreadSheet spreadsheet)
 {
     inner = spreadsheet;
 }
Exemplo n.º 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;
 }
Exemplo n.º 11
0
 public PINGenerator(ISpreadSheet spreadSheet)
 {
     this.spreadSheet = spreadSheet;
 }
 public void RegisterSheet(string name, ISpreadSheet sheet)
 {
     sheets[name] = sheet;
 }
Exemplo n.º 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();
 }
Exemplo n.º 17
0
 public SpreadSheetDecorator(ISpreadSheet spreadsheet)
 {
     _inner = spreadsheet;
 }