Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Empty file.
Binary file removed .vs/GDSMultiPageFormService/v17/.futdcache.v2
Binary file not shown.
Binary file removed .vs/GDSMultiPageFormService/v17/.suo
Binary file not shown.
Binary file not shown.
Binary file not shown.
7 changes: 0 additions & 7 deletions .vs/VSWorkspaceState.json

This file was deleted.

29 changes: 25 additions & 4 deletions GDSMultiPageFormService/Enums/MultiPageFormDataFeature.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
namespace GDS.MultiPageFormData.Enums
namespace GDS.MultiPageFormData.Enums
{
public class MultiPageFormDataFeature : Enumeration
{
Expand Down Expand Up @@ -92,24 +91,46 @@ public class MultiPageFormDataFeature : Enumeration
nameof(EnrolDelegateInActivity),
"EnrolDelegateInActivity"
);

public static readonly MultiPageFormDataFeature AddUserFeedback = new MultiPageFormDataFeature(
15,
nameof(AddUserFeedback),
"AddUserFeedback"
);

public static MultiPageFormDataFeature CustomWebForm = new MultiPageFormDataFeature(
16,
nameof(CustomWebForm),
"CustomWebForm"
);

public readonly string TempDataKey;

private MultiPageFormDataFeature(int id, string name, string tempDataKey) : base(id, name)
{
TempDataKey = tempDataKey;
}


public static MultiPageFormDataFeature AddCustomWebForm(string name)
{
if (!name.EndsWith("CWF"))
{
throw new InvalidOperationException($"A custom web form name must end with CWF");
}
CustomWebForm = new MultiPageFormDataFeature(name.GetHashCode(), name.Trim(), $"{name.Trim()}Guid");
return CustomWebForm;
}

public static implicit operator MultiPageFormDataFeature(string value)
{
try
{
if (value.EndsWith("CWF"))
{
AddCustomWebForm(value);
}

return FromName<MultiPageFormDataFeature>(value);
}
catch (InvalidOperationException e)
Expand All @@ -123,4 +144,4 @@ public static implicit operator MultiPageFormDataFeature(string value)
return applicationType?.Name;
}
}
}
}
Binary file not shown.
Loading