当前位置: 首页>>代码示例>>C#>>正文


C# Environment.GetType方法代码示例

本文整理汇总了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;
        }
开发者ID:mcgredonps,项目名称:open-dis-csharp,代码行数:38,代码来源:Environment.cs

示例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;
        }
开发者ID:mcgredonps,项目名称:open-dis-csharp,代码行数:19,代码来源:Environment.cs


注:本文中的Environment.GetType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。