Refactor quick action output handling and extend case note support
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows;
|
||||
|
||||
using C4IT.F4SD.DisplayFormatting;
|
||||
using C4IT.F4SD.DisplayFormatting;
|
||||
using C4IT.F4SD.SupportCaseProtocoll.Models;
|
||||
using C4IT.FASD.Base;
|
||||
|
||||
using FasdCockpitBase;
|
||||
using FasdDesktopUi.Basics.Helper;
|
||||
using FasdDesktopUi.Basics.Services.ProtocollService;
|
||||
using FasdDesktopUi.Basics.Services.SupportCase.Processors;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Media.Imaging;
|
||||
using static C4IT.Logging.cLogManager;
|
||||
|
||||
namespace FasdDesktopUi.Basics.Models
|
||||
@@ -193,6 +195,33 @@ namespace FasdDesktopUi.Basics.Models
|
||||
}
|
||||
}
|
||||
|
||||
public class cNamedParameterEntryCaseNotes : cNamedParameterEntryBase
|
||||
{
|
||||
private readonly bool _getHtmlAsDefaultValue;
|
||||
|
||||
public cNamedParameterEntryCaseNotes(cSupportCaseDataProvider dataProvider, bool getHtmlAsDefaultValue) : base(dataProvider)
|
||||
{
|
||||
_getHtmlAsDefaultValue = getHtmlAsDefaultValue;
|
||||
}
|
||||
|
||||
public override string GetValue()
|
||||
{
|
||||
if (_getHtmlAsDefaultValue)
|
||||
return GetHtmlValue();
|
||||
|
||||
StringBuilder caseNotesStringBuilder = new StringBuilder();
|
||||
cRichTextBoxHelper.TraverseBlockAsUnicode(dataProvider.CaseNotes.Blocks, caseNotesStringBuilder);
|
||||
return caseNotesStringBuilder.ToString();
|
||||
}
|
||||
|
||||
public override string GetHtmlValue()
|
||||
{
|
||||
StringBuilder caseNotesHtmlStringBuilder = new StringBuilder();
|
||||
cRichTextBoxHelper.TraverseBlockAsHtml(dataProvider.CaseNotes.Blocks, caseNotesHtmlStringBuilder);
|
||||
return caseNotesHtmlStringBuilder.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public class cNamedParameterList : Dictionary<string, cNamedParameterEntryBase>
|
||||
{
|
||||
public cNamedParameterList()
|
||||
@@ -204,8 +233,11 @@ namespace FasdDesktopUi.Basics.Models
|
||||
{
|
||||
try
|
||||
{
|
||||
Add("F4SD_QuickActionProtocolLast", new cNamedParameterEntryQuickActionResult(dataProvider));
|
||||
Add("F4SD_QuickActionProtocol", new cNamedParameterEntryQuickActionResultProtocol(dataProvider));
|
||||
Add(SupportCaseProcessor.QuickActionProtocolLastNamedParameterName, new cNamedParameterEntryQuickActionResult(dataProvider));
|
||||
Add(SupportCaseProcessor.QuickActionProtocolNamedParameterName, new cNamedParameterEntryQuickActionResultProtocol(dataProvider));
|
||||
|
||||
Add(SupportCaseProcessor.CaseNotesNamedParameterName, new cNamedParameterEntryCaseNotes(dataProvider, false));
|
||||
Add(SupportCaseProcessor.CaseNotesHtmlNamedParameterName, new cNamedParameterEntryCaseNotes(dataProvider, true));
|
||||
}
|
||||
catch (Exception E)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user