private void menuNewApp_Click(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;

                string groupName = string.Empty;

                if (tvApps.SelectedNode != null)
                {
                    TreeNode tnTop = tvApps.SelectedNode;

                    while (tnTop.Parent != null)
                    {
                        tnTop = tnTop.Parent;
                    }

                    groupName = tnTop.Text;
                }

                frmEditAppProperty fe = new frmEditAppProperty(ConstAppValue.DefaultAppName, ConstAppValue.DefaultIsLogsFromFile, groupName);
                fe.Text = "编辑应用程序名称";

                if (CGeneralFuncion.ShowWindow(this, fe, true) == System.Windows.Forms.DialogResult.OK)
                {
                    LogApp la = LogApp.NewApplication;
                    la.Name = fe.EditedName;
                    la.IsImportLogsFromFiles = fe.IsImportLogsFromFile;
                    la.Group = fe.Group;

                    CreateNewAppCommand cmd = new CreateNewAppCommand(la);
                    cmd.UndoDone += new UndoRedoEventHandler(RemoveAppFromTree);
                    cmd.RedoDone += new UndoRedoEventHandler(AddApp2Tree);
                    cmd.Execute();

                    AddCommand(cmd);
                    AddApp2Tree(la);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("创建新工艺失败,错误消息为:" + ex.Message);
            }
        }
        private void UpdateAppProperry()
        {
            this.Cursor = Cursors.WaitCursor;
            LogApp la = AppService.Instance.GetApp(Convert.ToString(tvApps.SelectedNode.Tag));

            frmEditAppProperty fe = new frmEditAppProperty(la.Name, la.IsImportLogsFromFiles, la.Group.Name);

            fe.Guid = la.AppGUID;

            if (CGeneralFuncion.ShowWindow(this, fe, true) == System.Windows.Forms.DialogResult.OK)
            {
                string        appGuid          = Convert.ToString(tvApps.SelectedNode.Tag);
                LogAppMemento memento          = new LogAppMemento(fe.IsImportLogsFromFile, fe.EditedName, la.Group.Name);
                UpdateAppPropertiesCommand cmd = new UpdateAppPropertiesCommand(appGuid, memento);
                cmd.UndoDone += new UndoRedoEventHandler(RefreshAppNodeName);
                cmd.RedoDone += new UndoRedoEventHandler(RefreshAppNodeName);

                cmd.Execute();

                AddCommand(cmd);
                RefreshAppNodeName(appGuid, fe.EditedName);
            }
        }