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); } }
/// <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); }
/// <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); } }
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); } }