Beispiel #1
0
        private void xunhuan_Checked(object sender, RoutedEventArgs e)
        {
            ViewModel.ProofItem rootItem = (sender as RadioButton).Tag as ViewModel.ProofItem;
            int index = datasource.IndexOf(rootItem);

            if (SingletonManager.Get <UserProcesser>().GetUser().HasProofPower(index))
            {
                if (!CurrentProofDir.Contains(rootItem))
                {
                    if (container.Content != null && container.Content is ProofControl)
                    {
                        ((ProofControl)container.Content).Close();
                    }

                    queueDir.Clear();
                    queueDir.Add(rootItem);
                    CurrentProofDir = rootItem;
                    proofList.SetBinding(ItemsControl.ItemsSourceProperty, new Binding(".")
                    {
                        Source = CurrentProofDir.Proofs
                    });
                }
            }
            else
            {
                WinBuyActivationCode winCode = new WinBuyActivationCode();
                winCode.ShowDialog();
            }
        }
Beispiel #2
0
 private void ProofShow_Loaded(object sender, RoutedEventArgs e)
 {
     if (!isFirstLoad)
     {
         return;
     }
     isFirstLoad             = false;
     queueDir                = new ObservableCollection <ViewModel.ProofItem>();
     datasource              = SingletonManager.Get <ProofShowProcessor>().GetProofItems();
     datasource[0].IsChecked = true;
     queueDir.Add(datasource[0]);
     CurrentProofDir = datasource[0];
     xunhuanList.SetBinding(ItemsControl.ItemsSourceProperty, new Binding(".")
     {
         Source = datasource
     });
     dirList.SetBinding(ItemsControl.ItemsSourceProperty, new Binding(".")
     {
         Source = queueDir
     });
     proofList.SetBinding(ItemsControl.ItemsSourceProperty, new Binding(".")
     {
         Source = CurrentProofDir.Proofs
     });
 }
Beispiel #3
0
        private void ChoiseDir_Checked(object sender, RoutedEventArgs e)
        {
            ViewModel.ProofItem choiseItem = (sender as RadioButton).Tag as ViewModel.ProofItem;
            if (choiseItem != CurrentProofDir)
            {
                CurrentProofDir = choiseItem;

                int index = queueDir.IndexOf(CurrentProofDir);

                while (index != queueDir.Count - 1)
                {
                    queueDir.RemoveAt(queueDir.Count - 1);
                }

                proofList.SetBinding(ItemsControl.ItemsSourceProperty, new Binding(".")
                {
                    Source = CurrentProofDir.Proofs
                });
            }
        }
Beispiel #4
0
        private void ShowImg_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            ViewModel.ProofItem choiseItem = (sender as Image).Tag as ViewModel.ProofItem;
            if (e.ClickCount == 2)
            {
                switch (choiseItem.Type)
                {
                case ViewModel.FileTypeEnum.Directory:
                    CurrentProofDir = choiseItem;
                    queueDir.Add(choiseItem);
                    proofList.SetBinding(ItemsControl.ItemsSourceProperty, new Binding(".")
                    {
                        Source = CurrentProofDir.Proofs
                    });
                    break;

                case ViewModel.FileTypeEnum.Word:
                    break;

                case ViewModel.FileTypeEnum.Excel:
                    break;

                case ViewModel.FileTypeEnum.Pdf:
                case ViewModel.FileTypeEnum.Img:
                    currentShowImgItem = choiseItem;
                    ProofControl proofControl = new ProofControl(CurrentProofDir, CurrentProofDir.Proofs.IndexOf(choiseItem));
                    proofControl.OnClose        += ProofControl_OnClose;
                    this.keyboardHook.OnKeyDown += keyboardHook_OnKeyDown;
                    container.Content            = proofControl;
                    break;

                default:
                    break;
                }
            }
        }