-
Notifications
You must be signed in to change notification settings - Fork 1k
/
Copy pathCustomAppointment.cs
91 lines (81 loc) · 2.64 KB
/
CustomAppointment.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
using Telerik.Windows.Controls.ScheduleView;
namespace CustomReadOnlyBehavior
{
public class CustomAppointment : Appointment
{
private bool isDeletable = true;
private bool isDraggable = true;
private bool isResizable = true;
private bool isEditable = true;
public bool IsDeletable
{
get { return this.Storage<CustomAppointment>().isDeletable; }
set
{
var storage = this.Storage<CustomAppointment>();
if(storage.isDeletable != value)
{
storage.isDeletable = value;
this.OnPropertyChanged(() => this.IsDeletable);
}
}
}
public bool IsDraggable
{
get { return this.Storage<CustomAppointment>().isDraggable; }
set
{
var storage = this.Storage<CustomAppointment>();
if(storage.isDraggable != value)
{
storage.isDraggable = value;
this.OnPropertyChanged(() => this.IsDraggable);
}
}
}
public bool IsResizable
{
get { return this.Storage<CustomAppointment>().isResizable; }
set
{
var storage = this.Storage<CustomAppointment>();
if(storage.isResizable != value)
{
storage.isResizable = value;
this.OnPropertyChanged(() => this.IsResizable);
}
}
}
public bool IsEditable
{
get { return this.Storage<CustomAppointment>().isEditable; }
set
{
var storage = this.Storage<CustomAppointment>();
if (storage.isEditable != value)
{
storage.isEditable = value;
this.OnPropertyChanged(() => this.IsEditable);
}
}
}
public override IAppointment Copy()
{
var newAppointment = new CustomAppointment();
newAppointment.CopyFrom(this);
return newAppointment;
}
public override void CopyFrom(IAppointment other)
{
var task = other as CustomAppointment;
if (task != null)
{
this.IsDeletable = task.IsDeletable;
this.IsEditable = task.IsEditable;
this.IsDraggable = task.IsDraggable;
this.IsResizable = task.IsResizable;
}
base.CopyFrom(other);
}
}
}