• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ActionEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ActionEventArgs的典型用法代码示例。如果您正苦于以下问题:C# ActionEventArgs类的具体用法?C# ActionEventArgs怎么用?C# ActionEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ActionEventArgs类属于命名空间,在下文中一共展示了ActionEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: ProjectVote

        void ProjectVote(object sender, ActionEventArgs e)
        {
            uPowers.BusinessLogic.Action a = (uPowers.BusinessLogic.Action)sender;

            if (a.Alias == "ProjectUp" || a.Alias == "ProjectDown")
            {

                Document d = new Document(e.ItemId);

                e.ReceiverId = (int)d.getProperty("owner").Value;

                e.ExtraReceivers = Utils.GetProjectContributors(d.Id);
            }
        }
开发者ID:KerwinMa,项目名称:OurUmbraco,代码行数:14,代码来源:projectVote.cs


示例17: MyLogic

        public void MyLogic(ActionEventArgs args)
        {
            if (DoerIsPlayer)
            {
                DialogGroup group = new DialogGroup();

                Dialog dialog = new Dialog();
                dialog.RawText = "You crawl into the bed and fall asleep.";
                dialog.Image = Game.Instance.ResourceController.GetActionImage(this, @"bed\sleep\", true);
                dialog.AddBeginEffect(new GUI.Effects.FadeColorOut());
                dialog.AddEndEffect(new GUI.Effects.FadeColorIn());
                dialog.Choices.Add(new DialogChoice("Test", new Action(() => { Game.Instance.Player.Stats.SetValue("Happiness", 0.0); })));
                dialog.Choices.Add(new DialogChoice("Test2", new Action(() => 
                {
                    Game.Instance.Player.Stats.SetValue("Happiness", 50.0);

                    dialog.ClearEndEffects();

                    dialog.AddEndEffect(new GUI.Effects.Flash(Colors.White));
                    dialog.AddEndEffect(new GUI.Effects.Flash(Colors.Red), 1);
                    dialog.AddEndEffect(new GUI.Effects.Flash(Colors.Blue), 2);
                    dialog.AddEndEffect(new GUI.Effects.Flash(Colors.Yellow), 3);
                    dialog.AddEndEffect(new GUI.Effects.Flash(Colors.Green), 4);
                    dialog.AddEndEffect(new GUI.Effects.Flash(Colors.White), 5);

                    dialog.AddEndEffect(new GUI.Effects.FadeColorIn(), 10);
                })));
                dialog.Choices.Add(new DialogChoice("Test3", new Action(() => { Game.Instance.Player.Stats.SetValue("Happiness", 100.0); })));
                group.Entries.Add(dialog);
                
                Dialog dialog2 = new Dialog();
                dialog2.RawText = "You wake up.";
                dialog2.AddBeginEffect(new GUI.Effects.FadeColorOut());
                dialog2.AddEndEffect(new GUI.Effects.FadeColorIn());
                group.Entries.Add(dialog2);

                Dialog dialog3 = new Dialog();
                dialog3.RawText = "You crawl into the bed and fall asleep.";
                dialog3.Image = Game.Instance.ResourceController.GetActionImage(this, @"bed\sleep\", true);
                dialog3.AddBeginEffect(new GUI.Effects.FadeColorOut());
                dialog3.AddEndEffect(new GUI.Effects.FadeColorIn());
                group.Entries.Add(dialog3);

                Game.Instance.DialogController.DrawDialog(group);
            }
            else if (this.Witnesses.Contains(Game.Instance.Player))
            {
                //Game.Instance.DialogController.DrawDialog(new DialogControl(args.Doer.FirstName + " crawls into the bed and falls asleep.", true));
            }
        }
开发者ID:Tragedian-HLife,项目名称:HLife,代码行数:50,代码来源:Bed.cs


示例18: ProjectVote

        void ProjectVote(object sender, ActionEventArgs e)
        {
            uPowers.BusinessLogic.Action a = (uPowers.BusinessLogic.Action)sender;

            if (a.Alias == "ProjectUp" || a.Alias == "ProjectDown")
            {
                var contentService = UmbracoContext.Current.Application.Services.ContentService;
                var content = contentService.GetById(e.ItemId);

                e.ReceiverId = content.GetValue<int>("owner");

                e.ExtraReceivers = Utils.GetProjectContributors(content.Id);
            }
        }
开发者ID:QuangDang212,项目名称:OurUmbraco,代码行数:14,代码来源:projectVote.cs


示例19: GetActionsByStat

        public List<GameAction> GetActionsByStat(string stat, ActionEventArgs args)
        {
            List<GameAction> actions = new List<GameAction>();

            foreach (GameAction action in Game.Instance.ActionController.Actions)
            {
                if(action.GetEffectsByStat(stat, args).Count > 0)
                {
                    actions.Add(action);
                }
            }

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


示例20: TopicScoring

        void TopicScoring(object sender, ActionEventArgs e)
        {
            if (!e.Cancel)
            {
                Action a = (Action)sender;

                if (a.Alias == "LikeTopic" || a.Alias == "DisLikeTopic")
                {
                    int topicScore = Xslt.Score(e.ItemId, a.DataBaseTable);

                    //this uses a non-standard coloumn in the forum schema, so this is added manually..
                    Data.SqlHelper.ExecuteNonQuery("UPDATE forumTopics SET score = @score WHERE id = @id", Data.SqlHelper.CreateParameter("@id", e.ItemId), Data.SqlHelper.CreateParameter("@score", topicScore));
                }
            }
        }
开发者ID:ClaytonWang,项目名称:OurUmbraco,代码行数:15,代码来源:TopicVote.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ActionExecutedContext类代码示例发布时间:2022-05-24
下一篇:
C# ActionDescriptor类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap