33 lines
1.1 KiB
C#
33 lines
1.1 KiB
C#
![]() |
// 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.Linq;
|
|||
|
using Microsoft.DotNet.ProjectModel.Server.Models;
|
|||
|
|
|||
|
namespace Microsoft.DotNet.ProjectModel.Server.Messengers
|
|||
|
{
|
|||
|
internal class ProjectDiagnosticsMessenger : Messenger<Snapshot>
|
|||
|
{
|
|||
|
public ProjectDiagnosticsMessenger(Action<string, object> transmit)
|
|||
|
: base(MessageTypes.Diagnostics, transmit)
|
|||
|
{ }
|
|||
|
|
|||
|
protected override bool CheckDifference(Snapshot local, Snapshot remote)
|
|||
|
{
|
|||
|
return remote.ProjectDiagnostics != null &&
|
|||
|
Enumerable.SequenceEqual(local.ProjectDiagnostics, remote.ProjectDiagnostics);
|
|||
|
}
|
|||
|
|
|||
|
protected override object CreatePayload(Snapshot local)
|
|||
|
{
|
|||
|
return new DiagnosticsListMessage(local.ProjectDiagnostics);
|
|||
|
}
|
|||
|
|
|||
|
protected override void SetValue(Snapshot local, Snapshot remote)
|
|||
|
{
|
|||
|
remote.ProjectDiagnostics = local.ProjectDiagnostics;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|