2015-12-09 17:57:45 +00:00
|
|
|
|
// 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;
|
|
|
|
|
|
|
|
|
|
namespace Microsoft.DotNet.ProjectModel.Server.Messengers
|
|
|
|
|
{
|
2016-01-02 08:44:59 +00:00
|
|
|
|
internal class GlobalErrorMessenger : Messenger<ProjectSnapshot>
|
2015-12-09 17:57:45 +00:00
|
|
|
|
{
|
|
|
|
|
public GlobalErrorMessenger(Action<string, object> transmit)
|
|
|
|
|
: base(MessageTypes.Error, transmit)
|
|
|
|
|
{ }
|
|
|
|
|
|
2016-01-02 08:44:59 +00:00
|
|
|
|
protected override bool CheckDifference(ProjectSnapshot local, ProjectSnapshot remote)
|
2015-12-09 17:57:45 +00:00
|
|
|
|
{
|
|
|
|
|
return remote != null && Equals(local.GlobalErrorMessage, remote.GlobalErrorMessage);
|
|
|
|
|
}
|
|
|
|
|
|
2016-01-02 08:44:59 +00:00
|
|
|
|
protected override object CreatePayload(ProjectSnapshot local)
|
2015-12-09 17:57:45 +00:00
|
|
|
|
{
|
|
|
|
|
return local.GlobalErrorMessage;
|
|
|
|
|
}
|
|
|
|
|
|
2016-01-02 08:44:59 +00:00
|
|
|
|
protected override void SetValue(ProjectSnapshot local, ProjectSnapshot remote)
|
2015-12-09 17:57:45 +00:00
|
|
|
|
{
|
|
|
|
|
remote.GlobalErrorMessage = local.GlobalErrorMessage;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|