I hereby claim:
- I am dannycabrera on github.
- I am dannyc (https://keybase.io/dannyc) on keybase.
- I have a public key ASAQdo3ygYwQ9-kyIy9iP8hX1969zoXtQFb4vorZMYtX5go
To claim this, I am signing this object:
async void Demo () | |
{ | |
switch (await ShowAlert ("Title", "Message", "Ok", "Cancel")){ | |
case 0: // Ok | |
.... | |
case 1: // Cancel | |
.... | |
} | |
} |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Runtime.InteropServices; | |
using System.Threading; | |
using MonoTouch; | |
using MonoTouch.AVFoundation; | |
using MonoTouch.Foundation; | |
using MonoTouch.UIKit; |
using System; | |
using System.IO; | |
using MonoTouch.Foundation; | |
using MonoTouch.AVFoundation; | |
using MonoTouch.CoreMedia; | |
namespace TestProject.Common | |
{ | |
public class AudioTrim | |
{ |
private UIImage GetVideoThumbnail(string path) | |
{ | |
try { | |
CMTime actualTime; | |
NSError outError; | |
using (var asset = AVAsset.FromUrl (NSUrl.FromFilename (path))) | |
using (var imageGen = new AVAssetImageGenerator (asset)) | |
using (var imageRef = imageGen.CopyCGImageAtTime (new CMTime (1, 1), out actualTime, out outError)) { | |
return UIImage.FromImage (imageRef); | |
} |
NSError error = null; | |
var attributedString = new NSAttributedString (new NSUrl ("...Sample.rtf", false), null, ref error); | |
var attributedTextHolder = new NSMutableAttributedString (attributedString); | |
textView.AllowsEditingTextAttributes = true; | |
textView.AttributedText = attributedTextHolder; |
NSError error1 = null; | |
NSError error2 = null; | |
var atts = new NSAttributedStringDocumentAttributes (); | |
atts.DocumentType = NSDocumentType.RTF; | |
using (var wrapper = textView.AttributedText.GetFileWrapperFromRange (new NSRange (0, textView.Text.Length), atts, ref error1)) | |
{ | |
wrapper.Write (new NSUrl ("...Edited.rtf", false), NSFileWrapperWritingOptions.Atomic, new NSUrl ("...Sample.rtf", false), out error2); | |
} |
using UIKit; | |
void AirPrint (CGRect frame, string pdfOrImageToPrint) | |
{ | |
var printer = UIPrintInteractionController.SharedPrintController; | |
if (printer == null) { | |
Console.WriteLine("Unable to print at this time."); | |
} else { | |
var printInfo = UIPrintInfo.PrintInfo; |
using System; | |
/// <summary> | |
/// Contains approximate string matching | |
/// </summary> | |
static class LevenshteinDistance | |
{ | |
/// <summary> | |
/// Compute the distance between two strings. | |
/// </summary> |
using System; | |
using UIKit; | |
// based on http://blog.functionalfun.net/2008/07/random-pastel-colour-generator.html | |
public static UIColor RandomColor () | |
{ | |
Random random = new Random (); | |
// to create lighter colors: | |
// take a random integer between 0 & 128 (rather than between 0 and 255) |
I hereby claim:
To claim this, I am signing this object: