Exemplo n.º 1
0
        private void DG_FList_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_FList.SelectedIndex < 0)
            {
                return;
            }
            ErrorReportElement_FB ele      = (ErrorReportElement_FB)DG_FList.SelectedItem;
            FuncBlockViewModel    fbvmodel = ele.FBVModel;
            int line   = ele.Line;
            int column = ele.Column;

            parent.NavigateToFuncBlock(fbvmodel, line, column);
        }
Exemplo n.º 2
0
        private void DG_List_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (!parent.MainWindow.LAReplace.IsFloat &&
                !parent.MainWindow.LAReplace.IsDock)
            {
                LayoutSetting.AddDefaultDockWidthAnchorable(
                    Properties.Resources.MainWindow_Replace, parent.MainWindow.LAReplace.AutoHideWidth.ToString());
                LayoutSetting.AddDefaultDockHeighAnchorable(
                    Properties.Resources.MainWindow_Replace, parent.MainWindow.LAReplace.AutoHideHeight.ToString());
                parent.MainWindow.LAReplace.ToggleAutoHide();
            }
            if (DG_List.SelectedIndex < 0)
            {
                return;
            }
            TextReplaceElement element = null;

            if (e.AddedItems.Count > 0)
            {
                element = (TextReplaceElement)(e.AddedItems[0]);
            }
            else if (e.RemovedItems.Count > 0)
            {
                element = (TextReplaceElement)(e.RemovedItems[0]);
            }
            else
            {
                return;
            }
            FuncBlockViewModel fbvmodel = element.FBVModel;
            int offset = element.Offset;
            int count  = element.Word.Length;

            parent.NavigateToFuncBlock(fbvmodel, offset);
            fbvmodel.SetOffset(offset, count);
        }