Esempio n. 1
0
        private void CreateButton_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            ITwitterService srv = ServiceDispatcher.GetService(DataTransfer.CurrentAccount);
            TwitterListMode mode;

            if (PublicBtn.IsChecked == true)
            {
                mode = TwitterListMode.Public;
            }
            else
            {
                mode = TwitterListMode.Private;
            }
            Dispatcher.BeginInvoke(() => pBar.IsVisible = true);
            srv.CreateList(new CreateListOptions {
                ListOwner = DataTransfer.CurrentAccount.ScreenName, Name = ListName.Text, Description = ListDescp.Text, Mode = mode
            }, (list, response) =>
            {
                if (response.StatusCode == HttpStatusCode.OK)
                {
                    Dispatcher.BeginInvoke(() =>
                    {
                        MessageBox.Show(Localization.Resources.ListCreated);
                        NavigationService.GoBack();
                    });
                }
                else
                {
                    Dispatcher.BeginInvoke(() => MessageBox.Show(Localization.Resources.ErrorCreatingList));
                }

                Dispatcher.BeginInvoke(() => pBar.IsVisible = false);
            });
        }