/// <summary> /// Handles the MoveComplete event of the underlying Recordset, triggering the control's MoveComplete event. /// </summary> /// <param name="eventSender">The object which rises the event.</param> /// <param name="e">The arguments of the event.</param> void Recordset_MoveComplete(object eventSender, MoveCompleteEventArgs e) { EventStatusEnum status = e.Status; OnMoveComplete(e.Reason, ref status, e.Errors); e.Status = status; }
/// <summary> /// Handles the WillMove event of the underlying Recordset, triggering the control's WillMove event. /// </summary> /// <param name="eventSender">The object which rises the event.</param> /// <param name="e">The arguments of the event.</param> void Recordset_WillMove(object eventSender, MoveEventArgs e) { EventStatusEnum status = e.Status; OnWillMove(e.Reason, ref status); e.Status = status; }
/// <summary> /// Handles the RecordChangeComplete event of the underlying Recordset, triggering the control's RecordChangeComplete event. /// </summary> /// <param name="eventSender">The object which rises the event.</param> /// <param name="e">The arguments of the event.</param> void Recordset_RecordChangeComplete(object eventSender, RecordChangeCompleteEventArgs e) { EventStatusEnum status = e.Status; OnRecordChangeComplete(e.Reason, ref status, e.NumberOfRecords, e.Errors); e.Status = status; }
/// <summary> /// Handles the WillChangeRecord event of the underlying Recordset, triggering the control's WillChangeRecord event. /// </summary> /// <param name="eventSender">The object which rises the event.</param> /// <param name="e">The arguments of the event.</param> void Recordset_WillChangeRecord(object eventSender, RecordChangeEventArgs e) { EventStatusEnum status = e.Status; OnWillChangeRecord(e.Reason, ref status, e.NumberOfRecords); e.Status = status; }
/// <summary> /// Handles the FieldChangeComplete event of the underlying Recordset, triggering the control's FieldChangeComplete event. /// </summary> /// <param name="eventSender">The object which rises the event.</param> /// <param name="e">The arguments of the event.</param> void Recordset_FieldChangeComplete(object eventSender, FieldChangeCompleteEventArgs e) { EventStatusEnum status = e.Status; OnFieldChangeComplete(ref status, e.NumberOfFields, e.FieldValues, e.Errors); e.Status = status; }
/// <summary> /// Handles the WillChangeRecordset event of the underlying Recordset, triggering the control's WillChangeRecordset event. /// </summary> /// <param name="eventSender">The object which rises the event.</param> /// <param name="e">The arguments of the event.</param> void Recordset_WillChangeRecordset(object eventSender, RecordSetChangeEventArgs e) { EventStatusEnum status = e.Status; OnWillChangeRecordset(e.Reason, ref status); e.Status = status; }
/// <summary> /// Handles the WillChangeField event of the underlying Recordset, triggering the control's WillChangeField event. /// </summary> /// <param name="eventSender">The object which rises the event.</param> /// <param name="e">The arguments of the event.</param> void Recordset_WillChangeField(object eventSender, FieldChangeEventArgs e) { EventStatusEnum status = e.Status; OnWillChangeField(ref status, e.NumberOfFields, e.FieldValues); e.Status = status; }
/// <summary> /// The EndOfRecordset event is called when there is an attempt to move to a row past the end of the Recordset. /// </summary> /// <param name="moredata">Bool value that indicates if more data have been added to the ADORecordsetHelper.</param> /// <param name="status">A EventStatusEnum value that indicates the state of the ADORecordsetHelper in the moment that the event rose.</param> protected void OnEndOfRecordset(ref bool moredata, EventStatusEnum status) { if (EndOfRecordset != null) { EndOfRecordsetEventArgs eor = new EndOfRecordsetEventArgs(moredata, status); EndOfRecordset(this, eor); moredata = eor.MoreData; } }
/// <summary> /// The WillChangeField event is called before a pending operation changes the value of one or more Field objects in the ADORecordsetHelper. /// </summary> /// <param name="status">A EventStatusEnum value that indicates the state of the ADORecordsetHelper in the moment that the event rose.</param> /// <param name="numfields">Indicates the number of fields objects contained in the “fieldvalues” array.</param> /// <param name="fieldvalues">Array with the new values of the modified fields.</param> protected void OnWillChangeField(ref EventStatusEnum status, int numfields, object[] fieldvalues) { if (WillChangeField != null) { FieldChangeEventArgs args = new FieldChangeEventArgs(numfields, fieldvalues, status); WillChangeField(this, args); status = args.Status; } }
/// <summary> /// The FieldChangeComplete event is called after the value of one or more Field objects has changed. /// </summary> /// <param name="status">A EventStatusEnum value that indicates the state of the ADORecordsetHelper in the moment that the event rose.</param> /// <param name="numfields">Indicates the number of fields objects contained in the “fieldvalues” array.</param> /// <param name="fieldvalues">Array with the new values of the modified fields.</param> /// <param name="errors">Array containing all the errors occurred during the field change.</param> protected void OnFieldChangeComplete(ref EventStatusEnum status, int numfields, object[] fieldvalues, string[] errors) { if (FieldChangeComplete != null) { FieldChangeCompleteEventArgs args = new FieldChangeCompleteEventArgs(numfields, fieldvalues, errors, status); FieldChangeComplete(this, args); status = args.Status; } }
/// <summary> /// The OnWillChangeRecord event is called before one or more records (rows) in the Recordset change. /// </summary> /// <param name="reason">The reason of the change.</param> /// <param name="status">A EventStatusEnum value that indicates the state of the ADORecordsetHelper in the moment that the event rose.</param> /// <param name="numRecords">Value indicating the number of records changed (affected).</param> protected void OnWillChangeRecord(EventReasonEnum reason, ref EventStatusEnum status, int numRecords) { if (WillChangeRecord != null) { RecordChangeEventArgs args = new RecordChangeEventArgs(reason, numRecords, status); WillChangeRecord(this, args); status = args.Status; } }
/// <summary> /// OnWillChangeRecordset event is called before a pending operation changes the ADORecordsetHelper. /// </summary> /// <param name="reason">The reason of the change.</param> /// <param name="status">A EventStatusEnum value that indicates the state of the ADORecordsetHelper in the moment that the event rose.</param> protected void OnWillChangeRecordset(EventReasonEnum reason, ref EventStatusEnum status) { if (WillChangeRecordset != null) { RecordSetChangeEventArgs args = new RecordSetChangeEventArgs(reason, status); WillChangeRecordset(this, args); status = args.Status; } }
/// <summary> /// OnRecordsetChangeComplete event is called after the ADORecordsetHelper has changed. /// </summary> /// <param name="reason">The reason of the change.</param> /// <param name="status">A EventStatusEnum value that indicates the state of the ADORecordsetHelper in the moment that the event rose.</param> /// <param name="errors">Array containing all the errors occurred during the field change.</param> protected void OnRecordsetChangeComplete(EventReasonEnum reason, ref EventStatusEnum status, string[] errors) { if (RecordsetChangeComplete != null) { RecordSetChangeCompleteEventArgs args = new RecordSetChangeCompleteEventArgs(reason, errors, status); RecordsetChangeComplete(this, args); status = args.Status; } }
/// <summary> /// OnWillMove event is called before a pending operation changes the current position in the ADORecordsetHelper. /// </summary> /// <param name="reason">The reason of the change.</param> /// <param name="status">A EventStatusEnum value that indicates the state of the ADORecordsetHelper in the moment that the event rose.</param> protected void OnWillMove(EventReasonEnum reason, ref EventStatusEnum status) { if (WillMove != null) { MoveEventArgs args = new MoveEventArgs(reason, status); WillMove(this, args); status = args.Status; } }
/// <summary> /// OnMoveComplete event is called after the current position in the ADORecordsetHelper changes. /// </summary> /// <param name="reason">The reason of the change.</param> /// <param name="status">A EventStatusEnum value that indicates the state of the ADORecordsetHelper in the moment that the event rose.</param> /// <param name="errors">Array containing all the errors occurred during the field change.</param> protected void OnMoveComplete(EventReasonEnum reason, ref EventStatusEnum status, string[] errors) { if (MoveComplete != null) { MoveCompleteEventArgs args = new MoveCompleteEventArgs(reason, errors, status); MoveComplete(this, args); status = args.Status; } }
/// <summary> /// 改变事件状态 /// </summary> /// <param name="isEvent"></param> public void SetEventStatus(EventStatusEnum eventStatus) { mEventStatus = eventStatus; if (eventStatus == EventStatusEnum.EventEnd) { //保存数据 if (storyInfo != null) { GameDataBean gameData = GameDataHandler.Instance.manager.GetGameData(); gameData.AddTraggeredEvent(storyInfo.id); } if (mEventType != EventTypeEnum.StoryForMiniGameCooking) { //打开主界面UI UIHandler.Instance.manager.OpenUIAndCloseOther <UIGameMain>(UIEnum.GameMain); //恢复时间 GameTimeHandler.Instance.SetTimeRestore(); } //回复生成NPC //事件结束 操作回复 if (mEventType == EventTypeEnum.Story) { NpcHandler.Instance.RestoreBuildNpc(); GameControlHandler.Instance.StartControl <BaseControl>(ControlEnum.Normal); } else if (mEventType == EventTypeEnum.StoryForMiniGameCooking) { } else { GameControlHandler.Instance.RestoreControl(); } //初始化数据 InitData(); } else if (eventStatus == EventStatusEnum.EventIng) { //暂停生成NPC if (mEventType == EventTypeEnum.Story) { NpcHandler.Instance.StopBuildNpc(); } } }
public void InitData() { mEventStatus = EventStatusEnum.EventEnd; //通知事件结束 if (storyInfo == null) { notifyForEvent?.Invoke(NotifyEventTypeEnum.EventEnd, new object[] { -1 }); } else { notifyForEvent?.Invoke(NotifyEventTypeEnum.EventEnd, new object[] { storyInfo.id }); } //移除所有观察者 notifyForEvent = null; //显示重要NPC if (NpcHandler.Instance.buildForImportant) { NpcHandler.Instance.buildForImportant.ShowNpc(); } if (NpcHandler.Instance.builderForFamily) { NpcHandler.Instance.builderForFamily.ShowNpc(); } }
/// <summary> /// Creates a new FieldChangeEventArgs instance. /// </summary> /// <param name="numberOfFields">The number of fields affected.</param> /// <param name="fieldValues">The field's values before the change.</param> /// <param name="status">The status of the event.</param> public FieldChangeEventArgs(int numberOfFields, object[] fieldValues, EventStatusEnum status) : this(numberOfFields, fieldValues, null, status) { }
/// <summary> /// Creates a new RecordChangeCompleteEventArgs instance. /// </summary> /// <param name="reason">The reason of the change.</param> /// <param name="numberOfRecords">The number of fields affected.</param> /// <param name="errors">The errors ocurred during the operation.</param> /// <param name="status">The status of the event.</param> public RecordChangeCompleteEventArgs(EventReasonEnum reason, int numberOfRecords, string[] errors, EventStatusEnum status) : base(reason, numberOfRecords, errors, status) { }
/// <summary> /// Creates a new EndOfRecordsetEventArgs instance. /// </summary> /// <param name="moreData">Indicates if there are more data to get.</param> /// <param name="status">The status of the event</param> public EndOfRecordsetEventArgs(bool moreData, EventStatusEnum status) : base(status) { _moreData = moreData; }
/// <summary> /// Creates a new RecordChangeEventArgs instance. /// </summary> /// <param name="reason">The reason of the change.</param> /// <param name="numberOfRecords">The number of fields affected.</param> /// <param name="errors">The errors ocurred during the operation.</param> /// <param name="status">The status of the event.</param> protected RecordChangeEventArgs(EventReasonEnum reason, int numberOfRecords, string[] errors, EventStatusEnum status) : base(status, errors) { this.reason = reason; this.numberOfRecords = numberOfRecords; }
/// <summary> /// Creates a new instance. /// </summary> /// <param name="status">The status of the event.</param> protected BaseAdoEventArgs(EventStatusEnum status) : this(status, new string[] { }) { }
/// <summary> /// Creates a new RecordSetChangeEventArgs instance. /// </summary> /// <param name="reason">The reason of the change.</param> /// <param name="status">The status of the event.</param> public RecordSetChangeEventArgs(EventReasonEnum reason, EventStatusEnum status) : this(reason, null, status) { }
/// <summary> /// Creates a new RecordSetChangeEventArgs instance. /// </summary> /// <param name="reason">The reason of the change.</param> /// <param name="errors">The errors ocurred during the operation.</param> /// <param name="status">The status of the event.</param> protected RecordSetChangeEventArgs(EventReasonEnum reason, string[] errors, EventStatusEnum status) : base(status, errors) { this.reason = reason; }
/// <summary> /// Creates a new RecordSetChangeCompleteEventArgs instance. /// </summary> /// <param name="reason">The reason of the change.</param> /// <param name="errors">The errors ocurred during the operation.</param> /// <param name="status">The status of the event.</param> public RecordSetChangeCompleteEventArgs(EventReasonEnum reason, string[] errors, EventStatusEnum status) : base(reason, errors, status) { }
/// <summary> /// Creates a new RecordChangeEventArgs instance. /// </summary> /// <param name="reason">The reason of the change.</param> /// <param name="numberOfRecords">The number of fields affected.</param> /// <param name="status">The status of the event.</param> public RecordChangeEventArgs(EventReasonEnum reason, int numberOfRecords, EventStatusEnum status) : this(reason, numberOfRecords, null, status) { }
/// <summary> /// Creates a new EndOfRecordsetEventArgs instance. /// </summary> /// <param name="moreData">Indicates if there are more data to get.</param> /// <param name="status">The status of the event</param> public EndOfRecordsetEventArgs(bool moreData, EventStatusEnum status) : base(status) { this.moreData = moreData; }
/// <summary> /// Creates a new instance. /// </summary> /// <param name="status">The status of the event.</param> /// <param name="errors">The errors on the operation.</param> protected BaseAdoEventArgs(EventStatusEnum status, string[] errors) { this.adStatus = status; this.errors = errors; }
/// <summary> /// Creates a new MoveCompleteEventArgs instance. /// </summary> /// <param name="reason">The reason of the move.</param> /// <param name="errors">The errors ocurred during the operation.</param> /// <param name="status">The status of the event.</param> public MoveCompleteEventArgs(EventReasonEnum reason, string[] errors, EventStatusEnum status) : base(reason, errors, status) { }
/// <summary> /// Creates a new FieldChangeEventArgs instance. /// </summary> /// <param name="numberOfFields">The number of fields affected.</param> /// <param name="fieldValues">The field's values before the change.</param> /// <param name="errors">The errors ocurred during the operation.</param> /// <param name="status">The status of the event</param> protected FieldChangeEventArgs(int numberOfFields, object[] fieldValues, string[] errors, EventStatusEnum status) : base(status, errors) { this.numberOfFields = numberOfFields; this.fieldValues = fieldValues; }
/// <summary> /// Creates a new instance. /// </summary> /// <param name="status">The status of the event.</param> /// <param name="errors">The errors on the operation.</param> protected BaseAdoEventArgs(EventStatusEnum status, string[] errors) { adStatus = status; this.errors = errors; }
/// <summary> /// Creates a new FieldChangeCompleteEventArgs instance. /// </summary> /// <param name="numberOfFields">The number of fields affected.</param> /// <param name="fieldValues">The field's values after the change.</param> /// <param name="errors">The errors ocurred during the operation.</param> /// <param name="status">The status of the event</param> public FieldChangeCompleteEventArgs(int numberOfFields, object[] fieldValues, string[] errors, EventStatusEnum status) : base(numberOfFields, fieldValues, errors, status) { }
/// <summary> /// Creates a new MoveEventArgs instance. /// </summary> /// <param name="reason">The reason of the move.</param> /// <param name="status">The status of the event.</param> public MoveEventArgs(EventReasonEnum reason, EventStatusEnum status) : this(reason, null, status) { }
/// <summary> /// Move the current record according to the value of “records”. /// </summary> /// <param name="records">The number of records to move forward (if positive), backwards (if negative).</param> /// <param name="reason">The reason of the change.</param> /// <param name="status">An EventStatusEnum value that indicates the state of the ADORecordsetHelper in the moment that the event rose.</param> private void Move(int records, EventReasonEnum reason, EventStatusEnum status) { //if ((!UsingView && Tables[0].Rows.Count == 0) || (UsingView && currentView.Count == 0)) //{ // throw new InvalidOperationException("Requested operation requires a current record"); //} OnWillMove(reason, ref status); string[] errors = null; if (status != EventStatusEnum.adStatusCancel) { try { if (records != 0 && index >= 0) { Update(false); } BasicMove(index + records); if (eof && reason != EventReasonEnum.adRsnMoveFirst && reason != EventReasonEnum.adRsnMovePrevious) { EndOfRecordsetLogic(); } //else //{ // eof = false; //} } catch (Exception e) { errors = new string[] { e.Message }; status = EventStatusEnum.adStatusErrorsOccurred; } OnMoveComplete(reason, ref status, errors); } }
/// <summary> /// Creates a new MoveEventArgs instance. /// </summary> /// <param name="reason">The reason of the move.</param> /// <param name="errors">The errors ocurred during the operation.</param> /// <param name="status">The status of the event.</param> protected MoveEventArgs(EventReasonEnum reason, string[] errors, EventStatusEnum status) : base(status, errors) { this.reason = reason; }
/// <summary> /// OnWillMove event is called before a pending operation changes the current position in the ADORecordsetHelper. /// </summary> /// <param name="reason">The reason of the change.</param> /// <param name="status">An EventStatusEnum value that indicates the state of the ADORecordsetHelper in the moment that the event rose.</param> protected void OnWillMove(EventReasonEnum reason, ref EventStatusEnum status) { firstChange = true; if (WillMove != null) { MoveEventArgs args = new MoveEventArgs(reason, status); WillMove(this, args); status = args.Status; firstChange = status == EventStatusEnum.adStatusCancel ? false : true; } }