AnnotationStore.GetAnnotations Methode

Definitie

Retourneert een lijst met aantekeningen in het archief.

Overloads

Name Description
GetAnnotations()

Retourneert een lijst met alle aantekeningen in de store.

GetAnnotations(ContentLocator)

Retourneert een lijst met aantekeningen met locators die Anchors beginnen met een overeenkomende ContentLocatorPart reeks.

Voorbeelden

In het volgende voorbeeld ziet u hoe u de GetAnnotations methode gebruikt om te bepalen of er aantekeningen in het archief zijn opgenomen.

// ---------------------------- CloseFile -----------------------------
private void CloseFile()
{
    // If there are existing annotations, then they should be saved.
    if (_annStore.GetAnnotations().Count > 0)
    {
        string backupFile = _fileName + ".annotations" + ".xml";
        FileStream backupStream = new FileStream(backupFile, FileMode.Create);
        CopyStream(_annotationBuffer, backupStream);
        _annStore.Flush();
        _annServ.Disable();
    }
}

GetAnnotations()

Retourneert een lijst met alle aantekeningen in de store.

public:
 abstract System::Collections::Generic::IList<System::Windows::Annotations::Annotation ^> ^ GetAnnotations();
public abstract System.Collections.Generic.IList<System.Windows.Annotations.Annotation> GetAnnotations();
abstract member GetAnnotations : unit -> System.Collections.Generic.IList<System.Windows.Annotations.Annotation>
Public MustOverride Function GetAnnotations () As IList(Of Annotation)

Retouren

De lijst met alle aantekeningen die momenteel in het archief zijn opgenomen.

Uitzonderingen

Dispose is opgeroepen in de winkel.

Voorbeelden

In het volgende voorbeeld ziet u hoe u de GetAnnotations methode gebruikt om te bepalen of er aantekeningen in het archief zijn opgenomen.

// ---------------------------- CloseFile -----------------------------
private void CloseFile()
{
    // If there are existing annotations, then they should be saved.
    if (_annStore.GetAnnotations().Count > 0)
    {
        string backupFile = _fileName + ".annotations" + ".xml";
        FileStream backupStream = new FileStream(backupFile, FileMode.Create);
        CopyStream(_annotationBuffer, backupStream);
        _annStore.Flush();
        _annServ.Disable();
    }
}

Zie ook

Van toepassing op

GetAnnotations(ContentLocator)

Retourneert een lijst met aantekeningen met locators die Anchors beginnen met een overeenkomende ContentLocatorPart reeks.

public:
 abstract System::Collections::Generic::IList<System::Windows::Annotations::Annotation ^> ^ GetAnnotations(System::Windows::Annotations::ContentLocator ^ anchorLocator);
public abstract System.Collections.Generic.IList<System.Windows.Annotations.Annotation> GetAnnotations(System.Windows.Annotations.ContentLocator anchorLocator);
abstract member GetAnnotations : System.Windows.Annotations.ContentLocator -> System.Collections.Generic.IList<System.Windows.Annotations.Annotation>
Public MustOverride Function GetAnnotations (anchorLocator As ContentLocator) As IList(Of Annotation)

Parameters

anchorLocator
ContentLocator

De beginvolgorde ContentLocatorPart voor het retourneren van overeenkomende aantekeningen voor.

Retouren

De lijst met aantekeningen met locators die Anchors beginnen en overeenkomen met de opgegeven anchorLocator; anders, null als er geen overeenkomende aantekeningen zijn gevonden.

Opmerkingen

Deze GetAnnotations methode maakt intern gebruik van de StartsWith methode van de ContentLocator klasse om te zoeken en overeen te komen met de aantekeningen die moeten worden geretourneerd.

Zie ook

Van toepassing op