private static void InitializeClient(string[] args) { _client = new SkypeCefOffScreenClient(); _client.StatusChanged += ClientOnStatusChanged; _client.IncomingCall += ClientOnIncomingCall; _client.CallStatusChanged += (sender, eventArgs) => Console.WriteLine(eventArgs); _client.MessageReceived += (sender, eventArgs) => Console.WriteLine(eventArgs); Console.WriteLine("Logging in"); _client.Login(args[0], args[1]); }
static void Main(string[] args) { IServiceCollection services = new ServiceCollection(); services.AddLogging(logging => { logging.AddDebug(); logging.AddConsole(); }); #if DEBUG services.Configure <LoggerFilterOptions>(options => options.MinLevel = LogLevel.Debug); #endif services.AddSingleton <SkypeCefOffScreenClient>(); var serviceProvider = services.BuildServiceProvider(); if (args.Length == 2) { Console.WriteLine("Creating new instance of client"); client = serviceProvider.GetService <SkypeCefOffScreenClient>(); client.StatusChanged += OnAppOnStatusChanged; client.IncomingCall += (sender, eventArgs) => Console.WriteLine(eventArgs); client.CallStatusChanged += (sender, eventArgs) => Console.WriteLine(eventArgs); client.MessageReceived += OnClientOnMessageReceived; Console.WriteLine("Starting authentication. This might take a few seconds."); client.Login(args[0], args[1]); Console.ReadKey(); } else { Console.WriteLine("Parameters mismatch"); } }