本文整理汇总了C#中Schedule类的典型用法代码示例。如果您正苦于以下问题:C# Schedule类的具体用法?C# Schedule怎么用?C# Schedule使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Schedule类属于命名空间,在下文中一共展示了Schedule类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ValidateSchedule
public String ValidateSchedule(Schedule.Schedule schedule, Registration.Registration vehicle)
{
String information = "";
try
{
if (comboBoxCountry.SelectedItem.ToString() == Registration.Country.country_name.Ecuador.ToString())
{
vehicle = new Registration.EcuadorRegistration(this.textBoxRegistration.Text);
schedule = new Schedule.EcuadorSchedule();
DateTime dt = new DateTime();
dt = Convert.ToDateTime(dateTimePicker.Text);
if (!(schedule as Schedule.EcuadorSchedule).EcuadorValidator(vehicle, dt))
information = "El vehículo con matrícula " + vehicle.Number + " no puede conducir en la ciudad de Quito entre las las 7:00 y las 9:30 en la mañana y entre las 16:00 y las 19:30 en la tarde y noche.";
else
information = "El vehículo con matrícula " + vehicle.Number + " puede conducir libremente en la ciudad de Quito en la fecha seleccionada.";
}
else
information = "Información solo disponible para " + Registration.Country.country_name.Ecuador.ToString();
}
catch (Exception exception)
{
information = exception.Message;
}
return information;
}
开发者ID:alainosorio,项目名称:Pico-y-Placa,代码行数:34,代码来源:PicoPlaca.cs
示例2: Day
public DateTime Day(DayOfWeek dayOfWeek, Schedule schedule)
{
switch (schedule)
{
case Schedule.Second:
FindDate(dayOfWeek, _indexes[schedule]);
break;
case Schedule.Third:
FindDate(dayOfWeek, _indexes[schedule]);
break;
case Schedule.Fourth:
FindDate(dayOfWeek, _indexes[schedule]);
break;
case Schedule.Last:
FindDate(dayOfWeek, _indexes[schedule]);
break;
case Schedule.Teenth:
FindDate(dayOfWeek, _indexes[schedule]);
break;
case Schedule.First:
FindDate(dayOfWeek, _indexes[schedule]);
break;
default:
throw new ArgumentOutOfRangeException(nameof(schedule), schedule, null);
}
return _date;
}
开发者ID:leovieira20,项目名称:exercismcsharp,代码行数:28,代码来源:Meetup.cs
示例3: FNode
public FNode(Schedule _data, float _key)
{
right = this;
left = this;
data = _data;
key = _key;
}
开发者ID:Jonanory,项目名称:Reputations,代码行数:7,代码来源:ScheduleHeap.cs
示例4: AssignSchedule
public void AssignSchedule(Schedule schedule=null)
{
if (schedule == null)
Schedule = NewSchedule();
else
Schedule = schedule;
}
开发者ID:blackram,项目名称:fluent-daypattern,代码行数:7,代码来源:Context.cs
示例5: DeleteEmptyScheduler
private void DeleteEmptyScheduler(Schedule schedule)
{
if (schedule != null && schedule.ID != ID.Null.ToString())
{
CalendarActions.DeleteScheduler(schedule);
}
}
开发者ID:Refactored,项目名称:SitecoreCalendarModule,代码行数:7,代码来源:CreateSchedule.cs
示例6: MonthOnDayOfMonthUnit
internal MonthOnDayOfMonthUnit(Schedule schedule, int duration, int dayOfMonth)
{
_duration = duration;
_dayOfMonth = dayOfMonth;
Schedule = schedule;
At(0, 0);
}
开发者ID:cschoolfield,项目名称:FluentScheduler,代码行数:7,代码来源:MonthOnDayOfMonthUnit.cs
示例7: ConfigureSchedulerSeedData
private Schedule ConfigureSchedulerSeedData()
{
var scheduleRepository = Container.Resolve<IRepository<Schedule>>();
var globalSchedule = scheduleRepository.CreateQuery().FirstOrDefault(x => x.Name == _globalScheduleName);
if (globalSchedule == null)
{
globalSchedule = new Schedule
{
GlobalDefault = true,
Name = _globalScheduleName,
StartOnWeekends = false,
StartCron = "* 8 * * 1-5", // 8 AM, Monday through Friday
StopCron = "* 18 * * 1-5", // 6 PM, Monday through Friday
};
scheduleRepository.Add(globalSchedule);
}
foreach (var schedule in GetAdditionalSchedules())
{
var scopedSchedule = schedule;
var existingSchedule = scheduleRepository.CreateQuery().FirstOrDefault(x => x.Name == scopedSchedule.Name);
if (existingSchedule == null)
{
scheduleRepository.Add(scopedSchedule);
}
}
return globalSchedule;
}
开发者ID:nelsonwellswku,项目名称:stack-it-net,代码行数:29,代码来源:Startup.Scheduler.cs
示例8: Announce
public void Announce(Schedule schedule)
{
var timeboxes = _timeBoxRepository.GetTimeBoxesFrom(schedule.Campaign, schedule.Start, schedule.End);
foreach (var timeBox in timeboxes)
{
foreach (var term in timeBox.TermSet)
{
var hrDate = term.GetLowestTerm().SaftyGetProperty<DateTime, IAssignment>(o => o.SaftyGetHrDate());
if (!hrDate.IsInTheRange(schedule))
continue;
//backupTerm
var backup = new BackupTerm(term.Id, timeBox.Agent.Id, term.Start, term.End, term.Text, term.Background, term.Level)
{
HrDate = hrDate
};
if (term.ParentTerm != null)
backup.ParentTermId = term.ParentTerm.Id;
term.SaftyInvoke<AssignmentBase>(o => backup.WorkingTotals = o.WorkingTotals);
_timeBoxRepository.SaveOrUpdate(backup);
}
}
}
开发者ID:Mrding,项目名称:Ribbon,代码行数:26,代码来源:MaintenanceScheduleModel.cs
示例9: Copy_Schedule
public void Copy_Schedule()
{
// Arange
int scheduleId = 1;
string scheduleName = "ScheduleName1";
int pierId = 1;
string pierName = "PierName1";
Pier pier = new Pier { Id = pierId, Name = pierName };
int routeId = 1;
string routeCode = "RouteCode1";
string routeName = "RouteName1";
Route route = new Route { Id = routeId, Code = routeCode, Name = routeName };
TimeSpan time = new TimeSpan(0, 10, 0);
Schedule oldSchedule = new Schedule { Id = scheduleId, Name = scheduleName, Pier = pier, Route = route, Time = time };
// Act
Schedule newSchedule = oldSchedule.Copy();
// Assert
Assert.AreNotSame(newSchedule, oldSchedule); // Not the same object
// Check properties
Assert.AreEqual(newSchedule.Id, scheduleId);
Assert.AreEqual(newSchedule.Name, scheduleName);
Assert.AreEqual(newSchedule.Route, route);
Assert.AreEqual(newSchedule.Pier, pier);
Assert.AreEqual(newSchedule.Time, time);
}
开发者ID:johannsutherland,项目名称:johannsutherland.net,代码行数:33,代码来源:ScheduleTest.cs
示例10: CopyValidEvents
public static void CopyValidEvents(Schedule schedule, ScheduleEventCollection eventList, string postfix)
{
if (eventList.Count == 0) return;
ScheduleEventCollection newEventsList = new ScheduleEventCollection();
foreach (ScheduleEvent srcEvent in eventList)
{
StringBuilder sb = new StringBuilder();
sb.Append(DescriptionHeaderName);
sb.AppendLine(Resources.CrossSyncDescription);
if (!string.IsNullOrEmpty(srcEvent.Description))
{
sb.AppendLine();
sb.Append(srcEvent.Description);
}
ScheduleEvent newEvent = new ScheduleEvent();
newEvent.EventType = srcEvent.IsBanner ? ScheduleEventType.Banner : ScheduleEventType.Normal;
newEvent.PublicType = srcEvent.IsPublic ? SchedulePublicType.Public : SchedulePublicType.Private;
newEvent.Start = srcEvent.Start;
newEvent.End = srcEvent.End;
newEvent.AllDay = srcEvent.AllDay;
newEvent.StartOnly = srcEvent.StartOnly;
newEvent.Plan = srcEvent.Plan;
newEvent.Detail = srcEvent.Detail + postfix;
newEvent.Description = sb.ToString();
newEvent.UserIds.Add(schedule.App.UserId);
newEventsList.Add(newEvent);
}
if (newEventsList.Count == 0) return;
schedule.AddEvents(newEventsList);
}
开发者ID:hatashinya,项目名称:cybozu-crosssync,代码行数:35,代码来源:Program.cs
示例11: CanSync
public const string DescriptionHeaderName = "# CrossSync: "; // Don't modify this.
#endregion Fields
#region Methods
public static bool CanSync(out CybozuException ex)
{
ex = null;
Properties.Settings settings = Properties.Settings.Default;
if (!IsConfigured(settings)) return false;
App firstApp, secondApp;
Schedule firstSchedule, secondSchedule;
try
{
firstApp = new App(settings.FirstUrl);
firstApp.Auth(settings.FirstUsername, settings.FirstPassword);
firstSchedule = new Schedule(firstApp);
secondApp = new App(settings.SecondUrl);
secondApp.Auth(settings.SecondUsername, settings.SecondPassword);
secondSchedule = new Schedule(secondApp);
}
catch (CybozuException e)
{
// fail to auth
ex = e;
return false;
}
catch (Exception)
{
return false;
}
return true;
}
开发者ID:hatashinya,项目名称:cybozu-crosssync,代码行数:39,代码来源:Program.cs
示例12: UpdateSnapshots
public void UpdateSnapshots(Schedule schedule)
{
_snapshots.Clear();
pnLeftColumn.Controls.Clear();
pnRightColumn.Controls.Clear();
int columnIndex = 0;
foreach (PrintProduct publication in schedule.PrintProducts)
{
if (publication.Inserts.Count > 0)
{
var snapshot = new PublicationSnapshotControl(publication);
if (columnIndex == 0)
{
pnLeftColumn.Controls.Add(snapshot);
snapshot.BringToFront();
columnIndex++;
}
else
{
pnRightColumn.Controls.Add(snapshot);
snapshot.BringToFront();
columnIndex = 0;
}
_snapshots.Add(snapshot);
}
}
UpdateColumns(schedule);
}
开发者ID:w01f,项目名称:VolgaTeam.Dashboard,代码行数:28,代码来源:OutputSnapshotContainer.cs
示例13: ClearAndReplace
public void ClearAndReplace(NPC npc, Schedule newSchedule)
{
_schedulesToDo.Clear();
current = null;
Add(new DefaultSchedule(npc));
Add(newSchedule);
}
开发者ID:,项目名称:,代码行数:7,代码来源:
示例14: FrmSelectStaff
public FrmSelectStaff(Staff staff,Schedule schedule,int status)
{
InitializeComponent();
this.staff = staff;
this.schedule = schedule;
this.statusButton = status;
}
开发者ID:ASQL,项目名称:LichCongTacVaNhacViec,代码行数:7,代码来源:FrmSelectStaff.cs
示例15: load_schedule
public void load_schedule(string f)
{
videoList = new VideoFile[1024];
for (int i = 0; i < 7; i++)
{
dailyList[i] = new DailyVideoFiles();
}
Schedule s = new Schedule();
s = XMLReader.ReadSchedule(f);
List<DailyVideoFiles> list = s.DailyVideoFilesList;
list.CopyTo(dailyList, 0);
foreach (DailyVideoFiles dailyFile in list)
{
//MessageBox.Show("how many days?" + dailyFile.VideoFileList.Count);
foreach (VideoFile v in dailyFile.VideoFileList)
{
int index = v.Index;
videoList[index] = v;
}
}
get_diff(dailyList);
}
开发者ID:angad,项目名称:PeopleBAWX,代码行数:27,代码来源:AdsFiller.cs
示例16: Insert
///<summary>Inserts one Schedule into the database. Provides option to use the existing priKey.</summary>
internal static long Insert(Schedule schedule,bool useExistingPK)
{
if(!useExistingPK && PrefC.RandomKeys) {
schedule.ScheduleNum=ReplicationServers.GetKey("schedule","ScheduleNum");
}
string command="INSERT INTO schedule (";
if(useExistingPK || PrefC.RandomKeys) {
command+="ScheduleNum,";
}
command+="SchedDate,StartTime,StopTime,SchedType,ProvNum,BlockoutType,Note,Status,EmployeeNum) VALUES(";
if(useExistingPK || PrefC.RandomKeys) {
command+=POut.Long(schedule.ScheduleNum)+",";
}
command+=
POut.Date (schedule.SchedDate)+","
+ POut.Time (schedule.StartTime)+","
+ POut.Time (schedule.StopTime)+","
+ POut.Int ((int)schedule.SchedType)+","
+ POut.Long (schedule.ProvNum)+","
+ POut.Long (schedule.BlockoutType)+","
+"'"+POut.String(schedule.Note)+"',"
+ POut.Int ((int)schedule.Status)+","
+ POut.Long (schedule.EmployeeNum)+")";
//DateTStamp can only be set by MySQL
if(useExistingPK || PrefC.RandomKeys) {
Db.NonQ(command);
}
else {
schedule.ScheduleNum=Db.NonQ(command,true);
}
return schedule.ScheduleNum;
}
开发者ID:nampn,项目名称:ODental,代码行数:33,代码来源:ScheduleCrud.cs
示例17: MarkConflictingAppointmentsUponCreation
public void MarkConflictingAppointmentsUponCreation()
{
var schedule = new Schedule(Guid.NewGuid(), testDateTimeRange, testClinicId, new List<Appointment>() { testAppointment1, testAppointment2 });
Assert.IsTrue(testAppointment1.IsPotentiallyConflicting);
Assert.IsTrue(testAppointment2.IsPotentiallyConflicting);
}
开发者ID:CEG-Ecoles,项目名称:DomainDrivenDesignforDatabaseDrivenMind,代码行数:7,代码来源:ScheduleShould.cs
示例18: FluentTest1
public void FluentTest1()
{
//Verify output. Should see one or two 10-second ticks, one or two 1,6 ticks, and one or two 2,7 ticks.
var s = new Schedule()
.AtSeconds(0, 10, 20, 30, 40, 50)
.WithLocalTime()
.Execute<TenSecTask>();
SchedulerRuntime.Start(s);
Thread.Sleep(new TimeSpan(0, 0, 2));
SchedulerRuntime.AddSchedule(new Schedule().WithName("OneSix").AtSeconds(1, 6, 11, 16, 21, 26, 31, 36, 41, 46, 51, 56).Execute<OneSixTask>());
Thread.Sleep(new TimeSpan(0, 0, 6));
SchedulerRuntime.UpdateSchedule(new Schedule().WithName("OneSix").AtSeconds(2, 7, 12, 17, 22, 27, 32, 37, 42, 47, 52, 57).Execute<TwoSevenTask>());
Thread.Sleep(new TimeSpan(0, 0, 6));
SchedulerRuntime.Stop();
Console.WriteLine("Stopped");
Assert.IsTrue(TenSecTask.Ticked);
Assert.IsTrue(OneSixTask.Ticked);
Assert.IsTrue(TwoSevenTask.Ticked);
}
开发者ID:pettijohn,项目名称:TaskSchedulerEngine,代码行数:26,代码来源:FluentTest.cs
示例19: MinuteUnit
public MinuteUnit(Schedule schedule, int duration)
{
this.Schedule = schedule;
this.Duration = duration;
this.Schedule.CalculateNextRun = x => x.AddMinutes(Duration);
}
开发者ID:mjack121,项目名称:FluentScheduler,代码行数:7,代码来源:MinuteUnit.cs
示例20: Remove
internal bool Remove(Schedule schedule)
{
lock (_lock)
{
return _schedules.Remove(schedule);
}
}
开发者ID:fluentscheduler,项目名称:FluentScheduler,代码行数:7,代码来源:ScheduleCollection.cs
注:本文中的Schedule类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论