public Program() { #region Validate ConsumerKey / ConsumerSecret if (string.IsNullOrWhiteSpace(Settings.Default.ConsumerKey) || string.IsNullOrWhiteSpace(Settings.Default.ConsumerSecret)) { throw new ApplicationException( "The ConsumerKey or ConsumerSecret are not populated! \r\n" + "\r\n" + "If you are running this application from the console, " + "open 'adamprescott.net.TweetConsole.exe.config' with a text editor " + "and set ConsumerKey and ConsumerSecret." + "\r\n" + "\r\n" + "If you are running this application from with Visual Studio," + "update App.config." + "\r\n" + "\r\n" + "Example setting:\r\n" + "\r\n" + "<applicationSettings>\r\n" + "\t<adamprescott.net.TweetConsole.Properties.Settings >\r\n" + "\t\t< setting name = \"ConsumerKey\" serializeAs = \"String\" >\r\n" + "\t\t\t<value>YOUR_CONSUMER_KEY_GOES_HERE</value>\r\n" + "\t\t</ setting >\r\n" + "\t\t<setting name = \"ConsumerSecret\" serializeAs = \"String\">\r\n" + "<value>YOUR_CONSUMER_SECRET_GOES_HERE</value>\r\n" + "\t\t</ setting>\r\n"); } #endregion _twitter = new TwitterConsumer( Settings.Default.ConsumerKey, Settings.Default.ConsumerSecret); }
public Program() { _twitter = new TwitterConsumer(_consumerKey, _consumerSecret); }