Exemplo n.º 1
0
        public chatForm()
        {
            InitializeComponent();
            Printer    = new printer(print);
            Cleaner    = new cleaner(clearChat);
            UPrint     = new UserPrinter(UpdateOnlineList);
            bw.DoWork += new DoWorkEventHandler(bw_setName);

            connect();
            UserThread = new Thread(listner);
            UserThread.IsBackground = true;
            UserThread.Start();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            var user = new User()
            {
                FirstName = "John",
                LastName  = "Doe",
                Age       = 43
            };

            var userPrinter = new UserPrinter(user);

            userPrinter.Print();
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            var user = new User("admin", "123456");

            var userPrinter = new UserPrinter();

            userPrinter.PrintToFile(user);

            // var userPersistence = new UserPersistence();
            // userPersistence.SaveToFile();

            var userPersistence = new UserPersistence(new SqlServerPersistence());

            userPersistence.Save(user);
        }