//******************************
// Written by Peter Golde
// Copyright (c) 2004-2007, Wintellect
//
// Use and restribution of this code is subject to the license agreement
// contained in the file "License.txt" accompanying this file.
//******************************
using System;
using System.Collections;
using System.Collections.Generic;
namespace Wintellect.PowerCollections
{
///
/// A holder class for various internal utility functions that need to be shared.
///
internal static class Util
{
///
/// Determine if a type is cloneable: either a value type or implementing
/// ICloneable.
///
/// Type to check.
/// Returns if the type is a value type, and does not implement ICloneable.
/// True if the type is cloneable.
public static bool IsCloneableType(Type type, out bool isValue)
{
isValue = false;
if (typeof(ICloneable).IsAssignableFrom(type)) {
return true;
}
else if (type.IsValueType) {
isValue = true;
return true;
}
else
return false;
}
}
}