This file contains 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
#region Hide System.Object inherited methods | |
/// <summary> | |
/// Determines whether the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>. | |
/// </summary> | |
/// <returns> | |
/// true if the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>; otherwise, false. | |
/// </returns> | |
/// <param name="obj">The <see cref="T:System.Object"/> to compare with the current <see cref="T:System.Object"/>. </param><filterpriority>2</filterpriority> | |
[EditorBrowsable(EditorBrowsableState.Never)] |
This file contains 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
namespace Facebook.Web | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics.CodeAnalysis; | |
using System.Diagnostics.Contracts; | |
using System.Linq; | |
using System.Text; |
This file contains 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
namespace HttpWebHelperSample | |
{ | |
// http://stackoverflow.com/questions/3963483/stitching-together-multiple-streams-in-one-stream-class | |
// todo: implement BeginRead and EndRead. | |
internal class CombinationStream : System.IO.Stream | |
{ | |
private readonly System.Collections.Generic.IList<System.IO.Stream> streams; | |
private int currentStreamIndex; | |
private System.IO.Stream currentStream; | |
private long length = -1; |
This file contains 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
var result = fb.Batch( | |
new FacebookBatchParameter { HttpMethod = HttpMethod.Get, Path = "/4" }, | |
new FacebookBatchParameter(HttpMethod.Get, "/me/friends", new Dictionary<string, object> { { "limit", 10 } }) { Data = new { name = "friends", omit_response_on_success = false } }, | |
new FacebookBatchParameter("/me", new { fields = new[] { "id", "name" } }), | |
new FacebookBatchParameter("/me/feed", new { limit = 10 }), | |
new FacebookBatchParameter(HttpMethod.Post, "/me/feed", new { message = "test status update" })); |
This file contains 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
private static void Get() | |
{ | |
var ms = new MemoryStream(); | |
var request = new FluentHttpRequest() | |
.BaseUrl("https://graph.facebook.com") | |
.ResourcePath("/prabirshrestha") | |
.Method("GET") | |
.QueryStrings(qs => | |
qs |
This file contains 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
// original code from http://tomasp.net/blog/csharp-async.aspx | |
// converted to C# 2.0 compatible code and modified to support exceptions. | |
namespace AsyncEnumerator | |
{ | |
using System; | |
using System.Collections.Generic; | |
#if ASYNC_ENUMERATOR_INTERNAL | |
internal |
This file contains 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 DateTimeHelpers | |
{ | |
private static readonly string[] Iso8601Format = new[] | |
{ | |
"yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'", | |
@"yyyy-MM-dd\THH:mm:ssK" | |
}; | |
//SortableDateTimePattern (ISO 8601) | |
public static string ToIso8601(DateTime value) |
This file contains 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 MefServiceLocator : ServiceLocatorImplBase | |
{ | |
private ExportProvider provider; | |
public MefServiceLocator(ExportProvider provider) | |
{ | |
this.provider = provider; | |
} | |
protected override object DoGetInstance(Type serviceType, string key) |
This file contains 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
protected void Page_Load(object sender, EventArgs e) | |
{ | |
// http://developers.facebook.com/docs/authentication/permissions/ | |
var auth = new CanvasAuthorizer { Permissions = new[] { "user_videos", "publish_stream" } }; | |
if (auth.Authorize()) | |
{ | |
ShowFacebookContent(); | |
} | |
} |