Eco5 and Enums
CapableObjects Forums
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Eco5 and Enums Expand / Collapse
Author
Message
Posted 2010-04-07 14:52:19
Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Group: Forum Members
Last Login: Yesterday @ 20:21:00
Posts: 55, Visits: 3 211
Hi All!

In Eco4 all working fine.

I am using now Eco build 5.0.0.4754 and encountered strange issues. I have a Class1 with an enum attribute (PersistenceMapper set to GenericEnumAsInteger),


My Enum: DBaseWSEnum - is defined in
namespace ModelEnums of ModelEnums.dll

I do Generate Code
(Class1.eco.cs - auto-generated):

=============Skipped=================
[UmlElement(Id="d8c5d0a0-31d2-4dff-931c-eb42cbeb7b59", Index=Eco_LoopbackIndices.Attribute5)]
[UmlTaggedValue("Eco.PMapper", "GenericEnumAsInteger")]
public DBaseWSEnum Attribute5 {
get {
return ((DBaseWSEnum)(this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Attribute5)));
}
set {
this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Attribute5, ((object)(value)));
}
}
=============Skipped=================

Result of compiling:

Error 1:
The type or namespace name 'DBaseWSEnum' could not be found (are you missing a using directive or an assembly reference?) C:\Projects\Spectr\source\Assembly\Net2\ECO5\EcoTest\EcoTest.Model\EcoTest\Class1.eco.cs 237 12 EcoTest.Model

OK!

I do: Add Reference - ModelEnums.dll (which is containing DBaseWSEnum)
and add "using ModelEnums" - то auto-generated Class1.eco.cs

Compiling - no errors.
ОК!

Then I do "Generate Code" and get the same Error 1.

I see that my text "using ModelEnums" -
has deleted from auto-generated Class1.eco.cs

I.e:
Should I add "using ModelEnums" to auto-generated Class1.eco.cs
every time after "Generate Code"?

What is wrong?

Thanks
Seg
Post #5117
Posted 2010-04-07 16:34:26
Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Group: Forum Members
Last Login: Yesterday @ 20:21:00
Posts: 55, Visits: 3 211
Problem resolved!

In Mdlr for Type of Attribute5 I use ModelEnums.DBaseWSEnum
instead of DBaseWSEnum
(i.e. namespce + "." + type)


Generate Code :

===============Skipped=================
public ModelEnums.DBaseWSEnum Attribute5 {
get {
return ((ModelEnums.DBaseWSEnum)(this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Attribute5)));
}
set {
this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Attribute5, ((object)(value)));
}
}
===============Skipped=================

All is fine!

Thanks
Seg
Post #5118
Posted 2010-04-13 09:05:22
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
One solution is to use the full name of the type (ECO emits the type "as is" if it is not one of the known types). Another solution is to add the namespace to the packagein the property "AdditionalNamespaces". This is a comma separated list of namespaces that will be added to the using-clauses for the .eco.cs-files of all classes in the package.

/Jonas Hogstrom [CapableObjects]
Post #5139
Posted 2010-04-13 09:49:01
Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Group: Forum Members
Last Login: Yesterday @ 20:21:00
Posts: 55, Visits: 3 211
Thanks, Jonas!


Is there any new news about problems of importing Eco4 -> Eco5?

I have discribed problems in 2 mails.
It stopped my work...

Thanks
Seg
Post #5142
Posted 2010-04-13 11:44:24
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
sent via email

/Jonas Hogstrom [CapableObjects]
Post #5145
Posted 2010-04-15 15:39:04
Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Group: Forum Members
Last Login: Yesterday @ 20:21:00
Posts: 55, Visits: 3 211
Jonas Hogstrom (2010-04-13)
sent via email


Thank You very much, Jonas!
It helped me!

Seg
Post #5151
« 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 10:12

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