Rank: Newbie
Joined: 8/24/2010 Posts: 3 Location: Boston
|
Hi,
I am new to umodel, but reasonably proficient with OO/UML concepts.
Specifically, I am trying to use the IObservable interface in C#4.0 A screenshot of my desktop is here: http://www.quickphotohost.com/uploads/834eee55f9.png
I think the error message is indicating that I have not specified the type T in the interface. My problem is that for the life of me I cannot figure out how to specify it?
I tried this step outlined in another posting, but it did not have any options under the new menu.
" *) rightclick on a class diagram *) use New|Interface to create a new interface *) rightclick on the new interface *) use New|TemplateSignature to "add template capabilities" "
Update #1: I realized that I didn't have C#4.0 installed on this machine. Tried it again on a machine with C#4.0 and didnt get anywhere.
Update #2: I imported the iobservable interface from the mscorlib binary into my project. now it doesnt let me specify that my parameters class is a sub-class of iobservable. It says 'invalid target type'
Thanks for the advice,
Tim.
|
Rank: Advanced Member
Joined: 9/28/2005 Posts: 371 Location: Vienna
|
Hello tadler!
The link to your screenshot does not work for me, so I just can assume your problems. Anway, let's try... :-)
You don't need to have C#4.0 installed on your machine that you can work with C#4.0 classes, interfaces,... UModel installs a "predefined" include file for every major .NET version - just use "Project|Include Subproject|C#4.0|Microsoft.NET 4.0 for C#4.0". But of course you can also import mscorlib by yourself (the "predefined" include file has been made in exactly the same way).
Since I don't see your screenshot I'm not sure how you want to "use" it. To create a template binding, you can add a new class on your diagram and enter following text there ":IObservable<T->MyClass>". This way you create an "anonymous template binding" - a new type which you can use for your properties, parameters,.... or to derive from. Same you get when you specify this string directly as type of a property, parameter,... (see screenshot below).
A detailed documentation about templates, signature, bindings,... you can find here.
cor attached the following image(s):

|
Rank: Newbie
Joined: 8/24/2010 Posts: 3 Location: Boston
|
Thanks - that worked.
I didn't realize that just typing in the label was all that was required. The documentation makes a lot more sense now.
|