 |


 |
|
 |
 |
 |
 |
|
 |
 |
OK, the inability of Visual Studio's form designer to deal with abstract base forms is a known thing and there is a work around involving TypeDescriptionProvider. However what I currently want to do is have an abstract base form that is also generic; there doesn't seem to be a work around for this.
This is highly annoying because it makes designing child forms really awkward and right now would involve more effort than I can actually be bothered to make. I mean I could make the problem go away by doing it wrong and using "object", instead of using generics to make it all lovely and verifiable at compile/development time, but damn it, using generics is the right way to do it.
The main reason this fucking annoys me so much is Microsoft actually know about the damn problem. It's been there since at least Visual Studio 2003 .NET (in the abstract form, the generic problem is obviously not in 2003), as far as I know and it's still there in Visual Studio 2010. The bug is, if you report it, just closed as "won't fix" with fluff about concentrating on security related bugs. Well fuck that, I want the designer to work properly with perfectly valid fucking code.
The code produced, if you do go to the trouble of manually writing the code to populate the derived form with your controls, works fine. It's just the form designer can't handle it because of the way it uses reflection to create an instance of the base class and then calls the InitializeComponent() method to actually fill it. That, I suspect, is why Microsoft won't fix it. It would involve a complete change in the way that the form designer functions. At least that's my supposition. Tags: annoyances, microsoft, visual studio Current Location: Maldon, Essex, UK Current Mood: annoyed Current Music: Wendy Carlos - Brandenburg Concerto #4 in G Major: I-Allegro
|
 |
 |
 |
 |
|
 |
 |



 |
|
 |
 |
 |
 |
|
 |
 |
I wrote this method to get round having to do app.Run(scriptName, Type.Empty, Type.Empty, Type.Empty, Type.Empty, Type.Empty, Type.Empty, Type.Empty...) with "Type.Empty" in upto 30 times.
( Reflection Voodoo )
And I have since fixed some of the edge case issues (like what happens if you pass more than 30 optional parameters). Tags: c#, code, reflection, work Current Location: Ealing, London, UK Current Mood: tired
|
 |
 |
 |
 |
|
 |
 |

 |
|
 |
 |
 |
 |
|
 |
 |
| Candidate | Political Party | Votes Received | % | Elected? | Majority | | Channer, Penny | Conservative | 2359 | 41.63 | Yes | 1179 | | Mead, Brian Harold | Independent | 1180 | 20.83 | No | N/A | | Crowther, Christopher John | Liberal Democrat | 621 | 10.96 | No | N/A | | Carden, Janet Marilyn | Green Party | 600 | 10.59 | No | N/A | | Bentley, Michael John Charles | Labour | 515 | 9.09 | No | N/A | | Blain, Len | British National Party | 391 | 6.9 | No | N/A | | |
I'm quite happy with that result. And for those of you who don't know, that's me in third place. Tags: election, liberal democrats, maldon Current Location: Maldon, Essex, UK Current Mood: content Current Music: Harry Christophers, The Sixteen & The Symphony of Harmony and Invention - The Complete Funeral Music
|
 |
 |
 |
 |
|
 |
 |

 |
|
 |
 |
 |
 |
|
 |
 |
Method 'get_DbConnection' in type 'RHD.Database.DatabaseObjects.PackageBound.Course'
from assembly 'RHD.Database.DatabaseObjects, Version=2.0.1.1, Culture=neutral, PublicKeyToken=null'
does not have an implementation.
The main reason this exception is unhelpful is because there is an implementation for get_DbConnection (as you might have guessed from the name, it's actually the magic property method for the getter) in the ActiveRecord class, but for some reason it can't see this.
I suspect this might be something to do with Course being derived from BaseCourse, which is an abstract class derived from ActiveRecord, itself an abstract. BaseCourse also implements ICourse.
ActiveRecord is doing a partial implementation of IActiveRecord; it's implementing the dirty flag and db connection properties. The commit and delete methods are implemented as abstract and left for child classes to implement.
Solved: OK, apparently it was to do with platforms. For some reason my soltuion had reverted to building for "Any CPU" rather than "x86" (I'm on a 64-bit system, so often building for "Any CPU" won't work, becuase of assembly foobar). Tags: .net, c# Current Location: Maldon, Essex, UK Current Mood: frustrated
|
 |
 |
 |
 |
|
 |
 |

|
 |
|
 |