This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<configuration> | |
<configSections> | |
<section name="srvConfig" type="Sandrino.MyApplication.ServerConfigurationSection, Sandrino.MyApplication"/> | |
</configSections> | |
<srvConfig port="1986"/> | |
</configuration> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Test] | |
[ExpectedException(typeof(ConfigurationErrorsException))] | |
public void ServerMissing() | |
{ | |
RegisterConfiguration("Configurations\\ServerMissing.config"); | |
// Read the file. | |
var prov = krn.Get<IServerConfigurationProvider>(); | |
var section = prov.Read(); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ClientLogin | |
{ | |
/// <summary> | |
/// Client login url where we'll post login data to. | |
/// </summary> | |
private static string clientLoginUrl = | |
@"https://www.google.com/accounts/ClientLogin"; | |
/// <summary> | |
/// Data to be sent with the post request. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GoogleSession : IDisposable | |
{ | |
/// <summary> | |
/// Auth token. | |
/// </summary> | |
private string auth; | |
/// <summary> | |
/// Initialize request. | |
/// </summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
// Empty line. | |
Console.WriteLine(""); | |
// Get username. | |
Console.Write(" Enter your Google username: "); | |
string username = Console.ReadLine(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Send a post request to Google. | |
/// </summary> | |
/// <param name="url"></param> | |
/// <param name="postFields"></param> | |
/// <returns></returns> | |
public void PostRequest(string url, params GoogleParameter[] postFields) | |
{ | |
// Format the parameters. | |
string formattedParameters = string.Empty; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class GoogleService : IDisposable | |
{ | |
/// <summary> | |
/// Current google session. | |
/// </summary> | |
protected GoogleSession session; | |
/// <summary> | |
/// Creating this class will automatically try to log in and create a session. | |
/// That way for each service we create we don't need to worry about the implementation of authentication and session. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class GoogleSyndicationItem | |
{ | |
/// <summary> | |
/// Initialize the item. | |
/// </summary> | |
/// <param name="item"></param> | |
internal GoogleSyndicationItem(SyndicationItem item) | |
{ | |
if (item != null) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class GoogleSyndicationItem | |
{ | |
/// <summary> | |
/// Initialize the item. | |
/// </summary> | |
/// <param name="item"></param> | |
internal GoogleSyndicationItem(SyndicationItem item) | |
{ | |
if (item != null) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ReaderUrl | |
{ | |
/// <summary> | |
/// Base url for Atom services. | |
/// </summary> | |
public const string AtomUrl = "https://www.google.com/reader/atom/"; | |
/// <summary> | |
/// Base url for API actions. | |
/// </summary> |