Book a Demo

Author Topic: Modelling delegates in C#  (Read 4042 times)

GaryB

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Modelling delegates in C#
« on: January 25, 2007, 12:23:32 pm »
Hi group!
I am trying to model a delegate in 6.5.797 for use in my C# project. I see the appropriate tagged value in the help system but it's for an operation. If I just type a "public delegate void MyEventHandler(object sender, MyEventArgs e)" into a namespace and reverse engineer that source file, my delegate gets ignored.  If I reverse engineer the binary it gets modeled as a generalization of "MulticastDelegate" which is not quite what I want.  I'd like to see the "delegate" declaration as I exampled above.  Am I doing something wrong?

GaryB

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Modelling delegates in C#
« Reply #1 on: February 02, 2007, 11:29:36 am »
Just still wondering about this. I'm going to guess I'm the only one this is affecting if nobody has any input. I'm sure I'm not the only one using delegates though.  Hmmmm.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Modelling delegates in C#
« Reply #2 on: February 02, 2007, 11:41:35 am »
Hi Gary,

Report this as a bug, you can use the [size=13]Report a Bug[/size] link via the Support link at the top of the page.
Place a reference back to this topic in the message.  That way, the Sparxians can see any ongoing discussion.
If you get a response, please add it to the topic.

HTH,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Modelling delegates in C#
« Reply #3 on: February 04, 2007, 01:13:26 pm »
The delegates get ignored because as they don't fit neatly into UML they are represented in EA as methods.  As a result they can only exist inside other classes.

GaryB

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Modelling delegates in C#
« Reply #4 on: February 07, 2007, 06:32:16 am »
So then what is the best practice for declaring an event of that delegate type since it's not a class? Do you recommend I just free-form type the name of the delegate into my event's Return Type?  That's not ideal but if that's the best way I guess I could live with it.  What is the official recommendation for modeling delegates?