/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/EditorFeatures/VisualBasic/LineCommit/CommitBufferManager.DirtyState.vb
51 строка
2 KB
Jonathon Marolf
update headers
23 янв 2020, 04:01
Не верифицирован
23 янв 2020, 04:01
91571a3
Код
Авторство
О чём код?
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. Imports Microsoft.VisualStudio.Text Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.LineCommit Partial Friend Class CommitBufferManager Private Class DirtyState Private ReadOnly _dirtyRegion As ITrackingSpan Private ReadOnly _baseSnapshot As ITextSnapshot Private ReadOnly _baseDocument As Document Public Sub New(span As SnapshotSpan, baseSnapshot As ITextSnapshot, baseDocument As Document) Contract.ThrowIfNull(baseDocument) Contract.ThrowIfNull(baseSnapshot) _dirtyRegion = span.CreateTrackingSpan(SpanTrackingMode.EdgeInclusive) _baseSnapshot = baseSnapshot _baseDocument = baseDocument End Sub Public Function WithExpandedDirtySpan(includeSpan As SnapshotSpan) As DirtyState Dim oldDirtyRegion = _dirtyRegion.GetSpan(includeSpan.Snapshot) Dim newDirtyRegion = Span.FromBounds(Math.Min(oldDirtyRegion.Start, includeSpan.Start), Math.Max(oldDirtyRegion.End, includeSpan.End)) Return New DirtyState(New SnapshotSpan(includeSpan.Snapshot, newDirtyRegion), _baseSnapshot, _baseDocument) End Function Public ReadOnly Property DirtyRegion As ITrackingSpan Get Return _dirtyRegion End Get End Property Public ReadOnly Property BaseSnapshot As ITextSnapshot Get Return _baseSnapshot End Get End Property Public ReadOnly Property BaseDocument As Document Get Return _baseDocument End Get End Property End Class End Class End Namespace