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
const string applicationKey = "[your application key goes here"; | |
const string applicationUrl = "[your mobile service url goes here]"; |
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
const string applicationKey = "[Insert Your Azure Mobile Service Application Key Here]"; | |
const string applicationUrl = "[Insert Your Azure Mobile Service URL Here]"; | |
private readonly MobileServiceClient client = new MobileServiceClient(applicationUrl, applicationKey); |
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 override void ViewDidLoad () | |
{ | |
base.ViewDidLoad (); | |
// Perform any additional setup after loading the view, typically from a nib. | |
this.MicrosoftLoginButton.TouchUpInside += (sender, e) => { | |
this.DoLogin(MobileServiceAuthenticationProvider.MicrosoftAccount); | |
}; | |
this.FacebookLoginButton.TouchUpInside += (sender, e) => { |
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 void DoLogin(MobileServiceAuthenticationProvider provider) | |
{ | |
var task = this.client.LoginAsync(this, provider).ContinueWith(t => { | |
MobileServiceUser user = t.Result; | |
this.BeginInvokeOnMainThread(() => { | |
UIAlertView alert = new UIAlertView("Logged In!", string.Format ("Hello user {0}", user.UserId), | |
null, "OK"); | |
alert.Show (); | |
}); |
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
using System; | |
using ThirteenDaysAWeek.TitleAttribute.Models.Attributes; | |
namespace ThirteenDaysAWeek.TitleAttribute.Models | |
{ | |
public enum ReportType | |
{ | |
[ReportTitle(ReportTitle = "Annual Sales Recap", Color = ConsoleColor.DarkGreen)] | |
AnnualSalesRecap, | |
[ReportTitle(ReportTitle = "Sales By Region", Color = ConsoleColor.DarkRed)] |
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 ThirteenDaysAWeek.TitleAttribute | |
{ | |
public static class ReflectionExtensions | |
{ | |
public static IEnumerable<T> GetCustomAttributes<T>(this Enum enumValue, bool inherit) | |
{ | |
Type enumType = enumValue.GetType(); | |
string enumValueName = Enum.GetName(enumType, enumValue); | |
MemberInfo enumMember = enumType.GetMember(enumValueName).First(); |
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
using System; | |
namespace ThirteenDaysAWeek.TitleAttribute.Models.Attributes | |
{ | |
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)] | |
public class ReportTitleAttribute : Attribute | |
{ | |
public string ReportTitle { get; set; } | |
public ConsoleColor Color { get; set; } |
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
using System; | |
using MonoTouch.MapKit; | |
using MonoTouch.UIKit; | |
using System.Drawing; | |
namespace ThirteenDaysAWeek.MKOverlayView.Views | |
{ | |
public class MainView : UIView | |
{ | |
public MainView (RectangleF frame) : base(frame) |
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 void OnStateSelected(string stateName) | |
{ | |
if (this.currentStateOverlay != null) | |
{ | |
this.mainView.MapView.RemoveOverlay(this.currentStateOverlay); | |
} | |
State selectedState = this.states.First(state => state.Name == stateName); | |
this.mainView.MoveMapIntoViewAndPickerOutOfView(); |
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 MapDelegate : MKMapViewDelegate | |
{ | |
public override MonoTouch.MapKit.MKOverlayView GetViewForOverlay (MKMapView mapView, NSObject overlay) | |
{ | |
MKPolygon polygon = overlay as MKPolygon; | |
MKPolygonView polygonView = new MKPolygonView(polygon); | |
polygonView.FillColor = UIColor.Purple; | |
return polygonView; | |
} |
OlderNewer