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();
        }
        private void PasteSyntax()
        {
            //copy to clipboard and return for this function
            Clipboard.SetText(cmd.CommandSyntax);

            //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;

            //31May2015. No need to paste the R commented '#' commands in syntax
            //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";
            string syncomment = "\n";                             //31May2015

            sewindow.PasteSyntax(syncomment + cmd.CommandSyntax); //paste command  :->
            sewindow.Show();
            sewindow.WindowState = WindowState.Normal;
            sewindow.Activate();
        }