public override void Execute() { if (!ModeChosen) { throw new InvalidOperationException("Invalid mode"); } var mgr = new FlickrManager(); mgr.InteractiveAuthorize(); Console.WriteLine("Please enter the code displayed on the website:"); var code = Console.ReadLine(); mgr.InteractiveAuthorizeComplete(code); var token = mgr.GetToken(); using (var stream = KeyFile.OpenWrite()) { token.ToXml(stream, Encoding.UTF8, null); } Console.WriteLine($"Token successfully exported to\r\n{KeyFile.FullName}"); }