Skip to content

Commit

Permalink
Remove the warning message intercept
Browse files Browse the repository at this point in the history
  • Loading branch information
saintentropy committed Oct 23, 2023
1 parent 2637309 commit 0be48cd
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 38 deletions.
1 change: 0 additions & 1 deletion src/DynamoUtilities/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("fdd60a60-c6e4-4f11-b583-8a417061c043")]
[assembly: InternalsVisibleTo("DynamoCore")]
[assembly: InternalsVisibleTo("CoreNodeModels")]
[assembly: InternalsVisibleTo("DynamoCoreWpf")]
[assembly: InternalsVisibleTo("DynamoCoreTests")]
[assembly: InternalsVisibleTo("DynamoCoreWpfTests")]
Expand Down
37 changes: 0 additions & 37 deletions src/Libraries/CoreNodeModels/Remember.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using VMDataBridge;
using System.Collections.Specialized;

namespace CoreNodeModels
{
Expand All @@ -28,7 +23,6 @@ namespace CoreNodeModels
public class Remember : NodeModel
{
private string cache = "";
private string updatedMessage = "";

[JsonProperty("Cache")]
public string Cache
Expand All @@ -49,14 +43,12 @@ public string Cache
private Remember(IEnumerable<PortModel> inPorts, IEnumerable<PortModel> outPorts) : base(inPorts, outPorts)
{
PropertyChanged += OnPropertyChanged;
Infos.CollectionChanged += ProcessInfos;
}

public Remember()
{
RegisterAllPorts();
PropertyChanged += OnPropertyChanged;
Infos.CollectionChanged += ProcessInfos;
}

private void OnPropertyChanged(object sender, PropertyChangedEventArgs e)
Expand All @@ -76,34 +68,6 @@ private void OnPropertyChanged(object sender, PropertyChangedEventArgs e)
}
}

/// <summary>
/// Handle updating the error message to remove the non-pointer message.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ProcessInfos(object sender, NotifyCollectionChangedEventArgs e)
{
if(Infos.Count == 0 || State != ElementState.Warning) return;
if(Infos.Any(x => x.State == ElementState.Warning && x.Message != updatedMessage))
{
var infos = new List<Info> { };
foreach (var info in Infos)
{
if (info.State == ElementState.Warning)
{
string[] errorMessages =
info.Message.Split(new[] { "\r\n", "\n" }, StringSplitOptions.None);
updatedMessage = errorMessages.Last();

infos.Add(new Info(updatedMessage, ElementState.Warning));
}
}

Infos.RemoveWhere(x => x.State == ElementState.Warning);
Infos.AddRange(infos);
}
}

protected override void OnBuilt()
{
base.OnBuilt();
Expand All @@ -113,7 +77,6 @@ protected override void OnBuilt()
public override void Dispose()
{
PropertyChanged -= OnPropertyChanged;
Infos.CollectionChanged -= ProcessInfos;
base.Dispose();
DataBridge.Instance.UnregisterCallback(GUID.ToString());
}
Expand Down

0 comments on commit 0be48cd

Please sign in to comment.