private async void SdkOnPublishCompleted(object sender, GenericSdkEventArgs <string> e) { if (e.Error == null) { await this.Dispatcher.RunAsync( CoreDispatcherPriority.Normal, () => { this.linkPopup.IsOpen = true; this.linkPopup.HorizontalOffset = Window.Current.CoreWindow.Bounds.Right / 2 - this.linkPanel.Width / 2; this.linkPopup.VerticalOffset = Window.Current.CoreWindow.Bounds.Bottom / 2 - this.linkPanel.Height / 2; this.txtLink.Text = e.Result; var package = new DataPackage(); package.SetText(e.Result); Clipboard.SetContent(package); }); this.InitFolder(this.currentPath); } else { this.ProcessError(e.Error); } this.ChangeVisibilityOfProgressBar(Visibility.Collapsed); }
private void SdkOnPublishCompleted(object sender, GenericSdkEventArgs<string> e) { if (e.Error == null) { this.Dispatcher.BeginInvoke( new Action( () => { //this.popupLink.IsOpen = true; if (e.Result == null || e.Result == "") tblLink.Text = "Ошибка поиска папки!"; else { tblLink.Text = "Ссылка на папку скопирована в буфер обмена"; Clipboard.SetText(e.Result); } })); //this.InitFolder(this.currentPath); } else { //this.ProcessError(e.Error); } this.ChangeVisibilityOfProgressBar(Visibility.Collapsed); }
/// <summary> /// Occurs when browser is navigating to the url. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The event argument.</param> private static void BrowserOnNavigating(object sender, GenericSdkEventArgs <string> e) { if (e.Result.Contains(retUrl)) { var token = ResponseParser.ParseToken(e.Result); completeHandler.SafeInvoke(sender, new GenericSdkEventArgs <string>(token)); } }
private void CompleteCallback(object sender, GenericSdkEventArgs <string> e) { if (this.AuthCompleted != null) { this.AuthCompleted(this, new GenericSdkEventArgs <string>(e.Result)); } this.Close(); }
private void SdkOnGetListCompleted(object sender, GenericSdkEventArgs <IEnumerable <DiskItemInfo> > e) //event handler { if (e.Error == null) { this.Dispatcher.BeginInvoke(new Action(() => { this.FolderItems = new List <DiskItemInfo>(e.Result); })); } else { this.ProcessError(e.Error); } }
private void SdkOnGetListCompleted(object sender, GenericSdkEventArgs <IEnumerable <DiskItemInfo> > e) { if (e.Error == null) { this.Dispatcher.BeginInvoke(new Action(() => { this.FolderItems = new ObservableCollection <DiskItemInfo>(e.Result); })); } else { this.ProcessError(e.Error); } this.ChangeVisibilityOfProgressBar(Visibility.Collapsed); }
public void SdkOnAuthorizeCompleted(object sender, GenericSdkEventArgs <string> e) { if (e.Error == null) { AccessToken = e.Result; this.Dispatcher.BeginInvoke(() => { this.InitFolder("/"); this.ChangeAppBar(AppState.Disk); }); } else { this.ProcessError(e.Error); } }
private void CompleteCallback(object sender, GenericSdkEventArgs <string> e) { _authCompleted = true; Browser.Visibility = Visibility.Hidden; BusyIndicator.BusyContent = LocalizedStrings.Str1574; BusyIndicator.IsBusy = true; Task.Factory .StartNew(() => AuthCompleted.SafeInvoke(this, new GenericSdkEventArgs <string>(e.Result))) .ContinueWith(res => { BusyIndicator.IsBusy = false; Close(); }, TaskScheduler.FromCurrentSynchronizationContext()); }
private void CompleteCallback(object sender, GenericSdkEventArgs<string> e) { _authCompleted = true; Browser.Visibility = Visibility.Hidden; BusyIndicator.BusyContent = LocalizedStrings.Str1574; BusyIndicator.IsBusy = true; Task.Factory .StartNew(() => AuthCompleted.SafeInvoke(this, new GenericSdkEventArgs<string>(e.Result))) .ContinueWith(res => { BusyIndicator.IsBusy = false; Close(); }, TaskScheduler.FromCurrentSynchronizationContext()); }
private void SdkOnAuthorizeCompleted(object sender, GenericSdkEventArgs <string> e) { if (e.Error == null) { AccessToken = e.Result; this.CreateSdkClient(); this.Dispatcher.BeginInvoke(new Action(() => { this.OnPropertyChanged("IsLoggedIn"); this.OnPropertyChanged("IsLoggedOut"); this.InitFolder("/"); })); } else { this.ProcessError(e.Error); } }
private async void SdkOnGetListCompleted(object sender, GenericSdkEventArgs <IEnumerable <DiskItemInfo> > e) { if (e.Error == null) { await this.Dispatcher.RunAsync( CoreDispatcherPriority.Normal, () => { this.Items = new ObservableCollection <DiskItemInfo>(e.Result); this.NotifyMenuItems(); }); } else { this.ProcessError(e.Error); } this.ChangeVisibilityOfProgressBar(Visibility.Collapsed); }
private void SdkOnPublishCompleted(object sender, GenericSdkEventArgs <string> e) { if (e.Error == null) { this.Dispatcher.BeginInvoke(() => { this.linkPopup.IsOpen = true; this.linkPopup.HorizontalOffset = (Application.Current.Host.Content.ActualWidth - this.linkPanel.Width) / 2; this.linkPopup.VerticalOffset = (Application.Current.Host.Content.ActualHeight - this.linkPanel.Height) / 2; this.txtLink.Text = e.Result; Clipboard.SetText(e.Result); }); } else { this.ProcessError(e.Error); } this.ChangeVisibilityOfProgressBar(Visibility.Collapsed); }
private void SdkOnPublishCompleted(object sender, GenericSdkEventArgs <string> e) { if (e.Error == null) { this.Dispatcher.BeginInvoke( new Action( () => { this.popupLink.IsOpen = true; this.txtLink.Text = e.Result; Clipboard.SetText(e.Result); })); this.InitFolder(this.currentPath); } else { this.ProcessError(e.Error); } this.ChangeVisibilityOfProgressBar(Visibility.Collapsed); }
private void CompleteCallback(object sender, GenericSdkEventArgs <string> e) { this.NavigationService.Navigate(new Uri("/MainPage.xaml?token=" + e.Result, UriKind.Relative)); }