コード例 #1
0
        private void AdminOptionsButton_Click(object sender, RoutedEventArgs e)
        {
            AdminLoginWindow adminAccess = _viewmodel.AdminOptions();

            adminAccess.Owner = this;
            adminAccess.ShowDialog();
        }
コード例 #2
0
        private void LoadOnlineApps()
        {
            string key = getKey(this.typeId, this.subTypeId, this.pageIndex);

            if (this.appItemOnlineDictionary.ContainsKey(key))
            {
                if (this.appItemOnlineDictionary[key].Count != 0)
                {
                    lock (this.appCollectionLocker)
                    {
                        this.appCollection.Clear();
                        this.appCollection.AddRange(this.appItemOnlineDictionary[key]);
                    }

                    this.FilterApps();

                    return;
                }
            }

            if (this.loadOnlineApps)
            {
                return;
            }

#if DEBUG
            if (TypeItem.NotApproved == this.typeId)
            {
                AdminLoginWindow adminLoginWindow = new AdminLoginWindow();
                if (!adminLoginWindow.ShowDialog().Value)
                {
                    return;
                }
            }
#endif

            this.loadOnlineApps = true;

            BackgroundWorker worker = new BackgroundWorker();
            worker.WorkerSupportsCancellation = true;
            worker.WorkerReportsProgress      = true;
            worker.DoWork             += new DoWorkEventHandler(worker_DoWork);
            worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(worker_RunWorkerCompleted);
            worker.RunWorkerAsync();

            this.loadingAnimationCtrl.Visibility    = System.Windows.Visibility.Visible;
            this.loadGadgetInfoTextBlock.Visibility = System.Windows.Visibility.Hidden;
        }