Esempio n. 1
0
        public XSheetMain(String APPid)
        {
            XSheetUser user = null;
            String     path = null;

            try
            {
                user = new XSheetUser(System.Environment.UserDomainName, System.Environment.UserName, System.Environment.MachineName, System.Environment.OSVersion.ToString());
                try
                {
                    path = user.apps[APPid.ToUpper()];
                }
                catch (Exception)
                {
                    MessageBox.Show("你没有APP:" + APPid + "的权限");
                    return;
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.ToString());
                return;
            }
            InitializeComponent();
            setDefaultParam();

            this.control = new XSheetControl(spreadsheetMain, buttons, labels, path, menus, rightClickBarManager, this, alertcontrolMain, user);
            timer100ms.Start();
            this.Show();
        }
Esempio n. 2
0
        public MainForm()
        {
            try
            {
                user = new XSheetUser(System.Environment.UserDomainName, System.Environment.UserName, System.Environment.MachineName, System.Environment.OSVersion.ToString());
            }
            catch (Exception e)
            {
                MessageBox.Show(e.ToString());
                return;
            }

            InitializeComponent();
            this.splashManager = new DevExpress.XtraSplashScreen.SplashScreenManager(this, typeof(global::XSheet.v2.Form.process), true, true);
            this.splashManager.ShowWaitForm();
            init();
            this.splashManager.CloseWaitForm();
        }
Esempio n. 3
0
        public String execute(XSheetUser user)
        {
            StartNotify();
            String ans = "OK";

            foreach (char item in cfg.CRUDP)
            {
                /*if (!user.getPrivilege(rsheet).Contains(item))
                 * {
                 *  ans = "No privilege!";
                 *  return ans;
                 * }*/
            }
            if (actions.Count <= 0)
            {
                AlertUtil.Show("error", String.Format("Command :{0} 中未找到对应的Action,Command无法执行", this.CommandName));
            }
            else
            {
                actions = actions.OrderBy(o => o.Key).ToDictionary(o => o.Key, p => p.Value);
                int i = 0;
                while (i <= actions.Keys.Max())
                {
                    if (actions.Keys.Contains(i))
                    {
                        actions[i].dRange.getRange().Worksheet.Calculate();
                        ans = actions[i].doAction();
                        i   = actions[i].getNextIndex(ans, i);
                    }
                    else
                    {
                        i++;
                    }
                }
            }

            /*foreach (KeyValuePair<int, XAction> kv in actions)
             * {
             *  kv.Value.dRange.getRange().Worksheet.Calculate();
             * }*/
            FinishNotify();
            return(ans);
        }
Esempio n. 4
0
        /*public XCfgData cfgData { get; set; }
         * public XApp app { get; set; }
         * public XSheet.Data.XSheet currentSheet{ get; set;}
         * public XNamed currentXNamed { get; set; }
         *
         * public string executeState { get; set; }
         * public string appstatu { get; set; }
         * private CommandExecuter executer;
         * private AreasCollection oldSelected { get; set; }*/
        public XSheetDesigner(XSheetUser user)
        {
            user.logAsDesigner = true;
            DateTime     date = DateTime.Now;
            StreamWriter sw   = new StreamWriter(@"ConsoleOutput.txt", true);
            TextWriter   temp = Console.Out;

            InitializeComponent();
            InitSkinGallery();
            setDefaultParam();
            Console.SetOut(sw);
            Console.WriteLine("beforeDsp:" + date.ToString());
            sw.Close();
            Console.SetOut(temp);
            this.control = new XSheetControl(spreadsheetMain, buttons, labels, menus, rightClickBarManager, this, alertcontrolMain, user);
            timer100ms.Start();
            date = DateTime.Now;
            sw   = new StreamWriter(@"ConsoleOutput.txt", true);
            Console.SetOut(sw);
            Console.WriteLine("end:" + date.ToString());
            sw.Close();
            Console.SetOut(temp);
            this.Show();
        }
Esempio n. 5
0
 public CommandTask(XCommand cmd, XSheetUser user)
 {
     this.cmd        = cmd;
     this.user       = user;
     this.submitTime = DateTime.Now;
 }
Esempio n. 6
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();
     }
 }
Esempio n. 7
0
 //构造函数
 public XSheetControl(SpreadsheetControl spreadsheetMain, Dictionary <String, SimpleButton> buttons, Dictionary <String, Label> labels, Dictionary <String, PopupMenu> menus, BarManager barmanager, XtraForm form, AlertControl alert, XSheetUser user)
 {
     controlInit(spreadsheetMain, buttons, labels, "", menus, barmanager, form, alert, user);
 }
Esempio n. 8
0
 public CommandExecuter(XSheetUser user)
 {
     this.user = user;
 }