2024-02-16 20:38:18 -06:00
|
|
|
using Microsoft.Iris.Markup;
|
|
|
|
|
using System;
|
2024-01-31 16:58:28 -06:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace Microsoft.Iris.Asm;
|
|
|
|
|
|
2024-02-16 20:38:18 -06:00
|
|
|
public static class Extensions
|
2024-01-31 16:58:28 -06:00
|
|
|
{
|
2024-02-16 20:38:18 -06:00
|
|
|
public static void FullLoad(this LoadResult result)
|
|
|
|
|
{
|
|
|
|
|
result.Load(LoadPass.DeclareTypes);
|
|
|
|
|
result.Load(LoadPass.PopulatePublicModel);
|
|
|
|
|
result.Load(LoadPass.Full);
|
|
|
|
|
result.Load(LoadPass.Done);
|
|
|
|
|
}
|
|
|
|
|
|
2024-01-31 16:58:28 -06:00
|
|
|
#if NETSTANDARD
|
2024-02-16 20:38:18 -06:00
|
|
|
internal static StringBuilder AppendJoin<T>(this StringBuilder sb, string? separator, IEnumerable<T> values)
|
2024-01-31 16:58:28 -06:00
|
|
|
{
|
|
|
|
|
_ = values ?? throw new ArgumentNullException(nameof(values));
|
|
|
|
|
|
|
|
|
|
separator ??= string.Empty;
|
|
|
|
|
using (IEnumerator<T> en = values.GetEnumerator())
|
|
|
|
|
{
|
|
|
|
|
if (!en.MoveNext())
|
|
|
|
|
{
|
|
|
|
|
return sb;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
T value = en.Current;
|
|
|
|
|
if (value != null)
|
|
|
|
|
{
|
|
|
|
|
sb.Append(value.ToString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
while (en.MoveNext())
|
|
|
|
|
{
|
|
|
|
|
sb.Append(separator);
|
|
|
|
|
value = en.Current;
|
|
|
|
|
if (value != null)
|
|
|
|
|
{
|
|
|
|
|
sb.Append(value.ToString());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return sb;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
}
|