void CaretChanged(object sender, EventArgs e)
        {
            TextAreaControl activeTextAreaControl = textEditorControl.ActiveTextAreaControl;
            int             line = activeTextAreaControl.Caret.Line;
            int             col  = activeTextAreaControl.Caret.Column;

            StatusBarService.SetCaretPosition(activeTextAreaControl.TextArea.TextView.GetVisualColumn(line, col) + 1, line + 1, col + 1);
            NavigationService.Log(this.BuildNavPoint());
        }
Exemplo n.º 2
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            //对登陆界面的帐号密码进行判断并对XML 进行重新配置
            if (CheckData(this.txtUserName.Text.Trim(), this.txtPassword.Text.Trim()))
            {
                try
                {
                    CallRemotingService.SelectServerSite(site);
                    DataSet   ds        = new DataSet();
                    DataTable dataTable = CreateUserTable();//创建一张自定义结构的表
                    Dictionary <string, string> rowData = new Dictionary <string, string>()
                    {
                        { RBAC_USER_FIELDS.FIELD_USERNAME, txtUserName.Text.Trim() }
                    };
                    FanHai.Hemera.Utils.Common.Utils.AddRowDataToDataTable(ref dataTable, rowData); //把rowData中的数据添加在表dataTable中
                    ds.Tables.Add(dataTable);                                                       //把表dataTable添加到表集ds中
                    DataSet dataUser = new DataSet();

                    IServerObjFactory isof       = CallRemotingService.GetRemoteObject();//创建工厂接口对象
                    IUserEngine       userEngine = isof.CreateIUserEngine();

                    dataUser = userEngine.CheckUser(ds); //通过传入的帐号查询返回该帐号对应的信息

                    if (CheckUser(dataUser))             //数据库信息和用户信息进行对比返回bool类型
                    {
                        UpdateLanguageInfo();
                        UpdateServerSitList();
                        //对登录用户的信息进行登记
                        UpdateLoginUserInfo();

                        DialogResult = DialogResult.OK;
                        this.Close();
                        StatusBarService.SetCaretPosition(30, 70, 0);
                    }
                }
                catch (Exception ex)
                {
                    MessageService.ShowMessage(ex.Message);
                }
                finally
                {
                    CallRemotingService.UnregisterChannel();
                }
            }
            Xmlproper();
        }
Exemplo n.º 3
0
        public void Run(IList <string> fileList)
        {
            //WorkbenchSingleton.MainForm.Show();

            bool didLoadSolutionOrFile = false;

            NavigationService.SuspendLogging();

            foreach (string file in fileList)
            {
                LoggingService.Info("Open file " + file);
                didLoadSolutionOrFile = true;
                try
                {
                    string fullFileName = Path.GetFullPath(file);

                    //IProjectLoader loader = ProjectService.GetProjectLoader(fullFileName);
                    //if (loader != null)
                    //{
                    //    loader.Load(fullFileName);
                    //}
                    //else
                    //{
                    //    FileService.OpenFile(fullFileName);
                    //}
                }
                catch (Exception e)
                {
                    MessageService.ShowError(e, "unable to open file " + file);
                }
            }

            if (!didLoadSolutionOrFile)
            {
                foreach (ICommand command in AddInTree.BuildItems <ICommand>("/Workspace/AutostartNothingLoaded", null, false))
                {
                    try
                    {
                        command.Run();
                    }
                    catch (Exception ex)
                    {
                        MessageService.ShowError(ex);
                    }
                }

                ICommand hidePadCmd = new HidePadCommand();
                hidePadCmd.Run();
            }

            NavigationService.ResumeLogging();

            //WorkbenchSingleton.MainForm.Focus(); // windows.forms focus workaround

            ParserService.StartParserThread();

            // finally run the workbench window ...
            Application.AddMessageFilter(new FormKeyHandler());
            //add by zhanghao begin 20100623 for status
            StatusBarService.SetCaretPosition(30, 70, 0);
            //end

            //Register app switch event
            if (!CallRemotingService.RegisterAppSwitchEvent())
            {
                MessageService.ShowError("App switch event register fail!");
            }

            //Register receive message from server event
            if (!CallRemotingService.RegisterReceiveMessageEvent())
            {
                MessageService.ShowError("Receive message fail!");
            }

            Application.Run(WorkbenchSingleton.MainForm);


            // save the workbench memento in the ide properties
            try
            {
                PropertyService.Set(workbenchMemento, WorkbenchSingleton.Workbench.CreateMemento());
            }
            catch (Exception e)
            {
                MessageService.ShowError(e, "Exception while saving workbench state.");
            }
        }