public void Dispose() { if (_activeLifetime == this) { _activeLifetime = null; } }
public CefNetApplicationLifetime() { if (_activeLifetime is null) { _activeLifetime = this; } else { throw new InvalidOperationException($"Can not have multiple active {this.GetType().Name} instances and the previously created one was not disposed."); } }
public static int StartWithCefNetApplicationLifetime <T>(this T builder, string[] args, ShutdownMode shutdownMode = ShutdownMode.OnLastWindowClose) where T : AppBuilderBase <T>, new() { CefNetApplicationLifetime lifetime = new CefNetApplicationLifetime { Args = args, ShutdownMode = shutdownMode }; builder.SetupWithLifetime(lifetime); return(lifetime.Start(args)); }