当前位置: 首页>>代码示例>>C#>>正文


C# DayOfWeek.ToString方法代码示例

本文整理汇总了C#中DayOfWeek.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# DayOfWeek.ToString方法的具体用法?C# DayOfWeek.ToString怎么用?C# DayOfWeek.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DayOfWeek的用法示例。


在下文中一共展示了DayOfWeek.ToString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Init

 public void Init()
 {
     _mockFactory = new MockRepository(MockBehavior.Strict);
     _cacherFactory = _mockFactory.Create<ICacherFactory>();
     _cacher = _mockFactory.Create<ICacher<FieldInfo>>();
     _e = DayOfWeek.Friday;
     _eName = _e.ToString();
     _f = typeof (DayOfWeek).GetField(_eName);
 }
开发者ID:riberk,项目名称:Rib.Common,代码行数:9,代码来源:EnumFieldReaderTests.cs

示例2: DayElement

        internal DayElement(GanttView view, DayOfWeek dayOfWeek, bool isHoliday)
            : base(view, ElementName)
        {
            _dayOfWeek = dayOfWeek;
            _isHoliday = isHoliday;

            AddAttribute(DayOfWeekName, dayOfWeek.ToString());
            AddAttribute(HolidayName, isHoliday.ToString(CultureInfo.InvariantCulture));
        }
开发者ID:0anion0,项目名称:IBN,代码行数:9,代码来源:DayElement.cs

示例3: HasFutureBookings

    public bool HasFutureBookings(Staff staff, System.Web.UI.HtmlControls.HtmlInputCheckBox chkBox, DayOfWeek dayOfWeek)
    {
        if (chkBox.Checked)
            return false;

        Booking[] bookings = BookingDB.GetFutureBookings(staff, null, dayOfWeek.ToString(), new TimeSpan(0, 0, 0), new TimeSpan(23, 59, 59));
        if (bookings.Length == 0)
            return false;

        string space = "          ";
        string bookingDates = string.Empty;
        for (int i = 0; i < bookings.Length; i++)
            bookingDates += "<br />" + space + bookings[i].DateStart.ToString(@"ddd MMM d, yyy HH:mm");

        lblErrorMessage.Text = "Can not select " + dayOfWeek.ToString() + "  as not working until the bookings on the following days have been moved or deleted:" + "<br />" + bookingDates + "<br />";
        lblErrorMessage.Visible = true;
        return true;
    }
开发者ID:mcep,项目名称:Mediclinic,代码行数:18,代码来源:StaffDetailV2.aspx.cs

示例4: DiaIngParaPort

        public static string DiaIngParaPort(DayOfWeek dayOfWeek)
        {
            var dia = "Segunda";

            switch (dayOfWeek.ToString())
            {
                case "Monday": dia = "Segunda"; break;
                case "Tuesday": dia = "Terça"; break;
                case "Wednesday": dia = "Quarta"; break;
                case "Thursday": dia = "Quinta"; break;
                case "Friday": dia = "Sexta"; break;
            }
            return dia;
        }
开发者ID:brunobsi,项目名称:appRike,代码行数:14,代码来源:Converter.cs

示例5: getWeekCHA

    public static int getWeekCHA(DayOfWeek dw)
    {
        string key = dw.ToString();
        if (key != null)
        {
            int num2;
            if (f__switch_map5A == null)
            {
                Dictionary<string, int> dictionary = new Dictionary<string, int>(7);
                dictionary.Add("Monday", 0);
                dictionary.Add("Tuesday", 1);
                dictionary.Add("Wednesday", 2);
                dictionary.Add("Thursday", 3);
                dictionary.Add("Friday", 4);
                dictionary.Add("Saturday", 5);
                dictionary.Add("Sunday", 6);
                f__switch_map5A = dictionary;
            }
            if (f__switch_map5A.TryGetValue(key, out num2))
            {
                switch (num2)
                {
                    case 0:
                        return 1;

                    case 1:
                        return 2;

                    case 2:
                        return 3;

                    case 3:
                        return 4;

                    case 4:
                        return 5;

                    case 5:
                        return 6;

                    case 6:
                        return 7;
                }
            }
        }
        return 1;
    }
开发者ID:hebbaixue99,项目名称:XJDemoServer,代码行数:47,代码来源:TimeKit.cs

示例6: AvailableForTranscoding

        public bool AvailableForTranscoding(string serverKey, DayOfWeek dayOfWeek, int hour)
        {
            using (var db = new MediaManagerDataContext())
            {
                var server = db.Servers.FirstOrDefault(a => a.Key == new Guid(serverKey) && a.IsActive);

                if (server != null)
                {
                    // override hold on transcoding, or currently executing remote job
                    if (server.HoldTranscoding || server.CurrentlyTranscoding) return false;

                    return server.TranscodingSchedules.Any(a => a.DayOfWeek == dayOfWeek.ToString() && a.Start <= hour && a.End > hour);
                }
            }

            return false;
        }
开发者ID:anlai,项目名称:MyMediaManager,代码行数:17,代码来源:LinkService.svc.cs

示例7: SetScheduleForDayOfWeek

        public static XDocument SetScheduleForDayOfWeek(DayOfWeek dayOfWeek)
        {
            XDocument dayScheduleRequest = GetEntireScheduling(true);

            XElement weekDayPowerScheduleList = null;
            XElement weekDayPowerSchedule = null;
            switch (dayOfWeek)
            {
                case DayOfWeek.Sunday:
                    weekDayPowerScheduleList = new XElement("Device.System.Power.Schedule.0.List");
                    weekDayPowerSchedule = new XElement("Device.System.Power.Schedule.0");
                    break;
                case DayOfWeek.Monday:
                    weekDayPowerScheduleList = new XElement("Device.System.Power.Schedule.1.List");
                    weekDayPowerSchedule = new XElement("Device.System.Power.Schedule.1");
                    break;
                case DayOfWeek.Tuesday:
                    weekDayPowerScheduleList = new XElement("Device.System.Power.Schedule.2.List");
                    weekDayPowerSchedule = new XElement("Device.System.Power.Schedule.2");
                    break;
                case DayOfWeek.Wednesday:
                    weekDayPowerScheduleList = new XElement("Device.System.Power.Schedule.3.List");
                    weekDayPowerSchedule = new XElement("Device.System.Power.Schedule.3");
                    break;
                case DayOfWeek.Thursday:
                    weekDayPowerScheduleList = new XElement("Device.System.Power.Schedule.4.List");
                    weekDayPowerSchedule = new XElement("Device.System.Power.Schedule.4");
                    break;
                case DayOfWeek.Friday:
                    weekDayPowerScheduleList = new XElement("Device.System.Power.Schedule.5.List");
                    weekDayPowerSchedule = new XElement("Device.System.Power.Schedule.5");
                    break;
                case DayOfWeek.Saturday:
                    weekDayPowerScheduleList = new XElement("Device.System.Power.Schedule.6.List");
                    weekDayPowerSchedule = new XElement("Device.System.Power.Schedule.6");
                    break;
                default:
                    throw new Exception(string.Format(@"Not supported parameter value: ""{0}"" forSetScheduleForDayOfWeek(DayOfWeek dayOfWeek)",
                           dayOfWeek.ToString()));
            }
            
            dayScheduleRequest.Descendants("SCHEDULE").First().Add(weekDayPowerSchedule);
            dayScheduleRequest.Descendants("SCHEDULE").First().AddFirst(weekDayPowerScheduleList);


            return dayScheduleRequest;
        }
开发者ID:contrequarte,项目名称:SmartPlugSP2101W,代码行数:47,代码来源:SmartPlugMessages.cs

示例8: GetDayValue

 /// <summary>
 /// Gets the day value.
 /// </summary>
 /// <param name="day"></param>
 /// <returns></returns>
 public int GetDayValue(DayOfWeek day)
 {
     var abbr = day.ToString().Substring(0,2).ToLower();
     return _dayValues[abbr];
 }
开发者ID:kishorereddy,项目名称:slate-lib,代码行数:10,代码来源:WeekRangeCalculator.cs

示例9: DayOfWeekMatches

        private static bool DayOfWeekMatches(DayOfWeek dayOfWeek, string weekRelativeDay)
        {
            if (dayOfWeek.ToString().Equals(weekRelativeDay, StringComparison.InvariantCultureIgnoreCase))
            {
                return true;
            }

            switch (dayOfWeek)
            {
                    case DayOfWeek.Monday:
                    case DayOfWeek.Tuesday:
                    case DayOfWeek.Wednesday:
                    case DayOfWeek.Thursday:
                    case DayOfWeek.Friday:
                    if (weekRelativeDay.Equals("weekday", StringComparison.InvariantCultureIgnoreCase))
                    {
                        return true;
                    }
                    break;

                    case DayOfWeek.Saturday:
                    case DayOfWeek.Sunday:
                    if (weekRelativeDay.Equals("weekend", StringComparison.InvariantCultureIgnoreCase))
                    {
                        return true;
                    }
                    break;
            }

            return false;
        }
开发者ID:Mavtak,项目名称:roomie,代码行数:31,代码来源:TimeUtils.cs

示例10: ConvertToScheduleDays

 private static ScheduleDays ConvertToScheduleDays(DayOfWeek day)
 {
     return (ScheduleDays)Enum.Parse(typeof(ScheduleDays), day.ToString());
 }
开发者ID:DrivenLogic,项目名称:CruiseControl.NET-TfsPlugin-CM19,代码行数:4,代码来源:TFSServerManager.cs

示例11: TestEnum

		public string TestEnum(DayOfWeek week)
		{
			return week.ToString();
		}
开发者ID:ChinaSuperLiu,项目名称:ClownFish.Mvc,代码行数:4,代码来源:DemoService.cs

示例12: GetDayName

        /// <summary>
        /// Obtiene el nombre del día
        /// </summary>
        /// <param name="dayOfWeek">El día de la semana</param>
        /// <returns>El nombre del día</returns>
        private string GetDayName(DayOfWeek dayOfWeek)
        {
            string dayName = string.Empty;

            switch (dayOfWeek.ToString())
            {
                case "Sunday":
                    dayName = "Domingo";
                    break;
                case "Monday":
                    dayName = "Lunes";
                    break;
                case "Tuesday":
                    dayName = "Martes";
                    break;
                case "Wednesday":
                    dayName = "Miércoles";
                    break;
                case "Thrusday":
                    dayName = "Jueves";
                    break;
                case "Friday":
                    dayName = "Viernes";
                    break;
                case "Saturday":
                    dayName = "Sábado";
                    break;
            }
            return dayName;
        }
开发者ID:Crommel1503,项目名称:FlujoCreditosExpress,代码行数:35,代码来源:FormPrincipal.cs

示例13: ParseDay

 /// <summary>
 /// Converts a comma separated list of times
 /// </summary>
 /// <param name="day"></param>
 /// <returns></returns>
 protected virtual IEnumerable<TimeSpan> ParseDay(DayOfWeek day)
 {
     return ParseDay(day.ToString());
 }
开发者ID:jdruin,项目名称:Wolfpack-Redux,代码行数:9,代码来源:TwentyFourSevenTimer.cs

示例14: dayToInt

 private int dayToInt(DayOfWeek day)
 {
     switch (day.ToString())
     {
         case "Monday":
             return 0;
         case "Tuesday":
             return 1;
         case "Wednesday":
             return 2;
         case "Thursday":
             return 3;
         case "Friday":
             return 4;
         case "Saturday":
             return 5;
         case "Sunday":
             return 6;
         default:
             return 0;
     }
 }
开发者ID:justjanne,项目名称:SmartOrganizer,代码行数:22,代码来源:EventCollection.cs

示例15: WeekString

        private string WeekString(DayOfWeek week)
        {
            if (Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName.ToLower() == "zh")
            {
                string result = "星期一";
                switch (week)
                {
                    case DayOfWeek.Monday:
                        result = "星期一";
                        break;
                    case DayOfWeek.Tuesday:
                        result = "星期二";
                        break;
                    case DayOfWeek.Wednesday:
                        result = "星期三";
                        break;
                    case DayOfWeek.Thursday:
                        result = "星期四";
                        break;
                    case DayOfWeek.Friday:
                        result = "星期五";
                        break;
                    case DayOfWeek.Saturday:
                        result = "星期六";
                        break;
                    case DayOfWeek.Sunday:
                        result = "星期天";
                        break;
                }
                return result;
            }

            return week.ToString();
        }
开发者ID:kjiwu,项目名称:WorldCupGuide,代码行数:34,代码来源:MatchItem.cs


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