public void ChangeSchedule(SchedulePart s, bool check) { if (check) { _context.ScheduleParts.Find(s.Id).IsChecked = check; } else { _context.ScheduleParts.Remove(_context.ScheduleParts.Find(s.Id)); } }
/// <summary> /// Registers a job to be executed using Autofac as resolving container. /// </summary> /// <param name="part">The fluent part upon which the job is to be registered.</param> /// <param name="serviceName">The name used when registering the component with Autofac.</param> /// <returns>A part that allows chained fluent method calls.</returns> public static JobPart Run(this SchedulePart part, string serviceName) { return(part.With(() => RootContainer.BeginLifetimeScope()).Run(c => c.ResolveNamed <ICronJob>(serviceName))); }
/// <summary> /// Registers a job to be executed using Autofac as resolving container. /// </summary> /// <typeparam name="TJob">The type of job to be registered. Must implement <see cref="ICronJob"/>.</typeparam> /// <param name="part">The fluent part upon which the job is to be registered.</param> /// <returns>A part that allows chained fluent method calls.</returns> public static JobPart Run <TJob>(this SchedulePart part) where TJob : ICronJob { return(part.With(() => RootContainer.BeginLifetimeScope()).Run(c => c.Resolve <TJob>())); }
public void AddSchedule(SchedulePart s) { _context.ScheduleParts.Add(s); }
/// <summary> /// Registers a job for execution using the job type as parameter. /// </summary> /// <param name="part">The fluent part upon which the job is to be registered.</param> /// <param name="jobType">The type of the job to be created.</param> /// <returns>A part that allows chained fluent method calls.</returns> public static JobPart Run(this SchedulePart part, Type jobType) { var constructor = jobType.GetConstructor(NoFormalArguments); return(part.Run(() => (ICronJob)constructor.Invoke(NoActualArguments))); }
/// <summary> /// Registers a job for execution using the job type name as parameter. /// </summary> /// <param name="part">The fluent part upon which the job is to be registered.</param> /// <param name="jobType">The fully qualified type name of the job (including assembly name if from seperate assembly).</param> /// <returns>A part that allows chained fluent method calls.</returns> public static JobPart Run(this SchedulePart part, string jobType) { var type = Type.GetType(jobType, true, false); return(part.Run(type)); }
/// <summary> /// Registers a job to be executed using LightCore as resolving container. /// </summary> /// <typeparam name="TJob">The type of job to be registered. Must implement <see cref="ICronJob"/>.</typeparam> /// <param name="part">The fluent part upon which the job is to be registered.</param> /// <param name="activatorFunction">The activator function to which the object creation is delegated.</param> /// <returns>A part that allows chained fluent method calls.</returns> public static JobPart Run <TJob>(this SchedulePart part, Func <IContainer, TJob> activatorFunction) where TJob : ICronJob { return(part.With(() => LightCoreContainer.GetContainer()).Run(c => c.Resolve <TJob>(activatorFunction))); }
/// <summary> /// Registers a job to be executed using LightCore as resolving container. /// </summary> /// <typeparam name="TJob">The type of job to be registered. Must implement <see cref="ICronJob"/>.</typeparam> /// <param name="part">The fluent part upon which the job is to be registered.</param> /// <param name="namedArguments">The named arguments that are injected into the resolved type.</param> /// <returns>A part that allows chained fluent method calls.</returns> public static JobPart Run <TJob>(this SchedulePart part, IDictionary <string, object> namedArguments) where TJob : ICronJob { return(part.With(() => LightCoreContainer.GetContainer()).Run(c => c.Resolve <TJob>(namedArguments))); }
/// <summary> /// Registers a job to be executed using LightCore as resolving container. /// </summary> /// <typeparam name="TJob">The type of job to be registered. Must implement <see cref="ICronJob"/>.</typeparam> /// <param name="part">The fluent part upon which the job is to be registered.</param> /// <param name="arguments">The arguments that are injected into the resolved type.</param> /// <returns>A part that allows chained fluent method calls.</returns> public static JobPart Run <TJob>(this SchedulePart part, IEnumerable <object> arguments) where TJob : ICronJob { return(part.With(() => LightCoreContainer.GetContainer()).Run(c => c.Resolve <TJob>(arguments))); }
/// <summary> /// Registers a job to be executed using LightCore as resolving container. /// </summary> /// <typeparam name="TJob">The type of job to be registered. Must implement <see cref="ICronJob"/>.</typeparam> /// <param name="part">The fluent part upon which the job is to be registered.</param> /// <param name="namedArguments">The named arguments that are injected into the resolved type.</param> /// <returns>A part that allows chained fluent method calls.</returns> public static JobPart Run <TJob>(this SchedulePart part, AnonymousArgument namedArguments) where TJob : ICronJob { return(part.With(() => LightCoreContainer.GetContainer()).Run(c => c.Resolve <TJob>(namedArguments))); }
/// <summary> /// Registers a job to be executed using LightCore as resolving container. /// </summary> /// <typeparam name="TJob">The type of job to be registered. Must implement <see cref="ICronJob"/>.</typeparam> /// <param name="part">The fluent part upon which the job is to be registered.</param> /// <returns>A part that allows chained fluent method calls.</returns> public static JobPart Run <TJob>(this SchedulePart part) where TJob : ICronJob { return(part.With(() => LightCoreContainer.GetContainer()).Run(c => c.Resolve <TJob>())); }
/// <summary> /// Registers a job to be executed using LightCore as resolving container. /// </summary> /// <param name="part">The fluent part upon which the job is to be registered.</param> /// <param name="contractType">The contract type which is resolved from the container.</param> /// <param name="arguments">The named arguments that are injected into the resolved type.</param> /// <returns>A part that allows chained fluent method calls.</returns> public static JobPart Run(this SchedulePart part, Type contractType, IDictionary <string, object> arguments) { return(part.With(() => LightCoreContainer.GetContainer()).Run(c => c.Resolve(contractType, arguments) as ICronJob)); }
/// <summary> /// Registers a job for execution using the job type as generic parameter. /// </summary> /// <typeparam name="TJob">The type of job to be registered. Must implement <see cref="ICronJob"/> and must have a default (parameterless) constructor.</typeparam> /// <param name="part">The fluent part upon which the job is to be registered.</param> /// <returns>A part that allows chained fluent method calls.</returns> public static JobPart Run <TJob>(this SchedulePart part) where TJob : ICronJob, new() { return(part.Run(() => new TJob())); }
/// <summary> /// Registers a job to be executed using Autofac as resolving container. /// </summary> /// <param name="part">The fluent part upon which the job is to be registered.</param> /// <param name="serviceName">The name used when registering the component with Autofac.</param> /// <returns>A part that allows chained fluent method calls.</returns> public static JobPart Run(this SchedulePart part, string serviceName) { return(part.With(() => RootContainer.CreateInnerContainer()).Run(c => c.Resolve <ICronJob>(serviceName))); }
/// <summary> /// Registers a job to be executed using Autofac as resolving container. /// </summary> /// <typeparam name="TJob">The type of job to be registered. Must implement <see cref="ICronJob"/>.</typeparam> /// <param name="part">The fluent part upon which the job is to be registered.</param> /// <returns>A part that allows chained fluent method calls.</returns> public static JobPart Run <TJob>(this SchedulePart part) where TJob : ICronJob { return(part.With(() => RootContainer.CreateInnerContainer()).Run(c => c.Resolve <TJob>())); }