Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > Generics
| Search | Today's Posts | Mark Forums Read
Generics Discussion of the .NET Generics feature common to all Microsoft .NET 2.0 and later languages. Questions specific to an individual language should go in the language forums instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Generics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 2nd, 2006, 11:26 PM
Friend of Wrox
Points: 2,376, Level: 20
Points: 2,376, Level: 20 Points: 2,376, Level: 20 Points: 2,376, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: , , Australia.
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default Generics Related error in my code, I think???

VS.NET 2005, Windows Forms App, C#

Hi All,
I am using a generic List for the first time and I am getting strange problems with the designer.

I have a user control which has the following generic list property:
        
Code:
private List<BOL.Trip> trips = new List<BOL.Trip>();
Code:
        public List<BOL.Trip> Trips { get { return trips; } set { trips = value; } }


When I add this control to another user control i get the following error in the designer for the consuming Control:

Code:
 One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed by rebuilding your project, while others may require code changes. 

Object of type 'DMWhiteboard.BOL.Trip[]' cannot be converted to type 'DMWhiteboard.BOL.Trip[]'.
The project builds with the following warning.
Code:
Warning    1    ResX file Object of type 'DMWhiteboard.BOL.Trip[]' cannot be converted to type 'DMWhiteboard.BOL.Trip[]'. Line 129, position 5. cannot be parsed.        129    0
However there is no line 129 in the resx code file.

Any Assistance would be greatly appreciated.






======================================
They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================
__________________
======================================
"They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad."
--Shakespeare
======================================
 
Old August 3rd, 2006, 12:02 AM
Friend of Wrox
Points: 2,376, Level: 20
Points: 2,376, Level: 20 Points: 2,376, Level: 20 Points: 2,376, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: , , Australia.
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default

It appeard that the problem was related to the instanciating the List<BOL.Trip> from within seperate classes.
Not sure why or what for, but the creating a class derived from the List<BOL.Trip> enabled me to put use the type definition in both classes.
Many thanks,
Rod

======================================
They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================




Similar Threads
Thread Thread Starter Forum Replies Last Post
Generics in 3.0 sikanderwaheed C# 2008 aka C# 3.0 1 May 5th, 2008 08:30 AM
NET Generics FREDYCOREA .NET Framework 3.5 1 February 21st, 2008 10:17 AM
error related to vb6 Rajesh Pachouri Pro VB 6 0 September 16th, 2006 03:14 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.