AnnotationStore.GetAnnotations 메서드

정의

저장소에 포함된 주석 목록을 반환합니다.

오버로드

GetAnnotations()

저장소에 있는 모든 주석의 목록을 반환합니다.

GetAnnotations(ContentLocator)

일치하는 ContentLocatorPart 시퀀스로 시작하는 로케이터가 있는 Anchors를 포함하는 주석 목록을 반환합니다.

예제

다음 예제에서는 사용 하는 방법의 GetAnnotations 주석이 저장소에 포함 되는지 확인 하는 방법입니다.

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

저장소에 있는 모든 주석의 목록을 반환합니다.

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)

반환

IList<Annotation>

현재 저장소에 포함되어 있는 모든 주석의 목록입니다.

예외

Dispose가 저장소에서 호출되었습니다.

예제

다음 예제에서는 사용 하는 방법의 GetAnnotations 주석이 저장소에 포함 되는지 확인 하는 방법입니다.

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

일치하는 ContentLocatorPart 시퀀스로 시작하는 로케이터가 있는 Anchors를 포함하는 주석 목록을 반환합니다.

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)

매개 변수

anchorLocator
ContentLocator

일치하는 주석을 반환할 시작 ContentLocatorPart 시퀀스입니다.

반환

IList<Annotation>

지정된 anchorLocator로 시작하며 이 항목과 일치하는 로케이터가 있는 Anchors를 포함하는 주석 목록이거나, 일치하는 주석이 없는 경우 null입니다.

설명

GetAnnotations 메서드는 내부적으로 사용 합니다 StartsWith 메서드를 ContentLocator 클래스를 검색 하 고 반환할 주석에 대 한 일치 합니다.

추가 정보

적용 대상