Reference Handle
CapableObjects Forums
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Reference Handle Expand / Collapse
Author
Message
Posted 2009-01-16 23:22:38
Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Group: Forum Members
Last Login: 2011-08-30 12:38:11
Posts: 61, Visits: 183
Hi, In eco I have a IObjectList filled programatically, and I need to put this list in a Reference Handle in order to display it.
How do I have to cast the IObjectList to a compatible argument for brhVersionList.SetElement(

I Tried this but no way I get an error
DialogExportForm.brhVersionList.SetElement(lVmVersionList.AsObject);
Post #1835
Posted 2009-01-17 02:12:38
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: 2010-11-30 12:17:13
Posts: 1 230, Visits: 1 382
You dont have to cast it at all

IObjectList lVmVersionList = ... some code here ...;
DialogExportForm.brhVersionList.SetElement(lVmVersionList);


The above should compile and do what you want. IObjectList inherits from IElement and that is the type of the parameter to ReferenceHandle.SetElement().


/Jonas Hogstrom [CapableObjects]
Post #1838
Posted 2009-01-19 11:55:30
Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Group: Forum Members
Last Login: 2011-08-30 12:38:11
Posts: 61, Visits: 183
If I doc this I get this Error
ex = {"Attempt to set handle to type Collection(ECOModelRoot) when static type is Collection(VmVersion)"}
I put static type as Collection(VmVersion)

Any Idea?
Post #1857
Posted 2009-01-19 12:26:46
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: 2010-11-30 12:17:13
Posts: 1 230, Visits: 1 382
How did you create the objectlist in the first place? if you use IVariablefactoryService.CreateUntypedObjectlist you will get a list with the internal UML-type "Collection(EcoModelRoot)". You will need to use another method of the factory:
CreateTypedObjectList(typeof(VmVersion), false);

That should give you a list that only accepts objects of type VmVersion.


/Jonas Hogstrom [CapableObjects]
Post #1858
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: HansKarlsen, Jonas Hogstrom, PeterMorris

Permissions Expand / Collapse

All times are GMT +1:00, Time now is 9:39

Powered By InstantForum.NET v4.1.4 © 2012
Execution: 0,125. 6 queries. Compression Disabled.