├── .gitignore ├── LICENSE ├── README.md ├── Source ├── eXam.sln └── eXam │ ├── eXam.AutomatedTests │ ├── AppInitializer.cs │ ├── DirectTests │ │ └── eXamAutomatedTests.cs │ ├── Models │ │ └── AnsweredQuestion.cs │ ├── PageObjectTests │ │ └── FluenteXamAutomatedTests.cs │ ├── PageObjects │ │ ├── AppNav.cs │ │ ├── AppNavPage.cs │ │ ├── BasePageObject.cs │ │ ├── QuestionPage.cs │ │ ├── ReviewPage.cs │ │ └── StartTestPage.cs │ ├── TestRecorderTests │ │ └── TestRecorderCheckTestBegins.cs │ ├── Utility │ │ └── SimpleContainer.cs │ ├── eXam.AutomatedTests.csproj │ └── packages.config │ ├── eXam.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 │ ├── BundleArtifacts │ │ ├── arm.txt │ │ ├── x64.txt │ │ └── x86.txt │ ├── HockeyAppEventService_UWP.cs │ ├── MainPage.xaml │ ├── MainPage.xaml.cs │ ├── Package.appxmanifest │ ├── PlatformFileHelper.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ └── Default.rd.xml │ ├── Windows_TemporaryKey.pfx │ ├── eXam.UWP.csproj │ ├── eXam.UWP.nuget.targets │ ├── eXam.UWP_TemporaryKey.pfx │ ├── project.json │ └── project.lock.json │ ├── eXam.UnitTests │ ├── GameTests.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── app.config │ ├── eXam.UnitTests.csproj │ └── packages.config │ ├── eXam.WinPhone │ ├── App.xaml │ ├── App.xaml.cs │ ├── Assets │ │ ├── Logo.scale-240.png │ │ ├── SmallLogo.scale-240.png │ │ ├── SplashScreen.scale-240.png │ │ ├── Square71x71Logo.scale-240.png │ │ ├── StoreLogo.scale-240.png │ │ └── WideLogo.scale-240.png │ ├── MainPage.xaml │ ├── MainPage.xaml.cs │ ├── Package.appxmanifest │ ├── PlatformFileHelper.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── app.config │ ├── eXam.WinPhone.csproj │ └── packages.config │ ├── eXam.Windows │ ├── App.xaml │ ├── App.xaml.cs │ ├── Assets │ │ ├── Logo.scale-100.png │ │ ├── SmallLogo.scale-100.png │ │ ├── SplashScreen.scale-100.png │ │ └── StoreLogo.scale-100.png │ ├── MainPage.xaml │ ├── MainPage.xaml.cs │ ├── Package.appxmanifest │ ├── PlatformFileHelper.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Windows_TemporaryKey.pfx │ ├── eXam.Windows.csproj │ └── packages.config │ ├── eXam.iOS │ ├── AppDelegate.cs │ ├── Entitlements.plist │ ├── Info.plist │ ├── Main.cs │ ├── PlatformFileHelper.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Resources │ │ ├── Default-568h@2x.png │ │ ├── Default-Portrait.png │ │ ├── Default-Portrait@2x.png │ │ ├── Default.png │ │ ├── Default@2x.png │ │ ├── Icon-60@2x.png │ │ ├── Icon-60@3x.png │ │ ├── Icon-76.png │ │ ├── Icon-76@2x.png │ │ ├── Icon-Small-40.png │ │ ├── Icon-Small-40@2x.png │ │ ├── Icon-Small-40@3x.png │ │ ├── Icon-Small.png │ │ ├── Icon-Small@2x.png │ │ ├── Icon-Small@3x.png │ │ └── LaunchScreen.storyboard │ ├── app.config │ ├── eXam.iOS.csproj │ ├── iTunesArtwork │ ├── iTunesArtwork@2x │ └── packages.config │ ├── eXam │ ├── App.cs │ ├── AzureService.cs │ ├── Data │ │ └── questions.json │ ├── Game.cs │ ├── GettingStarted.Xamarin │ ├── HomePage.cs │ ├── IFileHelper.cs │ ├── Images │ │ └── background.jpg │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── QuestionPage.xaml │ ├── QuestionPage.xaml.cs │ ├── QuizQuestion.cs │ ├── ReviewPage.xaml │ ├── ReviewPage.xaml.cs │ ├── Services │ │ ├── HockeyAppHelper.cs │ │ └── IHockeyEventService.cs │ ├── app.config │ ├── eXam.csproj │ └── packages.config │ └── exam.droid │ ├── Assets │ └── AboutAssets.txt │ ├── MainActivity.cs │ ├── PlatformFileHelper.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 │ ├── app.config │ ├── eXam.Droid.csproj │ └── packages.config └── UITest └── Extras ├── README.md ├── Video Recording ├── TaskyUITests │ ├── TaskyUITests.sln │ └── TaskyUITests │ │ ├── AndroidTaskSystem.cs │ │ ├── AppInitializer.cs │ │ ├── IOSTaskSystem.cs │ │ ├── ITaskSystem.cs │ │ ├── TaskyUITests.csproj │ │ ├── Tests.cs │ │ └── packages.config └── com.xamarin.samples.taskyandroid.apk └── Web Apps ├── TestWeatherAppUI.sln └── TestWeatherAppUI ├── TestWeatherAppUI.csproj ├── Tests.cs └── packages.config /.gitignore: -------------------------------------------------------------------------------- 1 | # Build Folders (you can keep bin if you'd like, to store dlls and pdbs) 2 | [Bb]in/ 3 | [Oo]bj/ 4 | 5 | # mstest test results 6 | TestResults 7 | 8 | ## Ignore Visual Studio temporary files, build results, and 9 | ## files generated by popular Visual Studio add-ons. 10 | 11 | # User-specific files 12 | *.suo 13 | *.user 14 | *.sln.docstates 15 | *.GhostDoc.xml 16 | 17 | ## Mac OS network streams 18 | .DS_Store 19 | 20 | # FAKE scripts 21 | .fake/ 22 | 23 | # Test results 24 | testRuns/ 25 | 26 | # Build results 27 | [Dd]ebug/ 28 | [Rr]elease/ 29 | x64/ 30 | *_i.c 31 | *_p.c 32 | *.ilk 33 | *.meta 34 | *.obj 35 | *.pch 36 | *.pdb 37 | *.pgc 38 | *.pgd 39 | *.rsp 40 | *.sbr 41 | *.tlb 42 | *.tli 43 | *.tlh 44 | *.tmp 45 | *.log 46 | *.vspscc 47 | *.vssscc 48 | .builds 49 | 50 | # Visual C++ cache files 51 | ipch/ 52 | *.aps 53 | *.ncb 54 | *.opensdf 55 | *.sdf 56 | 57 | # Visual Studio profiler 58 | *.psess 59 | *.vsp 60 | *.vspx 61 | 62 | # Guidance Automation Toolkit 63 | *.gpState 64 | 65 | # ReSharper is a .NET coding add-in 66 | _ReSharper* 67 | 68 | # NCrunch 69 | *.ncrunch* 70 | .*crunch*.local.xml 71 | 72 | # Installshield output folder 73 | [Ee]xpress 74 | 75 | # DocProject is a documentation generator add-in 76 | DocProject/buildhelp/ 77 | DocProject/Help/*.HxT 78 | DocProject/Help/*.HxC 79 | DocProject/Help/*.hhc 80 | DocProject/Help/*.hhk 81 | DocProject/Help/*.hhp 82 | DocProject/Help/Html2 83 | DocProject/Help/html 84 | 85 | # Click-Once directory 86 | publish 87 | 88 | # Publish Web Output 89 | *.Publish.xml 90 | 91 | # NuGet Packages Directory 92 | packages/ 93 | 94 | # Xamarin Components directory 95 | Components/ 96 | 97 | # Windows Azure Build Output 98 | csx 99 | *.build.csdef 100 | 101 | # Windows Store app package directory 102 | AppPackages/ 103 | 104 | # Others 105 | [Bb]in 106 | [Oo]bj 107 | sql 108 | TestResults 109 | [Tt]est[Rr]esult* 110 | *.Cache 111 | ClientBin 112 | [Ss]tyle[Cc]op.* 113 | ~$* 114 | *.dbmdl 115 | Generated_Code #added for RIA/Silverlight projects 116 | 117 | # Backup & report files from converting an old project file to a newer 118 | # Visual Studio version. Backup files are not needed, because we have git ;-) 119 | _UpgradeReport_Files/ 120 | Backup*/ 121 | UpgradeLog*.XML 122 | 123 | # Windows image thumb files 124 | [Tt]humbs.db 125 | 126 | *.userprefs 127 | 128 | *.bak 129 | Icon[\r] 130 | 0 131 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) [year] [fullname] 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Connect(); 2016 Training Materials 2 | 3 | ## Welcome to the Xamarin University eXam application 4 | 5 | This application was created as part of our Connect(); 2016 training day. You can watch the recorded videos to see it's construction [here](https://university.xamarin.com/connect2016). 6 | 7 | ### Overview 8 | 9 | This is a Xamarin.Forms application which can target iOS, Android, Windows 10 UWP, Windows 8.1, and Windows 8.1 Phone. It has platform-specific "head" projects for each supported platform, and a core PCL library with all the logic and screens written in XAML for the application. In addition, we have some UI tests which can be run locally with Xamarin.UITest, or in the cloud with [Xamarin Test Cloud](https://testcloud.xamarin.com) or [Visual Studio Mobile Center](https://mobile.azure.com). 10 | 11 | ### Extras 12 | 13 | There are some other extra projects here as well added by the instructors that led the training. Make sure to check through the repository to see what all is present! 14 | 15 | -------------------------------------------------------------------------------- /Source/eXam/eXam.AutomatedTests/AppInitializer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using NUnit.Framework; 5 | using Xamarin.UITest; 6 | 7 | namespace eXam.AutomatedTests 8 | { 9 | public static class AppInitializer 10 | { 11 | public static IApp StartApp(Platform platform) 12 | { 13 | if (platform == Platform.Android) 14 | return ConfigureApp 15 | .Android 16 | .ApkFile(@"..\..\..\eXam.Droid\bin\Release\eXam.Droid.apk") 17 | .PreferIdeSettings() 18 | .StartApp(); 19 | 20 | if (platform == Platform.iOS) 21 | return ConfigureApp 22 | .iOS 23 | .PreferIdeSettings() 24 | .StartApp(); 25 | 26 | throw new Exception($"AppInitializer: Unsupported platform {platform}"); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Source/eXam/eXam.AutomatedTests/DirectTests/eXamAutomatedTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using NUnit.Framework; 5 | using Xamarin.UITest; 6 | 7 | namespace eXam.AutomatedTests 8 | { 9 | //[TestFixture] 10 | public class eXamAutomatedTests 11 | { 12 | IApp app; 13 | 14 | //[SetUp] 15 | public void StartApp() 16 | { 17 | app = ConfigureApp.Android 18 | .PreferIdeSettings() 19 | .StartApp(); 20 | } 21 | 22 | bool IsOnQuestionPage() 23 | { 24 | return app.Query(c => c.Marked("questionPage")).Any(); 25 | } 26 | 27 | //[Test] 28 | public void eXamTestDirect_StartTheTestAndThenCancel_ShouldWork() 29 | { 30 | // Start the Test 31 | app.Tap(c => c.Marked("startExamButton")); 32 | 33 | // Wait for the first question 34 | app.WaitForElement(c => c.Marked("questionPage")); 35 | 36 | // Go back 37 | app.Back(); 38 | 39 | // We should see the home page again 40 | Assert.IsTrue(app.Query(c => c.Marked("startExamButton")).Any()); 41 | } 42 | 43 | //[Test] 44 | public void PerformTestDirect_AnswerAllQuestions_ShouldBeOK() 45 | { 46 | var r = new Random(); 47 | 48 | var allAnswers = new List(); 49 | 50 | // Start the Test 51 | app.Tap(c => c.Marked("startExamButton")); 52 | 53 | // Answer the Questions 54 | while (IsOnQuestionPage()) 55 | { 56 | var currentQuestion = new AnsweredQuestion(); 57 | 58 | // We have a question page 59 | currentQuestion.Text = app.Query(c => c.Marked("questionText"))[0].Text; 60 | 61 | // Let's answer the question 62 | currentQuestion.Answer = r.Next(2) == 0; 63 | 64 | app.Tap(c => c.Marked(currentQuestion.Answer ? "trueButton" : "falseButton")); 65 | app.WaitForElement(c => c.Marked("resultText")); 66 | 67 | // Get the status to see if it is correct or incorrect 68 | var response = app.Query(c => c.Marked("resultText")).FirstOrDefault().Text; 69 | 70 | currentQuestion.WasCorrect = response == "Correct"; 71 | 72 | allAnswers.Add(currentQuestion); 73 | 74 | // Move on to the next question, unless we are on the last one 75 | app.Tap(c => c.Marked("nextButton")); 76 | 77 | try 78 | { 79 | app.WaitForElement(c => c.Marked("questionPage")); 80 | } 81 | catch 82 | { 83 | break; 84 | } 85 | } 86 | 87 | // See that we have questions 88 | Assert.Greater(allAnswers.Count, 0); 89 | 90 | // Let's see that we have answers 91 | Assert.IsTrue(app.Query(c => c.Marked(allAnswers[0].ReviewText)).Any()); 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /Source/eXam/eXam.AutomatedTests/Models/AnsweredQuestion.cs: -------------------------------------------------------------------------------- 1 | namespace eXam.AutomatedTests 2 | { 3 | public class AnsweredQuestion 4 | { 5 | public string Text { get; set; } 6 | public bool Answer { get; set; } 7 | public bool WasCorrect { get; set; } 8 | 9 | public string ReviewText 10 | { 11 | get 12 | { 13 | return $"Question: {Text}"; 14 | } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Source/eXam/eXam.AutomatedTests/PageObjectTests/FluenteXamAutomatedTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using NUnit.Framework; 5 | using Xamarin.UITest; 6 | 7 | namespace eXam.AutomatedTests 8 | { 9 | [TestFixture(Platform.Android)] 10 | // [TestFixture(Platform.iOS)] 11 | public class FluenteXamAutomatedTests 12 | { 13 | Platform platform; 14 | 15 | public FluenteXamAutomatedTests(Platform platform) 16 | { 17 | this.platform = platform; 18 | } 19 | 20 | IApp app; 21 | AppNav navigation; 22 | SimpleContainer container; 23 | 24 | [SetUp] 25 | public void BeforeEachTest() 26 | { 27 | app = AppInitializer.StartApp(platform); 28 | 29 | container = new SimpleContainer(); 30 | container.Register(() => app); 31 | 32 | navigation = container.Create(); 33 | } 34 | 35 | [Test] 36 | public void eXamTest_StartTheTestAndThenCancel_ShouldWork() 37 | { 38 | var startPage = container.Create(); 39 | var questionPage = container.Create(); 40 | 41 | // Start the Test 42 | startPage.StartTest(); 43 | navigation.AssertPage(AppNavPage.Question); 44 | 45 | // Go Back 46 | app.Screenshot("Viewing Question"); 47 | questionPage.GoBack(); 48 | 49 | // We should see the home page again 50 | navigation.AssertPage(AppNavPage.Home); 51 | } 52 | 53 | [Test] 54 | public void PerformTest_AnswerAllQuestions_ShouldBeOK() 55 | { 56 | // Arrange 57 | var startPage = container.Create(); 58 | var reviewPage = container.Create(); 59 | 60 | // Act 61 | startPage.StartTest(); 62 | navigation.AssertPage(AppNavPage.Question); 63 | 64 | var allQuestions = new List(); 65 | 66 | while (navigation.CurrentPage == AppNavPage.Question) 67 | { 68 | var questionPage = container.Create(); 69 | 70 | allQuestions.Add(questionPage); 71 | 72 | questionPage 73 | .AnswerWithRandomAnswer() 74 | .NextQuestion(); 75 | } 76 | 77 | // Assert 78 | var questionCount = allQuestions.Count; 79 | var correctCount = allQuestions.Count(q => q.currentQuestion.WasCorrect); 80 | 81 | app.Screenshot("Reviewing Answers"); 82 | 83 | Assert.IsTrue(reviewPage.HasCorrectCount(correctCount, questionCount)); 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /Source/eXam/eXam.AutomatedTests/PageObjects/AppNav.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using NUnit.Framework; 4 | using Xamarin.UITest; 5 | 6 | namespace eXam.AutomatedTests 7 | { 8 | public class AppNav 9 | { 10 | protected readonly IApp app; 11 | 12 | public AppNav(IApp app) 13 | { 14 | this.app = app; 15 | } 16 | 17 | string[] ids = new string[] { "startExamButton", "questionPage", "resultText" }; 18 | 19 | public AppNavPage CurrentPage 20 | { 21 | get 22 | { 23 | for (int i = 0; i < ids.Length; i++) 24 | { 25 | if (app.Query(c => c.Marked(ids[i])).Any()) 26 | return (AppNavPage)i; 27 | } 28 | 29 | throw new ArgumentException("None of the pages could be found"); 30 | } 31 | } 32 | 33 | public void AssertPage(AppNavPage page) 34 | { 35 | app.WaitForElement(ids[(int)page]); 36 | 37 | Assert.AreEqual(page, CurrentPage); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Source/eXam/eXam.AutomatedTests/PageObjects/AppNavPage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using Xamarin.UITest; 4 | 5 | namespace eXam.AutomatedTests 6 | { 7 | public enum AppNavPage 8 | { 9 | Home, 10 | Question, 11 | Review 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Source/eXam/eXam.AutomatedTests/PageObjects/BasePageObject.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using Xamarin.UITest; 4 | 5 | namespace eXam.AutomatedTests 6 | { 7 | /// 8 | /// A Simple base Page object that is used. Often you will have pages in your application 9 | /// that have shared functionality; For example you could have a hamburger navigation in your app 10 | /// and you want some shared code to open the flyout and navigate to a particular page 11 | /// 12 | public class BasePageObject 13 | { 14 | protected readonly IApp app; 15 | 16 | public BasePageObject(IApp app) 17 | { 18 | this.app = app; 19 | } 20 | } 21 | 22 | /// 23 | /// A Generic version which is useful if you are making fluent-page objects 24 | /// 25 | /// 26 | public class BasePageObject : BasePageObject 27 | { 28 | public BasePageObject(IApp app) : base(app) 29 | { 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Source/eXam/eXam.AutomatedTests/PageObjects/QuestionPage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using Xamarin.UITest; 4 | 5 | namespace eXam.AutomatedTests 6 | { 7 | public class QuestionPage : BasePageObject 8 | { 9 | public QuestionPage(IApp app) : base(app) 10 | { 11 | } 12 | 13 | public AnsweredQuestion currentQuestion { get; set; } = new AnsweredQuestion(); 14 | 15 | public QuestionPage AnswerQuestion(bool answer) 16 | { 17 | currentQuestion.Text = app.Query(c => c.Marked("questionText"))[0].Text; 18 | currentQuestion.Answer = answer; 19 | 20 | app.Tap(c => c.Marked(currentQuestion.Answer ? "trueButton" : "falseButton")); 21 | app.WaitForElement(c => c.Marked("resultText")); 22 | 23 | app.Screenshot("Answer: " + currentQuestion.Text); 24 | 25 | // Get the status to see if it is correct or incorrect 26 | var response = app.Query(c => c.Marked("resultText"))[0].Text; 27 | currentQuestion.WasCorrect = response == "Correct"; 28 | 29 | return this; 30 | } 31 | 32 | Random r = new Random(); 33 | 34 | public QuestionPage AnswerWithRandomAnswer() 35 | { 36 | return AnswerQuestion(r.Next(2) == 1); 37 | } 38 | 39 | public QuestionPage NextQuestion() 40 | { 41 | app.Tap(c => c.Marked("nextButton")); 42 | 43 | // We want to get either another Question Page or the Results Page 44 | app.WaitFor(() => app.Query(c => c.Marked("questionPage")).Any() || 45 | app.Query(c => c.Marked("resultText")).Any()); 46 | 47 | return this; 48 | } 49 | 50 | public QuestionPage GoBack() 51 | { 52 | app.Back(); 53 | 54 | return this; 55 | } 56 | 57 | public QuestionPage WaitToAppear() 58 | { 59 | app.WaitForElement(c => c.Marked("questionPage")); 60 | 61 | return this; 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Source/eXam/eXam.AutomatedTests/PageObjects/ReviewPage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Xamarin.UITest; 5 | 6 | namespace eXam.AutomatedTests 7 | { 8 | public class ReviewPage : BasePageObject 9 | { 10 | public ReviewPage(IApp app) : base(app) 11 | { 12 | } 13 | 14 | public bool HasCorrectCount(int correctCount, int answerCount) 15 | { 16 | var text = $"Great! You got {correctCount} out of {answerCount} questions correct"; 17 | var control = app.Query(c => c.Marked(text)).FirstOrDefault(); 18 | 19 | return control != null; 20 | } 21 | 22 | public bool HasResponse(AnsweredQuestion question) 23 | { 24 | app.ScrollDownTo(c => c.Marked(question.ReviewText)); 25 | 26 | return app.Query(c => c.Marked(question.ReviewText)).Any(); 27 | } 28 | 29 | public bool HasResponses(IEnumerable questions) 30 | { 31 | foreach (var question in questions) 32 | if (!HasResponse(question)) 33 | return false; 34 | 35 | return true; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Source/eXam/eXam.AutomatedTests/PageObjects/StartTestPage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using Xamarin.UITest; 4 | 5 | namespace eXam.AutomatedTests 6 | { 7 | public class StartTestPage : BasePageObject 8 | { 9 | public StartTestPage(IApp app) : base(app) 10 | { 11 | } 12 | 13 | public StartTestPage StartTest() 14 | { 15 | app.Screenshot("Starting Test"); 16 | 17 | app.WaitForElement(c => c.Marked("startExamButton")); 18 | app.Tap(c => c.Marked("startExamButton")); 19 | app.WaitForElement(c => c.Marked("questionPage")); 20 | 21 | return this; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Source/eXam/eXam.AutomatedTests/TestRecorderTests/TestRecorderCheckTestBegins.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using Xamarin.UITest; 8 | using Xamarin.UITest.Android; 9 | 10 | namespace eXam.AutomatedTests.TestRecorderTests 11 | { 12 | [TestFixture] 13 | public class TestRecorderCheckTestBegins 14 | { 15 | AndroidApp app; 16 | 17 | [SetUp] 18 | public void BeforeEachTest() 19 | { 20 | app = ConfigureApp 21 | .Android 22 | .ApkFile(@"..\..\..\eXam.Droid\bin\Release\eXam.Droid.apk") 23 | .StartApp(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Source/eXam/eXam.AutomatedTests/Utility/SimpleContainer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | 6 | namespace eXam.AutomatedTests 7 | { 8 | /// 9 | /// This is a very simple example of a DI/IoC container. Taken from the XAM300 - Advanced Cross Platform Class 10 | /// 11 | public sealed class SimpleContainer 12 | { 13 | readonly Dictionary> registeredCreators = new Dictionary>(); 14 | 15 | /// 16 | /// Register a type with the container. This is only necessary if the 17 | /// type has a non-default constructor or needs to be customized in some fashion. 18 | /// 19 | /// Abstraction type 20 | /// Type to create 21 | public void Register() 22 | where TImpl : new() 23 | { 24 | registeredCreators.Add(typeof(TAbstraction), () => new TImpl()); 25 | } 26 | 27 | /// 28 | /// Register a type with the container. This is only necessary if the 29 | /// type has a non-default constructor or needs to be customized in some fashion. 30 | /// 31 | /// Function to create the given type. 32 | /// Type to create 33 | public void Register(Func creator) 34 | { 35 | registeredCreators.Add(typeof(T),creator); 36 | } 37 | 38 | /// 39 | /// Creates a factory for a type so it may be created through 40 | /// the container without taking a dependency on the container directly. 41 | /// 42 | /// Creator function 43 | /// The 1st type parameter. 44 | public Func FactoryFor() 45 | { 46 | return Create; 47 | } 48 | 49 | /// 50 | /// Creates the given type, either through a registered function 51 | /// or through the default constructor. 52 | /// 53 | /// Type to create 54 | public T Create() 55 | { 56 | return (T) Create(typeof(T)); 57 | } 58 | 59 | /// 60 | /// Creates the given type, either through a registered function 61 | /// or through the default constructor. 62 | /// 63 | /// Type to create 64 | public object Create(Type type) 65 | { 66 | TypeInfo typeInfo = type.GetTypeInfo(); 67 | 68 | Func creator; 69 | if (registeredCreators.TryGetValue(type, out creator)) 70 | return registeredCreators[type](); 71 | 72 | var ctors = typeInfo.DeclaredConstructors.Where(c => c.IsPublic).ToArray(); 73 | var ctor = ctors.FirstOrDefault(c => c.GetParameters().Length == 0); 74 | if (ctor != null) 75 | return Activator.CreateInstance(type); 76 | 77 | // Pick the first constructor found and create any parameters. 78 | ctor = ctors[0]; 79 | List parameters = new List(); 80 | foreach (var p in ctor.GetParameters()) 81 | parameters.Add(Create(p.ParameterType)); 82 | 83 | return Activator.CreateInstance(type, parameters.ToArray()); 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /Source/eXam/eXam.AutomatedTests/eXam.AutomatedTests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | {4635E436-5DAF-4EAA-9FC8-C6F1869A2CBE} 7 | Library 8 | eXam.AutomatedTests 9 | eXam.AutomatedTests 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 | 32 | ..\..\packages\HockeySDK.Xamarin.4.1.0\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\HockeySDK.dll 33 | True 34 | 35 | 36 | ..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll 37 | True 38 | 39 | 40 | 41 | ..\..\packages\Xamarin.UITest.2.0.0\lib\Xamarin.UITest.dll 42 | True 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /Source/eXam/eXam.AutomatedTests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Source/eXam/eXam.UWP/App.xaml: -------------------------------------------------------------------------------- 1 |  7 | 8 | 9 | -------------------------------------------------------------------------------- /Source/eXam/eXam.UWP/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.ApplicationModel; 7 | using Windows.ApplicationModel.Activation; 8 | using Windows.Foundation; 9 | using Windows.Foundation.Collections; 10 | using Windows.UI.Xaml; 11 | using Windows.UI.Xaml.Controls; 12 | using Windows.UI.Xaml.Controls.Primitives; 13 | using Windows.UI.Xaml.Data; 14 | using Windows.UI.Xaml.Input; 15 | using Windows.UI.Xaml.Media; 16 | using Windows.UI.Xaml.Navigation; 17 | using Microsoft.HockeyApp; 18 | using eXam.Services; 19 | 20 | namespace eXam.UWP 21 | { 22 | /// 23 | /// Provides application-specific behavior to supplement the default Application class. 24 | /// 25 | sealed partial class App : 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 | HockeyClient.Current.Configure(HockeyAppHelper.AppIds.HockeyAppId_UWP); 36 | } 37 | 38 | /// 39 | /// Invoked when the application is launched normally by the end user. Other entry points 40 | /// will be used such as when the application is launched to open a specific file. 41 | /// 42 | /// Details about the launch request and process. 43 | protected override void OnLaunched(LaunchActivatedEventArgs e) 44 | { 45 | 46 | #if DEBUG 47 | if (System.Diagnostics.Debugger.IsAttached) 48 | { 49 | this.DebugSettings.EnableFrameRateCounter = true; 50 | } 51 | #endif 52 | 53 | Frame rootFrame = Window.Current.Content as Frame; 54 | 55 | // Do not repeat app initialization when the Window already has content, 56 | // just ensure that the window is active 57 | if (rootFrame == null) 58 | { 59 | // Create a Frame to act as the navigation context and navigate to the first page 60 | rootFrame = new Frame(); 61 | 62 | rootFrame.NavigationFailed += OnNavigationFailed; 63 | 64 | Xamarin.Forms.Forms.Init(e); 65 | 66 | if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) 67 | { 68 | //TODO: Load state from previously suspended application 69 | } 70 | 71 | // Place the frame in the current Window 72 | Window.Current.Content = rootFrame; 73 | } 74 | 75 | if (rootFrame.Content == null) 76 | { 77 | // When the navigation stack isn't restored navigate to the first page, 78 | // configuring the new page by passing required information as a navigation 79 | // parameter 80 | rootFrame.Navigate(typeof(MainPage), e.Arguments); 81 | } 82 | // Ensure the current window is active 83 | Window.Current.Activate(); 84 | } 85 | 86 | /// 87 | /// Invoked when Navigation to a certain page fails 88 | /// 89 | /// The Frame which failed navigation 90 | /// Details about the navigation failure 91 | void OnNavigationFailed(object sender, NavigationFailedEventArgs e) 92 | { 93 | throw new Exception("Failed to load Page " + e.SourcePageType.FullName); 94 | } 95 | 96 | /// 97 | /// Invoked when application execution is being suspended. Application state is saved 98 | /// without knowing whether the application will be terminated or resumed with the contents 99 | /// of memory still intact. 100 | /// 101 | /// The source of the suspend request. 102 | /// Details about the suspend request. 103 | private void OnSuspending(object sender, SuspendingEventArgs e) 104 | { 105 | var deferral = e.SuspendingOperation.GetDeferral(); 106 | //TODO: Save application state and stop any background activity 107 | deferral.Complete(); 108 | } 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /Source/eXam/eXam.UWP/Assets/LockScreenLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.UWP/Assets/LockScreenLogo.scale-200.png -------------------------------------------------------------------------------- /Source/eXam/eXam.UWP/Assets/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.UWP/Assets/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /Source/eXam/eXam.UWP/Assets/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.UWP/Assets/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /Source/eXam/eXam.UWP/Assets/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.UWP/Assets/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /Source/eXam/eXam.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png -------------------------------------------------------------------------------- /Source/eXam/eXam.UWP/Assets/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.UWP/Assets/StoreLogo.png -------------------------------------------------------------------------------- /Source/eXam/eXam.UWP/Assets/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.UWP/Assets/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /Source/eXam/eXam.UWP/BundleArtifacts/arm.txt: -------------------------------------------------------------------------------- 1 | MainPackage=C:\VSConnect\eXam\eXam.UWP\bin\ARM\Release\eXam.UWP_1.0.1.0_ARM.appx 2 | SymbolPackage=C:\VSConnect\exam\eXam.UWP\bin\x86\Debug\eXam.UWP_1.0.1.0_Test\eXam.UWP_1.0.1.0_ARM.appxsym 3 | -------------------------------------------------------------------------------- /Source/eXam/eXam.UWP/BundleArtifacts/x64.txt: -------------------------------------------------------------------------------- 1 | MainPackage=C:\VSConnect\eXam\eXam.UWP\bin\x64\Release\eXam.UWP_1.0.1.0_x64.appx 2 | SymbolPackage=C:\VSConnect\exam\eXam.UWP\bin\x86\Debug\eXam.UWP_1.0.1.0_Test\eXam.UWP_1.0.1.0_x64.appxsym 3 | -------------------------------------------------------------------------------- /Source/eXam/eXam.UWP/BundleArtifacts/x86.txt: -------------------------------------------------------------------------------- 1 | MainPackage=C:\VSConnect\eXam\eXam.UWP\bin\x86\Release\eXam.UWP_1.0.1.0_x86.appx 2 | SymbolPackage=C:\VSConnect\exam\eXam.UWP\bin\x86\Debug\eXam.UWP_1.0.1.0_Test\eXam.UWP_1.0.1.0_x86.appxsym 3 | -------------------------------------------------------------------------------- /Source/eXam/eXam.UWP/HockeyAppEventService_UWP.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using eXam.Services; 7 | using eXam.UWP; 8 | 9 | [assembly:Xamarin.Forms.Dependency(typeof(HockeyAppEventService_UWP))] 10 | namespace eXam.UWP 11 | { 12 | public class HockeyAppEventService_UWP : IHockeyEventService 13 | { 14 | public void TrackEvent(string eventName) 15 | { 16 | Microsoft.HockeyApp.HockeyClient.Current.TrackEvent(eventName); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Source/eXam/eXam.UWP/MainPage.xaml: -------------------------------------------------------------------------------- 1 |  10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Source/eXam/eXam.UWP/MainPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.Foundation; 7 | using Windows.Foundation.Collections; 8 | using Windows.UI.Xaml; 9 | using Windows.UI.Xaml.Controls; 10 | using Windows.UI.Xaml.Controls.Primitives; 11 | using Windows.UI.Xaml.Data; 12 | using Windows.UI.Xaml.Input; 13 | using Windows.UI.Xaml.Media; 14 | using Windows.UI.Xaml.Navigation; 15 | 16 | namespace eXam.UWP 17 | { 18 | public sealed partial class MainPage 19 | { 20 | public MainPage() 21 | { 22 | this.InitializeComponent(); 23 | 24 | LoadApplication(new eXam.App()); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Source/eXam/eXam.UWP/Package.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | eXam.UWP 7 | kphillpotts 8 | Assets\StoreLogo.png 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Source/eXam/eXam.UWP/PlatformFileHelper.cs: -------------------------------------------------------------------------------- 1 | using eXam.Windows; 2 | using System; 3 | using System.Threading.Tasks; 4 | using Windows.Storage; 5 | using Xamarin.Forms; 6 | 7 | [assembly: Dependency(typeof(PlatformFileHelper))] 8 | 9 | namespace eXam.Windows 10 | { 11 | class PlatformFileHelper : IFileHelper 12 | { 13 | public string GetNameWithPath(string filename) 14 | { 15 | return filename; 16 | } 17 | 18 | public async Task LoadLocalFileAsync(string filename) 19 | { 20 | try 21 | { 22 | var file = await ApplicationData.Current.LocalFolder.GetFileAsync(filename).AsTask(); 23 | return await FileIO.ReadTextAsync(file); 24 | } 25 | catch 26 | { 27 | return null; 28 | } 29 | } 30 | 31 | public async Task SaveLocalFileAsync(string filename, string data) 32 | { 33 | try 34 | { 35 | var file = await ApplicationData.Current.LocalFolder.CreateFileAsync(filename, CreationCollisionOption.ReplaceExisting).AsTask(); 36 | await FileIO.WriteTextAsync(file, data); 37 | return true; 38 | } 39 | catch 40 | { 41 | return false; 42 | } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Source/eXam/eXam.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("eXam.UWP")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("eXam.UWP")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 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)] -------------------------------------------------------------------------------- /Source/eXam/eXam.UWP/Properties/Default.rd.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Source/eXam/eXam.UWP/Windows_TemporaryKey.pfx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.UWP/Windows_TemporaryKey.pfx -------------------------------------------------------------------------------- /Source/eXam/eXam.UWP/eXam.UWP.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | x86 7 | {7C3FBAA5-8A9D-4A37-BCF8-EFF1803D18DA} 8 | AppContainerExe 9 | Properties 10 | eXam.UWP 11 | eXam.UWP 12 | en-US 13 | UAP 14 | 10.0.10586.0 15 | 10.0.10586.0 16 | 14 17 | true 18 | 512 19 | {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 20 | eXam.UWP_TemporaryKey.pfx 21 | B247B7F9F2AA2EC806A4DDB04FE7E4F04183D6B1 22 | True 23 | C:\VSConnect\exam\eXam.UWP\bin\x86\Debug\ 24 | Always 25 | x86|x64|arm 26 | 27 | 28 | true 29 | bin\ARM\Debug\ 30 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 31 | ;2008 32 | full 33 | ARM 34 | false 35 | prompt 36 | true 37 | 38 | 39 | bin\ARM\Release\ 40 | TRACE;NETFX_CORE;WINDOWS_UWP 41 | true 42 | ;2008 43 | pdbonly 44 | ARM 45 | false 46 | prompt 47 | true 48 | false 49 | 50 | 51 | true 52 | bin\x64\Debug\ 53 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 54 | ;2008 55 | full 56 | x64 57 | false 58 | prompt 59 | true 60 | 61 | 62 | bin\x64\Release\ 63 | TRACE;NETFX_CORE;WINDOWS_UWP 64 | true 65 | ;2008 66 | pdbonly 67 | x64 68 | false 69 | prompt 70 | true 71 | false 72 | 73 | 74 | true 75 | bin\x86\Debug\ 76 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 77 | ;2008 78 | full 79 | x86 80 | false 81 | prompt 82 | true 83 | 84 | 85 | bin\x86\Release\ 86 | TRACE;NETFX_CORE;WINDOWS_UWP 87 | true 88 | ;2008 89 | pdbonly 90 | x86 91 | false 92 | prompt 93 | true 94 | false 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | App.xaml 104 | 105 | 106 | 107 | MainPage.xaml 108 | 109 | 110 | 111 | 112 | 113 | 114 | Designer 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | MSBuild:Compile 131 | Designer 132 | 133 | 134 | MSBuild:Compile 135 | Designer 136 | 137 | 138 | 139 | 140 | eXam 141 | 142 | 143 | 144 | 145 | Visual C++ 2015 Runtime for Universal Windows Platform Apps 146 | 147 | 148 | SQLite for Universal Windows Platform 149 | 150 | 151 | 152 | 14.0 153 | 154 | 155 | 162 | -------------------------------------------------------------------------------- /Source/eXam/eXam.UWP/eXam.UWP.nuget.targets: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(UserProfile)\.nuget\packages\ 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Source/eXam/eXam.UWP/eXam.UWP_TemporaryKey.pfx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.UWP/eXam.UWP_TemporaryKey.pfx -------------------------------------------------------------------------------- /Source/eXam/eXam.UWP/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "HockeySDK.UWP": "4.1.5", 4 | "Microsoft.Azure.Mobile.Client": "3.0.3", 5 | "Microsoft.Azure.Mobile.Client.SQLiteStore": "3.0.3", 6 | "Microsoft.Net.Http": "2.2.29", 7 | "Microsoft.NETCore.UniversalWindowsPlatform": "5.2.2", 8 | "Newtonsoft.Json": "9.0.1", 9 | "Xamarin.Forms": "2.3.2.127" 10 | }, 11 | "frameworks": { 12 | "uap10.0": {} 13 | }, 14 | "runtimes": { 15 | "win10-arm": {}, 16 | "win10-arm-aot": {}, 17 | "win10-x86": {}, 18 | "win10-x86-aot": {}, 19 | "win10-x64": {}, 20 | "win10-x64-aot": {} 21 | } 22 | } -------------------------------------------------------------------------------- /Source/eXam/eXam.UnitTests/GameTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using NUnit.Framework; 4 | using eXam; 5 | 6 | namespace eXam.UnitTests 7 | { 8 | [TestFixture] 9 | public class GameTests 10 | { 11 | [Test] 12 | public void GameTests_TestForCorrectInitialization_ShouldBeOk() 13 | { 14 | // Arrange (setup test) 15 | var question = new QuizQuestion() 16 | { 17 | Question = "Xamarin.Forms is awesome", 18 | Answer = true, 19 | Explanation = "Try it for yourself :)" 20 | }; 21 | 22 | // Act (perform test) 23 | var game = new Game(new List(new [] { question })); 24 | 25 | // Assert (verify test) 26 | Assert.AreEqual(1, game.Questions.Count); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Source/eXam/eXam.UnitTests/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("eXam.UnitTests")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("eXam.UnitTests")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 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("753a485c-9491-4753-97a9-22bbd410e9bd")] 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 Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Source/eXam/eXam.UnitTests/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Source/eXam/eXam.UnitTests/eXam.UnitTests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {753A485C-9491-4753-97A9-22BBD410E9BD} 8 | Library 9 | Properties 10 | eXam.UnitTests 11 | eXam.UnitTests 12 | v4.5.2 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | ..\..\packages\HockeySDK.Xamarin.4.1.0\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\HockeySDK.dll 35 | True 36 | 37 | 38 | ..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll 39 | True 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | {281f83a1-af13-4b44-b595-58545e995a44} 57 | eXam 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 75 | -------------------------------------------------------------------------------- /Source/eXam/eXam.UnitTests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Source/eXam/eXam.WinPhone/App.xaml: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | -------------------------------------------------------------------------------- /Source/eXam/eXam.WinPhone/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.ApplicationModel; 7 | using Windows.ApplicationModel.Activation; 8 | using Windows.Foundation; 9 | using Windows.Foundation.Collections; 10 | using Windows.UI.Xaml; 11 | using Windows.UI.Xaml.Controls; 12 | using Windows.UI.Xaml.Controls.Primitives; 13 | using Windows.UI.Xaml.Data; 14 | using Windows.UI.Xaml.Input; 15 | using Windows.UI.Xaml.Media; 16 | using Windows.UI.Xaml.Media.Animation; 17 | using Windows.UI.Xaml.Navigation; 18 | 19 | // The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=234227 20 | 21 | namespace eXam.WinPhone 22 | { 23 | /// 24 | /// Provides application-specific behavior to supplement the default Application class. 25 | /// 26 | public sealed partial class App : Application 27 | { 28 | private TransitionCollection transitions; 29 | 30 | /// 31 | /// Initializes the singleton application object. This is the first line of authored code 32 | /// executed, and as such is the logical equivalent of main() or WinMain(). 33 | /// 34 | public App() 35 | { 36 | this.InitializeComponent(); 37 | this.Suspending += this.OnSuspending; 38 | } 39 | 40 | /// 41 | /// Invoked when the application is launched normally by the end user. Other entry points 42 | /// will be used when the application is launched to open a specific file, to display 43 | /// search results, and so forth. 44 | /// 45 | /// Details about the launch request and process. 46 | protected override void OnLaunched(LaunchActivatedEventArgs e) 47 | { 48 | #if DEBUG 49 | if (System.Diagnostics.Debugger.IsAttached) 50 | { 51 | this.DebugSettings.EnableFrameRateCounter = true; 52 | } 53 | #endif 54 | 55 | Frame rootFrame = Window.Current.Content as Frame; 56 | 57 | // Do not repeat app initialization when the Window already has content, 58 | // just ensure that the window is active 59 | if (rootFrame == null) 60 | { 61 | // Create a Frame to act as the navigation context and navigate to the first page 62 | rootFrame = new Frame(); 63 | 64 | // TODO: change this value to a cache size that is appropriate for your application 65 | rootFrame.CacheSize = 1; 66 | 67 | Xamarin.Forms.Forms.Init(e); 68 | 69 | if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) 70 | { 71 | // TODO: Load state from previously suspended application 72 | } 73 | 74 | // Place the frame in the current Window 75 | Window.Current.Content = rootFrame; 76 | } 77 | 78 | if (rootFrame.Content == null) 79 | { 80 | // Removes the turnstile navigation for startup. 81 | if (rootFrame.ContentTransitions != null) 82 | { 83 | this.transitions = new TransitionCollection(); 84 | foreach (var c in rootFrame.ContentTransitions) 85 | { 86 | this.transitions.Add(c); 87 | } 88 | } 89 | 90 | rootFrame.ContentTransitions = null; 91 | rootFrame.Navigated += this.RootFrame_FirstNavigated; 92 | 93 | // When the navigation stack isn't restored navigate to the first page, 94 | // configuring the new page by passing required information as a navigation 95 | // parameter 96 | if (!rootFrame.Navigate(typeof(MainPage), e.Arguments)) 97 | { 98 | throw new Exception("Failed to create initial page"); 99 | } 100 | } 101 | 102 | // Ensure the current window is active 103 | Window.Current.Activate(); 104 | } 105 | 106 | /// 107 | /// Restores the content transitions after the app has launched. 108 | /// 109 | /// The object where the handler is attached. 110 | /// Details about the navigation event. 111 | private void RootFrame_FirstNavigated(object sender, NavigationEventArgs e) 112 | { 113 | var rootFrame = sender as Frame; 114 | rootFrame.ContentTransitions = this.transitions ?? new TransitionCollection() { new NavigationThemeTransition() }; 115 | rootFrame.Navigated -= this.RootFrame_FirstNavigated; 116 | } 117 | 118 | /// 119 | /// Invoked when application execution is being suspended. Application state is saved 120 | /// without knowing whether the application will be terminated or resumed with the contents 121 | /// of memory still intact. 122 | /// 123 | /// The source of the suspend request. 124 | /// Details about the suspend request. 125 | private void OnSuspending(object sender, SuspendingEventArgs e) 126 | { 127 | var deferral = e.SuspendingOperation.GetDeferral(); 128 | 129 | // TODO: Save application state and stop any background activity 130 | deferral.Complete(); 131 | } 132 | } 133 | } -------------------------------------------------------------------------------- /Source/eXam/eXam.WinPhone/Assets/Logo.scale-240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.WinPhone/Assets/Logo.scale-240.png -------------------------------------------------------------------------------- /Source/eXam/eXam.WinPhone/Assets/SmallLogo.scale-240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.WinPhone/Assets/SmallLogo.scale-240.png -------------------------------------------------------------------------------- /Source/eXam/eXam.WinPhone/Assets/SplashScreen.scale-240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.WinPhone/Assets/SplashScreen.scale-240.png -------------------------------------------------------------------------------- /Source/eXam/eXam.WinPhone/Assets/Square71x71Logo.scale-240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.WinPhone/Assets/Square71x71Logo.scale-240.png -------------------------------------------------------------------------------- /Source/eXam/eXam.WinPhone/Assets/StoreLogo.scale-240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.WinPhone/Assets/StoreLogo.scale-240.png -------------------------------------------------------------------------------- /Source/eXam/eXam.WinPhone/Assets/WideLogo.scale-240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.WinPhone/Assets/WideLogo.scale-240.png -------------------------------------------------------------------------------- /Source/eXam/eXam.WinPhone/MainPage.xaml: -------------------------------------------------------------------------------- 1 |  11 | 12 | -------------------------------------------------------------------------------- /Source/eXam/eXam.WinPhone/MainPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.Foundation; 7 | using Windows.Foundation.Collections; 8 | using Windows.UI.Xaml; 9 | using Windows.UI.Xaml.Controls; 10 | using Windows.UI.Xaml.Controls.Primitives; 11 | using Windows.UI.Xaml.Data; 12 | using Windows.UI.Xaml.Input; 13 | using Windows.UI.Xaml.Media; 14 | using Windows.UI.Xaml.Navigation; 15 | 16 | // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238 17 | 18 | namespace eXam.WinPhone 19 | { 20 | /// 21 | /// An empty page that can be used on its own or navigated to within a Frame. 22 | /// 23 | public sealed partial class MainPage 24 | { 25 | public MainPage() 26 | { 27 | this.InitializeComponent(); 28 | 29 | this.NavigationCacheMode = NavigationCacheMode.Required; 30 | 31 | LoadApplication(new eXam.App()); 32 | } 33 | 34 | /// 35 | /// Invoked when this page is about to be displayed in a Frame. 36 | /// 37 | /// Event data that describes how this page was reached. 38 | /// This parameter is typically used to configure the page. 39 | protected override void OnNavigatedTo(NavigationEventArgs e) 40 | { 41 | // TODO: Prepare page for display here. 42 | 43 | // TODO: If your application contains multiple pages, ensure that you are 44 | // handling the hardware Back button by registering for the 45 | // Windows.Phone.UI.Input.HardwareButtons.BackPressed event. 46 | // If you are using the NavigationHelper provided by some templates, 47 | // this event is handled for you. 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Source/eXam/eXam.WinPhone/Package.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 7 | 8 | 9 | 10 | 11 | FPCL.Windows8.WindowsPhone 12 | joaqu 13 | Assets\StoreLogo.png 14 | 15 | 16 | 17 | 6.3.1 18 | 6.3.1 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /Source/eXam/eXam.WinPhone/PlatformFileHelper.cs: -------------------------------------------------------------------------------- 1 | using eXam.Windows; 2 | using System; 3 | using System.Threading.Tasks; 4 | using Windows.Storage; 5 | using Xamarin.Forms; 6 | 7 | [assembly: Dependency(typeof(PlatformFileHelper))] 8 | 9 | namespace eXam.Windows 10 | { 11 | class PlatformFileHelper : IFileHelper 12 | { 13 | public string GetNameWithPath(string filename) 14 | { 15 | return filename; 16 | } 17 | 18 | public async Task LoadLocalFileAsync(string filename) 19 | { 20 | try 21 | { 22 | var file = await ApplicationData.Current.LocalFolder.GetFileAsync(filename).AsTask(); 23 | return await FileIO.ReadTextAsync(file); 24 | } 25 | catch 26 | { 27 | return null; 28 | } 29 | } 30 | 31 | public async Task SaveLocalFileAsync(string filename, string data) 32 | { 33 | try 34 | { 35 | var file = await ApplicationData.Current.LocalFolder.CreateFileAsync(filename, CreationCollisionOption.ReplaceExisting).AsTask(); 36 | await FileIO.WriteTextAsync(file, data); 37 | return true; 38 | } 39 | catch 40 | { 41 | return false; 42 | } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Source/eXam/eXam.WinPhone/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("eXam.WinPhone.WindowsPhone")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("eXam.WinPhone.WindowsPhone")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 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)] -------------------------------------------------------------------------------- /Source/eXam/eXam.WinPhone/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Source/eXam/eXam.WinPhone/eXam.WinPhone.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {D1922C72-65A9-4656-BB99-8D96E500A8BE} 8 | AppContainerExe 9 | Properties 10 | eXam.WinPhone 11 | eXam.WinPhone 12 | en-US 13 | 8.1 14 | 12 15 | 512 16 | {76F1466A-8B6D-4E39-A767-685A06062A39};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 17 | true 18 | 19 | 20 | 21 | 22 | AnyCPU 23 | true 24 | full 25 | false 26 | bin\Debug\ 27 | DEBUG;TRACE;NETFX_CORE;WINDOWS_PHONE_APP 28 | prompt 29 | 4 30 | 31 | 32 | AnyCPU 33 | pdbonly 34 | true 35 | bin\Release\ 36 | TRACE;NETFX_CORE;WINDOWS_PHONE_APP 37 | prompt 38 | 4 39 | 40 | 41 | true 42 | bin\ARM\Debug\ 43 | DEBUG;TRACE;NETFX_CORE;WINDOWS_PHONE_APP 44 | ;2008 45 | full 46 | ARM 47 | false 48 | prompt 49 | true 50 | 51 | 52 | bin\ARM\Release\ 53 | TRACE;NETFX_CORE;WINDOWS_PHONE_APP 54 | true 55 | ;2008 56 | pdbonly 57 | ARM 58 | false 59 | prompt 60 | true 61 | 62 | 63 | true 64 | bin\x86\Debug\ 65 | DEBUG;TRACE;NETFX_CORE;WINDOWS_PHONE_APP 66 | ;2008 67 | full 68 | x86 69 | false 70 | prompt 71 | true 72 | 73 | 74 | bin\x86\Release\ 75 | TRACE;NETFX_CORE;WINDOWS_PHONE_APP 76 | true 77 | ;2008 78 | pdbonly 79 | x86 80 | false 81 | prompt 82 | true 83 | 84 | 85 | 86 | App.xaml 87 | 88 | 89 | MainPage.xaml 90 | 91 | 92 | 93 | 94 | 95 | 96 | Designer 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | Designer 110 | 111 | 112 | MSBuild:Compile 113 | Designer 114 | 115 | 116 | 117 | 118 | eXam 119 | 120 | 121 | 122 | 123 | ..\..\packages\HockeySDK.Xamarin.4.1.0\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\HockeySDK.dll 124 | True 125 | 126 | 127 | ..\..\packages\Microsoft.Azure.Mobile.Client.3.0.3\lib\wpa81\Microsoft.WindowsAzure.Mobile.dll 128 | True 129 | 130 | 131 | ..\..\packages\Microsoft.Azure.Mobile.Client.3.0.3\lib\wpa81\Microsoft.WindowsAzure.Mobile.Ext.dll 132 | True 133 | 134 | 135 | ..\..\packages\Microsoft.Azure.Mobile.Client.SQLiteStore.3.0.3\lib\portable-win+net45+wp8+wpa81+monotouch10+monoandroid10+xamarinios10\Microsoft.WindowsAzure.Mobile.SQLiteStore.dll 136 | True 137 | 138 | 139 | ..\..\packages\Newtonsoft.Json.9.0.1\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll 140 | True 141 | 142 | 143 | ..\..\packages\SQLitePCLRaw.bundle_green.1.0.0\lib\wpa81\SQLitePCLRaw.batteries_green.dll 144 | True 145 | 146 | 147 | ..\..\packages\SQLitePCLRaw.core.1.0.0\lib\wpa81\SQLitePCLRaw.core.dll 148 | True 149 | 150 | 151 | ..\..\packages\SQLitePCLRaw.provider.e_sqlite3.wpa81.1.0.0\lib\wpa81\SQLitePCLRaw.provider.e_sqlite3.dll 152 | True 153 | 154 | 155 | ..\..\packages\Microsoft.Net.Http.2.2.29\lib\wpa81\System.Net.Http.Extensions.dll 156 | True 157 | 158 | 159 | ..\..\packages\Microsoft.Net.Http.2.2.29\lib\wpa81\System.Net.Http.Primitives.dll 160 | True 161 | 162 | 163 | ..\..\packages\Xamarin.Forms.2.3.2.127\lib\wpa81\Xamarin.Forms.Core.dll 164 | True 165 | 166 | 167 | ..\..\packages\Xamarin.Forms.2.3.2.127\lib\wpa81\Xamarin.Forms.Platform.dll 168 | True 169 | 170 | 171 | ..\..\packages\Xamarin.Forms.2.3.2.127\lib\wpa81\Xamarin.Forms.Platform.WinRT.dll 172 | True 173 | 174 | 175 | ..\..\packages\Xamarin.Forms.2.3.2.127\lib\wpa81\Xamarin.Forms.Platform.WinRT.Phone.dll 176 | True 177 | 178 | 179 | ..\..\packages\Xamarin.Forms.2.3.2.127\lib\wpa81\Xamarin.Forms.Xaml.dll 180 | True 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | Microsoft Visual C++ 2013 Runtime Package for Windows Phone 190 | 191 | 192 | SQLite for Windows Phone 8.1 193 | 194 | 195 | 196 | 12.0 197 | 198 | 199 | WindowsPhoneApp 200 | 201 | 202 | 203 | 204 | 205 | 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}. 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 220 | -------------------------------------------------------------------------------- /Source/eXam/eXam.WinPhone/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Source/eXam/eXam.Windows/App.xaml: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | -------------------------------------------------------------------------------- /Source/eXam/eXam.Windows/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.ApplicationModel; 7 | using Windows.ApplicationModel.Activation; 8 | using Windows.Foundation; 9 | using Windows.Foundation.Collections; 10 | using Windows.UI.Xaml; 11 | using Windows.UI.Xaml.Controls; 12 | using Windows.UI.Xaml.Controls.Primitives; 13 | using Windows.UI.Xaml.Data; 14 | using Windows.UI.Xaml.Input; 15 | using Windows.UI.Xaml.Media; 16 | using Windows.UI.Xaml.Media.Animation; 17 | using Windows.UI.Xaml.Navigation; 18 | 19 | // The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=234227 20 | 21 | namespace eXam.Windows 22 | { 23 | /// 24 | /// Provides application-specific behavior to supplement the default Application class. 25 | /// 26 | public sealed partial class App : Application 27 | { 28 | /// 29 | /// Initializes the singleton application object. This is the first line of authored code 30 | /// executed, and as such is the logical equivalent of main() or WinMain(). 31 | /// 32 | public App() 33 | { 34 | this.InitializeComponent(); 35 | this.Suspending += this.OnSuspending; 36 | } 37 | 38 | /// 39 | /// Invoked when the application is launched normally by the end user. Other entry points 40 | /// will be used when the application is launched to open a specific file, to display 41 | /// search results, and so forth. 42 | /// 43 | /// Details about the launch request and process. 44 | protected override void OnLaunched(LaunchActivatedEventArgs e) 45 | { 46 | #if DEBUG 47 | if (System.Diagnostics.Debugger.IsAttached) 48 | { 49 | this.DebugSettings.EnableFrameRateCounter = true; 50 | } 51 | #endif 52 | 53 | Frame rootFrame = Window.Current.Content as Frame; 54 | 55 | // Do not repeat app initialization when the Window already has content, 56 | // just ensure that the window is active 57 | if (rootFrame == null) 58 | { 59 | // Create a Frame to act as the navigation context and navigate to the first page 60 | rootFrame = new Frame(); 61 | 62 | // TODO: change this value to a cache size that is appropriate for your application 63 | rootFrame.CacheSize = 1; 64 | 65 | Xamarin.Forms.Forms.Init(e); 66 | 67 | if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) 68 | { 69 | // TODO: Load state from previously suspended application 70 | } 71 | 72 | // Place the frame in the current Window 73 | Window.Current.Content = rootFrame; 74 | } 75 | 76 | if (rootFrame.Content == null) 77 | { 78 | // When the navigation stack isn't restored navigate to the first page, 79 | // configuring the new page by passing required information as a navigation 80 | // parameter 81 | if (!rootFrame.Navigate(typeof(MainPage), e.Arguments)) 82 | { 83 | throw new Exception("Failed to create initial page"); 84 | } 85 | } 86 | 87 | // Ensure the current window is active 88 | Window.Current.Activate(); 89 | } 90 | 91 | /// 92 | /// Invoked when application execution is being suspended. Application state is saved 93 | /// without knowing whether the application will be terminated or resumed with the contents 94 | /// of memory still intact. 95 | /// 96 | /// The source of the suspend request. 97 | /// Details about the suspend request. 98 | private void OnSuspending(object sender, SuspendingEventArgs e) 99 | { 100 | var deferral = e.SuspendingOperation.GetDeferral(); 101 | 102 | // TODO: Save application state and stop any background activity 103 | deferral.Complete(); 104 | } 105 | } 106 | } -------------------------------------------------------------------------------- /Source/eXam/eXam.Windows/Assets/Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.Windows/Assets/Logo.scale-100.png -------------------------------------------------------------------------------- /Source/eXam/eXam.Windows/Assets/SmallLogo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.Windows/Assets/SmallLogo.scale-100.png -------------------------------------------------------------------------------- /Source/eXam/eXam.Windows/Assets/SplashScreen.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.Windows/Assets/SplashScreen.scale-100.png -------------------------------------------------------------------------------- /Source/eXam/eXam.Windows/Assets/StoreLogo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.Windows/Assets/StoreLogo.scale-100.png -------------------------------------------------------------------------------- /Source/eXam/eXam.Windows/MainPage.xaml: -------------------------------------------------------------------------------- 1 |  10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Source/eXam/eXam.Windows/MainPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.Foundation; 7 | using Windows.Foundation.Collections; 8 | using Windows.UI.Xaml; 9 | using Windows.UI.Xaml.Controls; 10 | using Windows.UI.Xaml.Controls.Primitives; 11 | using Windows.UI.Xaml.Data; 12 | using Windows.UI.Xaml.Input; 13 | using Windows.UI.Xaml.Media; 14 | using Windows.UI.Xaml.Navigation; 15 | 16 | namespace eXam.Windows 17 | { 18 | public sealed partial class MainPage 19 | { 20 | public MainPage() 21 | { 22 | this.InitializeComponent(); 23 | 24 | LoadApplication(new eXam.App()); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Source/eXam/eXam.Windows/Package.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 7 | 8 | 9 | FPCL.Windows8.Windows 10 | joaqu 11 | Assets\StoreLogo.png 12 | 13 | 14 | 15 | 6.3.0 16 | 6.3.0 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 27 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Source/eXam/eXam.Windows/PlatformFileHelper.cs: -------------------------------------------------------------------------------- 1 | using eXam.Windows; 2 | using System; 3 | using System.Threading.Tasks; 4 | using Windows.Storage; 5 | using Xamarin.Forms; 6 | 7 | [assembly: Dependency(typeof(PlatformFileHelper))] 8 | 9 | namespace eXam.Windows 10 | { 11 | class PlatformFileHelper : IFileHelper 12 | { 13 | public string GetNameWithPath(string filename) 14 | { 15 | return filename; 16 | } 17 | 18 | public async Task LoadLocalFileAsync(string filename) 19 | { 20 | try 21 | { 22 | var file = await ApplicationData.Current.LocalFolder.GetFileAsync(filename).AsTask(); 23 | return await FileIO.ReadTextAsync(file); 24 | } 25 | catch 26 | { 27 | return null; 28 | } 29 | } 30 | 31 | public async Task SaveLocalFileAsync(string filename, string data) 32 | { 33 | try 34 | { 35 | var file = await ApplicationData.Current.LocalFolder.CreateFileAsync(filename, CreationCollisionOption.ReplaceExisting).AsTask(); 36 | await FileIO.WriteTextAsync(file, data); 37 | return true; 38 | } 39 | catch 40 | { 41 | return false; 42 | } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Source/eXam/eXam.Windows/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("eXam.Windows.Windows")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("eXam.Windows.Windows")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 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)] -------------------------------------------------------------------------------- /Source/eXam/eXam.Windows/Windows_TemporaryKey.pfx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.Windows/Windows_TemporaryKey.pfx -------------------------------------------------------------------------------- /Source/eXam/eXam.Windows/eXam.Windows.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {CE67550D-C9DF-42DE-AFEC-EE4221AC3A4C} 8 | AppContainerExe 9 | Properties 10 | eXam.Windows 11 | eXam.Windows 12 | en-US 13 | 8.1 14 | 12 15 | 512 16 | true 17 | {BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 18 | Windows_TemporaryKey.pfx 19 | 20 | 21 | 22 | 23 | AnyCPU 24 | true 25 | full 26 | false 27 | bin\Debug\ 28 | DEBUG;TRACE;NETFX_CORE;WINDOWS_APP 29 | prompt 30 | 4 31 | 32 | 33 | AnyCPU 34 | pdbonly 35 | true 36 | bin\Release\ 37 | TRACE;NETFX_CORE;WINDOWS_APP 38 | prompt 39 | 4 40 | 41 | 42 | true 43 | bin\ARM\Debug\ 44 | DEBUG;TRACE;NETFX_CORE;WINDOWS_APP 45 | ;2008 46 | full 47 | ARM 48 | false 49 | prompt 50 | true 51 | 52 | 53 | bin\ARM\Release\ 54 | TRACE;NETFX_CORE;WINDOWS_APP 55 | true 56 | ;2008 57 | pdbonly 58 | ARM 59 | false 60 | prompt 61 | true 62 | 63 | 64 | true 65 | bin\x64\Debug\ 66 | DEBUG;TRACE;NETFX_CORE;WINDOWS_APP 67 | ;2008 68 | full 69 | x64 70 | false 71 | prompt 72 | true 73 | 74 | 75 | bin\x64\Release\ 76 | TRACE;NETFX_CORE;WINDOWS_APP 77 | true 78 | ;2008 79 | pdbonly 80 | x64 81 | false 82 | prompt 83 | true 84 | 85 | 86 | true 87 | bin\x86\Debug\ 88 | DEBUG;TRACE;NETFX_CORE;WINDOWS_APP 89 | ;2008 90 | full 91 | x86 92 | false 93 | prompt 94 | true 95 | 96 | 97 | bin\x86\Release\ 98 | TRACE;NETFX_CORE;WINDOWS_APP 99 | true 100 | ;2008 101 | pdbonly 102 | x86 103 | false 104 | prompt 105 | true 106 | 107 | 108 | 109 | App.xaml 110 | 111 | 112 | MainPage.xaml 113 | 114 | 115 | 116 | 117 | 118 | 119 | Designer 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | Designer 133 | 134 | 135 | MSBuild:Compile 136 | Designer 137 | 138 | 139 | 140 | 141 | eXam 142 | 143 | 144 | 145 | 146 | ..\..\packages\HockeySDK.Xamarin.4.1.0\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\HockeySDK.dll 147 | True 148 | 149 | 150 | ..\..\packages\Microsoft.Azure.Mobile.Client.3.0.3\lib\netcore45\Microsoft.WindowsAzure.Mobile.dll 151 | True 152 | 153 | 154 | ..\..\packages\Microsoft.Azure.Mobile.Client.3.0.3\lib\netcore45\Microsoft.WindowsAzure.Mobile.Ext.dll 155 | True 156 | 157 | 158 | ..\..\packages\Microsoft.Azure.Mobile.Client.SQLiteStore.3.0.3\lib\portable-win+net45+wp8+wpa81+monotouch10+monoandroid10+xamarinios10\Microsoft.WindowsAzure.Mobile.SQLiteStore.dll 159 | True 160 | 161 | 162 | ..\..\packages\Newtonsoft.Json.9.0.1\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll 163 | True 164 | 165 | 166 | ..\..\packages\SQLitePCLRaw.bundle_green.1.0.0\lib\win81\SQLitePCLRaw.batteries_green.dll 167 | True 168 | 169 | 170 | ..\..\packages\SQLitePCLRaw.core.1.0.0\lib\win81\SQLitePCLRaw.core.dll 171 | True 172 | 173 | 174 | ..\..\packages\SQLitePCLRaw.provider.e_sqlite3.win81.1.0.0\lib\win81\SQLitePCLRaw.provider.e_sqlite3.dll 175 | True 176 | 177 | 178 | ..\..\packages\Microsoft.Net.Http.2.2.29\lib\win8\System.Net.Http.Extensions.dll 179 | True 180 | 181 | 182 | ..\..\packages\Microsoft.Net.Http.2.2.29\lib\win8\System.Net.Http.Primitives.dll 183 | True 184 | 185 | 186 | ..\..\packages\Xamarin.Forms.2.3.2.127\lib\win81\Xamarin.Forms.Core.dll 187 | True 188 | 189 | 190 | ..\..\packages\Xamarin.Forms.2.3.2.127\lib\win81\Xamarin.Forms.Platform.dll 191 | True 192 | 193 | 194 | ..\..\packages\Xamarin.Forms.2.3.2.127\lib\win81\Xamarin.Forms.Platform.WinRT.dll 195 | True 196 | 197 | 198 | ..\..\packages\Xamarin.Forms.2.3.2.127\lib\win81\Xamarin.Forms.Platform.WinRT.Tablet.dll 199 | True 200 | 201 | 202 | ..\..\packages\Xamarin.Forms.2.3.2.127\lib\win81\Xamarin.Forms.Xaml.dll 203 | True 204 | 205 | 206 | 207 | 208 | SQLite for Windows Runtime %28Windows 8.1%29 209 | 210 | 211 | 212 | 12.0 213 | 214 | 215 | 216 | 217 | 218 | 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}. 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 233 | -------------------------------------------------------------------------------- /Source/eXam/eXam.Windows/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Source/eXam/eXam.iOS/AppDelegate.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Foundation; 5 | using UIKit; 6 | using HockeyApp.iOS; 7 | using eXam.Services; 8 | 9 | namespace eXam.iOS 10 | { 11 | // The UIApplicationDelegate for the application. This class is responsible for launching the 12 | // User Interface of the application, as well as listening (and optionally responding) to 13 | // application events from iOS. 14 | [Register("AppDelegate")] 15 | public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate 16 | { 17 | // 18 | // This method is invoked when the application has loaded and is ready to run. In this 19 | // method you should instantiate the window, load the UI into it and then make the window 20 | // visible. 21 | // 22 | // You have 17 seconds to return from this method, or iOS will terminate your application. 23 | // 24 | public override bool FinishedLaunching(UIApplication app, NSDictionary options) 25 | { 26 | InitializeHockeyApp(); 27 | global::Xamarin.Forms.Forms.Init(); 28 | Microsoft.WindowsAzure.MobileServices.CurrentPlatform.Init(); 29 | 30 | LoadApplication(new App()); 31 | 32 | return base.FinishedLaunching(app, options); 33 | } 34 | 35 | private void InitializeHockeyApp() 36 | { 37 | var manager = BITHockeyManager.SharedHockeyManager; 38 | manager.Configure(HockeyAppHelper.AppIds.HockeyAppId_iOS); 39 | manager.StartManager(); 40 | manager.Authenticator.AuthenticateInstallation(); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Source/eXam/eXam.iOS/Entitlements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Source/eXam/eXam.iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UIDeviceFamily 6 | 7 | 1 8 | 2 9 | 10 | UISupportedInterfaceOrientations 11 | 12 | UIInterfaceOrientationPortrait 13 | UIInterfaceOrientationLandscapeLeft 14 | UIInterfaceOrientationLandscapeRight 15 | 16 | UISupportedInterfaceOrientations~ipad 17 | 18 | UIInterfaceOrientationPortrait 19 | UIInterfaceOrientationPortraitUpsideDown 20 | UIInterfaceOrientationLandscapeLeft 21 | UIInterfaceOrientationLandscapeRight 22 | 23 | MinimumOSVersion 24 | 6.0 25 | CFBundleDisplayName 26 | eXam 27 | CFBundleIdentifier 28 | com.yourcompany.eXam 29 | CFBundleVersion 30 | 1.1 31 | CFBundleIconFiles 32 | 33 | Icon-60@2x.png 34 | Icon-76.png 35 | Icon-76@2x.png 36 | Default.png 37 | Default@2x.png 38 | Default-568h@2x.png 39 | Default-Portrait.png 40 | Default-Portrait@2x.png 41 | Icon-Small-40.png 42 | Icon-Small-40@2x.png 43 | Icon-Small.png 44 | Icon-Small@2x.png 45 | 46 | UILaunchStoryboardName 47 | LaunchScreen 48 | UIViewControllerBasedStatusBarAppearance 49 | 50 | UIStatusBarHidden 51 | 52 | CFBundleShortVersionString 53 | 1 54 | 55 | 56 | -------------------------------------------------------------------------------- /Source/eXam/eXam.iOS/Main.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | using Foundation; 6 | using UIKit; 7 | 8 | namespace eXam.iOS 9 | { 10 | public class Application 11 | { 12 | // This is the main entry point of the application. 13 | static void Main(string[] args) 14 | { 15 | // if you want to use a different Application Delegate class from "AppDelegate" 16 | // you can specify it here. 17 | UIApplication.Main(args, null, "AppDelegate"); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Source/eXam/eXam.iOS/PlatformFileHelper.cs: -------------------------------------------------------------------------------- 1 | using eXam; 2 | using System; 3 | using System.IO; 4 | using System.Threading.Tasks; 5 | using Xamarin.Forms; 6 | 7 | [assembly: Dependency(typeof(PlatformFileHelper))] 8 | 9 | namespace eXam 10 | { 11 | public class PlatformFileHelper : IFileHelper 12 | { 13 | public string GetNameWithPath(string filename) 14 | { 15 | return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "..", "Library", filename); 16 | } 17 | 18 | public Task LoadLocalFileAsync (string filename) 19 | { 20 | try 21 | { 22 | return Task.FromResult(File.ReadAllText(GetNameWithPath(filename))); 23 | } 24 | catch 25 | { 26 | return Task.FromResult(null); 27 | } 28 | } 29 | 30 | public Task SaveLocalFileAsync (string filename, string data) 31 | { 32 | File.WriteAllText (GetNameWithPath(filename), data); 33 | 34 | return Task.FromResult (true); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /Source/eXam/eXam.iOS/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("eXam.iOS")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("eXam.iOS")] 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("72bdc44f-c588-44f3-b6df-9aace7daafdd")] 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 Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Source/eXam/eXam.iOS/Resources/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.iOS/Resources/Default-568h@2x.png -------------------------------------------------------------------------------- /Source/eXam/eXam.iOS/Resources/Default-Portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.iOS/Resources/Default-Portrait.png -------------------------------------------------------------------------------- /Source/eXam/eXam.iOS/Resources/Default-Portrait@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.iOS/Resources/Default-Portrait@2x.png -------------------------------------------------------------------------------- /Source/eXam/eXam.iOS/Resources/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.iOS/Resources/Default.png -------------------------------------------------------------------------------- /Source/eXam/eXam.iOS/Resources/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.iOS/Resources/Default@2x.png -------------------------------------------------------------------------------- /Source/eXam/eXam.iOS/Resources/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.iOS/Resources/Icon-60@2x.png -------------------------------------------------------------------------------- /Source/eXam/eXam.iOS/Resources/Icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.iOS/Resources/Icon-60@3x.png -------------------------------------------------------------------------------- /Source/eXam/eXam.iOS/Resources/Icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.iOS/Resources/Icon-76.png -------------------------------------------------------------------------------- /Source/eXam/eXam.iOS/Resources/Icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.iOS/Resources/Icon-76@2x.png -------------------------------------------------------------------------------- /Source/eXam/eXam.iOS/Resources/Icon-Small-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.iOS/Resources/Icon-Small-40.png -------------------------------------------------------------------------------- /Source/eXam/eXam.iOS/Resources/Icon-Small-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.iOS/Resources/Icon-Small-40@2x.png -------------------------------------------------------------------------------- /Source/eXam/eXam.iOS/Resources/Icon-Small-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.iOS/Resources/Icon-Small-40@3x.png -------------------------------------------------------------------------------- /Source/eXam/eXam.iOS/Resources/Icon-Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.iOS/Resources/Icon-Small.png -------------------------------------------------------------------------------- /Source/eXam/eXam.iOS/Resources/Icon-Small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.iOS/Resources/Icon-Small@2x.png -------------------------------------------------------------------------------- /Source/eXam/eXam.iOS/Resources/Icon-Small@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.iOS/Resources/Icon-Small@3x.png -------------------------------------------------------------------------------- /Source/eXam/eXam.iOS/Resources/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /Source/eXam/eXam.iOS/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Source/eXam/eXam.iOS/eXam.iOS.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | iPhoneSimulator 6 | 8.0.30703 7 | 2.0 8 | {687955E6-0CAB-41FB-B578-39D741484596} 9 | {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 10 | Exe 11 | eXam.iOS 12 | Resources 13 | eXamiOS 14 | 15 | 16 | 17 | 18 | true 19 | full 20 | false 21 | bin\iPhoneSimulator\Debug 22 | DEBUG 23 | prompt 24 | 4 25 | false 26 | i386, x86_64 27 | None 28 | true 29 | 30 | 31 | none 32 | true 33 | bin\iPhoneSimulator\Release 34 | prompt 35 | 4 36 | None 37 | i386, x86_64 38 | false 39 | 40 | 41 | true 42 | full 43 | false 44 | bin\iPhone\Debug 45 | DEBUG 46 | prompt 47 | 4 48 | false 49 | ARMv7, ARM64 50 | iPhone Developer 51 | true 52 | Entitlements.plist 53 | 54 | 55 | none 56 | true 57 | bin\iPhone\Release 58 | prompt 59 | 4 60 | ARMv7, ARM64 61 | false 62 | iPhone Developer 63 | Entitlements.plist 64 | 65 | 66 | none 67 | True 68 | bin\iPhone\Ad-Hoc 69 | prompt 70 | 4 71 | False 72 | ARMv7, ARM64 73 | True 74 | 1cdac9ed-a4d7-4879-8b6a-1f23c0ee2fcc 75 | iPhone Distribution 76 | Entitlements.plist 77 | 78 | 79 | none 80 | True 81 | bin\iPhone\AppStore 82 | prompt 83 | 4 84 | False 85 | ARMv7, ARM64 86 | Automatic:AppStore 87 | iPhone Distribution 88 | Entitlements.plist 89 | 90 | 91 | iPhone Distribution: Kym Phillpotts (PKK9Q92S55) 92 | 1cdac9ed-a4d7-4879-8b6a-1f23c0ee2fcc 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | eXam 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | ..\..\packages\HockeySDK.Xamarin.4.1.0\lib\Xamarin.iOS10\HockeySDK.dll 132 | True 133 | 134 | 135 | ..\..\packages\HockeySDK.Xamarin.4.1.0\lib\Xamarin.iOS10\HockeySDK.iOSBindings.dll 136 | True 137 | 138 | 139 | ..\..\packages\Microsoft.Azure.Mobile.Client.3.0.3\lib\Xamarin.iOS10\Microsoft.WindowsAzure.Mobile.dll 140 | True 141 | 142 | 143 | ..\..\packages\Microsoft.Azure.Mobile.Client.3.0.3\lib\Xamarin.iOS10\Microsoft.WindowsAzure.Mobile.Ext.dll 144 | True 145 | 146 | 147 | ..\..\packages\Microsoft.Azure.Mobile.Client.SQLiteStore.3.0.3\lib\portable-win+net45+wp8+wpa81+monotouch10+monoandroid10+xamarinios10\Microsoft.WindowsAzure.Mobile.SQLiteStore.dll 148 | True 149 | 150 | 151 | ..\..\packages\Newtonsoft.Json.9.0.1\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll 152 | True 153 | 154 | 155 | ..\..\packages\SQLitePCLRaw.bundle_green.1.0.0\lib\Xamarin.iOS10\SQLitePCLRaw.batteries_green.dll 156 | True 157 | 158 | 159 | ..\..\packages\SQLitePCLRaw.core.1.0.0\lib\Xamarin.iOS10\SQLitePCLRaw.core.dll 160 | True 161 | 162 | 163 | ..\..\packages\SQLitePCLRaw.provider.sqlite3.ios_unified.1.0.0\lib\Xamarin.iOS10\SQLitePCLRaw.provider.sqlite3.dll 164 | True 165 | 166 | 167 | 168 | 169 | ..\..\packages\Microsoft.Net.Http.2.2.29\lib\Xamarin.iOS10\System.Net.Http.Extensions.dll 170 | True 171 | 172 | 173 | ..\..\packages\Microsoft.Net.Http.2.2.29\lib\Xamarin.iOS10\System.Net.Http.Primitives.dll 174 | True 175 | 176 | 177 | 178 | 179 | ..\..\packages\Xamarin.Forms.2.3.2.127\lib\Xamarin.iOS10\Xamarin.Forms.Core.dll 180 | True 181 | 182 | 183 | ..\..\packages\Xamarin.Forms.2.3.2.127\lib\Xamarin.iOS10\Xamarin.Forms.Platform.dll 184 | True 185 | 186 | 187 | ..\..\packages\Xamarin.Forms.2.3.2.127\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll 188 | True 189 | 190 | 191 | ..\..\packages\Xamarin.Forms.2.3.2.127\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll 192 | True 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 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}. 201 | 202 | 203 | 204 | 205 | 206 | -------------------------------------------------------------------------------- /Source/eXam/eXam.iOS/iTunesArtwork: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.iOS/iTunesArtwork -------------------------------------------------------------------------------- /Source/eXam/eXam.iOS/iTunesArtwork@2x: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam.iOS/iTunesArtwork@2x -------------------------------------------------------------------------------- /Source/eXam/eXam.iOS/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Source/eXam/eXam/App.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Reflection; 5 | using Xamarin.Forms; 6 | using Xamarin.Forms.Xaml; 7 | 8 | [assembly: XamlCompilationAttribute(XamlCompilationOptions.Compile)] 9 | 10 | namespace eXam 11 | { 12 | public class App : Application 13 | { 14 | public static Game CurrentGame { get; private set; } 15 | 16 | public App() 17 | { 18 | // The root page of your application 19 | MainPage = new NavigationPage ( new HomePage() ); 20 | } 21 | 22 | protected async override void OnStart() 23 | { 24 | /* var fileHelper = DependencyService.Get(); 25 | 26 | string questionsText = string.Empty; 27 | 28 | var assembly = typeof(App).GetTypeInfo().Assembly; 29 | 30 | using (var stream = assembly.GetManifestResourceStream("eXam.Data.questions.json")) 31 | { 32 | questionsText = new StreamReader(stream).ReadToEnd(); 33 | } 34 | 35 | var questions = JsonConvert.DeserializeObject>(questionsText);*/ 36 | 37 | var azureService = DependencyService.Get(); 38 | 39 | var questions = await azureService.GetQuestions(); 40 | 41 | CurrentGame = new Game(questions); 42 | } 43 | 44 | protected override void OnSleep() 45 | { 46 | // Handle when your app sleeps 47 | } 48 | 49 | protected override void OnResume() 50 | { 51 | // Handle when your app resumes 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Source/eXam/eXam/AzureService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using Xamarin.Forms; 5 | using Microsoft.WindowsAzure.MobileServices; 6 | using Microsoft.WindowsAzure.MobileServices.Sync; 7 | using System.Threading.Tasks; 8 | using System.Diagnostics; 9 | using eXam; 10 | using Microsoft.WindowsAzure.MobileServices.SQLiteStore; 11 | 12 | [assembly: Dependency(typeof(AzureService))] 13 | namespace eXam 14 | { 15 | public class AzureService 16 | { 17 | MobileServiceClient client { get; set; } 18 | 19 | IMobileServiceSyncTable table; 20 | 21 | public async Task Initialize() 22 | { 23 | if (client?.SyncContext?.IsInitialized ?? false) 24 | return; 25 | 26 | var azureUrl = "http://vsconnectxam.azurewebsites.net/"; 27 | 28 | //Create our client 29 | client = new MobileServiceClient(azureUrl); 30 | 31 | //InitialzeDatabase for path 32 | var path = "questions.db"; 33 | path = Path.Combine(MobileServiceClient.DefaultDatabasePath, path); 34 | 35 | 36 | //setup our local sqlite store and intialize our table 37 | var store = new MobileServiceSQLiteStore(path); 38 | 39 | //Define table 40 | store.DefineTable(); 41 | 42 | //Initialize SyncContext 43 | await client.SyncContext.InitializeAsync(store, new MobileServiceSyncHandler()); 44 | 45 | table = client.GetSyncTable(); 46 | } 47 | 48 | public async Task> GetQuestions() 49 | { 50 | await Initialize(); 51 | await SyncQuestions(); 52 | return await table.ToListAsync(); 53 | } 54 | 55 | 56 | public async Task SyncQuestions() 57 | { 58 | try 59 | { 60 | await client.SyncContext.PushAsync(); 61 | await table.PullAsync("allQuizQuestions", table.CreateQuery()); 62 | } 63 | catch (Exception ex) 64 | { 65 | Debug.WriteLine("Unable to sync, using offline capabilities: " + ex); 66 | } 67 | 68 | } 69 | } 70 | } -------------------------------------------------------------------------------- /Source/eXam/eXam/Data/questions.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | Question: "Xamarin.Forms is a great choice when developing mobile business applications or prototypes.", 4 | Answer: "true" , 5 | Explanation: "Xamarin.Forms is ideal for creating line-of-business applications and can be used to rapidly create UIs that work on all supported plattforms.", 6 | }, 7 | { 8 | Question: "Xamarin.Forms is a great choice when you're required to follow pixel-perfect mockups or leverage a lot of platform specific features.", 9 | Answer: "false", 10 | Explanation: "To create highly customized or pixel perfect UIs, additional customization work is required on each platform can may, in some cases, substantially increase development time.", 11 | }, 12 | { 13 | Question: "For the purposes of testing an application, simulators are just as good as physical devices.", 14 | Answer: "false", 15 | Explanation: "Simulator features and performance can vary greatly from physical devices.", 16 | }, 17 | { 18 | Question: "When using Xamarin.Forms, your Android head project should always target the latest Android framework avaliable.", 19 | Answer: "true", 20 | Explanation: "Xamarin.Forms is developed and tested against the latest stable Android framework. You should always keep your Android development tools up to date.", 21 | }, 22 | { 23 | Question: "When developing an app using Xamarin.Forms, the application will look identical on all supported platforms.", 24 | Answer: "false", 25 | Explanation: "Xamarin.Forms creates native views on each platform; the UI of your application will use the native visual styling on each platform.", 26 | } 27 | ] -------------------------------------------------------------------------------- /Source/eXam/eXam/Game.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace eXam 5 | { 6 | public class Game 7 | { 8 | public List Questions { get; private set; } 9 | public bool?[] Responses { get; private set; } 10 | 11 | public QuizQuestion CurrentQuestion { get { return Questions [QuestionIndex]; } } 12 | public bool? CurrentResponse { get { return Responses [QuestionIndex]; } } 13 | int QuestionIndex { get; set; } 14 | 15 | public int NumberOfQuestions 16 | { 17 | get { return (Questions == null) ? 0 : Questions.Count; } 18 | } 19 | 20 | public Game (List questions) 21 | { 22 | Questions = questions; 23 | Responses = new bool?[Questions.Count]; 24 | } 25 | 26 | public bool NextQuestion () 27 | { 28 | if (QuestionIndex < NumberOfQuestions - 1) 29 | { 30 | QuestionIndex++; 31 | 32 | return true; 33 | } 34 | 35 | return false; 36 | } 37 | 38 | public void Restart () 39 | { 40 | QuestionIndex = 0; 41 | 42 | Responses = new bool?[Questions.Count]; 43 | } 44 | 45 | public void OnTrue () 46 | { 47 | Responses [QuestionIndex] = true; 48 | } 49 | 50 | public void OnFalse () 51 | { 52 | Responses [QuestionIndex] = false; 53 | } 54 | 55 | public int GetNumberOfCorrectResponses () 56 | { 57 | int count = 0; 58 | 59 | for (int i = 0; i < Responses.Length; i++) 60 | { 61 | if (IsQuestionCorrect (i) == true) 62 | count++; 63 | } 64 | 65 | return count; 66 | } 67 | 68 | bool IsQuestionCorrect (int index) 69 | { 70 | if (index < 0 || index >= NumberOfQuestions) 71 | return false; 72 | 73 | if (Responses [index] == null) 74 | return false; 75 | 76 | if (Responses [index].Value == Questions [index].Answer) 77 | return true; 78 | 79 | return false; 80 | } 81 | } 82 | } -------------------------------------------------------------------------------- /Source/eXam/eXam/GettingStarted.Xamarin: -------------------------------------------------------------------------------- 1 | 2 | GS\XF\CS\App\GettingStarted.html 3 | false 4 | -------------------------------------------------------------------------------- /Source/eXam/eXam/HomePage.cs: -------------------------------------------------------------------------------- 1 | using eXam.Services; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Reflection.Emit; 6 | using System.Text; 7 | 8 | using Xamarin.Forms; 9 | 10 | namespace eXam 11 | { 12 | public class HomePage : ContentPage 13 | { 14 | public HomePage() 15 | { 16 | var layout = new AbsoluteLayout(); 17 | 18 | Content = layout; 19 | 20 | var button = new Button() 21 | { 22 | Text = "Start eXam!", 23 | TextColor = Color.White, 24 | BackgroundColor = Color.FromHex("#0892d0"), 25 | Font = Font.SystemFontOfSize(NamedSize.Medium), 26 | AutomationId = "startExamButton" 27 | }; 28 | 29 | var bg = new Image(); 30 | bg.Source = ImageSource.FromResource("eXam.Images.background.jpg"); 31 | bg.Aspect = Aspect.AspectFill; 32 | 33 | layout.Children.Add(bg, new Rectangle(0, 0, 1, 1), AbsoluteLayoutFlags.SizeProportional); 34 | 35 | layout.Children.Add(button, new Rectangle(0.5, 0.5, 200, 60), AbsoluteLayoutFlags.PositionProportional); 36 | 37 | NavigationPage.SetHasNavigationBar(this, false); 38 | 39 | button.Clicked += OnStartClicked; 40 | } 41 | 42 | async void OnStartClicked(object sender, EventArgs e) 43 | { 44 | HockeyAppHelper.TrackEvent(HockeyAppHelper.Events.ExamStarted); 45 | await Navigation.PushAsync(new QuestionPage()); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Source/eXam/eXam/IFileHelper.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace eXam 4 | { 5 | public interface IFileHelper 6 | { 7 | Task LoadLocalFileAsync(string filename); 8 | Task SaveLocalFileAsync(string filename, string data); 9 | 10 | string GetNameWithPath(string filename); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Source/eXam/eXam/Images/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/eXam/Images/background.jpg -------------------------------------------------------------------------------- /Source/eXam/eXam/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Resources; 2 | using System.Reflection; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | 6 | // General Information about an assembly is controlled through the following 7 | // set of attributes. Change these attribute values to modify the information 8 | // associated with an assembly. 9 | [assembly: AssemblyTitle("eXam")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("")] 13 | [assembly: AssemblyProduct("eXam")] 14 | [assembly: AssemblyCopyright("Copyright © 2014")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | [assembly: NeutralResourcesLanguage("en")] 18 | 19 | // Version information for an assembly consists of the following four values: 20 | // 21 | // Major Version 22 | // Minor Version 23 | // Build Number 24 | // Revision 25 | // 26 | // You can specify all the values or you can default the Build and Revision Numbers 27 | // by using the '*' as shown below: 28 | // [assembly: AssemblyVersion("1.0.*")] 29 | [assembly: AssemblyVersion("1.0.0.0")] 30 | [assembly: AssemblyFileVersion("1.0.0.0")] 31 | -------------------------------------------------------------------------------- /Source/eXam/eXam/QuestionPage.xaml: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 59 | 60 | -------------------------------------------------------------------------------- /Source/eXam/eXam/QuestionPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Xamarin.Forms; 3 | 4 | namespace eXam 5 | { 6 | public partial class QuestionPage : ContentPage 7 | { 8 | Game game; 9 | public QuestionPage() 10 | { 11 | game = App.CurrentGame; 12 | 13 | InitializeComponent(); 14 | 15 | InitializeControls(); 16 | } 17 | 18 | void InitializeControls () 19 | { 20 | btnTrue.Clicked += (s, e) => OnAnswer(true); 21 | btnFalse.Clicked += (s, e) => OnAnswer(false); 22 | 23 | btnNext.Clicked += OnNextClicked; 24 | 25 | ResetUI(); 26 | } 27 | 28 | void ResetUI() 29 | { 30 | lblQuestion.Text = game.CurrentQuestion.Question; 31 | lblResponse.Text = String.Empty; 32 | 33 | btnTrue.IsEnabled = true; 34 | btnFalse.IsEnabled = true; 35 | btnNext.IsEnabled = false; 36 | } 37 | 38 | void OnAnswer (bool answer) 39 | { 40 | if (answer == true) 41 | game.OnTrue(); 42 | else 43 | game.OnFalse(); 44 | 45 | lblResponse.Text = game.CurrentResponse == game.CurrentQuestion.Answer ? "Correct" : "Incorrect"; 46 | 47 | btnTrue.IsEnabled = false; 48 | btnFalse.IsEnabled = false; 49 | btnNext.IsEnabled = true; 50 | } 51 | 52 | void OnNextClicked (object sender, EventArgs e) 53 | { 54 | if (game.NextQuestion() == true) 55 | { 56 | ResetUI(); 57 | } 58 | else 59 | { 60 | this.Navigation.PushAsync(new ReviewPage()); 61 | } 62 | } 63 | } 64 | } -------------------------------------------------------------------------------- /Source/eXam/eXam/QuizQuestion.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace eXam 4 | { 5 | public class QuizQuestion 6 | { 7 | public string Id { get; set; } 8 | public string Question { get; set; } 9 | public bool Answer { get; set; } 10 | public string Explanation { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /Source/eXam/eXam/ReviewPage.xaml: -------------------------------------------------------------------------------- 1 |  2 | 5 | -------------------------------------------------------------------------------- /Source/eXam/eXam/ReviewPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | using Xamarin.Forms; 8 | 9 | namespace eXam 10 | { 11 | public partial class ReviewPage : ContentPage 12 | { 13 | public ReviewPage() 14 | { 15 | InitializeComponent(); 16 | 17 | lblResult.Text = String.Format("Great! You got {0} out of {1} questions correct", App.CurrentGame.GetNumberOfCorrectResponses(), App.CurrentGame.NumberOfQuestions); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Source/eXam/eXam/Services/HockeyAppHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Xamarin.Forms; 7 | 8 | namespace eXam.Services 9 | { 10 | public static class HockeyAppHelper 11 | { 12 | public static class AppIds 13 | { 14 | public const string HockeyAppId_iOS = "__HOCKEYAPP_IOS_APPID__"; 15 | public const string HockeyAppId_droid = "__HOCKEYAPP_ANDROID_APPID__"; 16 | public const string HockeyAppId_UWP = "__HOCKEYAPP_UWP_APPID__"; 17 | } 18 | 19 | public static class Events 20 | { 21 | public const string ExamStarted = "User Started Exam"; 22 | } 23 | 24 | public static void TrackEvent (string eventName) 25 | { 26 | if (Device.OS == TargetPlatform.Windows) 27 | DependencyService.Get()?.TrackEvent(eventName); 28 | else 29 | HockeyApp.MetricsManager.TrackEvent(eventName); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Source/eXam/eXam/Services/IHockeyEventService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace eXam.Services 8 | { 9 | public interface IHockeyEventService 10 | { 11 | void TrackEvent(string eventName); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Source/eXam/eXam/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Source/eXam/eXam/eXam.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 10.0 6 | Debug 7 | AnyCPU 8 | {281F83A1-AF13-4B44-B595-58545E995A44} 9 | Library 10 | Properties 11 | eXam 12 | eXam 13 | v4.5 14 | Profile111 15 | 512 16 | {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 17 | 18 | 19 | 20 | 21 | true 22 | full 23 | false 24 | bin\Debug\ 25 | DEBUG;TRACE 26 | prompt 27 | 4 28 | 29 | 30 | pdbonly 31 | true 32 | bin\Release\ 33 | TRACE 34 | prompt 35 | 4 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | QuestionPage.xaml 46 | 47 | 48 | 49 | ReviewPage.xaml 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | ..\..\packages\HockeySDK.Xamarin.4.1.0\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\HockeySDK.dll 63 | True 64 | 65 | 66 | ..\..\packages\Microsoft.Azure.Mobile.Client.3.0.3\lib\portable-win+net45+wp8+wpa81+monotouch+monoandroid\Microsoft.WindowsAzure.Mobile.dll 67 | True 68 | 69 | 70 | ..\..\packages\Microsoft.Azure.Mobile.Client.SQLiteStore.3.0.3\lib\portable-win+net45+wp8+wpa81+monotouch10+monoandroid10+xamarinios10\Microsoft.WindowsAzure.Mobile.SQLiteStore.dll 71 | True 72 | 73 | 74 | ..\..\packages\Newtonsoft.Json.9.0.1\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll 75 | True 76 | 77 | 78 | ..\..\packages\SQLitePCLRaw.bundle_green.1.0.0\lib\portable-net45+netcore45+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\SQLitePCLRaw.batteries_green.dll 79 | True 80 | 81 | 82 | ..\..\packages\SQLitePCLRaw.core.1.0.0\lib\portable-net45+netcore45+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\SQLitePCLRaw.core.dll 83 | True 84 | 85 | 86 | ..\..\packages\Microsoft.Net.Http.2.2.29\lib\portable-net45+win8+wpa81\System.Net.Http.Extensions.dll 87 | True 88 | 89 | 90 | ..\..\packages\Microsoft.Net.Http.2.2.29\lib\portable-net45+win8+wpa81\System.Net.Http.Primitives.dll 91 | True 92 | 93 | 94 | ..\..\packages\Xamarin.Forms.2.3.2.127\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Core.dll 95 | True 96 | 97 | 98 | ..\..\packages\Xamarin.Forms.2.3.2.127\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Platform.dll 99 | True 100 | 101 | 102 | ..\..\packages\Xamarin.Forms.2.3.2.127\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Xaml.dll 103 | True 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | MSBuild:UpdateDesignTimeXaml 112 | Designer 113 | 114 | 115 | 116 | 117 | MSBuild:UpdateDesignTimeXaml 118 | Designer 119 | 120 | 121 | 122 | 123 | 124 | 125 | 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}. 126 | 127 | 128 | 129 | 130 | 131 | 138 | -------------------------------------------------------------------------------- /Source/eXam/eXam/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Source/eXam/exam.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 you 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 | -------------------------------------------------------------------------------- /Source/eXam/exam.droid/MainActivity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Android.App; 3 | using Android.Content.PM; 4 | using Android.Runtime; 5 | using Android.Views; 6 | using Android.Widget; 7 | using Android.OS; 8 | using eXam.Services; 9 | using HockeyApp.Android; 10 | using HockeyApp.Android.Metrics; 11 | 12 | [assembly:MetaData("net.hockeyapp.android.appIdentifier", Value= HockeyAppHelper.AppIds.HockeyAppId_droid)] 13 | namespace eXam.Droid 14 | { 15 | [Activity(Label = "eXam", Icon = "@drawable/icon", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)] 16 | public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsApplicationActivity 17 | { 18 | protected override void OnCreate(Bundle bundle) 19 | { 20 | base.OnCreate(bundle); 21 | InitializeHockeyApp(); 22 | global::Xamarin.Forms.Forms.Init(this, bundle); 23 | Microsoft.WindowsAzure.MobileServices.CurrentPlatform.Init(); 24 | 25 | LoadApplication(new App()); 26 | } 27 | 28 | private void InitializeHockeyApp() 29 | { 30 | CrashManager.Register(this); 31 | MetricsManager.Register(Application); 32 | } 33 | } 34 | } 35 | 36 | -------------------------------------------------------------------------------- /Source/eXam/exam.droid/PlatformFileHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Xamarin.Forms; 3 | using eXam.Droid; 4 | using System.Threading.Tasks; 5 | using System.IO; 6 | 7 | [assembly: Dependency(typeof(PlatformFileHelper))] 8 | 9 | namespace eXam.Droid 10 | { 11 | public class PlatformFileHelper : IFileHelper 12 | { 13 | public string GetNameWithPath(string filename) 14 | { 15 | return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), filename); 16 | } 17 | 18 | public Task LoadLocalFileAsync (string filename) 19 | { 20 | try 21 | { 22 | return Task.FromResult(File.ReadAllText(GetNameWithPath(filename))); 23 | } 24 | catch 25 | { 26 | return Task.FromResult(null); 27 | } 28 | } 29 | 30 | public Task SaveLocalFileAsync (string filename, string data) 31 | { 32 | File.WriteAllText (GetNameWithPath(filename), data); 33 | 34 | return Task.FromResult (true); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /Source/eXam/exam.droid/Properties/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Source/eXam/exam.droid/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | using Android.App; 5 | 6 | // General Information about an assembly is controlled through the following 7 | // set of attributes. Change these attribute values to modify the information 8 | // associated with an assembly. 9 | [assembly: AssemblyTitle("eXam.Droid")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("")] 13 | [assembly: AssemblyProduct("eXam.Droid")] 14 | [assembly: AssemblyCopyright("Copyright © 2014")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | [assembly: ComVisible(false)] 18 | 19 | // Version information for an assembly consists of the following four values: 20 | // 21 | // Major Version 22 | // Minor Version 23 | // Build Number 24 | // Revision 25 | // 26 | // You can specify all the values or you can default the Build and Revision Numbers 27 | // by using the '*' as shown below: 28 | // [assembly: AssemblyVersion("1.0.*")] 29 | [assembly: AssemblyVersion("1.0.0.0")] 30 | [assembly: AssemblyFileVersion("1.0.0.0")] 31 | 32 | // Add some common permissions, these can be removed if not needed 33 | [assembly: UsesPermission(Android.Manifest.Permission.Internet)] 34 | [assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)] 35 | -------------------------------------------------------------------------------- /Source/eXam/exam.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.xml), 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-hdpi/ 12 | icon.png 13 | 14 | drawable-ldpi/ 15 | icon.png 16 | 17 | drawable-mdpi/ 18 | icon.png 19 | 20 | layout/ 21 | main.xml 22 | 23 | values/ 24 | strings.xml 25 | 26 | In order to get the build system to recognize Android resources, set the build action to 27 | "AndroidResource". The native Android APIs do not operate directly with filenames, but 28 | instead operate on resource IDs. When you compile an Android application that uses resources, 29 | the build system will package the resources for distribution and generate a class called 30 | "Resource" that contains the tokens for each one of the resources included. For example, 31 | for the above Resources layout, this is what the Resource class would expose: 32 | 33 | public class Resource { 34 | public class drawable { 35 | public const int icon = 0x123; 36 | } 37 | 38 | public class layout { 39 | public const int main = 0x456; 40 | } 41 | 42 | public class strings { 43 | public const int first_string = 0xabc; 44 | public const int second_string = 0xbcd; 45 | } 46 | } 47 | 48 | You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main 49 | to reference the layout/main.xml file, or Resource.strings.first_string to reference the first 50 | string in the dictionary file values/strings.xml. 51 | -------------------------------------------------------------------------------- /Source/eXam/exam.droid/Resources/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/exam.droid/Resources/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /Source/eXam/exam.droid/Resources/drawable-xhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/exam.droid/Resources/drawable-xhdpi/icon.png -------------------------------------------------------------------------------- /Source/eXam/exam.droid/Resources/drawable-xxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/exam.droid/Resources/drawable-xxhdpi/icon.png -------------------------------------------------------------------------------- /Source/eXam/exam.droid/Resources/drawable/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/Source/eXam/exam.droid/Resources/drawable/icon.png -------------------------------------------------------------------------------- /Source/eXam/exam.droid/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Source/eXam/exam.droid/eXam.Droid.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {C23B0E77-B7B8-413A-ADB2-0652BDC675CC} 9 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 10 | Library 11 | Properties 12 | eXam.Droid 13 | eXam.Droid 14 | 512 15 | true 16 | Resources\Resource.Designer.cs 17 | Off 18 | Properties\AndroidManifest.xml 19 | true 20 | v7.0 21 | armeabi,armeabi-v7a,x86 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | true 31 | full 32 | false 33 | bin\Debug\ 34 | DEBUG;TRACE 35 | prompt 36 | 4 37 | True 38 | None 39 | 40 | 41 | pdbonly 42 | true 43 | bin\Release\ 44 | TRACE 45 | prompt 46 | 4 47 | False 48 | None 49 | True 50 | False 51 | False 52 | armeabi-v7a;arm64-v8a 53 | Xamarin 54 | False 55 | False 56 | False 57 | False 58 | False 59 | 60 | 61 | 62 | ..\..\packages\Xamarin.Forms.2.3.2.127\lib\MonoAndroid10\FormsViewGroup.dll 63 | True 64 | 65 | 66 | ..\..\packages\HockeySDK.Xamarin.4.1.0\lib\MonoAndroid403\HockeySDK.dll 67 | True 68 | 69 | 70 | ..\..\packages\HockeySDK.Xamarin.4.1.0\lib\MonoAndroid403\HockeySDK.AndroidBindings.dll 71 | True 72 | 73 | 74 | ..\..\packages\Microsoft.Azure.Mobile.Client.3.0.3\lib\monoandroid\Microsoft.WindowsAzure.Mobile.dll 75 | True 76 | 77 | 78 | ..\..\packages\Microsoft.Azure.Mobile.Client.3.0.3\lib\monoandroid\Microsoft.WindowsAzure.Mobile.Ext.dll 79 | True 80 | 81 | 82 | ..\..\packages\Microsoft.Azure.Mobile.Client.SQLiteStore.3.0.3\lib\portable-win+net45+wp8+wpa81+monotouch10+monoandroid10+xamarinios10\Microsoft.WindowsAzure.Mobile.SQLiteStore.dll 83 | True 84 | 85 | 86 | 87 | 88 | ..\..\packages\Newtonsoft.Json.9.0.1\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll 89 | True 90 | 91 | 92 | ..\..\packages\SQLitePCLRaw.bundle_green.1.0.0\lib\MonoAndroid\SQLitePCLRaw.batteries_green.dll 93 | True 94 | 95 | 96 | ..\..\packages\SQLitePCLRaw.core.1.0.0\lib\MonoAndroid\SQLitePCLRaw.core.dll 97 | True 98 | 99 | 100 | ..\..\packages\SQLitePCLRaw.lib.e_sqlite3.android.1.0.0\lib\MonoAndroid\SQLitePCLRaw.lib.e_sqlite3.dll 101 | True 102 | 103 | 104 | ..\..\packages\SQLitePCLRaw.provider.e_sqlite3.android.1.0.0\lib\MonoAndroid\SQLitePCLRaw.provider.e_sqlite3.dll 105 | True 106 | 107 | 108 | 109 | 110 | 111 | ..\..\packages\Microsoft.Net.Http.2.2.29\lib\monoandroid\System.Net.Http.Extensions.dll 112 | True 113 | 114 | 115 | ..\..\packages\Microsoft.Net.Http.2.2.29\lib\monoandroid\System.Net.Http.Primitives.dll 116 | True 117 | 118 | 119 | 120 | 121 | ..\..\packages\Xamarin.Android.Support.Animated.Vector.Drawable.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.Animated.Vector.Drawable.dll 122 | True 123 | 124 | 125 | ..\..\packages\Xamarin.Android.Support.Design.23.3.0\lib\MonoAndroid43\Xamarin.Android.Support.Design.dll 126 | True 127 | 128 | 129 | ..\..\packages\Xamarin.Android.Support.v4.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v4.dll 130 | True 131 | 132 | 133 | ..\..\packages\Xamarin.Android.Support.v7.AppCompat.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.AppCompat.dll 134 | True 135 | 136 | 137 | ..\..\packages\Xamarin.Android.Support.v7.CardView.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.CardView.dll 138 | True 139 | 140 | 141 | ..\..\packages\Xamarin.Android.Support.v7.MediaRouter.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.MediaRouter.dll 142 | True 143 | 144 | 145 | ..\..\packages\Xamarin.Android.Support.v7.RecyclerView.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.RecyclerView.dll 146 | True 147 | 148 | 149 | ..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.Vector.Drawable.dll 150 | True 151 | 152 | 153 | ..\..\packages\Xamarin.Forms.2.3.2.127\lib\MonoAndroid10\Xamarin.Forms.Core.dll 154 | True 155 | 156 | 157 | ..\..\packages\Xamarin.Forms.2.3.2.127\lib\MonoAndroid10\Xamarin.Forms.Platform.dll 158 | True 159 | 160 | 161 | ..\..\packages\Xamarin.Forms.2.3.2.127\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll 162 | True 163 | 164 | 165 | ..\..\packages\Xamarin.Forms.2.3.2.127\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll 166 | True 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | Designer 190 | 191 | 192 | 193 | 194 | eXam 195 | 196 | 197 | 198 | 199 | 200 | 201 | 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}. 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 216 | -------------------------------------------------------------------------------- /Source/eXam/exam.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 | -------------------------------------------------------------------------------- /UITest/Extras/README.md: -------------------------------------------------------------------------------- 1 | # Connect(); 2016 Training Materials 2 | 3 | ## UITest Extras 4 | 5 | During the UITest talk there were two applications that were demonstrated that showed some of the other capabilities of UI Test. These were the ability to test HTML5 based apps such as Cordova as well as the ability to record the videos of the tests while the tests are running on Test Cloud 6 | 7 | ### Cordova Based Example 8 | 9 | This demonstrates connecting to an Android App that was built using Cordova. 10 | 11 | The app is from the Microsoft Cordova Samples repository and this app is available at the [Cordova Github Samples](https://github.com/Microsoft/cordova-samples/tree/master/weather-app). 12 | You would need to build a version of the application using the Cordova tools and and make sure that you sign-up for an appopriate Weather API key from [openweathermap.org](http://openweathermap.org/ and paste the API key into the 13 | [weather.js](https://github.com/Microsoft/cordova-samples/blob/master/weather-app/WeatherApp/www/scripts/weather.js#L2) file 14 | 15 | ### Recording Test Cloud Videos on Android 16 | 17 | Android 4.3 and above devices have the ability to record the videos of the test while they are executing. This is an additional option and requires an additional parameter to be sent to Test Cloud. You would need to start a Test Run through the [Test Cloud portal](https://testcloud.xamarin.com). You would select a new Test Run and go through the steps selecting your devices and test series. Once it has shown the command prompt statement you would need to use to run the test, add the parameter to it and the videos will be recorded. 18 | 19 | mono packages/Xamarin.UITest.[version]/tools/test-cloud.exe submit yourAppFile.apk _key_ --devices _devices_ --series "master" --locale "en_US" --app-name "_AppName_" --user u --assembly-dir _pathToTestDllFolder_ **--test-params screencapture:true** 20 | -------------------------------------------------------------------------------- /UITest/Extras/Video Recording/TaskyUITests/TaskyUITests.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TaskyUITests", "TaskyUITests\TaskyUITests.csproj", "{ABB70BDB-5C67-4B97-9787-EDD35D9ECDA3}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {ABB70BDB-5C67-4B97-9787-EDD35D9ECDA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {ABB70BDB-5C67-4B97-9787-EDD35D9ECDA3}.Debug|Any CPU.Build.0 = Debug|Any CPU 14 | {ABB70BDB-5C67-4B97-9787-EDD35D9ECDA3}.Release|Any CPU.ActiveCfg = Release|Any CPU 15 | {ABB70BDB-5C67-4B97-9787-EDD35D9ECDA3}.Release|Any CPU.Build.0 = Release|Any CPU 16 | EndGlobalSection 17 | EndGlobal 18 | -------------------------------------------------------------------------------- /UITest/Extras/Video Recording/TaskyUITests/TaskyUITests/AndroidTaskSystem.cs: -------------------------------------------------------------------------------- 1 | using Xamarin.UITest; 2 | using System.Linq; 3 | using System; 4 | 5 | namespace TaskyUITests 6 | { 7 | public class AndroidTaskSystem : ITaskSystem 8 | { 9 | readonly IApp app; 10 | 11 | public AndroidTaskSystem(IApp app) 12 | { 13 | this.app = app; 14 | } 15 | 16 | public ITaskSystem Add () 17 | { 18 | app.Tap ("Add Task"); 19 | return this; 20 | } 21 | 22 | public ITaskSystem Delete(string taskName) 23 | { 24 | app.Tap(taskName); 25 | app.Tap("Delete"); 26 | app.WaitForNoElement(taskName); 27 | 28 | return this; 29 | } 30 | 31 | public ITaskSystem SetName (string name) 32 | { 33 | app.EnterText (c => c.Class("EditText").Index(0), name); 34 | return this; 35 | } 36 | 37 | public ITaskSystem SetNotes (string notes) 38 | { 39 | app.EnterText (c => c.Class("EditText").Index(1), notes); 40 | return this; 41 | } 42 | 43 | public ITaskSystem Save () 44 | { 45 | app.Tap ("Save"); 46 | return this; 47 | } 48 | 49 | public ITaskSystem Cancel () 50 | { 51 | app.Back (); 52 | return this; 53 | } 54 | 55 | public bool HasItem(string itemName) 56 | { 57 | try 58 | { 59 | app.WaitForElement(c => c.Marked(itemName)); 60 | return true; 61 | } 62 | catch (TimeoutException) 63 | { 64 | } 65 | return false; 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /UITest/Extras/Video Recording/TaskyUITests/TaskyUITests/AppInitializer.cs: -------------------------------------------------------------------------------- 1 | using Xamarin.UITest; 2 | using System; 3 | 4 | namespace TaskyUITests 5 | { 6 | public static class AppInitializer 7 | { 8 | public static ITaskSystem StartApp(Platform platform) 9 | { 10 | if (platform == Platform.Android) 11 | { 12 | return new AndroidTaskSystem(ConfigureApp 13 | .Android 14 | // Comment this out to use the project-resources 15 | .ApkFile(@"../../../../../Binaries/TaskyPro/Android/com.xamarin.samples.taskyandroid.apk") 16 | .StartApp()); 17 | } 18 | 19 | else if (platform == Platform.iOS) 20 | { 21 | return new IOSTaskSystem(ConfigureApp 22 | .iOS 23 | // Comment this out to use the project-resources 24 | .AppBundle(@"../../../../../Binaries/TaskyPro/iOS/TaskyiOS.app") 25 | .StartApp()); 26 | } 27 | 28 | throw new Exception("AppInitializer: Unsupported platform " + platform); 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /UITest/Extras/Video Recording/TaskyUITests/TaskyUITests/IOSTaskSystem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using Xamarin.UITest; 4 | 5 | namespace TaskyUITests 6 | { 7 | public class IOSTaskSystem : ITaskSystem 8 | { 9 | readonly IApp app; 10 | 11 | public IOSTaskSystem(IApp app) 12 | { 13 | this.app = app; 14 | } 15 | 16 | public ITaskSystem Add() 17 | { 18 | app.Tap ("Add"); 19 | return this; 20 | } 21 | 22 | public ITaskSystem Delete(string name) 23 | { 24 | app.Tap(name); 25 | app.Tap("Delete"); 26 | app.WaitForNoElement(name); 27 | 28 | return this; 29 | } 30 | 31 | public ITaskSystem SetName (string name) 32 | { 33 | app.EnterText (c => c.Class ("UITextField").Index (0), name); 34 | return this; 35 | } 36 | 37 | public ITaskSystem SetNotes (string notes) 38 | { 39 | app.EnterText (c => c.Class ("UITextField").Index (1), notes); 40 | return this; 41 | } 42 | 43 | public ITaskSystem Save () 44 | { 45 | app.Tap ("Save"); 46 | return this; 47 | } 48 | 49 | public ITaskSystem Cancel () 50 | { 51 | app.Tap ("Cancel"); 52 | return this; 53 | } 54 | 55 | public bool HasItem(string itemName) 56 | { 57 | try 58 | { 59 | app.WaitForElement(c => c.Marked(itemName)); 60 | return true; 61 | } 62 | catch (TimeoutException) 63 | { 64 | } 65 | return false; 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /UITest/Extras/Video Recording/TaskyUITests/TaskyUITests/ITaskSystem.cs: -------------------------------------------------------------------------------- 1 | namespace TaskyUITests 2 | { 3 | public interface ITaskSystem 4 | { 5 | ITaskSystem Add(); 6 | ITaskSystem Delete(string name); 7 | 8 | ITaskSystem SetName(string name); 9 | ITaskSystem SetNotes (string notes); 10 | ITaskSystem Save(); 11 | ITaskSystem Cancel(); 12 | 13 | bool HasItem(string itemName); 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /UITest/Extras/Video Recording/TaskyUITests/TaskyUITests/TaskyUITests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | {ABB70BDB-5C67-4B97-9787-EDD35D9ECDA3} 7 | Library 8 | TaskyUITests 9 | TaskyUITests 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 | 32 | 33 | ..\packages\NUnit.2.6.4\lib\nunit.framework.dll 34 | 35 | 36 | ..\packages\Xamarin.UITest.2.0.0\lib\Xamarin.UITest.dll 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /UITest/Extras/Video Recording/TaskyUITests/TaskyUITests/Tests.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | using Xamarin.UITest; 3 | 4 | namespace TaskyUITests 5 | { 6 | [TestFixture (Platform.Android)] 7 | // [TestFixture (Platform.iOS)] 8 | public class Tests 9 | { 10 | ITaskSystem tasks; 11 | Platform platform; 12 | 13 | public Tests(Platform platform) 14 | { 15 | this.platform = platform; 16 | } 17 | 18 | [SetUp] 19 | public void BeforeEachTest () 20 | { 21 | tasks = AppInitializer.StartApp (platform); 22 | } 23 | 24 | [Test] 25 | public void TaskyPro_CreatingATask_ShouldBeSuccessful () 26 | { 27 | tasks.Add () 28 | .SetName ("Get Milk") 29 | .SetNotes ("Pickup Milk") 30 | .Save (); 31 | 32 | Assert.IsTrue (tasks.HasItem ("Get Milk")); 33 | } 34 | 35 | [Test] 36 | public void TaskyPro_DeletingATask_ShouldBeSuccessful () 37 | { 38 | tasks.Add() 39 | .SetName("Test Delete") 40 | .SetNotes("This item should be deleted") 41 | .Save(); 42 | 43 | tasks.Delete("Test Delete"); 44 | 45 | Assert.IsFalse(tasks.HasItem("Test Delete")); 46 | } 47 | } 48 | } 49 | 50 | -------------------------------------------------------------------------------- /UITest/Extras/Video Recording/TaskyUITests/TaskyUITests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /UITest/Extras/Video Recording/com.xamarin.samples.taskyandroid.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xamarin/xamarinu-connect2016/fa90c36f964800e7d90a339090be9d1c42d37fb5/UITest/Extras/Video Recording/com.xamarin.samples.taskyandroid.apk -------------------------------------------------------------------------------- /UITest/Extras/Web Apps/TestWeatherAppUI.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestWeatherAppUI", "TestWeatherAppUI\TestWeatherAppUI.csproj", "{77457845-C28B-444C-9882-1A9934DED9EA}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {77457845-C28B-444C-9882-1A9934DED9EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {77457845-C28B-444C-9882-1A9934DED9EA}.Debug|Any CPU.Build.0 = Debug|Any CPU 14 | {77457845-C28B-444C-9882-1A9934DED9EA}.Release|Any CPU.ActiveCfg = Release|Any CPU 15 | {77457845-C28B-444C-9882-1A9934DED9EA}.Release|Any CPU.Build.0 = Release|Any CPU 16 | EndGlobalSection 17 | EndGlobal 18 | -------------------------------------------------------------------------------- /UITest/Extras/Web Apps/TestWeatherAppUI/TestWeatherAppUI.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | {77457845-C28B-444C-9882-1A9934DED9EA} 7 | Library 8 | TestWeatherAppUI 9 | TestWeatherAppUI 10 | v4.5 11 | 12 | 13 | true 14 | full 15 | false 16 | bin\Debug 17 | DEBUG; 18 | prompt 19 | 4 20 | 21 | 22 | true 23 | bin\Release 24 | prompt 25 | 4 26 | 27 | 28 | 29 | 30 | ..\packages\NUnit.2.6.3\lib\nunit.framework.dll 31 | 32 | 33 | ..\packages\Xamarin.UITest.1.3.7\lib\Xamarin.UITest.dll 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /UITest/Extras/Web Apps/TestWeatherAppUI/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.Android; 7 | 8 | namespace TestWeatherAppUI 9 | { 10 | /// 11 | /// This demonstrates connecting to an Android App that was built using Cordova. 12 | /// The app is from the Microsoft Cordova Samples repository and this app is available at 13 | /// https://github.com/Microsoft/cordova-samples/tree/master/weather-app 14 | /// You would need to build a version of the application using the Cordova tools and and make sure that you 15 | /// sign-up for an appopriate Weather API key from http://openweathermap.org/ and paste the API key into the 16 | /// weather.js file 17 | /// 18 | [TestFixture] 19 | public class Tests 20 | { 21 | AndroidApp app; 22 | 23 | [SetUp] 24 | public void BeforeEachTest() 25 | { 26 | app = ConfigureApp 27 | .Android 28 | .EnableLocalScreenshots() 29 | .ApkFile ("../../Cordova-WeatherApp.apk") 30 | .StartApp(); 31 | } 32 | 33 | [Test] 34 | public void WeatherApp_TestSearchCapability_ShouldDisplayCorrectLocation() 35 | { 36 | // Tap on the Zip Code input 37 | app.WaitForElement(c => c.Css("#zip-code-input")); 38 | 39 | app.Screenshot("Entering the Zip Code"); 40 | app.Tap(c => c.Css("#zip-code-input")); 41 | 42 | // Enter the Zip Code 43 | app.EnterText("90210"); 44 | 45 | // Perform the Search 46 | app.Screenshot("Performing the Search"); 47 | app.Tap(c => c.Css("#get-weather-btn")); 48 | 49 | // Wait for the title to appear 50 | app.WaitFor(() => app.Query(c => c.Css("#title")).First().TextContent == "Beverly Hills"); 51 | 52 | // Check the correct postcode appears 53 | app.Screenshot("Viewing the Search Results"); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /UITest/Extras/Web Apps/TestWeatherAppUI/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | --------------------------------------------------------------------------------