示例#1
0
		private static void OnVoteRequest(VoteRequestEventArgs e)
		{
			Mobile from = e.Sender;
			VoteSite voteSite = e.VoteSite;

			if (from == null || from.Deleted)
				return;

			if (voteSite.Valid)
			{
				if (e.CanVote)
				{
					if (voteSite.Parent.OnBeforeVote(from))
					{
						voteSite.Parent.OnVote(from, VoteStatus.Success);
						voteSite.Parent.OnAfterVote(from, VoteStatus.Success);
					}
					else
					{
						voteSite.Parent.OnVote(from, VoteStatus.Custom);
						voteSite.Parent.OnAfterVote(from, VoteStatus.Custom);
					}
				}
				else
				{
					voteSite.Parent.OnVote(from, VoteStatus.TooEarly);
					voteSite.Parent.OnAfterVote(from, VoteStatus.TooEarly);
				}
			}
			else
			{
				voteSite.Parent.OnVote(from, VoteStatus.Invalid);
				voteSite.Parent.OnAfterVote(from, VoteStatus.Invalid);
			}
		}
示例#2
0
		/// <summary>
		/// Invokes the VoteRequest event with the specified EventArgs.
		/// </summary>
		/// <param name="e">VoteRequestEventArgs object.</param>
		public static void InvokeVoteRequest(VoteRequestEventArgs e)
		{
			if (InternalVoteRequest != null && e != null)
				InternalVoteRequest.Invoke(e);

			if (VoteRequest != null && e != null)
				VoteRequest.Invoke(e);
		}
示例#3
0
        /// <summary>
        /// Invokes the VoteRequest event with the specified EventArgs.
        /// </summary>
        /// <param name="e">VoteRequestEventArgs object.</param>
        public static void InvokeVoteRequest(VoteRequestEventArgs e)
        {
            if (InternalVoteRequest != null && e != null)
            {
                InternalVoteRequest.Invoke(e);
            }

            if (VoteRequest != null && e != null)
            {
                VoteRequest.Invoke(e);
            }
        }
示例#4
0
        private static void OnVoteRequest(VoteRequestEventArgs e)
        {
            Mobile   from     = e.Sender;
            VoteSite voteSite = e.VoteSite;

            if (from == null || from.Deleted)
            {
                return;
            }

            if (voteSite.Valid)
            {
                if (e.CanVote)
                {
                    if (voteSite.Parent.OnBeforeVote(from))
                    {
                        voteSite.Parent.OnVote(from, VoteStatus.Success);
                        voteSite.Parent.OnAfterVote(from, VoteStatus.Success);
                    }
                    else
                    {
                        voteSite.Parent.OnVote(from, VoteStatus.Custom);
                        voteSite.Parent.OnAfterVote(from, VoteStatus.Custom);
                    }
                }
                else
                {
                    voteSite.Parent.OnVote(from, VoteStatus.TooEarly);
                    voteSite.Parent.OnAfterVote(from, VoteStatus.TooEarly);
                }
            }
            else
            {
                voteSite.Parent.OnVote(from, VoteStatus.Invalid);
                voteSite.Parent.OnAfterVote(from, VoteStatus.Invalid);
            }
        }