• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Season类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Season的典型用法代码示例。如果您正苦于以下问题:C# Season类的具体用法?C# Season怎么用?C# Season使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Season类属于命名空间,在下文中一共展示了Season类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetSeasonDateRange

        /// <summary>
        /// Retrieves the date range for the season based on season and year.
        /// </summary>
        /// <param name="season">
        /// The season you wish to get the date range for.
        /// </param>
        /// <param name="year">
        /// The year of the season you wish to get the date range for.
        /// </param>
        /// <param name="restated">
        /// Set to true if you want the time period adjusted forward in 53 week years for comparability to 52 week years.
        /// </param>
        /// <returns>
        /// DateRange
        /// </returns>
        public static DateRange GetSeasonDateRange(Season season,
            int year,
            bool restated = false)
        {
            // Default to Spring season, weeks 1 through 26.
            var startWeek = 1;
            var endWeek = 26;

            if (season == Season.Fall)
            {
                // Check whether the year has a 53rd week.
                var extraWeek = GetMerchYearInfo(year).ExtraWeek;

                startWeek = 27;

                /* If the year has an extra week and the time period has not been restated, end on
                 * 53rd week, otherwise end on 52nd. */
                if (extraWeek && !restated)
                    endWeek = 53;
                else
                    endWeek = 52;
            }

            var startDate = GetWeekDateRange(startWeek, year, restated).StartDate;
            var endDate = GetWeekDateRange(endWeek, year, restated).EndDate.ToEndOfDay();

            return new DateRange
            {
                StartDate = startDate,
                EndDate = endDate
            };
        }
开发者ID:mhertzfeld,项目名称:MerchandiseCalendar,代码行数:47,代码来源:SeasonFunctions.cs


示例2: ChangeColor

 public virtual void ChangeColor(Season season)
 {
     switch (season)
     {
         case Season.Winter:
             {
                 color = TreeColor.Brown;
                 break;
             }
         case Season.Spring:
             {
                 color = TreeColor.LightGreen;
                 break;
             }
         case Season.Summer:
             {
                 color = TreeColor.Green;
                 break;
             }
         case Season.Autumn:
             {
                 color = TreeColor.Yellow;
                 break;
             }
         default:
             {
                 break;
             }
     }
 }
开发者ID:vbre,项目名称:CS_2015_Winter,代码行数:30,代码来源:AbstractTree.cs


示例3: Tree

 public Tree(Season season)
 {
     countOfDays = Counting();
     this.season = season;
     var msMessanger = new Messanger(this);
     Options();
 }
开发者ID:vbre,项目名称:CS_2015_Winter,代码行数:7,代码来源:Tree.cs


示例4: Time

        public Time(string pod, string pow, string ss)
        {
            if (pod == "Morning")
                period_of_day = Time.Period_Of_Day.Morning;
            else if (pod == "Afternoon")
                period_of_day = Time.Period_Of_Day.Afternoon;
            else if (pod == "Night")
                period_of_day = Time.Period_Of_Day.Night;
            else
                period_of_day = Time.Period_Of_Day.All;

            
            if (pow == "Weekday")
                period_of_week = Time.Period_Of_Week.Weekday;
            else if (pow == "Weekend")
                period_of_week = Time.Period_Of_Week.Weekend;
            else
                period_of_week = Time.Period_Of_Week.All;

            
            if (ss == "Spring")
                season = Time.Season.Spring;
            else if (ss == "Summer")
                season = Time.Season.Summer;
            else if (ss == "Autumn")
                season = Time.Season.Autumn;
            else if (ss == "Winter")
                season = Time.Season.Winter;
            else
                season = Time.Season.All;
        }
开发者ID:tiemptit,项目名称:travelh2v,代码行数:31,代码来源:Time.cs


示例5: Practice

        private List<Inning> innings; // The innings associated with this game.

        #endregion Fields

        #region Constructors

        public Practice(Season newSeason, DateTime newDate, String newLocation)
        {
            season = newSeason;
            date = newDate;
            location = newLocation;
            innings = new List<Inning>();
        }
开发者ID:kjlahm,项目名称:Dugout-Digits,代码行数:13,代码来源:Practice.cs


示例6: Context

        public Context(State initialState, Season initialSeason)
        {
            if (initialState == null) throw new ArgumentNullException("initialState");

              currentState = initialState;
              CurrentSeason = initialSeason;
        }
开发者ID:headsigned,项目名称:csharp-state-pattern-encapsulation-example,代码行数:7,代码来源:Context.cs


示例7: GetSeasonWithOneRace

        public static Season GetSeasonWithOneRace()
        {
            var season = new Season()
            {
                Id = ++SeasonId,
                Name = "Test Season",
                PointsSystemTypeName = "atomicf1.domain.PointsSystem2011, atomicf1.domain"
            };

            season.AddRace(Race(season, new List<RaceEntry>() {
                RaceEntry(season.PointsSystem, 1),
                RaceEntry(season.PointsSystem, 2),
                RaceEntry(season.PointsSystem, 3),
                RaceEntry(season.PointsSystem, 4),
                RaceEntry(season.PointsSystem, 5),
                RaceEntry(season.PointsSystem, 6),
                RaceEntry(season.PointsSystem, 7),
                RaceEntry(season.PointsSystem, 8),
                RaceEntry(season.PointsSystem, 9),
                RaceEntry(season.PointsSystem, 10),
                RaceEntry(season.PointsSystem, 11) }
                ));

            return season;
        }
开发者ID:robgray,项目名称:f1speedguides,代码行数:25,代码来源:FakesFactory.cs


示例8: GrabMethods

	//called by lvl change
	private void GrabMethods(){ 
		background = GameObject.Find("Background");
		//player = GameObject.Find("Player").GetComponent<PlayerController>();
		scenery = background.GetComponent<Animator>();
		sea =  SeasonExtension.ToSeason(scenery.GetInteger("Season"));
		targets = GetEffectedArray();
	}
开发者ID:fondreak,项目名称:FailSeason,代码行数:8,代码来源:GameController.cs


示例9: CalculateWatchedPercentage

 private static decimal CalculateWatchedPercentage(Season season)
 {
     var episodes = season.Unwatched + season.Watched;
     decimal watchedEpisodes = season.Watched;
     decimal result = watchedEpisodes / episodes;
     return Math.Round(result * 100);
 }
开发者ID:ja1984,项目名称:TweeWeb,代码行数:7,代码来源:UserController.cs


示例10: GetStatsSummaryAsync

 /// <summary>
 /// Gets aggregated stats for a summoner. This method uses the Stats API.
 /// </summary>
 /// <param name="summonerId">The summoner's summoner IDs.</param>
 /// <param name="season">The season to get stats for. If unspecified, stats for the current season are returned.</param>
 /// <returns>A task representing the asynchronous operation.</returns>
 public Task<PlayerStatsSummaryList> GetStatsSummaryAsync(long summonerId, Season? season = null)
 {
     var queryParameters = new Dictionary<string, object>();
     if (season != null)
         queryParameters["season"] = season;
     return GetAsync<PlayerStatsSummaryList>($"{mainBaseUrl}/api/lol/{lowerRegion}/{StatsApiVersion}/stats/by-summoner/{summonerId}/summary", queryParameters);
 }
开发者ID:aj-r,项目名称:RiotNet,代码行数:13,代码来源:RiotClientStats.cs


示例11: VisSource

 public VisSource(Aura aura, Ability art, Season seasons, double amount)
 {
     Aura = aura;
     Art = art;
     Seasons = seasons;
     Amount = amount;
 }
开发者ID:ndilday,项目名称:wizard-monks,代码行数:7,代码来源:Aura.cs


示例12: SetSeason

 public void SetSeason(Season season)
 {
     foreach (var tree in _trees)
     {
         tree.TreeOption(season);
     }
 }
开发者ID:vbre,项目名称:CS_2015_Winter,代码行数:7,代码来源:MyForest.cs


示例13: CreateNextSeason

 // TODO Lookup current season
 public Season CreateNextSeason(Season currentSeason)
 {
     if (currentSeason != null && currentSeason.StartYear == DateTime.Today.Year)
         return null;
     else
         return new Season(DateTime.Today.Year, DateTime.Today.Year + 1);
 }
开发者ID:philjhale,项目名称:TeessideBasketballLeague,代码行数:8,代码来源:CompetitionServiceOld.cs


示例14: Transition

 //Boilerplate to make sure that the object-specific transitions only happen when needed
 //Also helps remember to actually set the current season
 public void Transition(Season toSeason)
 {
     if (currentSeason != toSeason) {
         DoTransition(toSeason);
         currentSeason = toSeason;
     }
 }
开发者ID:kmoverall,项目名称:azimuth-unity,代码行数:9,代码来源:SeasonalObject.cs


示例15: Index

        public ActionResult Index(string userName)
        {
            var backup = RavenSession.Query<Backup>().FirstOrDefault(x => x.Username == userName);

            if (backup.Shows.Any(x => x.Seasons != null && x.Seasons.Any()))
                return View(backup);

            foreach (var show in backup.Shows)
            {
                var seasons = show.Episodes.GroupBy(x => x.Season);
                show.Seasons = new List<Season>();
                foreach (var season in seasons)
                {
                    var newSeason = new Season()
                                        {
                                            Number = int.Parse(season.Key),
                                            Unwatched = season.Count(x => x.Watched == "0"),
                                            Watched = season.Count(x => x.Watched == "1"),
                                        };
                    newSeason.Percent = CalculateWatchedPercentage(newSeason);
                    show.Seasons.Add(newSeason);

                }
            }

            RavenSession.Store(backup);
            RavenSession.SaveChanges();

            return View(backup);
        }
开发者ID:ja1984,项目名称:TweeWeb,代码行数:30,代码来源:UserController.cs


示例16: ChangeSeason

 private void ChangeSeason(Season currentSeason)
 {
     foreach (var item in Trees)
     {
         item.GrowUp();
         item.ChangeColor(currentSeason);
     }
 }
开发者ID:vbre,项目名称:CS_2015_Winter,代码行数:8,代码来源:Forest.cs


示例17: RegisterMap

		public static void RegisterMap(
			int mapIndex, int mapID, int fileIndex, int width, int height, Season season, Expansion ex, string name, MapRules rules)
		{
			var newMap = new Map(mapID, mapIndex, fileIndex, width, height, season.GetID(), ex, name, rules);

			Map.Maps[mapIndex] = newMap;
			Map.AllMaps.Add(newMap);
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:8,代码来源:MapDefinitions.cs


示例18: Calendar

 internal Calendar(World world)
     : base(world)
 {
     _seasons = Season.LoadSeasons();
     _months = Month.LoadMonths();
     CurrentDate = new Date(28,_months.Skip(11).First(),2014);
     _currentSeason = Season.CurrentSeason(_seasons, this);
 }
开发者ID:ndech,项目名称:Alpha,代码行数:8,代码来源:Calendar.cs


示例19: GetCurrentSeasonTest

 public void GetCurrentSeasonTest()
 {
     var rep = new SeasonRepository(context);
     var season = new Season();
     season = rep.GetCurrentSeason(1);
     Assert.IsTrue(season != null);
     Assert.IsTrue(season.SeasonID != 0);
 }
开发者ID:rsalit,项目名称:CSBC,代码行数:8,代码来源:SeasonsTest.cs


示例20: SeasonDto

 public SeasonDto(Season season)
 {
     _SeasonID = season.ID;
     _OperatorId = season.OperatorId;
     _StartMonth = season.StartMonth;
     _StartDay = season.StartDay;
     _EndMonth = season.EndMonth;
     _EndDay = season.EndDay;
 }
开发者ID:senolakkas,项目名称:ferrybooking,代码行数:9,代码来源:SeasonDto.cs



注:本文中的Season类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# SecHandle类代码示例发布时间:2022-05-24
下一篇:
C# SearchWindow类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap