本文整理汇总了C#中ActionEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# ActionEventArgs类的具体用法?C# ActionEventArgs怎么用?C# ActionEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ActionEventArgs类属于命名空间,在下文中一共展示了ActionEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NotifyAction
public virtual void NotifyAction(IActionControl sender, ActionEventArgs argument)
{
if (ActionCallback != null)
{
ActionCallback(sender, argument);
}
}
示例2: TopicSolved
void TopicSolved(object sender, ActionEventArgs e)
{
var ts = new TopicService(ApplicationContext.Current.DatabaseContext);
var cs = new CommentService(ApplicationContext.Current.DatabaseContext, ts);
Action a = (Action)sender;
if (a.Alias == "TopicSolved")
{
var c = cs.GetById(e.ItemId);
if (c != null)
{
var t = ts.GetById(c.TopicId);
//if performer and author of the topic is the same... go ahead..
if ((e.PerformerId == t.MemberId || ModeratorRoles.Split(',').Any(x => Roles.IsUserInRole(x))) && t.Answer == 0)
{
//receiver of points is the comment author.
e.ReceiverId = c.MemberId;
//remove any previous votes by the author on this comment to ensure the solution is saved instead of just the vote
a.ClearVotes(e.PerformerId, e.ItemId);
//this uses a non-standard coloumn in the forum schema, so this is added manually..
t.Answer = c.Id;
ts.Save(t);
}
}
}
}
示例3: OnPostAction
void OnPostAction(object sender, ActionEventArgs e)
{
if (!e.Action.Cancel && e.Action.Initiator != Source) {
Source.Outside.SendMessage(e.Action.Initiator.Name + " targeted " + e.Action.Target.Name);
triggered = true;
}
}
示例4: OnPreActionTarget
void OnPreActionTarget(object sender, ActionEventArgs e)
{
if(e.Action.Power is Powers.DaykillPower) {
e.Action.Cancel = true;
(e.Action.Who as VillageMember).Kill(DeathCauseType.Hero);
e.Action.Village.Phase.End();
}
}
示例5: MouseDownHandler
public override bool MouseDownHandler(object sender, ActionEventArgs e)
{
if ( e.Worldcoord != null)
c1 = (Vector)e.Worldcoord;
base.ResolveSelection(sender, e);
_presenter.NotifyViews();
return true;
}
示例6: MouseDownHandler
/// <summary>
/// Method MouseDownHandler
/// </summary>
/// <returns>A bool</returns>
/// <param name="sender">An object</param>
/// <param name="e">An ActionEventArgs</param>
public override bool MouseDownHandler(Object sender, ActionEventArgs e)
{
if (e.Selected != null && (e.Selected is Area) )
{
Handle(e.Selected as Area);
}
return false;
}
示例7: CanPerformLogic
public override bool CanPerformLogic(ActionEventArgs args)
{
if(args.Doer.Stats.GetValue<double>("Energy") < 100)
{
return true;
}
return false;
}
示例8: CheckNextApprove
/// <summary>
/// 检查下一步审批
/// </summary>
/// <param name="cfoTaskUsers">CFO</param>
/// <param name="faTaskUsers">财务</param>
/// <param name="e">事件对象</param>
/// <param name="manager">管理者</param>
/// <param name="status">状态</param>
/// <param name="orderNum"></param>
/// <param name="isReject">是否拒绝</param>
/// <param name="isToCfo">是否转向CFO审批</param>
private void CheckNextApprove(int paymentTerm, ref NameCollection cfoTaskUsers, ref NameCollection faTaskUsers, ActionEventArgs e, string manager, ref string status, ref string vendorID, ref bool isReject, ref bool isToCfo)
{
if (WorkflowContext.Current.Step == "DepartmentManagerTask")
{
faTaskUsers = GetTaskUsers("wf_Finance_MDM");
cfoTaskUsers = GetTaskUsers("wf_CFO");
if (e.Action == "Approve")
{
isToCfo = (paymentTerm >= 30) ? false : true;
status = CAWorkflowStatus.IODepartmentManagerApprove;
}
else if (e.Action == "Reject")
{
isReject = true;
status = CAWorkflowStatus.IODepartmentManagerReject;
}
AddWorkFlowStepApprovers(WorkflowContext.Current.Task.Step, CA.WorkFlow.UI.Constants.WorkFlowStep.SupplierSetupMaintenanceApprovers, CA.WorkFlow.UI.Constants.WorkFlowStep.SupplierSetupMaintenanceApproverLoginName);
}
else if (WorkflowContext.Current.Step == "CfoTask")
{
if (e.Action == "Approve")
{
faTaskUsers = GetTaskUsers("wf_Finance_MDM");
status = CAWorkflowStatus.IOCFOApprove;
}
else if (e.Action == "Reject")
{
isReject = true;
status = CAWorkflowStatus.IOCFOReject;
}
AddWorkFlowStepApprovers(WorkflowContext.Current.Task.Step, CA.WorkFlow.UI.Constants.WorkFlowStep.SupplierSetupMaintenanceApprovers, CA.WorkFlow.UI.Constants.WorkFlowStep.SupplierSetupMaintenanceApproverLoginName);
}
else if (WorkflowContext.Current.Step == "MdmTask")
{
//不论财务是拒绝还是确认,工作流都结束
if (e.Action == "Confirm")
{
status = CAWorkflowStatus.Completed;
}
else if (e.Action == "Reject")
{
vendorID = string.Empty;
status = CAWorkflowStatus.IOFinanceReject;
}
AddWorkFlowStepApprovers(WorkflowContext.Current.Task.Step, CA.WorkFlow.UI.Constants.WorkFlowStep.SupplierSetupMaintenanceApprovers, CA.WorkFlow.UI.Constants.WorkFlowStep.SupplierSetupMaintenanceApproverLoginName);
}
bool isCfo = CurrentManagerIsCfo(cfoTaskUsers, manager);
//如果部门领导是CFO,当点击 “To CFO”,直接跳转到财务
if (isCfo && isToCfo)
{
isToCfo = false;
status = CAWorkflowStatus.IOCFOApprove;
AddWorkFlowStepApprovers(WorkflowContext.Current.Task.Step, CA.WorkFlow.UI.Constants.WorkFlowStep.SupplierSetupMaintenanceApprovers, CA.WorkFlow.UI.Constants.WorkFlowStep.SupplierSetupMaintenanceApproverLoginName);
}
}
示例9: Action_BeforePerform
void Action_BeforePerform(object sender, ActionEventArgs e)
{
Action a = (Action)sender;
if (a.Alias == "ExternalVote")
{
var memberId = OurUmbraco.Powers.BusinessLogic.Data.SqlHelper.ExecuteScalar<int>("SELECT memberId FROM externalUrls WHERE (@id = id)", OurUmbraco.Powers.BusinessLogic.Data.SqlHelper.CreateParameter("@id", e.ItemId));
e.ReceiverId = memberId;
}
}
示例10: OnPostActionTarget
void OnPostActionTarget(object sender, ActionEventArgs e)
{
if(e.Action.Power is Powers.InvestigatePower) {
Powers.InvestigationResult result = e.Action.Result as Powers.InvestigationResult;
if(result != null) {
result.Evil = !result.Evil;
Log.Debug("Flipped investigation result on " + e.Action.Target.Name + " for " + e.Action.Who.Name);
}
}
}
示例11: Actions_ActionExecuting
private void Actions_ActionExecuting(object sender, ActionEventArgs e)
{
WorkflowContext context = WorkflowContext.Current;
if (e.Action.Equals("Submit", StringComparison.CurrentCultureIgnoreCase))
{
context.DataFields["Status"] = CAWorkflowStatus.InProgress;
#region Set Workflow variable
var chopTaskTitle = string.Format("Purchase Order \"{0}\" needs chop online.", context.DataFields["WorkflowNumber"].ToString());
var confirmTaskTitle = string.Format("Purchase Order \"{0}\" needs create system PO.", context.DataFields["WorkflowNumber"].ToString());
context.UpdateWorkflowVariable("ChopTaskTitle", chopTaskTitle);
context.UpdateWorkflowVariable("ConfirmTaskTitle", confirmTaskTitle);
var confirmURL = "/_Layouts/CA/WorkFlows/PurchaseOrder/ConfirmForm.aspx";
context.UpdateWorkflowVariable("ChopTaskFormURL", confirmURL);
context.UpdateWorkflowVariable("ConfirmTaskFormURL", confirmURL);
#endregion
#region Set Next Step Task Assigner
bool isSkipChop = (bool)context.DataFields["IsSkipChop"];
if (isSkipChop)
{
var financeManager = PurchaseOrderCommon.GetTaskUsers("wf_Finance_PO");
if (financeManager == null || financeManager.Count == 0)
{
DisplayMessage("Can not find people from finance po group, please contact IT for help.");
e.Cancel = true;
return;
}
context.UpdateWorkflowVariable("ConfirmTaskUsers", financeManager);
}
else
{
var chopManager = PurchaseOrderCommon.GetTaskUsers("wf_Legal");
if (chopManager == null || chopManager.Count == 0)
{
DisplayMessage("Can not find people from legal group, please contact IT for help.");
e.Cancel = true;
return;
}
context.UpdateWorkflowVariable("ChopTaskUsers", chopManager);
}
#endregion
}
else
{
context.DataFields["Status"] = CAWorkflowStatus.Pending;
}
this.DataForm1.SavePaymentData();// 保存分期付款数据。
WorkFlowUtil.UpdateWorkflowPath(WorkflowContext.Current);
}
示例12: MyLogic
public void MyLogic(ActionEventArgs args)
{
if (DoerIsPlayer)
{
DialogGroup group = new DialogGroup();
Dialog dialog = new Dialog();
dialog.RawText = "You talk to " + args.Target.FirstName + ".";
group.Entries.Add(dialog);
Game.Instance.DialogController.DrawDialog(group);
}
}
示例13: TopicVote
void TopicVote(object sender, ActionEventArgs e)
{
var ts = new TopicService(ApplicationContext.Current.DatabaseContext);
Action a = (Action)sender;
if (a.Alias == "LikeTopic" || a.Alias == "DisLikeTopic")
{
var t = ts.GetById(e.ItemId);
e.ReceiverId = t.MemberId;
}
}
示例14: CommentScoring
void CommentScoring(object sender, ActionEventArgs e)
{
uPowers.BusinessLogic.Action a = (uPowers.BusinessLogic.Action)sender;
if (a.Alias == "LikeComment" || a.Alias == "DisLikeComment" || a.Alias == "TopicSolved")
{
int score = uPowers.Library.Xslt.Score(e.ItemId, a.DataBaseTable);
//we then add the sum of the total score to the
our.Data.SqlHelper.ExecuteNonQuery("UPDATE forumComments SET score = @score WHERE id = @id", Data.SqlHelper.CreateParameter("@id", e.ItemId), Data.SqlHelper.CreateParameter("@score", score));
}
}
示例15: OnPreAction
void OnPreAction(object sender, ActionEventArgs e)
{
if ((e.Action.Power.GetType() == cancelType || e.Action.Power.GetType().IsSubclassOf(cancelType))
&& !e.Action.Power.Instant) {
Log.Debug("Cancelled Power " + e.Action.Power.GetType().FullName + " by " + e.Action.Who.Name + (e.Action.Target != null ? " on " + e.Action.Target.Name : ""));
e.Action.Cancel = true;
if(ActionCancelled != null) {
ActionCancelled(this, e);
}
}
}