當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。