diff --git a/toast_ui.blazor_calendar.TestProject/toast_ui.blazor_calendar.TestProject/ViewModels/CalendarViewModel.cs b/toast_ui.blazor_calendar.TestProject/toast_ui.blazor_calendar.TestProject/ViewModels/CalendarViewModel.cs index e71d340..f1d7b8c 100644 --- a/toast_ui.blazor_calendar.TestProject/toast_ui.blazor_calendar.TestProject/ViewModels/CalendarViewModel.cs +++ b/toast_ui.blazor_calendar.TestProject/toast_ui.blazor_calendar.TestProject/ViewModels/CalendarViewModel.cs @@ -91,7 +91,10 @@ public async Task InitCalendarDataAsync() { useCreationPopup = true, useDetailPopup = true, - defaultView = TUICalendarViewName.Month + defaultView = TUICalendarViewName.Month, + taskView = false, + scheduleView = true + }; var calendarProps = new List(); diff --git a/toast_ui.blazor_calendar/Models/TUICalendarOptions.cs b/toast_ui.blazor_calendar/Models/TUICalendarOptions.cs index d1753a3..988ad75 100644 --- a/toast_ui.blazor_calendar/Models/TUICalendarOptions.cs +++ b/toast_ui.blazor_calendar/Models/TUICalendarOptions.cs @@ -2,6 +2,7 @@ using System.Linq; using System.Text.Json.Serialization; using toast_ui.blazor_calendar.Services; +using toast_ui.blazor_calendar.Services.JsonConverters; namespace toast_ui.blazor_calendar.Models { @@ -22,14 +23,16 @@ public class TUICalendarOptions /// Show the milestone and task in weekly, daily view. /// The default value is true. If the value is array, it can be ['milestone', 'task']. /// - public string[] taskView { get; set; } = new[] {"milestone", "task"}; + //[JsonConverter(typeof(TUITaskViewJsonConverter))] + public bool taskView { get; set; } = true; /// /// Show the all day and time grid in weekly, daily view. /// The default value is false. /// If the value is array, it can be ['allday', 'time']. /// - public string[] scheduleView { get; set; } = new[] { "allday", "time" }; + //public string[] scheduleView { get; set; } = new[] { "allday", "time" }; + public bool scheduleView { get; set; } = true; /// /// themeConfig for custom style. @@ -122,11 +125,11 @@ private bool CompareMembers(TUICalendarOptions options) { return false; } - if (!taskView.SequenceEqual(options.taskView)) + if (!taskView.Equals(options.taskView)) { return false; } - if (!scheduleView.SequenceEqual(options.scheduleView)) + if (!scheduleView.Equals(options.scheduleView)) { return false; } @@ -199,4 +202,17 @@ private TUICalendarViewName(string value) } +public class TUITaskView +{ + private TUITaskView(string[] value) + { + Value = value; + } + public string[] Value { get; set; } + + public static TUITaskView MilestoneAndTask { get { return new TUITaskView(new[] { "milestone", "task" }); }} + public static TUITaskView Milestone { get { return new TUITaskView(new[] { "milestone" }); } } + public static TUITaskView Task { get { return new TUITaskView(new[] { "task" }); } } + public static TUITaskView None { get { return new TUITaskView(new[] { "" }); } } +} } \ No newline at end of file diff --git a/toast_ui.blazor_calendar/Models/TUISchedule.cs b/toast_ui.blazor_calendar/Models/TUISchedule.cs index 95a9d72..a48d9bb 100644 --- a/toast_ui.blazor_calendar/Models/TUISchedule.cs +++ b/toast_ui.blazor_calendar/Models/TUISchedule.cs @@ -1,6 +1,7 @@ using System; using System.Text.Json.Serialization; using toast_ui.blazor_calendar.Services; +using toast_ui.blazor_calendar.Services.JsonConverters; namespace toast_ui.blazor_calendar.Models { diff --git a/toast_ui.blazor_calendar/NpmJS/src/index.js b/toast_ui.blazor_calendar/NpmJS/src/index.js index 62e0478..03251ab 100644 --- a/toast_ui.blazor_calendar/NpmJS/src/index.js +++ b/toast_ui.blazor_calendar/NpmJS/src/index.js @@ -131,4 +131,8 @@ window.TUICalendar = { return TUICalendar.calendarRef.getDateRangeEnd(); }, + scrollToNow: function () { + TUICalendar.calendarRef.scrollToNow(); + } + } \ No newline at end of file diff --git a/toast_ui.blazor_calendar/Services/ITUICalendarInteropService.cs b/toast_ui.blazor_calendar/Services/ITUICalendarInteropService.cs index 1348986..0682238 100644 --- a/toast_ui.blazor_calendar/Services/ITUICalendarInteropService.cs +++ b/toast_ui.blazor_calendar/Services/ITUICalendarInteropService.cs @@ -20,5 +20,7 @@ public interface ITUICalendarInteropService ValueTask GetDateRangeStart(); ValueTask GetDateRangeEnd(); ValueTask SetCalendarOptionsAsync(TUICalendarOptions calendarOptions); + void ScrollToNow(); + } } \ No newline at end of file diff --git a/toast_ui.blazor_calendar/Services/TUICalendarViewNameJsonConverter.cs b/toast_ui.blazor_calendar/Services/JsonConverters/TUICalendarViewNameJsonConverter.cs similarity index 96% rename from toast_ui.blazor_calendar/Services/TUICalendarViewNameJsonConverter.cs rename to toast_ui.blazor_calendar/Services/JsonConverters/TUICalendarViewNameJsonConverter.cs index 48440c8..a23a081 100644 --- a/toast_ui.blazor_calendar/Services/TUICalendarViewNameJsonConverter.cs +++ b/toast_ui.blazor_calendar/Services/JsonConverters/TUICalendarViewNameJsonConverter.cs @@ -8,7 +8,7 @@ using System.Threading.Tasks; using toast_ui.blazor_calendar.Models; -namespace toast_ui.blazor_calendar.Services +namespace toast_ui.blazor_calendar.Services.JsonConverters { class TUICalendarViewNameJsonConverter : JsonConverter { diff --git a/toast_ui.blazor_calendar/Services/TZDateJsonConverter.cs b/toast_ui.blazor_calendar/Services/JsonConverters/TZDateJsonConverter.cs similarity index 97% rename from toast_ui.blazor_calendar/Services/TZDateJsonConverter.cs rename to toast_ui.blazor_calendar/Services/JsonConverters/TZDateJsonConverter.cs index a5baf01..7854725 100644 --- a/toast_ui.blazor_calendar/Services/TZDateJsonConverter.cs +++ b/toast_ui.blazor_calendar/Services/JsonConverters/TZDateJsonConverter.cs @@ -7,7 +7,7 @@ using System.Text.Json.Serialization; using System.Threading.Tasks; -namespace toast_ui.blazor_calendar.Services +namespace toast_ui.blazor_calendar.Services.JsonConverters { class TZDateJsonConverter : JsonConverter { diff --git a/toast_ui.blazor_calendar/Services/TUICalendarInteropService.cs b/toast_ui.blazor_calendar/Services/TUICalendarInteropService.cs index 6ee80ba..6d75189 100644 --- a/toast_ui.blazor_calendar/Services/TUICalendarInteropService.cs +++ b/toast_ui.blazor_calendar/Services/TUICalendarInteropService.cs @@ -1,11 +1,11 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Text.Json; using System.Threading.Tasks; using Microsoft.JSInterop; using toast_ui.blazor_calendar.Models; +using toast_ui.blazor_calendar.Services.JsonConverters; namespace toast_ui.blazor_calendar.Services { @@ -15,7 +15,6 @@ namespace toast_ui.blazor_calendar.Services /// public class TUICalendarInteropService : ITUICalendarInteropService, IAsyncDisposable { - private readonly IJSRuntime _JSRuntime; //private DotNetObjectReference ObjectReference; @@ -25,24 +24,9 @@ public TUICalendarInteropService(IJSRuntime jsRuntime) _JSRuntime = jsRuntime; } - /// - /// Initialize the Calendar - /// - /// - /// - public async ValueTask InitCalendarAsync(DotNetObjectReference objectReference, TUICalendarOptions calendarOptions) - { - await _JSRuntime.InvokeVoidAsync("TUICalendar.initializeCalendar", objectReference, calendarOptions); - } - - /// - /// Sets Calendar Options - /// - /// - /// - public async ValueTask SetCalendarOptionsAsync(TUICalendarOptions calendarOptions) + public async ValueTask ChangeView(TUICalendarViewName viewName) { - await _JSRuntime.InvokeVoidAsync("TUICalendar.setCalendarOptions", calendarOptions); + await _JSRuntime.InvokeVoidAsync("TUICalendar.changeView", viewName.Value); } /// @@ -58,27 +42,41 @@ public async ValueTask CreateSchedulesAsync(IEnumerable schedules) } } - /// - /// Set the calendars' properties via TUICalendarProps - /// - /// - /// - public async ValueTask SetCalendars(IEnumerable calendars) + public ValueTask DisposeAsync() { - if (calendars is not null) - { - await _JSRuntime.InvokeVoidAsync("TUICalendar.setCalendars", calendars); - } + return new ValueTask(); + //throw new NotImplementedException(); } - public async ValueTask ChangeView(TUICalendarViewName viewName) + public async ValueTask GetDateRangeEnd() { - await _JSRuntime.InvokeVoidAsync("TUICalendar.changeView", viewName.Value); + var result = await _JSRuntime.InvokeAsync("TUICalendar.getDateRangeEnd"); + var deserializeOptions = new JsonSerializerOptions(); + deserializeOptions.Converters.Add(new TZDateJsonConverter()); + return JsonSerializer.Deserialize(result.ToString(), deserializeOptions); } - public TUISchedule UpdateSchedule(TUISchedule scheduleToModify, JsonElement changedSchedule) + public async ValueTask GetDateRangeStart() { - return CombineTuiSchedule(scheduleToModify, changedSchedule); + var result = await _JSRuntime.InvokeAsync("TUICalendar.getDateRangeStart"); + var deserializeOptions = new JsonSerializerOptions(); + deserializeOptions.Converters.Add(new TZDateJsonConverter()); + return JsonSerializer.Deserialize(result.ToString(), deserializeOptions); + } + + public async ValueTask HideShowCalendar(string calendarId, bool hide) + { + await _JSRuntime.InvokeVoidAsync("hideShowCalendar", calendarId, hide); + } + + /// + /// Initialize the Calendar + /// + /// + /// + public async ValueTask InitCalendarAsync(DotNetObjectReference objectReference, TUICalendarOptions calendarOptions) + { + await _JSRuntime.InvokeVoidAsync("TUICalendar.initializeCalendar", objectReference, calendarOptions); } /// @@ -94,9 +92,11 @@ public async ValueTask MoveCalendar(CalendarMove moveTo) case CalendarMove.Next: value = 1; break; + case CalendarMove.Previous: value = -1; break; + case CalendarMove.Today: value = 0; break; @@ -104,6 +104,53 @@ public async ValueTask MoveCalendar(CalendarMove moveTo) await _JSRuntime.InvokeVoidAsync("TUICalendar.moveToNextOrPreviousOrToday", value); } + /// + /// Scroll to current time on today in daily or weekly view + /// + public void ScrollToNow() + { + _JSRuntime.InvokeVoidAsync("TUICalendar.scrollToNow"); + } + + /// + /// Sets Calendar Options + /// + /// + /// + public async ValueTask SetCalendarOptionsAsync(TUICalendarOptions calendarOptions) + { + await _JSRuntime.InvokeVoidAsync("TUICalendar.setCalendarOptions", calendarOptions); + } + /// + /// Set the calendars' properties via TUICalendarProps + /// + /// + /// + public async ValueTask SetCalendars(IEnumerable calendars) + { + if (calendars is not null) + { + await _JSRuntime.InvokeVoidAsync("TUICalendar.setCalendars", calendars); + } + } + public async ValueTask SetDate(DateTimeOffset? dateToDisplay) + { + if (dateToDisplay is not null) + { + await _JSRuntime.InvokeVoidAsync("TUICalendar.setDate", dateToDisplay); + } + } + + /// + /// Call when an updated schedule has been returned from the calendar + /// + /// Current Schedule Object + /// The changes made to the schedule + /// The changed schedule ready to further processing and/or saving + public TUISchedule UpdateSchedule(TUISchedule scheduleToModify, JsonElement changedSchedule) + { + return CombineTuiSchedule(scheduleToModify, changedSchedule); + } private TUISchedule CombineTuiSchedule(TUISchedule schedule, JsonElement changes) { var c = JsonSerializer.Deserialize(changes.ToString()); @@ -125,42 +172,5 @@ private void CopyValues(T target, T source) prop.SetValue(target, value, null); } } - - public ValueTask DisposeAsync() - { - return new ValueTask(); - //throw new NotImplementedException(); - } - - public async ValueTask HideShowCalendar(string calendarId, bool hide) - { - await _JSRuntime.InvokeVoidAsync("hideShowCalendar", calendarId, hide); - } - - public async ValueTask SetDate(DateTimeOffset? dateToDisplay) - { - if (dateToDisplay is not null) - { - await _JSRuntime.InvokeVoidAsync("TUICalendar.setDate", dateToDisplay); - } - } - - public async ValueTask GetDateRangeStart() - { - var result = await _JSRuntime.InvokeAsync("TUICalendar.getDateRangeStart"); - var deserializeOptions = new JsonSerializerOptions(); - deserializeOptions.Converters.Add(new TZDateJsonConverter()); - return JsonSerializer.Deserialize(result.ToString(), deserializeOptions); - - } - - public async ValueTask GetDateRangeEnd() - { - var result = await _JSRuntime.InvokeAsync("TUICalendar.getDateRangeEnd"); - var deserializeOptions = new JsonSerializerOptions(); - deserializeOptions.Converters.Add(new TZDateJsonConverter()); - return JsonSerializer.Deserialize(result.ToString(), deserializeOptions); - } - } -} +} \ No newline at end of file diff --git a/toast_ui.blazor_calendar/TUICalendar.razor.cs b/toast_ui.blazor_calendar/TUICalendar.razor.cs index 3e2def4..c75173f 100644 --- a/toast_ui.blazor_calendar/TUICalendar.razor.cs +++ b/toast_ui.blazor_calendar/TUICalendar.razor.cs @@ -15,41 +15,30 @@ namespace toast_ui.blazor_calendar { - public partial class TUICalendar : ComponentBase, IDisposable + /// + /// Enum Used to Advance the Calendar Forward, Reverse, or to Today + /// + public enum CalendarMove { + Next, + Previous, + Today + } - public TUICalendarInteropService CalendarInterop { get; private set; } = null; - - [Inject] - public IJSRuntime jsRuntime { get; set; } - - [Parameter] - public EventCallback OnChangeCalendarEventOrTask { get; set; } - - [Parameter] - public EventCallback OnCreateCalendarEventOrTask { get; set; } - - [Parameter] - public EventCallback OnClickCalendarEventOrTask { get; set; } + public partial class TUICalendar : ComponentBase, IDisposable + { - [Parameter] - public EventCallback OnDeleteCalendarEventOrTask { get; set; } + private DotNetObjectReference _ObjectReference; /// - /// Not Working + /// Used to Queue events in SetParametersAsync. Code cannot be left until after all parameters have been set /// - /* - [Parameter] - public EventCallback OnDoubleClickCalendarEventOrTask { get; set; } - */ - + private Queue _OnParameterChangeEvents = new Queue(); /// - /// IEnumerable of all events/tasks etc of type TUISchedule. - /// The initial set to be loaded + /// Direct access to some calendar functions via the Interop /// - [Parameter] - public IEnumerable Schedules { get; set; } + public TUICalendarInteropService CalendarInterop { get; private set; } = null; /// /// Calendar display options and defaults, can be null @@ -82,18 +71,48 @@ public partial class TUICalendar : ComponentBase, IDisposable [Parameter] public DateTimeOffset? GoToDate { get; set; } + [Inject] + public IJSRuntime jsRuntime { get; set; } + /// - /// The Start Date of the Range of days displayed on the calendar + /// Invoked when a calendar Event or Task is changed /// [Parameter] - public DateTimeOffset? VisibleStartDateRange { get; set; } + public EventCallback OnChangeCalendarEventOrTask { get; set; } + + /// + /// Invoked when a calendar Event or Task is Clicked + /// + [Parameter] + public EventCallback OnClickCalendarEventOrTask { get; set; } + + /// + /// Raised when a calendar Event or Task is Created + /// + [Parameter] + public EventCallback OnCreateCalendarEventOrTask { get; set; } /// - /// The Start Date of the Range of days displayed on the calendar + /// Raised when a calendar Event or Task is Deleted /// [Parameter] - public EventCallback VisibleStartDateRangeChanged { get; set; } + public EventCallback OnDeleteCalendarEventOrTask { get; set; } + + /// + /// Not Working + /// + /* + [Parameter] + public EventCallback OnDoubleClickCalendarEventOrTask { get; set; } + */ + /// + /// IEnumerable of all events/tasks etc of type TUISchedule. + /// This is the initial set of schedules/events to be loaded + /// + [Parameter] + public IEnumerable Schedules { get; set; } + /// /// The End Date of the Range of days displated on the calendar /// @@ -107,32 +126,22 @@ public partial class TUICalendar : ComponentBase, IDisposable public EventCallback VisibleEndDateRangeChanged { get; set; } /// - /// Call this method and Advance the calendar, in any view, forward,backward, or to today. + /// The Start Date of the Range of days displayed on the calendar /// - /// Previous, Next, or Today - /// - public async ValueTask MoveCalendar(CalendarMove moveTo) - { - await CalendarInterop.MoveCalendar(moveTo); - await SetDateRange(); - } - - private DotNetObjectReference _ObjectReference; + [Parameter] + public DateTimeOffset? VisibleStartDateRange { get; set; } /// - /// Used to Queue events in SetParametersAsync. Code cannot be left until after all parameters have been set + /// The Start Date of the Range of days displayed on the calendar /// - private Queue _OnParameterChangeEvents = new Queue(); - - [JSInvokable("UpdateSchedule")] - public async Task UpdateSchedule(dynamic scheduleBeingModified, dynamic updatedScheduleFields) - { - var currentSchedule = JsonSerializer.Deserialize(scheduleBeingModified.ToString()); - var updatedSchedule = CalendarInterop.UpdateSchedule(currentSchedule, updatedScheduleFields); //Todo: Combine changes with actual schedule - await OnChangeCalendarEventOrTask.InvokeAsync(updatedSchedule); //Todo: Test This callback! - Debug.WriteLine($"Schedule {currentSchedule.Id} Modified"); - } - + [Parameter] + public EventCallback VisibleStartDateRangeChanged { get; set; } + + /// + /// When the user created a new schedule from the UI + /// + /// + /// [JSInvokable("CreateSchedule")] public async Task CreateSchedule(JsonElement newSchedule) { @@ -141,23 +150,33 @@ public async Task CreateSchedule(JsonElement newSchedule) await OnCreateCalendarEventOrTask.InvokeAsync(schedule); Debug.WriteLine("New Schedule Created"); } - - [JSInvokable("OnClickSchedule")] - public async Task OnScheduleClick(string scheduleId) + + public void Dispose() { - await OnClickCalendarEventOrTask.InvokeAsync(scheduleId); - Debug.WriteLine($"Schedule {scheduleId} Clicked!"); + GC.SuppressFinalize(this); + if (_ObjectReference != null) + { + //Now dispose our object reference so our component can be garbage collected + _ObjectReference.Dispose(); + } } - /*@Todo: Waiting for Double click in TUI API - [JSInvokable("OnDoubleClickSchedule")] - public async Task OnScheduleDoubleClick(string scheduleId) + /// + /// Call this method and Advance the calendar, in any view, forward,backward, or to today. + /// + /// Previous, Next, or Today + /// + public async ValueTask MoveCalendar(CalendarMove moveTo) { - await OnDoubleClickCalendarEventOrTask.InvokeAsync(scheduleId); - Debug.WriteLine($"Schedule {scheduleId} Double-Clicked!"); + await CalendarInterop.MoveCalendar(moveTo); + await SetDateRange(); } - */ - + + /// + /// When a schedule is deleted from calendar UI, this is invoked + /// + /// + /// [JSInvokable("DeleteSchedule")] public async Task OnDeleteSchedule(string scheduleId) { @@ -165,13 +184,16 @@ public async Task OnDeleteSchedule(string scheduleId) Debug.WriteLine($"Schedule {scheduleId} Deleted!"); } - protected override void OnInitialized() + /// + /// When a schedule is clicked from the calendar UI, this is invoked + /// + /// + /// + [JSInvokable("OnClickSchedule")] + public async Task OnScheduleClick(string scheduleId) { - _ObjectReference = DotNetObjectReference.Create(this); - if (CalendarInterop is null) - { - CalendarInterop = new TUICalendarInteropService(jsRuntime); - } + await OnClickCalendarEventOrTask.InvokeAsync(scheduleId); + Debug.WriteLine($"Schedule {scheduleId} Clicked!"); } /// @@ -188,7 +210,7 @@ public override async Task SetParametersAsync(ParameterView parameters) _OnParameterChangeEvents.Enqueue(CalendarInterop?.ChangeView(viewName).AsTask()); _OnParameterChangeEvents.Enqueue(SetDateRange()); } - + var newDateDisplay = parameters.GetValueOrDefault("GoToDate"); if (newDateDisplay != GoToDate) { @@ -209,7 +231,7 @@ public override async Task SetParametersAsync(ParameterView parameters) } CalendarProperties = parameters.GetValueOrDefault>("CalendarProperties"); Schedules = parameters.GetValueOrDefault>("Schedules"); - + //Visible Date Range VisibleEndDateRange = parameters.GetValueOrDefault("VisibleEndDateRange"); VisibleStartDateRange = parameters.GetValueOrDefault("VisibleStartDateRange"); @@ -226,12 +248,49 @@ public override async Task SetParametersAsync(ParameterView parameters) } - protected override bool ShouldRender() + /// + /// When an schedule is updated from the UI, this is invoked. + /// + /// + /// + /// + [JSInvokable("UpdateSchedule")] + public async Task UpdateSchedule(dynamic scheduleBeingModified, dynamic updatedScheduleFields) { - return false; - //return shouldRender; + var currentSchedule = JsonSerializer.Deserialize(scheduleBeingModified.ToString()); + var updatedSchedule = CalendarInterop.UpdateSchedule(currentSchedule, updatedScheduleFields); //Todo: Combine changes with actual schedule + await OnChangeCalendarEventOrTask.InvokeAsync(updatedSchedule); //Todo: Test This callback! + Debug.WriteLine($"Schedule {currentSchedule.Id} Modified"); + } + + /*@Todo: Waiting for Double click in TUI API + [JSInvokable("OnDoubleClickSchedule")] + public async Task OnScheduleDoubleClick(string scheduleId) + { + await OnDoubleClickCalendarEventOrTask.InvokeAsync(scheduleId); + Debug.WriteLine($"Schedule {scheduleId} Double-Clicked!"); + } + */ + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (firstRender) + { + await CalendarInterop.InitCalendarAsync(_ObjectReference, CalendarOptions); + await CalendarInterop.SetCalendars(CalendarProperties); + await CalendarInterop.CreateSchedulesAsync(Schedules); + await SetDateRange(); + } } + protected override void OnInitialized() + { + _ObjectReference = DotNetObjectReference.Create(this); + if (CalendarInterop is null) + { + CalendarInterop = new TUICalendarInteropService(jsRuntime); + } + } protected override async Task OnParametersSetAsync() { if (CalendarInterop is not null) @@ -250,50 +309,31 @@ protected override async Task OnParametersSetAsync() } } - protected override async Task OnAfterRenderAsync(bool firstRender) + /// + /// Since there is no subsequent rendering required by blazor after the first render, this set to false + /// + /// + protected override bool ShouldRender() { - if (firstRender) - { - await CalendarInterop.InitCalendarAsync(_ObjectReference, CalendarOptions); - await CalendarInterop.SetCalendars(CalendarProperties); - await CalendarInterop.CreateSchedulesAsync(Schedules); - await SetDateRange(); - } + return false; } - - //@Bug: Bound Properties are being set when invoking the change event. + + /// + /// Each time there is a view change or advance of the calendar, ask the calendar what date range is visible + /// + /// private async Task SetDateRange() { if (CalendarInterop is not null) { - //VisibleStartDateRange = ; await VisibleStartDateRangeChanged.InvokeAsync(await CalendarInterop.GetDateRangeStart()); - //VisibleEndDateRange = ; await VisibleEndDateRangeChanged.InvokeAsync(await CalendarInterop.GetDateRangeEnd()); } } - - public void Dispose() - { - GC.SuppressFinalize(this); - if (_ObjectReference != null) - { - //Now dispose our object reference so our component can be garbage collected - _ObjectReference.Dispose(); - } - } - } - /// - /// Enum Used to Advance the Calendar Forward, Reverse, or to Today - /// - public enum CalendarMove - { - Next, - Previous, - Today } } +//SOME REFERENCE CODE /* * if (!_hasSetInitialParameters) {