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 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;
}
}
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; } }
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; } }
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.
"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
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
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
"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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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...
|
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...
|
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.
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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)...
|
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...
|
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....
|
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
| |