コード例 #1
0
        private void TryLoadAppFromStorageData(XmlData appInfoData)
        {
            AppInfo app = AppInfoExtensions.CreateAppInfo(GetAppPackageFilePath(appInfoData),
                                                          GetAppPlatform(appInfoData), GetAppGuid(appInfoData), GetAppBuildData(appInfoData));

            app.SolutionFilePath = GetAppSolutionFilePath(appInfoData);
            availableApps.Add(app);
        }
コード例 #2
0
        private void OnAppBuildResultRecieved(AppBuildResult receivedBuildResult)
        {
            AppInfo appInfo = AppInfoExtensions.CreateAppInfo(
                Path.Combine(AppListViewModel.AppStorageDirectory, receivedBuildResult.PackageFileName),
                receivedBuildResult.Platform, receivedBuildResult.PackageGuid, DateTime.Now);

            appInfo.SolutionFilePath = codeSolutionPathOfBuildingApp;
            AllowBuildingAppsAgain();
            TriggerBuiltAppRecieved(appInfo, receivedBuildResult.PackageFileData);
        }
コード例 #3
0
 private void LaunchApp(AppInfo appInfo, Device device)
 {
     try
     {
         TryLaunchApp(appInfo, device);
     }
     catch (Device.StartApplicationFailedOnDevice ex)
     {
         AppInfoExtensions.LogStartingAppFailed(appInfo, ex.DeviceName);
     }
 }
コード例 #4
0
 private static void LaunchApp(AppInfo selectedApp, Action enableLaunchButtonAgain)
 {
     try
     {
         TryLaunchApp(selectedApp);
     }
     catch (Device.StartApplicationFailedOnDevice ex)
     {
         AppInfoExtensions.LogStartingAppFailed(selectedApp, ex.DeviceName);
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
     }
     enableLaunchButtonAgain();
 }
コード例 #5
0
        private static void TryLaunchApp(AppInfo selectedApp)
        {
            if (!selectedApp.IsDeviceAvailable)
            {
                AppInfoExtensions.HandleNoDeviceAvailableInView(selectedApp);
                return;
            }
            Device primaryDevice = selectedApp.AvailableDevices[0];

            if (!primaryDevice.IsAppInstalled(selectedApp))
            {
                Logger.Info(selectedApp + " wasn't installed on the device '" + primaryDevice +
                            "' will install it now.");
                primaryDevice.Install(selectedApp);
            }
            selectedApp.LaunchAppOnPrimaryDevice();
        }
コード例 #6
0
        public void InstallAndLaunchNewBuiltApp(AppInfo appInfo)
        {
            if (!appInfo.IsDeviceAvailable)
            {
                AppInfoExtensions.HandleNoDeviceAvailableInView(appInfo);
                UpdateBuildProgressBar("Launching App aborted", 100);
                ViewModel.OpenLocalBuiltAppsDirectory();
                return;
            }
            Device primaryDevice = appInfo.AvailableDevices[0];

            if (primaryDevice.IsAppInstalled(appInfo))
            {
                UpdateBuildProgressBar(appInfo.Name + " was already installed, uninstalling it.", 90);
                primaryDevice.Uninstall(appInfo);
            }
            UpdateBuildProgressBar("Installing " + appInfo.Name + " on " + primaryDevice.Name, 95);
            primaryDevice.Install(appInfo);
            LaunchApp(appInfo, primaryDevice);
        }