コード例 #1
0
        private void DG_List_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
        {
            if (!parent.MainWindow.LAErrorList.IsFloat &&
                !parent.MainWindow.LAErrorList.IsDock)
            {
                LayoutSetting.AddDefaultDockWidthAnchorable(
                    Properties.Resources.MainWindow_Error_List, parent.MainWindow.LAErrorList.AutoHideWidth.ToString());
                LayoutSetting.AddDefaultDockHeighAnchorable(
                    Properties.Resources.MainWindow_Error_List, parent.MainWindow.LAErrorList.AutoHideHeight.ToString());
                parent.MainWindow.LAErrorList.ToggleAutoHide();
            }
            if (DG_List.SelectedIndex < 0)
            {
                return;
            }
            ErrorReportElement inst    = (ErrorReportElement)DG_List.SelectedItem;
            BaseViewModel      bvmodel = inst.Prototype;
            int    x       = bvmodel.X;
            int    y       = bvmodel.Y;
            int    network = int.Parse(inst.Network);
            string diagram = inst.Diagram;
            NavigateToNetworkEventArgs _e = new NavigateToNetworkEventArgs(network, diagram, x, y);

            parent.NavigateToNetwork(_e);
        }
コード例 #2
0
ファイル: FindWindow.xaml.cs プロジェクト: hyzhappy/samsoarii
        /// <summary>
        /// 当在表格内选择元素时触发
        /// </summary>
        /// <param name="sender">事件源</param>
        /// <param name="e">事件信息</param>
        private void DG_List_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            // 若当前窗口为停靠状态,可能会覆盖到导航的位置,
            // 所以先将窗口固定,保证主界面的完整显示
            if (!parent.MainWindow.LAFind.IsFloat &&
                !parent.MainWindow.LAFind.IsDock)
            {
                LayoutSetting.AddDefaultDockWidthAnchorable(
                    Properties.Resources.MainWindow_Search, parent.MainWindow.LAFind.AutoHideWidth.ToString());
                LayoutSetting.AddDefaultDockHeighAnchorable(
                    Properties.Resources.MainWindow_Search, parent.MainWindow.LAFind.AutoHideHeight.ToString());
                parent.MainWindow.LAFind.ToggleAutoHide();
            }
            // 未选择元素则不导航
            if (DG_List.SelectedIndex < 0)
            {
                return;
            }
            // 导航到选择元素对应的位置
            FindElement   fele            = items[DG_List.SelectedIndex];
            BaseViewModel bvmodel         = fele.BVModel;
            int           x               = bvmodel.X;
            int           y               = bvmodel.Y;
            string        diagram         = fele.Diagram;
            int           network         = int.Parse(fele.Network);
            NavigateToNetworkEventArgs _e = new NavigateToNetworkEventArgs(network, diagram, x, y);

            parent.NavigateToNetwork(_e);
        }
コード例 #3
0
 private void OnBreakpointPause(object sender, BreakpointPauseEventArgs e)
 {
     Dispatcher.Invoke(new Utility.Delegates.Execute(() =>
     {
         BaseViewModel bvmodel = BreakPointManager.GetBVModel(e.Address);
         if (bvmodel != null)
         {
             Breakpoint = bvmodel;
             ifacade.NavigateToNetwork(bvmodel);
             IEnumerable <SimuBrpoElement> fit = items.Where(
                 (_ele) => { return(_ele.BVModel == bvmodel); });
             if (fit.Count() > 0)
             {
                 SimuBrpoElement ele = fit.First();
                 int id = items.IndexOf(ele);
                 DG_Main.SelectedIndex = id;
             }
         }
     }));
 }