AnnotationStore.GetAnnotations Yöntem

Tanım

Depoda bulunan ek açıklamaların listesini döndürür.

Aşırı Yüklemeler

Name Description
GetAnnotations()

Mağazadaki tüm ek açıklamaların listesini döndürür.

GetAnnotations(ContentLocator)

Eşleşen Anchors bir diziyle başlayan bulucuları olan ek açıklamaların ContentLocatorPart listesini döndürür.

Örnekler

Aşağıdaki örnekte, depoda GetAnnotations herhangi bir ek açıklama olup olmadığını belirlemek için yönteminin nasıl kullanılacağı gösterilmektedir.

// ---------------------------- 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()

Mağazadaki tüm ek açıklamaların listesini döndürür.

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)

Döndürülenler

Şu anda depoda bulunan tüm ek açıklamaların listesi.

Özel durumlar

Dispose mağazadan çağrıldı.

Örnekler

Aşağıdaki örnekte, depoda GetAnnotations herhangi bir ek açıklama olup olmadığını belirlemek için yönteminin nasıl kullanılacağı gösterilmektedir.

// ---------------------------- 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();
    }
}

Ayrıca bkz.

Şunlara uygulanır

GetAnnotations(ContentLocator)

Eşleşen Anchors bir diziyle başlayan bulucuları olan ek açıklamaların ContentLocatorPart listesini döndürür.

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)

Parametreler

anchorLocator
ContentLocator

için eşleşen ek açıklamaların döndürüleceği başlangıç ContentLocatorPart dizisi.

Döndürülenler

Belirtilenle Anchorsbaşlayıp eşleşen bulucularla olan anchorLocator ek açıklamaların listesi; aksi takdirde eşleşen null ek açıklamalar bulunmazsa.

Açıklamalar

Bu GetAnnotations yöntem, döndürülecek ek açıklamaları aramak ve eşleştirmek için sınıfının yöntemini StartsWith dahili olarak kullanırContentLocator.

Ayrıca bkz.

Şunlara uygulanır