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 AsImage(this UIView view) | |
| { | |
| UIGraphics.BeginImageContextWithOptions(view.Bounds.Size, true, 0); | |
| view.Layer.RenderInContext(UIGraphics.GetCurrentContext()); | |
| var img = UIGraphics.GetImageFromCurrentImageContext(); | |
| UIGraphics.EndImageContext(); | |
| return img; | |
| } |
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.Collections.Generic; | |
| using System.Linq; | |
| using MonoTouch.MessageUI; | |
| using MonoTouch.UIKit; | |
| namespace MyApp | |
| { | |
| public interface ICanCleanUpMyself | |
| { |
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
| // | |
| // UIView+Orientation.h | |
| // | |
| #import <UIKit/UIKit.h> | |
| // These macros should only be used if you MUST know the interface orientation for the device itself, for example when displaying a new UIWindow. | |
| // This should be very rare; generally you should only look at the immediate parent view's size (or "view orientation" using the category below). | |
| #define StatusBarOrientationIsPortrait UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation]) | |
| #define StatusBarOrientationIsLandscape UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation]) |
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 void Fade (this UIView view, bool isIn, double duration = 0.3, Action onFinished = null) | |
| { | |
| var minAlpha = (nfloat)0.0f; | |
| var maxAlpha = (nfloat)1.0f; | |
| view.Alpha = isIn ? minAlpha : maxAlpha; | |
| view.Transform = CGAffineTransform.MakeIdentity (); | |
| UIView.Animate (duration, 0, UIViewAnimationOptions.CurveEaseInOut, | |
| () => { | |
| view.Alpha = isIn ? maxAlpha : minAlpha; |
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.Drawing; | |
| using MonoTouch.Foundation; | |
| using MonoTouch.UIKit; | |
| namespace CollectionViewWithControllerDemo | |
| { | |
| public class Controller : UIViewController | |
| { | |
| CVSource source; |
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
| /** | |
| * WkHtmlToPdf table vertically-splitting hack | |
| * Script to automatically split wide HTML tables that doesn't fit the width of the PDF page generated | |
| * by WkHtmlToPdf (or equivalent) | |
| * | |
| * The general idea come from Florin Stancu <[email protected]> and his script wkhtmltopdf.tablesplit.js | |
| * The implementation is quite different because the splitting is done vertically on a excessive | |
| * wide table, while the original script was meant to split horizontally an excessive long table | |
| * | |
| * To use, you must adjust pdfPage object's contents to reflect your PDF's |
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
| // Usage: | |
| // Put this in a separate file and load it as the first module | |
| // (See https://github.com/jrburke/requirejs/wiki/Internal-API:-onResourceLoad) | |
| // Methods available after page load: | |
| // rtree.map() | |
| // - Fills out every module's map property under rtree.tree. | |
| // - Print out rtree.tree in the console to see their map property. | |
| // rtree.toUml() | |
| // - Prints out a UML string that can be used to generate UML | |
| // - UML Website: http://yuml.me/diagram/scruffy/class/draw |
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.Collections.Generic; | |
| using System.Linq; | |
| using System.Linq.Expressions; | |
| using MonoTouch.UIKit; | |
| namespace Async.iOS | |
| { | |
| public static class Layout | |
| { |
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
| /** | |
| * WkHtmlToPdf table splitting hack. | |
| * | |
| * Script to automatically split multiple-pages-spanning HTML tables for PDF | |
| * generation using webkit. | |
| * | |
| * To use, you must adjust pdfPage object's contents to reflect your PDF's | |
| * page format. | |
| * The tables you want to be automatically splitted when the page ends must | |
| * have a class name of "splitForPrint" (can be changed). |