예제 #1
0
 public string ToStringAllBase( )
 {
     return(string.Format("[QWORD: (D): {0} | (H): {1} | (B): {2}",
                          ConventionSupport.ProduceDecimalString(mulQWORD),
                          ConventionSupport.ProduceHexString(mulQWORD),
                          ConventionSupport.ProduceBinaryString(mulQWORD)
                          ));
 }
예제 #2
0
        public static string ProduceErrorMsg(StackTrace oStackTrace, string sMsg)
        {
            smStackTrace = oStackTrace;

            return(ConventionSupport.cmsErrorMsgPrefix +
                   "[" + sMsg + "] " +
                   ConventionSupport.GetCurrentMethodFileName( ) + ConventionSupport.cmsSpace +
                   ConventionSupport.GetCurrentMethodLineNumber( ) + ConventionSupport.cmsSpace +
                   ConventionSupport.GetCurrentMethodName( ) + ConventionSupport.cmsSpace +
                   ConventionSupport.cmsNewLine);
        }
예제 #3
0
        public static string ProduceHexString(ulong iValue, int iNumHexDigits)
        {
            if (iNumHexDigits > ConventionSupport.MaxiumHexDigitsForToString || iNumHexDigits < ConventionSupport.MinimumDigitsForToString)
            {
                StackTrace oStackTrace = new StackTrace( );

                string sMsg = string.Format("{0} ( int iValue, int iNumBinaryDigits ): iNumHexDigits must be >= {1} or <= {2} -> was '{3}'",
                                            ConventionSupport.GetCurrentMethodName(new StackTrace( )),
                                            ConventionSupport.MinimumDigitsForToString,
                                            ConventionSupport.MaxiumHexDigitsForToString,
                                            iNumHexDigits);

                throw new Exception(ConventionSupport.ProduceErrorMsg(oStackTrace, sMsg));
            }

            return(ConventionSupport.HexPrefix + iValue.ToString("X" + iNumHexDigits.ToString()));
        }
예제 #4
0
        public static string ProduceBinaryString(ulong iValue, int iNumBinaryDigits)
        {
            if (iNumBinaryDigits > ConventionSupport.MaxiumBinaryDigitsForToString || iNumBinaryDigits < ConventionSupport.MinimumDigitsForToString)
            {
                StackTrace oStackTrace = new StackTrace( );

                string sMsg = string.Format("{0} ( int iValue, int iNumBinaryDigits ): iNumBinaryDigits must be >= {1} or <= {2} -> was '{3}'",
                                            ConventionSupport.GetCurrentMethodName(oStackTrace),
                                            ConventionSupport.MinimumDigitsForToString,
                                            ConventionSupport.MaxiumBinaryDigitsForToString,
                                            iNumBinaryDigits);


                throw new Exception(ConventionSupport.ProduceErrorMsg(oStackTrace, sMsg));
            }

            return(ConventionSupport.BinaryPrefix + Convert.ToString((int)iValue, 2).PadLeft(iNumBinaryDigits, '0'));
        }
예제 #5
0
파일: BIT.cs 프로젝트: jon-str/EmuSandbox
 public override string ToString( )
 {
     return("[BIT: " + ConventionSupport.ProduceBinaryString((byte)(mbnValue.Value & BinaryValue.BitMask_1bit)) + "]");
 }
예제 #6
0
 public override string ToString( )
 {
     return("[NYBLE: " + ConventionSupport.ProduceBinaryNybleString((byte)(mnNyble & BinaryValue.BitMask_4bit)) + "]");
 }
예제 #7
0
 public override string ToString( )
 {
     return("[DWORD: " + ConventionSupport.ProduceHexString(( uint )(muiDWORD & BinaryValue.BitMask_32bit)) + "]");
 }
예제 #8
0
 public override string ToString( )
 {
     return("[BYTE: " + ConventionSupport.ProduceHexString(( byte )(mbByte & BinaryValue.BitMask_8bit)) + "]");
 }
예제 #9
0
 public override string ToStringDecimal( )
 {
     return("[BYTE: " + ConventionSupport.ProduceDecimalString(mbByte) + "]");
 }
예제 #10
0
 public override string ToString( )
 {
     return("[QWORD: " + ConventionSupport.ProduceHexString((ulong)(mulQWORD & BinaryValue.BitMask_64bit)) + "]");
 }
예제 #11
0
파일: WORD.CS 프로젝트: jon-str/EmuSandbox
 public override string ToString( )
 {
     return("[WORD: " + ConventionSupport.ProduceHexString(( ushort )(musWORD & BinaryValue.BitMask_16bit)) + "]");
 }