Aracılığıyla paylaş


XmlStreamStore.GetAnnotations Yöntem

Tanım

Depodaki tüm ek açıklamaların listesini döndürür.

Aşırı Yüklemeler

GetAnnotations()

Depodaki tüm ek açıklamaların listesini döndürür.

GetAnnotations(ContentLocator)

Eşleşen ContentLocatorPart bir diziyle başlayan bulucularla birlikte olan ek açıklamaların Anchors 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()

Depodaki 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

IList<Annotation>

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

Özel durumlar

Dispose mağazadan arandı.

Ö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 ContentLocatorPart bir diziyle başlayan bulucularla birlikte olan ek açıklamaların Anchors 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 sırası.

Döndürülenler

IList<Annotation>

Belirtilen anchorLocatorile başlayan ve eşleşen bulucularla olan Anchors ek açıklamaların listesi; aksi takdirde eşleşen null ek açıklamalar bulunamadıysa.

Ö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 ContentLocator dahili olarak kullanırStartsWith.

Ayrıca bkz.

Şunlara uygulanır