-
Notifications
You must be signed in to change notification settings - Fork 368
/
HoverTextProduced.cs
36 lines (29 loc) · 1.21 KB
/
HoverTextProduced.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using Microsoft.DotNet.Interactive.Commands;
using Microsoft.DotNet.Interactive.Extensions;
namespace Microsoft.DotNet.Interactive.Events
{
public class HoverTextProduced : KernelEvent
{
private readonly LinePositionSpan _linePositionSpan;
public HoverTextProduced(RequestHoverText command, IReadOnlyCollection<FormattedValue> content, LinePositionSpan linePositionSpan = null)
: base(command)
{
if (content is null)
{
throw new ArgumentNullException(nameof(content));
}
if (content.Count == 0)
{
throw new ArgumentException("At least one content required.", nameof(content));
}
Content = content;
_linePositionSpan = linePositionSpan;
}
public IReadOnlyCollection<FormattedValue> Content { get; }
public LinePositionSpan LinePositionSpan => this.CalculateLineOffsetFromParentCommand(_linePositionSpan);
}
}