// called from InitDrawingControl, does GsPreviewCtrl specific initialization
public void Init( Document doc, Database db )
{
mCurrentDwg = db;
// check to see if the manager is already initalised
if( null == mpManager )
{
// if not let's set it up
mpManager = doc.GraphicsManager;
// here's some test code to show the GS Events working
mpManager.ViewToBeDestroyed += new ViewToBeDestroyedEventHandler( GSUtil.mpManager_ViewToBeDestroyed );
mpManager.ViewWasCreated += new ViewWasCreatedEventHandler( GSUtil.mpManager_ViewWasCreated );
mpManager.GsToBeUnloaded += new GsToBeUnloadedEventHandler( GSUtil.mpManager_GsToBeUnloaded );
mpManager.ConfigWasModified += new ConfigWasModifiedEventHandler( GSUtil.mpManager_ConfigWasModified );
mpDevice = mpManager.CreateAutoCADDevice(this.Handle);
// resize the device to the panel size
mpDevice.OnSize( this.Size );
// now create a new gs view
mpView = new Autodesk.AutoCAD.GraphicsSystem.View();
// and create the model
mpModel = mpManager.CreateAutoCADModel();
// add the view to the device
mpDevice.Add( mpView );
}
}