/// <summary>
        /// The main entry point for the application.
        /// </summary>
        //[STAThread]
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Console.WriteLine("Hello!");
            Console.WriteLine(args[0]);
            XmlConfigurator.Configure(new System.IO.FileInfo(args[0]));
            IDictionary <String, string> props = new SortedList <String, String>();

            props.Add("ConnectionString", GetConnectionStringByName("labDB"));
            RepoDbContestant   repoDbContestant   = new RepoDbContestant(props);
            RepoDbOfficePers   repoDbOffice       = new RepoDbOfficePers(props);
            RepoDbRace         repoDbRace         = new RepoDbRace(props);
            RepoDbRegistration repoDbRegistration = new RepoDbRegistration(props);

            ServiceApp service = new ServiceApp(repoDbContestant, repoDbOffice, repoDbRace, repoDbRegistration);
            //repoTests repo1 = new repoTests();
            //repo1.test();

            Login login = new Login();

            login.Service = service;
            Application.Run(login);
        }
 public ServiceApp(RepoDbContestant repoC, RepoDbOfficePers repoOp, RepoDbRace repoR, RepoDbRegistration repoReg)
 {
     this.repoC   = repoC;
     this.repoOp  = repoOp;
     this.repoR   = repoR;
     this.repoReg = repoReg;
 }
Exemple #3
0
 public ServerImpl(IRepoContestant repoContestant, IRepoRace repoRace, IOfficePers officePers, RepoDbRegistration reg)
 {
     this.contRepo = repoContestant;
     this.raceRepo = repoRace;
     this.userRepo = officePers;
     this.regRepo  = reg;
     loggedClients = new Dictionary <String, IClient>();
 }
        static void Main(string[] args)
        {
            XmlConfigurator.Configure(new System.IO.FileInfo(args[0]));
            IDictionary <String, string> props = new SortedList <String, String>();

            props.Add("ConnectionString", GetConnectionStringByName("labDB"));
            IRepoContestant    repoContestant     = new RepoDbContestant(props);
            IRepoRace          repoRace           = new RepoDbRace(props);
            IOfficePers        officePersRepo     = new RepoDbOfficePers(props);
            RepoDbRegistration repoDbRegistration = new RepoDbRegistration(props);
            IServer            serverImpl         = new ServerImpl(repoContestant, repoRace, officePersRepo, repoDbRegistration);
            SerialServer       server             = new SerialServer("127.0.0.1", 55555, serverImpl);

            server.Start();
            Console.WriteLine("Server started...");
            Console.ReadLine();
        }