mcneel/RhinoCommonTemplatePackage — Issue #2: Use automatic properties for the command/plug-in instances
Author: sbaer
Created: 2012-02-01 19:53:40+00:00
State: open

The static properties that let you access the singleton instances of the command and plug-in classes should be written as automatic properties. Here's a sample

public class MyPlugIn : Rhino.PlugIns.PlugIn
{
///
Gets the only instance of the MyPlugIn plug-in.

public static MyPlugIn Instance { get; private set; }

public MyPlugIn()
{
Instance = this;
}

// You can override methods here to change the plug-in behavior on
// loading and shut down, add options pages to the Rhino _Option command
// and mantain plug-in wide options in a document.
}