I am trying to use the Single AIN code within a windows form application in C#. I got the SingleAIN code from the examples and then I made my own Windows Form App. I basically copied the performActions and showErrorMessage functions and replaced Console.WriteLine and Console.Out.WriteLine with textBox1.AppendText. I am getting errors around the performAction part. I attached the .cs file.
The main issue appears to be that you define performActions within your button click function. With this, performActions is not defined outside of the button click function, so you should move the performActions function definition outside of the button click function. I would also recommend you define [STAThread] above your main function.
Attached below is a similar project to what you are doing if it is at all helpful.