public async void view_Activated(CoreApplicationView sender, Windows.ApplicationModel.Activation.IActivatedEventArgs args1) { FileOpenPickerContinuationEventArgs args = args1 as FileOpenPickerContinuationEventArgs; if (args != null) { if (args.Files.Count == 0) { return; } view.Activated -= view_Activated; StorageFile storfile = args.Files[0]; var stream = await storfile.OpenAsync(Windows.Storage.FileAccessMode.Read); var bitmapImage = new Windows.UI.Xaml.Media.Imaging.BitmapImage(); await bitmapImage.SetSourceAsync(stream); var decoder = await Windows.Graphics.Imaging.BitmapDecoder.CreateAsync(stream); ImageName = storfile.Name; btimg.ImageSource = bitmapImage; image.Content = ""; } }
private async void SoruDetay_Activated(CoreApplicationView sender, Windows.ApplicationModel.Activation.IActivatedEventArgs args) { #if WINDOWS_PHONE_APP FileOpenPickerContinuationEventArgs param = args as FileOpenPickerContinuationEventArgs; if (param != null) { if (param.Files.Count == 0) { return; } view.Activated -= SoruDetay_Activated; file = param.Files[0]; if (file != null) { var data = await FileHelper.ReadFile(file); var result = await App.APIService.ResimGuncelle(data, file.Name); if (result != null) { await Mesaj.MesajGoster(result.Mesaj); } } } #endif }
private async void SoruEkle_Activated(CoreApplicationView sender, Windows.ApplicationModel.Activation.IActivatedEventArgs args) { #if WINDOWS_PHONE_APP FileOpenPickerContinuationEventArgs param = args as FileOpenPickerContinuationEventArgs; if (param != null) { if (param.Files.Count == 0) { return; } view.Activated -= SoruEkle_Activated; if (type == 1) { resimfile1 = param.Files[0]; await Resim1Degistir(resimfile1); } else { resimfile2 = param.Files[0]; await Resim2Degistir(resimfile2); } } #endif }
// Code to execute when a contract activation such as a file open or save picker returns // with the picked file or other return values private void Application_ContractActivated(object sender, Windows.ApplicationModel.Activation.IActivatedEventArgs e) { var wabPage = RootFrame.Content as IWebAuthenticationContinuable; if (wabPage != null) { wabPage.ContinueWebAuthentication(e as WebAuthenticationBrokerContinuationEventArgs); } }
// Code to execute when a contract activation such as a file open or save picker returns // with the picked file or other return values private void Application_ContractActivated(object sender, Windows.ApplicationModel.Activation.IActivatedEventArgs e) { var filePickerContinuationArgs = e as FileOpenPickerContinuationEventArgs; if (filePickerContinuationArgs != null) { this.FilePickerContinuationArgs = filePickerContinuationArgs; } }
async void view_Activated(CoreApplicationView sender, Windows.ApplicationModel.Activation.IActivatedEventArgs args) { string strEx = string.Empty; try { FileOpenPickerContinuationEventArgs result = args as FileOpenPickerContinuationEventArgs; if (result != null && result.Files.Any()) { m_StorageFile = result.Files.FirstOrDefault(); //var composition = new MediaComposition(); //composition.Clips.Add(await MediaClip.CreateFromFileAsync(result.Files.FirstOrDefault())); //await composition.RenderToFileAsync(file); var basicProperties = await result.Files.FirstOrDefault().GetBasicPropertiesAsync(); ImageProperties imgProp = await result.Files.FirstOrDefault().Properties.GetImagePropertiesAsync(); var savedPictureStream = await result.Files.FirstOrDefault().OpenAsync(FileAccessMode.Read); Debug.WriteLine("Default size : " + Calculatesize(savedPictureStream.Size)); var length = basicProperties.Size; //string strLength = Calculatesize(length); WriteableBitmap wb = new WriteableBitmap(1, 1); await wb.SetSourceAsync(savedPictureStream); using (var storageStream = await result.Files.FirstOrDefault().OpenAsync(FileAccessMode.Read)) { var encoder = await BitmapEncoder.CreateAsync(BitmapEncoder.JpegEncoderId, storageStream); var pixelStream = wb.PixelBuffer.AsStream(); var pixels = new byte[pixelStream.Length]; await pixelStream.ReadAsync(pixels, 0, pixels.Length); encoder.SetPixelData(BitmapPixelFormat.Bgra8, BitmapAlphaMode.Ignore, (uint)wb.PixelWidth, (uint)wb.PixelHeight, 48, 48, pixels); await encoder.FlushAsync(); } m_NewStorageFile = result.Files.FirstOrDefault(); //TSGServiceManager.uploadFile(strURL, dictHeader, result.Files.FirstOrDefault()); var thumb = await LoadVideoImageThumb(result.Files.FirstOrDefault()); //var thumb = new BitmapImage(); //var tt = await result.Files.FirstOrDefault().GetThumbnailAsync(Windows.Storage.FileProperties.ThumbnailMode.MusicView, 200, ThumbnailOptions.UseCurrentScale); //thumb.SetSource(tt); imgUpload.Source = thumb; imgTemp.Source = wb; } } catch (Exception ex) { strEx = ex.ToString(); } if (!string.IsNullOrEmpty(strEx)) { MessageDialog msg = new MessageDialog(strEx); await msg.ShowAsync(); } }
protected override void OnActivated(Windows.ApplicationModel.Activation.IActivatedEventArgs args) { if (args.Kind == ActivationKind.WebAccountProvider) { Trace.Log("Activated with WebAccountProvider request"); var e = args as WebAccountProviderActivatedEventArgs; Trace.Log(string.Format("Activation Type = {0}", e.GetType().ToString())); OnWebAccountProvider(e); } }
/// <summary> /// Invoked when the application is activated by some means other than normal launching. /// </summary> protected override void OnActivated(Windows.ApplicationModel.Activation.IActivatedEventArgs e) { var preActivationContent = Window.Current.Content; base.OnActivated(e); if (preActivationContent == null && Window.Current != null) { // Display the initial content var frame = (Frame)Window.Current.Content; frame.Navigate(typeof(MainPage), null); } }
protected override void OnActivated(Windows.ApplicationModel.Activation.IActivatedEventArgs args) { if (args.Kind == ActivationKind.ContactPicker) { var page = new MainPagePicker(); page.Activate((ContactPickerActivatedEventArgs)args); } else { base.OnActivated(args); } }
private async void activation(Windows.ApplicationModel.Activation.IActivatedEventArgs obj) { (Application.Current as App).Activation -= activation; var ea = obj as FolderPickerContinuationEventArgs; var files = enumerateFiles(ea.Folder); foreach (var file in files) { test(new StreamReader((await file.OpenReadAsync()).AsStream(0)).ReadToEnd()); } }
void Current_ContractActivated(object sender, Windows.ApplicationModel.Activation.IActivatedEventArgs e) { var filePickerContinuationArgs = e as FileOpenPickerContinuationEventArgs; if (filePickerContinuationArgs != null) { var files = filePickerContinuationArgs.Files; if (files != null) { AddFilesToBookList(files); } } }
protected override void OnActivated(Windows.ApplicationModel.Activation.IActivatedEventArgs e) { if (e.Kind == ActivationKind.Protocol) { ProtocolActivatedEventArgs protocolArgs = (ProtocolActivatedEventArgs)e; Uri uri = protocolArgs.Uri; if (uri.Scheme == "xamlesheep") { Frame rootFrame = new Frame(); Window.Current.Content = rootFrame; rootFrame.Navigate(typeof(MainPage), uri.Host); Window.Current.Activate(); } } }
/// <inheritdoc/> protected override void OnActivated(Windows.ApplicationModel.Activation.IActivatedEventArgs args) { if (args is ILaunchActivatedEventArgs launch) { UwpDispatcher.Activated = true; ActivateApp(new LaunchActivatedEventArgs(launch.Arguments)); } else if (args is IFileActivatedEventArgs fileArgs) { UwpDispatcher.Activated = true; ActivateApp(new StorageActivatedEventArgs(fileArgs.Files.FirstOrDefault().ToMvvm())); } else { Debug.WriteLine($"Unsupported activation type {args?.GetType().Name}."); } }
private void SoruDetay_Activated(CoreApplicationView sender, Windows.ApplicationModel.Activation.IActivatedEventArgs args) { #if WINDOWS_PHONE_APP FileOpenPickerContinuationEventArgs param = args as FileOpenPickerContinuationEventArgs; if (param != null) { if (param.Files.Count == 0) { return; } view.Activated -= SoruDetay_Activated; if (type == 1) { resimfile1 = param.Files[0]; } } #endif }
private void OnActivated(CoreApplicationView sender, Windows.ApplicationModel.Activation.IActivatedEventArgs args) { if (args.Kind == ActivationKind.Launch) { var launchArgs = (LaunchActivatedEventArgs)args; if (launchArgs.PrelaunchActivated) { CoreApplication.Exit(); return; } } int w, h; w = this.Game.GetDefaultWidth(); h = this.Game.GetDefaultHeight(); this.DPI = DisplayInformation.GetForCurrentView().LogicalDpi; ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize; var desiredSize = new Size(ConvertPixelsToDips(w), ConvertPixelsToDips(h)); ApplicationView.PreferredLaunchViewSize = desiredSize; var view = ApplicationView.GetForCurrentView(); var minSize = new Size(ConvertPixelsToDips(320), ConvertPixelsToDips(200)); view.SetPreferredMinSize(minSize); CoreWindow.GetForCurrentThread().Activate(); view.FullScreenSystemOverlayMode = FullScreenSystemOverlayMode.Standard; view.TryResizeView(desiredSize); }