Search Result
Collapse
25 results in 0.0042 seconds.
Keywords
Members
Tags
-
Setting __proto__
I am confused as to why __proto__ is now deprecated and something less flexible - getPrototypeOf - is recommended. Having a __proto__ property will allow you to set the object "type"/methods of a currently existing object, which cannot be achieved with Object.getProto typeOf and Object.create. One application that I can think of is if you have a drawing tool, and you want to allow users to switch between shapes with similar parameters but... -
Multi-Inheritance, Recursion and Stack Overflow Exception
https://gist.github.com/23048a7c3cc7c7768d8c and https://gist.github.com/4621acc4d76d611e8d55
cause a Stack-overflow exception here: https://gist.github.com/23048a7c3cc7...gui_componenet. However, if i keep to the old design, everything is ok: https://gist.github.com/be821a529e8440f73831
any help, please? -
Inherited methods which return a base class instance
Hi,
consider this inheritance of MyVector from MyPoint:
Code:class MyPoint { /* ... */ public MyPoint add(MyPoint other){ ... } } class MyVector extends MyPoint { /* ... */ } /* somewhere in the code */ MyVector v1 = new MyVector(...); MyVector v2 = new MyVector(...); MyVector v3 = v1.add(v2); // Error, cannot cast from
-
Inheriting BindingList(Of T)
Please see the below example:
Code:Imports System.ComponentModel Public Class level1Collection(Of T As level1Item) Inherits BindingList(Of T) Public Sub Load() Dim i As T = Me.AddNew End Sub End Class Public Class level2Collection(Of T As level2Item) Inherits level1Collection(Of level2Item) End Class Public Class level3Collection(Of
-
How to Create a Custom Shape using Inheritance?
Hello,
I am trying to create a WPF application that will have a custom rectangle shape. Since Rectangle is a sealed class I have to inherit from Shape class. Basically my rectangle will consist of four corners (triangles) and 4 edges (trapezoids) that the user can interact with by selecting and dragging the edge or corner to resize the rectangle. Each side/corner will highlight when the mouse is over it (opacity on or off). The body... -
methods imported once should be available to all child classes
I have a module from which I am importing a couple of methods. Here is the code:
Code:package MyEncoder; use strict; use Exporter qw(import) use vars qw(@EXPORT); @EXPORT = qw(encode decode); sub encode { ... } sub decode { ... } 1;
-
Is it possible to derive a tree from two different parent classes in C++?
Hi guys, I’ve been given a task in which my teachers even cannot help me through! I wonder how can I derive a tree from two different parent classes in C++; i.e. which parameters should be from the first and which from the second? I tried putting the left and right pointers in the second and the data in the first, but due to the difference in types, I am not able to use them?
Thanks by the way, -
How to extend controls with base class?
Hi
I have a BaseClass
Code:public class BaseClass { [XmlIgnore] public PropertyGrid PropertyGridControl [XmlAttribute("Name")] public string Name { get; set; } }
Code:public class MyLabel : Label { } public
Last edited by Niheel; Feb 27 '11, 06:04 AM. -
EARNEST started a topic How to change the way the Vector2 is presented in a file upon serialization?in C SharpHow to change the way the Vector2 is presented in a file upon serialization?
Hello,
Current output result when I serialize my asset's class in XNA is of the following form:
Code:<?xml version="1.0" encoding="utf-8"?> <XnaContent xmlns:Game_Entities="HPC_AsteroidGame.Game_Entities"> <Asset Type="Game_Entities:GameEntity"> <ListOfSprites /> <Center>0 0</Center> <Position>0 0</Position>
-
Custom Object data binding, polymorphism and inheritance
I'm hoping that someone out there can give me some guidance here, and I hope that I am explaining this properly.
Here is my scenerio:
I have a BaseData object that serves as an abstract object for all my business objects. Notice there is an overridable method on the object.
Code:Public Class BaseData Dim msDataID As String Dim msDescription As String
-
I have List and inheritance problem question pls tell me what I can do
I'm new at c# and I have little problem when use List and Inheritance
I have Inheritance& Like this
public abstract class Light
{}
public class OpenLight:Light
{}
public class WhiteLight:Open Light
{}
public class BlackLight:Open Light
{}
White & Black is Inheritance have data I use but not save that why I create
public... -
Some trouble with packages
I've started studying java using the tutorial on Oracle. I've been making a program as I've gone along in the tutorial, adding what I learn to the program. When I reached the packages section, I tried packaging my program. However, after I set up the package, my files couldn't find each other. After a couple frustrating hours of trying to fix it, I made a simple package with the following files:
C:\Users\Kenny\ Desktop\testpac kage\TestSuperC lass.java:... -
Overloading assignment operator in a class with inheritance?
Code:class base { public: base(int data = 0):a(data) {} base(const base& rhs) { a = rhs.a; } base& operator = (const base& rhs) { a = rhs.a; return *this; } private: int a; }; class derived:public base { public: int b; derived(int
-
PK field & Inheritance
Hello,
I want to use inheritance and I have created some tables for a program that I want to use it (see attachment).
What is your opinion? Is it better to use the old way or inheritance?
If I use inheritance, would it be good to use as PK for all table the ID field of LASTUPDATE table who will be the parent table of all?
What is your opinion for all these?
Thanks... -
Design a database with or without inheritance
Hello,
I am trying to understand inheritance and how to use it with PostgreSQL. For this reason i design a database in the excel file. In the 1st columns you can see the table w/o inheritance while in the 2nd part of the sheet you can see the tables with INHERITANCE.
Can you give me your opinion and help on the following?
1. Which is the best design ( w or w/o inheritance )?
2. Is my design with inheritance good or sth...