5th-releasedahd::released a butterfly, what else? ;)


reply

name:   color:
email:   icq:
homepage:
title:           xhtml-mode
text:
email @5ahd

to


 
 
2005-05-04 01:08:12
gizmo
email | icqstatus
 
c# - singleton
 wers verwenden will und ned weiß wie - wird hier geholfen ^^

public sealed class BusinessLogic {
    // private Konstruktor aufrufen
    private static readonly BusinessLogic instance = new BusinessLogic();
    // Property zum Zugriff
    public static BusinessLogic Instance
    {    get    {    return instance;    }    }
    // Konstruktor (private!)
    private BusinessLogic()    {
        data = new DataLayer();
        // ...
    }
}
// Zugriff (aus der GUI bzw. ASP) zb:
BusinessLogic.Instance.Funktion();^

ps: namespace sollte identisch sein.
 

« back

© gizmo'05