View ARMSanityCheck.ps1
mkdir C:\ARM-Temp |
View MemoryMonito.cs
public sealed class MemoryMonitor : IDisposable | |
{ | |
#region Private members | |
private bool _isEnabled; | |
private bool _showVisualization; | |
private bool _isInitialized; | |
private bool _currentWarningExceeded; | |
private bool _currentCriticalExceeded; | |
private DispatcherTimer _timer; | |
private Popup _popup = new Popup(); |
View PropertyChangedViewModel.cs
public event PropertyChangedEventHandler PropertyChanged; | |
protected virtual void NotifyPropertyChanged<T>(Expression<Func<T>> propertyEvaluator) | |
{ | |
var lambda = propertyEvaluator as LambdaExpression; | |
var member = lambda.Body as MemberExpression; | |
var handler = PropertyChanged; | |
if (handler != null) | |
{ | |
handler(this, new PropertyChangedEventArgs(member.Member.Name)); |
View CCUtils.cs
public class CCUtils | |
{ | |
public static CCRect CCRectIntersection(CCRect r1, CCRect r2) | |
{ | |
CCRect intersection = new CCRect(Math.Max(CCRect.CCRectGetMinX(r1), CCRect.CCRectGetMinX(r2)), Math.Max(CCRect.CCRectGetMinY(r1), CCRect.CCRectGetMinY(r2)), 0, 0); | |
intersection.size.width = Math.Min(CCRect.CCRectGetMaxX(r1), CCRect.CCRectGetMaxX(r2)) - | |
CCRect.CCRectGetMinX(intersection); | |
intersection.size.height = Math.Min(CCRect.CCRectGetMaxY(r1), CCRect.CCRectGetMaxY(r2)) - | |
CCRect.CCRectGetMinY(intersection); | |
return intersection; |
View Macros.h
#define ApplicationDelegate ((AppDelegate *)[[UIApplication sharedApplication] delegate]) | |
#define UserDefaults [NSUserDefaults standardUserDefaults] | |
#define NotificationCenter [NSNotificationCenter defaultCenter] | |
#define SharedApplication [UIApplication sharedApplication] | |
#define Bundle [NSBundle mainBundle] | |
#define MainScreen [UIScreen mainScreen] | |
#define ShowNetworkActivityIndicator() [UIApplication sharedApplication].networkActivityIndicatorVisible = YES | |
#define HideNetworkActivityIndicator() [UIApplication sharedApplication].networkActivityIndicatorVisible = NO | |
#define NetworkActivityIndicatorVisible(x) [UIApplication sharedApplication].networkActivityIndicatorVisible = x | |
#define NavBar self.navigationController.navigationBar |