Board index » delphi » Re: How do I do .... in C#?

Re: How do I do .... in C#?


2005-01-27 08:27:19 AM
delphi275
Nick Hodges [TeamB] writes:
Quote
Don't listen to Rudy. We still have it. it is been cleaned though.
<phew>
The sort of insolence in regards to 'with' displayed by Rudy must not
go unpunished. I will leave the matter in your capable hands.
--
Cheers,
David Clegg
XXXX@XXXXX.COM
 
 

Re: How do I do .... in C#?

Nick Hodges [TeamB] writes:
Quote
David Clegg writes:

>Nick, do you guys still have that comfy chair for {*word*194} TeamB
>members? <g>

Don't listen to Rudy. We still have it. it is been cleaned though.
Do you really think a comfy chair scares me? Pah! Usually I scare
others.
--
Rudy Velthuis [TeamB] rvelthuis.bei.t-online.de
"God, please save me from your followers!"
- Bumper Sticker
 

Re: How do I do .... in C#?

Rudy Velthuis [TeamB] writes:
Quote
Do you really think a comfy chair scares me? Pah! Usually I scare
others.
Laugh while you can, Monkey Boy.
--
Nick Hodges -- TeamB
Lemanix Corporation -- www.lemanix.com
Read my Blog -- www.lemanix.com/nick
 

Re: How do I do .... in C#?

Ingvar Nilsen writes:
Quote
>One cool syntax in C# is the syntax you can use to chain
>constructors together i.e.

And practical use?
Well just the obvious not having to repeat calls in separate
constructors (not a C# or .NET specific benefit), I was really just
commenting on the elegant syntax for doing that. I do of course realise
that, that is subjective, do you like it ? (the syntax that is)
 

Re: How do I do .... in C#?

Nick Hodges [TeamB] writes:
Quote
Rudy Velthuis [TeamB] writes:

>Do you really think a comfy chair scares me? Pah! Usually I scare
>others.

Laugh while you can, Monkey Boy.
Can I bring some tools? <g>
--
Rudy Velthuis [TeamB] rvelthuis.bei.t-online.de
"Every normal man must be tempted at times to spit upon his hands,
hoist
the black flag, and begin slitting throats."
-- Henry Louis Mencken (1880-1956)
 

Re: How do I do .... in C#?

Rudy Velthuis [TeamB] writes:
Quote
Can I bring some tools? <g>
Sure, we'll be happy to use them.
--
Nick Hodges -- TeamB
Lemanix Corporation -- www.lemanix.com
Read my Blog -- www.lemanix.com/nick
 

Re: How do I do .... in C#?

Tim Jarvis writes:
Quote
Ingvar Nilsen writes:

>>One cool syntax in C# is the syntax you can use to chain
>>constructors together i.e.
>
>And practical use?

Well just the obvious not having to repeat calls in separate
constructors (not a C# or .NET specific benefit), I was really just
commenting on the elegant syntax for doing that. I do of course
realise that, that is subjective, do you like it ? (the syntax that
is)
I think it detracts from what really happens. In the first, the
inehrited constructor is called, in the second the parameterless
constructor of this class. Why not simply code them there?
I guess this was done for C++ users. <g>
--
Rudy Velthuis [TeamB] rvelthuis.bei.t-online.de
"Believe those who are seeking the truth. Doubt those who find it."
-- Andr?Gide
 

Re: How do I do .... in C#?

Nick Hodges [TeamB] writes:
Quote
Rudy Velthuis [TeamB] writes:

>Can I bring some tools? <g>

Sure, we'll be happy to use them.
In that case I will know what to bring. <g>
--
Rudy Velthuis [TeamB] rvelthuis.bei.t-online.de
"Everybody wants to go to heaven, but nobody wants to die."
-- Joe Louis.
 

Re: How do I do .... in C#?

Rudy Velthuis [TeamB] writes:
Quote
I think it detracts from what really happens. In the first, the
inehrited constructor is called, in the second the parameterless
constructor of this class. Why not simply code them there?

I guess this was done for C++ users. <g>
How about when you are adding a constructor to a Form, your designer
has already createed a parameterless constructor for you with a call to
InitializeComponent, if you remove the paramentless one you will break
the designer but if you just add another constructor now you will need
to make the same call to InitializeComponent.
i.e.
public TheForm()
{
InitializeComponent;
}
public TheForm(SomeClass myObject) : this()
{
BindTheObjectToTheForm();
}
See where I am coming from ?
 

Re: How do I do .... in C#?

Tim Jarvis writes:
Quote
See where I am coming from ?
No, sorry.
--
Rudy Velthuis [TeamB] rvelthuis.bei.t-online.de
"It is time I stepped aside for a less experienced and less able man."
- Professor Scott Elledge on his retirement from Cornell
 

Re: How do I do .... in C#?

Rudy Velthuis [TeamB] writes:
Quote
Tim Jarvis writes:

>See where I am coming from ?

No, sorry.
How would you do that in C# then ?
 

Re: How do I do .... in C#?

Tim Jarvis writes:
Quote
Rudy Velthuis [TeamB] writes:

>Tim Jarvis writes:
>
>>See where I am coming from ?
>
>No, sorry.

How would you do that in C# then ?
I didn't quite get the problem, that is why I said "No, sorry".
Could you explain what you are actually asking?
--
Rudy Velthuis [TeamB] rvelthuis.bei.t-online.de
"I was thrown out of college for cheating on the metaphysics exam;
I looked into the soul of the boy next to me." -- Woody Allen.
 

Re: How do I do .... in C#?

Rudy Velthuis [TeamB] writes:
Quote

I didn't quite get the problem, that is why I said "No, sorry".

Could you explain what you are actually asking?
Oh,
ok, say you have created a dialog box that you want to use to say edit
one of your classes, and what you also want to do is pass you object
that you want to edit in the constructor to bind it to the form i.e.
MyClassDialog dlg = new MyClassDialog(myClassInstance);
When you have created your dialog the .NET designer has created a
parameterless constructor for you with a call to InitializeComponent
i.e.
public MyClassDialog()
{
InitializeComponent();
}
now, we can not remove this one and place the Init call into our
constructor because this would break the desiger, our options are then
to either duplicate the call to the initialization routine or to chain
it i.e.
public MyClassDialog(MyClass myClassInstance)
{
InitializeComponent();
BindMyClassToTheDialog();
}
or
Public MyClassDialog(MyClass myClassInstance) : this()
{
BindMyClassToTheDialog();
}
I personally prefer the chaining approach, appeals to my sense of reuse.
Regards Tim.
 

Re: How do I do .... in C#?

Tim Jarvis writes:
Quote
Public MyClassDialog(MyClass myClassInstance) : this()
{
BindMyClassToTheDialog();
}

I personally prefer the chaining approach, appeals to my sense of
reuse.
Oh, so do I, but I only meant to say that in Delphi, you would write
the this() call in the body of the constructor with the parameter.
public MyClassDialog(MyClass myClassInstance)
{
this(); // pseudo-C#, i.e. how Delphi does it.
BindMyClassToTheDialog();
}
constructor MyClassDialog.Create(myClassInstance: MyClass);
begin
Create;
BindMyClassToTheDialog(myClassInstance);
end;
I think the Delphi syntax is clearer.
--
Rudy Velthuis [TeamB] rvelthuis.bei.t-online.de
"I've had a wonderful time, but this wasn't it."
-- Groucho Marx (1895-1977)
 

Re: How do I do .... in C#?

Ingvar Nilsen writes:
Quote
Yeah, very easy.. if you know what to search for.
Yes, it is very easy to get lots of false hits. Glad you can finally
find the information, but it does have a size problem.
--
John Kaster blogs.borland.com/johnk
Features and bugs: qc.borland.com
Get source: cc.borland.com
What's going on? calendar.borland.com