Example #1
0
 public string ToStringAllBase( )
 {
     return(string.Format("[QWORD: (D): {0} | (H): {1} | (B): {2}",
                          ConventionSupport.ProduceDecimalString(mulQWORD),
                          ConventionSupport.ProduceHexString(mulQWORD),
                          ConventionSupport.ProduceBinaryString(mulQWORD)
                          ));
 }
Example #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);
        }
Example #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()));
        }
Example #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'));
        }
Example #5
0
 public override string ToString( )
 {
     return("[BIT: " + ConventionSupport.ProduceBinaryString((byte)(mbnValue.Value & BinaryValue.BitMask_1bit)) + "]");
 }
Example #6
0
 public override string ToString( )
 {
     return("[NYBLE: " + ConventionSupport.ProduceBinaryNybleString((byte)(mnNyble & BinaryValue.BitMask_4bit)) + "]");
 }
Example #7
0
 public override string ToString( )
 {
     return("[DWORD: " + ConventionSupport.ProduceHexString(( uint )(muiDWORD & BinaryValue.BitMask_32bit)) + "]");
 }
Example #8
0
 public override string ToString( )
 {
     return("[BYTE: " + ConventionSupport.ProduceHexString(( byte )(mbByte & BinaryValue.BitMask_8bit)) + "]");
 }
Example #9
0
 public override string ToStringDecimal( )
 {
     return("[BYTE: " + ConventionSupport.ProduceDecimalString(mbByte) + "]");
 }
Example #10
0
 public override string ToString( )
 {
     return("[QWORD: " + ConventionSupport.ProduceHexString((ulong)(mulQWORD & BinaryValue.BitMask_64bit)) + "]");
 }
Example #11
0
 public override string ToString( )
 {
     return("[WORD: " + ConventionSupport.ProduceHexString(( ushort )(musWORD & BinaryValue.BitMask_16bit)) + "]");
 }