I created a splash class with a timer on it, and when the timer is finished it instances another class as shown in the code below. When i then create a new class how can i access MainWindow?
namespace Kinetics
{
public class KineticsCommand : RMA.Rhino.MRhinoCommand
{
Splash Splash = new Splash();
Splash.Show();
}
public partial class Splash : Form
{
public Splash()
{
InitializeComponent();
}
private void timer1_Tick(object sender, EventArgs e)
{
this.Close();
MainUI MainWindow = new MainUI();
MainWindow.Show();
}
}
public class CustomEventWatcher : MRhinoEventWatcher
{
public override void OnReplaceObject(ref MRhinoDoc doc, ref MRhinoObject old, ref MRhinoObject obj)
{
// How can i access the class from here?
}
}
}
CustomEventWatcher will need a reference to MainWindow, for example via a property within CustomEventWatcher: