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

            if (handler != null)
            {
                handler(this, eventArgs);
            }
        }
Beispiel #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;
        }
Beispiel #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;
 }
Beispiel #7
0
        public void FireBeforeVoteMade(object sender, VoteEventArgs eventArgs)
        {
            var handler = BeforeVoteMade;

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