Load() public method

public Load ( string code ) : bool
code string
return bool
Ejemplo n.º 1
0
        public mainForm()
        {
            InitializeComponent();

            outputCallback = OutputCallbackMethod;
            AmandaHook.SetOutputCallback(outputCallback);

            AmandaObj = Amanda.GetInstance();
            tbConsole.AppendText(tempOutput.ToString());
            tempOutput.Clear();

            runButton.Click  += new EventHandler(RunCodeHandler);
            loadButton.Click += (sender, e) =>
            {
                if (fileManager.SelectedTabTextBox.Text == "")
                {
                    return;
                }

                if (AmandaObj.Load(fileManager.SelectedTabTextBox.Text) == true)
                {
                    MessageBox.Show("File Loaded");
                    fileManager.UpdateAutocompleteIdentifiers(AmandaObj.GetIdentifiers());
                }

                // Print if error
                //
                tbConsole.AppendText("\n\n");
                tbConsole.AppendText(tempOutput.ToString());
                tempOutput.Clear();
                tbConsole.SelectionStart = tbConsole.TextLength;
                tbConsole.ScrollToCaret();
            };

            //
            fileManager.UpdateAutocompleteIdentifiers(AmandaObj.GetIdentifiers());

            bwInterpret.WorkerSupportsCancellation = true;
            bwInterpret.WorkerReportsProgress      = false;
            bwInterpret.DoWork             += new DoWorkEventHandler(bwInterpret_doWork);
            bwInterpret.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bwInterpret_runWorkerCompleted);

            bwTextToConsole.WorkerSupportsCancellation = true;
            bwTextToConsole.WorkerReportsProgress      = false;
            bwTextToConsole.DoWork             += new DoWorkEventHandler(bwTextToConsole_doWork);
            bwTextToConsole.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bwTextToConsole_runWorkerCompleted);
        }
Ejemplo n.º 2
0
        public mainForm()
        {
            InitializeComponent();

            outputCallback = OutputCallbackMethod;
            AmandaHook.SetOutputCallback(outputCallback);

            AmandaObj = Amanda.GetInstance();
            tbConsole.AppendText(tempOutput.ToString());
            tempOutput.Clear();

            runButton.Click += new EventHandler(RunCodeHandler);
            loadButton.Click += (sender, e) =>
                {
                    if (fileManager.SelectedTabTextBox.Text == "") return;

                    if (AmandaObj.Load(fileManager.SelectedTabTextBox.Text) == true)
                    {
                        MessageBox.Show("File Loaded");
                        fileManager.UpdateAutocompleteIdentifiers(AmandaObj.GetIdentifiers());
                    }

                    // Print if error
                    //
                    tbConsole.AppendText("\n\n");
                    tbConsole.AppendText(tempOutput.ToString());
                    tempOutput.Clear();
                    tbConsole.SelectionStart = tbConsole.TextLength;
                    tbConsole.ScrollToCaret();
                };

            //
            fileManager.UpdateAutocompleteIdentifiers(AmandaObj.GetIdentifiers());

            bwInterpret.WorkerSupportsCancellation = true;
            bwInterpret.WorkerReportsProgress = false;
            bwInterpret.DoWork += new DoWorkEventHandler(bwInterpret_doWork);
            bwInterpret.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bwInterpret_runWorkerCompleted);

            bwTextToConsole.WorkerSupportsCancellation = true;
            bwTextToConsole.WorkerReportsProgress = false;
            bwTextToConsole.DoWork += new DoWorkEventHandler(bwTextToConsole_doWork);
            bwTextToConsole.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bwTextToConsole_runWorkerCompleted);
        }