• Manual
  • API Documentation
  • Bayat.Json.Utilities
  • ConvertUtils

    Show / Hide Table of Contents
    • Bayat
      • UnityThread
    • Bayat.Core
      • AddReferenceWindow
      • AddReferenceWindow.Dependency
      • AssetReferenceResolver
      • AssetReferenceResolverEditor
      • BayatEditorStyles
      • CoreAssetPostProcessor
      • EditorApplicationUtility
      • MaterialPropertiesResolver
      • MaterialPropertiesResolverEditor
      • ReferenceCheckerWindow
      • ReferenceResolverMode
      • RuntimeMaterialProperties
      • RuntimeMaterialProperty
      • RuntimeMaterialPropertyType
      • SceneReferenceResolver
      • SceneReferenceResolverEditor
      • UnityEditorInternalException
    • Bayat.Core.EditorWindows
      • AssetReferenceManagerWindow
      • AssetReferenceManagerWindow.Styles
      • DatabaseMigrationWindow
      • DatabaseMigrationWindow.SceneMigrationStatus
      • DatabaseMigrationWindow.Styles
      • EditorWindowExtensions
      • EditorWindowUtility
      • EditorWindowWrapper
      • SceneReferenceManagerWindow
      • SceneReferenceManagerWindow.Styles
      • WindowClose
      • WrappedEditorWindow
    • Bayat.Core.Profiling
      • ProfiledSegment
      • ProfiledSegmentCollection
      • ProfilingScope
      • ProfilingUtility
    • Bayat.Core.Reflection
      • AssemblyExtensions
      • Codebase
      • RuntimeCodebase
      • TypeExtensions
      • TypeUtility
    • Bayat.Core.Text
      • StringExtensions
      • StringUtility
    • Bayat.Core.Utilities
      • ExceptionExtensions
      • GuidToReferenceDictionary
      • SerializableDictionary<TKey, TVal>
    • Bayat.Json
      • ConstructorHandling
      • CreateObjectConverterWindow
      • CreateObjectConverterWindow.Styles
      • DateFormatHandling
      • DateParseHandling
      • DateTimeZoneHandling
      • DefaultValueHandling
      • FloatFormatHandling
      • FloatParseHandling
      • Formatting
      • GameObjectSerializationHandler
      • GameObjectSerializationManagerTreeView
      • GameObjectSerializationManagerTreeView.Styles
      • GameObjectSerializationManagerWindow
      • GameObjectSerializationManagerWindow.Styles
      • IArrayPool<T>
      • IJsonLineInfo
      • JsonArrayAttribute
      • JsonConstructorAttribute
      • JsonContainerAttribute
      • JsonContainerType
      • JsonConvert
      • JsonConverter
      • JsonConverterAttribute
      • JsonConverterCollection
      • JsonDefaultSettingsWindow
      • JsonDefaultSettingsWindow.Styles
      • JsonDictionaryAttribute
      • JsonException
      • JsonExtensionDataAttribute
      • JsonIgnoreAttribute
      • JsonObjectAttribute
      • JsonPosition
      • JsonPropertyAttribute
      • JsonReader
      • JsonReader.State
      • JsonReaderException
      • JsonRequiredAttribute
      • JsonSerializationException
      • JsonSerializer
      • JsonSerializerSettings
      • JsonSerializerSettingsPreset
      • JsonTextReader
      • JsonTextWriter
      • JsonToken
      • JsonWriter
      • JsonWriter.State
      • JsonWriterException
      • MemberSerialization
      • MetadataPropertyHandling
      • MissingMemberHandling
      • NullValueHandling
      • ObjectCreationHandling
      • PreserveReferencesHandling
      • ReadType
      • ReferenceLoopHandling
      • Required
      • StringEscapeHandling
      • TypeNameHandling
      • WriteState
    • Bayat.Json.Bson
      • BsonArray
      • BsonBinary
      • BsonBinaryType
      • BsonBinaryWriter
      • BsonObject
      • BsonObjectId
      • BsonProperty
      • BsonReader
      • BsonRegex
      • BsonString
      • BsonToken
      • BsonType
      • BsonValue
      • BsonWriter
    • Bayat.Json.Converters
      • AnimatorConverter
      • AudioClipConverter
      • BinaryConverter
      • BoundsConverter
      • BsonObjectIdConverter
      • ColliderConverter
      • ColorConverter
      • CustomCreationConverter<T>
      • DateTimeConverterBase
      • DiscriminatedUnionConverter
      • EntityKeyMemberConverter
      • ExpandoObjectConverter
      • GameObjectConverter
      • HashSetConverter
      • IsoDateTimeConverter
      • JavaScriptDateTimeConverter
      • KeyValuePairConverter
      • MaterialConverter
      • MaterialConverter.JsonSerializedMaterialProperty
      • Matrix4x4Converter
      • MeshConverter
      • MeshConverter.SerializedIndices
      • MeshFilterConverter
      • ObjectJsonConverter
      • QuaternionConverter
      • RectConverter
      • RectTransformConverter
      • RegexConverter
      • RendererConverter
      • ResolutionConverter
      • ShaderConverter
      • SpriteConverter
      • StringEnumConverter
      • Texture2DConverter
      • TransformConverter
      • UnityBehaviourConverter
      • UnityComponentConverter
      • UnityMonoBehaviourConverter
      • UnityObjectConverter
      • UriConverter
      • VectorConverter
      • VersionConverter
      • XmlNodeConverter
    • Bayat.Json.Linq
      • CommentHandling
      • Extensions
      • IJEnumerable<T>
      • JArray
      • JConstructor
      • JContainer
      • JEnumerable<T>
      • JObject
      • JProperty
      • JPropertyDescriptor
      • JPropertyKeyedCollection
      • JRaw
      • JsonLoadSettings
      • JsonMergeSettings
      • JToken
      • JTokenEqualityComparer
      • JTokenReader
      • JTokenType
      • JTokenWriter
      • JValue
      • LineInfoHandling
      • MergeArrayHandling
      • MergeNullValueHandling
    • Bayat.Json.Linq.JsonPath
      • ArrayIndexFilter
      • ArrayMultipleIndexFilter
      • ArraySliceFilter
      • BooleanQueryExpression
      • CompositeExpression
      • FieldFilter
      • FieldMultipleFilter
      • JPath
      • PathFilter
      • QueryExpression
      • QueryFilter
      • QueryOperator
      • ScanFilter
    • Bayat.Json.Serialization
      • CachedAttributeGetter<T>
      • CamelCasePropertyNamesContractResolver
      • DefaultContractResolver
      • DefaultContractResolver.EnumerableDictionaryWrapper<TEnumeratorKey, TEnumeratorValue>
      • DefaultContractResolverState
      • DefaultReferenceResolver
      • DefaultSerializationBinder
      • DefaultSerializationBinder.TypeNameKey
      • DiagnosticsTraceWriter
      • ErrorContext
      • ErrorEventArgs
      • ExpressionValueProvider
      • ExtensionDataGetter
      • ExtensionDataSetter
      • IAttributeProvider
      • IContractResolver
      • IReferenceResolver
      • ITraceWriter
      • IValueProvider
      • JsonArrayContract
      • JsonContainerContract
      • JsonContract
      • JsonContractType
      • JsonDictionaryContract
      • JsonDynamicContract
      • JsonFormatterConverter
      • JsonISerializableContract
      • JsonLinqContract
      • JsonObjectContract
      • JsonPrimitiveContract
      • JsonProperty
      • JsonPropertyCollection
      • JsonSerializerInternalBase
      • JsonSerializerProxy
      • JsonSerializerReader
      • JsonSerializerReader.CreatorPropertyContext
      • JsonSerializerReader.PropertyPresence
      • JsonSerializerWriter
      • JsonStringContract
      • JsonTypeReflector
      • MemoryTraceWriter
      • ObjectConstructor<T>
      • OnErrorAttribute
      • ReflectionAttributeProvider
      • ReflectionValueProvider
      • ResolverContractKey
      • SerializationCallback
      • SerializationErrorCallback
      • TraceJsonReader
      • TraceJsonWriter
    • Bayat.Json.Shims
      • PreserveAttribute
    • Bayat.Json.Utilities
      • Base64Encoder
      • BidirectionalDictionary<TFirst, TSecond>
      • BufferUtils
      • CollectionUtils
      • CollectionWrapper<T>
      • ConvertUtils
      • ConvertUtils.ConvertResult
      • ConvertUtils.TypeConvertKey
      • Creator<T>
      • DateTimeParser
      • DateTimeUtils
      • DictionaryWrapper<TKey, TValue>
      • DynamicProxy<T>
      • DynamicProxyMetaObject<T>
      • DynamicUtils
      • DynamicUtils.BinderWrapper
      • EnumUtils
      • EnumValue<T>
      • ExpressionReflectionDelegateFactory
      • FSharpFunction
      • FSharpUtils
      • ImmutableCollectionsUtils
      • ImmutableCollectionsUtils.ImmutableCollectionTypeInfo
      • IWrappedCollection
      • IWrappedDictionary
      • JavaScriptUtils
      • JsonTokenUtils
      • LateBoundReflectionDelegateFactory
      • MathUtils
      • MethodCall<T, TResult>
      • MiscellaneousUtils
      • NoThrowExpressionVisitor
      • NoThrowGetBinderMember
      • NoThrowSetBinderMember
      • ParseResult
      • ParserTimeZone
      • PrimitiveTypeCode
      • PropertyNameTable
      • ReflectionDelegateFactory
      • ReflectionMember
      • ReflectionObject
      • ReflectionUtils
      • StringBuffer
      • StringReference
      • StringReferenceExtensions
      • StringUtils
      • ThreadSafeStore<TKey, TValue>
      • TypeInformation
      • ValidationUtils
    • Bayat.SaveSystem
      • AutoSave
      • AutoSaveManager
      • AutoSaveManager.LoadEvent
      • AutoSaveManager.SaveEvent
      • AutoSaveManagerWindow
      • AutoSaveManagerWindow.Styles
      • LoadEventArgs
      • LoadIntoEventArgs
      • SaveEventArgs
      • SaveSystemAPI
      • SaveSystemDefaultSettingsWindow
      • SaveSystemDefaultSettingsWindow.Styles
      • SaveSystemEditorResources
      • SaveSystemJsonSerializer
      • SaveSystemManager
      • SaveSystemSettings
      • SaveSystemSettingsPreset
      • WelcomeWindow
      • WelcomeWindow.Styles
    • Bayat.SaveSystem.Security
      • ISaveSystemEncryption
      • SaveSystemCryptoStream
      • SaveSystemSymmetricCryptoStream
      • SaveSystemSymmetricEncryption
    • Bayat.SaveSystem.Storage
      • BuiltInConnectionFactory
      • ConnectionStringFactory
      • FileStorageStream
      • IConnectionFactory
      • IStorage
      • IStorageStream
      • LocalDiskStorage
      • PlayerPrefsStorage
      • PlayerPrefsStorageStream
      • StorageBackup
      • StorageBase
      • StorageClearOperationResult
      • StorageConnectionString
      • StorageCopyOperationResult
      • StorageDeleteOperationResult
      • StorageFactory
      • StorageFullException
      • StorageInvalidIdentifierException
      • StorageItemNotFoundException
      • StorageListOptions
      • StorageMetaData
      • StorageMoveOperationResult
      • StorageOperationResult
      • StorageStream

    Class ConvertUtils

    Inheritance
    System.Object
    ConvertUtils
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Bayat.Json.Utilities
    Assembly: Bayat.Json.Runtime.dll
    Syntax
    public static class ConvertUtils

    Methods

    | Improve this Doc View Source

    Convert(Object, CultureInfo, Type)

    Declaration
    public static object Convert(object initialValue, CultureInfo culture, Type targetType)
    Parameters
    Type Name Description
    System.Object initialValue
    System.Globalization.CultureInfo culture
    System.Type targetType
    Returns
    Type Description
    System.Object
    | Improve this Doc View Source

    ConvertOrCast(Object, CultureInfo, Type)

    Converts the value to the specified type. If the value is unable to be converted, the value is checked whether it assignable to the specified type.

    Declaration
    public static object ConvertOrCast(object initialValue, CultureInfo culture, Type targetType)
    Parameters
    Type Name Description
    System.Object initialValue

    The value to convert.

    System.Globalization.CultureInfo culture

    The culture to use when converting.

    System.Type targetType

    The type to convert or cast the value to.

    Returns
    Type Description
    System.Object

    The converted type. If conversion was unsuccessful, the initial value is returned if assignable to the target type.

    | Improve this Doc View Source

    FromBigInteger(BigInteger, Type)

    Declaration
    public static object FromBigInteger(BigInteger i, Type targetType)
    Parameters
    Type Name Description
    System.Numerics.BigInteger i
    System.Type targetType
    Returns
    Type Description
    System.Object
    | Improve this Doc View Source

    GetConverter(Type)

    Declaration
    public static TypeConverter GetConverter(Type t)
    Parameters
    Type Name Description
    System.Type t
    Returns
    Type Description
    System.ComponentModel.TypeConverter
    | Improve this Doc View Source

    GetTypeCode(Type)

    Declaration
    public static PrimitiveTypeCode GetTypeCode(Type t)
    Parameters
    Type Name Description
    System.Type t
    Returns
    Type Description
    PrimitiveTypeCode
    | Improve this Doc View Source

    GetTypeCode(Type, out Boolean)

    Declaration
    public static PrimitiveTypeCode GetTypeCode(Type t, out bool isEnum)
    Parameters
    Type Name Description
    System.Type t
    System.Boolean isEnum
    Returns
    Type Description
    PrimitiveTypeCode
    | Improve this Doc View Source

    GetTypeInformation(IConvertible)

    Declaration
    public static TypeInformation GetTypeInformation(IConvertible convertable)
    Parameters
    Type Name Description
    System.IConvertible convertable
    Returns
    Type Description
    TypeInformation
    | Improve this Doc View Source

    HexTextToInt(Char[], Int32, Int32)

    Declaration
    public static int HexTextToInt(char[] text, int start, int end)
    Parameters
    Type Name Description
    System.Char[] text
    System.Int32 start
    System.Int32 end
    Returns
    Type Description
    System.Int32
    | Improve this Doc View Source

    Int32TryParse(Char[], Int32, Int32, out Int32)

    Declaration
    public static ParseResult Int32TryParse(char[] chars, int start, int length, out int value)
    Parameters
    Type Name Description
    System.Char[] chars
    System.Int32 start
    System.Int32 length
    System.Int32 value
    Returns
    Type Description
    ParseResult
    | Improve this Doc View Source

    Int64TryParse(Char[], Int32, Int32, out Int64)

    Declaration
    public static ParseResult Int64TryParse(char[] chars, int start, int length, out long value)
    Parameters
    Type Name Description
    System.Char[] chars
    System.Int32 start
    System.Int32 length
    System.Int64 value
    Returns
    Type Description
    ParseResult
    | Improve this Doc View Source

    IsConvertible(Type)

    Declaration
    public static bool IsConvertible(Type t)
    Parameters
    Type Name Description
    System.Type t
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsInteger(Object)

    Declaration
    public static bool IsInteger(object value)
    Parameters
    Type Name Description
    System.Object value
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    ParseTimeSpan(String)

    Declaration
    public static TimeSpan ParseTimeSpan(string input)
    Parameters
    Type Name Description
    System.String input
    Returns
    Type Description
    System.TimeSpan
    | Improve this Doc View Source

    ToBigInteger(Object)

    Declaration
    public static BigInteger ToBigInteger(object value)
    Parameters
    Type Name Description
    System.Object value
    Returns
    Type Description
    System.Numerics.BigInteger
    | Improve this Doc View Source

    TryConvertGuid(String, out Guid)

    Declaration
    public static bool TryConvertGuid(string s, out Guid g)
    Parameters
    Type Name Description
    System.String s
    System.Guid g
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    VersionTryParse(String, out Version)

    Declaration
    public static bool VersionTryParse(string input, out Version result)
    Parameters
    Type Name Description
    System.String input
    System.Version result
    Returns
    Type Description
    System.Boolean
    • Improve this Doc
    • View Source
    • 0 Comments
    In This Article
    • Methods
      • Convert(Object, CultureInfo, Type)
      • ConvertOrCast(Object, CultureInfo, Type)
      • FromBigInteger(BigInteger, Type)
      • GetConverter(Type)
      • GetTypeCode(Type)
      • GetTypeCode(Type, out Boolean)
      • GetTypeInformation(IConvertible)
      • HexTextToInt(Char[], Int32, Int32)
      • Int32TryParse(Char[], Int32, Int32, out Int32)
      • Int64TryParse(Char[], Int32, Int32, out Int64)
      • IsConvertible(Type)
      • IsInteger(Object)
      • ParseTimeSpan(String)
      • ToBigInteger(Object)
      • TryConvertGuid(String, out Guid)
      • VersionTryParse(String, out Version)