Re: Methods, Named Parameters

From: Ignacio Machin \( .NET/ C# MVP \) ("Ignacio)
Date: 12/22/04


Date: Wed, 22 Dec 2004 09:56:30 -0500

Hi,

 No always and not for sure, what if you select weirds or not explicit names
for the parameters, then you get nothing from it.

 AFAIK the only language that supported this was VB IIRC, and frankly I
never saw it used extensely.

Cheers,

-- 
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Peter Hardy" <pete@nospam.com> wrote in message 
news:OjMs%23a45EHA.2180@TK2MSFTNGP12.phx.gbl...
> Hi Guyz,
>
> Thanks for the feedback. I find named parameters (hey, I don't choose the
> lingo) to be a useful way to document code.
>
> For example, calling
>
>   ticket = new FormsAuthenticationTicket
>    (
>     version = 1,
>     name = txtUserName.Text,
>     issueDate = DateTime.Now,
>     expiration = DateTime.Now.AddMinutes(30),
>     isPersistant = false,
>     userData = "Users",
>     cookiePath = FormsAuthentication.FormsCookiePath
>    );
>
> says a lot more to anyone reading the code than
>
>   ticket = new FormsAuthenticationTicket
>    (
>     1,
>     txtUserName.Text,
>     DateTime.Now,
>     DateTime.Now.AddMinutes(30),
>     false,
>     "Users",
>     FormsAuthentication.FormsCookiePath
>    );
>
> I have this sinking feeling I'm gonna have to learn Visual Basic now ... 
> And
> just before Christmas too :(
>
> Cheers Pete
>
> "Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> 
> wrote
> in message news:OgxIsq25EHA.2592@TK2MSFTNGP09.phx.gbl...
>> Hi Peter,
>>
>>  Nop, C# does not support named parameters, only  "positional" 
>> parameters.
>>
>> Cheers,
>>
>> -- 
>> Ignacio Machin,
>> ignacio.machin AT dot.state.fl.us
>> Florida Department Of Transportation
>>
>>
>>
>> "Peter Hardy" <pete@nospam.com> wrote in message
>> news:OhM3MK25EHA.960@TK2MSFTNGP10.phx.gbl...
>> > Hi Guys,
>> >
>> > Can I use named parameters in C# Methods. i.e doFoo(fname="do",
>> > lname="Foo");
>> >
>> > Cheers, Pete
>> >
>> >
>>
>>
>
> 


Relevant Pages

  • Re: Methods, Named Parameters
    ... > lingo) to be a useful way to document code. ... > ticket = new FormsAuthenticationTicket ... really kills off any need to use named parameters in this case, ...
    (microsoft.public.dotnet.languages.csharp)
  • FormsAuthentication und schlaflose Nächte
    ... FormsAuthenticationTicket ticket = new FormsAuthenticationTicket( ... string sEncTicket = FormsAuthentication.Encrypt; ... Die Rolle im Ticket aufzubewahren scheint mir das Naheliegenste zu sein. ... Auf der Logon Seite finde ich ...
    (microsoft.public.de.german.entwickler.dotnet.asp)
  • Re: Forms Authentication in ASP.NET 2.0
    ... FormsAuthenticationTicket ticket = new FormsAuthenticationTicket( ... // Encrypt the cookie using the machine key for secure transport ... That's pretty much all you need for the Forms Authentication without using ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Use of Login Control
    ... Dim id As FormsIdentity = CType ... Dim ticket As FormsAuthenticationTicket = id.Ticket ... Dr. Doug Pruiett ...
    (microsoft.public.vsnet.general)
  • Re: Ooooh, Alpina!
    ... Ticket on my expense. ... Pete M - Using the Scouse Side of the Force - ... Golf GTi Mk1 ...
    (uk.rec.cars.modifications)