csharp 隐藏System.Object C#方法

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了csharp 隐藏System.Object C#方法相关的知识,希望对你有一定的参考价值。

#region Hide System.Object inherited methods

/// <summary>
/// Determines whether the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>.
/// </summary>
/// <returns>
/// true if the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>; otherwise, false.
/// </returns>
/// <param name="obj">The <see cref="T:System.Object"/> to compare with the current <see cref="T:System.Object"/>. </param><filterpriority>2</filterpriority>
[EditorBrowsable(EditorBrowsableState.Never)]
public override bool Equals(object obj)
{
    return base.Equals(obj);
}

/// <summary>
/// Serves as a hash function for a particular type. 
/// </summary>
/// <returns>
/// A hash code for the current <see cref="T:System.Object"/>.
/// </returns>
/// <filterpriority>2</filterpriority>
[EditorBrowsable(EditorBrowsableState.Never)]
public override int GetHashCode()
{
    return base.GetHashCode();
}

#pragma warning disable 0108
[EditorBrowsable(EditorBrowsableState.Never)]
public Type GetType()
{
    return base.GetType();
}
#pragma warning restore 0108

/// <summary>
/// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
/// </summary>
/// <returns>
/// A <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
/// </returns>
/// <filterpriority>2</filterpriority>
[EditorBrowsable(EditorBrowsableState.Never)]
public override string ToString()
{
    return base.ToString();
}

#endregion

以上是关于csharp 隐藏System.Object C#方法的主要内容,如果未能解决你的问题,请参考以下文章

C# - 将列表 System.Object[] 转换为列表 System.Int32[]

在 Directory<system.String, system.Object> 中按键访问值 - C# Unity Dictionary

未定义或导入 C# 预定义类型“System.Object”

从“System.Object [,]”c#中获取值

csharp UD01隐藏树和菜单。

接口继承自System.Object吗?