XmlStreamStore.GetAnnotations Yöntem

Tanım

Mağazadaki tüm 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 bulunup bulunmadığı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:
 override System::Collections::Generic::IList<System::Windows::Annotations::Annotation ^> ^ GetAnnotations();
public override System.Collections.Generic.IList<System.Windows.Annotations.Annotation> GetAnnotations();
override this.GetAnnotations : unit -> System.Collections.Generic.IList<System.Windows.Annotations.Annotation>
Public Overrides Function GetAnnotations () As IList(Of Annotation)

Döndürülenler

Şu anda mağazada olan tüm ek açıklamaların listesi.

Özel durumlar

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

Örnekler

Aşağıdaki örnekte, depoda GetAnnotations 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();
    }
}

Açıklamalar

GetAnnotations Yöntemi hiçbir zaman döndürmeznull; ancak depoda ek açıklama yoksa liste boş olabilir.

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:
 override System::Collections::Generic::IList<System::Windows::Annotations::Annotation ^> ^ GetAnnotations(System::Windows::Annotations::ContentLocator ^ anchorLocator);
public override System.Collections.Generic.IList<System.Windows.Annotations.Annotation> GetAnnotations(System.Windows.Annotations.ContentLocator anchorLocator);
override this.GetAnnotations : System.Windows.Annotations.ContentLocator -> System.Collections.Generic.IList<System.Windows.Annotations.Annotation>
Public Overrides 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.

Örnekler

Aşağıdaki örnekte, depoda GetAnnotations 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();
    }
}

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