ToString() 공개 메소드

public ToString ( ) : String
리턴 String
예제 #1
0
 public override string ToString()
 {
     return(_value.ToString());
 }
예제 #2
0
        private static void VerifyPointer(UIntPtr ptr, ulong expected)
        {
            Assert.Equal(expected, ptr.ToUInt64());

            uint expected32 = (uint)expected;
            if (expected32 != expected)
            {
                Assert.Throws<OverflowException>(() => ptr.ToUInt32());
                return;
            }

            Assert.Equal(expected32, ptr.ToUInt32());

            Assert.Equal(expected.ToString(), ptr.ToString());

            Assert.Equal(ptr, new UIntPtr(expected));
            Assert.True(ptr == new UIntPtr(expected));
            Assert.False(ptr != new UIntPtr(expected));

            Assert.NotEqual(ptr, new UIntPtr(expected + 1));
            Assert.False(ptr == new UIntPtr(expected + 1));
            Assert.True(ptr != new UIntPtr(expected + 1));
        }
예제 #3
0
 private void SetThreadAffinity(int threadIndex, IntPtr hThread)
 {
     UIntPtr newThreadAffinity = new UIntPtr((uint)threadIndex + 1);
     uint result = Native.SetThreadAffinityMask(hThread, newThreadAffinity);
     if (result == 0)
     {
         int errorCode = Marshal.GetLastWin32Error();
         Log(string.Format("Thread affinity setting failed. New: {0}, Win32Error: {1}",
             newThreadAffinity.ToString(),
             errorCode));
     }
     else
     {
         Log(string.Format("Thread affinity setting succeeded. Previouse: {0}, New: {1}",
             result,
             newThreadAffinity.ToString()));
     }
 }