πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.csharpbuilder.language.csharp
Article #166

Re: Question about C# after reading 3rd party library docs

#166
From: Joanna Carter [TeamB]
Date: Wed, 20 Sep 2006 06:30
62 lines
2697 bytes
"Frederick C. Wilt" <fcwilt@mindspring.com> a οΏ½crit dans le message de news: 
4510c1fc$1@newsgroups.borland.com...

| I am new to C# and .NET so bear with me if I don't use the correct terms.
|
| I was writing a C# test app (in BDS2006) using this 3rd party library in a
| .NET DLL. The documentation stated:
|
| ---------------------------------------
| Note that when calling property read methods that require input parameters
| using C#, "get_" must be appended to the property name. This is an
| idiosyncrasy of the C# language and is not a naming convention 
inconsistency
| within this API.
|
| ---------------------------------------
|
| It seems to be the case and I was wondering why. Seems kind of odd to have
| this requirement.

??????????????????!!!!!!!!!!!!!!!!

Interesting :-) I have been using C# for some time now and have never come 
across any such convention.

The normal property declaration is :

class Thing
{
  private string name;

  public string Name
  {
    get { return name; }
    set { name = value; }
  }
}

However, the quote that you make says something about read methods that 
require input parameters; the only thing I can see that satisifies that 
would be an indexer (array property) :

class Thing
{
  private Dictionary<string, Stuff> stuffList;

  public Stuff this[string index]
  {
    get { return stuffList[index]; }
  }
}

But in no case that I know of would you ever call the accessor method, which 
does get compiled to a hidden method called something like get_Stuff.

Do the docs give any examples of what they are talking about ?

Joanna

-- 
Joanna Carter [TeamB]
Consultant Software Engineer 
Technical Details
Message-ID: <4510e002$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news3.google.com!news.glorb.com!newsfeed.kamp.net!newsfeed.kamp.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4510c1fc$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1efe35,f0e0371ea8ed4a27
X-Google-Attributes: gid1efe35,public
X-Google-Language: ENGLISH,ASCII
From: "Joanna Carter [TeamB]" <joanna@not.for.spam>
Newsgroups: borland.public.csharpbuilder.language.csharp
References: <4510c1fc$1@newsgroups.borland.com>
Subject: Re: Question about C# after reading 3rd party library docs
Date: Wed, 20 Sep 2006 07:30:15 +0100
Lines: 64
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
NNTP-Posting-Host: 86.43.77.112
Message-ID: <4510e002$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1158733826 86.43.77.112 (19 Sep 2006 23:30:26 -0700)
X-Authenticated-User: jcarter
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news3.google.com!news.glorb.com!newsfeed.kamp.net!newsfeed.kamp.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail