Beispiel #1
0
 public static Amanda GetInstance()
 {
     if (Instance == null)
     {
         lock (LockObj)
         {
             Instance = new Amanda();
         }
     }
     return Instance;
 }
Beispiel #2
0
        private Amanda(string autorun = null)
        {
            if (Instance == null)
            {
                Instance = this;
            }

            AmandaHook.InitOptions(true, ""); //empty char will result in amanda loading up amanda.ini
            AmandaHook.CreateInterpreter();
            if (autorun != null) AmandaHook.Load(autorun);
        }
Beispiel #3
0
 public static Amanda GetInstance()
 {
     if (Instance == null)
     {
         lock (LockObj)
         {
             Instance = new Amanda();
         }
     }
     return(Instance);
 }
Beispiel #4
0
        private Amanda(string autorun = null)
        {
            if (Instance == null)
            {
                Instance = this;
            }

            AmandaHook.InitOptions(true, ""); //empty char will result in amanda loading up amanda.ini
            AmandaHook.CreateInterpreter();
            if (autorun != null)
            {
                AmandaHook.Load(autorun);
            }
        }
Beispiel #5
0
        public void UpdateAutocompleteIdentifiers()
        {
            //of toch wel? :D, word per keydown opnieuw geparsed, zou niet langzaam moeten zijn omdat string compare snel is/kan zijn

            Amanda amandaObj = Amanda.GetInstance();

            amandaTagParser.Parse(textBox.Text);

            ICollection <string> tags = new List <string>();

            amandaTagParser.AmandaTags.ForEach(q => tags.Add(q.Name));

            ICollection <string> items = tags.Concat(amandaObj.GetIdentifiers()).ToList();//amandaTagParser.Concat(Identifiers).ToList();

            autocomplete.Items.SetAutocompleteItems(items);
        }
Beispiel #6
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);
        }
Beispiel #7
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);
        }