StrataFrame Forum

BOMapper - Custom Data Types Problem

http://forum.strataframe.net/Topic10331.aspx

By Tim Dol - 7/16/2007

I created an new enum and want to assign it to one of my fields. (I've done this many times in the past...pre 1.6).  I perform a search in the custom data type fields but it doesn't return anything. I have a number of existing enums and just added a new one. I tried again and it crashed visual studio with Out of Memory errors.  I restarted and tried again but it doesn't seem to find anything and/or crashes again.

I can manually enter the enum name 'enum_CRMRoleType'. I then rebuild the partial class but when I rebuild the project I get an error 'Type enum_CRMRoleType' is not defined.

I haven't created an enum in a while but it did work a while back.

Any ideas as to why it can't find my enums?

Thanks,

Tim

By Trent L. Taylor - 7/16/2007

If it cannot find it when you manually type it in, then it is not visible by the compiler when assigned to the strong-typed property.  This is generally because a reference is missing or the namespace is different than the BO.  If you provide the full namespace and it still cannot be found, you are missing a reference.  As for the Out of Memory exceptions, I am not sure.  I have been running this version for a really long time and lately it has been "enum city" for me and I have not had any issues.  However, the other day I did get an exception when the compiler was starting to act funny.  I was in a large project and things were becoming sluggish because of the compiler and I did a search for an enum and got an exception, but it was because the compiler was flaking out on me.  I actually reboot my computer, went back in, and haven't had an issue since.....and this was last week sometime.
By Tim Dol - 7/17/2007

Okay after some more investigation, I discovered that I did neglect to enter the full namespace when I manually entered the data type.  This works now when I manually enter. Thanks.Smile

With respect to the search. Each time I perform a search, it returns nothing and Visual Studio crashes. Could this indicate some type of corruption in my solution? I have 6 projects in one solution, if that matters.  Also, for the heck of it I tried doing the same search using the sample CRM project and it worked fine.

By StrataFrame Team - 7/18/2007

It's probably not corruption in your solution, but rather something in your code model that we're not expecting, so an exception in thrown, which crashes VS.  When we search for enums, we search through all of the references, but to search within the solution itself, we have to go through the code model of each of the files in the solution and if the code model is weird, it might crash.
By Tim Dol - 7/18/2007

Well I can live with having to manually entering the enum in the BO mapper for now but I discovered a bigger problem.

When I try to use the enum for combobox population and perform a search in the PopulationDataSourceSettings, Visual Studio crashes with the attached error. This property doesn't seem to allow me to manually populate the value so I have to search for it. I also tried to manually set the property via code in the load event but it also produces an error. Should you be able to manually populate? . The error varies based on the controls on my form.  This one just happens to have the UltraOPtionSet Control on it. It also crashed with an UltraTabControl on another form.

By Trent L. Taylor - 7/18/2007

Should you be able to manually populate?

You can in code if your provide the full name to the class.  I have had to do this on certain occasions.  As for the error...I really do not know.  It looks like a design-time render error within Infragistics....but I would have to get this in a reproducable state first to even have a clue where to tell you to look.

By Tim Dol - 7/19/2007

I was able to finally get the code working. I used the wrong property the first time I tried. When I get some time I will try to reproduce in a small project.

One other strange thing I noticed with custom data types.  Select Case doesn't seem to evaluate the data type. I had to change everything to If's.  Have you every run across this before?

Thanks

Tim

By Trent L. Taylor - 7/19/2007

Have you every run across this before?

Depends on the type of value you are testing on.  If you are testing a reference type then you may have to use an if/elseif.  However, if you use any type of value type (i.e. integer) then you can always go with select case.

By StrataFrame Team - 7/20/2007

On a custom data type, did you override the System.Object.Equals(object obj) method on your custom type?  I think that's what a Select Case evaluates when comparing the value in the select with the values in the case.