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 RestSharpExtensions | |
{ | |
public static Task<RestResponse<T>> ExecuteAsync<T>(this IRestClient client, IRestRequest request) where T : new() | |
{ | |
return client.ExecuteAsync<T>(request, CancellationToken.None); | |
} | |
public static Task<RestResponse<T>> ExecuteAsync<T>(this IRestClient client, IRestRequest request, CancellationToken token) where T : new() | |
{ |
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
using System; | |
using System.IO; | |
using System.Net; | |
using System.Text; | |
using System.Threading; | |
using ServiceStack.Common.Web; | |
using ServiceStack.Logging; | |
using ServiceStack.ServiceHost; | |
using ServiceStack.Text; | |
using ServiceStack.ServiceClient.Web; |
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 KeyboardTabBehavior : Behavior<UIElement> | |
{ | |
private KeyboardTabHelper _keyboardTabHelper; | |
protected override void OnAttached() | |
{ | |
base.OnAttached(); | |
_keyboardTabHelper = new KeyboardTabHelper(AssociatedObject); | |
} |
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
using System; | |
namespace Epoch | |
{ | |
public class Epoch | |
{ | |
static readonly DateTime epochStart = new DateTime(1970, 1, 1, 0, 0, 0); | |
static readonly DateTimeOffset epochDateTimeOffset = new DateTimeOffset(1970, 1, 1, 0, 0, 0, TimeSpan.Zero); | |
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
using System.Collections; | |
using System.Collections.ObjectModel; | |
using System.Collections.Specialized; | |
using System.Linq; | |
using System.Windows; | |
using System.Windows.Controls; | |
using Telerik.Windows.Controls; | |
namespace Travefy.UI.WP8.Controls | |
{ |
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 interface IRemove | |
{ | |
ICommand RemoveCommand { get; } | |
} |
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 UIImage ScaleImage(UIImage image, int maxSize) | |
{ | |
UIImage res; | |
using (CGImage imageRef = image.CGImage) | |
{ | |
CGImageAlphaInfo alphaInfo = imageRef.AlphaInfo; | |
CGColorSpace colorSpaceInfo = CGColorSpace.CreateDeviceRGB(); | |
if (alphaInfo == CGImageAlphaInfo.None) |
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
void initCameraView(){ | |
NSError error = null; | |
captureSession = new AVCaptureSession(){ | |
SessionPreset=AVCaptureSession.Preset640x480 | |
}; | |
var device = AVCaptureDevice.DefaultDeviceWithMediaType(AVMediaType.Video); | |
var deviceInput = AVCaptureDeviceInput.FromDevice(device,out error); | |
if(error!=null){ | |
displayErrorOnMainQueueWithMessage(error,"Unable to setup capture"); | |
return; |
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
using System; | |
using MonoTouch.UIKit; | |
using MonoTouch.Foundation; | |
using System.Drawing; | |
namespace TwinCoders.Utils | |
{ | |
public abstract partial class ParentViewController | |
{ |
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
else if (restRequest.ContentType == ContentTypes.MultipartFormData) | |
{ | |
var multipartPartFormDataContent = new MultipartFormDataContent(); | |
var contentJson = new StringContent(restRequest.GetRequestBody()); | |
multipartPartFormDataContent.Add(contentJson); | |
httpRequestMessage.Content = contentJson; | |
if (restRequest.Files.Any()) | |
foreach (var fileParameter in restRequest.Files) | |
{ |