Hi,
I need to add a sveral suggestions to custom verification message. I'm using code and form from SDK sample Sdl.Verification.Sdk.EditAndApplyChanges.MessageUI plugin to display it.
I'm not sure how to construct extended data for message reporter.
I try doing it as below:
if (MessageReporter is IBilingualContentMessageReporterWithExtendedData)
{
#region CreateExtendedData
CustomMessageData extendedData = new CustomMessageData("MessageType", "Detailed description");
extendedData.SuggestedChanges.Add(new KeyValuePair<string, string>("Markup","Label"));
extendedData.SuggestedChanges.Add(new KeyValuePair<string, string>("Markup2","Label2"));
extendedData.SuggestedChanges.Add(new KeyValuePair<string, string>("Markup3","Label3"));
#endregion
IBilingualContentMessageReporterWithExtendedData extendedMessageReporter = (IBilingualContentMessageReporterWithExtendedData)MessageReporter;
extendedMessageReporter.ReportMessage(this, PluginResources.Plugin_Name,
ErrorLevel.Warning, PluginResources.Error_LT,
new TextLocation(new Location(segmentPair.Target, true), 0),
new TextLocation(new Location(segmentPair.Target, false), segmentPair.Target.ToString().Length - 1),
extendedData);
#endregion
else
{
#region ReportingMessageWithoutExtendedData
MessageReporter.ReportMessage(this, PluginResources.Plugin_Name,
ErrorLevel.Warning, PluginResources.Error_LT,
new TextLocation(new Location(segmentPair.Target, true), 0),
new TextLocation(new Location(segmentPair.Target, false), segmentPair.Target.ToString().Length - 1));
#endregion
}
Results are partially okay. Added suggestions are in list. Suggestions have correct markup values assigned and I can replace target text, but suggestions have wrong labels in list.
What do I wrong? How should I construct extendedData for MessageReporter?
DArek