Click here to Skip to main content
15,898,036 members
Home / Discussions / C#
   

C#

 
GeneralRe: Session timeout problem Pin
ayyp19-Jun-06 18:55
ayyp19-Jun-06 18:55 
QuestionReading Tree View Item from another process Pin
suguimoto18-Jun-06 23:55
suguimoto18-Jun-06 23:55 
AnswerRe: Reading Tree View Item from another process Pin
Nader Elshehabi19-Jun-06 0:12
Nader Elshehabi19-Jun-06 0:12 
GeneralRe: Reading Tree View Item from another process Pin
suguimoto19-Jun-06 0:22
suguimoto19-Jun-06 0:22 
QuestionCreating object [modified] Pin
alazer18-Jun-06 23:37
alazer18-Jun-06 23:37 
GeneralRe: Creating object Pin
Colin Angus Mackay19-Jun-06 0:10
Colin Angus Mackay19-Jun-06 0:10 
AnswerRe: Creating object Pin
Colin Angus Mackay19-Jun-06 0:14
Colin Angus Mackay19-Jun-06 0:14 
AnswerRe: Creating object Pin
BoneSoft19-Jun-06 4:13
BoneSoft19-Jun-06 4:13 
Also wrong, you can have constructors on abstract classes, inheriting classes can access them. It's not the best practice, because then all inheriting class must have a constructor with matching signature, but you can do it.

public abstract class BaseClass {
    protected string name;
    public BaseClass(string name) {
        this.name = name;
    }
}
public class ChildClass : BaseClass {
    public ChildClass(string name) : base(name) {
    }
}


And you can instantiate your inherited type with an abstract instance, that's what polymorphism is all about. You can't construct an abstract class, but you can construct concrete implementations of it as if they were the abstract class. Meaning you can use any class that inherits from the base class as an instance of the base class.

public abstract class Setting {
}

public class SimpleSetting : Setting {
    private Setting parent;
    public SimpleSetting() {
    }
    public SimpleSetting(Setting parent) {
        this.parent = parent;
    }
}
public class CollectionSetting : Setting {
    private Setting parent;
    public CollectionSetting(Setting parent) {
        this.parent = parent;
    }
}

public class Test {
    static void Main(string[] args) {
        Setting s = new CollectionSetting(new SimpleSetting());
    }
}


But you are right about abstract members, don't know where they heard you can only have static members on abstract types. You can do everything with a abstract type that you can with a normal class.

Visit BoneSoft.com
GeneralRe: Creating object Pin
Colin Angus Mackay19-Jun-06 5:29
Colin Angus Mackay19-Jun-06 5:29 
GeneralRe: Creating object Pin
BoneSoft19-Jun-06 5:42
BoneSoft19-Jun-06 5:42 
GeneralRe: Creating object Pin
LongRange.Shooter20-Jun-06 17:24
LongRange.Shooter20-Jun-06 17:24 
Questiongetting day of the date Pin
SR Ranjini18-Jun-06 22:55
SR Ranjini18-Jun-06 22:55 
AnswerRe: getting day of the date Pin
rah_sin18-Jun-06 23:25
professionalrah_sin18-Jun-06 23:25 
AnswerRe: getting day of the date Pin
Jesal Rana19-Jun-06 2:39
Jesal Rana19-Jun-06 2:39 
QuestionPLEASE HELP Pin
innocent7318-Jun-06 22:44
innocent7318-Jun-06 22:44 
AnswerRe: PLEASE HELP Pin
Colin Angus Mackay19-Jun-06 0:05
Colin Angus Mackay19-Jun-06 0:05 
GeneralRe: PLEASE HELP Pin
innocent7319-Jun-06 0:19
innocent7319-Jun-06 0:19 
GeneralRe: PLEASE HELP Pin
Colin Angus Mackay19-Jun-06 0:36
Colin Angus Mackay19-Jun-06 0:36 
GeneralRe: PLEASE HELP Pin
innocent7319-Jun-06 0:55
innocent7319-Jun-06 0:55 
GeneralRe: PLEASE HELP Pin
Colin Angus Mackay19-Jun-06 1:54
Colin Angus Mackay19-Jun-06 1:54 
AnswerRe: PLEASE HELP Pin
Nader Elshehabi19-Jun-06 1:14
Nader Elshehabi19-Jun-06 1:14 
GeneralRe: PLEASE HELP Pin
Colin Angus Mackay19-Jun-06 1:57
Colin Angus Mackay19-Jun-06 1:57 
QuestionApplying themes in application using VC# Pin
vikas84singh18-Jun-06 22:33
vikas84singh18-Jun-06 22:33 
AnswerRe: Applying themes in application using VC# Pin
BoneSoft19-Jun-06 4:28
BoneSoft19-Jun-06 4:28 
Questionhowto use dll in windows applications ? Pin
cmpeng3418-Jun-06 21:35
cmpeng3418-Jun-06 21:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.