本文整理汇总了C#中Environment.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# Environment.GetType方法的具体用法?C# Environment.GetType怎么用?C# Environment.GetType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Environment
的用法示例。
在下文中一共展示了Environment.GetType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Equals
/// <summary>
/// Compares for reference AND value equality.
/// </summary>
/// <param name="obj">The object to compare with this instance.</param>
/// <returns>
/// <c>true</c> if both operands are equal; otherwise, <c>false</c>.
/// </returns>
public bool Equals(Environment obj)
{
bool ivarsEqual = true;
if (obj.GetType() != this.GetType())
{
return false;
}
if (this._environmentType != obj._environmentType)
{
ivarsEqual = false;
}
if (this._length != obj._length)
{
ivarsEqual = false;
}
if (this._index != obj._index)
{
ivarsEqual = false;
}
if (this._padding != obj._padding)
{
ivarsEqual = false;
}
return ivarsEqual;
}
示例2: equals
/**
* The equals method doesn't always work--mostly on on classes that consist only of primitives. Be careful.
*/
public bool equals(Environment rhs)
{
bool ivarsEqual = true;
if(rhs.GetType() != this.GetType())
return false;
if( ! (_environmentType == rhs._environmentType)) ivarsEqual = false;
if( ! (_length == rhs._length)) ivarsEqual = false;
if( ! (_index == rhs._index)) ivarsEqual = false;
if( ! (_padding1 == rhs._padding1)) ivarsEqual = false;
if( ! (_geometry == rhs._geometry)) ivarsEqual = false;
if( ! (_padding2 == rhs._padding2)) ivarsEqual = false;
return ivarsEqual;
}