Exemple #1
0
        public void FireAfterVoteMade(object sender, VoteEventArgs eventArgs)
        {
            var handler = AfterVoteMade;

            if (handler != null)
            {
                handler(this, eventArgs);
            }
        }
Exemple #2
0
        /// <summary>
        /// Add a new vote
        /// </summary>
        /// <param name="vote"></param>
        /// <returns></returns>
        public Vote Add(Vote vote)
        {
            var e = new VoteEventArgs {Vote = vote, Api = _api};
            EventManager.Instance.FireBeforeVoteMade(this, e);

            if (!e.Cancel)
            {
                _voteRepository.Add(vote);

                EventManager.Instance.FireAfterVoteMade(this, new VoteEventArgs {Vote = vote, Api = _api});
            }

            return vote;
        }
Exemple #3
0
        /// <summary>
        /// Add a new vote
        /// </summary>
        /// <param name="vote"></param>
        /// <returns></returns>
        public Vote Add(Vote vote)
        {

            var e = new VoteEventArgs {Vote = vote};
            EventManager.Instance.FireBeforeVoteMade(this, e);

            if (!e.Cancel)
            {
                _context.Vote.Add(vote);

                EventManager.Instance.FireAfterVoteMade(this, new VoteEventArgs {Vote = vote});
            }

            return vote;
        }
 private void EventManagerInstanceAfterVoteMade(object sender, VoteEventArgs args)
 {
     _eventTestStr = TestString;
 }
 private void EventManagerInstanceBeforeVoteMadeCancel(object sender, VoteEventArgs args)
 {
     args.Cancel = true;
 }
 private void EventManagerInstanceBeforeVoteMadeAllow(object sender, VoteEventArgs args)
 {
     args.Cancel = false;
 }
Exemple #7
0
        public void FireBeforeVoteMade(object sender, VoteEventArgs eventArgs)
        {
            var handler = BeforeVoteMade;

            if (handler != null)
            {
                handler(this, eventArgs);
            }
        }