Dear Telerik Team!
I have successfuly implemented drag and drop operation between ListBox and ScheduleView. I use custom appointment. Everything works fine when my custom appointment inherits from Appointment class. Unfortunately I need to use a class which inherits from EntityObject class so my custom appointment class must implement IAppointment interface instead of inheriting Appointment base class. After that drag and drop stopped working. Could you please provide me with some samples of correct IAppointment interface implementation. You can find a class I use for now down below:
Thank you very much and best regards
Krzysztof Kaźmierczak
I have successfuly implemented drag and drop operation between ListBox and ScheduleView. I use custom appointment. Everything works fine when my custom appointment inherits from Appointment class. Unfortunately I need to use a class which inherits from EntityObject class so my custom appointment class must implement IAppointment interface instead of inheriting Appointment base class. After that drag and drop stopped working. Could you please provide me with some samples of correct IAppointment interface implementation. You can find a class I use for now down below:
public
class
WMSAppointment : IAppointment
{
public
string
Body {
get
;
set
; }
public
ICategory Category {
get
;
set
; }
public
Importance Importance {
get
;
set
; }
public
DateTime End {
get
;
set
; }
public
DateTime Start {
get
;
set
; }
public
string
Subject {
get
;
set
; }
public
IList Resources {
get
;
set
; }
public
int
JobId {
get
;
set
; }
public
bool
IsAllDayEvent {
get
;
set
; }
public
IRecurrenceRule RecurrenceRule {
get
;
set
; }
public
ITimeMarker TimeMarker {
get
;
set
; }
public
TimeZoneInfo TimeZone {
get
;
set
; }
public
event
EventHandler RecurrenceRuleChanged;
public
event
PropertyChangedEventHandler PropertyChanged;
public
bool
Equals(IAppointment other)
{
var otherAppointment = other
as
WMSAppointment;
return
otherAppointment !=
null
&&
other.Start ==
this
.Start &&
other.End ==
this
.End &&
other.Subject ==
this
.Subject &&
this
.JobId == otherAppointment.JobId &&
this
.TimeMarker == otherAppointment.TimeMarker &&
this
.TimeZone == otherAppointment.TimeZone &&
this
.IsAllDayEvent == other.IsAllDayEvent &&
this
.RecurrenceRule == other.RecurrenceRule;
}
public
void
BeginEdit()
{
throw
new
NotImplementedException();
}
public
void
CancelEdit()
{
throw
new
NotImplementedException();
}
public
void
EndEdit()
{
throw
new
NotImplementedException();
}
public
IAppointment Copy()
{
IAppointment appointment =
new
WMSAppointment();
appointment.CopyFrom(
this
);
return
appointment;
}
public
void
CopyFrom(IAppointment other)
{
this
.IsAllDayEvent = other.IsAllDayEvent;
this
.Start = other.Start;
this
.End = other.End;
this
.Subject = other.Subject;
var otherAppointment = other
as
WMSAppointment;
if
(otherAppointment ==
null
)
return
;
this
.JobId = otherAppointment.JobId;
this
.TimeMarker = otherAppointment.TimeMarker;
this
.Resources.Clear();
this
.Resources.AddRange(otherAppointment.Resources);
this
.Body = otherAppointment.Body;
}
}
Thank you very much and best regards
Krzysztof Kaźmierczak