Generics: how to create a base generic class to use on other base classHi, I am stuck on a Generics class that must be used in another base class and interfaces that the descendant actually supplies the actual type. I cannot get this to work and my google search have not lead me anywhere...
Here are the breakdown of classes..
TBizObj = class
TBizList<BOType: TBizObj> = class...
property Items[index: integer]: BOType ...
end;
With generics, TBizList<> works out great...before it, I had TBizList for each TBizObj class..
However, I have other base classes and interfaces that uses TBizList<> and I don't know how to creat...
How can I write and create my own property in a class
Hi how do i create a property in a class when using vs.net
would this suffice
Public Property Name as String = "asp"
Am a bit lost. Please help thanksMCAD.Net vb.net
Hi,
an example of a property:
'Private member variable that is exposed by the property
'You can set default value for the member here if it's appropriate
Private _name As String = "asp"
Public Property Name() As String
Get
Return _name
End Get
Set(ByVal Value As String)
_name = Value
End Set
...
Calling a derived classes property when have reference to base class
I have a situation where I am looping through all of the controls on a web form and inspecting the attributes collection for a particular attribute. I do this by calling a method on another object and passing a reference of the webform to it. It then recursively loops through the controls collection looking for objects that derive from WebControl, which is the class that implements the Attibutes collection.
ctl = childcontrol as WebControl;
if(ctl != null)
//inspect attributes collection.
We use that attribute value to look up a translation for the control (o...
Error: Property SupportAutoEvents cannot be declared Overrides because it does not override a property in the base class.
I'm getting the error in the subject line with a "hello world" Web User Control. Here's all 14 lines of code: Is this a bug or am I missing something?
Partial Class TestLabel
Inherits System.Web.UI.WebControls.Label
Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
MyBase.Render(writer)
End Sub
Public Overrides Property Text() As String
Get
Return MyBase.Text
End Get
Set(ByVal value As String)
MyBase.Text = value
End Set
End Property
End Class
Is the partial class necessary? My best gue...
Can I create a new instance of a vcl component with only the pointer to some vcl class?Lets say I have a pointer to a TDBGrid in an Ancestor class that has been
modified in the Ancestor's Descendant class:
TDBGrid* MyDBGrid;
Is there a way that I can create a new instance of the Descendant class with
only the Ancestors pointer?
TDBGrid* CopyOfMyDBGrid = MyDBGrid->Clone();
or maybe something like CopyOfMyDBGrid = new ClassID( MyDBGrid->ClassID() ).
Larry.
"Larry Griffiths" <larry@kalos-inc.com> wrote in message
news:36327@forums.codegear.com...
> Is there a way that I can create a new instance of the
> Descendant class wi...
Creating Base Class
I'm having quite a bit of trouble and hoping somebody can figure this out. I have a Class Library with one class in it and this class has the following code:1 Public Class PageLoadSecurityClass
2
3 Inherits System.Web.UI.Page
4
5 Protected Overrides Sub OnLoad(ByVal e As EventArgs)
6
7 Response.Write("Hello World")
8
9 MyBase.OnLoad(e)
10
11 End Sub
12
13 End Class
14
What I want to do is build this class and then put the dll in the GAC where it can be used in multiple applications. The problem is I...
How to override a function of the base class of base class [Edit]The codes are:
{code}
TGrandFather=class
procedure Fun();virtual;
end;
TFather=class(TGrandFather)
procedure Fun();override;
end;
TSon=class(TFather)
procedure Fun();override;
end;
{code}
When the TGrandFather.Fun() is called, the TFather.Fun() is called instead, but not the TSon.Fun().
How to make TSon override the TFather.Fun()?
Persanker wrote:
> The codes are:
You cannot declare a function without a return type.
> When the TGrandFather.Fun() is called, the TFather.Fun() is called
> instead, but not the TSon.Fun().
That means a TFather object was i...
XE3 Delphi VCL and DataModulesVM with Windows 7 and XE3. Many 3rd party components.
When I tried to create a new DataModule to add to the project, the IDE crashes. Has this happened to others?
Fault Module Version: 17.0.4625.53395
Fault Module Timestamp: 50400227
Exception Code: c0000005
Exception Offset: 00016f36
OS Version: 6.1.7601.2.1.0.256.4
Locale ID: 1033
Additional Information 1: 8df4
Additional Information 2: 8df4e92201aa034aa9797467e9f342c8
Additional Information 3: 1c84
Additional Information 4: 1c8452195d96ca947ca02660f30e029c
Problem signature:
Problem Event Name: AP...
Typeconverter for base-class property
Hi there,
I have a custom web control, which has a property MyProperty of type BaseClass, this property can return either a BaseClass reference, or a reference to an instance of either DerivedA or DerivedB. What the MyProperty property returns is determined by another property of the control - call it PropType. Now, this all behaves very nicely in the property browser, I can set the type returned by PropType, the display refreshes to show the properties of DerivedA or DerivedB and so on. When I go to the source view, I can also see that the properties of BaseClass/DerivedA/DerivedB are...
Generic Property on Base Class
Is it possible to have a generic property on a base class? For example, I 'm creating a base class with an ID property. For Xml implementations this will be a Guid, and for SQL implementations it will be an int. Right now I have it as an object since I can cast it as needed :
public abstract class MyBaseClass{
public abstract object ID;
//below works because Guid and int both implement ToString(),
// but I would like to use a generic
public string SomeMethod(){
return ID.ToString();
}
}
But if I could somehow use a generic for th...
how to write Nested property in a class ?
Warning :- if u don't know the answer or don't want to give the answer then please
don't try to put any comments or advice.
datagrid has many nested properties means many properties declared in a another property.
as a example AlternatingItemStyle, this property has many sub property.so could i desing
my own proprty like this.so please tell how could i design nested property in a class.help me
with a sample code.
your warning was a very sick statement. i doubt anyone would want to assist you if you are rude in your posting.
Are you so extremely busy, that you don'...
Create a base page class
Hi, I have created a login page for my website, but I'm uncertain how to create a base page class to determine if someone is logged in or not. Would you please show me how to create a base page class or point me to a tutorial on creating a base page class? I have found some tutorials on creating a base page, but they are not showing what I want to do. I will try to derive pages that are off limit to nonmembers from the base class page and enforce login. Thank you in advance for your help.
You can refer this tutorial for base page class implementation:http://aspalliance.com/...
How to create my own label base control/class ?
Hello....
I would like to create my own web form label control and set some base properties - like height, width, font, border, etc. Then I want to use this label control on all my web pages so I could just modify the label properties in one place and have those changes propagate to all the web forms where the control is used....rather than manually editing every control. Is this possible? If so....if you know of some articles or places where I could learn how to do this, that would be appreciated.
thanks
-dw
The simplest way to do this *as a control*, would be to just create...
Create entity based on AUX ClassI'm trying to create an entity based on an AUX class? Is this possible?
When I go into the DAL to create an entity, I dont see any AUX classes.
I've reimported the schema and all seems ok but I cant see anywhere
where I can do this.
The docs arent clear, can this be done?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
No. See the eDirectory documentation for details on what aux classes
are and how they should be used. They are made to allow extensions to
objects instantiated from base classes (User, Organization, etc.) but
not to be objects themselves.
Good luck....