public Activity(ActivitySys mgr, ResDT_WealCommon config) { this._sys = mgr; this._config = config; this._phaseList = new ListView <ActivityPhase>(); this._timeState = Activity.TimeState.InHiding; this._secondSpan = 0; }
public virtual bool CheckTimeState() { CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (masterRoleInfo == null) { return(false); } bool flag = false; Activity.TimeState timeState; if (this.TimeType == null || this.TimeType == 2 || this.TimeType == 3) { if (this.TimeType == 2 && ((ulong)masterRoleInfo.AccountRegisterTime < (ulong)this.StartTime || (ulong)masterRoleInfo.AccountRegisterTime > (ulong)this.CloseTime)) { timeState = Activity.TimeState.Close; } else { long num = (long)CRoleInfo.GetCurrentUTCTime(); this._secondSpan = (int)(num - this.ShowTime); if (this._secondSpan < 0) { this._secondSpan = -this._secondSpan; timeState = Activity.TimeState.InHiding; } else { this._secondSpan = (int)(num - this.StartTime); if (this._secondSpan < 0) { timeState = Activity.TimeState.ForeShow; this._secondSpan = -this._secondSpan; } else { this._secondSpan = (int)(num - this.CloseTime); if (this._secondSpan <= 0) { timeState = Activity.TimeState.Going; this._secondSpan = -this._secondSpan; } else { timeState = Activity.TimeState.Close; } } } } } else { if (this.TimeType != 1) { return(false); } timeState = Activity.TimeState.Going; } Activity.TimeState timeState2 = this._timeState; if (timeState != this._timeState) { this._timeState = timeState; flag = true; } if (this._timeState == Activity.TimeState.Going || timeState2 == Activity.TimeState.Going) { for (int i = 0; i < this.PhaseList.get_Count(); i++) { if (this.PhaseList.get_Item(i).CheckTimeState()) { flag = true; } } } if (flag) { this.NotifyTimeStateChanged(); } return(flag); }