factory (, ).
EDITED VERSION w/SIngleton:
namespace Kinetics {
public class KineticsCommand : RMA.Rhino.MRhinoCommand
{
Splash splashVariable= Splash.SingletonInstance;
splashVariable.Show();
Splash.SingletonInstance.Show();
}
public partial class Splash : Form
{
private Splash splsh;
private Splash()
{
InitializeComponent();
}
public static Splash SingletonInstance
{
get { return splsh?? (splsh = new Splash()); }
}
public static Splash GetSingletonInstance()
{
return splsh?? (splsh = new Splash());
}
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)
{
Splash.SingletonInstance.[Whatever];
}
}
OLD Version, Splash: , , .
{
public class KineticsCommand : RMA.Rhino.MRhinoCommand
{
Splash splashVariable= new Splash();
splashVariable.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,
Splash splashScreen)
{
splashScreen.[Whatever];
}
}