当前位置: 首页>>代码示例>>C#>>正文


C# ActionEventArgs类代码示例

本文整理汇总了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);
			}
		}
开发者ID:mind0n,项目名称:hive,代码行数:7,代码来源:ActionNode.cs

示例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);
                    }

                }

            }
        }
开发者ID:ClaytonWang,项目名称:OurUmbraco,代码行数:32,代码来源:TopicVote.cs

示例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;
     }
 }
开发者ID:JamesBondski,项目名称:mafiabot,代码行数:7,代码来源:TrackedEffect.cs

示例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();
     }
 }
开发者ID:JamesBondski,项目名称:mafiabot,代码行数:8,代码来源:HeroEffect.cs

示例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;
 }
开发者ID:dimpapadim3,项目名称:NErgyPlatformSample,代码行数:8,代码来源:ModifyElementState.cs

示例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;
 }
开发者ID:dimpapadim3,项目名称:NErgyPlatformSample,代码行数:14,代码来源:AddSecondaryBeamsState.cs

示例7: CanPerformLogic

        public override bool CanPerformLogic(ActionEventArgs args)
        {
            if(args.Doer.Stats.GetValue<double>("Energy") < 100)
            {
                return true;
            }

            return false;
        }
开发者ID:Tragedian-HLife,项目名称:HLife,代码行数:9,代码来源:Bed.cs

示例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);
            }
        }
开发者ID:porter1130,项目名称:C-A,代码行数:68,代码来源:ApproveForm.aspx.cs

示例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;
			}
		}
开发者ID:larrynPL,项目名称:OurUmbraco,代码行数:10,代码来源:ExternalVote.cs

示例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);
                }
            }
        }
开发者ID:JamesBondski,项目名称:mafiabot,代码行数:11,代码来源:FlipInvestigationEffect.cs

示例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);
        }
开发者ID:porter1130,项目名称:C-A,代码行数:53,代码来源:EditForm.aspx.cs

示例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);
            }
        }
开发者ID:Tragedian-HLife,项目名称:HLife,代码行数:12,代码来源:Person.cs

示例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;
            }
        }
开发者ID:ClaytonWang,项目名称:OurUmbraco,代码行数:12,代码来源:TopicVote.cs

示例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));
            }
        }
开发者ID:KerwinMa,项目名称:OurUmbraco,代码行数:13,代码来源:CommentVote.cs

示例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);
                }
            }
        }
开发者ID:JamesBondski,项目名称:mafiabot,代码行数:13,代码来源:CancellingEffect.cs


注:本文中的ActionEventArgs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。