fyiReporting.RdlDesign.RdlEditPreview.Goto C# (CSharp) Method

Goto() public method

public Goto ( Control ctl, int nLine ) : void
ctl System.Windows.Forms.Control
nLine int
return void
        public void Goto(Control ctl, int nLine)
        {
            if (_CurrentTab != DesignTabs.Edit)
                return;

            if(nLine > scintilla1.Lines.Count)
                nLine = scintilla1.Lines.Count;
            scintilla1.Lines[nLine-1].Goto();
            scintilla1.SelectionStart = scintilla1.Lines[nLine - 1].Position;
            scintilla1.SelectionEnd = scintilla1.Lines[nLine - 1].EndPosition;
        }

Usage Example

        private void lbSchemaErrors_DoubleClick(object sender, System.EventArgs e)
        {
            RdlEditPreview rep = _RdlDesigner.GetEditor();

            if (rep == null || this.lbSchemaErrors.SelectedIndex < 0)
            {
                return;
            }
            try
            {
                // line numbers are reported as (line#, character offset) e.g. (110, 32)
                string v  = this.lbSchemaErrors.Items[lbSchemaErrors.SelectedIndex] as string;
                int    li = v.LastIndexOf("(");
                if (li < 0)
                {
                    return;
                }
                v  = v.Substring(li + 1);
                li = v.IndexOf(",");    // find the
                v  = v.Substring(0, li);

                int nLine = Int32.Parse(v);
                rep.Goto(this, nLine);
                this.BringToFront();
            }
#if DEBUG
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);    // developer might care about this error??
            }
#else
            catch
            {}                          // user doesn't really care if something went wrong
#endif
        }
All Usage Examples Of fyiReporting.RdlDesign.RdlEditPreview::Goto