F# doesn't support the "protected" modifier, but here's how your class would look if the OnObjectsAdded member is made public:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
open System


type ControlNumberQueue() =
  inherit Queue()
  let ev = Event<EventHandler,EventArgs>()
  

  [<CLIEvent>]
  member this.ObjectsAdded = ev.Publish


  abstract OnObjectsAdded : EventArgs -> unit
  default this.OnObjectsAdded(e) = ev.Trigger(this, e)


  override this.Enqueue(o) =
    base.Enqueue(o)
    this.OnObjectsAdded(EventArgs.Empty)
By on 12/7/2010 1:55 PM ()

Thanks for the quick answer. I will have to spend some time understanding the event declaration.

By on 12/8/2010 7:04 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper