This repository has been archived by the owner on Sep 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Services.cs
58 lines (56 loc) · 2.44 KB
/
Services.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using DevExpress.XtraScheduler;
using DevExpress.XtraScheduler.Drawing;
using DevExpress.XtraScheduler.Services;
namespace SchedulerAPISample.CodeExamples {
class Services
{
static void AppointmentFormatStringServiceAction(SchedulerControl scheduler)
{
#region #AppointmentFormatStringService
IAppointmentFormatStringService oldService = scheduler.GetService<IAppointmentFormatStringService>();
if (oldService != null)
{
MyAppointmentFormatStringService newService = new MyAppointmentFormatStringService(oldService);
scheduler.RemoveService(typeof(IAppointmentFormatStringService));
scheduler.AddService(typeof(IAppointmentFormatStringService), newService);
}
scheduler.ActiveView.LayoutChanged();
#endregion #AppointmentFormatStringService
}
#region #@AppointmentFormatStringService
public class MyAppointmentFormatStringService : AppointmentFormatStringServiceWrapper
{
public MyAppointmentFormatStringService(IAppointmentFormatStringService service)
: base(service) { }
public override string GetVerticalAppointmentStartFormat(
IAppointmentViewInfo aptViewInfo)
{
return "{0: HHmm:ss - 'VerticalAppointmentStart'}";
}
public override string GetVerticalAppointmentEndFormat(
IAppointmentViewInfo aptViewInfo)
{
return "{0: HHmm:ss - 'VerticalAppointmentEnd'}";
}
public override string GetHorizontalAppointmentEndFormat(
IAppointmentViewInfo aptViewInfo)
{
return "{0: HHmm - 'HorizontalAppointmentEnd'}";
}
public override string GetHorizontalAppointmentStartFormat(
IAppointmentViewInfo aptViewInfo)
{
return "{0: HHmm - 'HorizontalAppointmentStart'}";
}
public override string GetContinueItemStartFormat(IAppointmentViewInfo aptViewInfo)
{
return "{0: HHmm MMM dd - 'ContinueItemStart'}";
}
public override string GetContinueItemEndFormat(IAppointmentViewInfo aptViewInfo)
{
return "{0: HHmm MMM dd - 'ContinueItemEnd'}";
}
}
#endregion #@AppointmentFormatStringService
}
}