static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // On crée la mainframe mais on ne l'affichage pas encore BrickInvaders._frame = new MainFrame(); // On crée le launcher et on le lance Launcher launcher = new Launcher(); Application.Run(launcher); // On récupère la configuration qui en est issue Configuration c = launcher.Configuration; // Si elle existe (le launcher n'a pas été fermé mais on l'a validé) if (c != null) { // On crée le joueur et le modèle du jeu, on charge les scores associés, la mainframe surveillera le modèle pour détecter la défaite entre autre Player p = new Player(launcher.Pseudo); ModelInterface m = new GameModel(); m.SetScoresModel(new ScoresModel(c.GameMode)); m.AddObserver(BrickInvaders._frame); // On initialise le contrôleur Engine.Initialise(p, c, m, BrickInvaders._frame); // On lance l'application depuis la mainframe Application.Run(BrickInvaders._frame); } }
static void Main(string[] args) { var launcher = new Launcher<HelloWorld>(); SetUpDesignEnvironment(launcher.ProgramInfo); launcher.Start(); }
// Use this for initialization void Start() { launcher = GetComponent<Launcher>(); line = GetComponent<LineRenderer>(); //Hide the line at the beginning by disabling its component line.enabled = false; }
void Start() { rb = this.GetComponent<Rigidbody>(); cam = GameObject.Find("Main Camera"); anim = GetComponentInChildren<Animator>(); thrower = gameObject.GetComponentInChildren<Launcher>(); }
static void Main(string[] args) { int iChannel = System.Convert.ToInt32(args[0]); string sWMVDirectory = args[1]; OysterEncoder.Launcher launcher = new Launcher(iChannel,sWMVDirectory); launcher.Start(); }
// Use this for initialization void Start() { rb = gameObject.GetComponent<Rigidbody>(); pc = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerControl>(); launcher = GameObject.Find("Launcher").GetComponent<Launcher>(); rb.AddForce(speed * pc.direction, 0f, 0f); StartCoroutine("life"); }
// Use this for initialization void Start() { // Find the launcher launcher = GameObject.FindObjectOfType(typeof(Launcher)) as Launcher; // Get the values power = launcher.powerSlider.value; rotation = launcher.rotationSlider.value; }
// Use this for initialization void Start() { //Destroy mouse input if Android detected if (Application.platform == RuntimePlatform.Android) { LauncherMouseInput mouseInput = GetComponent<LauncherMouseInput>(); Destroy(mouseInput); } launcher = GetComponent<Launcher>(); }
public QonqrManager() { _apiCall = new ApiCall(); _statistics = new Stats(); _zonesList = new List<Zoneski>(); _harvest = new Harvester(); _fortsList = new List<Zoneski>(); _launch = new Launcher(); ConfigFile configFile = new ConfigFile(); _accounts = configFile.GetAccounts(); ResetCoordinates(); }
static void CommandLoop(Launcher launcher) { while (true) { string[] inputStr = (Console.ReadLine() ?? "").ToLower().Split(SEPARATOR, StringSplitOptions.RemoveEmptyEntries); if (inputStr.Length == 0) continue; string cmd = inputStr[0]; try { switch (cmd) { case "echo": var defaultColor = Console.ForegroundColor; Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine("------------------------------"); foreach (ServerBase serverBase in launcher.Servers) { Console.WriteLine("[{0}]", serverBase.Name); } Console.WriteLine("------------------------------"); Console.ForegroundColor = defaultColor; break; case "restart": OnRestartCommand(launcher, inputStr); break; case "stop": OnStopCommand(launcher, inputStr); break; case "exit": launcher.StopAll(); return; default: Console.WriteLine("command is not exist"); break; } } catch (Exception ex) { Console.WriteLine(ex.Message); } } }
static void Main() { Application.ThreadException += new ThreadExceptionEventHandler(ExceptionHandler.UIThreadException); Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(ExceptionHandler.UnhandledException); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Localization.Culture = new CultureInfo(Settings.Default.Language); Launcher launcher = new Launcher(); launcher.ShowDialog(); if (launcher.IsSafe == true) { launcher.Dispose(); Application.Run(new Main()); } }
async Task Run() { Launcher launcher = null; IInstallLocation installLocation = null; try { launcher = new Launcher(Path.Combine(config.RootDirFullPath, "Launcher")); installLocation = new InstallLocation(Path.Combine(config.RootDirFullPath, "Bin"), config.WurmAssistantExeFileName, new ProcessRunner()); launcher.EnterLock(); LauncherData launcherData = launcher.GetPersistentData(); IStagingLocation stagingLocation = new StagingLocation(Path.Combine(config.RootDirFullPath, "Staging")); IWurmAssistantService wurmAssistantService = new WurmAssistantService( config.WebServiceRootUrl, stagingLocation); stagingLocation.ClearExtractionDir(); if (installLocation.Installed) { if (stagingLocation.AnyPackageStaged) { var latestStagedPackage = stagingLocation.GetLatestStagedPackage(); gui.ShowGui(); gui.AddUserMessage("Updating to version " + latestStagedPackage.Version); gui.SetProgressStatus("Updating..."); gui.SetProgressPercent(null); stagingLocation.ExtractIntoExtractionDir(latestStagedPackage); installLocation.ClearLocation(); stagingLocation.MoveExtractionDir(installLocation.InstallLocationPath); stagingLocation.ClearStagingArea(); launcherData.WurmAssistantInstalledVersion = latestStagedPackage.Version; launcher.SavePersistentData(); gui.AddUserMessage("Update complete"); gui.SetProgressStatus("Update complete"); await Task.Delay(TimeSpan.FromSeconds(1)); gui.HideGui(); } TryRunWurmAssistant(installLocation); await CheckAndDownloadLatestPackage(wurmAssistantService, launcher, launcherData); } else { gui.ShowGui(); gui.AddUserMessage("Installing latest version of Wurm Assistant"); var latestVersion = await wurmAssistantService.GetLatestVersionAsync(gui); var latestPackage = await wurmAssistantService.GetPackageAsync(gui, latestVersion); gui.AddUserMessage("Extracting Wurm Assistant version " + latestVersion); latestPackage.ExtractIntoDirectory(installLocation.InstallLocationPath); launcherData.WurmAssistantInstalledVersion = latestVersion; launcher.SavePersistentData(); gui.AddUserMessage("Installation complete."); gui.AddUserMessage("Starting Wurm Assistant..."); await Task.Delay(TimeSpan.FromSeconds(1)); installLocation.RunWurmAssistant(); gui.HideGui(); stagingLocation.ClearStagingArea(); } launcher.SavePersistentData(); gui.HideGui(); host.Close(); } catch (LockFailedException exception) { debug.Write("LockFailedException: " + exception.ToString()); if (installLocation != null) { if (installLocation.Installed) { TryRunWurmAssistant(installLocation); } } host.Close(); } finally { if (launcher != null) { launcher.ReleaseLock(); } } }
/// <summary> /// Assign the recieveMessageCallback used for sending messages back to the UI thread. /// </summary> /// <param name="updateText"></param> public void setRecieveMessageCallback(Launcher.recieveMessageCallback updateText) { this.sendMessage = updateText; }
private void Button_Click(object sender, RoutedEventArgs e) { Launcher.LaunchUriAsync(new Uri("https://jingyan.baidu.com/article/fedf07379bd69c35ac897795.html")); }
/// <summary> /// 指定した URL を Web ブラウザーで表示します。 /// </summary> private async void LaunchBrowser(string parameter) { await Launcher.LaunchUriAsync(new Uri(parameter)); }
private async void web_Click(object sender, RoutedEventArgs e) { await Launcher.LaunchUriAsync(new Uri(string.Format("http://konachan.net/post/show/{0}/", ID))); }
public async Task LaunchAppReviewInStoreByAppId(string productId) { await Launcher.LaunchUriAsync(AppReviewInStoreByAppIdUri(productId)); }
/// <summary> /// Create and open a satellite application form /// </summary> /// <param name="applicationFormType"></param> /// <param name="parameters"></param> public static void Open(Type applicationFormType, params object[] parameters) { Launcher launcher = new Launcher(applicationFormType, parameters); launcher.OpenForm(); }
private async void ToCalendar_Click(object sender, RoutedEventArgs e) { bool success = await Launcher.LaunchUriAsync(new Uri("https://bay04.calendar.live.com/calendar/import.aspx?mkt=zh-CN#")); }
private async void LaunchTerminalsConfigFile() { await Launcher.LaunchFileAsync(await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appdata:///local/settings/terminal.json"))); }
void Awake() { Instance = this; }
static void OnStopCommand(Launcher launcher, string[] inputStr) { if (inputStr.Length != 2) { throw new ArgumentException("command argument error"); } string param = inputStr[1]; if (param == "all") { launcher.StopAll(); Console.WriteLine("all servers have been stopped"); } else { launcher.Stop(param); Console.WriteLine("[{0}] stopped", param); } }
// Use this for initialization void Start() { launcher = GetComponent<Launcher>(); }
void OnEnable() { temptime = Time.time + lifetime; launcher = GameObject.FindGameObjectWithTag ("Launcher").GetComponent<Launcher>() ; }
private async Task OnTrack() { await Launcher.OpenAsync(new Uri($"https://portal-dev.trulite.com/WorkOrders/Track/{_packingSlip.Order.Key}")); }
public void Open(string file) { objects = new List<MapObject>(); BufferReader reader = new BufferReader(file); if (Path.GetExtension(file) != ".adm") { throw new ArgumentException("File does not have *.adm extension."); } if (reader.ReadString() != "ADmapv2") { throw new ArgumentException("Not a valid Adrenaline map file."); } // general map info this.version = reader.ReadByte(); this.gridSize = reader.ReadByte(); // spare slots reader.Skip(15); this.Name = reader.ReadString(); this.Author = reader.ReadString(); this.floorType = reader.ReadByte(); // objects while (reader.HasMore()) { string objectType = reader.ReadString(); int instances = (int)reader.ReadUShort(); for (int i = 0; i < instances; i++) { ushort x = reader.ReadUShort(); ushort y = reader.ReadUShort(); MapObject obj = null; #region Object Creation switch (objectType) { // pickups case "objAbArmor": obj = new BulletArmorPickup(); break; case "objAbIncendary": obj = new BulletIncendiaryPickup(); break; case "objAbDefault": obj = new BulletNormalPickup(); break; case "objAbVelocity": obj = new BulletVelocityPickup(); break; case "objAnades": obj = new GrenadePickup(); break; case "objMedkit": obj = new HealthPickup(); break; case "objAeNormal": obj = new LaserPickup(); break; case "objAmines": obj = new MinePickup(); break; case "objApDisc": obj = new PlasmaDiscPickup(); break; case "objApFragma": obj = new PlasmaFragmaPickup(); break; case "objApHigh": obj = new PlasmaHighPickup(); break; case "objApNormal": obj = new PlasmaNormalPickup(); break; case "objAmNormal": obj = new RocketDualPickup(); break; case "objAmNade": obj = new RocketNukePickup(); break; case "objAcSniper": obj = new SniperPickup(); break; case "objAeSuper": obj = new SuperLaserPickup(); break; // static case "objSpawn": obj = new AllSpawn(); break; case "objFlagBlue": obj = new BlueFlag(); break; case "objFlagRed": obj = new RedFlag(); break; case "objTBlueSpawn": obj = new BlueSpawn(); break; case "objTRedSpawn": obj = new RedSpawn(); break; case "objLevelMine": obj = new LevelMine(); break; case "objTeleportDest": obj = new TeleportDestination(); break; case "objTeleportSrc": obj = new TeleportSource(); break; case "objStaticLight": obj = new Light(reader.ReadByte(), reader.ReadByte(), reader.ReadByte(), reader.ReadByte()); break; // Walls case "objBlockWallBlocks": obj = new BlocksWall(); break; case "objBlockBrick": obj = new BrickWall(); break; case "objCube": obj = new CompanionCube(); break; case "objCompanion": obj = new Crate(); break; case "objBlockWall": obj = new GreyWall(); break; case "objBlockIceWall": obj = new IceWall(); break; case "objBlockLight": obj = new LightWall(); break; case "objBlockLightWall": obj = new LightWall2(); break; case "objBlockOld": obj = new OldWall(); break; case "objBlockRusty": obj = new RustyWall(); break; case "objBlockStripeWall": obj = new StripeWall(); break; case "objBlockWallpaper": obj = new WallpaperWall(); break; case "objBlockCrate": obj = new WoodWall(); break; // weapons case "objAssault": obj = new Assault(); break; case "objSawnOff": obj = new Curveshot(); break; case "objLaserRifle": obj = new Laser(); break; case "objLauncher": obj = new Launcher(); break; case "objMinigun": obj = new Minigun(); break; case "objPistol": obj = new IceWall(); break; case "Pistol": obj = new LightWall(); break; case "objPlasma": obj = new Plasma(); break; case "objShotgun": obj = new Shotgun(); break; case "objSMG": obj = new SMG(); break; case "objSniper": obj = new Sniper(); break; default: // no known object... better read bytes anyway reader.ReadUShort(); reader.ReadUShort(); break; } #endregion Object Creation if (obj != null) { obj.X = x; obj.Y = y; objects.Add(obj); } } } }
// Double-tap event for DataGrid public static async void List_ItemClick(object sender, DoubleTappedRoutedEventArgs e) { if (page.Name == "GenericItemView") { var index = GenericFileBrowser.data.SelectedIndex; if (index > -1) { var clickedOnItem = ItemViewModel.FilesAndFolders[index]; if (clickedOnItem.FileExtension == "Folder") { ItemViewModel.TextState.isVisible = Visibility.Collapsed; History.ForwardList.Clear(); ItemViewModel.FS.isEnabled = false; ItemViewModel.FilesAndFolders.Clear(); if (clickedOnItem.FilePath == Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)) { GenericFileBrowser.P.path = "Desktop"; foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems) { if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "DesktopIC") { MainPage.Select.itemSelected = NavItemChoice; break; } } MainPage.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), YourHome.DesktopPath, new SuppressNavigationTransitionInfo()); MainPage.accessibleAutoSuggestBox.PlaceholderText = "Search Desktop"; } else if (clickedOnItem.FilePath == Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)) { GenericFileBrowser.P.path = "Documents"; foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems) { if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "DocumentsIC") { MainPage.Select.itemSelected = NavItemChoice; break; } } MainPage.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), YourHome.DocumentsPath, new SuppressNavigationTransitionInfo()); MainPage.accessibleAutoSuggestBox.PlaceholderText = "Search Documents"; } else if (clickedOnItem.FilePath == (Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + @"\Downloads")) { GenericFileBrowser.P.path = "Downloads"; foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems) { if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "DownloadsIC") { MainPage.Select.itemSelected = NavItemChoice; break; } } MainPage.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), YourHome.DownloadsPath, new SuppressNavigationTransitionInfo()); MainPage.accessibleAutoSuggestBox.PlaceholderText = "Search Downloads"; } else if (clickedOnItem.FilePath == Environment.GetFolderPath(Environment.SpecialFolder.MyPictures)) { foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems) { if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "PicturesIC") { MainPage.Select.itemSelected = NavItemChoice; break; } } MainPage.accessibleContentFrame.Navigate(typeof(PhotoAlbum), YourHome.PicturesPath, new SuppressNavigationTransitionInfo()); MainPage.accessibleAutoSuggestBox.PlaceholderText = "Search Pictures"; GenericFileBrowser.P.path = "Pictures"; } else if (clickedOnItem.FilePath == Environment.GetFolderPath(Environment.SpecialFolder.MyMusic)) { GenericFileBrowser.P.path = "Music"; foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems) { if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "MusicIC") { MainPage.Select.itemSelected = NavItemChoice; break; } } MainPage.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), YourHome.MusicPath, new SuppressNavigationTransitionInfo()); MainPage.accessibleAutoSuggestBox.PlaceholderText = "Search Music"; } else if (clickedOnItem.FilePath == (Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + @"\OneDrive")) { GenericFileBrowser.P.path = "OneDrive"; foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems) { if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "OneD_IC") { MainPage.Select.itemSelected = NavItemChoice; break; } } MainPage.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), YourHome.OneDrivePath, new SuppressNavigationTransitionInfo()); MainPage.accessibleAutoSuggestBox.PlaceholderText = "Search OneDrive"; } else if (clickedOnItem.FilePath == Environment.GetFolderPath(Environment.SpecialFolder.MyVideos)) { GenericFileBrowser.P.path = "Videos"; foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems) { if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "VideosIC") { MainPage.Select.itemSelected = NavItemChoice; break; } } MainPage.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), YourHome.VideosPath, new SuppressNavigationTransitionInfo()); MainPage.accessibleAutoSuggestBox.PlaceholderText = "Search Videos"; } else { GenericFileBrowser.P.path = clickedOnItem.FilePath; foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems) { if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "LocD_IC") { MainPage.Select.itemSelected = NavItemChoice; break; } } ItemViewModel.ViewModel = new ItemViewModel(clickedOnItem.FilePath, GenericFileBrowser.GFBPageName); } } else if (clickedOnItem.FileExtension == "Executable") { message = new MessageDialog("We noticed you’re trying to run an executable file. This type of file may be a security risk to your device, and is not supported by the Universal Windows Platform. If you're not sure what this means, check out the Microsoft Store for a large selection of secure apps, games, and more."); message.Title = "Unsupported Functionality"; message.Commands.Add(new UICommand("Continue...", new UICommandInvokedHandler(Interaction.CommandInvokedHandler))); message.Commands.Add(new UICommand("Cancel")); await message.ShowAsync(); } else { StorageFile file = await StorageFile.GetFileFromPathAsync(clickedOnItem.FilePath); var options = new LauncherOptions { DisplayApplicationPicker = true }; await Launcher.LaunchFileAsync(file, options); } } } else if (page.Name == "PhotoAlbumViewer") { var index = PhotoAlbum.gv.SelectedIndex; if (index > -1) { var clickedOnItem = ItemViewModel.FilesAndFolders[index]; if (clickedOnItem.FileExtension == "Folder") { ItemViewModel.TextState.isVisible = Windows.UI.Xaml.Visibility.Collapsed; History.ForwardList.Clear(); ItemViewModel.FS.isEnabled = false; ItemViewModel.FilesAndFolders.Clear(); if (clickedOnItem.FilePath == Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)) { GenericFileBrowser.P.path = "Desktop"; foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems) { if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "DesktopIC") { MainPage.Select.itemSelected = NavItemChoice; break; } } MainPage.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), YourHome.DesktopPath, new SuppressNavigationTransitionInfo()); MainPage.accessibleAutoSuggestBox.PlaceholderText = "Search Desktop"; } else if (clickedOnItem.FilePath == Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)) { GenericFileBrowser.P.path = "Documents"; foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems) { if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "DocumentsIC") { MainPage.Select.itemSelected = NavItemChoice; break; } } MainPage.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), YourHome.DocumentsPath, new SuppressNavigationTransitionInfo()); MainPage.accessibleAutoSuggestBox.PlaceholderText = "Search Documents"; } else if (clickedOnItem.FilePath == (Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + @"\Downloads")) { GenericFileBrowser.P.path = "Downloads"; foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems) { if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "DownloadsIC") { MainPage.Select.itemSelected = NavItemChoice; break; } } MainPage.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), YourHome.DownloadsPath, new SuppressNavigationTransitionInfo()); MainPage.accessibleAutoSuggestBox.PlaceholderText = "Search Downloads"; } else if (clickedOnItem.FilePath == Environment.GetFolderPath(Environment.SpecialFolder.MyPictures)) { foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems) { if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "PicturesIC") { MainPage.Select.itemSelected = NavItemChoice; break; } } MainPage.accessibleContentFrame.Navigate(typeof(PhotoAlbum), YourHome.PicturesPath, new SuppressNavigationTransitionInfo()); MainPage.accessibleAutoSuggestBox.PlaceholderText = "Search Pictures"; GenericFileBrowser.P.path = "Pictures"; } else if (clickedOnItem.FilePath == Environment.GetFolderPath(Environment.SpecialFolder.MyMusic)) { GenericFileBrowser.P.path = "Music"; foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems) { if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "MusicIC") { MainPage.Select.itemSelected = NavItemChoice; break; } } MainPage.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), YourHome.MusicPath, new SuppressNavigationTransitionInfo()); MainPage.accessibleAutoSuggestBox.PlaceholderText = "Search Music"; } else if (clickedOnItem.FilePath == (Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + @"\OneDrive")) { GenericFileBrowser.P.path = "OneDrive"; foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems) { if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "OneD_IC") { MainPage.Select.itemSelected = NavItemChoice; break; } } MainPage.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), YourHome.OneDrivePath, new SuppressNavigationTransitionInfo()); MainPage.accessibleAutoSuggestBox.PlaceholderText = "Search OneDrive"; } else if (clickedOnItem.FilePath == Environment.GetFolderPath(Environment.SpecialFolder.MyVideos)) { GenericFileBrowser.P.path = "Videos"; foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems) { if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "VideosIC") { MainPage.Select.itemSelected = NavItemChoice; break; } } MainPage.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), YourHome.VideosPath, new SuppressNavigationTransitionInfo()); MainPage.accessibleAutoSuggestBox.PlaceholderText = "Search Videos"; } else { GenericFileBrowser.P.path = clickedOnItem.FilePath; foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems) { if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "LocD_IC") { MainPage.Select.itemSelected = NavItemChoice; break; } } ItemViewModel.ViewModel = new ItemViewModel(clickedOnItem.FilePath, PhotoAlbum.PAPageName); } } else if (clickedOnItem.FileExtension == "Executable") { Interaction.message = new MessageDialog("We noticed you’re trying to run an executable file. This type of file may be a security risk to your device, and is not supported by the Universal Windows Platform. If you're not sure what this means, check out the Microsoft Store for a large selection of secure apps, games, and more."); Interaction.message.Title = "Unsupported Functionality"; Interaction.message.Commands.Add(new UICommand("Continue...", new UICommandInvokedHandler(Interaction.CommandInvokedHandler))); Interaction.message.Commands.Add(new UICommand("Cancel")); await Interaction.message.ShowAsync(); } else { StorageFile file = await StorageFile.GetFileFromPathAsync(clickedOnItem.FilePath); var options = new LauncherOptions { DisplayApplicationPicker = true }; await Launcher.LaunchFileAsync(file, options); } } } }
private void EndShooterTap() { tappedShooter.EndTap(); tappedShooter = null; }
/// <summary> /// Launches the store app so the user can leave a review. /// </summary> /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns> /// <remarks>This method needs to be called from your UI thread.</remarks> public static async Task LaunchStoreForReviewAsync() { await Launcher.LaunchUriAsync(new Uri(string.Format("ms-windows-store://review/?PFN={0}", Package.Current.Id.FamilyName))); }
/// <summary> /// Initialize all of our behaviors. /// </summary> /// <param name="file"></param> public FileUserControlViewModel(IFile file, IBlobCache cache = null) { File = file; cache = cache ?? Blobs.LocalStorage; // Save the document type for the UI DocumentTypeString = file.FileType.ToUpper(); // Setup the actual file downloader FileDownloader = new FileDownloadController(file, cache); // Now, hook up our UI indicators to the download control. FileDownloader.WhenAny(x => x.IsDownloading, x => x.Value) .ToProperty(this, x => x.IsDownloading, out _isDownloading, false, RxApp.MainThreadScheduler); FileDownloader.WhenAny(x => x.IsDownloaded, x => x.IsDownloading, (x, y) => !x.Value || y.Value) .ToProperty(this, x => x.FileNotCachedOrDownloading, out _fileNotCachedOrDownloading, true, RxApp.MainThreadScheduler); // Allow them to download a file. var canDoDownload = FileDownloader.WhenAny(x => x.IsDownloading, x => x.Value) .Select(x => !x); ClickedUs = ReactiveCommand.Create(canDoDownload); ClickedUs .Where(_ => !FileDownloader.IsDownloaded) .InvokeCommand(FileDownloader.DownloadOrUpdate); // Opening the file is a bit more complex. It happens only when the user clicks the button a second time. // Requires us to write a file to the local cache. ClickedUs .Where(_ => FileDownloader.IsDownloaded) .SelectMany(_ => file.GetFileFromCache(cache)) .SelectMany(async stream => { var fname = string.Format("{0}.{1}", file.DisplayName.CleanFilename(), file.FileType).CleanFilename(); var fdate = await file.GetCacheCreateTime(cache); var folder = fdate.HasValue ? fdate.Value.ToString().CleanFilename() : "Unknown Cache Time"; // Write the file. If it is already written, then we will just return it (e.g. assume it is the same). // 0x800700B7 (-2147024713) is the error code for file already exists. return(CreateFile(folder, fname) .SelectMany(f => f.OpenStreamForWriteAsync()) .SelectMany(async fstream => { try { using (var readerStream = stream.AsStreamForRead()) { await readerStream.CopyToAsync(fstream); } } finally { fstream.Dispose(); } return default(Unit); }) .Catch <Unit, Exception>(e => { if (e.HResult == unchecked ((int)0x800700B7)) { return Observable.Return(default(Unit)); } return Observable.Throw <Unit>(e); }) .SelectMany(_ => GetExistingFile(folder, fname))); }) .SelectMany(f => f) .ObserveOn(RxApp.MainThreadScheduler) .SelectMany(f => { return(Observable.FromAsync(async _ => await Launcher.LaunchFileAsync(f)) .Select(good => Tuple.Create(f, good)) .Catch(Observable.Return(Tuple.Create(f, false)))); }) .Where(g => g.Item2 == false) .ObserveOn(RxApp.MainThreadScheduler) .SelectMany(f => { return(Observable.FromAsync(async _ => await Launcher.LaunchFileAsync(f.Item1, new LauncherOptions() { DisplayApplicationPicker = true })) .Catch(Observable.Return(false))); }) .Where(g => g == false) .Subscribe( g => { throw new InvalidOperationException(string.Format("Unable to open file {0}.", file.DisplayName)); }, e => { throw new InvalidOperationException(string.Format("Unable to open file {0}.", file.DisplayName), e); } ); // Init the UI from the cache. We want to do one or the other // because the download will fetch from the cache first. So no need to // fire them both off. OnLoaded = ReactiveCommand.Create(); OnLoaded .Where(_ => Settings.AutoDownloadNewMeeting) .InvokeCommand(FileDownloader.DownloadOrUpdate); }
private async void DonateButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) { var link = new Uri("https://www.paypal.me/PabloJmnz"); await Launcher.LaunchUriAsync(link); }
private async void ToAccount_Click(object sender, RoutedEventArgs e) { bool success = await Launcher.LaunchUriAsync(new Uri("ms-settings-emailandaccounts:")); }
private async void OpenWebsite_OnClick(object sender, RoutedEventArgs e) { await Launcher.LaunchUriAsync(new Uri("http://taskmodel.azurewebsites.net/taskModelsMvc")); }
public async Task LaunchAppReviewInStoreByProductFamilyName(string pfn) { await Launcher.LaunchUriAsync(AppReviewInStoreByProductFamilyNameUri(pfn)); }
private async void Rate_Click(object sender, RoutedEventArgs e) { await Launcher.LaunchUriAsync(new Uri(string.Format("ms-windows-store:REVIEW?PFN={0}", Windows.ApplicationModel.Package.Current.Id.FamilyName))); }
public async Task LaunchPublisherPageInStore(string publisherName) { await Launcher.LaunchUriAsync(PublisherPageInStoreUri(publisherName)); }
private async void FeedbackButton_Click(object sender, RoutedEventArgs e) { await Launcher.LaunchUriAsync(new Uri("feedback-hub:")); }
private async void BtnVisit_Clicked(object sender, EventArgs e) { await Launcher.TryOpenAsync("http://gjhdigital.com/anypal"); }
private async void OpenOptionWindow(string url) { Uri uri = new Uri(url); await Launcher.LaunchUriAsync(uri); }
private static async Task UpdateLauncherFiles(IDispatcherService dispatcher, IDialogService dialogService, NugetStore store, CancellationToken cancellationToken) { var version = new PackageVersion(Version); var productAttribute = (typeof(SelfUpdater).Assembly).GetCustomAttribute <AssemblyProductAttribute>(); var packageId = productAttribute.Product; var packages = (await store.GetUpdates(new PackageName(packageId, version), true, true, cancellationToken)).OrderBy(x => x.Version); try { // First, check if there is a package forcing us to download new installer const string ReinstallUrlPattern = @"force-reinstall:\s*(\S+)\s*(\S+)"; var reinstallPackage = packages.LastOrDefault(x => x.Version > version && Regex.IsMatch(x.Description, ReinstallUrlPattern)); if (reinstallPackage != null) { var regexMatch = Regex.Match(reinstallPackage.Description, ReinstallUrlPattern); var minimumVersion = PackageVersion.Parse(regexMatch.Groups[1].Value); if (version < minimumVersion) { var installerDownloadUrl = regexMatch.Groups[2].Value; await DownloadAndInstallNewVersion(dispatcher, dialogService, installerDownloadUrl); return; } } } catch (Exception e) { await dialogService.MessageBox(string.Format(Strings.NewVersionDownloadError, e.Message), MessageBoxButton.OK, MessageBoxImage.Error); } // If there is a mandatory intermediate upgrade, take it, otherwise update straight to latest version var package = (packages.FirstOrDefault(x => x.Version > version && x.Version.SpecialVersion == "req") ?? packages.LastOrDefault()); // Check to see if an update is needed if (package != null && version < new PackageVersion(package.Version.Version, package.Version.SpecialVersion)) { var windowCreated = new TaskCompletionSource <SelfUpdateWindow>(); var mainWindow = dispatcher.Invoke(() => Application.Current.MainWindow as LauncherWindow); if (mainWindow == null) { throw new ApplicationException("Update requested without a Launcher Window. Cannot continue!"); } dispatcher.InvokeAsync(() => { selfUpdateWindow = new SelfUpdateWindow { Owner = mainWindow }; windowCreated.SetResult(selfUpdateWindow); selfUpdateWindow.ShowDialog(); }).Forget(); var movedFiles = new List <string>(); // Download package var installedPackage = await store.InstallPackage(package.Id, package.Version, null); // Copy files from tools\ to the current directory var inputFiles = installedPackage.GetFiles(); var window = windowCreated.Task.Result; dispatcher.Invoke(window.LockWindow); // TODO: We should get list of previous files from nuspec (store it as a resource and open it with NuGet API maybe?) // TODO: For now, we deal only with the App.config file since we won't be able to fix it afterward. var exeLocation = Launcher.GetExecutablePath(); var exeDirectory = Path.GetDirectoryName(exeLocation); const string directoryRoot = "tools/"; // Important!: this is matching where files are store in the nuspec try { if (File.Exists(exeLocation)) { Move(exeLocation, exeLocation + ".old"); movedFiles.Add(exeLocation); } var configLocation = exeLocation + ".config"; if (File.Exists(configLocation)) { Move(configLocation, configLocation + ".old"); movedFiles.Add(configLocation); } foreach (var file in inputFiles.Where(file => file.Path.StartsWith(directoryRoot) && !file.Path.EndsWith("/"))) { var fileName = Path.Combine(exeDirectory, file.Path.Substring(directoryRoot.Length)); // Move previous files to .old if (File.Exists(fileName)) { Move(fileName, fileName + ".old"); movedFiles.Add(fileName); } // Update the file UpdateFile(fileName, file); } } catch (Exception) { // Revert all olds files if a file didn't work well foreach (var oldFile in movedFiles) { Move(oldFile + ".old", oldFile); } throw; } // Remove .old files foreach (var oldFile in movedFiles) { try { var renamedPath = oldFile + ".old"; if (File.Exists(renamedPath)) { File.Delete(renamedPath); } } catch (Exception) { // All the files have been replaced, we let it go even if we cannot remove all the old files. } } // Clean cache from files obtain via package.GetFiles above. store.PurgeCache(); dispatcher.Invoke(RestartApplication); } }
private void Button_Click_3(object sender, RoutedEventArgs e) { FeedbackFlyout.Hide(); var openReview = Launcher.LaunchUriAsync(new Uri(string.Format("ms-windows-store:REVIEW?PFN={0}", Windows.ApplicationModel.Package.Current.Id.FamilyName))); }
private void Button_Click_1(object sender, RoutedEventArgs e) { Launcher.LaunchUriAsync(new Uri("https://jingyan.baidu.com/article/9989c746e211eaf649ecfe47.html")); }
private void Button_Click_4(object sender, RoutedEventArgs e) { FeedbackFlyout.Hide(); var openReview = Launcher.LaunchUriAsync(new Uri("mailto:[email protected]")); }
async Task CheckAndDownloadLatestPackage(IWurmAssistantService wurmAssistantService, Launcher launcher, LauncherData launcherData) { Version remoteVersion = null; try { remoteVersion = await wurmAssistantService.GetLatestVersionAsync(gui); } catch (Exception exception) { launcher.WriteErrorFile( string.Format("Launcher failed to check latest WA version. Error: {0}", exception.ToString())); } if (remoteVersion != null && launcherData.WurmAssistantInstalledVersion < remoteVersion) { try { await wurmAssistantService.GetPackageAsync(gui, remoteVersion); // done - next run will install this staged version } catch (Exception exception) { launcher.WriteErrorFile( string.Format("Launcher failed to download latest WA version. Error: {0}", exception.ToString())); } } }
/// <summary> /// Starts the default app associated with the URI scheme name for the specified <see cref="Uri"/>. /// </summary> /// <param name="uri">The <see cref="Uri"/> to start.</param> /// <returns>The <see cref="Task"/> object representing the asynchronous operation.</returns> public virtual async Task LaunchUriAsync(Uri uri) { await Launcher.LaunchUriAsync(uri); }
static void Main(string[] args) { Launcher l = new Launcher(args); l.Run(); l.PrintStatistics(); }
/// <summary> /// Starts the default app associated with the specified file. /// </summary> /// <param name="file">The file to start.</param> /// <returns>The <see cref="Task"/> object representing the asynchronous operation.</returns> public virtual async Task LaunchFileAsync(string file) { var storageFile = await ApplicationData.Current.LocalFolder.GetFileAsync(file); await Launcher.LaunchFileAsync(storageFile); }
void Start() { count++; launch = GetComponent<Launcher>(); ID = countInstance; countInstance++; _anim = GetComponent<Animation>(); _anim["jumpingPeople"].speed = rate; _startPitch = audio.pitch; }
/// <summary> /// Enumerate the scheme handlers on the device. /// </summary> /// <param name="uriScheme">The scheme name that you find to find handlers for.</param> /// <param name="includeUriForResults">Filter the list of handlers by whether they can be launched for results or not.</param> /// <returns>The <see cref="Task"/> object representing the asynchronous operation.</returns> #if WINDOWS_UWP public virtual async Task <IEnumerable <LauncherServiceAppInfo> > FindUriSchemeHandlersAsync(string uriScheme, bool includeUriForResults = false) { var appInfos = await Launcher.FindUriSchemeHandlersAsync(uriScheme, includeUriForResults?LaunchQuerySupportType.UriForResults : LaunchQuerySupportType.Uri); return(appInfos.ToLauncherServiceAppInfo()); }
public Workshop(Launcher launcher) { this.launcher = launcher; }
/// <summary> /// Enumerate the file handlers on the device. /// </summary> /// <param name="extension">The file extension that you want to find handlers for.</param> /// <returns>The <see cref="Task"/> object representing the asynchronous operation.</returns> #if WINDOWS_UWP public virtual async Task <IEnumerable <LauncherServiceAppInfo> > FindFileHandlersAsync(string extension) { var appInfos = await Launcher.FindFileHandlersAsync(extension); return(appInfos.ToLauncherServiceAppInfo()); }
public void ShowPrivacyPolicy() { Uri uri = new Uri("https://raw.githubusercontent.com/faush01/SmartPlayer/master/PrivacyPolicy.txt"); Launcher.LaunchUriAsync(uri); }
private async void Button_Click(object sender, RoutedEventArgs e) { await Launcher.LaunchUriAsync(new Uri(@"https://www.pixiv.net/member_illust.php?mode=medium&illust_id=31251762")); }
private bool LoadMyServerConfigIni() { if (loading) return false; try { loading = true; this.launcher = new Launcher(); if (!this.launcher.ReadServerConfig()) return false; this.workshop = new Workshop(this.launcher); this.launcher.FindRunningServers(); return true; } finally { loading = false; } }
private async void BtnReg_Click(object sender, RoutedEventArgs e) => await Launcher.LaunchUriAsync(new Uri(@"https://accounts.pixiv.net/signup?lang=zh&source=pc&view_type=page&ref=wwwtop_accounts_index"));
/** * Gets the Acquirer and Launcher. */ private void Awake() { acquirer = GetComponent<Acquirer>(); launcher = GetComponentInChildren<Launcher>(); }
private void StartShooterTap(GameObject shooter) { tappedShooter = shooter.GetComponent<Launcher>(); tappedShooter.StartTap(); }