override

Strange Property Override in DataGridViewTextBoxCell.

If you look at the DataGridViewTextBoxCell property, ValueType, in reflector, you can see it overrides a property from DataGridViewCell. The strange thing is, is that the overriden property is readonly, but the property in the parent class is read and write. I can only presume that the property has been shadowed and reflector doesn't ....

Scala overriding a non-abstract def with a var

In Scala I can do this: trait SomeTrait { protected def foo: String } class Wibble extends SomeTrait { protected var foo = "Hello" } But I cannot do the same thing where I provide a default definition for foo trait SomeTrait { protected def foo: String = "World" } class Wibble extends SomeTrait { protected var foo = "Hello"...

MasterPage and ViewState (VB.Net)

Ok So i have written methods to override the LoadPageStateFromPersistenceMedium and SavePageStateToPersistenceMedium methods. now the problem is that i am using a masterpage, so how do i maintain using my masterpage and still inherit from System.Web.UI.Page? Please bear in mind that the .vb Code behind the masterpage already inherits Sy...

How do you override a TableAdapter method on a Table in a DataSet?

I currently have a single DataSet declared which contains 3 tables. For sake of this example we will call them User, Question and Answer. On each of these I have a TableAdapter with the various methods required, ie. GetData(), Update(), Delete() etc. On the Answer Table I would like to override the Update Method from the TableAdapter t...

C++ Overridden method not getting called

Shape.h namespace Graphics { class Shape { public: virtual void Render(Point point) {}; }; } Rect.h namespace Graphics { class Rect : public Shape { public: Rect(float x, float y); Rect(); void setSize(float x, float y); virtual void Render(Point point); private: float sizeX; float s...

Overriding a private method with Reflection

Is it possible to override a private method by using Reflection in .NET 3.5? ...

What's going on with overriding and overloading here in C++?

This doesn't work: class Foo { public: virtual int A(int); virtual int A(int,int); }; class Bar : public Foo { public: virtual int A(int); }; Bar b; int main() { b.A(0,0); } It seems that by overriding Foo::A(int) with Bar::A(int) I have somehow hidden Foo::A(int,int). If I add a Bar::A(int,int) things work. Does any...

C++ override/overload problem

I'm facing a problem in C++ : #include <iostream> class A { protected: void some_func(const unsigned int& param1) { std::cout << "A::some_func(" << param1 << ")" << std::endl; } public: virtual ~A() {} virtual void some_func(const unsigned int& param1, const char*) { some_func(param1); } }; class B : public A { p...

Subclasses causing unexpected behavior in superclasses — OO design question

Although I'm coding in ObjC, This question is intentionally language-agnostic - it should apply to most OO languages Let's say I have an "Collection" class, and I want to create a "FilteredCollection" that inherits from "Collection". Filters will be set up at object-creation time, and from them on, the class will behave like a "Collect...

java override during object creation

in the following java code a JButton is created but at the same time one of it's methods in overridden. Qestion: is there a name for overriding in this way, while creating the object? the code: JButton myButton; myButton = new JButton ("ok"){ @Override public void setText(String text) { super.set...

C#: Overriding OnPaint on ProgressBar not working?

Was thinking it should be pretty easy to create a ProgressBar that drew some text upon itself. However, I am not quite sure what is happening here... I added the following two overrides: protected override void OnPaintBackground(PaintEventArgs pevent) { base.OnPaintBackground(pevent); var flags = TextFormatFlags...

Why does XMLSerializer take DefaultValue Attribute of base class to serialize

using System.ComponentModel; using System.IO; using System.Xml.Serialization; namespace SerializerTest { static class Program { static void Main() { using (TextWriter textWriter = new StreamWriter("data.xml")) { Data data = new Data(); new XmlSerializer(typeof(Data)).Serialize(textWriter, data); textW...

What is this type of method overriding called in Java?

I'm relatively new to Java and I'm using a new API. I came across this method override and I'm not sure what this is called: public void exampleMethod() { Button loginButton = new Button("login"){ public void onSubmit(){ //submit code here } }; } From what I understand, this is overriding the onSubmit m...

method overriding in Java

How is method overriding implemented in Java? In C++ we have the concept of vtable.. how is this implemented internally in Java? ...

overriding pthread_create using LD_PRELOADed DLL in Cygwin

I'm on Windows XP with Cygwin, and I've compiled a DLL that overrides some pthread functions, e.g. pthread_create. LD_PRELOADing this library into a Cygwin application should make this application use my functions instead of standard ones. (See [1].) However it does not happen. I know that the library is loaded, because I've put printf ...

Extend HTML_BBCodeParser_Filter

I'm trying to add extra tags to the PEAR package BBCodeParser http://pear.php.net/package/HTML_BBCodeParser/docs/latest/li_HTML_BBCodeParser.html, to do this, I believe I need to place Object.php in \php5.3.0\PEAR\pear\HTML\BBCodeParser\Filter and call addFilter. Object.php <?php /* New filter @todo Lots */ require_once 'HTML/BBCode...

VB.NET overload default functionality when user clicks the X (Close Program)

How do I go about overriding the default functionality when a user clicks the X in a VB.NET form-based application? I am currently handling the MyBase.Closing event... but since it's a DirectX app, I need to do some cleanup before allowing the form the close. Thanks ...

Inherited method needs one more parameter

I have a parent class with several children. One of the children, has one overridden method that, for its particular internal usage, needs one more parameter. I don't want to change the method's signature because the overridden method in the other children does not need this parameter, also, I don't want to add a class property because i...

Polymorphism (not) broken with visitor pattern in C# (and new instead of override)

I have the following code: class Visitor { internal virtual void Visit(Node n) { } } class VisitorSpecial : Visitor { internal new void Visit(Node n) { } } class Base { internal virtual void Accept(Visitor v) { } internal virtual void Accept(VisitorSpecial v) { } } class Node : Base { internal override void Acc...

Make Hashtable immutable

How do I make a derived class from Hashtable, objects of which can be added, but cannot be removed or replaced? What do I have to override and particularly how do I override the [] operator? ...