2020-02-14 08:10:33 -06:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
|
|
|
|
|
namespace ACE.Entity.Models
|
|
|
|
|
{
|
|
|
|
|
public static class PropertiesTextureMapExtensions
|
|
|
|
|
{
|
|
|
|
|
public static int GetCount(this IList<PropertiesTextureMap> value, ReaderWriterLockSlim rwLock)
|
|
|
|
|
{
|
|
|
|
|
if (value == null)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
rwLock.EnterReadLock();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
return value.Count;
|
|
|
|
|
}
|
|
|
|
|
finally
|
|
|
|
|
{
|
|
|
|
|
rwLock.ExitReadLock();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static List<PropertiesTextureMap> Clone(this IList<PropertiesTextureMap> value, ReaderWriterLockSlim rwLock)
|
|
|
|
|
{
|
|
|
|
|
if (value == null)
|
|
|
|
|
return null;
|
2020-04-11 16:19:48 -05:00
|
|
|
|
2020-02-14 08:10:33 -06:00
|
|
|
rwLock.EnterReadLock();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
return new List<PropertiesTextureMap>(value);
|
|
|
|
|
}
|
|
|
|
|
finally
|
|
|
|
|
{
|
|
|
|
|
rwLock.ExitReadLock();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-02 22:40:27 -05:00
|
|
|
public static void CopyTo(this IList<PropertiesTextureMap> value, ICollection<PropertiesTextureMap> destination, ReaderWriterLockSlim rwLock)
|
|
|
|
|
{
|
|
|
|
|
if (value == null)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
rwLock.EnterReadLock();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
foreach (var entry in value)
|
|
|
|
|
destination.Add(entry);
|
|
|
|
|
}
|
|
|
|
|
finally
|
|
|
|
|
{
|
|
|
|
|
rwLock.ExitReadLock();
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-02-14 08:10:33 -06:00
|
|
|
}
|
|
|
|
|
}
|