예제 #1
0
 //带参数的初始化
 public void controlInit(SpreadsheetControl spreadsheetMain, Dictionary <String, SimpleButton> buttons, Dictionary <String, Label> labels, String path, Dictionary <String, PopupMenu> menus, BarManager barmanager, XtraForm form, AlertControl alert, XSheetUser user)
 {
     this.buttons              = buttons;
     this.labels               = labels;
     this.spreadsheetMain      = spreadsheetMain;
     this.menus                = menus;
     this.rightClickBarManager = barmanager;
     AlertUtil.setAlert(alert, form);
     this.user  = user;
     this.form  = form;
     this.alert = alert;
     //CELLCHANGE
     executer = new CommandExecuter(user);
     executer.Attach(this);
     executeState = "OK";
     /*加载文档,后续根据不同设置配置,待修改TODO*/
     try
     {
         DateTime     date = new DateTime();
         StreamWriter sw   = new StreamWriter(@"ConsoleOutput.txt", true);
         date = DateTime.Now;
         sw.WriteLine("beforeLoadDoc:" + date.ToString());
         if (path.Length > 0)
         {
             spreadsheetMain.Document.LoadDocument(path);
         }
         sw.Flush();
         sw.Close();
     }
     catch (Exception e)
     {
         MessageBox.Show(e.ToString());
         spreadsheetMain.Dispose();
     }
 }