├── .gitignore
├── Art
└── apps.png
├── CoffeeCups.Droid
├── Assets
│ └── AboutAssets.txt
├── CoffeeCups.Droid.csproj
├── Helpers
│ └── Settings.cs
├── MainActivity.cs
├── Properties
│ ├── AndroidManifest.xml
│ └── AssemblyInfo.cs
├── Resources
│ ├── AboutResources.txt
│ ├── Resource.designer.cs
│ ├── drawable-hdpi
│ │ └── icon.png
│ ├── drawable-xhdpi
│ │ └── icon.png
│ ├── drawable-xxhdpi
│ │ └── icon.png
│ ├── drawable
│ │ └── icon.png
│ ├── layout
│ │ ├── Tabbar.axml
│ │ └── toolbar.axml
│ ├── values-v21
│ │ └── styles.xml
│ └── values
│ │ ├── Colors.xml
│ │ ├── Strings.xml
│ │ └── styles.xml
├── app.config
└── packages.config
├── CoffeeCups.Shared
├── App.cs
├── Authentication
│ └── AuthHandler.cs
├── CoffeeCups.Shared.projitems
├── CoffeeCups.shproj
├── Helpers
│ └── Settings.cs
├── Model
│ └── CupOfCoffee.cs
├── Services
│ └── AzureService.cs
├── View
│ ├── CoffeesPage.xaml
│ └── CoffeesPage.xaml.cs
└── ViewModel
│ └── CoffeesViewModel.cs
├── CoffeeCups.UITests
├── AppInitializer.cs
├── CoffeeCups.UITests.csproj
├── Tests.cs
├── app.config
└── packages.config
├── CoffeeCups.UWP
├── App.xaml
├── App.xaml.cs
├── Assets
│ ├── LockScreenLogo.scale-200.png
│ ├── SplashScreen.scale-200.png
│ ├── Square150x150Logo.scale-200.png
│ ├── Square44x44Logo.scale-200.png
│ ├── Square44x44Logo.targetsize-24_altform-unplated.png
│ ├── StoreLogo.png
│ └── Wide310x150Logo.scale-200.png
├── CoffeeCups.UWP.csproj
├── CoffeeCups.UWP.nuget.props
├── CoffeeCups.UWP.nuget.targets
├── MainPage.xaml
├── MainPage.xaml.cs
├── Package.appxmanifest
├── Properties
│ ├── AssemblyInfo.cs
│ └── Default.rd.xml
├── project.json
└── project.lock.json
├── CoffeeCups.iOS
├── AppDelegate.cs
├── CoffeeCups.iOS.csproj
├── Entitlements.plist
├── Helpers
│ └── Settings.cs
├── Info.plist
├── Main.cs
├── Resources
│ ├── Images.xcassets
│ │ └── AppIcons.appiconset
│ │ │ └── Contents.json
│ └── LaunchScreen.xib
├── app.config
└── packages.config
├── CoffeeCups.sln
├── LICENSE.md
├── README.md
└── ilovecoffee_Runtime
├── ilovecoffee.sln
└── ilovecoffeeService
├── App_Start
└── Startup.MobileApp.cs
├── Controllers
├── CupOfCoffeeController.cs
├── TodoItemController.cs
└── ValuesController.cs
├── DataObjects
├── CupOfCoffee.cs
└── TodoItem.cs
├── Models
└── ilovecoffeeContext.cs
├── Properties
├── AssemblyInfo.cs
└── PublishProfiles
│ └── ilovecoffee - Web Deploy.pubxml
├── Startup.cs
├── Web.Debug.config
├── Web.Release.config
├── Web.config
├── ilovecoffeeService.csproj
└── packages.config
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.sln.docstates
8 | *.userprefs
9 |
10 | # Xamarin Components
11 | Components/
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | x64/
18 | build/
19 | bld/
20 | [Bb]in/
21 | [Oo]bj/
22 | [Pp]ackages/
23 | [Cc]omponents/
24 | data/
25 | .nuget/
26 | .vs/
27 | *.csproj.bak
28 |
29 | # MSTest test Results
30 | [Tt]est[Rr]esult*/
31 | [Bb]uild[Ll]og.*
32 |
33 | #NUNIT
34 | *.VisualState.xml
35 | TestResult.xml
36 |
37 | # Build Results of an ATL Project
38 | [Dd]ebugPS/
39 | [Rr]eleasePS/
40 | dlldata.c
41 |
42 | *_i.c
43 | *_p.c
44 | *_i.h
45 | *.ilk
46 | *.meta
47 | *.obj
48 | *.pch
49 | *.pdb
50 | *.pgc
51 | *.pgd
52 | *.rsp
53 | *.sbr
54 | *.tlb
55 | *.tli
56 | *.tlh
57 | *.tmp
58 | *.tmp_proj
59 | *.log
60 | *.vspscc
61 | *.vssscc
62 | .builds
63 | *.pidb
64 | *.svclog
65 | *.scc
66 |
67 | # Chutzpah Test files
68 | _Chutzpah*
69 |
70 | # Visual C++ cache files
71 | ipch/
72 | *.aps
73 | *.ncb
74 | *.opensdf
75 | *.sdf
76 | *.cachefile
77 |
78 | # Visual Studio profiler
79 | *.psess
80 | *.vsp
81 | *.vspx
82 |
83 | # TFS 2012 Local Workspace
84 | $tf/
85 |
86 | # Guidance Automation Toolkit
87 | *.gpState
88 |
89 | # ReSharper is a .NET coding add-in
90 | _ReSharper*/
91 | *.[Rr]e[Ss]harper
92 | *.DotSettings.user
93 |
94 | # JustCode is a .NET coding addin-in
95 | .JustCode
96 |
97 | # TeamCity is a build add-in
98 | _TeamCity*
99 |
100 | # DotCover is a Code Coverage Tool
101 | *.dotCover
102 |
103 | # NCrunch
104 | *.ncrunch*
105 | _NCrunch_*
106 | .*crunch*.local.xml
107 |
108 | # MightyMoose
109 | *.mm.*
110 | AutoTest.Net/
111 |
112 | # Web workbench (sass)
113 | .sass-cache/
114 |
115 | # Installshield output folder
116 | [Ee]xpress/
117 |
118 | # DocProject is a documentation generator add-in
119 | DocProject/buildhelp/
120 | DocProject/Help/*.HxT
121 | DocProject/Help/*.HxC
122 | DocProject/Help/*.hhc
123 | DocProject/Help/*.hhk
124 | DocProject/Help/*.hhp
125 | DocProject/Help/Html2
126 | DocProject/Help/html
127 |
128 | # Click-Once directory
129 | publish/
130 |
131 | # Publish Web Output
132 | *.[Pp]ublish.xml
133 | *.azurePubxml
134 |
135 | # Windows Azure Build Output
136 | csx/
137 | *.build.csdef
138 |
139 | # Windows Store app package directory
140 | AppPackages/
141 |
142 | # Others
143 | sql/
144 | *.Cache
145 | ClientBin/
146 | [Ss]tyle[Cc]op.*
147 | ~$*
148 | *~
149 | *.dbmdl
150 | *.dbproj.schemaview
151 | *.pfx
152 | *.publishsettings
153 | node_modules/
154 | .DS_Store
155 |
156 | # RIA/Silverlight projects
157 | Generated_Code/
158 |
159 | # Backup & report files from converting an old project file to a newer
160 | # Visual Studio version. Backup files are not needed, because we have git ;-)
161 | _UpgradeReport_Files/
162 | Backup*/
163 | UpgradeLog*.XML
164 | UpgradeLog*.htm
165 |
166 | # SQL Server files
167 | *.mdf
168 | *.ldf
169 |
170 | # Business Intelligence projects
171 | *.rdl.data
172 | *.bim.layout
173 | *.bim_*.settings
174 |
175 | # Microsoft Fakes
176 | FakesAssemblies/
177 |
--------------------------------------------------------------------------------
/Art/apps.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jamesmontemagno/app-coffeecups/4f49646ecd5fcba26e7ea7f6b0974f0699fe9b46/Art/apps.png
--------------------------------------------------------------------------------
/CoffeeCups.Droid/Assets/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | Any raw assets you want to be deployed with your application can be placed in
2 | this directory (and child directories) and given a Build Action of "AndroidAsset".
3 |
4 | These files will be deployed with your package and will be accessible using Android's
5 | AssetManager, like this:
6 |
7 | public class ReadAsset : Activity
8 | {
9 | protected override void OnCreate (Bundle bundle)
10 | {
11 | base.OnCreate (bundle);
12 |
13 | InputStream input = Assets.Open ("my_asset.txt");
14 | }
15 | }
16 |
17 | Additionally, some Android functions will automatically load asset files:
18 |
19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
20 |
--------------------------------------------------------------------------------
/CoffeeCups.Droid/CoffeeCups.Droid.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
7 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}
8 | Library
9 | CoffeeCups.Droid
10 | Assets
11 | Resources
12 | Resource
13 | Resources\Resource.designer.cs
14 | True
15 | true
16 | CoffeeCups.Droid
17 | Properties\AndroidManifest.xml
18 |
19 |
20 | v7.1
21 |
22 |
23 | true
24 | full
25 | false
26 | bin\Debug
27 | DEBUG;
28 | prompt
29 | 4
30 | None
31 | false
32 |
33 |
34 | full
35 | true
36 | bin\Release
37 | prompt
38 | 4
39 | false
40 | false
41 |
42 |
43 | false
44 | bin\iPhone\UITest
45 | 4
46 | ENABLE_TEST_CLOUD
47 | false
48 | armeabi-v7a;x86
49 | full
50 |
51 |
52 |
53 | ..\packages\Xamarin.Forms.2.3.4.247\lib\MonoAndroid10\FormsViewGroup.dll
54 |
55 |
56 | False
57 | ..\packages\Microsoft.Azure.Mobile.Client.4.0.1\lib\monoandroid70\Microsoft.Azure.Mobile.Client.dll
58 |
59 |
60 | False
61 | ..\packages\Microsoft.Azure.Mobile.Client.SQLiteStore.4.0.1\lib\netstandard1.4\Microsoft.Azure.Mobile.Client.SQLiteStore.dll
62 |
63 |
64 |
65 |
66 | ..\packages\Refractored.MvvmHelpers.1.3.0\lib\netstandard1.0\MvvmHelpers.dll
67 |
68 |
69 | ..\packages\Newtonsoft.Json.10.0.3\lib\netstandard1.3\Newtonsoft.Json.dll
70 |
71 |
72 | ..\packages\PCLCrypto.2.0.147\lib\MonoAndroid23\PCLCrypto.dll
73 |
74 |
75 | ..\packages\PInvoke.BCrypt.0.5.97\lib\portable-net45+win8+wpa81\PInvoke.BCrypt.dll
76 |
77 |
78 | ..\packages\PInvoke.Kernel32.0.5.97\lib\portable-net45+win8+wpa81\PInvoke.Kernel32.dll
79 |
80 |
81 | ..\packages\PInvoke.NCrypt.0.5.97\lib\portable-net45+win8+wpa81\PInvoke.NCrypt.dll
82 |
83 |
84 | ..\packages\PInvoke.Windows.Core.0.5.97\lib\portable-net45+win8+wpa81\PInvoke.Windows.Core.dll
85 |
86 |
87 | ..\packages\Xam.Plugin.Connectivity.3.0.2\lib\MonoAndroid10\Plugin.Connectivity.dll
88 |
89 |
90 | ..\packages\Xam.Plugin.Connectivity.3.0.2\lib\MonoAndroid10\Plugin.Connectivity.Abstractions.dll
91 |
92 |
93 | ..\packages\Xam.Plugins.Settings.3.0.1\lib\MonoAndroid10\Plugin.Settings.dll
94 |
95 |
96 | ..\packages\Xam.Plugins.Settings.3.0.1\lib\MonoAndroid10\Plugin.Settings.Abstractions.dll
97 |
98 |
99 | ..\packages\SQLitePCLRaw.bundle_green.1.1.8\lib\MonoAndroid\SQLitePCLRaw.batteries_green.dll
100 |
101 |
102 | ..\packages\SQLitePCLRaw.bundle_green.1.1.8\lib\MonoAndroid\SQLitePCLRaw.batteries_v2.dll
103 |
104 |
105 | ..\packages\SQLitePCLRaw.core.1.1.8\lib\MonoAndroid\SQLitePCLRaw.core.dll
106 |
107 |
108 | ..\packages\SQLitePCLRaw.lib.e_sqlite3.android.1.1.8\lib\MonoAndroid\SQLitePCLRaw.lib.e_sqlite3.dll
109 |
110 |
111 | ..\packages\SQLitePCLRaw.provider.e_sqlite3.android.1.1.8\lib\MonoAndroid\SQLitePCLRaw.provider.e_sqlite3.dll
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 | ..\packages\Validation.2.4.15\lib\netstandard1.3\Validation.dll
120 |
121 |
122 | ..\packages\Xamarin.Android.Support.Animated.Vector.Drawable.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.Animated.Vector.Drawable.dll
123 |
124 |
125 | ..\packages\Xamarin.Android.Support.CustomTabs.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.CustomTabs.dll
126 |
127 |
128 | ..\packages\Xamarin.Android.Support.Design.23.3.0\lib\MonoAndroid43\Xamarin.Android.Support.Design.dll
129 |
130 |
131 | ..\packages\Xamarin.Android.Support.v4.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v4.dll
132 |
133 |
134 | ..\packages\Xamarin.Android.Support.v7.AppCompat.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.AppCompat.dll
135 |
136 |
137 | ..\packages\Xamarin.Android.Support.v7.CardView.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.CardView.dll
138 |
139 |
140 | ..\packages\Xamarin.Android.Support.v7.RecyclerView.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.RecyclerView.dll
141 |
142 |
143 | ..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.Vector.Drawable.dll
144 |
145 |
146 | ..\packages\Xamarin.Forms.2.3.4.247\lib\MonoAndroid10\Xamarin.Forms.Core.dll
147 |
148 |
149 | ..\packages\Xamarin.Forms.2.3.4.247\lib\MonoAndroid10\Xamarin.Forms.Platform.dll
150 |
151 |
152 | ..\packages\Xamarin.Forms.2.3.4.247\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll
153 |
154 |
155 | ..\packages\Xamarin.Forms.2.3.4.247\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
189 |
190 |
191 |
192 |
193 |
194 |
195 |
--------------------------------------------------------------------------------
/CoffeeCups.Droid/Helpers/Settings.cs:
--------------------------------------------------------------------------------
1 | /*
2 | // Helpers/Settings.cs This file was automatically added when you installed the Settings Plugin. If you are not using a PCL then comment this file back in to use it.
3 | using Plugin.Settings;
4 | using Plugin.Settings.Abstractions;
5 |
6 | namespace CoffeeCups.Droid.Helpers
7 | {
8 | ///
9 | /// This is the Settings static class that can be used in your Core solution or in any
10 | /// of your client applications. All settings are laid out the same exact way with getters
11 | /// and setters.
12 | ///
13 | public static class Settings
14 | {
15 | private static ISettings AppSettings
16 | {
17 | get
18 | {
19 | return CrossSettings.Current;
20 | }
21 | }
22 |
23 | #region Setting Constants
24 |
25 | private const string SettingsKey = "settings_key";
26 | private static readonly string SettingsDefault = string.Empty;
27 |
28 | #endregion
29 |
30 |
31 | public static string GeneralSettings
32 | {
33 | get
34 | {
35 | return AppSettings.GetValueOrDefault(SettingsKey, SettingsDefault);
36 | }
37 | set
38 | {
39 | AppSettings.AddOrUpdateValue(SettingsKey, value);
40 | }
41 | }
42 |
43 | }
44 | }*/
--------------------------------------------------------------------------------
/CoffeeCups.Droid/MainActivity.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Android.App;
3 | using Android.Content.PM;
4 | using Android.OS;
5 | using Xamarin.Forms.Platform.Android;
6 |
7 | namespace CoffeeCups.Droid
8 | {
9 | [Activity (Label = "Coffee Cups", Icon = "@drawable/icon", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
10 | public class MainActivity : FormsAppCompatActivity
11 | {
12 | protected override void OnCreate (Bundle bundle)
13 | {
14 |
15 | ToolbarResource = Resource.Layout.Toolbar;
16 | TabLayoutResource = Resource.Layout.Tabbar;
17 |
18 | base.OnCreate (bundle);
19 | global::Xamarin.Forms.Forms.Init (this, bundle);
20 |
21 | Microsoft.WindowsAzure.MobileServices.CurrentPlatform.Init();
22 |
23 | LoadApplication (new App ());
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/CoffeeCups.Droid/Properties/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/CoffeeCups.Droid/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using Android.App;
4 |
5 | // Information about this assembly is defined by the following attributes.
6 | // Change them to the values specific to your project.
7 |
8 | [assembly: AssemblyTitle("CoffeeCups.Droid")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Refractored LLC")]
12 | [assembly: AssemblyProduct("")]
13 | [assembly: AssemblyCopyright("Refractored LLC / James Montemagno")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
18 | // The form "{Major}.{Minor}.*" will automatically update the build and revision,
19 | // and "{Major}.{Minor}.{Build}.*" will update just the revision.
20 |
21 | [assembly: AssemblyVersion("1.0.0")]
22 |
23 | // The following attributes are used to specify the signing key for the assembly,
24 | // if desired. See the Mono documentation for more information about signing.
25 |
26 | //[assembly: AssemblyDelaySign(false)]
27 | //[assembly: AssemblyKeyFile("")]
28 |
29 |
--------------------------------------------------------------------------------
/CoffeeCups.Droid/Resources/AboutResources.txt:
--------------------------------------------------------------------------------
1 | Images, layout descriptions, binary blobs and string dictionaries can be included
2 | in your application as resource files. Various Android APIs are designed to
3 | operate on the resource IDs instead of dealing with images, strings or binary blobs
4 | directly.
5 |
6 | For example, a sample Android app that contains a user interface layout (main.axml),
7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
8 | would keep its resources in the "Resources" directory of the application:
9 |
10 | Resources/
11 | drawable/
12 | icon.png
13 |
14 | layout/
15 | main.axml
16 |
17 | values/
18 | strings.xml
19 |
20 | In order to get the build system to recognize Android resources, set the build action to
21 | "AndroidResource". The native Android APIs do not operate directly with filenames, but
22 | instead operate on resource IDs. When you compile an Android application that uses resources,
23 | the build system will package the resources for distribution and generate a class called "R"
24 | (this is an Android convention) that contains the tokens for each one of the resources
25 | included. For example, for the above Resources layout, this is what the R class would expose:
26 |
27 | public class R {
28 | public class drawable {
29 | public const int icon = 0x123;
30 | }
31 |
32 | public class layout {
33 | public const int main = 0x456;
34 | }
35 |
36 | public class strings {
37 | public const int first_string = 0xabc;
38 | public const int second_string = 0xbcd;
39 | }
40 | }
41 |
42 | You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
43 | to reference the layout/main.axml file, or R.strings.first_string to reference the first
44 | string in the dictionary file values/strings.xml.
45 |
--------------------------------------------------------------------------------
/CoffeeCups.Droid/Resources/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jamesmontemagno/app-coffeecups/4f49646ecd5fcba26e7ea7f6b0974f0699fe9b46/CoffeeCups.Droid/Resources/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/CoffeeCups.Droid/Resources/drawable-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jamesmontemagno/app-coffeecups/4f49646ecd5fcba26e7ea7f6b0974f0699fe9b46/CoffeeCups.Droid/Resources/drawable-xhdpi/icon.png
--------------------------------------------------------------------------------
/CoffeeCups.Droid/Resources/drawable-xxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jamesmontemagno/app-coffeecups/4f49646ecd5fcba26e7ea7f6b0974f0699fe9b46/CoffeeCups.Droid/Resources/drawable-xxhdpi/icon.png
--------------------------------------------------------------------------------
/CoffeeCups.Droid/Resources/drawable/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jamesmontemagno/app-coffeecups/4f49646ecd5fcba26e7ea7f6b0974f0699fe9b46/CoffeeCups.Droid/Resources/drawable/icon.png
--------------------------------------------------------------------------------
/CoffeeCups.Droid/Resources/layout/Tabbar.axml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/CoffeeCups.Droid/Resources/layout/toolbar.axml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/CoffeeCups.Droid/Resources/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/CoffeeCups.Droid/Resources/values/Colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #F2C500
4 | #E9972E
5 | #1E8E80
6 | #F5F5F5
7 |
--------------------------------------------------------------------------------
/CoffeeCups.Droid/Resources/values/Strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hello World, Click Me!
4 | Hanselman.Android
5 |
6 |
--------------------------------------------------------------------------------
/CoffeeCups.Droid/Resources/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
20 |
--------------------------------------------------------------------------------
/CoffeeCups.Droid/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/CoffeeCups.Droid/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
--------------------------------------------------------------------------------
/CoffeeCups.Shared/App.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using Xamarin.Forms;
4 | namespace CoffeeCups
5 | {
6 | public class App : Application
7 | {
8 | public App()
9 | {
10 | // The root page of your application
11 | MainPage = new NavigationPage(new CoffeesPage())
12 | {
13 | BarTextColor = Color.White,
14 | BarBackgroundColor = Color.FromHex("#F2C500")
15 | };
16 | }
17 |
18 | protected override void OnStart()
19 | {
20 |
21 | // Handle when your app starts
22 | }
23 |
24 | protected override void OnSleep()
25 | {
26 | // Handle when your app sleeps
27 | }
28 |
29 | protected override void OnResume()
30 | {
31 | // Handle when your app resumes
32 | }
33 | }
34 | }
35 |
36 |
--------------------------------------------------------------------------------
/CoffeeCups.Shared/Authentication/AuthHandler.cs:
--------------------------------------------------------------------------------
1 |
2 | using Microsoft.WindowsAzure.MobileServices;
3 | using Newtonsoft.Json.Linq;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Linq;
7 | using System.Net;
8 | using System.Net.Http;
9 | using System.Text;
10 | using System.Threading;
11 | using System.Threading.Tasks;
12 | using Xamarin.Forms;
13 | using System.Diagnostics;
14 | using CoffeeCups.Helpers;
15 |
16 | namespace CoffeeCups.Authentication
17 | {
18 | class AuthHandler : DelegatingHandler
19 | {
20 |
21 | private static readonly SemaphoreSlim semaphore = new SemaphoreSlim(1);
22 | private static bool isReauthenticating = false;
23 | protected override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
24 | {
25 | //Clone the request in case we need to send it again
26 | var clonedRequest = await CloneRequest(request);
27 | var response = await base.SendAsync(clonedRequest, cancellationToken);
28 |
29 | //If the token is expired or is invalid, then we need to either refresh the token or prompt the user to log back in
30 | if (response.StatusCode == HttpStatusCode.Unauthorized)
31 | {
32 | if (isReauthenticating)
33 | return response;
34 |
35 | var service = DependencyService.Get();
36 | var client = service.Client;
37 |
38 | string authToken = client.CurrentUser.MobileServiceAuthenticationToken;
39 | await semaphore.WaitAsync();
40 | //In case two threads enter this method at the same time, only one should do the refresh (or re-login), the other should just resend the request with an updated header.
41 | if (authToken != client.CurrentUser.MobileServiceAuthenticationToken) // token was already renewed
42 | {
43 | semaphore.Release();
44 | return await ResendRequest(client, request, cancellationToken);
45 | }
46 |
47 | isReauthenticating = true;
48 | bool gotNewToken = false;
49 | try
50 | {
51 |
52 | gotNewToken = await RefreshToken(client);
53 |
54 |
55 | //Otherwise if refreshing the token failed or Facebook\Twitter is being used, prompt the user to log back in via the login screen
56 | if (!gotNewToken)
57 | {
58 | gotNewToken = await service.LoginAsync();
59 | }
60 | }
61 | catch (System.Exception e)
62 | {
63 | Debug.WriteLine("Unable to refresh token: " + e);
64 | }
65 | finally
66 | {
67 | isReauthenticating = false;
68 | semaphore.Release();
69 | }
70 |
71 |
72 | if (gotNewToken)
73 | {
74 | if (!request.RequestUri.OriginalString.Contains("/.auth/me")) //do not resend in this case since we're not using the return value of auth/me
75 | {
76 | //Resend the request since the user has successfully logged in and return the response
77 | return await ResendRequest(client, request, cancellationToken);
78 | }
79 | }
80 | }
81 |
82 | return response;
83 | }
84 |
85 |
86 | private async Task ResendRequest(IMobileServiceClient client, HttpRequestMessage request, CancellationToken cancellationToken)
87 | {
88 | // Clone the request
89 | var clonedRequest = await CloneRequest(request);
90 |
91 | // Set the authentication header
92 | clonedRequest.Headers.Remove("X-ZUMO-AUTH");
93 | clonedRequest.Headers.Add("X-ZUMO-AUTH", client.CurrentUser.MobileServiceAuthenticationToken);
94 |
95 | // Resend the request
96 | return await base.SendAsync(clonedRequest, cancellationToken);
97 | }
98 |
99 | private async Task RefreshToken(IMobileServiceClient client)
100 | {
101 |
102 |
103 | try
104 | {
105 | await client.RefreshUserAsync();
106 | return true;
107 | }
108 | catch (System.Exception e)
109 | {
110 | Debug.WriteLine("Unable to refresh user: " + e);
111 | }
112 |
113 | return false;
114 | }
115 |
116 |
117 |
118 | private async Task CloneRequest(HttpRequestMessage request)
119 | {
120 | var result = new HttpRequestMessage(request.Method, request.RequestUri);
121 | foreach (var header in request.Headers)
122 | {
123 | result.Headers.Add(header.Key, header.Value);
124 | }
125 |
126 | if (request.Content != null && request.Content.Headers.ContentType != null)
127 | {
128 | var requestBody = await request.Content.ReadAsStringAsync();
129 | var mediaType = request.Content.Headers.ContentType.MediaType;
130 | result.Content = new StringContent(requestBody, Encoding.UTF8, mediaType);
131 | foreach (var header in request.Content.Headers)
132 | {
133 | if (!header.Key.Equals("Content-Type", StringComparison.OrdinalIgnoreCase))
134 | {
135 | result.Content.Headers.Add(header.Key, header.Value);
136 | }
137 | }
138 | }
139 |
140 | return result;
141 | }
142 | }
143 |
144 | }
--------------------------------------------------------------------------------
/CoffeeCups.Shared/CoffeeCups.Shared.projitems:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
5 | true
6 | cbca0e96-d552-4218-a0ba-dc4cdadbc99a
7 |
8 |
9 | CoffeeCups
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | CoffeesPage.xaml
20 |
21 |
22 |
23 |
24 | MSBuild:UpdateDesignTimeXaml
25 |
26 |
27 |
--------------------------------------------------------------------------------
/CoffeeCups.Shared/CoffeeCups.shproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | cbca0e96-d552-4218-a0ba-dc4cdadbc99a
5 | 14.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/CoffeeCups.Shared/Helpers/Settings.cs:
--------------------------------------------------------------------------------
1 | // Helpers/Settings.cs
2 | using Plugin.Settings;
3 | using Plugin.Settings.Abstractions;
4 | using System;
5 |
6 | namespace CoffeeCups.Helpers
7 | {
8 | ///
9 | /// This is the Settings static class that can be used in your Core solution or in any
10 | /// of your client applications. All settings are laid out the same exact way with getters
11 | /// and setters.
12 | ///
13 | public static class Settings
14 | {
15 | private static ISettings AppSettings
16 | {
17 | get
18 | {
19 | return CrossSettings.Current;
20 | }
21 | }
22 |
23 | #region Setting Constants
24 |
25 | const string LastSyncKey = "last_sync";
26 | static readonly DateTime LastSyncDefault = DateTime.Now.AddDays(-30);
27 |
28 |
29 | const string UserIdKey = "userid";
30 | static readonly string UserIdDefault = string.Empty;
31 |
32 | const string AuthTokenKey = "authtoken";
33 | static readonly string AuthTokenDefault = string.Empty;
34 |
35 | const string LoginAttemptsKey = "login_attempts";
36 | const int LoginAttemptsDefault = 0;
37 |
38 | const string NeedsSyncKey = "needs_sync";
39 | const bool NeedsSyncDefault = true;
40 |
41 | const string HasSyncedDataKey = "has_synced";
42 | const bool HasSyncedDataDefault = false;
43 |
44 | #endregion
45 |
46 |
47 | public static string AuthToken
48 | {
49 | get
50 | {
51 | return AppSettings.GetValueOrDefault(AuthTokenKey, AuthTokenDefault);
52 | }
53 | set
54 | {
55 | AppSettings.AddOrUpdateValue(AuthTokenKey, value);
56 | }
57 | }
58 |
59 | public static string UserId
60 | {
61 | get
62 | {
63 | return AppSettings.GetValueOrDefault(UserIdKey, UserIdDefault);
64 | }
65 | set
66 | {
67 | AppSettings.AddOrUpdateValue(UserIdKey, value);
68 | }
69 | }
70 |
71 | public static bool IsLoggedIn
72 | {
73 | get
74 | {
75 | if (!AzureService.UseAuth)
76 | return true;
77 |
78 | return !string.IsNullOrWhiteSpace(UserId);
79 | }
80 | }
81 | }
82 | }
--------------------------------------------------------------------------------
/CoffeeCups.Shared/Model/CupOfCoffee.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace CoffeeCups
4 | {
5 | public class CupOfCoffee
6 | {
7 |
8 |
9 | [Newtonsoft.Json.JsonProperty("Id")]
10 | public string Id { get; set; }
11 | ///
12 | /// Gets or sets the user identifier.
13 | ///
14 | /// The user identifier.
15 | [Newtonsoft.Json.JsonProperty("userId")]
16 | public string UserId { get; set; }
17 |
18 | ///
19 | /// Gets or sets the date UTC.
20 | ///
21 | /// The date UTC.
22 | public DateTime DateUtc { get; set;}
23 |
24 | ///
25 | /// Gets or sets a value indicating whether this made at home.
26 | ///
27 | /// true if made at home; otherwise, false.
28 | public bool MadeAtHome{ get; set; }
29 |
30 | ///
31 | /// Gets or sets the location of the coffee
32 | ///
33 | public string Location { get; set; }
34 |
35 | ///
36 | /// Gets or sets the OS of the user
37 | ///
38 | /// The OS
39 | public string OS { get; set; }
40 |
41 |
42 | [Newtonsoft.Json.JsonIgnore]
43 | public string DateDisplay { get { return DateUtc.ToLocalTime().ToString("d"); } }
44 |
45 | [Newtonsoft.Json.JsonIgnore]
46 | public string TimeDisplay { get { return DateUtc.ToLocalTime().ToString("t") + " " + OS.ToString(); } }
47 |
48 | [Newtonsoft.Json.JsonIgnore]
49 | public string AtHomeDisplay { get { return MadeAtHome ? "Made At Home" : Location; } }
50 |
51 |
52 |
53 | [Microsoft.WindowsAzure.MobileServices.Version]
54 | public string AzureVersion { get; set; }
55 |
56 | }
57 | }
58 |
59 |
--------------------------------------------------------------------------------
/CoffeeCups.Shared/Services/AzureService.cs:
--------------------------------------------------------------------------------
1 | //#define AUTH
2 |
3 | using System;
4 | using Microsoft.WindowsAzure.MobileServices;
5 | using Microsoft.WindowsAzure.MobileServices.Sync;
6 | using System.Threading.Tasks;
7 | using System.Collections.Generic;
8 | using Microsoft.WindowsAzure.MobileServices.SQLiteStore;
9 | using System.Diagnostics;
10 | using Xamarin.Forms;
11 | using CoffeeCups.Helpers;
12 | using CoffeeCups.Authentication;
13 | using CoffeeCups;
14 | using System.IO;
15 | using Plugin.Connectivity;
16 |
17 |
18 |
19 | [assembly: Dependency(typeof(AzureService))]
20 | namespace CoffeeCups
21 | {
22 | public class AzureService
23 | {
24 |
25 | public MobileServiceClient Client { get; set; } = null;
26 | IMobileServiceSyncTable coffeeTable;
27 |
28 | #if AUTH
29 | public static bool UseAuth { get; set; } = true;
30 | #else
31 | public static bool UseAuth { get; set; } = false;
32 | #endif
33 |
34 | public async Task Initialize()
35 | {
36 | if (Client?.SyncContext?.IsInitialized ?? false)
37 | return;
38 |
39 |
40 | var appUrl = "https://ENTER-APP-SERVICE-NAME.azurewebsites.net";
41 |
42 | #if AUTH
43 | Client = new MobileServiceClient(appUrl, new AuthHandler());
44 |
45 | if (!string.IsNullOrWhiteSpace (Settings.AuthToken) && !string.IsNullOrWhiteSpace (Settings.UserId)) {
46 | Client.CurrentUser = new MobileServiceUser (Settings.UserId);
47 | Client.CurrentUser.MobileServiceAuthenticationToken = Settings.AuthToken;
48 | }
49 | #else
50 | //Create our client
51 |
52 | Client = new MobileServiceClient(appUrl);
53 |
54 | #endif
55 |
56 | //InitialzeDatabase for path
57 | var path = "syncstore.db";
58 | path = Path.Combine(MobileServiceClient.DefaultDatabasePath, path);
59 |
60 | //setup our local sqlite store and intialize our table
61 | var store = new MobileServiceSQLiteStore(path);
62 |
63 | //Define table
64 | store.DefineTable();
65 |
66 |
67 | //Initialize SyncContext
68 | await Client.SyncContext.InitializeAsync(store);
69 |
70 | //Get our sync table that will call out to azure
71 | coffeeTable = Client.GetSyncTable();
72 |
73 |
74 | }
75 |
76 | public async Task SyncCoffee()
77 | {
78 | try
79 | {
80 | if (!CrossConnectivity.Current.IsConnected)
81 | return;
82 |
83 | await coffeeTable.PullAsync("allCoffee", coffeeTable.CreateQuery());
84 |
85 | await Client.SyncContext.PushAsync();
86 | }
87 | catch (Exception ex)
88 | {
89 | Debug.WriteLine("Unable to sync coffees, that is alright as we have offline capabilities: " + ex);
90 | }
91 |
92 | }
93 |
94 | public async Task> GetCoffees()
95 | {
96 | //Initialize & Sync
97 | await Initialize();
98 | await SyncCoffee();
99 |
100 | return await coffeeTable.OrderBy(c => c.DateUtc).ToEnumerableAsync(); ;
101 |
102 | }
103 |
104 | public async Task AddCoffee(bool atHome, string location)
105 | {
106 | await Initialize();
107 |
108 | var coffee = new CupOfCoffee
109 | {
110 | DateUtc = DateTime.UtcNow,
111 | MadeAtHome = atHome,
112 | OS = Device.RuntimePlatform,
113 | Location = location ?? string.Empty
114 | };
115 |
116 | await coffeeTable.InsertAsync(coffee);
117 |
118 | await SyncCoffee();
119 | //return coffee
120 | return coffee;
121 | }
122 |
123 |
124 |
125 | public async Task LoginAsync()
126 | {
127 |
128 | await Initialize();
129 |
130 | var provider = MobileServiceAuthenticationProvider.Twitter;
131 | var uriScheme = "coffeecups";
132 |
133 |
134 | #if __ANDROID__
135 | var user = await Client.LoginAsync(Forms.Context, provider, uriScheme);
136 |
137 | #elif __IOS__
138 | CoffeeCups.iOS.AppDelegate.ResumeWithURL = url => url.Scheme == uriScheme && Client.ResumeWithURL(url);
139 | var user = await Client.LoginAsync(GetController(), provider, uriScheme);
140 |
141 | #else
142 | var user = await Client.LoginAsync(provider, uriScheme);
143 |
144 | #endif
145 | if (user == null)
146 | {
147 | Settings.AuthToken = string.Empty;
148 | Settings.UserId = string.Empty;
149 | Device.BeginInvokeOnMainThread(async () =>
150 | {
151 | await App.Current.MainPage.DisplayAlert("Login Error", "Unable to login, please try again", "OK");
152 | });
153 | return false;
154 | }
155 | else
156 | {
157 | Settings.AuthToken = user.MobileServiceAuthenticationToken;
158 | Settings.UserId = user.UserId;
159 | }
160 |
161 | return true;
162 | }
163 |
164 |
165 | #if __IOS__
166 | UIKit.UIViewController GetController()
167 | {
168 | var window = UIKit.UIApplication.SharedApplication.KeyWindow;
169 | var root = window.RootViewController;
170 | if (root == null)
171 | return null;
172 |
173 | var current = root;
174 | while (current.PresentedViewController != null)
175 | {
176 | current = current.PresentedViewController;
177 | }
178 |
179 | return current;
180 | }
181 | #endif
182 | }
183 | }
184 |
185 |
--------------------------------------------------------------------------------
/CoffeeCups.Shared/View/CoffeesPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
28 |
31 |
38 |
39 |
41 |
44 |
45 |
46 |
49 |
50 |
51 |
52 |
53 |
54 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
76 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
97 |
98 |
99 |
100 |
101 |
102 |
--------------------------------------------------------------------------------
/CoffeeCups.Shared/View/CoffeesPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | using Xamarin.Forms;
5 | using Plugin.Connectivity;
6 | using CoffeeCups.Helpers;
7 |
8 | namespace CoffeeCups
9 | {
10 | public partial class CoffeesPage : ContentPage
11 | {
12 | CoffeesViewModel vm;
13 | public CoffeesPage()
14 | {
15 | InitializeComponent();
16 | BindingContext = vm = new CoffeesViewModel();
17 | ListViewCoffees.ItemTapped += (sender, e) =>
18 | {
19 | if(Device.OS == TargetPlatform.iOS || Device.OS == TargetPlatform.Android)
20 | ListViewCoffees.SelectedItem = null;
21 | };
22 |
23 | if (Device.OS != TargetPlatform.iOS && Device.OS != TargetPlatform.Android)
24 | {
25 | ToolbarItems.Add(new ToolbarItem
26 | {
27 | Text ="Refresh",
28 | Command=vm.LoadCoffeesCommand
29 | });
30 | }
31 |
32 |
33 | }
34 |
35 | protected override async void OnAppearing()
36 | {
37 | base.OnAppearing();
38 |
39 | CrossConnectivity.Current.ConnectivityChanged += ConnecitvityChanged;
40 | OfflineStack.IsVisible = !CrossConnectivity.Current.IsConnected;
41 |
42 |
43 | if (vm.Coffees.Count == 0 && Settings.IsLoggedIn)
44 | vm.LoadCoffeesCommand.Execute(null);
45 | else
46 | {
47 | await vm.LoginAsync();
48 | if (Settings.IsLoggedIn)
49 | vm.LoadCoffeesCommand.Execute(null);
50 | }
51 | }
52 |
53 | protected override void OnDisappearing()
54 | {
55 | base.OnDisappearing();
56 | CrossConnectivity.Current.ConnectivityChanged -= ConnecitvityChanged;
57 | }
58 |
59 | void ConnecitvityChanged (object sender, Plugin.Connectivity.Abstractions.ConnectivityChangedEventArgs e)
60 | {
61 | Device.BeginInvokeOnMainThread(() =>
62 | {
63 | OfflineStack.IsVisible = !e.IsConnected;
64 | });
65 | }
66 | }
67 | }
68 |
69 |
--------------------------------------------------------------------------------
/CoffeeCups.Shared/ViewModel/CoffeesViewModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using MvvmHelpers;
3 | using System.Windows.Input;
4 | using System.Threading.Tasks;
5 | using System.Diagnostics;
6 | using Xamarin.Forms;
7 | using System.Linq;
8 | using CoffeeCups.Helpers;
9 |
10 | namespace CoffeeCups
11 | {
12 | public class CoffeesViewModel : BaseViewModel
13 | {
14 | AzureService azureService;
15 | public CoffeesViewModel()
16 | {
17 | azureService = DependencyService.Get();
18 | }
19 |
20 | public ObservableRangeCollection Coffees { get; } = new ObservableRangeCollection();
21 | public ObservableRangeCollection> CoffeesGrouped { get; } = new ObservableRangeCollection>();
22 |
23 | string loadingMessage;
24 | public string LoadingMessage
25 | {
26 | get { return loadingMessage; }
27 | set { SetProperty(ref loadingMessage, value); }
28 | }
29 |
30 |
31 | bool atHome;
32 | public bool AtHome
33 | {
34 | get => atHome;
35 | set => SetProperty(ref atHome, value);
36 | }
37 |
38 |
39 | string location;
40 | public string Location
41 | {
42 | get => location;
43 | set => SetProperty(ref location, value);
44 | }
45 |
46 |
47 | ICommand loadCoffeesCommand;
48 | public ICommand LoadCoffeesCommand =>
49 | loadCoffeesCommand ?? (loadCoffeesCommand = new Command(async () => await ExecuteLoadCoffeesCommandAsync()));
50 |
51 | async Task ExecuteLoadCoffeesCommandAsync()
52 | {
53 | if(IsBusy || !(await LoginAsync()))
54 | return;
55 |
56 |
57 | try
58 | {
59 | LoadingMessage = "Loading Coffees...";
60 | IsBusy = true;
61 | var coffees = await azureService.GetCoffees();
62 | Coffees.ReplaceRange(coffees);
63 |
64 |
65 | SortCoffees();
66 |
67 |
68 | }
69 | catch (Exception ex)
70 | {
71 | Debug.WriteLine("OH NO!" + ex);
72 |
73 | await Application.Current.MainPage.DisplayAlert("Sync Error", "Unable to sync coffees, you may be offline", "OK");
74 | }
75 | finally
76 | {
77 | IsBusy = false;
78 | }
79 |
80 |
81 | }
82 |
83 | void SortCoffees()
84 | {
85 | var groups = from coffee in Coffees
86 | orderby coffee.DateUtc descending
87 | group coffee by coffee.DateDisplay
88 | into coffeeGroup
89 | select new Grouping($"{coffeeGroup.Key} ({coffeeGroup.Count()})", coffeeGroup);
90 |
91 |
92 | CoffeesGrouped.ReplaceRange(groups);
93 | }
94 |
95 | ICommand addCoffeeCommand;
96 | public ICommand AddCoffeeCommand =>
97 | addCoffeeCommand ?? (addCoffeeCommand = new Command(async () => await ExecuteAddCoffeeCommandAsync()));
98 |
99 | async Task ExecuteAddCoffeeCommandAsync()
100 | {
101 | if(IsBusy || !(await LoginAsync()))
102 | return;
103 |
104 | try
105 | {
106 |
107 | if (string.IsNullOrWhiteSpace(Location) && !AtHome)
108 | {
109 | await Application.Current.MainPage.DisplayAlert("Needs Location", "Please enter a location before adding the coffee.", "OK");
110 | return;
111 | }
112 | LoadingMessage = "Adding Coffee...";
113 | IsBusy = true;
114 |
115 |
116 | var coffee = await azureService.AddCoffee(AtHome, location);
117 | Location = string.Empty;
118 | AtHome = false;
119 | Coffees.Add(coffee);
120 | SortCoffees();
121 | }
122 | catch (Exception ex)
123 | {
124 | Debug.WriteLine("OH NO!" + ex);
125 | }
126 | finally
127 | {
128 | LoadingMessage = string.Empty;
129 | IsBusy = false;
130 | }
131 |
132 | }
133 |
134 | public Task LoginAsync()
135 | {
136 | if (Settings.IsLoggedIn)
137 | return Task.FromResult(true);
138 |
139 |
140 | return azureService.LoginAsync();
141 | }
142 | }
143 | }
144 |
145 |
--------------------------------------------------------------------------------
/CoffeeCups.UITests/AppInitializer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Linq;
4 | using Xamarin.UITest;
5 | using Xamarin.UITest.Queries;
6 |
7 | namespace CoffeeCups.UITests
8 | {
9 | public class AppInitializer
10 | {
11 | public static IApp StartApp(Platform platform)
12 | {
13 | // TODO: If the iOS or Android app being tested is included in the solution
14 | // then open the Unit Tests window, right click Test Apps, select Add App Project
15 | // and select the app projects that should be tested.
16 | //
17 | // The iOS project should have the Xamarin.TestCloud.Agent NuGet package
18 | // installed. To start the Test Cloud Agent the following code should be
19 | // added to the FinishedLaunching method of the AppDelegate:
20 | //
21 | // #if ENABLE_TEST_CLOUD
22 | // Xamarin.Calabash.Start();
23 | // #endif
24 | if (platform == Platform.Android)
25 | {
26 | return ConfigureApp
27 | .Android
28 | // TODO: Update this path to point to your Android app and uncomment the
29 | // code if the app is not included in the solution.
30 | //.ApkFile ("../../../Droid/bin/Debug/xamarinforms.apk")
31 | .StartApp();
32 | }
33 |
34 | return ConfigureApp
35 | .iOS
36 | // TODO: Update this path to point to your iOS app and uncomment the
37 | // code if the app is not included in the solution.
38 | //.AppBundle ("../../../iOS/bin/iPhoneSimulator/Debug/XamarinForms.iOS.app")
39 | .StartApp();
40 | }
41 | }
42 | }
43 |
44 |
--------------------------------------------------------------------------------
/CoffeeCups.UITests/CoffeeCups.UITests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | {6A8517EA-E91A-4C62-B151-FE5DF375B2A8}
7 | Library
8 | CoffeeCups.UITests
9 | CoffeeCups.UITests
10 | v4.5
11 |
12 |
13 | true
14 | full
15 | false
16 | bin\Debug
17 | DEBUG;
18 | prompt
19 | 4
20 | false
21 |
22 |
23 | full
24 | true
25 | bin\Release
26 | prompt
27 | 4
28 | false
29 |
30 |
31 | false
32 | bin\iPhone\UITest
33 | 4
34 |
35 |
36 |
37 |
38 | ..\packages\NUnit.2.6.3\lib\nunit.framework.dll
39 |
40 |
41 | ..\packages\Xamarin.UITest.1.3.1\lib\Xamarin.UITest.dll
42 | True
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}
57 | CoffeeCups.Droid
58 | False
59 | False
60 |
61 |
62 | {25C2AF37-F78F-4817-91D5-B98252FF3312}
63 | CoffeeCups.iOS
64 | False
65 | False
66 |
67 |
68 |
--------------------------------------------------------------------------------
/CoffeeCups.UITests/Tests.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Linq;
4 | using NUnit.Framework;
5 | using Xamarin.UITest;
6 | using Xamarin.UITest.Queries;
7 |
8 | namespace CoffeeCups.UITests
9 | {
10 | [TestFixture(Platform.Android)]
11 | [TestFixture(Platform.iOS)]
12 | public class Tests
13 | {
14 | IApp app;
15 | Platform platform;
16 |
17 | public Tests(Platform platform)
18 | {
19 | this.platform = platform;
20 | }
21 |
22 | [SetUp]
23 | public void BeforeEachTest()
24 | {
25 | app = AppInitializer.StartApp(platform);
26 | }
27 |
28 | [Test]
29 | public void AppLaunches()
30 | {
31 | app.Screenshot("First screen.");
32 | }
33 |
34 | [Test]
35 | public void AppLaunches2()
36 | {
37 | app.Screenshot("Second screen.");
38 | }
39 | }
40 | }
41 |
42 |
--------------------------------------------------------------------------------
/CoffeeCups.UITests/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/CoffeeCups.UITests/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/CoffeeCups.UWP/App.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/CoffeeCups.UWP/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.WindowsAzure.MobileServices;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.IO;
5 | using System.Linq;
6 | using System.Runtime.InteropServices.WindowsRuntime;
7 | using Windows.ApplicationModel;
8 | using Windows.ApplicationModel.Activation;
9 | using Windows.Foundation;
10 | using Windows.Foundation.Collections;
11 | using Windows.UI.Xaml;
12 | using Windows.UI.Xaml.Controls;
13 | using Windows.UI.Xaml.Controls.Primitives;
14 | using Windows.UI.Xaml.Data;
15 | using Windows.UI.Xaml.Input;
16 | using Windows.UI.Xaml.Media;
17 | using Windows.UI.Xaml.Navigation;
18 | using Xamarin.Forms;
19 |
20 | namespace CoffeeCups.UWP
21 | {
22 | ///
23 | /// Provides application-specific behavior to supplement the default Application class.
24 | ///
25 | sealed partial class App : Windows.UI.Xaml.Application
26 | {
27 | ///
28 | /// Initializes the singleton application object. This is the first line of authored code
29 | /// executed, and as such is the logical equivalent of main() or WinMain().
30 | ///
31 | public App()
32 | {
33 | this.InitializeComponent();
34 | this.Suspending += OnSuspending;
35 | }
36 |
37 | ///
38 | /// Invoked when the application is launched normally by the end user. Other entry points
39 | /// will be used such as when the application is launched to open a specific file.
40 | ///
41 | /// Details about the launch request and process.
42 | protected override void OnLaunched(LaunchActivatedEventArgs e)
43 | {
44 |
45 | #if DEBUG
46 | if (System.Diagnostics.Debugger.IsAttached)
47 | {
48 | this.DebugSettings.EnableFrameRateCounter = true;
49 | }
50 | #endif
51 |
52 | var rootFrame = Window.Current.Content as Windows.UI.Xaml.Controls.Frame;
53 |
54 | // Do not repeat app initialization when the Window already has content,
55 | // just ensure that the window is active
56 | if (rootFrame == null)
57 | {
58 | // Create a Frame to act as the navigation context and navigate to the first page
59 | rootFrame = new Windows.UI.Xaml.Controls.Frame();
60 |
61 | rootFrame.NavigationFailed += OnNavigationFailed;
62 | Xamarin.Forms.Forms.Init(e);
63 | if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
64 | {
65 | //TODO: Load state from previously suspended application
66 | }
67 |
68 | // Place the frame in the current Window
69 | Window.Current.Content = rootFrame;
70 | }
71 |
72 | if (rootFrame.Content == null)
73 | {
74 | // When the navigation stack isn't restored navigate to the first page,
75 | // configuring the new page by passing required information as a navigation
76 | // parameter
77 | rootFrame.Navigate(typeof(MainPage), e.Arguments);
78 | }
79 | // Ensure the current window is active
80 | Window.Current.Activate();
81 | }
82 |
83 | ///
84 | /// Invoked when Navigation to a certain page fails
85 | ///
86 | /// The Frame which failed navigation
87 | /// Details about the navigation failure
88 | void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
89 | {
90 | throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
91 | }
92 |
93 | ///
94 | /// Invoked when application execution is being suspended. Application state is saved
95 | /// without knowing whether the application will be terminated or resumed with the contents
96 | /// of memory still intact.
97 | ///
98 | /// The source of the suspend request.
99 | /// Details about the suspend request.
100 | private void OnSuspending(object sender, SuspendingEventArgs e)
101 | {
102 | var deferral = e.SuspendingOperation.GetDeferral();
103 | //TODO: Save application state and stop any background activity
104 | deferral.Complete();
105 | }
106 |
107 | protected override void OnActivated(IActivatedEventArgs args)
108 | {
109 | base.OnActivated(args);
110 | if(args.Kind == ActivationKind.Protocol)
111 | {
112 | var protocolArgs = args as ProtocolActivatedEventArgs;
113 | var service = DependencyService.Get();
114 | service.Client.ResumeWithURL(protocolArgs.Uri);
115 | }
116 | }
117 | }
118 | }
119 |
--------------------------------------------------------------------------------
/CoffeeCups.UWP/Assets/LockScreenLogo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jamesmontemagno/app-coffeecups/4f49646ecd5fcba26e7ea7f6b0974f0699fe9b46/CoffeeCups.UWP/Assets/LockScreenLogo.scale-200.png
--------------------------------------------------------------------------------
/CoffeeCups.UWP/Assets/SplashScreen.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jamesmontemagno/app-coffeecups/4f49646ecd5fcba26e7ea7f6b0974f0699fe9b46/CoffeeCups.UWP/Assets/SplashScreen.scale-200.png
--------------------------------------------------------------------------------
/CoffeeCups.UWP/Assets/Square150x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jamesmontemagno/app-coffeecups/4f49646ecd5fcba26e7ea7f6b0974f0699fe9b46/CoffeeCups.UWP/Assets/Square150x150Logo.scale-200.png
--------------------------------------------------------------------------------
/CoffeeCups.UWP/Assets/Square44x44Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jamesmontemagno/app-coffeecups/4f49646ecd5fcba26e7ea7f6b0974f0699fe9b46/CoffeeCups.UWP/Assets/Square44x44Logo.scale-200.png
--------------------------------------------------------------------------------
/CoffeeCups.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jamesmontemagno/app-coffeecups/4f49646ecd5fcba26e7ea7f6b0974f0699fe9b46/CoffeeCups.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
--------------------------------------------------------------------------------
/CoffeeCups.UWP/Assets/StoreLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jamesmontemagno/app-coffeecups/4f49646ecd5fcba26e7ea7f6b0974f0699fe9b46/CoffeeCups.UWP/Assets/StoreLogo.png
--------------------------------------------------------------------------------
/CoffeeCups.UWP/Assets/Wide310x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jamesmontemagno/app-coffeecups/4f49646ecd5fcba26e7ea7f6b0974f0699fe9b46/CoffeeCups.UWP/Assets/Wide310x150Logo.scale-200.png
--------------------------------------------------------------------------------
/CoffeeCups.UWP/CoffeeCups.UWP.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | x86
7 | {6C26713B-52CA-4373-A908-8995FA4A31AC}
8 | AppContainerExe
9 | Properties
10 | CoffeeCups.UWP
11 | CoffeeCups.UWP
12 | en-US
13 | UAP
14 | 10.0.10586.0
15 | 10.0.10240.0
16 | 14
17 | 512
18 | {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
19 | CoffeeCups.UWP_TemporaryKey.pfx
20 |
21 |
22 | true
23 | bin\x86\Debug\
24 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
25 | ;2008
26 | full
27 | x86
28 | false
29 | prompt
30 | true
31 |
32 |
33 | bin\x86\Release\
34 | TRACE;NETFX_CORE;WINDOWS_UWP
35 | true
36 | ;2008
37 | pdbonly
38 | x86
39 | false
40 | prompt
41 | true
42 | true
43 |
44 |
45 | true
46 | bin\ARM\Debug\
47 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
48 | ;2008
49 | full
50 | ARM
51 | false
52 | prompt
53 | true
54 |
55 |
56 | bin\ARM\Release\
57 | TRACE;NETFX_CORE;WINDOWS_UWP
58 | true
59 | ;2008
60 | pdbonly
61 | ARM
62 | false
63 | prompt
64 | true
65 | true
66 |
67 |
68 | true
69 | bin\x64\Debug\
70 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
71 | ;2008
72 | full
73 | x64
74 | false
75 | prompt
76 | true
77 |
78 |
79 | bin\x64\Release\
80 | TRACE;NETFX_CORE;WINDOWS_UWP
81 | true
82 | ;2008
83 | pdbonly
84 | x64
85 | false
86 | prompt
87 | true
88 | true
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 | App.xaml
97 |
98 |
99 | MainPage.xaml
100 |
101 |
102 |
103 |
104 |
105 | Designer
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 | MSBuild:Compile
122 | Designer
123 |
124 |
125 | MSBuild:Compile
126 | Designer
127 |
128 |
129 |
130 |
131 | 14.0
132 |
133 |
134 |
141 |
--------------------------------------------------------------------------------
/CoffeeCups.UWP/CoffeeCups.UWP.nuget.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | True
5 | NuGet
6 | C:\GitHub\app-coffeecups\CoffeeCups.UWP\project.lock.json
7 | $(UserProfile)\.nuget\packages\
8 | C:\Users\James Montemagno\.nuget\packages\
9 | ProjectJson
10 | 4.2.0
11 |
12 |
13 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/CoffeeCups.UWP/CoffeeCups.UWP.nuget.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/CoffeeCups.UWP/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/CoffeeCups.UWP/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.WindowsAzure.MobileServices;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.IO;
5 | using System.Linq;
6 | using System.Runtime.InteropServices.WindowsRuntime;
7 | using Windows.Foundation;
8 | using Windows.Foundation.Collections;
9 | using Windows.UI.Xaml;
10 | using Windows.UI.Xaml.Controls;
11 | using Windows.UI.Xaml.Controls.Primitives;
12 | using Windows.UI.Xaml.Data;
13 | using Windows.UI.Xaml.Input;
14 | using Windows.UI.Xaml.Media;
15 | using Windows.UI.Xaml.Navigation;
16 | using Xamarin.Forms;
17 |
18 | // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
19 |
20 | namespace CoffeeCups.UWP
21 | {
22 | ///
23 | /// An empty page that can be used on its own or navigated to within a Frame.
24 | ///
25 | public sealed partial class MainPage
26 | {
27 | public MainPage()
28 | {
29 | this.InitializeComponent();
30 | NavigationCacheMode = NavigationCacheMode.Required;
31 | LoadApplication(new CoffeeCups.App());
32 | }
33 |
34 | protected override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
35 | {
36 | if (e.Parameter is Uri)
37 | {
38 | var service = DependencyService.Get();
39 | service.Client.ResumeWithURL(e.Parameter as Uri);
40 | }
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/CoffeeCups.UWP/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | CoffeeCups.UWP
7 | Motz
8 | Assets\StoreLogo.png
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | CoffeeCups
27 |
28 |
29 |
30 |
31 | Assets\Logo.png
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/CoffeeCups.UWP/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("CoffeeCups.UWP")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("CoffeeCups.UWP")]
13 | [assembly: AssemblyCopyright("Copyright © 2016")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Version information for an assembly consists of the following four values:
18 | //
19 | // Major Version
20 | // Minor Version
21 | // Build Number
22 | // Revision
23 | //
24 | // You can specify all the values or you can default the Build and Revision Numbers
25 | // by using the '*' as shown below:
26 | // [assembly: AssemblyVersion("1.0.*")]
27 | [assembly: AssemblyVersion("1.0.0.0")]
28 | [assembly: AssemblyFileVersion("1.0.0.0")]
29 | [assembly: ComVisible(false)]
--------------------------------------------------------------------------------
/CoffeeCups.UWP/Properties/Default.rd.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/CoffeeCups.UWP/project.json:
--------------------------------------------------------------------------------
1 | {
2 | "dependencies": {
3 | "Microsoft.Azure.Mobile.Client": "4.0.1",
4 | "Microsoft.Azure.Mobile.Client.SQLiteStore": "4.0.1",
5 | "Microsoft.NETCore.UniversalWindowsPlatform": "5.4.0",
6 | "Newtonsoft.Json": "10.0.3",
7 | "Refractored.MvvmHelpers": "1.3.0",
8 | "SQLitePCLRaw.bundle_green": "1.1.8",
9 | "SQLitePCLRaw.core": "1.1.8",
10 | "Xam.Plugin.Connectivity": "3.0.2",
11 | "Xam.Plugins.Settings": "3.0.1",
12 | "Xamarin.Forms": "2.3.4.247"
13 | },
14 | "frameworks": {
15 | "uap10.0": {}
16 | },
17 | "runtimes": {
18 | "win10-arm": {},
19 | "win10-arm-aot": {},
20 | "win10-x86": {},
21 | "win10-x86-aot": {},
22 | "win10-x64": {},
23 | "win10-x64-aot": {}
24 | }
25 | }
--------------------------------------------------------------------------------
/CoffeeCups.iOS/AppDelegate.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 |
5 | using Foundation;
6 | using UIKit;
7 | using Xamarin.Forms;
8 |
9 | namespace CoffeeCups.iOS
10 | {
11 | [Register("AppDelegate")]
12 | public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
13 | {
14 | public static Func ResumeWithURL;
15 | public override bool FinishedLaunching(UIApplication app, NSDictionary options)
16 | {
17 |
18 | var tint = UIColor.FromRGB(30,142,128);
19 | UINavigationBar.Appearance.BarTintColor = UIColor.FromRGB(242,197,0); //bar background
20 | UINavigationBar.Appearance.TintColor = tint; //Tint color of button items
21 | UINavigationBar.Appearance.SetTitleTextAttributes(new UITextAttributes
22 | {
23 | Font = UIFont.FromName("Avenir-Medium", 17f),
24 | TextColor = UIColor.Black
25 | });
26 |
27 | UINavigationBar.Appearance.TitleTextAttributes = new UIStringAttributes
28 | {
29 | Font = UIFont.FromName("Avenir-Medium", 17f),
30 | ForegroundColor = UIColor.Black
31 | };
32 |
33 | UIBarButtonItem.Appearance.TintColor = tint; //Tint color of button items
34 |
35 |
36 | //NavigationBar Buttons
37 | UIBarButtonItem.Appearance.SetTitleTextAttributes(new UITextAttributes
38 | {
39 | Font = UIFont.FromName("Avenir-Medium", 17f),
40 | TextColor = tint
41 | },
42 | UIControlState.Normal);
43 |
44 | //TabBar
45 | UITabBarItem.Appearance.SetTitleTextAttributes(new UITextAttributes
46 | {
47 | Font = UIFont.FromName("Avenir-Book", 10f)
48 | }, UIControlState.Normal);
49 |
50 | UITabBar.Appearance.TintColor = tint;
51 |
52 | UISwitch.Appearance.OnTintColor = tint;
53 |
54 | global::Xamarin.Forms.Forms.Init();
55 |
56 | Microsoft.WindowsAzure.MobileServices.CurrentPlatform.Init();
57 |
58 |
59 | LoadApplication(new App());
60 |
61 | return base.FinishedLaunching(app, options);
62 | }
63 |
64 | public override bool OpenUrl(UIApplication app, NSUrl url, NSDictionary options)
65 | {
66 | return ResumeWithURL != null && ResumeWithURL(url);
67 | }
68 | }
69 | }
70 |
71 |
--------------------------------------------------------------------------------
/CoffeeCups.iOS/CoffeeCups.iOS.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | iPhoneSimulator
6 | {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
7 | {25C2AF37-F78F-4817-91D5-B98252FF3312}
8 | Exe
9 | CoffeeCups.iOS
10 | Resources
11 |
12 |
13 | CoffeeCupsiOS
14 |
15 |
16 | true
17 | full
18 | false
19 | bin\iPhoneSimulator\Debug
20 | DEBUG;ENABLE_TEST_CLOUD;
21 | prompt
22 | 4
23 | false
24 | i386
25 | None
26 | true
27 | true
28 | true
29 | true
30 | iPhone Developer
31 | true
32 | CoffeeCupsiOS
33 |
34 |
35 | full
36 | true
37 | bin\iPhone\Release
38 | prompt
39 | 4
40 | false
41 | ARMv7, ARM64
42 | Entitlements.plist
43 | true
44 | true
45 | iPhone Developer
46 | true
47 | CoffeeCupsiOS
48 |
49 |
50 | full
51 | true
52 | bin\iPhoneSimulator\Release
53 | prompt
54 | 4
55 | false
56 | i386
57 | None
58 | true
59 | iPhone Developer
60 | true
61 | CoffeeCupsiOS
62 |
63 |
64 | true
65 | full
66 | false
67 | bin\iPhone\Debug
68 | DEBUG;ENABLE_TEST_CLOUD;
69 | prompt
70 | 4
71 | false
72 | ARMv7, ARM64
73 | Entitlements.plist
74 | true
75 | iPhone Developer
76 | true
77 | true
78 | true
79 | true
80 | true
81 | CoffeeCupsiOS
82 |
83 |
84 | false
85 | bin\iPhone\UITest
86 | 4
87 | CoffeeCupsiOS
88 | iPhone Developer
89 | ENABLE_TEST_CLOUD
90 |
91 |
92 |
93 | ..\packages\Microsoft.Azure.Mobile.Client.4.0.1\lib\xamarinios10\Microsoft.Azure.Mobile.Client.dll
94 |
95 |
96 | ..\packages\Microsoft.Azure.Mobile.Client.SQLiteStore.4.0.1\lib\netstandard1.4\Microsoft.Azure.Mobile.Client.SQLiteStore.dll
97 |
98 |
99 |
100 | ..\packages\Refractored.MvvmHelpers.1.3.0\lib\netstandard1.0\MvvmHelpers.dll
101 |
102 |
103 | ..\packages\Newtonsoft.Json.10.0.3\lib\netstandard1.3\Newtonsoft.Json.dll
104 |
105 |
106 | ..\packages\PCLCrypto.2.0.147\lib\xamarinios10\PCLCrypto.dll
107 |
108 |
109 | ..\packages\PInvoke.BCrypt.0.5.97\lib\portable-net45+win8+wpa81\PInvoke.BCrypt.dll
110 |
111 |
112 | ..\packages\PInvoke.Kernel32.0.5.97\lib\portable-net45+win8+wpa81\PInvoke.Kernel32.dll
113 |
114 |
115 | ..\packages\PInvoke.NCrypt.0.5.97\lib\portable-net45+win8+wpa81\PInvoke.NCrypt.dll
116 |
117 |
118 | ..\packages\PInvoke.Windows.Core.0.5.97\lib\portable-net45+win8+wpa81\PInvoke.Windows.Core.dll
119 |
120 |
121 | ..\packages\Xam.Plugin.Connectivity.3.0.2\lib\Xamarin.iOS10\Plugin.Connectivity.dll
122 |
123 |
124 | ..\packages\Xam.Plugin.Connectivity.3.0.2\lib\Xamarin.iOS10\Plugin.Connectivity.Abstractions.dll
125 |
126 |
127 | ..\packages\Xam.Plugins.Settings.3.0.1\lib\Xamarin.iOS10\Plugin.Settings.dll
128 |
129 |
130 | ..\packages\Xam.Plugins.Settings.3.0.1\lib\Xamarin.iOS10\Plugin.Settings.Abstractions.dll
131 |
132 |
133 | ..\packages\SQLitePCLRaw.bundle_green.1.1.8\lib\Xamarin.iOS10\SQLitePCLRaw.batteries_green.dll
134 |
135 |
136 | ..\packages\SQLitePCLRaw.bundle_green.1.1.8\lib\Xamarin.iOS10\SQLitePCLRaw.batteries_v2.dll
137 |
138 |
139 | ..\packages\SQLitePCLRaw.core.1.1.8\lib\Xamarin.iOS10\SQLitePCLRaw.core.dll
140 |
141 |
142 | ..\packages\SQLitePCLRaw.provider.sqlite3.ios_unified.1.1.8\lib\Xamarin.iOS10\SQLitePCLRaw.provider.sqlite3.dll
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 | ..\packages\Validation.2.4.15\lib\netstandard1.3\Validation.dll
151 |
152 |
153 | ..\packages\Xamarin.Forms.2.3.4.247\lib\Xamarin.iOS10\Xamarin.Forms.Core.dll
154 |
155 |
156 | ..\packages\Xamarin.Forms.2.3.4.247\lib\Xamarin.iOS10\Xamarin.Forms.Platform.dll
157 |
158 |
159 | ..\packages\Xamarin.Forms.2.3.4.247\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll
160 |
161 |
162 | ..\packages\Xamarin.Forms.2.3.4.247\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll
163 |
164 |
165 |
166 |
167 |
168 | false
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 | Designer
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
194 |
195 |
196 |
197 |
--------------------------------------------------------------------------------
/CoffeeCups.iOS/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/CoffeeCups.iOS/Helpers/Settings.cs:
--------------------------------------------------------------------------------
1 | /*
2 | // Helpers/Settings.cs This file was automatically added when you installed the Settings Plugin. If you are not using a PCL then comment this file back in to use it.
3 | using Plugin.Settings;
4 | using Plugin.Settings.Abstractions;
5 |
6 | namespace CoffeeCups.iOS.Helpers
7 | {
8 | ///
9 | /// This is the Settings static class that can be used in your Core solution or in any
10 | /// of your client applications. All settings are laid out the same exact way with getters
11 | /// and setters.
12 | ///
13 | public static class Settings
14 | {
15 | private static ISettings AppSettings
16 | {
17 | get
18 | {
19 | return CrossSettings.Current;
20 | }
21 | }
22 |
23 | #region Setting Constants
24 |
25 | private const string SettingsKey = "settings_key";
26 | private static readonly string SettingsDefault = string.Empty;
27 |
28 | #endregion
29 |
30 |
31 | public static string GeneralSettings
32 | {
33 | get
34 | {
35 | return AppSettings.GetValueOrDefault(SettingsKey, SettingsDefault);
36 | }
37 | set
38 | {
39 | AppSettings.AddOrUpdateValue(SettingsKey, value);
40 | }
41 | }
42 |
43 | }
44 | }*/
--------------------------------------------------------------------------------
/CoffeeCups.iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDisplayName
6 | CoffeeCups
7 | CFBundleIdentifier
8 | com.refractored.coffeecups
9 | CFBundleShortVersionString
10 | 1.0
11 | CFBundleVersion
12 | 1.0
13 | LSRequiresIPhoneOS
14 |
15 | MinimumOSVersion
16 | 7.0
17 | UIDeviceFamily
18 |
19 | 1
20 | 2
21 |
22 | UILaunchStoryboardName
23 | LaunchScreen
24 | UIRequiredDeviceCapabilities
25 |
26 | armv7
27 |
28 | UISupportedInterfaceOrientations
29 |
30 | UIInterfaceOrientationPortrait
31 | UIInterfaceOrientationLandscapeLeft
32 | UIInterfaceOrientationLandscapeRight
33 |
34 | UISupportedInterfaceOrientations~ipad
35 |
36 | UIInterfaceOrientationPortrait
37 | UIInterfaceOrientationPortraitUpsideDown
38 | UIInterfaceOrientationLandscapeLeft
39 | UIInterfaceOrientationLandscapeRight
40 |
41 | XSAppIconAssets
42 | Resources/Images.xcassets/AppIcons.appiconset
43 | UIStatusBarStyle
44 | UIStatusBarStyleLightContent
45 | UIViewControllerBasedStatusBarAppearance
46 |
47 | CFBundleURLTypes
48 |
49 |
50 | CFBundleURLName
51 | com.refractored.coffeecups
52 | CFBundleURLSchemes
53 |
54 | coffeecups
55 |
56 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/CoffeeCups.iOS/Main.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using Foundation;
5 | using UIKit;
6 |
7 | namespace CoffeeCups.iOS
8 | {
9 | public class Application
10 | {
11 | // This is the main entry point of the application.
12 | static void Main (string[] args)
13 | {
14 | // if you want to use a different Application Delegate class from "AppDelegate"
15 | // you can specify it here.
16 | UIApplication.Main (args, null, "AppDelegate");
17 |
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/CoffeeCups.iOS/Resources/Images.xcassets/AppIcons.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images": [
3 | {
4 | "size": "29x29",
5 | "scale": "1x",
6 | "idiom": "iphone"
7 | },
8 | {
9 | "size": "29x29",
10 | "scale": "2x",
11 | "idiom": "iphone"
12 | },
13 | {
14 | "size": "29x29",
15 | "scale": "3x",
16 | "idiom": "iphone"
17 | },
18 | {
19 | "size": "40x40",
20 | "scale": "2x",
21 | "idiom": "iphone"
22 | },
23 | {
24 | "size": "40x40",
25 | "scale": "3x",
26 | "idiom": "iphone"
27 | },
28 | {
29 | "size": "57x57",
30 | "scale": "1x",
31 | "idiom": "iphone"
32 | },
33 | {
34 | "size": "57x57",
35 | "scale": "2x",
36 | "idiom": "iphone"
37 | },
38 | {
39 | "size": "60x60",
40 | "scale": "2x",
41 | "idiom": "iphone"
42 | },
43 | {
44 | "size": "60x60",
45 | "scale": "3x",
46 | "idiom": "iphone"
47 | },
48 | {
49 | "size": "29x29",
50 | "scale": "1x",
51 | "idiom": "ipad"
52 | },
53 | {
54 | "size": "29x29",
55 | "scale": "2x",
56 | "idiom": "ipad"
57 | },
58 | {
59 | "size": "40x40",
60 | "scale": "1x",
61 | "idiom": "ipad"
62 | },
63 | {
64 | "size": "40x40",
65 | "scale": "2x",
66 | "idiom": "ipad"
67 | },
68 | {
69 | "size": "50x50",
70 | "scale": "1x",
71 | "idiom": "ipad"
72 | },
73 | {
74 | "size": "50x50",
75 | "scale": "2x",
76 | "idiom": "ipad"
77 | },
78 | {
79 | "size": "72x72",
80 | "scale": "1x",
81 | "idiom": "ipad"
82 | },
83 | {
84 | "size": "72x72",
85 | "scale": "2x",
86 | "idiom": "ipad"
87 | },
88 | {
89 | "size": "76x76",
90 | "scale": "1x",
91 | "idiom": "ipad"
92 | },
93 | {
94 | "size": "76x76",
95 | "scale": "2x",
96 | "idiom": "ipad"
97 | },
98 | {
99 | "size": "120x120",
100 | "scale": "1x",
101 | "idiom": "car"
102 | }
103 | ],
104 | "info": {
105 | "version": 1,
106 | "author": "xcode"
107 | }
108 | }
--------------------------------------------------------------------------------
/CoffeeCups.iOS/Resources/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
21 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/CoffeeCups.iOS/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/CoffeeCups.iOS/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/CoffeeCups.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.26430.16
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CoffeeCups.iOS", "CoffeeCups.iOS\CoffeeCups.iOS.csproj", "{25C2AF37-F78F-4817-91D5-B98252FF3312}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CoffeeCups.Droid", "CoffeeCups.Droid\CoffeeCups.Droid.csproj", "{3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}"
9 | EndProject
10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CoffeeCups.UWP", "CoffeeCups.UWP\CoffeeCups.UWP.csproj", "{6C26713B-52CA-4373-A908-8995FA4A31AC}"
11 | EndProject
12 | Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "CoffeeCups", "CoffeeCups.Shared\CoffeeCups.shproj", "{CBCA0E96-D552-4218-A0BA-DC4CDADBC99A}"
13 | EndProject
14 | Global
15 | GlobalSection(SharedMSBuildProjectFiles) = preSolution
16 | CoffeeCups.Shared\CoffeeCups.Shared.projitems*{25c2af37-f78f-4817-91d5-b98252ff3312}*SharedItemsImports = 4
17 | CoffeeCups.Shared\CoffeeCups.Shared.projitems*{3fa9fa7a-a746-41c1-a0eb-316c0baa4acf}*SharedItemsImports = 4
18 | CoffeeCups.Shared\CoffeeCups.Shared.projitems*{6c26713b-52ca-4373-a908-8995fa4a31ac}*SharedItemsImports = 4
19 | CoffeeCups.Shared\CoffeeCups.Shared.projitems*{cbca0e96-d552-4218-a0ba-dc4cdadbc99a}*SharedItemsImports = 13
20 | EndGlobalSection
21 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
22 | Debug|Any CPU = Debug|Any CPU
23 | Debug|ARM = Debug|ARM
24 | Debug|iPhone = Debug|iPhone
25 | Debug|iPhoneSimulator = Debug|iPhoneSimulator
26 | Debug|x64 = Debug|x64
27 | Debug|x86 = Debug|x86
28 | Release|Any CPU = Release|Any CPU
29 | Release|ARM = Release|ARM
30 | Release|iPhone = Release|iPhone
31 | Release|iPhoneSimulator = Release|iPhoneSimulator
32 | Release|x64 = Release|x64
33 | Release|x86 = Release|x86
34 | UITest|Any CPU = UITest|Any CPU
35 | UITest|ARM = UITest|ARM
36 | UITest|iPhone = UITest|iPhone
37 | UITest|iPhoneSimulator = UITest|iPhoneSimulator
38 | UITest|x64 = UITest|x64
39 | UITest|x86 = UITest|x86
40 | EndGlobalSection
41 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
42 | {25C2AF37-F78F-4817-91D5-B98252FF3312}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator
43 | {25C2AF37-F78F-4817-91D5-B98252FF3312}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator
44 | {25C2AF37-F78F-4817-91D5-B98252FF3312}.Debug|ARM.ActiveCfg = Debug|iPhone
45 | {25C2AF37-F78F-4817-91D5-B98252FF3312}.Debug|iPhone.ActiveCfg = Debug|iPhone
46 | {25C2AF37-F78F-4817-91D5-B98252FF3312}.Debug|iPhone.Build.0 = Debug|iPhone
47 | {25C2AF37-F78F-4817-91D5-B98252FF3312}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
48 | {25C2AF37-F78F-4817-91D5-B98252FF3312}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
49 | {25C2AF37-F78F-4817-91D5-B98252FF3312}.Debug|x64.ActiveCfg = Debug|iPhone
50 | {25C2AF37-F78F-4817-91D5-B98252FF3312}.Debug|x86.ActiveCfg = Debug|iPhone
51 | {25C2AF37-F78F-4817-91D5-B98252FF3312}.Release|Any CPU.ActiveCfg = Release|iPhone
52 | {25C2AF37-F78F-4817-91D5-B98252FF3312}.Release|Any CPU.Build.0 = Release|iPhone
53 | {25C2AF37-F78F-4817-91D5-B98252FF3312}.Release|ARM.ActiveCfg = Release|iPhoneSimulator
54 | {25C2AF37-F78F-4817-91D5-B98252FF3312}.Release|iPhone.ActiveCfg = Release|iPhone
55 | {25C2AF37-F78F-4817-91D5-B98252FF3312}.Release|iPhone.Build.0 = Release|iPhone
56 | {25C2AF37-F78F-4817-91D5-B98252FF3312}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
57 | {25C2AF37-F78F-4817-91D5-B98252FF3312}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
58 | {25C2AF37-F78F-4817-91D5-B98252FF3312}.Release|x64.ActiveCfg = Release|iPhoneSimulator
59 | {25C2AF37-F78F-4817-91D5-B98252FF3312}.Release|x86.ActiveCfg = Release|iPhoneSimulator
60 | {25C2AF37-F78F-4817-91D5-B98252FF3312}.UITest|Any CPU.ActiveCfg = UITest|iPhone
61 | {25C2AF37-F78F-4817-91D5-B98252FF3312}.UITest|ARM.ActiveCfg = UITest|iPhone
62 | {25C2AF37-F78F-4817-91D5-B98252FF3312}.UITest|iPhone.ActiveCfg = UITest|iPhone
63 | {25C2AF37-F78F-4817-91D5-B98252FF3312}.UITest|iPhone.Build.0 = UITest|iPhone
64 | {25C2AF37-F78F-4817-91D5-B98252FF3312}.UITest|iPhoneSimulator.ActiveCfg = UITest|iPhone
65 | {25C2AF37-F78F-4817-91D5-B98252FF3312}.UITest|x64.ActiveCfg = UITest|iPhone
66 | {25C2AF37-F78F-4817-91D5-B98252FF3312}.UITest|x86.ActiveCfg = UITest|iPhone
67 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
68 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.Debug|Any CPU.Build.0 = Debug|Any CPU
69 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
70 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.Debug|ARM.ActiveCfg = Debug|Any CPU
71 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.Debug|ARM.Build.0 = Debug|Any CPU
72 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.Debug|ARM.Deploy.0 = Debug|Any CPU
73 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.Debug|iPhone.ActiveCfg = Debug|Any CPU
74 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.Debug|iPhone.Build.0 = Debug|Any CPU
75 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
76 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
77 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.Debug|x64.ActiveCfg = Debug|Any CPU
78 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.Debug|x64.Build.0 = Debug|Any CPU
79 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.Debug|x64.Deploy.0 = Debug|Any CPU
80 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.Debug|x86.ActiveCfg = Debug|Any CPU
81 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.Debug|x86.Build.0 = Debug|Any CPU
82 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.Debug|x86.Deploy.0 = Debug|Any CPU
83 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.Release|Any CPU.ActiveCfg = Release|Any CPU
84 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.Release|Any CPU.Build.0 = Release|Any CPU
85 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.Release|ARM.ActiveCfg = Release|Any CPU
86 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.Release|ARM.Build.0 = Release|Any CPU
87 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.Release|ARM.Deploy.0 = Release|Any CPU
88 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.Release|iPhone.ActiveCfg = Release|Any CPU
89 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.Release|iPhone.Build.0 = Release|Any CPU
90 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
91 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
92 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.Release|x64.ActiveCfg = Release|Any CPU
93 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.Release|x64.Build.0 = Release|Any CPU
94 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.Release|x64.Deploy.0 = Release|Any CPU
95 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.Release|x86.ActiveCfg = Release|Any CPU
96 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.Release|x86.Build.0 = Release|Any CPU
97 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.Release|x86.Deploy.0 = Release|Any CPU
98 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.UITest|Any CPU.ActiveCfg = UITest|iPhone
99 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.UITest|ARM.ActiveCfg = UITest|iPhone
100 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.UITest|iPhone.ActiveCfg = UITest|iPhone
101 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.UITest|iPhone.Build.0 = UITest|iPhone
102 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.UITest|iPhoneSimulator.ActiveCfg = UITest|iPhone
103 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.UITest|x64.ActiveCfg = UITest|iPhone
104 | {3FA9FA7A-A746-41C1-A0EB-316C0BAA4ACF}.UITest|x86.ActiveCfg = UITest|iPhone
105 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.Debug|Any CPU.ActiveCfg = Debug|x86
106 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.Debug|Any CPU.Build.0 = Debug|x86
107 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.Debug|Any CPU.Deploy.0 = Debug|x86
108 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.Debug|ARM.ActiveCfg = Debug|ARM
109 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.Debug|ARM.Build.0 = Debug|ARM
110 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.Debug|ARM.Deploy.0 = Debug|ARM
111 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.Debug|iPhone.ActiveCfg = Debug|x86
112 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.Debug|iPhoneSimulator.ActiveCfg = Debug|x86
113 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.Debug|x64.ActiveCfg = Debug|x64
114 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.Debug|x64.Build.0 = Debug|x64
115 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.Debug|x64.Deploy.0 = Debug|x64
116 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.Debug|x86.ActiveCfg = Debug|x86
117 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.Debug|x86.Build.0 = Debug|x86
118 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.Debug|x86.Deploy.0 = Debug|x86
119 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.Release|Any CPU.ActiveCfg = Release|x86
120 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.Release|ARM.ActiveCfg = Release|ARM
121 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.Release|ARM.Build.0 = Release|ARM
122 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.Release|ARM.Deploy.0 = Release|ARM
123 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.Release|iPhone.ActiveCfg = Release|x86
124 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.Release|iPhoneSimulator.ActiveCfg = Release|x86
125 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.Release|x64.ActiveCfg = Release|x64
126 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.Release|x64.Build.0 = Release|x64
127 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.Release|x64.Deploy.0 = Release|x64
128 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.Release|x86.ActiveCfg = Release|x86
129 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.Release|x86.Build.0 = Release|x86
130 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.Release|x86.Deploy.0 = Release|x86
131 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.UITest|Any CPU.ActiveCfg = Release|x64
132 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.UITest|Any CPU.Build.0 = Release|x64
133 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.UITest|Any CPU.Deploy.0 = Release|x64
134 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.UITest|ARM.ActiveCfg = Release|ARM
135 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.UITest|ARM.Build.0 = Release|ARM
136 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.UITest|ARM.Deploy.0 = Release|ARM
137 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.UITest|iPhone.ActiveCfg = Release|x64
138 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.UITest|iPhone.Build.0 = Release|x64
139 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.UITest|iPhone.Deploy.0 = Release|x64
140 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.UITest|iPhoneSimulator.ActiveCfg = Release|x64
141 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.UITest|iPhoneSimulator.Build.0 = Release|x64
142 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.UITest|iPhoneSimulator.Deploy.0 = Release|x64
143 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.UITest|x64.ActiveCfg = Release|x64
144 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.UITest|x64.Build.0 = Release|x64
145 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.UITest|x64.Deploy.0 = Release|x64
146 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.UITest|x86.ActiveCfg = Release|x86
147 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.UITest|x86.Build.0 = Release|x86
148 | {6C26713B-52CA-4373-A908-8995FA4A31AC}.UITest|x86.Deploy.0 = Release|x86
149 | EndGlobalSection
150 | GlobalSection(SolutionProperties) = preSolution
151 | HideSolutionNode = FALSE
152 | EndGlobalSection
153 | GlobalSection(MonoDevelopProperties) = preSolution
154 | Policies = $0
155 | $0.DotNetNamingPolicy = $1
156 | $1.DirectoryNamespaceAssociation = None
157 | $1.ResourceNamePolicy = FileName
158 | EndGlobalSection
159 | EndGlobal
160 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 James Montemagno / Refractored LLC
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the "Software"), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 | the Software, and to permit persons to whom the Software is furnished to do so,
10 | subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## Coffee Cups App!
2 |
3 | ## What is this?
4 | Sample application built with Xamarin.Forms for iOS, Android, and Windows 10 UWP showcasing simple data binding and tying into Azure Mobile Apps and Easy Tables.
5 |
6 | Built with C# 6 features, you must be running VS 2015 or Xamarin Studio to compile.
7 |
8 | ## Walkthrough:
9 | * Backend Setup: https://www.youtube.com/watch?v=Bi2TxyiK9wM
10 | * Blog: https://blog.xamarin.com/getting-started-azure-mobile-apps-easy-tables/
11 | * Video Demo: https://www.youtube.com/watch?v=r3tUKefwfy0
12 |
13 | ## Screenshots
14 | 
15 |
16 |
17 | #### Contributors
18 | * [jamesmontemagno](https://github.com/jamesmontemagno)
19 |
20 | #### Technology Used
21 | * [Xamarin.Forms](http://xamarin.com/forms)
22 | * [Xamarin Insights](http://xamarin.com/insights)
23 | * [Connectivity Plugin](http://github.com/jamesmontemagno/Xamarin.Plugins)
24 | * [Azure Mobile Apps](https://components.xamarin.com/view/azure-mobile-client)
25 | * [MvvmHelpers](https://github.com/jamesmontemagno/mvvm-helpers)
26 | * [Xamarin.Forms Toolkit](https://github.com/jamesmontemagno/xamarin.forms-toolkit)
27 |
28 | #### License
29 | Under MIT (See LICENSE.md)
30 |
--------------------------------------------------------------------------------
/ilovecoffee_Runtime/ilovecoffee.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.21005.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ilovecoffeeService", "ilovecoffeeService\ilovecoffeeService.csproj", "{209FA716-A7AD-4095-BD70-C8710FC66FA7}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {209FA716-A7AD-4095-BD70-C8710FC66FA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {209FA716-A7AD-4095-BD70-C8710FC66FA7}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {209FA716-A7AD-4095-BD70-C8710FC66FA7}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {209FA716-A7AD-4095-BD70-C8710FC66FA7}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/ilovecoffee_Runtime/ilovecoffeeService/App_Start/Startup.MobileApp.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data.Entity;
5 | using System.Web.Http;
6 | using Microsoft.Azure.Mobile.Server;
7 | using Microsoft.Azure.Mobile.Server.Authentication;
8 | using Microsoft.Azure.Mobile.Server.Config;
9 | using ilovecoffeeService.DataObjects;
10 | using ilovecoffeeService.Models;
11 | using Owin;
12 |
13 | namespace ilovecoffeeService
14 | {
15 | public partial class Startup
16 | {
17 | public static void ConfigureMobileApp(IAppBuilder app)
18 | {
19 | HttpConfiguration config = new HttpConfiguration();
20 |
21 | //For more information on Web API tracing, see http://go.microsoft.com/fwlink/?LinkId=620686
22 | config.EnableSystemDiagnosticsTracing();
23 |
24 | new MobileAppConfiguration()
25 | .UseDefaultConfiguration()
26 | .ApplyTo(config);
27 |
28 | // Use Entity Framework Code First to create database tables based on your DbContext
29 | Database.SetInitializer(new ilovecoffeeInitializer());
30 |
31 | // To prevent Entity Framework from modifying your database schema, use a null database initializer
32 | // Database.SetInitializer(null);
33 |
34 | MobileAppSettingsDictionary settings = config.GetMobileAppSettingsProvider().GetMobileAppSettings();
35 |
36 | if (string.IsNullOrEmpty(settings.HostName))
37 | {
38 | // This middleware is intended to be used locally for debugging. By default, HostName will
39 | // only have a value when running in an App Service application.
40 | app.UseAppServiceAuthentication(new AppServiceAuthenticationOptions
41 | {
42 | SigningKey = ConfigurationManager.AppSettings["SigningKey"],
43 | ValidAudiences = new[] { ConfigurationManager.AppSettings["ValidAudience"] },
44 | ValidIssuers = new[] { ConfigurationManager.AppSettings["ValidIssuer"] },
45 | TokenHandler = config.GetAppServiceTokenHandler()
46 | });
47 | }
48 | app.UseWebApi(config);
49 | }
50 | }
51 |
52 | public class ilovecoffeeInitializer : CreateDatabaseIfNotExists
53 | {
54 | protected override void Seed(ilovecoffeeContext context)
55 | {
56 | List todoItems = new List
57 | {
58 | new TodoItem { Id = Guid.NewGuid().ToString(), Text = "First item", Complete = false },
59 | new TodoItem { Id = Guid.NewGuid().ToString(), Text = "Second item", Complete = false },
60 | };
61 |
62 | foreach (TodoItem todoItem in todoItems)
63 | {
64 | context.Set().Add(todoItem);
65 | }
66 |
67 | base.Seed(context);
68 | }
69 | }
70 | }
71 |
72 |
--------------------------------------------------------------------------------
/ilovecoffee_Runtime/ilovecoffeeService/Controllers/CupOfCoffeeController.cs:
--------------------------------------------------------------------------------
1 | //#define AUTH
2 | using System.Linq;
3 | using System.Threading.Tasks;
4 | using System.Web.Http;
5 | using System.Web.Http.Controllers;
6 | using System.Web.Http.OData;
7 | using Microsoft.Azure.Mobile.Server;
8 | using ilovecoffeeService.DataObjects;
9 | using ilovecoffeeService.Models;
10 | using System.Security.Principal;
11 | using System.Security.Claims;
12 |
13 | namespace ilovecoffeeService.Controllers
14 | {
15 | #if AUTH
16 | [Authorize]
17 | #endif
18 | public class CupOfCoffeeController : TableController
19 | {
20 | protected override void Initialize(HttpControllerContext controllerContext)
21 | {
22 | base.Initialize(controllerContext);
23 | ilovecoffeeContext context = new ilovecoffeeContext();
24 | DomainManager = new EntityDomainManager(context, Request);
25 | }
26 |
27 |
28 | string GetSid(IPrincipal user)
29 | {
30 | ClaimsPrincipal claimsUser = (ClaimsPrincipal)user;
31 |
32 | string provider = claimsUser.FindFirst("http://schemas.microsoft.com/identity/claims/identityprovider").Value;
33 | string sid = claimsUser.FindFirst(ClaimTypes.NameIdentifier).Value;
34 |
35 | // The above assumes WEBSITE_AUTH_HIDE_DEPRECATED_SID is true. Otherwise, use the stable_sid claim:
36 | // string sid = claimsUser.FindFirst("stable_sid").Value;
37 |
38 | return $"{provider}|{sid}";
39 | }
40 |
41 | // GET tables/CupOfCoffee
42 | public IQueryable GetAllCupOfCoffee()
43 | {
44 | #if AUTH
45 | var sid = GetSid(User);
46 | return Query().Where(c => c.UserId == sid);
47 | #else
48 | return Query();
49 | #endif
50 | }
51 |
52 | // GET tables/CupOfCoffee/48D68C86-6EA6-4C25-AA33-223FC9A27959
53 | public SingleResult GetCupOfCoffee(string id)
54 | {
55 | return Lookup(id);
56 | }
57 |
58 | // PATCH tables/CupOfCoffee/48D68C86-6EA6-4C25-AA33-223FC9A27959
59 | public Task PatchCupOfCoffee(string id, Delta patch)
60 | {
61 | return UpdateAsync(id, patch);
62 | }
63 |
64 | // POST tables/CupOfCoffee
65 | public async Task PostCupOfCoffee(CupOfCoffee item)
66 | {
67 | #if AUTH
68 | var sid = GetSid(User);
69 | item.UserId = sid;
70 | #endif
71 |
72 | CupOfCoffee current = await InsertAsync(item);
73 | return CreatedAtRoute("Tables", new { id = current.Id }, current);
74 | }
75 |
76 | // DELETE tables/CupOfCoffee/48D68C86-6EA6-4C25-AA33-223FC9A27959
77 | public Task DeleteCupOfCoffee(string id)
78 | {
79 | return DeleteAsync(id);
80 | }
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/ilovecoffee_Runtime/ilovecoffeeService/Controllers/TodoItemController.cs:
--------------------------------------------------------------------------------
1 | using System.Linq;
2 | using System.Threading.Tasks;
3 | using System.Web.Http;
4 | using System.Web.Http.Controllers;
5 | using System.Web.Http.OData;
6 | using Microsoft.Azure.Mobile.Server;
7 | using ilovecoffeeService.DataObjects;
8 | using ilovecoffeeService.Models;
9 |
10 | namespace ilovecoffeeService.Controllers
11 | {
12 | public class TodoItemController : TableController
13 | {
14 | protected override void Initialize(HttpControllerContext controllerContext)
15 | {
16 | base.Initialize(controllerContext);
17 | ilovecoffeeContext context = new ilovecoffeeContext();
18 | DomainManager = new EntityDomainManager(context, Request);
19 | }
20 |
21 | // GET tables/TodoItem
22 | public IQueryable GetAllTodoItems()
23 | {
24 | return Query();
25 | }
26 |
27 | // GET tables/TodoItem/48D68C86-6EA6-4C25-AA33-223FC9A27959
28 | public SingleResult GetTodoItem(string id)
29 | {
30 | return Lookup(id);
31 | }
32 |
33 | // PATCH tables/TodoItem/48D68C86-6EA6-4C25-AA33-223FC9A27959
34 | public Task PatchTodoItem(string id, Delta patch)
35 | {
36 | return UpdateAsync(id, patch);
37 | }
38 |
39 | // POST tables/TodoItem
40 | public async Task PostTodoItem(TodoItem item)
41 | {
42 | TodoItem current = await InsertAsync(item);
43 | return CreatedAtRoute("Tables", new { id = current.Id }, current);
44 | }
45 |
46 | // DELETE tables/TodoItem/48D68C86-6EA6-4C25-AA33-223FC9A27959
47 | public Task DeleteTodoItem(string id)
48 | {
49 | return DeleteAsync(id);
50 | }
51 | }
52 | }
--------------------------------------------------------------------------------
/ilovecoffee_Runtime/ilovecoffeeService/Controllers/ValuesController.cs:
--------------------------------------------------------------------------------
1 | using System.Web.Http;
2 | using System.Web.Http.Tracing;
3 | using Microsoft.Azure.Mobile.Server;
4 | using Microsoft.Azure.Mobile.Server.Config;
5 |
6 | namespace ilovecoffeeService.Controllers
7 | {
8 | // Use the MobileAppController attribute for each ApiController you want to use
9 | // from your mobile clients
10 | [MobileAppController]
11 | public class ValuesController : ApiController
12 | {
13 | // GET api/values
14 | public string Get()
15 | {
16 | MobileAppSettingsDictionary settings = this.Configuration.GetMobileAppSettingsProvider().GetMobileAppSettings();
17 | ITraceWriter traceWriter = this.Configuration.Services.GetTraceWriter();
18 |
19 | string host = settings.HostName ?? "localhost";
20 | string greeting = "Hello from " + host;
21 |
22 | traceWriter.Info(greeting);
23 | return greeting;
24 | }
25 |
26 | // POST api/values
27 | public string Post()
28 | {
29 | return "Hello World!";
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/ilovecoffee_Runtime/ilovecoffeeService/DataObjects/CupOfCoffee.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Azure.Mobile.Server;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Web;
6 |
7 | namespace ilovecoffeeService.DataObjects
8 | {
9 | public class CupOfCoffee : EntityData
10 | {
11 | ///
12 | /// Gets or sets the user identifier.
13 | ///
14 | /// The user identifier.
15 | [Newtonsoft.Json.JsonProperty("userId")]
16 | public string UserId { get; set; }
17 |
18 | ///
19 | /// Gets or sets the date UTC.
20 | ///
21 | /// The date UTC.
22 | public DateTime DateUtc { get; set; }
23 |
24 | ///
25 | /// Gets or sets a value indicating whether this made at home.
26 | ///
27 | /// true if made at home; otherwise, false.
28 | public bool MadeAtHome { get; set; }
29 |
30 | ///
31 | /// Gets or sets the location of the coffee
32 | ///
33 | public string Location { get; set; }
34 |
35 | ///
36 | /// Gets or sets the OS of the user
37 | ///
38 | /// The OS
39 | public string OS { get; set; }
40 | }
41 | }
--------------------------------------------------------------------------------
/ilovecoffee_Runtime/ilovecoffeeService/DataObjects/TodoItem.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Azure.Mobile.Server;
2 |
3 | namespace ilovecoffeeService.DataObjects
4 | {
5 | public class TodoItem : EntityData
6 | {
7 | public string Text { get; set; }
8 |
9 | public bool Complete { get; set; }
10 | }
11 | }
--------------------------------------------------------------------------------
/ilovecoffee_Runtime/ilovecoffeeService/Models/ilovecoffeeContext.cs:
--------------------------------------------------------------------------------
1 | using System.Data.Entity;
2 | using System.Data.Entity.ModelConfiguration.Conventions;
3 | using System.Linq;
4 | using Microsoft.Azure.Mobile.Server;
5 | using Microsoft.Azure.Mobile.Server.Tables;
6 | using ilovecoffeeService.DataObjects;
7 |
8 | namespace ilovecoffeeService.Models
9 | {
10 | public class ilovecoffeeContext : DbContext
11 | {
12 | // You can add custom code to this file. Changes will not be overwritten.
13 | //
14 | // If you want Entity Framework to alter your database
15 | // automatically whenever you change your model schema, please use data migrations.
16 | // For more information refer to the documentation:
17 | // http://msdn.microsoft.com/en-us/data/jj591621.aspx
18 |
19 | private const string connectionStringName = "Name=MS_TableConnectionString";
20 |
21 | public ilovecoffeeContext() : base(connectionStringName)
22 | {
23 | }
24 |
25 | public DbSet TodoItems { get; set; }
26 |
27 | protected override void OnModelCreating(DbModelBuilder modelBuilder)
28 | {
29 | modelBuilder.Conventions.Add(
30 | new AttributeToColumnAnnotationConvention(
31 | "ServiceTableColumn", (property, attributes) => attributes.Single().ColumnType.ToString()));
32 | }
33 |
34 | public System.Data.Entity.DbSet CupOfCoffees { get; set; }
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/ilovecoffee_Runtime/ilovecoffeeService/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("ilovecoffeeService")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("ilovecoffeeService")]
13 | [assembly: AssemblyCopyright("Copyright © 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("2e8cfaa1-3743-49ef-9e21-2926ca18c058")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Revision and Build Numbers
33 | // by using the '*' as shown below:
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/ilovecoffee_Runtime/ilovecoffeeService/Properties/PublishProfiles/ilovecoffee - Web Deploy.pubxml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 | MSDeploy
9 | /subscriptions/da4ee2d0-42c2-4c86-94b0-170b0b122415/resourceGroups/RedmondCoffee/providers/Microsoft.Web/sites/ilovecoffee
10 | RedmondCoffee
11 | AzureWebSite
12 | Release
13 | Any CPU
14 | http://ilovecoffee.azurewebsites.net
15 | True
16 | False
17 | ilovecoffee.scm.azurewebsites.net:443
18 | ilovecoffee
19 |
20 | True
21 | WMSVC
22 | True
23 | $ilovecoffee
24 | <_SavePWD>True
25 | <_DestinationType>AzureWebSite
26 |
27 |
--------------------------------------------------------------------------------
/ilovecoffee_Runtime/ilovecoffeeService/Startup.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Owin;
2 | using Owin;
3 |
4 | [assembly: OwinStartup(typeof(ilovecoffeeService.Startup))]
5 |
6 | namespace ilovecoffeeService
7 | {
8 | public partial class Startup
9 | {
10 | public void Configuration(IAppBuilder app)
11 | {
12 | ConfigureMobileApp(app);
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/ilovecoffee_Runtime/ilovecoffeeService/Web.Debug.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/ilovecoffee_Runtime/ilovecoffeeService/Web.Release.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
19 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/ilovecoffee_Runtime/ilovecoffeeService/Web.config:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
17 |
18 |
19 |
20 |
23 |
24 |
25 |
26 |
27 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
--------------------------------------------------------------------------------
/ilovecoffee_Runtime/ilovecoffeeService/ilovecoffeeService.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | 2.0
8 | {209FA716-A7AD-4095-BD70-C8710FC66FA7}
9 | {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
10 | Library
11 | Properties
12 | ilovecoffeeService
13 | ilovecoffeeService
14 | v4.6.1
15 | false
16 | true
17 |
18 |
19 |
20 |
21 | true
22 | 10.0
23 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
24 | ..\
25 |
26 |
27 |
28 |
29 |
30 |
31 | true
32 | full
33 | false
34 | bin\
35 | DEBUG;TRACE
36 | prompt
37 | 4
38 |
39 |
40 | pdbonly
41 | true
42 | bin\
43 | TRACE
44 | prompt
45 | 4
46 |
47 |
48 |
49 |
50 |
51 | True
52 | True
53 | 50520
54 | /
55 | http://localhost:50520/
56 | False
57 | False
58 |
59 |
60 | False
61 |
62 |
63 |
64 |
65 |
66 |
67 | ..\packages\AutoMapper.6.1.1\lib\net45\AutoMapper.dll
68 |
69 |
70 | ..\packages\Microsoft.Azure.Mobile.Server.2.0.0\lib\net46\Microsoft.Azure.Mobile.Server.dll
71 |
72 |
73 | ..\packages\Microsoft.Azure.Mobile.Server.Authentication.2.0.0\lib\net46\Microsoft.Azure.Mobile.Server.Authentication.dll
74 |
75 |
76 | ..\packages\Microsoft.Azure.Mobile.Server.Entity.2.0.0\lib\net46\Microsoft.Azure.Mobile.Server.Entity.dll
77 |
78 |
79 | ..\packages\Microsoft.Azure.Mobile.Server.Home.2.0.0\lib\net46\Microsoft.Azure.Mobile.Server.Home.dll
80 |
81 |
82 | ..\packages\Microsoft.Azure.Mobile.Server.Notifications.2.0.0\lib\net46\Microsoft.Azure.Mobile.Server.Notifications.dll
83 |
84 |
85 | ..\packages\Microsoft.Azure.Mobile.Server.Quickstart.2.0.0\lib\net46\Microsoft.Azure.Mobile.Server.Quickstart.dll
86 |
87 |
88 | ..\packages\Microsoft.Azure.Mobile.Server.Tables.2.0.0\lib\net46\Microsoft.Azure.Mobile.Server.Tables.dll
89 |
90 |
91 | ..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.dll
92 |
93 |
94 | ..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.SqlServer.dll
95 |
96 |
97 | ..\packages\Microsoft.Azure.NotificationHubs.1.0.8\lib\net45-full\Microsoft.Azure.NotificationHubs.dll
98 |
99 |
100 | ..\packages\Microsoft.Data.Edm.5.8.2\lib\net40\Microsoft.Data.Edm.dll
101 |
102 |
103 | ..\packages\Microsoft.Data.OData.5.8.2\lib\net40\Microsoft.Data.OData.dll
104 |
105 |
106 | ..\packages\Microsoft.IdentityModel.Logging.1.1.4\lib\net451\Microsoft.IdentityModel.Logging.dll
107 |
108 |
109 | ..\packages\Microsoft.IdentityModel.Tokens.5.1.4\lib\net451\Microsoft.IdentityModel.Tokens.dll
110 |
111 |
112 | ..\packages\Microsoft.Owin.3.1.0\lib\net45\Microsoft.Owin.dll
113 |
114 |
115 | ..\packages\Microsoft.Owin.Host.SystemWeb.3.1.0\lib\net45\Microsoft.Owin.Host.SystemWeb.dll
116 |
117 |
118 | ..\packages\Microsoft.Owin.Security.3.1.0\lib\net45\Microsoft.Owin.Security.dll
119 |
120 |
121 | ..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll
122 |
123 |
124 | ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll
125 |
126 |
127 |
128 | ..\packages\System.IdentityModel.Tokens.Jwt.5.1.4\lib\net451\System.IdentityModel.Tokens.Jwt.dll
129 |
130 |
131 | ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll
132 |
133 |
134 | ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll
135 |
136 |
137 |
138 |
139 | ..\packages\System.Spatial.5.8.2\lib\net40\System.Spatial.dll
140 |
141 |
142 |
143 |
144 |
145 |
146 | False
147 | ..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 | ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll
157 |
158 |
159 | ..\packages\Owin.1.0\lib\net40\Owin.dll
160 |
161 |
162 | ..\packages\Microsoft.AspNet.WebApi.OData.5.7.0\lib\net45\System.Web.Http.OData.dll
163 |
164 |
165 | ..\packages\Microsoft.AspNet.WebApi.Owin.5.2.3\lib\net45\System.Web.Http.Owin.dll
166 |
167 |
168 | ..\packages\Microsoft.AspNet.WebApi.Tracing.5.2.3\lib\net45\System.Web.Http.Tracing.dll
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 | Web.config
191 |
192 |
193 | Web.config
194 |
195 |
196 | Designer
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
212 |
213 |
214 |
215 |
--------------------------------------------------------------------------------
/ilovecoffee_Runtime/ilovecoffeeService/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------