object 类中的函数:protected object MemberwiseClone(),作用是什么呀,我找不到实现的代码呀?
object 类中的函数:protected object MemberwiseClone(),作用是什么呀,我找不到实现的代码呀?
以下是vs2008中自带的源码,object 中有 MemberwiseClone() 方法,但是我不知道功能是什么,为何没有实现的代码呢?
如何能看到实现的代码呢?
using System.Runtime.ConstrainedExecution;
using System.Runtime.InteropServices;
namespace System
{
// 摘要:
// Supports all classes in the .NET Framework class hierarchy and provides low-level
// services to derived classes. This is the ultimate base class of all classes
// in the .NET Framework; it is the root of the type hierarchy.
[Serializable]
[ComVisible(true)]
[ClassInterface(ClassInterfaceType.AutoDual)]
public class Object
{
// 摘要:
// Initializes a new instance of the System.Object class.
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
public Object();
// 摘要:
// Determines whether the specified System.Object is equal to the current System.Object.
//
// 参数:
// obj:
// The System.Object to compare with the current System.Object.
//
// 返回结果:
// true if the specified System.Object is equal to the current System.Object;
// otherwise, false.
//
// 异常:
// System.NullReferenceException:
// The obj parameter is null.
public virtual bool Equals(object obj);
//
// 摘要:
// Determines whether the specified System.Object instances are considered equal.
//
// 参数:
// objA:
// The first System.Object to compare.
//
// objB:
// The second System.Object to compare.
public static bool Equals(object objA, object objB);
//
// 摘要:
// Serves as a hash function for a particular type.
//
// 返回结果:
// A hash code for the current System.Object.
public virtual int GetHashCode();
//
// 摘要:
// Gets the System.Type of the current instance.
//
// 返回结果:
// The System.Type instance that represents the exact runtime type of the current
// instance.
public Type GetType();
//
// 摘要:
// Creates a shallow copy of the current System.Object.
//
// 返回结果:
// A shallow copy of the current System.Object.
protected object MemberwiseClone();
//
// 摘要:
// Determines whether the specified System.Object instances are the same instance.
//
// 参数:
// objA:
// The first System.Object to compare.
//
// objB:
// The second System.Object to compare.
//
// 返回结果:
// true if objA is the same instance as objB or if both are null references;
// otherwise, false.
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
public static bool ReferenceEquals(object objA, object objB);
//
// 摘要:
// Returns a System.String that represents the current System.Object.
//
// 返回结果:
// A System.String that represents the current System.Object.
public virtual string ToString();
}
}