This repository has been archived by the owner on Jun 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ReminderForm.ascx.cs
69 lines (65 loc) · 2.11 KB
/
ReminderForm.ascx.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
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using DevExpress.Web.ASPxScheduler;
using DevExpress.XtraScheduler;
using DevExpress.Web.ASPxScheduler.Internal;
using DevExpress.Web;
using DevExpress.XtraScheduler.Native;
using DevExpress.XtraScheduler.Localization;
public partial class ReminderForm : SchedulerFormControl {
public ReminderForm()
: base() {
}
protected void Page_Load(object sender, EventArgs e) {
//PrepareChildControls();
}
public override void DataBind() {
base.DataBind();
RemindersFormTemplateContainer container = (RemindersFormTemplateContainer)Parent;
btnDismiss.ClientSideEvents.Click = container.DismissReminderHandler;
btnDismissAll.ClientSideEvents.Click = container.DismissAllRemindersHandler;
btnSnooze.ClientSideEvents.Click = container.SnoozeRemindersHandler;
InitItemListBox(container);
InitSnoozeCombo(container);
}
void InitItemListBox(RemindersFormTemplateContainer container) {
ReminderCollection reminders = container.Reminders;
int count = reminders.Count;
for(int i = 0; i < count; i++) {
Reminder reminder = reminders[i];
ListEditItem item = new ListEditItem(reminder.Subject, i);
lbItems.Items.Add(item);
}
lbItems.SelectedIndex = 0;
}
void InitSnoozeCombo(RemindersFormTemplateContainer container) {
cbSnooze.Items.Clear();
TimeSpan[] timeSpans = container.SnoozeTimeSpans;
int count = timeSpans.Length;
for(int i = 0; i < count; i++) {
TimeSpan timeSpan = timeSpans[i];
cbSnooze.Items.Add(new ListEditItem(container.ConvertSnoozeTimeSpanToString(timeSpan), timeSpan));
}
cbSnooze.SelectedIndex = 4;
}
protected override ASPxEditBase[] GetChildEditors() {
ASPxEditBase[] edits = new ASPxEditBase[] {
lbItems, lblClickSnooze, cbSnooze
};
return edits;
}
protected override ASPxButton[] GetChildButtons() {
ASPxButton[] buttons = new ASPxButton[] {
btnDismissAll, btnDismiss, btnSnooze
};
return buttons;
}
}