Beispiel #1
0
        private void LawListCT_DownloadProgressChanged_Callback(Law_DownloadItemViewModel lawItem)
        {
            Func <LawRow, bool>         func = null;
            _003C_003Ec__DisplayClass13 _003C_003Ec__DisplayClass = new _003C_003Ec__DisplayClass13();

            _003C_003Ec__DisplayClass.lawItem = lawItem;
            if (!base.Dispatcher.CheckAccess())
            {
                base.Dispatcher.BeginInvoke(new Action <Law_DownloadItemViewModel>(LawListCT_DownloadProgressChanged_Callback), _003C_003Ec__DisplayClass.lawItem);
                return;
            }
            IEnumerable <LawRow> source = Enumerable.OfType <LawRow>(LawRowSP.Children);

            if (func == null)
            {
                func = new Func <LawRow, bool>(_003C_003Ec__DisplayClass._003CLawListCT_DownloadProgressChanged_Callback_003Eb__11);
            }
            LawRow lawRow = Enumerable.FirstOrDefault(Enumerable.Where(source, func));

            if (lawRow != null)
            {
                lawRow.txtPercent.Text        = (int)_003C_003Ec__DisplayClass.lawItem.NowPercentage + " %";
                lawRow.pb.Value               = _003C_003Ec__DisplayClass.lawItem.NowPercentage;
                lawRow.btnDownload.Visibility = Visibility.Collapsed;
                lawRow.txtPercent.Visibility  = Visibility.Visible;
                lawRow.pb.Visibility          = Visibility.Visible;
            }
        }
Beispiel #2
0
        private void LawListCT_DownloadFileStart_Callback(Law_DownloadItemViewModel lawItem)
        {
            Func <LawRow, bool>        func = null;
            _003C_003Ec__DisplayClassb _003C_003Ec__DisplayClassb = new _003C_003Ec__DisplayClassb();

            _003C_003Ec__DisplayClassb.lawItem = lawItem;
            if (!base.Dispatcher.CheckAccess())
            {
                base.Dispatcher.BeginInvoke(new Action <Law_DownloadItemViewModel>(LawListCT_DownloadFileStart_Callback), _003C_003Ec__DisplayClassb.lawItem);
                return;
            }
            IEnumerable <LawRow> source = Enumerable.OfType <LawRow>(LawRowSP.Children);

            if (func == null)
            {
                func = new Func <LawRow, bool>(_003C_003Ec__DisplayClassb._003CLawListCT_DownloadFileStart_Callback_003Eb__9);
            }
            LawRow lawRow = Enumerable.FirstOrDefault(Enumerable.Where(source, func));

            if (lawRow != null)
            {
                lawRow.txtPercent.Text       = "0 %";
                lawRow.txtPercent.Foreground = Brushes.Black;
                lawRow.pb.Value      = 0.0;
                lawRow.pb.Foreground = Brushes.Orange;
                lawRow.pb.Background = Brushes.Black;
            }
        }
Beispiel #3
0
        private void LawListCT_UnZip_Callback(Law_DownloadItemViewModel lawItem)
        {
            Func <LawRow, bool>        func = null;
            _003C_003Ec__DisplayClass7 _003C_003Ec__DisplayClass = new _003C_003Ec__DisplayClass7();

            _003C_003Ec__DisplayClass.lawItem = lawItem;
            if (!base.Dispatcher.CheckAccess())
            {
                base.Dispatcher.BeginInvoke(new Action <Law_DownloadItemViewModel>(LawListCT_UnZip_Callback), _003C_003Ec__DisplayClass.lawItem);
                return;
            }
            IEnumerable <LawRow> source = Enumerable.OfType <LawRow>(LawRowSP.Children);

            if (func == null)
            {
                func = new Func <LawRow, bool>(_003C_003Ec__DisplayClass._003CLawListCT_UnZip_Callback_003Eb__5);
            }
            LawRow lawRow = Enumerable.FirstOrDefault(Enumerable.Where(source, func));

            if (lawRow == null)
            {
                return;
            }
            if (_003C_003Ec__DisplayClass.lawItem.FileType == LawFileType.更新檔解壓縮中)
            {
                lawRow.txtUpdatePercent.Text       = "100 %";
                lawRow.pbUpdate.Value              = lawRow.pb.Maximum;
                lawRow.txtUpdatePercent.Visibility = Visibility.Collapsed;
                lawRow.pbUpdate.Visibility         = Visibility.Collapsed;
                Storyboard storyboard = (Storyboard)lawRow.TryFindResource("sbUpdate");
                if (storyboard != null)
                {
                    storyboard.Begin();
                }
            }
            else
            {
                lawRow.txtPercent.Text       = "100 %";
                lawRow.pb.Value              = lawRow.pb.Maximum;
                lawRow.txtPercent.Visibility = Visibility.Collapsed;
                lawRow.pb.Visibility         = Visibility.Collapsed;
                Storyboard storyboard = (Storyboard)lawRow.TryFindResource("sb");
                if (storyboard != null)
                {
                    storyboard.Begin();
                }
            }
        }
        private void LawListCT_UnZip_Callback(Law_DownloadItemViewModel lawItem)
        {
            //先判斷是否要invoke
            if (this.Dispatcher.CheckAccess() == false)
            {
                // 這裡是下載事件處理,優先權設定為ContextIdle => 列舉值為 3。 幕後作業完成後,會處理作業。
                //this.Dispatcher.BeginInvoke(DispatcherPriority.SystemIdle, new Action<Law_DownloadItemViewModel>(LawListCT_UnZip_Callback), lawItem);
                this.Dispatcher.BeginInvoke(new Action <Law_DownloadItemViewModel>(LawListCT_UnZip_Callback), lawItem);
            }
            else
            {
                LawRow lawRow = LawRowSP.Children.OfType <LawRow>().Where(x => x.lawDataLaw.ID.Equals(lawItem.ID)).FirstOrDefault();
                if (lawRow != null)
                {
                    Storyboard sb;
                    if (lawItem.FileType == LawFileType.更新檔解壓縮中)
                    {
                        //記得不要讓使用者開書
                        lawRow.txtUpdatePercent.Text       = "100 %";
                        lawRow.pbUpdate.Value              = lawRow.pb.Maximum;
                        lawRow.txtUpdatePercent.Visibility = Visibility.Collapsed;
                        lawRow.pbUpdate.Visibility         = Visibility.Collapsed;

                        sb = (Storyboard)lawRow.TryFindResource("sbUpdate");
                        if (sb != null)
                        {
                            sb.Begin();
                        }
                    }
                    else
                    {
                        lawRow.txtPercent.Text       = "100 %";
                        lawRow.pb.Value              = lawRow.pb.Maximum;
                        lawRow.txtPercent.Visibility = Visibility.Collapsed;
                        lawRow.pb.Visibility         = Visibility.Collapsed;

                        sb = (Storyboard)lawRow.TryFindResource("sb");
                        if (sb != null)
                        {
                            sb.Begin();
                        }
                    }
                }
            }
        }
Beispiel #5
0
        private void LawListCT_DownloadFileCompleted_Callback(Law_DownloadItemViewModel lawItem)
        {
            Func <LawRow, bool>        func = null;
            _003C_003Ec__DisplayClassf _003C_003Ec__DisplayClassf = new _003C_003Ec__DisplayClassf();

            _003C_003Ec__DisplayClassf.lawItem = lawItem;
            if (!base.Dispatcher.CheckAccess())
            {
                base.Dispatcher.BeginInvoke(new Action <Law_DownloadItemViewModel>(LawListCT_DownloadFileCompleted_Callback), _003C_003Ec__DisplayClassf.lawItem);
                return;
            }
            IEnumerable <LawRow> source = Enumerable.OfType <LawRow>(LawRowSP.Children);

            if (func == null)
            {
                func = new Func <LawRow, bool>(_003C_003Ec__DisplayClassf._003CLawListCT_DownloadFileCompleted_Callback_003Eb__d);
            }
            LawRow lawRow = Enumerable.FirstOrDefault(Enumerable.Where(source, func));

            if (lawRow == null)
            {
                return;
            }
            if (_003C_003Ec__DisplayClassf.lawItem.FileType == LawFileType.更新檔已下載完成)
            {
                Storyboard storyboard = (Storyboard)lawRow.TryFindResource("sb");
                if (storyboard != null)
                {
                    storyboard.Stop();
                }
                lawRow.txtIsNew.Visibility = Visibility.Visible;
                return;
            }
            Storyboard storyboard2 = (Storyboard)lawRow.TryFindResource("sb");

            if (storyboard2 != null)
            {
                storyboard2.Stop();
            }
            lawRow.btnDownload.Visibility = Visibility.Collapsed;
            lawRow.btnOpen.Visibility     = Visibility.Visible;
            lawRow.btnDelete.Visibility   = Visibility.Visible;
            lawRow.txtIsNew.Visibility    = Visibility.Visible;
        }
        private void LawListCT_UnZipError_Callback(Law_DownloadItemViewModel lawItem)
        {
            //先判斷是否要invoke
            if (this.Dispatcher.CheckAccess() == false)
            {
                // 這裡是下載事件處理,優先權設定為ContextIdle => 列舉值為 3。 幕後作業完成後,會處理作業。
                //this.Dispatcher.BeginInvoke(DispatcherPriority.SystemIdle,new Action<Law_DownloadItemViewModel>(LawListCT_UnZipError_Callback), lawItem);
                this.Dispatcher.BeginInvoke(new Action <Law_DownloadItemViewModel>(LawListCT_UnZipError_Callback), lawItem);
            }
            else
            {
                // 在Home的主視窗Show,不要在這裡Show
                //AutoClosingMessageBox.Show("解壓縮失敗");
                LawRow lawRow = LawRowSP.Children.OfType <LawRow>().Where(x => x.lawDataLaw.ID.Equals(lawItem.ID)).FirstOrDefault();
                if (lawRow != null)
                {
                    Storyboard sb;
                    if (lawItem.FileType == LawFileType.更新檔解壓縮失敗)
                    {
                        sb = (Storyboard)lawRow.TryFindResource("sbUpdate");
                        if (sb != null)
                        {
                            sb.Stop();
                        }

                        // 記得必須隱藏必須先做,才不會被看見
                        lawRow.btnUpdate.Visibility = Visibility.Visible;
                    }
                    else
                    {
                        sb = (Storyboard)lawRow.TryFindResource("sb");
                        if (sb != null)
                        {
                            sb.Stop();
                        }

                        // 記得必須隱藏必須先做,才不會被看見
                        lawRow.btnDownload.Visibility = Visibility.Visible;
                    }
                }
            }
        }
Beispiel #7
0
        private void LawListCT_UnZipError_Callback(Law_DownloadItemViewModel lawItem)
        {
            Func <LawRow, bool>        func = null;
            _003C_003Ec__DisplayClass3 _003C_003Ec__DisplayClass = new _003C_003Ec__DisplayClass3();

            _003C_003Ec__DisplayClass.lawItem = lawItem;
            if (!base.Dispatcher.CheckAccess())
            {
                base.Dispatcher.BeginInvoke(new Action <Law_DownloadItemViewModel>(LawListCT_UnZipError_Callback), _003C_003Ec__DisplayClass.lawItem);
                return;
            }
            IEnumerable <LawRow> source = Enumerable.OfType <LawRow>(LawRowSP.Children);

            if (func == null)
            {
                func = new Func <LawRow, bool>(_003C_003Ec__DisplayClass._003CLawListCT_UnZipError_Callback_003Eb__1);
            }
            LawRow lawRow = Enumerable.FirstOrDefault(Enumerable.Where(source, func));

            if (lawRow == null)
            {
                return;
            }
            if (_003C_003Ec__DisplayClass.lawItem.FileType == LawFileType.更新檔解壓縮失敗)
            {
                Storyboard storyboard = (Storyboard)lawRow.TryFindResource("sbUpdate");
                if (storyboard != null)
                {
                    storyboard.Stop();
                }
                lawRow.btnUpdate.Visibility = Visibility.Visible;
            }
            else
            {
                Storyboard storyboard = (Storyboard)lawRow.TryFindResource("sb");
                if (storyboard != null)
                {
                    storyboard.Stop();
                }
                lawRow.btnDownload.Visibility = Visibility.Visible;
            }
        }
        private void LawListCT_DownloadFileCompleted_Callback(Law_DownloadItemViewModel lawItem)
        {
            //先判斷是否要invoke
            if (this.Dispatcher.CheckAccess() == false)
            {
                // 這裡是下載事件處理,優先權設定為ContextIdle => 列舉值為 3。 幕後作業完成後,會處理作業。
                //this.Dispatcher.BeginInvoke(DispatcherPriority.SystemIdle, new Action<Law_DownloadItemViewModel>(LawListCT_DownloadFileCompleted_Callback), lawItem);
                this.Dispatcher.BeginInvoke(new Action <Law_DownloadItemViewModel>(LawListCT_DownloadFileCompleted_Callback), lawItem);
            }
            else
            {
                LawRow lawRow = LawRowSP.Children.OfType <LawRow>().Where(x => x.lawDataLaw.ID.Equals(lawItem.ID)).FirstOrDefault();

                if (lawRow != null)
                {
                    if (lawItem.FileType == LawFileType.更新檔已下載完成)
                    {
                        Storyboard sb = (Storyboard)lawRow.TryFindResource("sb");
                        if (sb != null)
                        {
                            sb.Stop();
                        }

                        lawRow.txtIsNew.Visibility = Visibility.Visible;
                    }
                    else
                    {
                        Storyboard sb = (Storyboard)lawRow.TryFindResource("sb");
                        if (sb != null)
                        {
                            sb.Stop();
                        }

                        lawRow.btnDownload.Visibility = Visibility.Collapsed;
                        lawRow.btnOpen.Visibility     = Visibility.Visible;
                        lawRow.btnDelete.Visibility   = Visibility.Visible;
                        lawRow.txtIsNew.Visibility    = Visibility.Visible;
                    }
                }
            }
        }
 private void LawListCT_DownloadProgressChanged_Callback(Law_DownloadItemViewModel lawItem)
 {
     //先判斷是否要invoke
     if (this.Dispatcher.CheckAccess() == false)
     {
         // 這裡是下載事件處理,優先權設定為ContextIdle => 列舉值為 3。 幕後作業完成後,會處理作業。
         //this.Dispatcher.BeginInvoke(DispatcherPriority.SystemIdle, new Action<Law_DownloadItemViewModel>(LawListCT_DownloadProgressChanged_Callback), lawItem);
         this.Dispatcher.BeginInvoke(new Action <Law_DownloadItemViewModel>(LawListCT_DownloadProgressChanged_Callback), lawItem);
     }
     else
     {
         LawRow lawRow = LawRowSP.Children.OfType <LawRow>().Where(x => x.lawDataLaw.ID.Equals(lawItem.ID)).FirstOrDefault();
         if (lawRow != null)
         {
             lawRow.txtPercent.Text        = ((int)lawItem.NowPercentage).ToString() + " %";
             lawRow.pb.Value               = lawItem.NowPercentage;
             lawRow.btnDownload.Visibility = Visibility.Collapsed;
             lawRow.txtPercent.Visibility  = Visibility.Visible;
             lawRow.pb.Visibility          = Visibility.Visible;
         }
     }
 }
 private void LawListCT_DownloadFileStart_Callback(Law_DownloadItemViewModel lawItem)
 {
     //先判斷是否要invoke
     if (this.Dispatcher.CheckAccess() == false)
     {
         // 這裡是下載事件處理,優先權設定為ContextIdle => 列舉值為 3。 幕後作業完成後,會處理作業。
         //this.Dispatcher.BeginInvoke(DispatcherPriority.SystemIdle, new Action<Law_DownloadItemViewModel>(LawListCT_DownloadFileStart_Callback), lawItem);
         this.Dispatcher.BeginInvoke(new Action <Law_DownloadItemViewModel>(LawListCT_DownloadFileStart_Callback), lawItem);
     }
     else
     {
         LawRow lawRow = LawRowSP.Children.OfType <LawRow>().Where(x => x.lawDataLaw.ID.Equals(lawItem.ID)).FirstOrDefault();
         if (lawRow != null)
         {
             lawRow.txtPercent.Text       = "0 %";
             lawRow.txtPercent.Foreground = Brushes.Black;
             lawRow.pb.Value      = 0;
             lawRow.pb.Foreground = Brushes.Orange;
             lawRow.pb.Background = Brushes.Black;
         }
     }
 }
Beispiel #11
0
 public bool _003CLawListCT_GetBookVMs_ByMeetingFileCate_Callback_003Eb__18(LawRow x)
 {
     if (x.lawItem.FileCate == lawItem.FileCate && x.lawItem.DownloadBytes != 0)
     {
         return(x.lawItem.DownloadBytes >= x.lawItem.TotalBytes);
     }
     return(false);
 }
Beispiel #12
0
 public bool _003CLawListCT_DownloadProgressChanged_Callback_003Eb__11(LawRow x)
 {
     return(x.lawDataLaw.ID.Equals(lawItem.ID));
 }
Beispiel #13
0
 public bool _003CLawListCT_DownloadFileCompleted_Callback_003Eb__d(LawRow x)
 {
     return(x.lawDataLaw.ID.Equals(lawItem.ID));
 }
Beispiel #14
0
 public bool _003CLawListCT_UnZip_Callback_003Eb__5(LawRow x)
 {
     return(x.lawDataLaw.ID.Equals(lawItem.ID));
 }