- Saving paramters

This commit is contained in:
Bjarke Berg
2019-01-21 09:10:08 +01:00
parent 2dc9eb3a90
commit d5c6e0c6e7
2 changed files with 14 additions and 1 deletions

View File

@@ -125,6 +125,18 @@ namespace Umbraco.Core.Collections
}
public void ReplaceAll(IEnumerable<TValue> values)
{
if (values == null) throw new ArgumentNullException(nameof(values));
Clear();
foreach (var value in values)
{
Add(value);
}
}
public bool Remove(TKey key)
{
if (!Indecies.ContainsKey(key)) return false;

View File

@@ -149,6 +149,7 @@
macro.UseInEditor = macroDisplay.UseInEditor;
macro.MacroSource = macroDisplay.View;
macro.MacroType = MacroTypes.PartialView;
macro.Properties.ReplaceAll(macroDisplay.Parameters.Select((x,i) => new MacroProperty(x.Key, x.Label, i, x.Editor)));
try
{
@@ -218,7 +219,7 @@
}
/// <summary>
/// Finds all the macro partials
/// Finds all the macro partials
/// </summary>
/// <returns>
/// The <see cref="IEnumerable"/>.