Exemplo n.º 1
0
        private void ShowProgress(string text)
        {
            this.IsEnabled = false;

            if (progressIndicator == null)
            {
                progressIndicator = new ProgressIndicator();
                SystemTray.SetProgressIndicator(this, progressIndicator);
            }

            progressIndicator.Text            = text;
            progressIndicator.IsIndeterminate = true;
            progressIndicator.IsVisible       = true;
        }
Exemplo n.º 2
0
        private async void LoginButtonClick(object sender, RoutedEventArgs e)
        {
            if (NetworkInterface.NetworkInterfaceType != NetworkInterfaceType.None)
            {
                if (UserNameTextBox.Text != "" && PasswordTextBox.Password != "")
                {
                    ProgressIndicator progress = new ProgressIndicator
                    {
                        IsVisible       = true,
                        IsIndeterminate = true,
                        Text            = "登陆中..."
                    };
                    SystemTray.SetProgressIndicator(this, progress);

                    IEnumerable <User> list = await userTable.ReadAsync();

                    List <User> userList = list.ToList();

                    Boolean isMatch = false;

                    foreach (User user in userList)
                    {
                        if (user.UserId.Equals(UserNameTextBox.Text))
                        {
                            if (user.Password.Equals(PasswordTextBox.Password))
                            {
                                phoneAppServeice.State["username"] = UserNameTextBox.Text;
                                NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
                                isMatch = true;
                            }
                        }
                    }

                    if (!isMatch)
                    {
                        MessageBox.Show("用户名或者密码错误,请您检查后重新输入!");
                    }
                }
                else
                {
                    MessageBox.Show("请完整输入用户名以及密码!");
                }
            }
            else
            {
                Debug.WriteLine("[DEBUG]Network Interface Available Status:" + NetworkInterface.GetIsNetworkAvailable());
                Debug.WriteLine("[DEBUG]Network Interface Type Status:" + NetworkInterface.NetworkInterfaceType);
                MessageBox.Show("登陆需要网络连接,请开启手机的移动网络。");
            }
        }
Exemplo n.º 3
0
        private void CurrentViewModel_LongLoadingStartEvent(object sender, SimpleMvvmToolkit.NotificationEventArgs e)
        {
            systemTrayVisibleBck       = SystemTray.IsVisible;
            SystemTray.Opacity         = 0.3;
            SystemTray.BackgroundColor = Colors.Transparent;
            SystemTray.SetIsVisible(this, true);

            ProgressIndicator prog = new ProgressIndicator();

            prog.IsVisible       = true;
            prog.IsIndeterminate = true;
            prog.Text            = AppResources.LoadingIndicator;
            SystemTray.SetProgressIndicator(this, prog);
        }
Exemplo n.º 4
0
        private void IndicateUpdateAvailable()
        {
            ProgressIndicator prog = new ProgressIndicator {
                Text = AppResources.MainTopOutOfDate, IsVisible = true
            };

            SystemTray.SetProgressIndicator(this, prog);

            updateMenuIcon.IsEnabled = true;
            if (!ApplicationBar.Buttons.Contains(updateMenuIcon))
            {
                ApplicationBar.Buttons.Add(updateMenuIcon);
            }
        }
Exemplo n.º 5
0
        private void GirisYap()
        {
            try
            {
                ProgressIndicator indicator = new ProgressIndicator();
                indicator.IsIndeterminate = true;
                indicator.IsVisible       = true;
                indicator.Text            = "Bilgiler yükleniyor..";
                SystemTray.SetProgressIndicator(this, indicator);
                switch (Data._Sirket.Adi)
                {
                case "Aras Kargo":
                    Dispatcher.BeginInvoke(() => ArasKargo.TakipGetir(Dispatcher, TakipDetay, Data._TakipKodu));
                    break;

                case "DHL Kargo":
                    Dispatcher.BeginInvoke(() => DHLKargo.TakipGetir(Dispatcher, TakipDetay, Data._TakipKodu));
                    break;

                case "MNG Kargo":
                    Dispatcher.BeginInvoke(() => MNGKargo.TakipGetir(Dispatcher, TakipDetay, Data._TakipKodu));
                    break;

                case "PTT Kargo":
                    Dispatcher.BeginInvoke(() => PTTKargo.TakipGetir(Dispatcher, TakipDetay, Data._TakipKodu));
                    break;

                case "Sürat Kargo":
                    Dispatcher.BeginInvoke(() => SuratKargo.TakipGetir(Dispatcher, TakipDetay, Data._TakipKodu));
                    break;

                case "UPS Kargo":
                    Dispatcher.BeginInvoke(() => UPSKargo.TakipGetir(Dispatcher, TakipDetay, Data._TakipKodu));
                    break;

                case "Yurtiçi Kargo":
                    Dispatcher.BeginInvoke(() => YurticiKargo.TakipGetir(Dispatcher, TakipDetay, Data._TakipKodu));
                    break;

                default:
                    break;
                }
                Sirketler.Visibility = Visibility.Collapsed;
            }
            catch (Exception)
            {
                MessageBox.Show("Bir sorun oluştu!\nTekrar deneyiniz..");
            }
        }
Exemplo n.º 6
0
        public async Task Save()
        {
            if (SelectedIndex >= 0 && SelectedIndex < ImagePosts.Count)
            {
                bool cantSave = false;

                Models.API.APIPost.FileTypes fileType = (ImagePosts[SelectedIndex] as ImageViewerPostViewModel).FileType;
                if (fileType == Models.API.APIPost.FileTypes.webm || fileType == Models.API.APIPost.FileTypes.swf || fileType == Models.API.APIPost.FileTypes.gif)
                {
                    cantSave = true;
                }

                ProgressIndicator progress = new ProgressIndicator
                {
                    IsVisible       = true,
                    IsIndeterminate = true,
                    Text            = cantSave ? AppResources.ImageViewerPage_CantSave : AppResources.ImageViewerPage_SavingImage
                };

                PhoneApplicationPage page = (App.Current.RootVisual as PhoneApplicationFrame).Content as PhoneApplicationPage;

                SystemTray.SetOpacity(page, 0.99);
                SystemTray.SetIsVisible(page, true);
                SystemTray.SetProgressIndicator(page, progress);

                if (cantSave)
                {
                    await Task.Delay(1000);
                }
                else
                {
                    bool result = await SaveInternal(ImagePosts[SelectedIndex] as ImageViewerPostViewModel);

                    if (result)
                    {
                        progress.Text = AppResources.ImageViewerPage_ImageSaved;
                        await Task.Delay(400);
                    }
                    else
                    {
                        progress.Text = AppResources.ImageViewerPage_ImageFailed;
                        await Task.Delay(1000);
                    }
                }

                SystemTray.SetProgressIndicator(page, null);
                SystemTray.SetIsVisible(page, false);
            }
        }
Exemplo n.º 7
0
        public void Attach()
        {
            if (DesignerProperties.IsInDesignTool)
            {
                return;
            }

            var page = this.GetVisualAncestors <PhoneApplicationPage>().First();

            var progressIndicator = SystemTray.ProgressIndicator;

            if (progressIndicator != null)
            {
                return;
            }

            progressIndicator = new ProgressIndicator();

            SystemTray.SetProgressIndicator(page, progressIndicator);

            Binding binding = new Binding("IsIndeterminate")
            {
                Source = this
            };

            BindingOperations.SetBinding(
                progressIndicator, ProgressIndicator.IsIndeterminateProperty, binding);

            binding = new Binding("IsVisible")
            {
                Source = this
            };
            BindingOperations.SetBinding(
                progressIndicator, ProgressIndicator.IsVisibleProperty, binding);

            binding = new Binding("Text")
            {
                Source = this
            };
            BindingOperations.SetBinding(
                progressIndicator, ProgressIndicator.TextProperty, binding);

            binding = new Binding("Value")
            {
                Source = this
            };
            BindingOperations.SetBinding(
                progressIndicator, ProgressIndicator.ValueProperty, binding);
        }
Exemplo n.º 8
0
        private void ToggleFavourite(object sender, EventArgs e)
        {
            Debug.Assert(set != null, "group != null");

            SystemTray.SetProgressIndicator(this, new ProgressIndicator {
                IsIndeterminate = true,
                IsVisible       = true,
                Text            = set.Starred ? "Removing from favourites..." : "Adding to favourites..."
            });

            set.SetStarred(
                !set.Starred,
                () => SystemTray.SetProgressIndicator(this, null),                 // The binding will update the UI.
                err => { });
        }
Exemplo n.º 9
0
 private void StartPendingState(string status)
 {
     _isInPendingState         = true;
     PendingOverlay.Visibility = Visibility.Visible;
     ((ApplicationBarIconButton)ApplicationBar.Buttons[0]).IsEnabled = false;
     ((ApplicationBarIconButton)ApplicationBar.Buttons[1]).IsEnabled = false;
     ((ApplicationBarIconButton)ApplicationBar.Buttons[2]).IsEnabled = false;
     ApplicationBar.IsMenuEnabled = false;
     SystemTray.SetProgressIndicator(this, new ProgressIndicator
     {
         IsVisible       = true,
         IsIndeterminate = true,
         Text            = status
     });
 }
Exemplo n.º 10
0
        public backup()
        {
            InitializeComponent();
            fioInstance          = Filepicker_io.GetInstance();
            heroku               = new Heroku();
            BackupWorker         = new BackgroundWorker();
            BackupWorker.DoWork += new DoWorkEventHandler(BackupWorker_DoWork);
            //BackupWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(BackupWorker_RunWorkerCompleted);

            DataLoader                     = new BackgroundWorker();
            DataLoader.DoWork             += new DoWorkEventHandler(DataLoader_DoWork);
            DataLoader.RunWorkerCompleted += new RunWorkerCompletedEventHandler(DataLoader_RunWorkerCompleted);
            pgIndicator                    = new ProgressIndicator();
            SystemTray.SetProgressIndicator(this, pgIndicator);
        }
Exemplo n.º 11
0
 public MainPage()
 {
     InitializeComponent();
     IsolatedStorageSettings.ApplicationSettings["session_data"] = 0L;
     IsolatedStorageSettings.ApplicationSettings.Save();
     Loaded       += new RoutedEventHandler(MainPage_Loaded);
     loginbtn      = (ApplicationBarIconButton)ApplicationBar.Buttons[0];
     progindicator = new ProgressIndicator();
     SystemTray.SetProgressIndicator(this, progindicator);
     if (Network.IsConnected())
     {
         auth = new Authentication();
         auth.NewTokenReceived += new TokenReceivedEventHandler(auth_NewTokenReceived);
     }
 }
Exemplo n.º 12
0
        protected void ListaUsuarios(String id)
        {
            progress.IsVisible       = true;
            progress.IsIndeterminate = true;
            progress.Text            = "Atualizando Usuários...";

            SystemTray.SetProgressIndicator(this, progress);

            string url = "http://srvwebservice.herokuapp.com/api/v1/usuarios_por_jogo/" + id;

            WebClient client = new WebClient();

            client.OpenReadCompleted += Client_OpenReadCompleted;
            client.OpenReadAsync(new Uri(url, UriKind.Absolute));
        }
        public book_tickets()
        {
            InitializeComponent();
            _progressIndicator = new ProgressIndicator();
            _progressIndicator.IsIndeterminate = true;
            _progressIndicator.IsVisible       = false;
            SystemTray.SetProgressIndicator(this, _progressIndicator);

            // Event handler for the hardware back key
            BackKeyPress += aptz_BackKeyPress;

            // Fast app resume events
            PhoneApplicationService.Current.Deactivated += Current_Deactivated;
            PhoneApplicationService.Current.Closing     += Current_Closing;
        }
Exemplo n.º 14
0
        public ConfigPage()
        {
            InitializeComponent();

            ProgressIndicator indicator = new ProgressIndicator()
            {
                IsVisible       = false,
                IsIndeterminate = true,
                Text            = "正在联系服务器"
            };

            SystemTray.SetProgressIndicator(this, indicator);

            this.Loaded += ConfigPage_Loaded;
        }
Exemplo n.º 15
0
        public ImportTracks()
        {
            InitializeComponent();

            _fileIO        = new FileIO();
            _serializer    = new Serializer();
            _miscFunctions = new MiscFunctions();
            SystemTray.SetIsVisible(this, true);
            _prog = new ProgressIndicator();
            SystemTray.SetProgressIndicator(this, _prog);

            Routes = new ObservableCollection <ExternalStorageFile>();
            GetUserFolder();
            DataContext = this;
        }
Exemplo n.º 16
0
 // Constructor
 public MainPage()
 {
     InitializeComponent();
     Settings = IsolatedStorageSettings.ApplicationSettings;
     intro.checkconexion();
     prog = new ProgressIndicator();
     prog.IsIndeterminate = true;
     prog.IsVisible       = false;
     SystemTray.SetProgressIndicator(this, prog);
     vm      = new ViewModelPinchos();
     vperfil = new ViewModelProfilePreferences();
     _watcher.PositionChanged += Watcher_PositionChanged;
     iniciamapa();
     peticionperfil();
 }
Exemplo n.º 17
0
        private void SetLoadingEpisodeListVisibility(bool isVisible)
        {
            if (isVisible)
            {
                loadingLabel_List.Visibility            = Visibility.Visible;
                loadingProgressBar_List.IsIndeterminate = true;
            }
            else
            {
                loadingLabel_List.Visibility            = Visibility.Collapsed;
                loadingProgressBar_List.IsIndeterminate = false;

                SystemTray.SetProgressIndicator(this, null);
            }
        }
Exemplo n.º 18
0
        private void SubmitPassword(object sender, EventArgs e)
        {
            SystemTray.SetProgressIndicator(this, new ProgressIndicator {
                IsIndeterminate = true,
                IsVisible       = true,
            });

            set.SubmitPassword(
                password.Password,
                () => NavigationService.GoBack(),
                err => {
                SystemTray.SetProgressIndicator(this, null);
                MessageBox.Show(err.Message);
            });
        }
Exemplo n.º 19
0
        public void hide(string options)
        {
            if (progressIndicator != null && page != null)
            {
                Deployment.Current.Dispatcher.BeginInvoke(() =>
                {
                    if (!sysTrayVisible)
                    {
                        SystemTray.IsVisible = false;
                    }

                    SystemTray.SetProgressIndicator(page, null);
                    page.MouseLeftButtonUp -= ButtonEventHandler;
                });
            }
        }
Exemplo n.º 20
0
        public LoginPage()
        {
            InitializeComponent();
            TestUserBtn.Visibility = Visibility.Collapsed;
#if DEBUG
            TestUserBtn.Visibility = Visibility.Visible;
#endif
            App.FeedLastRefreshed = DateTime.MinValue;
            progress = new ProgressIndicator
            {
                IsVisible       = false,
                IsIndeterminate = false,
            };

            SystemTray.SetProgressIndicator(this, progress);
        }
Exemplo n.º 21
0
        private void GetMainPage()
        {
            ProgressIndicator pi = new ProgressIndicator();

            pi.Text            = "正在获取首页信息";
            pi.IsIndeterminate = true;
            pi.IsVisible       = true;
            SystemTray.SetProgressIndicator(this, pi);

            string url = "http://zh.moegirl.org/Mainpage";

            Debug.WriteLine(url);
            HttpWebRequest hwr = (HttpWebRequest)WebRequest.Create(new Uri(url));

            hwr.BeginGetResponse(GetMainPageCallback, hwr);
        }
Exemplo n.º 22
0
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            SystemTray.SetProgressIndicator(this, progressIndicator);

            // Set the data context of the listbox control to the sample data

            FavoriteItems = new ObservableCollection <BikeStopViewModel>();
            FavoriteListView.ItemsSource = FavoriteItems;

            NearItems            = new ObservableCollection <BikeStopViewModel>();
            NearList.ItemsSource = NearItems;

            BuildLocalizedApplicationBar(0);
        }
Exemplo n.º 23
0
        public static ProgressIndicator ShowLoading(PhoneApplicationPage page)
        {
            var indicator = new ProgressIndicator
            {
                IsVisible       = true,
                IsIndeterminate = true,
                Text            = "Loading..."
            };

            if (page != null)
            {
                SystemTray.SetProgressIndicator(page, indicator);
            }

            return(indicator);
        }
Exemplo n.º 24
0
        void bitmapImage_DownloadProgress(object sender, System.Windows.Media.Imaging.DownloadProgressEventArgs e)
        {
            try
            {
                SystemTray.IsVisible = true;

                SystemTray.SetProgressIndicator(imageViewer, new ProgressIndicator()
                {
                    IsIndeterminate = true, Text = "Loading the Picture", Value = e.Progress
                });
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 25
0
        protected ProgressIndicator AddIndicator()
        {
            if (_indicator == null)
            {
                _indicator = new ProgressIndicator
                {
                    IsVisible       = false,
                    IsIndeterminate = true,
                    Text            = Strings.Loading,
                };

                SystemTray.SetProgressIndicator(this, _indicator);
            }

            return(_indicator);
        }
Exemplo n.º 26
0
        public BooksPage()
        {
            InitializeComponent();

            Application.Current.Host.Settings.EnableFrameRateCounter = false;

            // Init progress indicator
            ProgressIndicator progressIndicator = new ProgressIndicator();

            progressIndicator.IsVisible       = false;
            progressIndicator.IsIndeterminate = true;
            progressIndicator.Text            = "...";
            SystemTray.SetProgressIndicator(this, progressIndicator);

            this.buildFileList();
        }
Exemplo n.º 27
0
        public void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            var progressIndicator = SystemTray.ProgressIndicator;

            if (progressIndicator != null)
            {
                return;
            }

            progressIndicatorRef = new ProgressIndicator();

            SystemTray.SetProgressIndicator(this, progressIndicatorRef);
            progressIndicatorRef.Text = "Carregando...";

            updatePanoramaPage(0);
        }
Exemplo n.º 28
0
        /// <summary>
        /// Clicking on the save button saves the photo in MainPage.ImageStream
        /// to media library camera roll. Once image has been saved, the
        /// application will navigate back to the main page.
        /// </summary>
        private async void SaveButton_Click(object sender, EventArgs e)
        {
            _progressIndicator.Text      = AppResources.SavingText;
            _progressIndicator.IsVisible = true;
            SystemTray.SetProgressIndicator(this, _progressIndicator);
            int selectedIndex = FilterPreviewPivot.SelectedIndex;

            DataContext dataContext = FilterEffects.DataContext.Instance;

            GC.Collect();

            try
            {
                if (selectedIndex == 0)
                {
                    using (MediaLibrary library = new MediaLibrary())
                    {
                        dataContext.FullResolutionStream.Position = 0;
                        library.SavePictureToCameraRoll(FileNamePrefix
                                                        + DateTime.Now.ToString() + ".jpg",
                                                        dataContext.FullResolutionStream);
                    }
                }
                else
                {
                    AbstractFilter filter = _filters[selectedIndex];

                    IBuffer buffer = await filter.RenderJpegAsync(
                        dataContext.FullResolutionStream.GetWindowsRuntimeBuffer());

                    using (MediaLibrary library = new MediaLibrary())
                    {
                        library.SavePictureToCameraRoll(FileNamePrefix
                                                        + DateTime.Now.ToString() + ".jpg", buffer.AsStream());
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Failed to save the image: " + ex.ToString());
            }

            _progressIndicator.IsVisible = false;
            SystemTray.SetProgressIndicator(this, _progressIndicator);

            NavigationService.GoBack();
        }
Exemplo n.º 29
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            if (Data.Connection == null)
            {
                MessageBox.Show("Giriş yapmanız gerekiyor!");
                NavigationService.Navigate(new Uri("/LoginPage.xaml", UriKind.Relative));
            }
            else
            {
                if (NavigationContext.QueryString.ContainsKey("YearCode") && NavigationContext.QueryString.ContainsKey("No"))
                {
                    YearCode = Convert.ToInt32(NavigationContext.QueryString["YearCode"]);
                    No       = Convert.ToInt32(NavigationContext.QueryString["No"]);
                    Donem period = Data.Connection.Ogrenci.Donemler.SingleOrDefault(x => x.No == No && x.OgretimYiliKodu == YearCode);
                    Title.Text             = period.OgretimYili + " " + period.Adi;
                    LessonList.ItemsSource = period.Dersler;
                }
                else
                {
                    Donem period = Data.Connection.Ogrenci.Donemler.First();
                    YearCode = period.OgretimYiliKodu;
                    No       = period.No;
                    LessonList.ItemsSource = period.Dersler;

                    if (NetworkInterface.GetIsNetworkAvailable())
                    {
                        ProgressIndicator indicator = new ProgressIndicator();
                        indicator.IsIndeterminate = true;
                        indicator.IsVisible       = true;
                        try
                        {
                            indicator.Text = "Dersler güncelleniyor..";
                            Service1Client client = new Service1Client();
                            client.CurrentPeriodAsync(Data.Connection.OgrenciNo, Data.Connection.Sifre, "WP8");
                            client.CurrentPeriodCompleted += new EventHandler <CurrentPeriodCompletedEventArgs>(Completed);
                        }
                        catch (Exception)
                        {
                            indicator.Text = "Dersler yüklenemedi!";
                        }
                        SystemTray.SetProgressIndicator(this, indicator);
                    }
                }
            }
        }
Exemplo n.º 30
0
        public MainPage()
        {
            InitializeComponent();

            // Repository für Laden/Sync erzeugen
            repository = new NewsRepository();

            // ProgressIndicator erzeugen und anzeigen
            indicator                 = new ProgressIndicator();
            indicator.Text            = "Lade lokale Daten...";
            indicator.IsIndeterminate = true;
            indicator.IsVisible       = true;
            SystemTray.SetProgressIndicator(this, indicator);

            // Asynchrone Laden der lokalen Daten starten
            loadDataTask = repository.LoadLocalDataAsync();
        }