コード例 #1
0
        private void ShowAllAnnotationsForDocumentButton_Click(object sender, EventArgs e)
        {
            var focused = documentsListView.FocusedItem;

            if (focused?.Selected != true || !(focused.Tag is PdfFile file))
            {
                MessageBox.Show("Please select a document first.", "No document selected", MessageBoxButtons.OK,
                                MessageBoxIcon.Exclamation);
                return;
            }

            var annotations = Annotations.GetAnnotations(file.Md5);

            if (!(annotations?.Count >= 0))
            {
                MessageBox.Show($"There are no existing annotations saved for this document.", "No Saved Annotations for Document", MessageBoxButtons.OK,
                                MessageBoxIcon.Exclamation);
                return;
            }

            using (var frm = new AllAnnotationsForm(_context, annotations))
            {
                frm.ShowDialog();
                if (frm.DidChangesToAnnotationsInContext)
                {
                    DidChangesToAnnotationsInContext = true;
                }
            }
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: georg-jung/PdfAnnotator
 private void allAnnotationsMenuItem_Click(object sender, EventArgs e)
 {
     using (var frm = new AllAnnotationsForm(_ctx))
     {
         frm.ShowDialog();
         if (frm.DidChangesToAnnotationsInContext)
         {
             RefreshAnnotationsList();
         }
     }
 }