Fixed assembly/classname when publishing from a received message
This commit is contained in:
parent
d7e21e508a
commit
4817b1806a
@ -2,6 +2,7 @@
|
||||
using System.Windows.Input;
|
||||
|
||||
// TODO validate input
|
||||
// TODO profiles
|
||||
|
||||
namespace PettingZoo.UI.Connection
|
||||
{
|
||||
|
@ -139,14 +139,14 @@ namespace PettingZoo.UI.Tab.Publisher
|
||||
var tapetiPublisherViewModel = new TapetiPublisherViewModel(connection, fromReceivedMessage);
|
||||
tapetiPublisherView = new TapetiPublisherView(tapetiPublisherViewModel);
|
||||
|
||||
SetMessageTypeControl(MessageType.Tapeti);
|
||||
MessageType = MessageType.Tapeti;
|
||||
}
|
||||
else
|
||||
{
|
||||
var rawPublisherViewModel = new RawPublisherViewModel(connection, fromReceivedMessage);
|
||||
rawPublisherView = new RawPublisherView(rawPublisherViewModel);
|
||||
|
||||
SetMessageTypeControl(MessageType.Raw);
|
||||
MessageType = MessageType.Raw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -226,12 +226,20 @@ namespace PettingZoo.UI.Tab.Publisher
|
||||
Key = header.Key,
|
||||
Value = header.Value
|
||||
});
|
||||
|
||||
PropertiesExpanded = AnyNotEmpty(AppId, ContentEncoding, Expiration, MessageId, Priority, Timestamp, TypeProperty, UserId);
|
||||
}
|
||||
|
||||
AddHeader();
|
||||
}
|
||||
|
||||
|
||||
private static bool AnyNotEmpty(params string?[] values)
|
||||
{
|
||||
return values.Any(s => !string.IsNullOrEmpty(s));
|
||||
}
|
||||
|
||||
|
||||
private void LastHeaderChanged(object? sender, PropertyChangedEventArgs e)
|
||||
{
|
||||
LastHeader.PropertyChanged -= LastHeaderChanged;
|
||||
|
@ -149,14 +149,15 @@ namespace PettingZoo.UI.Tab.Publisher
|
||||
publishCommand = new DelegateCommand(PublishExecute, PublishCanExecute);
|
||||
|
||||
|
||||
if (receivedMessage == null)
|
||||
if (receivedMessage == null || !IsTapetiMessage(receivedMessage, out var receivedAssemblyName, out var receivedClassName))
|
||||
return;
|
||||
|
||||
Exchange = receivedMessage.Exchange;
|
||||
RoutingKey = receivedMessage.RoutingKey;
|
||||
|
||||
AssemblyName = assemblyName;
|
||||
ClassName = className;
|
||||
|
||||
AssemblyName = receivedAssemblyName;
|
||||
ClassName = receivedClassName;
|
||||
CorrelationId = receivedMessage.Properties.CorrelationId ?? "";
|
||||
ReplyTo = receivedMessage.Properties.ReplyTo ?? "";
|
||||
Payload = Encoding.UTF8.GetString(receivedMessage.Body);
|
||||
|
Loading…
Reference in New Issue
Block a user