Esempio n. 1
0
        private void DelegateButton_Click(
            object sender, System.EventArgs e)
        {
            AsynchDelegate dlg
                = new AsynchDelegate(AsynchExecuted);

            dlg.BeginInvoke(null, null);
        }
Esempio n. 2
0
        public void AsynchLogUserRegistration(Guid?userId, string ip)
        {
            var userRegistrationLog = new UserRegistrationLog
            {
                UserId    = userId.Value,
                IpAddress = ip,
                DateTime  = DateTime.Now
            };

            AsynchDelegate aDelegate = () =>
            {
                DataService.PerThread.UserRegistrationLogSet.AddObject(userRegistrationLog);
                DataService.PerThread.SaveChanges();
            };

            var asynchRes = aDelegate.BeginInvoke(null, null);

            aDelegate.EndInvoke(asynchRes);
        }
Esempio n. 3
0
        public void AsynchLogUserAuthentification(string userName, string ip, bool status)
        {
            var userAuthentificationLog = new UserAuthentificationLog
            {
                UserName  = userName,
                IpAddress = ip,
                Status    = status,
                DateTime  = DateTime.Now
            };

            AsynchDelegate aDelegate = () =>
            {
                DataService.PerThread.UserAuthentificationLogSet.AddObject(userAuthentificationLog);
                DataService.PerThread.SaveChanges();
            };

            var asynchRes = aDelegate.BeginInvoke(null, null);

            aDelegate.EndInvoke(asynchRes);
        }
Esempio n. 4
0
        public void AsynchLogUserPollVote(Guid?userId, Guid groupMemberId, Guid pollId, string result)
        {
            var userPollVoteLog = new UserPollVoteLog
            {
                UserId        = userId.Value,
                GroupMemberId = groupMemberId,
                PollId        = pollId,
                Result        = result,
                DateTime      = DateTime.Now
            };

            AsynchDelegate aDelegate = () =>
            {
                DataService.PerThread.UserPollVoteLogSet.AddObject(userPollVoteLog);
                DataService.PerThread.SaveChanges();
            };

            var asynchRes = aDelegate.BeginInvoke(null, null);

            aDelegate.EndInvoke(asynchRes);
        }