Ejemplo n.º 1
0
 void ActionDone(object sender, CLRListenerEventArgs <CLRActionEventData> args)
 {
     try
     {
         if (args.EventData.ActionCommand == "writeTextAreaToConsole")
         {
             var result = textArea.Invoke("getText");
             Console.WriteLine("Text from from AWT TextArea: {0}", result);
         }
         else if (args.EventData.ActionCommand == "writeToConsole")
         {
             counter++;
             Console.WriteLine("{0} Simple Action from JVM", counter);
             buttonWrite.setLabel(string.Format("Write to console for {0} time", counter + 1));
         }
         else if (args.EventData.ActionCommand == "closeApplication")
         {
             Console.WriteLine("Closing...");
             execute = false;
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }
Ejemplo n.º 2
0
 void ActionDone(object sender, CLRListenerEventArgs <CLRActionEventData> args)
 {
     if (textBox1.InvokeRequired)
     {
         textBox1.Invoke(new MethodInvoker(delegate { textBox1.Text += wrapper.TextArea.getText() + Environment.NewLine; }));
     }
     else
     {
         textBox1.Text += args.EventData.ActionCommand + Environment.NewLine;
     }
 }
 void ActionDone(object sender, CLRListenerEventArgs <CLRActionEventData> args)
 {
     tbOutput.Dispatcher.Invoke(() => tbOutput.Text += wrapper.TextArea.getText() + Environment.NewLine);
 }