Exemplo n.º 1
0
        /// <summary>
        /// This function is the callback used to execute the command when the menu item is clicked.
        /// See the constructor to see how the menu item is associated with this function using
        /// OleMenuCommandService service and MenuCommand class.
        /// </summary>
        /// <param name="sender">Event sender.</param>
        /// <param name="e">Event args.</param>
        private void Execute(object sender, EventArgs e)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            var wpfTextView   = WpfTextViewHelper.GetWpfTextView(ServiceProvider);
            var caretPosition = WpfTextViewHelper.GetCaretPosition(wpfTextView);

            if (!Clipboard.ContainsText())
            {
                return;
            }

            var grid = new GridData(Clipboard.GetText());

            grid.DetermineNumericColumns();
            grid.FormatGrid();
            var tempTablePutput = new TempTableBuilder(grid).OutputString();

            var edit = wpfTextView.TextBuffer.CreateEdit();

            edit.Insert(caretPosition, tempTablePutput);
            edit.Apply();
        }
Exemplo n.º 2
0
 public ScriptBuilderBase(GridData data)
 {
     this.Data = data;
 }
Exemplo n.º 3
0
 public TempTableBuilder(GridData data) : base(data)
 {
 }
Exemplo n.º 4
0
 public InClauseBuilder(GridData data) : base(data)
 {
 }
Exemplo n.º 5
0
 public WhereClauseBuilder(GridData data) : base(data)
 {
 }