XmlStreamStore.GetAnnotations 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
저장소의 모든 주석 목록을 반환합니다.
오버로드
| Name | Description |
|---|---|
| GetAnnotations() |
저장소의 모든 주석 목록을 반환합니다. |
| GetAnnotations(ContentLocator) |
일치하는 Anchors 시퀀스로 시작하는 로케이터가 있는 ContentLocatorPart 주석 목록을 반환합니다. |
예제
다음 예제에서는 메서드를 사용 하 여 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:
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)
반품
현재 저장소에 있는 모든 주석 목록입니다.
예외
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 반환 null되지 않습니다. 그러나 저장소에 주석이 없는 경우 목록이 비어 있을 수 있습니다.
추가 정보
적용 대상
GetAnnotations(ContentLocator)
일치하는 Anchors 시퀀스로 시작하는 로케이터가 있는 ContentLocatorPart 주석 목록을 반환합니다.
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)
매개 변수
- anchorLocator
- ContentLocator
일치하는 주석을 반환할 시작 ContentLocatorPart 시퀀스입니다.
반품
지정된 Anchors주석을 시작하고 일치하는 로케이터가 있는 주석 anchorLocator 목록입니다. 그렇지 않으면 null 일치하는 주석을 찾을 수 없습니다.
예제
다음 예제에서는 메서드를 사용하여 저장소에 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 메서드는 내부적으로 클래스의 StartsWith 메서드를 사용하여 ContentLocator 반환할 주석을 검색하고 일치합니다.