Exemplo n.º 1
0
 /// <summary>
 /// The view is asking for items for its intellisense.
 /// </summary>
 /// <param name="sender">Editor that the user is typing in.</param>
 /// <param name="e">Event Arguments.</param>
 /// <param name="properties">Whether or not property suggestions should be generated.</param>
 /// <param name="methods">Whether or not method suggestions should be generated.</param>
 /// <param name="events">Whether or not event suggestions should be generated.</param>
 private void GetCompletionOptions(object sender, NeedContextItemsArgs e, bool properties, bool methods, bool events)
 {
     try
     {
         string currentLine = GetLine(e.Code, e.LineNo - 1);
         if (intellisense.GenerateGridCompletions(currentLine, e.ColNo, report, properties, methods, events, e.ControlSpace))
         {
             intellisense.Show(e.Coordinates.Item1, e.Coordinates.Item2);
         }
         intellisense.ItemSelected += (o, args) =>
         {
             if (args.ItemSelected == string.Empty)
             {
                 (sender as IEditorView).InsertAtCaret(args.ItemSelected);
             }
             else
             {
                 (sender as IEditorView).InsertCompletionOption(args.ItemSelected, args.TriggerWord);
             }
         };
     }
     catch (Exception err)
     {
         explorerPresenter.MainPresenter.ShowError(err);
     }
 }
 /// <summary>
 /// Called when the view is asking for completion items.
 /// Shows the intellisense popup.
 /// </summary>
 /// <param name="sender">Sender object.</param>
 /// <param name="e">Event data.</param>
 private void OnContextItemsNeeded(object sender, NeedContextItemsArgs e)
 {
     if (intellisense.GenerateGridCompletions(e.Code, e.Offset, tableModel as IModel, true, false, false, false, false))
     {
         intellisense.Show(e.Coordinates.X, e.Coordinates.Y);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// The view is asking for items for its intellisense.
 /// </summary>
 /// <param name="sender">Editor that the user is typing in.</param>
 /// <param name="e">Event Arguments.</param>
 /// <param name="rules">Controls whether rules (events) will be shown in intellisense</param>
 private void GetCompletionOptions(object sender, NeedContextItemsArgs e, bool rules)
 {
     try
     {
         string currentLine = GetLine(e.Code, e.LineNo - 1);
         currentEditor = sender as IEditorView;
         if (!e.ControlShiftSpace &&
             (rules ?
              intellisense.GenerateGridCompletions(currentLine, e.ColNo, model, true, false, false, false, e.ControlSpace) :
              intellisense.GenerateGridCompletions(currentLine, e.ColNo, model, false, true, false, true, e.ControlSpace)))
         {
             intellisense.Show(e.Coordinates.X, e.Coordinates.Y);
         }
     }
     catch (Exception err)
     {
         presenter.MainPresenter.ShowError(err);
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// The view is asking for items for the intellisense.
 /// </summary>
 /// <param name="sender">Sender object.</param>
 /// <param name="args">Event arguments.</param>
 private void OnIntellisenseNeeded(object sender, NeedContextItemsArgs args)
 {
     try
     {
         if (intellisense.GenerateSeriesCompletions(args.Code, args.Offset, tableDropDown.SelectedValue, dataStore.Reader))
             intellisense.Show(args.Coordinates.X, args.Coordinates.Y);
     }
     catch (Exception err)
     {
         explorerPresenter.MainPresenter.ShowError(err);
     }
 }
Exemplo n.º 5
0
 private void GetContextItems(object o, NeedContextItemsArgs e)
 {
     try
     {
         if (intellisense.GenerateGridCompletions(e.Code, e.Offset, model, true, false, false, e.ControlSpace))
         {
             intellisense.Show(e.Coordinates.Item1, e.Coordinates.Item2);
         }
     }
     catch (Exception err)
     {
         explorerPresenter.MainPresenter.ShowError(err);
     }
 }
Exemplo n.º 6
0
 /// <summary>
 /// Invoked when the user is asking for items for the intellisense.
 /// </summary>
 /// <param name="sender">Sender object.</param>
 /// <param name="args">Event arguments.</param>
 private void OnIntellisenseItemsNeeded(object sender, NeedContextItemsArgs args)
 {
     try
     {
         if (intellisense.GenerateSeriesCompletions(args.Code, args.Offset, seriesView.DataSource.SelectedValue, storage.Reader))
         {
             intellisense.Show(args.Coordinates.X, args.Coordinates.Y);
         }
     }
     catch (Exception err)
     {
         explorerPresenter.MainPresenter.ShowError(err);
     }
 }
Exemplo n.º 7
0
 /// <summary>
 /// Invoked when the view is asking for completion options.
 /// Generates and displays these completion options.
 /// </summary>
 /// <param name="sender">Sender object.</param>
 /// <param name="args">Evenet arguments.</param>
 private void OnIntellisenseItemsNeeded(object sender, NeedContextItemsArgs args)
 {
     try
     {
         if (intellisense.GenerateGridCompletions(args.Code, args.Offset, (tableModel as IModel).Children[0], true, false, false, args.ControlSpace))
         {
             intellisense.Show(args.Coordinates.X, args.Coordinates.Y);
         }
     }
     catch (Exception err)
     {
         presenter.MainPresenter.ShowError(err);
     }
 }
Exemplo n.º 8
0
 /// <summary>
 /// The view is asking for variable names for its intellisense.
 /// </summary>
 /// <param name="sender">Sending object</param>
 /// <param name="e">Context item arguments</param>
 public void OnNeedVariableNames(object sender, NeedContextItemsArgs e)
 {
     try
     {
         if (intellisense.GenerateScriptCompletions(e.Code, e.Offset, e.ControlSpace))
         {
             intellisense.Show(e.Coordinates.Item1, e.Coordinates.Item2);
         }
     }
     catch (Exception err)
     {
         explorerPresenter.MainPresenter.ShowError(err);
     }
 }
Exemplo n.º 9
0
 /// <summary>
 /// The view is asking for items for the intellisense.
 /// </summary>
 /// <param name="sender">Sender object.</param>
 /// <param name="args">Event arguments.</param>
 private void OnIntellisenseNeeded(object sender, NeedContextItemsArgs args)
 {
     try
     {
         if (intellisense.GenerateSeriesCompletions(args.Code, args.Offset, view.TableList.SelectedValue, dataStore))
         {
             intellisense.Show(args.Coordinates.Item1, args.Coordinates.Item2);
         }
     }
     catch (Exception err)
     {
         explorerPresenter.MainPresenter.ShowError(err);
     }
 }
Exemplo n.º 10
0
 /// <summary>
 /// The view is asking for items for its intellisense.
 /// </summary>
 /// <param name="sender">Editor that the user is typing in.</param>
 /// <param name="e">Event Arguments.</param>
 /// <param name="properties">Whether or not property suggestions should be generated.</param>
 /// <param name="methods">Whether or not method suggestions should be generated.</param>
 /// <param name="events">Whether or not event suggestions should be generated.</param>
 private void GetCompletionOptions(object sender, NeedContextItemsArgs e, bool properties, bool methods, bool events)
 {
     try
     {
         string currentLine = GetLine(e.Code, e.LineNo - 1);
         currentEditor = sender;
         if (!e.ControlShiftSpace && intellisense.GenerateGridCompletions(currentLine, e.ColNo, report, properties, methods, events, e.ControlSpace))
         {
             intellisense.Show(e.Coordinates.X, e.Coordinates.Y);
         }
     }
     catch (Exception err)
     {
         explorerPresenter.MainPresenter.ShowError(err);
     }
 }
Exemplo n.º 11
0
 private void GetContextItems(object o, NeedContextItemsArgs e)
 {
     try
     {
         if (e.ControlShiftSpace)
         {
             intellisense.ShowMethodCompletion(model, e.Code, e.Offset, new Point(e.Coordinates.X, e.Coordinates.Y));
         }
         else if (intellisense.GenerateGridCompletions(e.Code, e.Offset, model, true, false, false, e.ControlSpace))
         {
             intellisense.Show(e.Coordinates.X, e.Coordinates.Y);
         }
     }
     catch (Exception err)
     {
         presenter.MainPresenter.ShowError(err);
     }
 }
Exemplo n.º 12
0
 /// <summary>User has pressed a '.' in the commands window - supply context items.</summary>
 /// <param name="sender">Event sender</param>
 /// <param name="e">Event arguments</param>
 private void OnContextItemsNeeded(object sender, NeedContextItemsArgs e)
 {
     try
     {
         if (e.ControlShiftSpace)
         {
             intellisense.ShowMethodCompletion(cultivar, e.Code, e.Offset, new Point(e.Coordinates.X, e.Coordinates.Y));
         }
         else if (intellisense.GenerateGridCompletions(e.Code, e.Offset, cultivar, true, false, false, e.ControlSpace))
         {
             intellisense.Show(e.Coordinates.X, e.Coordinates.Y);
         }
     }
     catch (Exception err)
     {
         explorerPresenter.MainPresenter.ShowError(err);
     }
 }
Exemplo n.º 13
0
 /// <summary>
 /// The view is asking for variable names for its intellisense.
 /// </summary>
 /// <param name="sender">Sending object</param>
 /// <param name="e">Context item arguments</param>
 public void OnNeedVariableNames(object sender, NeedContextItemsArgs e)
 {
     try
     {
         if (e.ControlShiftSpace)
         {
             intellisense.ShowScriptMethodCompletion(manager, e.Code, e.Offset, new Point(e.Coordinates.X, e.Coordinates.Y));
         }
         else if (intellisense.GenerateScriptCompletions(e.Code, e.Offset, e.ControlSpace))
         {
             intellisense.Show(e.Coordinates.X, e.Coordinates.Y);
         }
     }
     catch (Exception err)
     {
         explorerPresenter.MainPresenter.ShowError(err);
     }
 }
Exemplo n.º 14
0
        /// <summary>
        /// Intellisense lookup.
        /// </summary>
        /// <param name="sender">The menu item</param>
        /// <param name="e">Event arguments</param>
        private void OnContextItemsNeeded(object sender, NeedContextItemsArgs e)
        {
            if (e.ObjectName == string.Empty)
            {
                e.ObjectName = ".";
            }

            try
            {
                string currentLine = GetLine(e.Code, e.LineNo - 1);
                if (e.ControlShiftSpace)
                {
                    intellisense.ShowMethodCompletion(factor, e.Code, e.Offset, new Point(e.Coordinates.X, e.Coordinates.Y));
                }
                else if (intellisense.GenerateGridCompletions(currentLine, e.ColNo, factor, true, false, false, false, e.ControlSpace))
                {
                    intellisense.Show(e.Coordinates.X, e.Coordinates.Y);
                }
            }
            catch (Exception err)
            {
                presenter.MainPresenter.ShowError(err);
            }
        }