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

            dlg.BeginInvoke(null, null);
        }
Ejemplo 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);
        }
Ejemplo 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);
        }
Ejemplo 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);
        }