static SchedulerSettings CreateReportTemplatesSchedulerSettings() { SchedulerSettings settings = new SchedulerSettings(); settings.Name = "scheduler"; settings.CallbackRouteValues = new { Controller = "Reporting", Action = "ReportTemplatesPartial" }; settings.ActiveViewType = SchedulerViewType.Week; settings.GroupType = SchedulerGroupType.Resource; settings.Start = new DateTime(2014, 5, 23); settings.Width = Unit.Percentage(100); settings.Views.DayView.ResourcesPerPage = 3; settings.Views.DayView.Styles.ScrollAreaHeight = Unit.Pixel(300); settings.Views.WorkWeekView.ResourcesPerPage = 3; settings.Views.WorkWeekView.Styles.ScrollAreaHeight = Unit.Pixel(300); settings.Views.FullWeekView.ResourcesPerPage = 3; settings.Views.WeekView.Enabled = false; settings.Views.FullWeekView.Enabled = true; settings.Views.MonthView.ResourcesPerPage = 3; settings.Views.TimelineView.ResourcesPerPage = 3; settings.Storage.EnableReminders = false; settings.Storage.Appointments.Assign(SchedulerDemoHelper.DefaultAppointmentStorage); settings.Storage.Resources.Assign(SchedulerDemoHelper.DefaultResourceStorage); settings.OptionsCustomization.AllowAppointmentCreate = UsedAppointmentType.None; settings.OptionsCustomization.AllowAppointmentEdit = UsedAppointmentType.None; settings.OptionsCustomization.AllowAppointmentDelete = UsedAppointmentType.None; return(settings); }
static SchedulerSettings CreateDateNavigatorSchedulerSettings() { SchedulerSettings settings = new SchedulerSettings(); settings.Name = "scheduler"; settings.CallbackRouteValues = new { Controller = "CalendarFeatures", Action = "DateNavigatorPartial" }; settings.Start = new DateTime(2010, 7, 13); settings.Width = Unit.Pixel(580); settings.Views.DayView.ResourcesPerPage = 2; settings.Views.DayView.Styles.ScrollAreaHeight = Unit.Pixel(400); settings.OptionsBehavior.ShowViewNavigator = false; settings.OptionsBehavior.ShowViewSelector = false; settings.Storage.EnableReminders = false; settings.Storage.Resources.Assign(SchedulerDemoHelper.DefaultResourceStorage); settings.Storage.Appointments.Assign(SchedulerDemoHelper.DefaultAppointmentStorage); settings.OptionsCustomization.AllowAppointmentCreate = UsedAppointmentType.None; settings.OptionsCustomization.AllowAppointmentEdit = UsedAppointmentType.None; settings.OptionsCustomization.AllowAppointmentDelete = UsedAppointmentType.None; settings.DateNavigatorExtensionSettings.Name = "dateNavigator"; settings.DateNavigatorExtensionSettings.Width = 220; settings.DateNavigatorExtensionSettings.Properties.Rows = 2; settings.DateNavigatorExtensionSettings.Properties.DayNameFormat = DayNameFormat.FirstLetter; settings.DateNavigatorExtensionSettings.Properties.BoldAppointmentDates = true; return(settings); }
public static SchedulerSettings GetSchedulerSettings() { SchedulerSettings settings = new SchedulerSettings(); settings.Name = "scheduler"; settings.CallbackRouteValues = new { Controller = "Home", Action = "SchedulerPartial" }; settings.EditAppointmentRouteValues = new { Controller = "Home", Action = "EditAppointment" }; settings.CustomActionRouteValues = new { Controller = "Home", Action = "CustomCallBackAction" }; settings.Storage.Appointments.Assign(SchedulerDataHelper.DefaultAppointmentStorage); settings.Storage.Resources.Assign(SchedulerDataHelper.DefaultResourceStorage); settings.Storage.EnableReminders = true; settings.GroupType = SchedulerGroupType.Resource; settings.Views.DayView.Styles.ScrollAreaHeight = 400; settings.Start = DateTime.Now; var dialog = settings.OptionsForms.DialogLayoutSettings.AppointmentDialog; dialog.ViewModel = new CustomAppointmentEditDialogViewModel(); dialog.GenerateDefaultLayoutElements(); var companies = dialog.LayoutElements.CreateField((CustomAppointmentEditDialogViewModel m) => m.AppointmentCompany); var contacts = dialog.LayoutElements.CreateField((CustomAppointmentEditDialogViewModel m) => m.AppointmentContact); dialog.InsertBefore(companies, dialog.FindLayoutElement("Description")); dialog.InsertAfter(contacts, companies); return(settings); }
public void HasReasonableDefaultSettings() { SchedulerSettings schedulerSettings = SchedulerSettings.Default; Assert.True(schedulerSettings.SafeGeneralInterval <= schedulerSettings.SafePrivateChatInterval); Assert.True(schedulerSettings.SafeGeneralInterval <= schedulerSettings.SafeGroupChatInterval); Assert.True(schedulerSettings.SafePrivateChatInterval <= schedulerSettings.SafeGroupChatInterval); }
public async Task <SchedulerSettings> GetSchedulerSetting() { string settingsJson = await jsRuntime.InvokeAsync <string>("localStorage.getItem", "scheduler"); SchedulerSettings settings = JsonSerializer.Deserialize <SchedulerSettings>(settingsJson); return(settings); }
public static bool InsertUpdateScheduleSettings(SchedulerSettings schedulerSettings) { var lstSqlParameter = new List <SqlParameter>(); lstSqlParameter.Add(new SqlParameter() { ParameterName = "@Id", SqlDbType = SqlDbType.Int, Value = schedulerSettings.Id }); lstSqlParameter.Add(new SqlParameter() { ParameterName = "@FeedProviderId", SqlDbType = SqlDbType.Int, Value = schedulerSettings.FeedProvider.Id }); lstSqlParameter.Add(new SqlParameter() { ParameterName = "@StartDateTime", SqlDbType = SqlDbType.DateTime, Value = schedulerSettings.StartDateTime }); lstSqlParameter.Add(new SqlParameter() { ParameterName = "@ExpiryDateTime", SqlDbType = SqlDbType.DateTime, Value = (object)schedulerSettings.ExpiryDateTime ?? DBNull.Value }); lstSqlParameter.Add(new SqlParameter() { ParameterName = "@IsEnabled", SqlDbType = SqlDbType.Bit, Value = schedulerSettings.IsEnabled }); lstSqlParameter.Add(new SqlParameter() { ParameterName = "@SchedulerFrequencyId", SqlDbType = SqlDbType.Int, Value = schedulerSettings.SchedulerFrequencyId }); lstSqlParameter.Add(new SqlParameter() { ParameterName = "@RecurranceInterval", SqlDbType = SqlDbType.NVarChar, Value = (object)schedulerSettings.RecurranceInterval ?? DBNull.Value }); lstSqlParameter.Add(new SqlParameter() { ParameterName = "@RecurranceDaysInWeek", SqlDbType = SqlDbType.NVarChar, Value = (object)schedulerSettings.RecurranceDaysInWeek ?? DBNull.Value }); lstSqlParameter.Add(new SqlParameter() { ParameterName = "@RecurranceMonths", SqlDbType = SqlDbType.NVarChar, Value = (object)schedulerSettings.RecurranceMonths ?? DBNull.Value }); lstSqlParameter.Add(new SqlParameter() { ParameterName = "@RecurranceDatesInMonth", SqlDbType = SqlDbType.NVarChar, Value = (object)schedulerSettings.RecurranceDatesInMonth ?? DBNull.Value }); lstSqlParameter.Add(new SqlParameter() { ParameterName = "@RecurranceWeekNos", SqlDbType = SqlDbType.NVarChar, Value = (object)schedulerSettings.RecurranceWeekNos ?? DBNull.Value }); lstSqlParameter.Add(new SqlParameter() { ParameterName = "@RecurranceDaysInWeekForMonth", SqlDbType = SqlDbType.NVarChar, Value = (object)schedulerSettings.RecurranceDaysInWeekForMonth ?? DBNull.Value }); int rowsAffected = DBProvider.ExecuteNonQuery("SchedulerSettings_InsertUpdate", CommandType.StoredProcedure, ref lstSqlParameter); return(rowsAffected > 0); }
public QuartzScheduler(SchedulerSettings settings, JobMetadata metadataManager, IJobDetailService jobDetailService) : base(settings, metadataManager, jobDetailService) { JobListener.ToBeExecuted += (s, e) => OnBeforeJobExecution(e.Job); JobListener.Executed += (s, e) => OnJobTriggered(e.Job); JobListener.ExecutionVetoed += (s, e) => OnJobSkipped(e.Job); JobListener.ExecutionSucceeded += (s, e) => OnJobSucceeded(e.Job); JobListener.ExecutionFailed += (s, e) => OnJobFailed(e.Job); }
public async Task GenerateFor_UsesCorrectGeneratorForEachAppointment() { var fromDate = DateTime.Today; var toDate = fromDate.AddDays(1); var settings = new SchedulerSettings { Appointments = new List <Appointment> { new Appointment { Recurrence = new Recurrence { Interval = Interval.Daily } }, new Appointment { Recurrence = new Recurrence { Interval = Interval.Monthly } }, new Appointment { Recurrence = new Recurrence { Interval = Interval.Annually } } } }; var dailyAppointments = new[] { new Event() }; var dailyGenerator = Substitute.For <IAppointmentGenerator>(); dailyGenerator.Interval.Returns(Interval.Daily); dailyGenerator.GenerateFor(fromDate, toDate, settings.Appointments[0]).Returns(dailyAppointments); var monthlyAppointments = new[] { new Event() }; var monthlyGenerator = Substitute.For <IAppointmentGenerator>(); monthlyGenerator.Interval.Returns(Interval.Monthly); monthlyGenerator.GenerateFor(fromDate, toDate, settings.Appointments[1]).Returns(monthlyAppointments); var annuallyGenerator = Substitute.For <IAppointmentGenerator>(); var annuallyAppointments = new[] { new Event() }; annuallyGenerator.Interval.Returns(Interval.Annually); this.SetDependency <IEnumerable <IAppointmentGenerator> >(new[] { dailyGenerator, monthlyGenerator, annuallyGenerator }); annuallyGenerator.GenerateFor(fromDate, toDate, settings.Appointments[2]).Returns(annuallyAppointments); var actual = await this.Target.GenerateFor(fromDate, toDate, settings); foreach (var appointment in dailyAppointments) { Assert.IsTrue(actual.Contains(appointment)); } foreach (var appointment in monthlyAppointments) { Assert.IsTrue(actual.Contains(appointment)); } foreach (var appointment in annuallyAppointments) { Assert.IsTrue(actual.Contains(appointment)); } }
/// <summary> /// Exports data to a serialization object. /// </summary> /// <returns></returns> internal static SchedulerSettings Export() { SchedulerSettings serial = new SchedulerSettings(); foreach (ScheduleEntry entry in s_schedule.Where(entry => !entry.Expired)) { serial.Entries.Add(entry.Export()); } return(serial); }
public static SchedulerSettings Settings() { if (schedulerSettings != null) { return(schedulerSettings); } schedulerSettings = new SchedulerSettings { NoOfMachines = Convert.ToInt32(ConfigurationManager.AppSettings["NoOfMachines"]), NoOfParallelRun = Convert.ToInt32(ConfigurationManager.AppSettings["NoOfParallelRun"]), NoOfChromeClients = Convert.ToInt32(ConfigurationManager.AppSettings["NoOfChromeClients"]), NoOfFirefoxClients = Convert.ToInt32(ConfigurationManager.AppSettings["NoOfFirefoxClients"]), NoOfIeClients = Convert.ToInt32(ConfigurationManager.AppSettings["NoOfIeClients"]), ScreenshotLocation = ConfigurationManager.AppSettings["ScreenshotPath"], ScreenshotUrl = ConfigurationManager.AppSettings["ScreenshotUrl"], NUnitArgs = ConfigurationManager.AppSettings["NUnitArgs"], AppendBuildNumberToPath = Convert.ToBoolean(ConfigurationManager.AppSettings["AppendBuildNumberToPath"]), ReRunFailedTests = Convert.ToBoolean(ConfigurationManager.AppSettings["ReRunFailedTests"]), ReRunFailedTestsLimit = Convert.ToInt32(ConfigurationManager.AppSettings["ReRunFailedTestsLimit"]), TestsGroupLimit = Convert.ToInt32(ConfigurationManager.AppSettings["TestsGroupLimit"]), ContinuousIntegrationSystemCmd = ConfigurationManager.AppSettings["ContinuousIntegrationSystemCmd"] }; var machineNames = GetMachineNames(); var seleniumClients = new List <SeleniumNode>(); foreach (var machineName in machineNames) { foreach (var clientType in Enum.GetValues(typeof(ClientType))) { var clients = GetClientsPorts((ClientType)clientType, machineName).ToList(); seleniumClients.AddRange(clients); switch ((ClientType)clientType) { case ClientType.Chrome: schedulerSettings.NoOfChromeClients = clients.Count; break; case ClientType.Firefox: schedulerSettings.NoOfFirefoxClients = clients.Count; break; case ClientType.Ie: schedulerSettings.NoOfIeClients = clients.Count; break; } } } schedulerSettings.SeleniumClients = seleniumClients; schedulerSettings.MachineConfigs = GetMachineConfigs(); return(schedulerSettings); }
public async Task<Event[]> GenerateFor(DateTime fromDate, DateTime toDate, SchedulerSettings settings) { var result = new List<Event>(); foreach (var appointment in settings.Appointments) { var generator = this.appointmentGenerators.FirstOrDefault(g => g.Interval == appointment.Recurrence.Interval); if (generator != null) { result.AddRange(await generator.GenerateFor(fromDate, toDate, appointment)); } } return await Task.Run(() => result.ToArray()); }
public static SchedulerSettings GetSchedulerSettings(this System.Web.Mvc.HtmlHelper customHtml) { SchedulerSettings settings = new SchedulerSettings(); settings.Name = "scheduler"; settings.CallbackRouteValues = new { Controller = "Home", Action = "SchedulerPartial" }; settings.EditAppointmentRouteValues = new { Controller = "Home", Action = "EditAppointment" }; settings.CustomActionRouteValues = new { Controller = "Home", Action = "CustomCallBackAction" }; settings.Storage.Appointments.Assign(SchedulerDataHelper.DefaultAppointmentStorage); settings.Storage.Resources.Assign(SchedulerDataHelper.DefaultResourceStorage); settings.Storage.EnableReminders = false; settings.GroupType = SchedulerGroupType.Resource; settings.Views.DayView.Styles.ScrollAreaHeight = 400; settings.Start = DateTime.Now; settings.AppointmentFormShowing = (sender, e) => { var scheduler = sender as MVCxScheduler; if (scheduler != null) { e.Container = new CustomAppointmentTemplateContainer(scheduler); } }; settings.OptionsForms.SetAppointmentFormTemplateContent(c => { var container = (CustomAppointmentTemplateContainer)c; ModelAppointment modelAppointment = new ModelAppointment() { ID = container.Appointment.Id == null ? -1 : (int)container.Appointment.Id, Subject = container.Appointment.Subject, Location = container.Appointment.Location, StartTime = container.Appointment.Start, EndTime = container.Appointment.End, AllDay = container.Appointment.AllDay, Description = container.Appointment.Description, EventType = (int)container.Appointment.Type, Status = container.Appointment.StatusId, Label = container.Appointment.LabelId, CustomInfo = container.CustomInfo, OwnerId = Convert.ToInt32(container.Appointment.ResourceId) }; customHtml.ViewBag.DeleteButtonEnabled = container.CanDeleteAppointment; (container.ResourceDataSource as ListEditItemCollection).RemoveAt(0); customHtml.ViewBag.ResourceDataSource = container.ResourceDataSource; customHtml.ViewBag.StatusDataSource = container.StatusDataSource; customHtml.ViewBag.LabelDataSource = container.LabelDataSource; //ViewBag.ReminderDataSource = container.ReminderDataSource; customHtml.RenderPartial("CustomAppointmentFormPartial", modelAppointment); }); return(settings); }
public static SchedulerSettings GetSchedulerSettings() { SchedulerSettings settings = new SchedulerSettings(); settings.Name = "scheduler"; settings.CallbackRouteValues = new { Controller = "Home", Action = "SchedulerPartial" }; settings.EditAppointmentRouteValues = new { Controller = "Home", Action = "EditAppointment" }; settings.CustomActionRouteValues = new { Controller = "Home", Action = "CustomCallBackAction" }; settings.Storage.Appointments.Assign(SchedulerDataHelper.DefaultAppointmentStorage); settings.Storage.Resources.Assign(SchedulerDataHelper.DefaultResourceStorage); settings.Storage.EnableReminders = true; settings.GroupType = SchedulerGroupType.Resource; settings.Views.DayView.Styles.ScrollAreaHeight = 400; settings.Start = DateTime.Now; settings.OptionsForms.DialogLayoutSettings.AppointmentDialog.ViewModel.PrepareControl((ASPxCheckBox cb) => { cb.ToggleSwitchDisplayMode = ToggleSwitchDisplayMode.Never; }); settings.OptionsForms.DialogLayoutSettings.AppointmentDialog.ViewModel.PrepareControlFor(m => m.StartTime, (ASPxDateEdit de) => { de.EditFormat = EditFormat.Custom; de.EditFormatString = "dd - MM - yyyy"; }); settings.OptionsForms.DialogLayoutSettings.AppointmentDialog.ViewModel.PrepareControlFor(m => m.EndTime, (ASPxDateEdit de) => { de.EditFormat = EditFormat.Custom; de.EditFormatString = "dd - MM - yyyy"; }); settings.OptionsForms.DialogLayoutSettings.AppointmentDialog.ViewModel.PrepareControlFor(m => m.ResourceIds, (ASPxComboBox de) => { de.Caption = "Employee"; }); settings.OptionsForms.DialogLayoutSettings.AppointmentDialog.ViewModel.PrepareControlFor(m => m.Subject, (ASPxTextBox de) => { de.CaptionStyle.ForeColor = Color.Red; de.CaptionStyle.Font.Bold = true; }); settings.OptionsForms.DialogLayoutSettings.AppointmentDialog.ViewModel.PrepareControlFor(m => m.Description, (ASPxMemo me) => { me.ForeColor = Color.Blue; me.Font.Bold = true; me.Font.Italic = true; }); settings.OptionsForms.DialogLayoutSettings.AppointmentDialog.ViewModel.SetItemVisibilityCondition("Location", false); settings.OptionsForms.DialogLayoutSettings.AppointmentDialog.ViewModel.SetItemVisibilityCondition(vm => vm.IsAllDay, false); return(settings); }
public static SchedulerSettings CreateSchedulerSettings(this HtmlHelper htmlHelper) { SchedulerSettings settings = new SchedulerSettings(); settings.Name = "scheduler"; settings.CallbackRouteValues = new { Controller = "Home", Action = "SchedulerPartial" }; settings.EditAppointmentRouteValues = new { Controller = "Home", Action = "EditAppointment" }; settings.Storage.Appointments.Assign(DefaultAppointmentStorage); settings.Storage.Resources.Assign(DefaultResourceStorage); settings.Storage.Appointments.ResourceSharing = true; settings.Start = new DateTime(2008, 7, 11); return(settings); }
public static SchedulerSettings GetSchedulerSettings() { SchedulerSettings settings = new SchedulerSettings(); settings.Name = "scheduler"; settings.CallbackRouteValues = new { Controller = "Home", Action = "SchedulerPartial" }; settings.EditAppointmentRouteValues = new { Controller = "Home", Action = "EditAppointment" }; settings.Storage.Appointments.Assign(SchedulerDataHelper.DefaultAppointmentStorage); settings.Storage.Resources.Assign(SchedulerDataHelper.DefaultResourceStorage); settings.Storage.EnableReminders = false; settings.GroupType = SchedulerGroupType.Resource; settings.Views.DayView.Styles.ScrollAreaHeight = 400; settings.Start = DateTime.Now; return(settings); }
static SchedulerSettings CreateExportSchedulerSettings() { SchedulerSettings settings = new SchedulerSettings(); settings.Name = "schedulerExport"; settings.CallbackRouteValues = new { Controller = "Scheduler", Action = "ICalendarPartial" }; settings.ActiveViewType = SchedulerViewType.WorkWeek; settings.Start = new DateTime(2010, 7, 14); settings.Views.DayView.Styles.ScrollAreaHeight = Unit.Pixel(200); settings.Views.WorkWeekView.Styles.ScrollAreaHeight = Unit.Pixel(200); settings.Storage.EnableReminders = false; settings.Storage.Appointments.Assign(DefaultAppointmentStorage); settings.Storage.Resources.Assign(DefaultResourceStorage); settings.OptionsCustomization.AllowAppointmentCreate = UsedAppointmentType.None; settings.OptionsCustomization.AllowAppointmentEdit = UsedAppointmentType.None; settings.OptionsCustomization.AllowAppointmentDelete = UsedAppointmentType.None; return(settings); }
static SchedulerSettings CreateExportSchedulerSettings() { SchedulerSettings settings = new SchedulerSettings(); settings.Name = "schedulerExport"; settings.CallbackRouteValues = new { Controller = "Features", Action = "ICalendarPartial" }; settings.ActiveViewType = SchedulerViewType.WorkWeek; settings.Start = new DateTime(2014, 5, 23); settings.Views.DayView.Styles.ScrollAreaHeight = Unit.Pixel(200); settings.Views.WorkWeekView.Styles.ScrollAreaHeight = Unit.Pixel(200); settings.Views.WeekView.Enabled = false; settings.Views.FullWeekView.Enabled = true; settings.Storage.EnableReminders = false; settings.Storage.Appointments.Assign(DefaultAppointmentStorage); settings.Storage.Resources.Assign(DefaultResourceStorage); settings.OptionsCustomization.AllowAppointmentCreate = UsedAppointmentType.None; settings.OptionsCustomization.AllowAppointmentEdit = UsedAppointmentType.None; settings.OptionsCustomization.AllowAppointmentDelete = UsedAppointmentType.None; return settings; }
/// <summary> /// Imports data from the given serialization object. /// </summary> /// <param name="serial"></param> internal static void Import(SchedulerSettings serial) { s_schedule.Clear(); foreach (SerializableScheduleEntry serialEntry in serial.Entries) { SerializableRecurringScheduleEntry serialReccuringEntry = serialEntry as SerializableRecurringScheduleEntry; if (serialReccuringEntry != null) { s_schedule.Add(new RecurringScheduleEntry(serialReccuringEntry)); } else { s_schedule.Add(new SimpleScheduleEntry(serialEntry)); } } // Notify to subscribers EveMonClient.OnSchedulerChanged(); }
public SerializableSettings() { m_plans = new Collection <SerializablePlan>(); m_apiKeys = new Collection <SerializableAPIKey>(); m_characters = new Collection <SerializableSettingsCharacter>(); m_monitoredCharacters = new Collection <MonitoredCharacterSettings>(); CloudStorageServiceProvider = new CloudStorageServiceProviderSettings(); PortableEveInstallations = new PortableEveInstallationsSettings(); Notifications = new NotificationSettings(); APIProviders = new APIProvidersSettings(); LoadoutsProvider = new LoadoutsProviderSettings(); MarketPricer = new MarketPricerSettings(); Exportation = new ExportationSettings(); Scheduler = new SchedulerSettings(); Calendar = new CalendarSettings(); Updates = new UpdateSettings(); Proxy = new ProxySettings(); G15 = new G15Settings(); UI = new UISettings(); }
private void ProcessWatcherAlerts() { IConfiguration configuration = GeminiApp.Container.Resolve <IConfiguration>(); var inputConfig = configuration.Get(); SchedulerSettings settings = inputConfig.SchedulerSettings.HasValue() ? inputConfig.SchedulerSettings.FromJson <SchedulerSettings>() : new SchedulerSettings(); DateTime lastChecked = settings.LastCheckedWatchers.HasValue ? settings.LastCheckedWatchers.Value : DateTime.UtcNow; IssuesFilter filter = new IssuesFilter(); filter.RevisedAfter = lastChecked.ToString(); filter.IncludeClosed = true; LogDebugMessage("Last checked for watched item alerts: " + lastChecked); settings.LastCheckedWatchers = DateTime.UtcNow; List <IssueDto> issues = _issueManager.GetFiltered(filter); LogDebugMessage("Item that have changed: " + issues.Count); if (issues.Count > 0) { ProcessWatchers(issues, lastChecked); } GeminiConfiguration config = configuration.Get(); config.SchedulerSettings = settings.ToJson(); ConfigurationItem item = new ConfigurationItem(); item.SettingId = GeminiConfigurationOption.SchedulerSettings.ToString(); item.SettingValue = config.SchedulerSettings; configuration.Update(item); GeminiApp.RefreshConfig(config); }
public async Task <IActionResult> SaveJob([FromBody] SchedulerJob[] jobs) { var settings = new SchedulerSettings { Jobs = jobs }; try { settings.Validate(); } catch (Exception x) { return(BadRequest(x.ToString())); } this._configurationWriter.Save(settings); // Give some time to IConfiguration to grab changes! await Task.Delay(1500); await _scheduler.Reload(); return(Ok(await _scheduler.GetStatus())); }
public static SchedulerSettings CreateSchedulerSettings(this HtmlHelper htmlHelper) { SchedulerSettings settings = new SchedulerSettings(); settings.Name = "scheduler"; settings.CallbackRouteValues = new { Controller = "Home", Action = "SchedulerPartial" }; settings.EditAppointmentRouteValues = new { Controller = "Home", Action = "EditAppointment" }; settings.Storage.Appointments.Assign(DefaultAppointmentStorage); settings.Storage.Resources.Assign(DefaultResourceStorage); settings.AppointmentFormShowing = (sender, e) => { MVCxScheduler scheduler = sender as MVCxScheduler; if (scheduler != null) { e.Container = new CustomAppointmentFormTemplateContainer(scheduler); } }; settings.OptionsForms.SetAppointmentFormTemplateContent(c => { CustomAppointmentFormTemplateContainer container = (CustomAppointmentFormTemplateContainer)c; ValidationSchedule schedule = new ValidationSchedule() { ID = container.Appointment.Id == null ? -1 : (int)container.Appointment.Id, Subject = container.Appointment.Subject, StartTime = container.Appointment.Start, EndTime = container.Appointment.End, Price = container.Price, }; htmlHelper.ViewData["DeleteButtonEnabled"] = container.CanDeleteAppointment; htmlHelper.RenderPartial("CustomAppointmentFormPartial", schedule); }); settings.Storage.Appointments.ResourceSharing = true; settings.Start = new DateTime(2008, 7, 11); return(settings); }
public static SchedulerSettings CreateSchedulerSettings(this HtmlHelper htmlHelper) { SchedulerSettings settings = new SchedulerSettings(); settings.Name = "scheduler"; settings.CallbackRouteValues = new { Controller = "Home", Action = "SchedulerPartial" }; settings.EditAppointmentRouteValues = new { Controller = "Home", Action = "EditAppointment" }; settings.Storage.Appointments.Assign(DefaultAppointmentStorage); settings.Storage.Resources.Assign(DefaultResourceStorage); settings.GroupType = SchedulerGroupType.Resource; settings.ActiveViewType = SchedulerViewType.Timeline; settings.Views.TimelineView.Styles.TimelineCellBody.Height = System.Web.UI.WebControls.Unit.Pixel(80); settings.ClientSideEvents.BeginCallback = "OnBeginCallback"; settings.Storage.Appointments.ResourceSharing = true; settings.Start = new DateTime(2008, 7, 11); return(settings); }
static SchedulerSettings CreateSchedulerSettings() { //Database.SetInitializer(new SchedulerContextSeedInilializer()); LocalContext.Database.Initialize(true); LocalContext.EfAppointments.Load(); LocalContext.EfResources.Load(); SchedulerSettings settings = new SchedulerSettings(); settings.Name = "scheduler"; settings.CallbackRouteValues = new { Controller = "Scheduler", Action = "SchedulerPartial" }; settings.EditAppointmentRouteValues = new { Controller = "Scheduler", Action = "EditAppointment" }; settings.Storage.Appointments.Assign(SchedulerDataHelper.DefaultAppointmentStorage); settings.Storage.Resources.Assign(SchedulerDataHelper.DefaultResourceStorage); settings.Storage.Appointments.ResourceSharing = true; settings.Storage.Resources.ColorSaving = ColorSavingType.ArgbColor; settings.GroupType = SchedulerGroupType.Resource; //settings.Width = 900; //settings.Views.WeekView.Styles.DateCellBody.Height = 50; settings.Views.MonthView.CellAutoHeightOptions.Mode = AutoHeightMode.FitToContent; settings.Views.MonthView.AppointmentDisplayOptions.AppointmentAutoHeight = true; settings.Views.MonthView.AppointmentDisplayOptions.TimeDisplayType = AppointmentTimeDisplayType.Clock; //settings.Views.DayView.Styles.ScrollAreaHeight = 250; //settings.Views.DayView.ShowWorkTimeOnly = true; //settings.Views.DayView.DayCount = 2; //settings.Start = new DateTime(2012, 5, 9); settings.ActiveViewType = SchedulerViewType.Agenda; settings.Height = 1200; return(settings); }
static SchedulerSettings CreateSchedulerSettings() { SchedulerSettings settings = new SchedulerSettings(); settings.Name = "scheduler"; settings.CallbackRouteValues = new { Controller = "Home", Action = "SchedulerPartial" }; settings.EditAppointmentRouteValues = new { Controller = "Home", Action = "EditAppointment" }; settings.Storage.Appointments.Assign(SchedulerDataHelper.DefaultAppointmentStorage); settings.Storage.Resources.Assign(SchedulerDataHelper.DefaultResourceStorage); settings.Width = 300; settings.Views.WeekView.Styles.DateCellBody.Height = 50; settings.Views.MonthView.CellAutoHeightOptions.Mode = AutoHeightMode.FitToContent; settings.Views.MonthView.AppointmentDisplayOptions.AppointmentAutoHeight = true; settings.Views.MonthView.AppointmentDisplayOptions.TimeDisplayType = AppointmentTimeDisplayType.Clock; settings.Views.DayView.Styles.ScrollAreaHeight = 250; settings.Views.DayView.ShowWorkTimeOnly = true; settings.Views.DayView.DayCount = 2; settings.Start = new DateTime(2012, 5, 9); settings.ActiveViewType = SchedulerViewType.Day; return(settings); }
public static SchedulerSettings GetSchedulerSettings(this System.Web.Mvc.HtmlHelper customHtml) { SchedulerSettings settings = new SchedulerSettings(); settings.Name = "scheduler"; settings.InitClientAppointment = (sched, evargs) => { evargs.Properties.Add(DevExpress.Web.ASPxScheduler.ClientSideAppointmentFieldNames.AppointmentType, evargs.Appointment.Type); evargs.Properties.Add(DevExpress.Web.ASPxScheduler.ClientSideAppointmentFieldNames.Subject, evargs.Appointment.Subject); }; settings.PopupMenuShowing = (sched, evargs) => { if (evargs.Menu.MenuId == SchedulerMenuItemId.AppointmentMenu) { evargs.Menu.ClientSideEvents.PopUp = "OnAppointmentMenuPopup"; } }; settings.CallbackRouteValues = new { Controller = "Home", Action = "SchedulerPartial" }; settings.EditAppointmentRouteValues = new { Controller = "Home", Action = "EditAppointment" }; settings.CustomActionRouteValues = new { Controller = "Home", Action = "CustomCallBackAction" }; settings.Storage.Appointments.Assign(SchedulerDataHelper.DefaultAppointmentStorage); settings.Storage.Resources.Assign(SchedulerDataHelper.DefaultResourceStorage); settings.Storage.EnableReminders = true; settings.GroupType = SchedulerGroupType.Resource; settings.Views.DayView.Styles.ScrollAreaHeight = 400; settings.Start = DateTime.Now; settings.AppointmentFormShowing = (sender, e) => { var scheduler = sender as MVCxScheduler; if (scheduler != null) { e.Container = new CustomAppointmentTemplateContainer(scheduler); } }; settings.OptionsForms.RecurrenceFormName = "appointmentRecurrenceForm"; settings.OptionsForms.SetAppointmentFormTemplateContent(c => { var container = (CustomAppointmentTemplateContainer)c; ModelAppointment modelAppointment = new ModelAppointment() { ID = container.Appointment.Id == null ? -1 : (int)container.Appointment.Id, Subject = container.Appointment.Subject, Location = container.Appointment.Location, StartTime = container.Appointment.Start, EndTime = container.Appointment.End, AllDay = container.Appointment.AllDay, Description = container.Appointment.Description, EventType = (int)container.Appointment.Type, Status = Convert.ToInt32(container.Appointment.StatusKey), Label = Convert.ToInt32(container.Appointment.LabelKey), CustomInfo = container.CustomInfo, CompanyID = container.CompanyID, ContactID = container.ContactID, HasReminder = container.Appointment.HasReminder, Reminder = container.Appointment.Reminder, OwnerId = Convert.ToInt32(container.Appointment.ResourceId) }; customHtml.ViewBag.DeleteButtonEnabled = container.CanDeleteAppointment; (container.ResourceDataSource as ListEditItemCollection).RemoveAt(0); customHtml.ViewBag.ResourceDataSource = container.ResourceDataSource; customHtml.ViewBag.StatusDataSource = container.StatusDataSource; customHtml.ViewBag.LabelDataSource = container.LabelDataSource; customHtml.ViewBag.AppointmentRecurrenceFormSettings = CreateAppointmentRecurrenceFormSettings(container); customHtml.ViewBag.ReminderDataSource = container.ReminderDataSource; customHtml.ViewBag.IsBaseAppointment = container.Appointment.Type == AppointmentType.Normal || container.Appointment.Type == AppointmentType.Pattern; customHtml.ViewBag.CompaniesDataSource = GetCompanies(); customHtml.ViewBag.ContactsDataSource = GetCompanyContacts(container.CompanyID); customHtml.RenderPartial("CustomAppointmentFormPartial", modelAppointment); }); return(settings); }
public async Task SetSchedulerSetting(SchedulerSettings settings) { string serializedSettings = JsonSerializer.Serialize(settings); await jsRuntime.InvokeAsync <string>("localStorage.setItem", "scheduler", serializedSettings); }
static SchedulerSettings CreateDateNavigatorSchedulerSettings() { SchedulerSettings settings = new SchedulerSettings(); settings.Name = "scheduler"; settings.CallbackRouteValues = new { Controller = "CalendarFeatures", Action = "DateNavigatorPartial" }; settings.Start = new DateTime(2014, 5, 23); settings.Width = Unit.Pixel(580); settings.Views.DayView.ResourcesPerPage = 2; settings.Views.DayView.Styles.ScrollAreaHeight = Unit.Pixel(400); settings.Views.WeekView.Enabled = false; settings.Views.FullWeekView.Enabled = true; settings.OptionsBehavior.ShowViewNavigator = false; settings.OptionsBehavior.ShowViewSelector = false; settings.Storage.EnableReminders = false; settings.Storage.Resources.Assign(SchedulerDemoHelper.DefaultResourceStorage); settings.Storage.Appointments.Assign(SchedulerDemoHelper.DefaultAppointmentStorage); settings.OptionsCustomization.AllowAppointmentCreate = UsedAppointmentType.None; settings.OptionsCustomization.AllowAppointmentEdit = UsedAppointmentType.None; settings.OptionsCustomization.AllowAppointmentDelete = UsedAppointmentType.None; settings.DateNavigatorExtensionSettings.Name = "dateNavigator"; settings.DateNavigatorExtensionSettings.Width = 220; settings.DateNavigatorExtensionSettings.Properties.Rows = 2; settings.DateNavigatorExtensionSettings.Properties.DayNameFormat = DayNameFormat.FirstLetter; settings.DateNavigatorExtensionSettings.Properties.BoldAppointmentDates = true; return settings; }
static SchedulerSettings CreateReportTemplatesSchedulerSettings() { SchedulerSettings settings = new SchedulerSettings(); settings.Name = "scheduler"; settings.CallbackRouteValues = new { Controller = "Reporting", Action = "ReportTemplatesPartial" }; settings.ActiveViewType = SchedulerViewType.Week; settings.GroupType = SchedulerGroupType.Resource; settings.Start = new DateTime(2014, 5, 23); settings.Width = Unit.Percentage(100); settings.Views.DayView.ResourcesPerPage = 3; settings.Views.DayView.Styles.ScrollAreaHeight = Unit.Pixel(300); settings.Views.WorkWeekView.ResourcesPerPage = 3; settings.Views.WorkWeekView.Styles.ScrollAreaHeight = Unit.Pixel(300); settings.Views.FullWeekView.ResourcesPerPage = 3; settings.Views.WeekView.Enabled = false; settings.Views.FullWeekView.Enabled = true; settings.Views.MonthView.ResourcesPerPage = 3; settings.Views.TimelineView.ResourcesPerPage = 3; settings.Storage.EnableReminders = false; settings.Storage.Appointments.Assign(SchedulerDemoHelper.DefaultAppointmentStorage); settings.Storage.Resources.Assign(SchedulerDemoHelper.DefaultResourceStorage); settings.OptionsCustomization.AllowAppointmentCreate = UsedAppointmentType.None; settings.OptionsCustomization.AllowAppointmentEdit = UsedAppointmentType.None; settings.OptionsCustomization.AllowAppointmentDelete = UsedAppointmentType.None; return settings; }
public static SchedulerSettings GetSchedulerSettingsByFeedProvider(int feedProviderId) { SchedulerSettings schedulerSettings = null; var lstSqlParameter = new List <SqlParameter>(); lstSqlParameter.Add(new SqlParameter() { ParameterName = "@FeedProviderId", SqlDbType = SqlDbType.Int, Value = feedProviderId }); var dt = DBProvider.GetDataTable("GetSchedulerSettingsByFeedProvider", CommandType.StoredProcedure, ref lstSqlParameter); if (dt != null && dt.Rows.Count > 0) { foreach (DataRow row in dt.Rows) { var feedProvider = new FeedProvider() { Id = Convert.ToInt32(row["FeedProviderId"]), Name = Convert.ToString(row["Name"]), Source = Convert.ToString(row["Source"]), IsIminConnector = Convert.ToBoolean(row["IsIminConnector"]), DataType = new FeedDataType() { Id = Convert.ToInt32(row["FeedDataTypeId"]), Name = Convert.ToString(row["FeedDataTypeName"]) }, EndpointUp = Convert.ToBoolean(row["EndpointUp"]), UsesPagingSpec = Convert.ToBoolean(row["UsesPagingSpec"]), IsOpenActiveCompatible = Convert.ToBoolean(row["IsOpenActiveCompatible"]), IncludesCoordinates = Convert.ToBoolean(row["IncludesCoordinates"]), IsFeedMappingConfirmed = Convert.ToBoolean(row["IsFeedMappingConfirmed"]) }; if (row["Id"] != DBNull.Value) { schedulerSettings = new SchedulerSettings() { Id = Convert.ToInt32(row["Id"]), FeedProvider = feedProvider, StartDateTime = Convert.ToDateTime(row["StartDateTime"]), liStartDateTime = Convert.ToInt64(row["StartDateTimeStamp"]), IsEnabled = Convert.ToBoolean(row["IsEnabled"]), SchedulerFrequencyId = Convert.ToInt32(row["SchedulerFrequencyId"]) }; if (row["ExpiryDateTime"] != DBNull.Value) { schedulerSettings.ExpiryDateTime = Convert.ToDateTime(row["ExpiryDateTime"]); schedulerSettings.liExpiryDateTime = Convert.ToInt64(row["ExpiryDateTimeStamp"]); } if (row["RecurranceInterval"] != DBNull.Value) { schedulerSettings.RecurranceInterval = Convert.ToInt32(row["RecurranceInterval"]); } if (row["RecurranceDaysInWeek"] != DBNull.Value) { schedulerSettings.RecurranceDaysInWeek = Convert.ToString(row["RecurranceDaysInWeek"]); } if (row["RecurranceMonths"] != DBNull.Value) { schedulerSettings.RecurranceMonths = Convert.ToString(row["RecurranceMonths"]); } if (row["RecurranceDatesInMonth"] != DBNull.Value) { schedulerSettings.RecurranceDatesInMonth = Convert.ToString(row["RecurranceDatesInMonth"]); } if (row["RecurranceWeekNos"] != DBNull.Value) { schedulerSettings.RecurranceWeekNos = Convert.ToString(row["RecurranceWeekNos"]); } if (row["RecurranceDaysInWeekForMonth"] != DBNull.Value) { schedulerSettings.RecurranceDaysInWeekForMonth = Convert.ToString(row["RecurranceDaysInWeekForMonth"]); } } else { schedulerSettings = new SchedulerSettings() { FeedProvider = feedProvider }; } break; } } return(schedulerSettings); }
public RateLimitedTelegramRequestSchedulerTests() { _schedulerSettings = SchedulerSettings.Default; _scheduler = new TelegramRequestScheduler(_schedulerSettings); }
private ScheduledProject GetScheduledProject(SchedulerSettings settings) => settings.ScheduledProjects .FirstOrDefault(p => p.ProjectId == _projectPath);
public static SchedulerSettings GetSchedulerSettings() { SchedulerSettings settings = new SchedulerSettings(); settings.Name = "Scheduler"; settings.CallbackRouteValues = new { Controller = "ResourceRequests", Action = "SchedulerPartial" }; settings.EditAppointmentRouteValues = new { Controller = "ResourceRequests", Action = "SchedulerPartialEditAppointment" }; settings.ActiveViewType = SchedulerViewType.Agenda; settings.Views.AgendaView.DayCount = 7; settings.OptionsBehavior.ShowFloatingActionButton = false; settings.Storage.Appointments.Assign(AppointmentStorage); settings.Storage.Resources.Assign(ResourceStorage); settings.Storage.EnableReminders = true; settings.Views.DayView.Enabled = false; settings.Views.WorkWeekView.Enabled = false; settings.Views.WeekView.Enabled = true; settings.Views.MonthView.Enabled = true; settings.Views.TimelineView.Enabled = false; settings.Views.AgendaView.Enabled = true; settings.Views.AgendaView.AppointmentDisplayOptions.ShowResource = true; settings.Views.DayView.Styles.ScrollAreaHeight = 610; settings.Views.DayView.WorkTime.Start = new TimeSpan(7, 0, 0); settings.Views.DayView.WorkTime.End = new TimeSpan(20, 0, 0); settings.Views.DayView.ShowWorkTimeOnly = true; settings.Views.DayView.ResourcesPerPage = 5; // Work Days View settings.WorkDays.Add(WeekDays.Saturday); settings.Views.WorkWeekView.Styles.ScrollAreaHeight = 610; settings.Views.WorkWeekView.WorkTime.Start = new TimeSpan(7, 0, 0); settings.Views.WorkWeekView.WorkTime.End = new TimeSpan(20, 0, 0); settings.Views.WorkWeekView.ShowWorkTimeOnly = true; settings.Views.WorkWeekView.ResourcesPerPage = 1; // Month View settings.Views.MonthView.ResourcesPerPage = 1; settings.Storage.Appointments.ResourceSharing = false; //SchedulerCompatibility.Base64XmlObjectSerialization = false; //settings.ClientSideEvents.AppointmentDeleting = "OnAppointmentDeleting"; //settings.ClientSideEvents.EndCallback = "OnAppointmentEndCallBack"; //settings.ClientSideEvents.AppointmentClick = "function(s,e){ OnAppointmentEventsClick(s,e); }"; //settings.ClientSideEvents.BeginCallback = "OnBeginCallback"; settings.AppointmentFormShowing += Scheduler_AppointmentFormShowing; settings.PopupMenuShowing = (sender, e) => { if (e.Menu.MenuId == SchedulerMenuItemId.AppointmentMenu) { DevExpress.Web.MenuItem item = e.Menu.Items.FindByName("DeleteAppointment") as DevExpress.Web.MenuItem; item.Text = "Cancel Appointment"; DevExpress.Web.MenuItem statusMenu = e.Menu.Items.FindByName(SchedulerMenuItemId.StatusSubMenu.ToString()); if (statusMenu != null) { statusMenu.Visible = false; } DevExpress.Web.MenuItem labelMenu = e.Menu.Items.FindByName(SchedulerMenuItemId.LabelSubMenu.ToString()); if (labelMenu != null) { labelMenu.Text = "Priority"; } //Hide items temerary as delete button not working. Need to establish if its bug in DevExpress 17.1 release if (item != null) { item.Visible = false; } if (labelMenu != null) { labelMenu.Visible = false; } } else { e.Menu.Items.Clear(); } }; settings.AppointmentFormShowing = (sender, e) => { //Console.WriteLine(e.ToString()); }; return(settings); }