مشاركة عبر


نظرة عامة حول التعليقات التوضيحية

تلاحظ الكتابة أو التعليق على المستندات الورقية مثل هذا النشاط شائعا أن نتخذ تقريبا أنها من المسلمات. التعليقات التوضيحية هى الملاحظات أو التعليقات التي تمت إضافتها إلى المستندات لوضع علامة على المعلومات أو تمييز عناصر الاهتمام كمرجع لاحق. على الرغم من الملاحظات على كتابة الوثائق المطبوعة هي سهلة ومألوفة ، والقدرة على إضافة تعليقات شخصية إلى الوثائق الالكترونية هي عادة محدودة للغاية ، إن وجدت على الإطلاق.

مراجعة هذا الموضوع العديد من الأنواع عام من التعليقات التوضيحية، وبشكل خاص sticky ملاحظات و تمييز، و يوضح كيفية Microsoft Annotations Frameworkيسهل هذه الأنواع من التعليقات التوضيحية في التطبيقات من خلال Windows Presentation Foundation (WPF)مستند عرض عناصر التحكم. WPF document viewing controls that support annotations include FlowDocumentReader and FlowDocumentScrollViewer, as well as controls derived from DocumentViewerBase such as DocumentViewer and FlowDocumentPageViewer.

يشتمل هذا الموضوع على الأقسام التالية.

  • ملاحظات ملصقة
  • موضوعات مهمة
  • بيانات anchoring
  • الشروح مطابقة مع كائنات المشروح
  • موضوعات ذات صلة

ملاحظات ملصقة

مذكرة نموذجية لزجة يحتوي على معلومات مكتوبة على قطعة صغيرة من الورق الملون التي يتم بعد ذلك "عالقة" في وثيقة. وتلاحظ لزجة الرقمية توفر وظائف مماثلة للوثائق الإلكترونية ، ولكن مع مرونة إضافية لتشمل العديد من أنواع أخرى من المحتوى مثل كتابة النص ، والمذكرات المكتوبة بخط اليد (على سبيل المثال كمبيوتر لوحي ضغطات "حبر") ، أو ويب الارتباطات.

يبين الرسم التوضيحي التالي بعض الأمثلة على تمييز النص sticky note والحبر sticky note التعليقات التوضيحية.

تعليقات توضيحية للتمييز والملاحظات الملصقة النصية والمكتوبة بالحبر.

المثال التالي يوضح الطريقة التي يمكنك استخدامها لتمكين دعم الشرح في التطبيق الخاص بك.

        ' ------------------------ StartAnnotations --------------------------
        ''' <summary>
        '''   Enables annotations and displays all that are viewable.</summary>
        Private Sub StartAnnotations()
            ' If there is no AnnotationService yet, create one.
            If _annotService Is Nothing Then
                ' docViewer is a document viewing control named in Window1.xaml.
                _annotService = New AnnotationService(docViewer)
            End If

            ' If the AnnotationService is currently enabled, disable it.
            If _annotService.IsEnabled = True Then
                _annotService.Disable()
            End If

            ' Open a stream to the file for storing annotations.
            _annotStream = New FileStream(_annotStorePath, FileMode.OpenOrCreate, FileAccess.ReadWrite)

            ' Create an AnnotationStore using the file stream.
            _annotStore = New XmlStreamStore(_annotStream)

            ' Enable the AnnotationService using the new store.
            _annotService.Enable(_annotStore)
        End Sub ' end:StartAnnotations()
// ------------------------ StartAnnotations --------------------------
/// <summary>
///   Enables annotations and displays all that are viewable.</summary>
private void StartAnnotations()
{
    // If there is no AnnotationService yet, create one.
    if (_annotService == null)
        // docViewer is a document viewing control named in Window1.xaml.
        _annotService = new AnnotationService(docViewer);

    // If the AnnotationService is currently enabled, disable it.
    if (_annotService.IsEnabled == true)
        _annotService.Disable();

    // Open a stream to the file for storing annotations.
    _annotStream = new FileStream(
        _annotStorePath, FileMode.OpenOrCreate, FileAccess.ReadWrite);

    // Create an AnnotationStore using the file stream.
    _annotStore = new XmlStreamStore(_annotStream);

    // Enable the AnnotationService using the new store.
    _annotService.Enable(_annotStore);
}// end:StartAnnotations()

موضوعات مهمة

الناس في استخدام أساليب مبتكرة للفت الانتباه إلى البنود التي تهم عندما تصل علامة وثيقة ورقية ، مثل التسطير ، وتبرز ، تدور الكلمات في الجملة ، أو الرسم أو علامات الترقيم في الهامش. الشروح في تسليط الضوء على Microsoft Annotations Framework توفير ميزة مشابهة لـ تمييز المعلومات المعروضة في WPF المستند عرض عناصر التحكم.

ويوضح الشكل التالي مثالا لشرح تسليط الضوء.

تعليق توضيحي بشكل مميز

للمستخدمين خلق عادة أول من الشروح اختيار بعض النصوص أو عنصر من الفائدة ، ومن ثم النقر بالزر الأيمن لعرض ContextMenu من خيارات التعليق التوضيحي. يظهر المثال التالي Extensible Application Markup Language (XAML) يمكنك استخدام التصريح ContextMenu مع توجيه الأوامر التي يمكن للمستخدمين الوصول إلى إنشاء وإدارة شروحه.

<DocumentViewer.ContextMenu>
  <ContextMenu>
    <MenuItem Command="ApplicationCommands.Copy" />
    <Separator />
    <!-- Add a Highlight annotation to a user selection. -->
    <MenuItem Command="ann:AnnotationService.CreateHighlightCommand"
              Header="Add Highlight" />
    <!-- Add a Text Note annotation to a user selection. -->
    <MenuItem Command="ann:AnnotationService.CreateTextStickyNoteCommand"
              Header="Add Text Note" />
    <!-- Add an Ink Note annotation to a user selection. -->
    <MenuItem Command="ann:AnnotationService.CreateInkStickyNoteCommand"
              Header="Add Ink Note" />
    <Separator />
    <!-- Remove Highlights from a user selection. -->
    <MenuItem Command="ann:AnnotationService.ClearHighlightsCommand"
              Header="Remove Highlights" />
    <!-- Remove Text Notes and Ink Notes from a user selection. -->
    <MenuItem Command="ann:AnnotationService.DeleteStickyNotesCommand"
              Header="Remove Notes" />
    <!-- Remove Highlights, Text Notes, Ink Notes from a selection. -->
    <MenuItem Command="ann:AnnotationService.DeleteAnnotationsCommand"
              Header="Remove Highlights &amp; Notes" />
  </ContextMenu>
</DocumentViewer.ContextMenu>

بيانات anchoring

Annotations Framework يربط شروح البيانات التي يحدد المستخدم ، وليس فقط لموقف بشأن عرض وجهة النظر. ولذلك ، إذا كانت التغييرات عرض المستند ، مثل عندما يقوم المستخدم لفائف أو تغيير حجم إطار العرض والشرح يبقى مع اختيار البيانات التي لابد أن. على سبيل المثال، يوضح الرسم التالي تعليق توضيحي التي قام بها المستخدم على تحديد نص. عند تغيير طريقة عرض المستند (لفائف ، تغيير حجم ، والمقاييس ، أو تحركات غير ذلك) ، ينتقل مع الشرح تسليط الضوء على اختيار البيانات الأصلية.

ارتساء بيانات التعليق التوضيحي

الشروح مطابقة مع كائنات المشروح

يمكنك مطابقة التعليقات التوضيحية المطابقة annotated الكائنات. على سبيل المثال، خذ بعين الاعتبار تطبيق قارئ مستند بسيط يحتوي على جزء. وربما يكون جزء من التعليقات مربع قائمة يعرض النص من قائمة الشروح التي ترتكز على وثيقة. إذا كان المستخدم تحديد عنصر في مربع القائمة ، ثم التطبيق يضع في عرض الفقرة في الوثيقة التي يرتكز الكائن الشرح الموافق.

المثال التالي يوضح كيفية تطبيق معالج الحدث من مربع القائمة على مثل هذه التي هي بمثابة جزء التعليقات.

        Private Sub annotationsListBox_SelectionChanged(ByVal sender As Object, ByVal e As SelectionChangedEventArgs)

            Dim comment As Annotation = TryCast((TryCast(sender, ListBox)).SelectedItem, Annotation)
            If comment IsNot Nothing Then
                ' service is an AnnotationService object
                ' comment is an Annotation object
                info = AnnotationHelper.GetAnchorInfo(Me.service, comment)
                Dim resolvedAnchor As TextAnchor = TryCast(info.ResolvedAnchor, TextAnchor)
                Dim textPointer As TextPointer = CType(resolvedAnchor.BoundingStart, TextPointer)
                textPointer.Paragraph.BringIntoView()
            End If
        End Sub
void annotationsListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{

    Annotation comment = (sender as ListBox).SelectedItem as Annotation;
    if (comment != null)
    {
        // IAnchorInfo info;
        // service is an AnnotationService object
        // comment is an Annotation object
        info = AnnotationHelper.GetAnchorInfo(this.service, comment);
        TextAnchor resolvedAnchor = info.ResolvedAnchor as TextAnchor;
        TextPointer textPointer = (TextPointer)resolvedAnchor.BoundingStart;
        textPointer.Paragraph.BringIntoView();
    }
}

سيناريو آخر ينطوي على سبيل المثال التطبيقات التي تمكن من تبادل الشروح والمذكرات لزجة بين القراء وثيقة عبر البريد الإلكتروني. هذه الميزة تتيح هذه التطبيقات للتنقل القارئ إلى الصفحة التي تحتوي على الشرح الذي يجري تبادلها.

راجع أيضًا:

المهام

كيفية القيام بما يلي: إضافة أمر إلى MenuItem

المرجع

DocumentViewerBase

DocumentViewer

FlowDocumentPageViewer

FlowDocumentScrollViewer

FlowDocumentReader

IAnchorInfo

المبادئ

مخطط التعليقات التوضيحية

نظرة عامة حول قائمة السياق

نظرة عامة على الأوامر

نظرة عامة على مستند التدفق