mirror of
https://github.com/SCToolsfactory/SCJMapper-V2.git
synced 2024-11-10 13:10:25 +00:00
ffe5005c2b
updates of dev tuning for strafe #48 improvement of control and selection #49 fix exception for multiple actionmaps #51 improvement for collapsing the treeview added Options dialog for all items in one window some minor fixes/refacturings on the way
34 lines
867 B
C#
34 lines
867 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace SCJMapper_V2
|
|
{
|
|
public class CloneableDictionary<TKey, TValue> : Dictionary<TKey, TValue> where TValue : ICloneable
|
|
{
|
|
public virtual object Clone( )
|
|
{
|
|
CloneableDictionary<TKey, TValue> clone = new CloneableDictionary<TKey, TValue>();
|
|
foreach ( KeyValuePair<TKey, TValue> kvp in this ) {
|
|
clone.Add( kvp.Key, ( TValue )kvp.Value.Clone( ) );
|
|
}
|
|
return clone;
|
|
}
|
|
}
|
|
|
|
public class CloneableList<TValue> : List<TValue> where TValue : ICloneable
|
|
{
|
|
public virtual CloneableList<TValue> Clone( )
|
|
{
|
|
CloneableList<TValue> clone = new CloneableList<TValue>();
|
|
foreach ( TValue kvp in this ) {
|
|
clone.Add( ( TValue )kvp.Clone( ) );
|
|
}
|
|
return clone;
|
|
}
|
|
}
|
|
|
|
}
|