Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Subclass failing with Stack Overflow. Help?
Message
 
À
24/03/2004 14:34:58
John Baird
Coatesville, Pennsylvanie, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00889378
Message ID:
00889382
Vues:
21
You are calling the property in an infinate loop. A property needs a field to hold its state
private bool _isLoggedIn;
public bool lIsLoggedIn {
    get {
      return _isLoggedIn;
  }
  set {
      _isLoggedIn = value;
     }
}
>The code below is in the class which creates my subclasses of the .net controls. This builds fine, but stack overflows on the line: lIsLoggedIn = value. Am I doing something wrong?
>
>Thanks in advance.
>
>
>public class frmBase : Quay.Base.frmBase
>{
>   public bool lIsLoggedIn {
>      get {
>         return lIsLoggedIn;
>      }
>
>      set {
>         lIsLoggedIn = value;
>      }
>   }
>
>   public frmBase() {
>      this.Font = new Font(“Arial”, 8)’;
>      this.lIsLoggedIn = false;
>   }
>}
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform