PC Review


Reply
Thread Tools Rate Thread

Anyone knows the C# Equivalent

 
 
alee via DotNetMonster.com
Guest
Posts: n/a
 
      19th Feb 2007
Hello Barry,

Thanks for your suggestion, and it does solve the problem.

Regards,

Alan L.

Barry Kelly wrote:
>> Public MustInherit Class BaseList(Of T As BaseObject) Inherits BindingList(Of
>> T)

>
>public abstract class BaseList<T> : BindingList<T>
> where T : BaseObject
>
>-- Barry
>


--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...users/200702/1

 
Reply With Quote
 
 
 
 
alee via DotNetMonster.com
Guest
Posts: n/a
 
      19th Feb 2007
Hi Goran

The BaseObject will be inherited by other classes. And I am defining an
extension to the
BindingList<T>.

I solved the problem by using the where keyworkd suggested by Barry and Mehdi.


Thanks for your feedback.

Regards,

Alan L.

Göran Andersson wrote:
>If you have a base class for all objects that the class handles, then
>you don't need to use generics at all in your class. Just use the base
>class when you inherit the BindingList.
>
>public abstract class BaseList : BindingList<BaseObject>
>
>Now your BaseList is a BindingList that handles any object that inherits
>from BaseObject.
>
>In your method that loops the items, just reference them as BaseObject:
>
>public void AcceptChanges() {
> foreach (BaseObject item in this.Items) {
> item.ObjectState = ObjectState.Unchanged;
> }
> DeletedRows.Clear();
>}
>
>> Hi Goran,
>>

>[quoted text clipped - 26 lines]
>>> ...
>>> }

>


--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...users/200702/1

 
Reply With Quote
 
alee via DotNetMonster.com
Guest
Posts: n/a
 
      19th Feb 2007
Hello Alvin,

I will look into using instant C# for my future projects.

Thanks and Regards,

Alan L.

Alvin Bruney [MVP] wrote:
>Google instant C#, this application will translate your VB code into C#. It
>is very good.
>
>> Hello,
>>

>[quoted text clipped - 52 lines]
>>
>> Alan L.


--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...users/200702/1

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Equivalent for VB6 Mazant, K. Microsoft Dot NET 2 9th Dec 2007 05:55 AM
vba equivalent John Microsoft VB .NET 7 3rd Dec 2007 05:57 PM
what the c# equivalent of ... =?Utf-8?B?am9zZSBnLiBkZSBqZXN1cyBqciBtY3AsIG1jZGJh Microsoft C# .NET 5 31st Jul 2005 02:16 PM
Equivalent of GetPrivateProfileString equivalent in C#? Germic Microsoft C# .NET 1 24th Jan 2005 09:22 AM
C#'s equivalent of the stl Boogie El Aceitoso Microsoft C# .NET 3 6th Apr 2004 02:25 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:34 PM.