/// <summary> /// Sets the engine configuration. /// </summary> /// <param name="Configuration">The configuration.</param> /// <exception cref="System.ArgumentNullException"> /// Configuration - Configuration is null /// or /// Process - Configuration->Process is null /// </exception> public void SetConfiguration(BekoConfig Configuration) { if (this.IsDisposed) { throw new ObjectDisposedException(nameof(BekoEngine), "The engine is disposed"); } if (Configuration == null) { throw new ArgumentNullException(nameof(Configuration), "Configuration is null"); } if (Configuration.Process == null) { throw new ArgumentNullException(nameof(Configuration.Process), "Configuration->Process is null"); } if (Configuration.MemoryHandler == null) { throw new ArgumentNullException(nameof(Configuration.MemoryHandler), "Configuration->MemoryHandler is null"); } if (Configuration.RequestsHandler == null) { throw new ArgumentNullException(nameof(Configuration.MemoryHandler), "Configuration->RequestsHandler is null"); } this.Configuration = Configuration; this.SetProcess(Configuration.Process, true); }
/// <summary> /// Returns a new instance of the <see cref="BekoEngine"/> class, /// and initializes it with the given configuration. /// </summary> /// <param name="Configuration">The configuration.</param> public static BekoEngine FromConfiguration(BekoConfig Configuration) { return(new BekoEngine(Configuration)); }
/// <summary> /// Initializes a new instance of the <see cref="BekoEngine"/> class. /// </summary> /// <param name="Configuration">The configuration.</param> public BekoEngine(BekoConfig Configuration) : this() { this.SetConfiguration(Configuration); }