mirror of
https://github.com/ZuneDev/ZuneUIXTools.git
synced 2026-07-27 13:11:59 -07:00
Add FullLoad extension
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
using Microsoft.Iris.Markup;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Microsoft.Iris.Asm;
|
||||
|
||||
public static class Extensions
|
||||
{
|
||||
public static void FullLoad(this LoadResult result)
|
||||
{
|
||||
result.Load(LoadPass.DeclareTypes);
|
||||
result.Load(LoadPass.PopulatePublicModel);
|
||||
result.Load(LoadPass.Full);
|
||||
result.Load(LoadPass.Done);
|
||||
}
|
||||
|
||||
#if NETSTANDARD
|
||||
internal static StringBuilder AppendJoin<T>(this StringBuilder sb, string? separator, IEnumerable<T> values)
|
||||
{
|
||||
_ = 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
|
||||
}
|
||||
Reference in New Issue
Block a user