To be hones I like working with events more than with override. This is because its very obvious how to use. Create a handdler or dispose the handdler. With overrides you need to exactly know what to do before you can get it to work.
Example with DisplayConduit:
The current method with override:
Imports Rhino.Display
Imports Rhino.Geometry
Imports System.Drawing
Imports Rhino
Public Class PatchConduitLeft
Inherits DisplayConduit
Private _bbox As BoundingBox
Protected Overrides Sub CalculateBoundingBox(ByVal e As CalculateBoundingBoxEventArgs)
MyBase.CalculateBoundingBox(e)
e.BoundingBox.Union(_bbox)
End Sub
Public Sub New()
_bbox = Brep.GetBoundingBox(True)
End Sub
Protected Overrides Sub PostDrawObjects(ByVal e As DrawEventArgs)
e.Display.PushCullFaceMode(CullFaceMode.DrawFrontAndBack)
MyBase.PostDrawObjects(e)
Dim vp = e.Display.Viewport
e.Display.EnableLighting(True)
e.Display.DrawBrepShaded(Brep, Mat)
End If
End Sub
End Class
How you probably do it with an event:
//somewhere add the handdler like Addhanddler Rhino.Display.DisplayConduit, AddressOf DisplaySub
Private Sub DisplaySub (ByVal sender As Object, ByVal e As Rhino.Display.DisplayConduitEventArgs)
e.Display.PushCullFaceMode(CullFaceMode.DrawFrontAndBack)
e.Display.EnableLighting(True)
e.Display.DrawBrepShaded(Brep, Mat)
End Sub
2nd example would be clearer because most of the things are handled by events (for me at least). It’s less code and less figuring out how to use it for the Developer. Couple of examples where Events are used for me are:
AddHandler Rhino.Commands.Command.BeginCommand, AddressOf StartOfCommand
AddHandler Rhino.Commands.Command.EndCommand, AddressOf EndOfCommand
AddHandler Rhino.RhinoDoc.CloseDocument, AddressOf InterceptRhinoClose
AddHandler Rhino.RhinoDoc.BeginSaveDocument, AddressOf BeforeRhinoCloses
AddHandler Rhino.Commands.Command.UndoRedo, AddressOf UndoRedoCommand
This way is clearer because everything is then written the same way. If the boundingbox can be calculated automaticly is more easier than have too override it. With DisplayConduit at least I think this could be possible.
I hope my explanation is not that hard to read. I think this is more of a personal thing… but it would be easiest to have one way of doing things
Also I’m not a programmer from origin. So I dont how a “real” programmer thinks about this stuff