Esempio n. 1
0
        private void tsbNew_Click(object sender, EventArgs e)
        {
            //foreach (IViewContent viewContent in WorkbenchSingleton.Workbench.ViewContentCollection)
            //{
            //    //判定视图名称是否为“区域管理”
            //    if (viewContent.TitleName == StringParser.Parse("${res:FanHai.Hemera.Addins.EMS.LocationCtrl.ViewContentPartTile}"))
            //    {
            //        viewContent.WorkbenchWindow.SelectWindow();
            //        return;
            //    }
            //}
            LocationViewContent locationViewContent = new LocationViewContent("", null);

            WorkbenchSingleton.Workbench.ShowView(locationViewContent);
        }
Esempio n. 2
0
        /// <summary>
        /// 执行命令。
        /// </summary>
        public override void Run()
        {
            //遍历工作台中已经打开的视图对象。
            foreach (IViewContent viewContent in WorkbenchSingleton.Workbench.ViewContentCollection)
            {
                //如果已打开该视图,则选中该视图显示,返回以结束该方法的运行。
                if (viewContent.TitleName == StringParser.Parse("${res:FanHai.Hemera.Addins.EMS.LocationViewContent.ViewContentPartTitle}"))
                {
                    viewContent.WorkbenchWindow.SelectWindow();
                    return;
                }
            }
            //创建新的视图对象,并显示该视图界面。
            LocationViewContent view = new LocationViewContent("", null);

            WorkbenchSingleton.Workbench.ShowView(view);
        }
Esempio n. 3
0
 private void tsbDelete_Click(object sender, EventArgs e)
 {
     //系统提示“确定要删除吗”
     if (MessageService.AskQuestion(StringParser.Parse("${res:FanHai.Hemera.Addins.Msg.DeleteRemind}"), StringParser.Parse("${res:Global.SystemInfo}")))
     {
         //判定LocationKey是否为空
         if (_locationEntity.LocationKey == "")
         {
             return;
         }
         else
         {
             _locationEntity.DeleteLocation();
             if (_locationEntity.ErrorMsg == "")
             {
                 //foreach (IViewContent viewContent in WorkbenchSingleton.Workbench.ViewContentCollection)
                 //{
                 //    //如果视图名称为“区域管理”执行
                 //    if (viewContent.TitleName == StringParser.Parse("${res:FanHai.Hemera.Addins.EMS.LocationCtrl.ViewContentPartTile}"))
                 //    {
                 //        //参数值为true则关闭当前操作视图
                 //        WorkbenchSingleton.Workbench.ActiveViewContent.WorkbenchWindow.CloseWindow(true);
                 //        viewContent.WorkbenchWindow.SelectWindow();
                 //        return;
                 //    }
                 //}
                 ////if there are no window named "区域管理" is opened
                 ////set control state
                 //State = ControlState.New;
                 ////change title 区域管理
                 //WorkbenchSingleton.Workbench.ActiveViewContent.TitleName = StringParser.Parse("${res:FanHai.Hemera.Addins.EMS.LocationCtrl.ViewContentPartTile}");
                 //提示“删除成功”
                 MessageBox.Show(StringParser.Parse("${res:FanHai.Hemera.Addins.EMS.LocationCtrl.MsgDeleteDataSuccessfully}"));
                 LocationViewContent locationViewContent = new LocationViewContent("", null);
                 WorkbenchSingleton.Workbench.ShowView(locationViewContent);
             }
             else
             {
                 MessageBox.Show(StringParser.Parse(_locationEntity.ErrorMsg));
             }
         }
     }
 }