Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding a property in a Web Service
Message
 
 
À
19/05/2003 14:13:47
Information générale
Forum:
ASP.NET
Catégorie:
Web Services
Divers
Thread ID:
00790056
Message ID:
00790090
Vues:
25
>I've been trying to find how to do that with the Properties window on the right and no wonder why I didn't find it. So, am I understanding correclty that we cannot add a property such as we do in VFP by using the visual interface?

Nope. You have to code it. Welcome to this brave new world! 8-)

Indeed, you better try to understand the difference between properties and member classes. In .NET, a property is the way to access a member class, not the member class itself.

Do inside Cathi's code:
public int Width  // This is the member class (or field)
{
   // The get/set code here is what constitutes the "Property"
   get { return width; }
   set
   {
      if (value > 0)
         width = value;
      else
         throw new ArgumentOutOfRangeException("Width must be 1 or higher");
   }
}
Of course Cathi or anyone else here can correct and enhance my explanation. But this actually how things are. VFP makes all of this invisible to us.

Best luck!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform