Goto() public method

public Goto ( Control ctl, int nLine ) : void
ctl System.Windows.Forms.Control
nLine int
return void
        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
        }
Example #2
0
        private void btnGoto_Click(object sender, System.EventArgs e)
        {
            try
            {
                try
                {
                    int nLine = Int32.Parse(txtLine.Text);
                    rdlEdit.Goto(this, nLine);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(this, ex.Message, "Invalid Line Number");
                }

                txtLine.Focus();
            }
            catch (Exception er)
            {
                er.ToString();
            }
        }