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