BlueSky.SyntaxEditorWindow.PasteSyntax C# (CSharp) Метод

PasteSyntax() публичный Метод

public PasteSyntax ( string command ) : void
command string
Результат void
        public void PasteSyntax(string command)//29Jan2013
        {
            string newlines = (inputTextbox.Text != null && inputTextbox.Text.Trim().Length > 0) ? "\n\n" : string.Empty;
            if (command != null && command.Length > 0)
                inputTextbox.AppendText(newlines + command);// inputTextbox.Text = existingCommands + command;
            int linecount = inputTextbox.LineCount - 1;
            inputTextbox.ScrollToLine(linecount); // linecount is zero based so decremented by 1 in above line
            inputTextbox.Select(inputTextbox.Text.Length, 0);//placing cursor at the end
        }

Usage Example

Пример #1
0
        private void PasteSyntax()
        {
            //copy to clipboard and return for this function
            // Clipboard.SetText(cmd.CommandSyntax);
            //Clipboard.SetText("asd dddddw");
            //Launch Syntax Editor window with command pasted /// 29Jan2013
            MainWindow mwindow = LifetimeService.Instance.Container.Resolve <MainWindow>();
            ////// Start Syntax Editor  //////
            SyntaxEditorWindow sewindow = LifetimeService.Instance.Container.Resolve <SyntaxEditorWindow>();

            sewindow.Owner = mwindow;
            //string syncomment = "# Use BSkyFormat(obj) to format the output.\n" +
            //    "# UAloadDataset(\'" + UIController.GetActiveDocument().FileName.Replace('\\', '/') +
            //    "\',  filetype=\'SPSS\', worksheetName=NULL, replace_ds=FALSE, csvHeader=TRUE, datasetName=\'" +
            //    UIController.GetActiveDocument().Name + "\' )\n";
            //  sewindow.PasteSyntax(syncomment + "asd dddddw");//paste command
            string syncomment = BSky.GlobalResources.Properties.UICtrlResources.syncomment + " " + "\"" + getTitle() + "\"";

            if (string.IsNullOrEmpty(getCommand()))
            {
                syncomment = syncomment = BSky.GlobalResources.Properties.UICtrlResources.syncomment2 + "\"" + getTitle() + "\"";
            }
            else
            {
                syncomment = syncomment + "\n" + getCommand();
            }

            sewindow.PasteSyntax(syncomment);
            sewindow.Show();
            sewindow.WindowState = WindowState.Normal;
            sewindow.Activate();
            this.Close();
        }
All Usage Examples Of BlueSky.SyntaxEditorWindow::PasteSyntax
SyntaxEditorWindow