コード例 #1
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            SetSizeTextBlockText(_size);

            if (_taskResult != null)
            {
                if (_taskResult.TaskResult == Microsoft.Phone.Tasks.TaskResult.OK)
                {
                    System.Diagnostics.Debug.WriteLine("Code read successfully");

                    var byteCount = _taskResult.Data != null ? _taskResult.Data.Length : 0;

                    TypeTextBlock.Text = String.Format("{0} ({1} bytes)", _taskResult.Format, byteCount);
                    DescriptionTextBlock.Text = _taskResult.Text;
                    ThumbnailImage.Source = _taskResult.Thumbnail;
                }
                else
                {
                    System.Diagnostics.Debug.WriteLine("Code reading aborted");
                }

                _taskResult = null;
            }

            ResultStackPanel.Visibility = ThumbnailImage.Source != null ? Visibility.Visible : Visibility.Collapsed;
            GuideStackPanel.Visibility = ThumbnailImage.Source == null ? Visibility.Visible : Visibility.Collapsed;
        }
コード例 #2
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            SetSizeTextBlockText(_size);

            if (_taskResult != null)
            {
                if (_taskResult.TaskResult == Microsoft.Phone.Tasks.TaskResult.OK)
                {
                    System.Diagnostics.Debug.WriteLine("Code read successfully");

                    var byteCount = _taskResult.Data != null ? _taskResult.Data.Length : 0;

                    TypeTextBlock.Text        = String.Format("{0} ({1} bytes)", _taskResult.Format, byteCount);
                    DescriptionTextBlock.Text = _taskResult.Text;
                    ThumbnailImage.Source     = _taskResult.Thumbnail;
                }
                else
                {
                    System.Diagnostics.Debug.WriteLine("Code reading aborted");
                }

                _taskResult = null;
            }

            ResultStackPanel.Visibility = ThumbnailImage.Source != null ? Visibility.Visible : Visibility.Collapsed;
            GuideStackPanel.Visibility  = ThumbnailImage.Source == null ? Visibility.Visible : Visibility.Collapsed;
        }
コード例 #3
0
ファイル: MainPage.xaml.cs プロジェクト: Tippr-app/scanner
 private void OpticalReaderTask_Completed(object sender, OpticalReaderLib.OpticalReaderResult e)
 {
     _taskResult = e;
     if (_taskResult.Text != null)
     {
         String thing = _taskResult.Text;
         System.Windows.MessageBox.Show(thing);
     }
 }
コード例 #4
0
        // Constructor
        public AddNewGame()
        {
            InitializeComponent();

            CreateOpticalReaderTask_Singleton();
            CreateHttpClient_Singleton();

            _opReadResult = null;

            _opReadTask.Completed += OpticalReaderTask_Completed;

            _opButtonContext     = false;
            addGameButtonContext = false;

            // Set the data context of the listbox control to the sample data
            DataContext = App.ViewModel;

            pickBackgroundColor();

            BuildLocalizedApplicationBar();
        }
コード例 #5
0
        // Load data for the ViewModel Items
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            if (!App.ViewModel.IsDataLoaded)
            {
                App.ViewModel.LoadData();
            }

            base.OnNavigatedTo(e);

            if (_opReadResult != null && _opReadResult.TaskResult == Microsoft.Phone.Tasks.TaskResult.OK)
            {
                SetProgressIndicator(true, ProgressStatus.Searching);
                await FetchHTMLdata();

                SetProgressIndicator(false, ProgressStatus.Searching);
            }

            _opReadResult        = null;
            _opButtonContext     = false;
            addGameButtonContext = false;
        }
コード例 #6
0
ファイル: MainPage.xaml.cs プロジェクト: Tippr-app/scanner
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);



            if (_taskResult != null)
            {
                if (_taskResult.TaskResult == Microsoft.Phone.Tasks.TaskResult.OK)
                {
                    System.Diagnostics.Debug.WriteLine("Code read successfully");

                    var byteCount = _taskResult.Data != null ? _taskResult.Data.Length : 0;
                }
                else
                {
                    System.Diagnostics.Debug.WriteLine("Code reading aborted");
                }

                _taskResult = null;
            }

            ReadCodeButton_Click();
        }
コード例 #7
0
 private void OpticalReaderTask_Completed(object sender, OpticalReaderLib.OpticalReaderResult e)
 {
     _taskResult = e;
 }
コード例 #8
0
ファイル: MainPage.xaml.cs プロジェクト: zhangzq71/AutoMgr
        void _task_Completed(object sender, OpticalReaderLib.OpticalReaderResult e)
        {
            _taskResult = e;

            System.Diagnostics.Debug.WriteLine(e.Text);
        }
コード例 #9
0
 private void OpticalReaderTask_Completed(object sender, OpticalReaderLib.OpticalReaderResult e)
 {
     _opReadResult = e;
 }