473,320 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

What was MS thinking

Okay, someone tell me I'm making a mistake here:

I need to create my own CurrencyManager class derived from
BindingManagerBase.

As far as I can tell this is impossible to do. The MSDN docs say,
erroneously:

---

Notes to Inheritors: When you inherit from BindingManagerBase, you must
override the following members: AddNew, Count, CancelCurrentEdit, Current,
EndCurrentEdit, GetItemProperties, OnCurrentChanged, Position, RemoveAt,
ResumeBinding, SuspendBinding, and UpdateIsBinding.

---

The problem is there are, I believe, 5 members of BindingManagerBase that
are marked as "internal abstract", despite the fact that the class itself is
marked a public abstract.

As far as I can tell, there's no way to override an internal abstract member
from a class in System.Windows.Forms.

Of course, if I don't override the methods, I get a "myclassname does not
implement inherited abstract member 'membername'"

But if I try to override them, I get: "no suitable method found to override"

WTH? I mean, the documentation makes it sound like you can derive from the
class, but at this point, all evidence is to the contrary.

Any ideas?

Pete
Nov 16 '05 #1
8 1407
They are actually marked 'protected internal abstract', which means you
should be able to override them. The following worked for me:

class test : System.Windows.Forms.BindingManagerBase
{
protected override string GetListName(ArrayList list)
{
return null;
}
}

Nov 16 '05 #2
What? You actually compiled that? I find that hard to believe. There are
about 20 abstract methods in BindingManagerBase. It won't compile if you
don't implement them.

And yes, string GetListName(ArrayList list) is protected internal abstract ,
but string GetListName() [with no parameters) is simply internal abstract.

Pete

<yv*********@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
They are actually marked 'protected internal abstract', which means you
should be able to override them. The following worked for me:

class test : System.Windows.Forms.BindingManagerBase
{
protected override string GetListName(ArrayList list)
{
return null;
}
}

Nov 16 '05 #3
By the way, the methods and properties that are internal abstract an NOT
protected internal abstract are:

BindType.get
DataSource.get
GetListName()
IsBinding.get
SetDataSource(object)

Pete
<yv*********@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
They are actually marked 'protected internal abstract', which means you
should be able to override them. The following worked for me:

class test : System.Windows.Forms.BindingManagerBase
{
protected override string GetListName(ArrayList list)
{
return null;
}
}

Nov 16 '05 #4
You are right Pete, my bad. Didn't notice that there is another
GetListName to be imlplemented. Well, I guess the fellow programmer
forgot to type 'protected' for those two methods and three properties.

Nov 16 '05 #5
"Pete Davis" <pd******@NOSPAM.hotmail.com> wrote in message
news:7O********************@giganews.com...

Pete, I think MS owes you an icecream, or a MSDN subscription... or both =)

- Michael S
Nov 16 '05 #6
Thanks guys. Really, I was kind of hoping someone was going to embarrass me
by saying, "No, all you have to do is XYZ." In fact, for a second, I thought
the other guy had me.

Alas, I'm going to have to write my own BindingManagerBase (or include the
functionality in my CurrencyManager) as well which is a big annoyance since
I already have to write CurrencyManager and RelatedCurrencyManager classes.

I know I can call internal or private methods using reflection. I was kind
of hoping someone might have some way of tricking the compiler into letting
me override internal abstract methods, but I figured that was a real long
shot.

Oh well. Thanks for the responses guys, even though the only solution is to
beat up some .NET framework developers. ;-)

Pete

"Michael S" <a@b.c> wrote in message
news:uQ**************@TK2MSFTNGP10.phx.gbl...
"Pete Davis" <pd******@NOSPAM.hotmail.com> wrote in message
news:7O********************@giganews.com...

Pete, I think MS owes you an icecream, or a MSDN subscription... or both =)
- Michael S

Nov 16 '05 #7
Hi,

Commiserations, and you might want to consider filing it as a bug report so
others more fortunate than yourself can be spared the torment either in .NET
2.0 or maybe even as part of a framework service pack.

Steve

"Pete Davis" <pd******@NOSPAM.hotmail.com> wrote in message
news:3Z********************@giganews.com...
Thanks guys. Really, I was kind of hoping someone was going to embarrass
me
by saying, "No, all you have to do is XYZ." In fact, for a second, I
thought
the other guy had me.

Alas, I'm going to have to write my own BindingManagerBase (or include the
functionality in my CurrencyManager) as well which is a big annoyance
since
I already have to write CurrencyManager and RelatedCurrencyManager
classes.

I know I can call internal or private methods using reflection. I was kind
of hoping someone might have some way of tricking the compiler into
letting
me override internal abstract methods, but I figured that was a real long
shot.

Oh well. Thanks for the responses guys, even though the only solution is
to
beat up some .NET framework developers. ;-)

Pete

"Michael S" <a@b.c> wrote in message
news:uQ**************@TK2MSFTNGP10.phx.gbl...
"Pete Davis" <pd******@NOSPAM.hotmail.com> wrote in message
news:7O********************@giganews.com...

Pete, I think MS owes you an icecream, or a MSDN subscription... or both

=)

- Michael S


Nov 16 '05 #8

"Steve McLellan" <sjm AT fixerlabs DOT com> wrote in message
news:u0**************@TK2MSFTNGP10.phx.gbl...
Hi,

Commiserations, and you might want to consider filing it as a bug report
so others more fortunate than yourself can be spared the torment either in
.NET 2.0 or maybe even as part of a framework service pack.


This is the sad part with .NET.

In Delphi you get all the code for the whole VCL (i.e FCL) and a bug like
this could have been fixed by yourself in no-time flat.There is still the
hazzle of bug-reporting, but you could fix it and move on. It's no fun
telling your project lead or customer that the project is in a dead end
because of a bug in a core library. - Sorry, but if you have the cash, you
could always buy Microsoft and have the bug fixed quicker.. =)

However, there are plenty of Microsoft employees that scans this group and
maybe they'll report the bug.If Microsoft was smart, they should hire Jon
Skeet for a fair amount of money and have him make bug reports, he reads
just about everything in this newsgroup!

And I still think Microsoft owes Pete an icecream... =)

- Michael S

Nov 16 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Al Davis | last post by:
Note: I tried cross-posting this message to several newsgoups, including comp.lang.perl.misc, c.l.p.moderated, comp.infosystems.www.authoring.cgi, comp.lang.javascript and comp.lang.php. Nothing...
220
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have...
125
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from...
6
by: Zhang Weiwu | last post by:
Hello. I am working with a php software project, in it (www.egroupware.org) Chinese simplified locate is "zh" while Traditional Chinese "tw". I wish to send correct language attribute in http...
47
by: Neal | last post by:
Patrick Griffiths weighs in on the CSS vs table layout debate in his blog entry "Tables my ass" - http://www.htmldog.com/ptg/archives/000049.php . A quite good article.
9
by: rick cameron | last post by:
TimeZone - the only instance you can get is one representing the local time zone DateTime - cannot represent a time before 00:00:00 1 Jan 1 CE What were they thinking? This is a serious question...
31
by: N.Davis | last post by:
I am very new to Python, but have done plenty of development in C++ and Java. One thing I find weird about python is the idea of a module. Why is this needed when there are already the ideas of...
46
by: Keith K | last post by:
Having developed with VB since 1992, I am now VERY interested in C#. I've written several applications with C# and I do enjoy the language. What C# Needs: There are a few things that I do...
6
by: Mark Broadbent | last post by:
this might sound like an obvious question but I have found that usually these two evolve at the same time. One of the biggest reasons for creating the abstraction in the first place (in my...
167
by: darren | last post by:
Hi I have to write a multi-threaded program. I decided to take an OO approach to it. I had the idea to wrap up all of the thread functions in a mix-in class called Threadable. Then when an...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.