ToString() public method

public ToString ( ) : string
return string
コード例 #1
0
        static StackObject *ToString_11(ILIntepreter __intp, StackObject *__esp, List <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.SByte instance_of_this_method = GetInstance(__domain, ptr_of_this_method, __mStack);

            var result_of_this_method = instance_of_this_method.ToString();

            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
コード例 #2
0
        static StackObject *ToString_13(ILIntepreter __intp, StackObject *__esp, List <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.String format = (System.String) typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.SByte instance_of_this_method = GetInstance(__domain, ptr_of_this_method, __mStack);

            var result_of_this_method = instance_of_this_method.ToString(format);

            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
コード例 #3
0
ファイル: Convert.cs プロジェクト: mstaessen/fluorinefx
        // Nullable Types.

        /// <summary>
        /// Converts the value of the specified nullable 8-bit signed integer to its equivalent SqlString representation.
        /// </summary>
        /// <param name="value">A nullable 8-bit signed integer.</param>
        /// <returns>The SqlString equivalent of the value of value.</returns>
        
        public static SqlString ToSqlString(SByte? value) { return value.HasValue ? value.ToString() : SqlString.Null; }
コード例 #4
0
ファイル: Convert.cs プロジェクト: mstaessen/fluorinefx
 /// <summary>
 /// Converts the value of the specified 8-bit signed integer to its equivalent SqlString representation.
 /// </summary>
 /// <param name="value">An 8-bit signed integer.</param>
 /// <returns>The SqlString equivalent of the 8-bit signed integer value.</returns>
 
 public static SqlString ToSqlString(SByte value) { return value.ToString(); }
コード例 #5
0
ファイル: Convert.cs プロジェクト: mstaessen/fluorinefx
		// Nullable Types.

        /// <summary>
        /// Converts the value of the specified nullable 8-bit signed integer to its equivalent SqlChars representation.
        /// </summary>
        /// <param name="value">A nullable 8-bit signed integer.</param>
        /// <returns>The equivalent SqlChars.</returns>
        
        public static SqlChars ToSqlChars(SByte? value) { return value.HasValue ? new SqlChars(value.ToString().ToCharArray()) : SqlChars.Null; }
コード例 #6
0
		public static SqlString ToSqlString(SByte           p) { return p.ToString();                                                                     }
コード例 #7
0
ファイル: Convert.cs プロジェクト: MajidSafari/bltoolkit
		public static SqlChars ToSqlChars(SByte? p)          { return p.HasValue? new SqlChars(p.ToString().ToCharArray()): SqlChars.Null; }
コード例 #8
0
ファイル: ItemProtoParser.cs プロジェクト: MisterDr/FOCommon
 private void ParseLine(string IfText, string OldText, ref SByte Value, bool Compatibility, bool Load, bool ignoreZero = true)
 {
     String V = Value.ToString(); ParseLine(IfText, OldText, ref V, Compatibility, Load, ignoreZero); Value = SByte.Parse(V);
 }
コード例 #9
0
ファイル: GlobLocHelper.cs プロジェクト: CheneyWu/coreclr
 public static unsafe string OSSByteToString(SByte n, string s, CultureInfo ci)
 {
     if (Utilities.IsWindows)
     {
         NumberFormatInfo nfi = NumberFormatInfoFromLCID(LCIDFromCultureInfo(ci));
         return n.ToString(s, nfi);
     }
     else
     {
         return OSNumberToStringMac(new IntPtr((void*)&n), s, ci, CFNumberType.kCFNumberSInt8Type, n);
     }
 }
コード例 #10
0
ファイル: Convert.cs プロジェクト: epdumitru/mysqlib
		public static String ToString(SByte? p)          { return p.ToString(); }
コード例 #11
0
        //
        // Helper for Enum.Format(,,"d")
        //
        private static String DoFormatD(ulong rawValue, RuntimeImports.RhCorElementType corElementType)
        {
            switch (corElementType)
            {
            case RuntimeImports.RhCorElementType.ELEMENT_TYPE_I1:
            {
                SByte result = (SByte)rawValue;

                return(result.ToString());
            }

            case RuntimeImports.RhCorElementType.ELEMENT_TYPE_U1:
            {
                Byte result = (Byte)rawValue;

                return(result.ToString());
            }

            case RuntimeImports.RhCorElementType.ELEMENT_TYPE_BOOLEAN:
            {
                // direct cast from bool to byte is not allowed
                bool b = (rawValue != 0);
                return(b.ToString());
            }

            case RuntimeImports.RhCorElementType.ELEMENT_TYPE_I2:
            {
                Int16 result = (Int16)rawValue;

                return(result.ToString());
            }

            case RuntimeImports.RhCorElementType.ELEMENT_TYPE_U2:
            {
                UInt16 result = (UInt16)rawValue;

                return(result.ToString());
            }

            case RuntimeImports.RhCorElementType.ELEMENT_TYPE_CHAR:
            {
                Char result = (Char)rawValue;

                return(result.ToString());
            }

            case RuntimeImports.RhCorElementType.ELEMENT_TYPE_U4:
            {
                UInt32 result = (UInt32)rawValue;

                return(result.ToString());
            }

            case RuntimeImports.RhCorElementType.ELEMENT_TYPE_I4:
            {
                Int32 result = (Int32)rawValue;

                return(result.ToString());
            }

            case RuntimeImports.RhCorElementType.ELEMENT_TYPE_U8:
            {
                UInt64 result = (UInt64)rawValue;

                return(result.ToString());
            }

            case RuntimeImports.RhCorElementType.ELEMENT_TYPE_I8:
            {
                Int64 result = (Int64)rawValue;

                return(result.ToString());
            }

            default:
                Contract.Assert(false, "Invalid Object type in Format");
                throw new InvalidOperationException(SR.InvalidOperation_UnknownEnumType);
            }
        }
コード例 #12
0
ファイル: Convert.cs プロジェクト: epdumitru/mysqlib
		public static SqlString ToSqlString(SByte? p)          { return p.HasValue? p.ToString(): SqlString.Null; }
コード例 #13
0
 public Boolean TestToString(SByte testSubject) {
 strLoc = "3498d";
 String b1 = "";
 String b2 = "";
 Boolean pass = false;
 Boolean excthrown = false;
 Object exc1 = null;
 Object exc2 = null;
 try {
 b1 = testSubject.ToString();
 pass = true;
 excthrown = false;
 } catch (Exception exc) {
 exc1 = exc;
 pass = false;
 excthrown = true;
 }
 try {
 b2 = Convert.ToString(testSubject);
 pass = pass & true;
 excthrown = false;
 } catch (Exception exc) {
 exc2 = exc;
 pass = false;
 excthrown = excthrown & true;
 }
 if(excthrown)
   if(exc1.GetType() == exc2.GetType())
     return true;
   else
     return false;
 else if(pass && b1.Equals(b2))
   return true;
 else
   return false;
 }	
コード例 #14
0
ファイル: stringconcat1.cs プロジェクト: CheneyWu/coreclr
 public bool PosTest12()
 {
     bool retVal = true;
     string ActualResult;
     object ObjA;
     TestLibrary.TestFramework.BeginScenario("PosTest12:Concat an object of SByte");
     try
     {
         ObjA = new SByte();
         ActualResult = string.Concat(ObjA);
         if (ActualResult != ObjA.ToString())
         {
             TestLibrary.TestFramework.LogError("023", "Concat an object of SByte ExpectResult is equel" + ObjA.ToString()+ ",ActualResult is (" + ActualResult + ")");
             retVal = false;
         }
     }
     catch (Exception e)
     {
         TestLibrary.TestFramework.LogError("024", "Unexpected exception" + e);
         retVal = false;
     }
     return retVal;
 }
コード例 #15
0
ファイル: PHPConvert.cs プロジェクト: bluelovers/phprpc
 public static Mono.Math.BigInteger ToMonoBigInteger(SByte value)
 {
     return Mono.Math.BigInteger.Parse(value.ToString("#"));
 }
コード例 #16
0
 public void CheckSByte(SByte value, string format)
 {
     var parsed = Format.Parse(format);
     var formatter = new StringFormatter(pool);
     formatter.Append(value, parsed);
     var result = formatter.ToString();
     var clrResult = value.ToString(format, CultureInfo.InvariantCulture);
     Assert.Equal(clrResult, result);
 }
コード例 #17
0
ファイル: PHPConvert.cs プロジェクト: bluelovers/phprpc
 public static BigInteger ToBigInteger(SByte value)
 {
     return BigInteger.Parse(value.ToString("#"));
 }
コード例 #18
0
ファイル: XmlConvert.cs プロジェクト: GirlD/mono
		public static string ToString(SByte value)
		{
			return value.ToString(CultureInfo.InvariantCulture);
		}
コード例 #19
0
 // IConvertible
 public string ToString(string format, IFormatProvider formatProvider)
 {
     return(m_v.ToString(format, formatProvider));
 }
コード例 #20
0
ファイル: IniFile.cs プロジェクト: Robin--/RMLib
 public SByte ReadSByte(string ASection, string AKey, SByte ADefault)
 {
     SByte X;
     string Result = ReadString(ASection, AKey, ADefault.ToString());
     return (SByte.TryParse(Result, out X)) ? X : ADefault;
 }