Ejemplo n.º 1
0
 public UserService()
 {
     log = new Logger();
     log.LogInfo("ctor ()");
     //TODO:Eq comparer
     Storage     = new HashSet <User>(new UserComparer());
     IdGenerator = new UserIdGenerator(o => o.GetHashCode());
     notifier    = new AddRemoveNotifier();
 }
Ejemplo n.º 2
0
 public UserService(bool swh)
 {
     if (swh)
     {
         log = new Logger();
         log.LogInfo("ctor (switch)");
     }
     else
     {
         log = new Logger();
         log.LogInfo("ctor (without loging)");
         log = null;
     }
     //TODO:Eq comparer
     Storage     = new HashSet <User>(new UserComparer());
     IdGenerator = new UserIdGenerator(o => o.GetHashCode());
     notifier    = new AddRemoveNotifier();
 }
Ejemplo n.º 3
0
        private ILogger log;//TODO: static or singleton

        public UserService(bool isMaster, bool isLog, HashSet <User> storage)
        {
            this.isMaster = isMaster;
            if (isLog)
            {
                log = new Logger();
                log.LogInfo("ctor (switch)");
            }
            else
            {
                log = new Logger();
                log.LogInfo("ctor (without loging)");
                log = null;
            }
            Storage       = storage;
            IdGenerator   = new UserIdGenerator(o => o.GetHashCode());
            this.notifier = new AddRemoveNotifier();
        }