private async Task RunAddStatsAsync(AddStats.RunInfo runInfo) { if (!runInfo.Week.HasValue) { await _engine.Stats.AddMissingAsync(); return; } var earliestAvailable = new WeekInfo(2010, 1); var latestAvailable = await _engine.GetLatestWeekAsync(); var specifiedWeek = runInfo.Week.Value; if (specifiedWeek < earliestAvailable) { throw new InvalidOperationException($"Cannot add stats for week '{specifiedWeek}'. " + $"The earliest available week is '{earliestAvailable}'."); } if (specifiedWeek > latestAvailable) { throw new InvalidOperationException($"Cannot add stats for week '{specifiedWeek}'. " + $"The latest available week is '{latestAvailable}'."); } await _engine.Stats.AddForWeekAsync(specifiedWeek); }
public Task <WeekMatchupsVersioned> MapAsync(string httpResponse, WeekInfo week) { XElement weekGameXml = XElement.Parse(httpResponse); XElement gamesNode = weekGameXml.Elements("gms").Single(); var model = new WeekMatchupsVersioned { Week = week, Games = new List <WeekMatchupsVersioned.Game>() }; foreach (XElement game in gamesNode.Elements("g")) { int homeTeamId = Teams.GetIdFromAbbreviation(game.Attribute("h").Value, includePriorLookup: true); int awayTeamId = Teams.GetIdFromAbbreviation(game.Attribute("v").Value, includePriorLookup: true); string nflGameId = game.Attribute("eid").Value; string gsisGameId = game.Attribute("gsis").Value; var matchup = new WeekMatchupsVersioned.Game { HomeTeamId = homeTeamId, AwayTeamId = awayTeamId, NflGameId = nflGameId, GsisGameId = gsisGameId }; model.Games.Add(matchup); } return(Task.FromResult(model)); }
/// <summary> /// Return null if there are no more subjects /// </summary> private SubjectInfo ParseRowsOfSubject(IExcelDataReader reader) { var subject = new SubjectInfo() { Days = new List <SchoolDayInfo>() }; const int weekCount = 2; bool isEvenWeek = false; for (int week = 1; week <= weekCount; week++, isEvenWeek = !isEvenWeek) { WeekInfo weekInfo = ParseWeek(reader, isEvenWeek); if (weekInfo == null) { return(null); } if (isEvenWeek) { string fromToShared = weekInfo.SubjectSection; FillFromTo(subject, fromToShared); } else { subject.Title = weekInfo.SubjectSection; subject.Teachers = weekInfo.TeachersSection; } weekInfo.Days.ForEach(d => d.IsDayOfEvenWeek = isEvenWeek); subject.Days.AddRange(weekInfo.Days); } return(subject); }
private static List <PlayerWeekStatsVersioned.Player> GetPlayers(JObject playersObject, WeekInfo week, Dictionary <string, int> playerTeamMap) { var result = new List <PlayerWeekStatsVersioned.Player>(); foreach (var p in playersObject) { string nflId = p.Key; var statsObject = SourceJsonReader.GetStatsObjectForPlayer(p.Value, week); Dictionary <WeekStatType, double> stats = SourceJsonReader.ResolveStatsMapFromObject(statsObject); var player = new PlayerWeekStatsVersioned.Player { NflId = nflId, Stats = stats }; if (playerTeamMap.TryGetValue(nflId, out int teamId)) { player.TeamId = teamId; } result.Add(player); } return(result); }
public void PopulateWeek() { DateTime startDate = DateTime.Today.Date.AddDays(-14); DateTime endDate = startDate.AddDays(6); using (WeekInfoRepository repository = new WeekInfoRepository()) { for (int i = 0; i < 200; i++) { WeekInfo weekInfo = new WeekInfo { StartDate = startDate, EndDate = endDate }; string label = string.Empty; label = startDate.ToString("MMM") + "-Week " + GetWeekOfMonth(startDate); if (startDate.Month != endDate.Month) { label += " / " + endDate.ToString("MMM") + "-Week 1"; } weekInfo.Label = label; //string label = startDate. repository.Insert(weekInfo); startDate = startDate.AddDays(7); endDate = endDate.AddDays(7); } } }
public async Task <Func <string, Guid> > GetAsync(int teamId, WeekInfo week) { Dictionary <string, Guid> map = await GetNameIdMapAsync(teamId, week); return((string search) => { var normalized = Normalize(search); IEnumerable <KeyValuePair <string, Guid> > searchNames = map .Where(kv => kv.Key[0] == normalized[0] && kv.Key[kv.Key.Length - 1] == normalized[normalized.Length - 1]); // get min dist for all search names, pick lowest. // todo for case where more than one min var results = new List <(int min, Guid playerId)>(); foreach (var searchKv in searchNames) { int minOperations = EditDistance.Find(normalized, searchKv.Key); results.Add((minOperations, searchKv.Value)); } IGrouping <int, (int min, Guid playerId)> minGroup = results.GroupBy(r => r.min).OrderBy(g => g.Key).First(); if (minGroup.Count() > 1) { throw new InvalidOperationException($"Failed to match '{search}' (normalized to '{normalized}') to only one existing player."); } return minGroup.Single().playerId; }); }
/// <summary> /// 获取所有周的信息 /// </summary> /// <returns></returns> public static List <WeekInfo> GetWeekInfo() { List <WeekInfo> weekInfoList = new List <WeekInfo>(); MySqlConnection con = new MySqlConnection(ConnectionString); try { con.Open(); MySqlDataReader reader = MySqlHelper.ExecuteReader(con, "select * from WeekStartEndDay "); while (reader.Read()) { WeekInfo w = new WeekInfo(); w.Year = int.Parse(reader["YearNum"].ToString()); w.Week = int.Parse(reader["WeekNum"].ToString()); w.YearWeek = int.Parse(reader["YearWeek"].ToString()); w.WeekEnd = DateTime.Parse(reader["WeekEnd"].ToString()); w.WeekStart = DateTime.Parse(reader["WeekStart"].ToString()); weekInfoList.Add(w); } reader.Close(); } catch (MySqlException e) { Logger.Error("查询WeekInfo出错。", e); } finally { con.Close(); } return(weekInfoList); }
protected override void OnInitialized() { Start = new DateTime(Year, Month, 1); while (Start.DayOfWeek != DayOfWeek.Monday) { Start = Start.AddDays(-1); } End = new DateTime(Year, Month, 1).LastDayOfMonth(); while (End.DayOfWeek != DayOfWeek.Sunday) { End = End.AddDays(1); } Current = Start; Weeks = new List <WeekInfo>(); while (Start <= End) { var current = Start; var week = new WeekInfo(); while (current.DayOfWeek != DayOfWeek.Sunday) { var d = new DayInfo { Day = current }; week.Days.Add(d); current = current.AddDays(1); } Weeks.Add(week); Start = Start.AddDays(7); } }
WeekInfo[] ReadInFreqs() { if (ecgType == levelOfDetail.flinders) { info = Resources.LoadAll("flindersdata", typeof(TextAsset)); } else { info = Resources.LoadAll("weeklydata", typeof(TextAsset)); } nbrWeeks = info.Length; WeekInfo[] allWeeks = new WeekInfo[nbrWeeks]; WeekInfo[] sortedAllWeeks = new WeekInfo[nbrWeeks]; int ixWeek = 0; //Debug.Log("nbr of plts is " + nbrWeeks); foreach (TextAsset fname in info) { allWeeks[ixWeek] = readInFile(fname); ixWeek += 1; } // need to sort array of structs sortedAllWeeks = allWeeks.OrderByDescending(x => x.weekNbr).ToArray(); return(sortedAllWeeks); }
public async Task <List <string> > GetPlayerNflIdsAsync(WeekInfo week) { Logger.LogDebug($"Getting all player's NFL ids that played in week '{week}'."); List <Guid> playerIds = await DbConnection.UnionSelect <Guid>() .From <WeekStatsIdpSql>(sb => sb.Property(s => s.PlayerId).Where(s => s.Season == week.Season && s.Week == week.Week)) .From <WeekStatsKickSql>(sb => sb.Property(s => s.PlayerId).Where(s => s.Season == week.Season && s.Week == week.Week)) .From <WeekStatsMiscSql>(sb => sb.Property(s => s.PlayerId).Where(s => s.Season == week.Season && s.Week == week.Week)) .From <WeekStatsPassSql>(sb => sb.Property(s => s.PlayerId).Where(s => s.Season == week.Season && s.Week == week.Week)) .From <WeekStatsReceiveSql>(sb => sb.Property(s => s.PlayerId).Where(s => s.Season == week.Season && s.Week == week.Week)) .From <WeekStatsReturnSql>(sb => sb.Property(s => s.PlayerId).Where(s => s.Season == week.Season && s.Week == week.Week)) .From <WeekStatsRushSql>(sb => sb.Property(s => s.PlayerId).Where(s => s.Season == week.Season && s.Week == week.Week)) .ExecuteAsync(); List <PlayerSql> players = await DbConnection .Select <PlayerSql>( p => p.Id, p => p.NflId) .ExecuteAsync(); Dictionary <Guid, string> idMap = players.ToDictionary(p => p.Id, p => p.NflId); return(playerIds .Where(id => idMap.ContainsKey(id)) .Select(id => idMap[id]) .ToList()); }
public int MoveWorkItemToPrevious(WorkItemDto workItemDto) { if (workItemDto == null) { throw new ArgumentNullException(nameof(workItemDto), "WorkItem cannot be null"); } int workItemWeekId = workItemDto.WeekId; int previousWeekId = -1; using (WeekInfoRepository weekInfoRepository = new WeekInfoRepository()) { WeekInfo weekInfo = weekInfoRepository.Find(x => x.Id == workItemWeekId); if (weekInfo == null) { throw new Exception("Week not found."); } DateTime startDate = weekInfo.StartDate; DateTime nextDate = startDate.AddDays(-7); weekInfo = weekInfoRepository .Find(x => DbFunctions.TruncateTime(x.StartDate) == nextDate); if (weekInfo == null) { throw new Exception("Next Week not found."); } previousWeekId = weekInfo.Id; } using (WorkItemRepository workItemRepository = new WorkItemRepository()) { UserWorkItem workItem = workItemRepository.Find(x => x.Id == workItemDto.Id); if (workItem == null) { throw new Exception("Work Item not found"); } // Validate if work item already exists in previous week. UserWorkItem previousWeekWorkItem = workItemRepository .Find(x => x.TaskId == workItemDto.TaskId && x.WeekId == previousWeekId && x.ServerId == workItemDto.ServerId); if (previousWeekWorkItem != null) { workItemRepository.Delete(previousWeekWorkItem); } workItem.WeekId = previousWeekId; workItem.State = WorkItemState.New; int nextWorkItemId = workItemRepository.Insert(workItem); UserWorkItem currentWorkItem = workItemRepository.Find(x => x.Id == workItemDto.Id); // update the current work item. currentWorkItem.State = WorkItemState.Moved; workItemRepository.Update(currentWorkItem); return(nextWorkItemId); } }
public List <WorkItemDto> GetUserSyncedTasksByDateRange(DateTime fromDate, DateTime endDate, string userId, bool includeIncompleteItems = false) { List <WorkItemDto> workItemDtos = new List <WorkItemDto>(); if (fromDate.Date > DateTime.Today.Date.AddDays(7)) { return(workItemDtos); } if (endDate.Date < fromDate.Date) { return(workItemDtos); } WeekInfo currentWeekInfo = null; List <int> weekIdRange = new List <int>(); using (WeekInfoRepository repository = new WeekInfoRepository()) { currentWeekInfo = repository.GetCurrentWeekInfo(); if (currentWeekInfo == null) { throw new Exception("Current Week is not registered."); } IQueryable <WeekInfo> weekItems = repository.FilterLocal( x => DbFunctions.TruncateTime(x.StartDate) >= fromDate && DbFunctions.TruncateTime(x.EndDate) <= endDate); weekIdRange = weekItems.Select(x => x.Id).ToList(); } if (weekIdRange.Count == 0 && !includeIncompleteItems) { return(workItemDtos); } // Get Current Week Tasks. if (weekIdRange.Contains(currentWeekInfo.Id)) { List <WorkItemDto> userWorkItems = GetUserCurrentWeekSyncedTasks(userId, includeIncompleteItems); workItemDtos.AddRange(userWorkItems); weekIdRange = weekIdRange.Except(new List <int>() { currentWeekInfo.Id }).ToList(); } // Get other week Tasks. using (WorkItemRepository repository = new WorkItemRepository()) { List <WorkItemDto> otherWeekWorkItems = repository.Filter(x => weekIdRange.Contains(x.WeekId)).ToList() .Select(x => x.ToDto(x.Id)).ToList(); workItemDtos.AddRange(otherWeekWorkItems); } return(workItemDtos); }
private void DeleteEmptyPeriodsAndEmptyDays(WeekInfo week) { // clean periods week.Days.ForEach(day => day.Periods.RemoveAll(period => string.IsNullOrWhiteSpace(period.UpperInfo) && string.IsNullOrWhiteSpace(period.LowerInfo))); // clean days week.Days.RemoveAll(day => !day.Periods.Any()); }
public async Task <List <WeekMatchup> > GetAsync(WeekInfo week) { Logger.LogDebug($"Retrieving week matchups for week '{week}' from '{MetadataResolver.TableName<WeekGameMatchupSql>()}' table."); List <WeekGameMatchupSql> matchups = await DbConnection.Select <WeekGameMatchupSql>() .Where(m => m.Season == week.Season && m.Week == week.Week) .ExecuteAsync(); return(matchups.Select(WeekGameMatchupSql.ToCoreEntity).ToList()); }
public async Task <List <TeamWeekStats> > GetAsync(WeekInfo week) { Logger.LogDebug($"Getting team stats for '{week}' from '{MetadataResolver.TableName<TeamGameStatsSql>()}' table."); List <TeamGameStatsSql> sqlEntries = await DbConnection.Select <TeamGameStatsSql>() .Where(s => s.Season == week.Season && s.Week == week.Week) .ExecuteAsync(); return(sqlEntries.Select(TeamGameStatsSql.ToCoreEntity).ToList()); }
public int CopyWorkItemToNext(WorkItemDto workItemDto) { if (workItemDto == null) { throw new ArgumentNullException(nameof(workItemDto), "WorkItem cannot be null"); } int workItemWeekId = workItemDto.WeekId; int nextWeekId = -1; using (WeekInfoRepository weekInfoRepository = new WeekInfoRepository()) { WeekInfo weekInfo = weekInfoRepository.Find(x => x.Id == workItemWeekId); if (weekInfo == null) { throw new Exception("Week not found."); } DateTime startDate = weekInfo.StartDate; DateTime nextDate = startDate.AddDays(7); weekInfo = weekInfoRepository .Find(x => DbFunctions.TruncateTime(x.StartDate) == nextDate); if (weekInfo == null) { throw new Exception("Next Week not found."); } nextWeekId = weekInfo.Id; } using (WorkItemRepository workItemRepository = new WorkItemRepository()) { UserWorkItem workItem = workItemRepository.Find(x => x.Id == workItemDto.Id); if (workItem == null) { throw new Exception("Work Item not found"); } // Validate if work item already exists in next week. UserWorkItem nextWeekWorkItem = workItemRepository .Find(x => x.TaskId == workItemDto.TaskId && x.WeekId == nextWeekId && x.ServerId == workItemDto.ServerId); if (nextWeekWorkItem != null) { workItemRepository.Delete(nextWeekWorkItem); } // Clone the work item. workItem.WeekId = nextWeekId; workItem.State = WorkItemState.New; int nextWorkItemId = workItemRepository.Insert(workItem); return(nextWorkItemId); } }
/// <summary> /// Add stats for the specified week. /// </summary> public Task AddForWeekAsync(WeekInfo week) { var context = new AddForWeekPipeline.Context { Week = week }; var pipeline = _serviceProvider.Create <AddForWeekPipeline>(); return(pipeline.ProcessAsync(context)); }
WeekInfo[] AddtoWeekInfoArray(WeekInfo[] vArray, WeekInfo newValue) { int newLength = vArray.Length + 1; WeekInfo[] result = new WeekInfo[newLength]; for (int i = 0; i < vArray.Length; i++) { result[i] = vArray[i]; } result[newLength - 1] = newValue; return(result); }
public async Task <bool> HasUpdatedWeekAsync(WeekInfo week) { var collectionName = CollectionResolver.GetName <UpdateLogDocument>(); var builder = Builders <UpdateLogDocument> .Filter; var filter = builder.Eq(l => l.Season, week.Season) & builder.Eq(l => l.Week, week.Week); UpdateLogDocument log = await GetMongoDbContext().FindOneAsync(filter); return(log != null); }
public Task AddAsync(WeekInfo week) { Logger.LogDebug("Adding update log for {Week}.", week); var log = new UpdateLogSql { Season = week.Season, Week = week.Week, UpdateTime = DateTime.Now }; return(DbConnection.Insert(log).ExecuteAsync()); }
public static JObject GetStatsObjectForPlayer(JToken playerValue, WeekInfo week) { var playerObject = playerValue as JObject; var statsObject = playerObject?.SelectToken($"stats.week.{week.Season}.{week.Week}") as JObject; if (statsObject == null) { throw new InvalidOperationException($"Failed to read the Stats JObject from the player object."); } return(statsObject); }
public async Task <PlayerWeekStatsVersioned> MapAsync(string httpResponse, WeekInfo week) { JObject playersObject = SourceJsonReader.GetPlayersObject(httpResponse); Dictionary <string, int> playerTeamMap = await _teamStatsCache.GetPlayerTeamMapAsync(week); var players = GetPlayers(playersObject, week, playerTeamMap); return(new PlayerWeekStatsVersioned { Week = week, Players = players }); }
public async Task <List <TeamWeekStats> > GetAsync(WeekInfo week) { var collectionName = CollectionResolver.GetName <WeekStatsTeamDocument>(); var builder = Builders <WeekStatsTeamDocument> .Filter; var filter = builder.Eq(s => s.Season, week.Season) & builder.Eq(s => s.Week, week.Week); List <WeekStatsTeamDocument> documents = await GetMongoDbContext().FindAsync(filter); Logger.LogDebug($"Retrieved team week stats for week '{week}' from '{collectionName}' collection."); return(documents.Select(WeekStatsTeamDocument.ToCoreEntity).ToList()); }
private Task <List <Guid> > GetPlayerIdsAsync(WeekInfo week, MongoDbContext mongoDbContext) { var builder = Builders <WeekStatsPlayerDocument> .Filter; var filter = builder.Eq(s => s.Season, week.Season) & builder.Eq(s => s.Week, week.Week); var findOptions = new FindOptions <WeekStatsPlayerDocument, Guid> { Projection = Builders <WeekStatsPlayerDocument> .Projection .Expression(p => p.PlayerId) }; return(mongoDbContext.FindAsync(filter, findOptions)); }
public async Task <List <string> > GetPlayerNflIdsAsync(WeekInfo week) { var collectionName = CollectionResolver.GetName <WeekStatsPlayerDocument>(); MongoDbContext mongoDbContext = GetMongoDbContext(); List <Guid> ids = await GetPlayerIdsAsync(week, mongoDbContext); Dictionary <Guid, string> idNflMap = await GetIdNflMapAsync(mongoDbContext); return(ids .Where(id => idNflMap.ContainsKey(id)) .Select(id => idNflMap[id]) .ToList()); }
public async Task AddAsync(WeekInfo week) { var collectionName = CollectionResolver.GetName <UpdateLogDocument>(); var log = new UpdateLogDocument { Season = week.Season, Week = week.Week, UpdateTime = DateTime.UtcNow }; await GetMongoDbContext().InsertOneAsync(log); Logger.LogDebug($"Successfully added update log for {week} to '{collectionName}' collection."); }
public IEnumerable <RealHoursPerWeekInfo> Get(int projectID, int nTop) { List <RealHoursPerWeekInfo> data = new List <RealHoursPerWeekInfo>(); Dictionary <string, int> realMinutes = DB.GetRealMinutesPerWeek(projectID, nTop); ProjectInfo project = DB.Projects.GetProject(projectID); bool isOK = false; WeekInfo w = new WeekInfo(DateTime.Today); int count = 0; while (!isOK) { string keyCandidate = w.StartDate.Year.ToString() + DTC.GetFullDigits(w.WeekNO, 2); if (realMinutes.ContainsKey(keyCandidate)) { decimal realHours = Convert.ToDecimal(DTC.Format2(Convert.ToDecimal(realMinutes[keyCandidate]) / 60)); data.Add(new RealHoursPerWeekInfo(w.StartDate.Year, w.WeekNO, realHours)); } else { data.Add(new RealHoursPerWeekInfo(w.StartDate.Year, w.WeekNO, 0)); } w = DTC.GetPreviousWeek(w); count++; if (count > 20 || w.StartDate < project.StartDate) { isOK = true; } } data.Reverse(); /* * foreach(string key in realMinutes.Keys) * { * int year = Convert.ToInt16(key.Substring(0, 4)); * int week = Convert.ToInt16(key.Substring(4, key.Length - 4)); * decimal realHours = Convert.ToDecimal(DTC.Format2(Convert.ToDecimal(realMinutes[key]) / 60)); * * data.Add(new RealHoursPerWeekInfo(year, week, realHours)); * } */ return(data); }
public void Condition_EqualsObjPropRef_WithAndOperator_Success() { var week = new WeekInfo { Season = 2019, Week = 1 }; Expression <Func <TestEntity, bool> > expr = e => e.Number1 == week.Season && e.Number2 == week.Week; string expected = "((number1 = 2019) AND (number2 = 1))"; string result = WhereConditionBuilder <TestEntity> .FromExpression(expr); Assert.Equal( expected.RemoveWhiteSpaces(), result.RemoveWhiteSpaces()); }
/// <summary> /// 获得年度周(星期)信息实体集合列表 /// </summary> /// <param name="year">需要计算的年份</param> /// <param name="jumpYear">年度第一周是否跳过跨年的周数</param> /// <returns>周(星期)信息实体集合列表对象</returns> public static IList <WeekInfo> WeekOfList(int year, bool jumpYear) { IList <WeekInfo> weekList = new List <WeekInfo>(); if (year <= 0001 || year >= 9999) { return(weekList); } int offset; DateTime firstDate = WeekOfFirstDay(year, jumpYear, out offset); //年度周一的日期 int index = 1; while (true) { if (index > 54) { break; } var weekInfo = new WeekInfo { Number = index, BeginDate = firstDate, EndDate = firstDate.AddDays(6) }; //周一 //周日 weekList.Add(weekInfo); firstDate = firstDate.AddDays(7); //下周 if (jumpYear) { if (firstDate.Year != year) { break; } } else { if (firstDate.AddDays(6).Year != year) { break; } } index++; } return(weekList); }
public IEnumerable <NewsInfo> Get(DTC.RangeEnum range, int parameter, string strDateStart, string strDateEnd) { DateTime dtStart = DateTime.Today; DateTime dtEnd = DateTime.Today; List <NewsInfo> events = new List <NewsInfo>(); if (strDateStart != string.Empty) { dtStart = DTC.Date.GetDateFromString(strDateStart, DTC.Date.DateStyleEnum.Universal); } if (strDateEnd != string.Empty) { dtEnd = DTC.Date.GetDateFromString(strDateEnd, DTC.Date.DateStyleEnum.Universal); } if (parameter == 1) { if (range == DTC.RangeEnum.Day) { events = DB.News.GetNews(dtStart, dtEnd); } else if (range == DTC.RangeEnum.Week) { WeekInfo week = DB.Weeks.GetWeek(dtStart, false); events = DB.News.GetNews(week.StartDate, week.EndDate); events = events.OrderBy(i => i.Date).ToList(); } } else if (parameter == 2) { if (range == DTC.RangeEnum.Day) { events = DB.News.GetTheDayInHistory(dtStart); } else if (range == DTC.RangeEnum.Week) { WeekInfo week = DB.Weeks.GetWeek(dtStart, false); events = DB.News.GetNewsLastYear(week.StartDate, week.EndDate); } } return(events); }
public Window_AddTimingAdjustData_VM() { if (!this.IsInDesignMode) { string title; CommonStaticMethod.GetLanguageString("设置智能亮度", "Lang_Bright_AddSmartBrightTitle", out title); this.WindowRealTitle = title; CmdOK = new RelayCommand(OnOK); CmdCancel = new RelayCommand(OnCancel); #region 初始化CustomTimePeriodDataCollection foreach (DayOfWeek item in Enum.GetValues(typeof(DayOfWeek))) { WeekInfo info = new WeekInfo(); info.IsSelected = false; info.WeekValue = item; CustomSelectedWeekCollection.Add(info); } #endregion #region 初始化RepetitionState foreach (RepetitionState item in Enum.GetValues(typeof(RepetitionState))) { string msg = ""; switch (item) { case RepetitionState.MonToFri: CommonStaticMethod.GetLanguageString("周一至周五", "Lang_Bright_MonToFri", out msg); break; case RepetitionState.EveryDay: CommonStaticMethod.GetLanguageString("每天", "Lang_Bright_EveryDay", out msg); break; case RepetitionState.Custom: CommonStaticMethod.GetLanguageString("自定义", "Lang_Bright_Custom", out msg); break; default: break; } RepetitionStateDataSource.Add(new ComboBoxDataSet(msg, item)); } SelectedRepetitionState = RepetitionState.EveryDay; #endregion } }