示例#1
0
 public void _16To10Test()
 {
     Assert.Equal(0, AnyRadixConvert._16To10("0"));
     Assert.Equal(1, AnyRadixConvert._16To10("01"));
     Assert.Equal(10, AnyRadixConvert._16To10("A"));
     Assert.Equal(100, AnyRadixConvert._16To10("64"));
     Assert.Throws <ArgumentException>(() => AnyRadixConvert._16To10("fds&*("));
 }
示例#2
0
        public void _16To10Test()
        {
            Assert.AreEqual(AnyRadixConvert._16To10("0"), 0);
            Assert.AreEqual(AnyRadixConvert._16To10("01"), 1);
            Assert.AreEqual(AnyRadixConvert._16To10("A"), 10);
            Assert.AreEqual(AnyRadixConvert._16To10("64"), 100);
//            Assert.Throws<ArgumentException>(() => AnyRadixConvert._16To10("fds&*("));
        }
示例#3
0
        public override string ToString()
        {
            string result = Offset;

            if (BaseAddress != null)
            {
                result = BaseAddress.Name == "游戏基址"
                    ? AnyRadixConvert._10To16(AnyRadixConvert._16To10(BaseAddress.Offset) + AnyRadixConvert._16To10(Offset))
                    : string.Format("[{0}]+{1}", BaseAddress.ToString(), Offset);
            }
            return(string.IsNullOrEmpty(result) ? "0" : result.StartsWith("[") || result[0] == '0' ? result : '0' + result);
        }