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); } } } }
public virtual void NotifyAction(IActionControl sender, ActionEventArgs argument) { if (ActionCallback != null) { ActionCallback(sender, argument); } }
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; } }
public override bool MouseDownHandler(object sender, ActionEventArgs e) { if ( e.Worldcoord != null) c1 = (Vector)e.Worldcoord; base.ResolveSelection(sender, e); _presenter.NotifyViews(); return true; }
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(); } }
/// <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; }
/// <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); } }
public override bool CanPerformLogic(ActionEventArgs args) { if(args.Doer.Stats.GetValue<double>("Energy") < 100) { return true; } return false; }
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; } }
/// <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(ref NameCollection cfoTaskUsers, ref NameCollection faTaskUsers, ActionEventArgs e, string manager, ref string status, ref string orderNum, ref bool isReject, ref bool isToCfo) { if (WorkflowContext.Current.Step == "DepartmentManagerTask") { faTaskUsers = GetTaskUsers("wf_FinanceAnalyst_IO"); cfoTaskUsers = GetTaskUsers("wf_CFO"); if (e.Action == "Approve"){ status = CAWorkflowStatus.IODepartmentManagerApprove; } else if (e.Action == "To CFO") { isToCfo = true; status = CAWorkflowStatus.IOToCFO; } else if (e.Action == "Reject") { isReject = true; status = CAWorkflowStatus.IODepartmentManagerReject; } } else if (WorkflowContext.Current.Step == "CfoTask") { if (e.Action == "Approve") { faTaskUsers = GetTaskUsers("wf_FinanceAnalyst_IO"); status = CAWorkflowStatus.IOCFOApprove; } else if (e.Action == "Reject") { isReject = true; status = CAWorkflowStatus.IOCFOReject; } } else if (WorkflowContext.Current.Step == "FinanceAnalystTask") { //不论财务是拒绝还是确认,工作流都结束 if (e.Action == "Confirm"){ status = CAWorkflowStatus.Completed; } else if (e.Action == "Reject") { orderNum = string.Empty; status = CAWorkflowStatus.IOFinanceReject; } } bool isCfo = CurrentManagerIsCfo(cfoTaskUsers, manager); //如果部门领导是CFO或者CEO,当点击 “To CFO”,直接跳转到财务 if (isCfo && isToCfo) { isToCfo = false; status = CAWorkflowStatus.IOCFOApprove; } }
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); } } }
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; } }
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); } }
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); }
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)); } }
public void MyLogic(ActionEventArgs args) { if (DoerIsPlayer) { DialogGroup group = new DialogGroup(); Dialog dialog = new Dialog(); dialog.RawText = "You give " + args.Target.FirstName + " a warm hug."; dialog.Image = Game.Instance.ResourceController.GetActionImage(this, @"person\hug\", true); group.Entries.Add(dialog); Game.Instance.DialogController.DrawDialog(group); } }
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); } } }
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; }
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); } }
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)); } }
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); } }
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)); } } }
public static void ReportSaleFinish(object sender, ActionEventArgs<Sale> args) { var sale = args.EventInfo; if (sale.LastBid != null) { Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine("sale #" + sale.Number + " finished!\tWinnwer:\t" + (sale.Buyer == null ? "none" : sale.Buyer.Login) + "\tPRICE: " + sale.CurrentPrice); Console.ForegroundColor = ConsoleColor.Gray; return; } Console.ForegroundColor = ConsoleColor.DarkGreen; Console.WriteLine("sale #" + sale.Number + " finished with no bids :("); Console.ForegroundColor = ConsoleColor.Gray; }
public override bool MouseUpHandler(object sender, ActionEventArgs e) { if (Modiafiable is ISelectable && Modiafiable != null) { try { // ExecuteMoveCommand(); } catch { } ((ISelectable)Modiafiable).IsSelected = false; c1 = null; c2 = null; diff = null; Modiafiable = null; _presenter.NotifyViews(); } return true; }
void Action_AfterPerform(object sender, ActionEventArgs e) { uPowers.BusinessLogic.Action a = (uPowers.BusinessLogic.Action)sender; if (a.Alias == "ProjectUp") { var contentService = UmbracoContext.Current.Application.Services.ContentService; var content = contentService.GetById(e.ItemId); if (content.GetValue<bool>("approved") == false && uPowers.Library.Xslt.Score(content.Id, "powersProject") >= 15) { content.SetValue("approved", true); contentService.SaveAndPublishWithStatus(content); } } }
private void ActionSelected(object sender, ActionEventArgs e) { string s = e.Action; switch (s) { case "View Inspection": { ViewInspection(); break; } default: { break; } } }
private void ActionSelected(object sender, ActionEventArgs e) { string s = e.Action; switch (s) { case "Execute Query": { BindGridToQuery(); break; } default: { break; } } }
private void Actions_ActionExecuting(object sender, ActionEventArgs e) { string currentStatus = string.Empty; string manager = WorkflowContext.Current.DataFields["Manager"].AsString(); string orderNum = WorkflowContext.Current.DataFields["Order Number"].AsString(); bool isReject = false, isToCfo = false; NameCollection cfoTaskUsers = new NameCollection(); NameCollection faTaskUsers = new NameCollection(); CheckNextApprove(ref cfoTaskUsers, ref faTaskUsers, e, manager, ref currentStatus, ref orderNum, ref isReject, ref isToCfo); UpdateWorkflowVariable(cfoTaskUsers, faTaskUsers, isReject, isToCfo); UpdateWorkFlowDataFields((isToCfo && cfoTaskUsers.Count > 0) ? cfoTaskUsers[0] : manager, currentStatus, orderNum); SendMailAndSaveApprovers(e, isReject); WorkFlowUtil.UpdateWorkflowPath(WorkflowContext.Current); }
/// <summary> /// 发送邮件和保存数据 /// </summary> /// <param name="e"></param> protected void SendMailAndSaveApprovers(ActionEventArgs e, bool isReject) { //当拒绝和确认时,验证事件和发送邮件 if (e.Action == "Reject" || e.Action == "Confirm") { if (!Validate(e.Action, e)){ return; } SendMail(isReject); } //当条件满足,保存审批信息 if (e.Action == "Approve" || e.Action == "Confirm" || e.Action == "To CFO") { SaveToApprovers(); } }
private void Actions_ActionExecuting(object sender, ActionEventArgs e) { string currentStatus = string.Empty; string manager = WorkflowContext.Current.DataFields["Manager"].AsString(); string vendorID = WorkflowContext.Current.DataFields["Vendor ID"].AsString(); int paymentTerm = Convert.ToInt32(WorkflowContext.Current.DataFields["PaymentTerm"].AsString()); bool isReject = false, isToCfo = false; NameCollection cfoTaskUsers = new NameCollection(); NameCollection faTaskUsers = new NameCollection(); CheckNextApprove(paymentTerm, ref cfoTaskUsers, ref faTaskUsers, e, manager, ref currentStatus, ref vendorID, ref isReject, ref isToCfo); UpdateWorkflowVariable(cfoTaskUsers, faTaskUsers, isReject, isToCfo); UpdateWorkFlowDataFields((isToCfo && cfoTaskUsers.Count > 0) ? cfoTaskUsers[0] : manager, currentStatus, vendorID); SendMailAndSaveApprovers(e, isReject); WorkFlowUtil.UpdateWorkflowPath(WorkflowContext.Current); }
private void OnSingleQuoteLiteral(object sender, ActionEventArgs args) { Debug.Assert(args.Value == "''"); _currentDataString.Append("\'"); }
private void OnDataCharacter(object sender, ActionEventArgs args) { Debug.Assert(args.Value.Length == 1); _currentDataString.Append(args.Value); }
public virtual void DoAction(object sender, ActionEventArgs args) { this.List.Add(args?.Value); }
private void OnDataString(object sender, ActionEventArgs args) { _currentDataObjects.Push(IcuDataObject.CreateText(_currentDataString.ToString())); _currentDataString = new StringBuilder(); }
protected override async Task OnWillAppear(ActionEventArgs <AppearancePayload> args) { var tokens = args.Action.Split("."); var number = int.Parse(tokens[^ 1]);
private void OnExpression(object sender, ActionEventArgs args) { Console.Out.WriteLine("expression: {0} = {1}", args.Value, numberStack.Peek()); }
private void OnSimpleDifference(object sender, ActionEventArgs args) { AddXmlNodeWithData(_currentOperators.Pop()); }
/// ----------------------------------------------------------------------------- /// <summary> /// ActionButtonClick handles the Action event of the contained ActionCommandButton(s) /// </summary> private void ActionButtonClick(object sender, ActionEventArgs e) { OnAction(e); }
/// <summary> /// 开始绘制 /// </summary> /// <param name="gs"></param> private void A_DrawStartEvent(ActionEventArgs gs) { this.drawingControl.AddTemporaryVisual(sublineGeometry); }
/// <summary> /// 绘制完成 /// </summary> /// <param name="gs"></param> private void A_DrawCompleteEvent(ActionEventArgs gs) { this.drawingControl.RemoveTemporaryVisual(sublineGeometry); this.Tip.SetHide(); }
void OnActionRemoved(object s, ActionEventArgs args) { args.Action.ObjectChanged -= changedEvent; Fill(); NotifyModified(); }
private void OnCharacterSet(object sender, ActionEventArgs args) { Debug.Assert(_currentCharacterSet == null); _currentCharacterSet = args.Value; }
protected override async Task OnSendToPlugin(ActionEventArgs <JObject> args) { InitializeSettings(args.Payload.ToObject <PresetToggleSettings>()); await UpdateImage(); }
private void OnElementWithData(object sender, ActionEventArgs args) { Debug.Assert(sender is Rule); AddXmlNodeWithData(((Rule)sender).ID); }
protected override Task OnSendToPlugin(ActionEventArgs <JObject> args) { setValues(args.Payload); _ = UpdateImage(); return(Task.CompletedTask); }
public void Realize() { var num = (int) ActionHandler.Invoke(sender: UIObject, actionInfo: ActionEventArgs.GetDefault(action: "WaitForReady")); Pattern.Realize(); }
protected override Task OnKeyDown(ActionEventArgs<KeyPayload> args) { if (toggleEvent.HasValue) flightConnector.Trigger(toggleEvent.Value, toggleEventData ?? 0); return Task.CompletedTask; }
private void OnInteger(object sender, ActionEventArgs args) { Console.Out.WriteLine("integer: {0}", args.Value); numberStack.Push(int.Parse(args.Value)); }
protected override Task OnWillDisappear(ActionEventArgs<AppearancePayload> args) { flightConnector.GenericValuesUpdated -= FlightConnector_GenericValuesUpdated; DeRegisterValues(); return Task.CompletedTask; }
private void BindingActionEvent(object sender, ActionEventArgs e) { OnAction?.Invoke(this, e); }
void ActionPerformed(object source, ActionEventArgs args) { Logger.logMessage = args.LogMessage; }
public Messages NormalOneDataCollect(XmlNode node) { string action = node.Attributes["action"].Value; string card = node["code"].InnerText; string res = node["resource"].InnerText; string usr = node["user"].InnerText; string data = node["data"].InnerText; string[] ss = data.Split(';'); object[] datas = new object[ss.Length]; for (int i = 0; i < ss.Length; i++) { datas[i] = ss[i]; } Messages productmessages = new Messages(); try { //数据准备 productmessages.AddMessages(dataCollect.GetIDInfo(card)); ProductInfo product; if (productmessages.IsSuccess()) { product = (ProductInfo)productmessages.GetData().Values[0]; } else { return(productmessages); } ActionEventArgs eventArgs; switch (action) { case ActionType.DataCollectAction_OQCLotAddID: eventArgs = new OQCLotAddIDEventArgs(action, card, usr, res, data, OQCLotType.OQCLotType_Normal, false, 5000, true, product); productmessages.AddMessages(dataCollect.Action(eventArgs)); break; default: eventArgs = new ActionEventArgs(card, action, res, usr, product, datas); break; } //检查数据 if (productmessages.IsSuccess()) { DataCollectFacade df = new DataCollectFacade(); Simulation s2 = (Simulation)df.GetSimulation(card); if (s2 == null) { productmessages.Add(new Message(MessageType.Error, "天拉")); return(productmessages); } } else { return(productmessages); } return(productmessages); } catch (Exception e) { productmessages.Add(new Message(e)); return(productmessages); } }
private void OnTop(object sender, ActionEventArgs args) { // [top] is deprecated in ICU and not directly allowed in LDML // [top] is probably best rendered the same as [last regular] _currentDataObjects.Push(IcuDataObject.CreateElement("last_non_ignorable")); }
public void OnChannelAction(object sender, ActionEventArgs e) { OnMessage(ChatMessageType.Action, e.Data.Nick, e.Data.Message); }
private void OnIndirectPosition(object sender, ActionEventArgs args) { _currentDataObjects.Push(IcuDataObject.CreateElement(_currentIndirectPosition.ToString())); _currentIndirectPosition = new StringBuilder(); }
private void A_DrawTermimationEvent(ActionEventArgs gs) { this.drawingControl.RemoveTemporaryVisual(sublineGeometry); }
void OnAction(object sender, ActionEventArgs e) { Player.GlobalMessage("* " + e.Data.Nick + " " + e.ActionMessage); }
private void OnCharacter(object sender, ActionEventArgs args) { _currentCollationElement.Append(IcuEscape(args.Value)); }
protected override Task OnWillDisappear(ActionEventArgs <AppearancePayload> args) { timer.Stop(); return(Task.CompletedTask); }