本文整理汇总了C#中Schedule类的典型用法代码示例。如果您正苦于以下问题:C# Schedule类的具体用法?C# Schedule怎么用?C# Schedule使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Schedule类属于命名空间,在下文中一共展示了Schedule类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例3: FNode
public FNode(Schedule _data, float _key)
{
right = this;
left = this;
data = _data;
key = _key;
}
示例4: AssignSchedule
public void AssignSchedule(Schedule schedule=null)
{
if (schedule == null)
Schedule = NewSchedule();
else
Schedule = schedule;
}
示例5: DeleteEmptyScheduler
private void DeleteEmptyScheduler(Schedule schedule)
{
if (schedule != null && schedule.ID != ID.Null.ToString())
{
CalendarActions.DeleteScheduler(schedule);
}
}
示例6: MonthOnDayOfMonthUnit
internal MonthOnDayOfMonthUnit(Schedule schedule, int duration, int dayOfMonth)
{
_duration = duration;
_dayOfMonth = dayOfMonth;
Schedule = schedule;
At(0, 0);
}
示例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;
}
示例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);
}
}
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例13: ClearAndReplace
public void ClearAndReplace(NPC npc, Schedule newSchedule)
{
_schedulesToDo.Clear();
current = null;
Add(new DefaultSchedule(npc));
Add(newSchedule);
}
示例14: FrmSelectStaff
public FrmSelectStaff(Staff staff,Schedule schedule,int status)
{
InitializeComponent();
this.staff = staff;
this.schedule = schedule;
this.statusButton = status;
}
示例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);
}