Esempio n. 1
0
 /// <summary>
 /// Gets the best possible type descriptor for a specified CLR object.
 /// </summary>
 /// <param name="o">The object.</param>
 /// <returns></returns>
 public static IUserDataDescriptor GetDescriptorForObject(object o)
 {
     return(TypeDescriptorRegistry.GetDescriptorForType(o.GetType(), true));
 }
Esempio n. 2
0
		/// <summary>
		/// Gets the best possible type descriptor for a specified CLR type.
		/// </summary>
		/// <typeparam name="T">The CLR type for which the descriptor is desired.</typeparam>
		/// <param name="searchInterfaces">if set to <c>true</c> interfaces are used in the search.</param>
		/// <returns></returns>
		public static IUserDataDescriptor GetDescriptorForType<T>(bool searchInterfaces)
		{
			return TypeDescriptorRegistry.GetDescriptorForType(typeof(T), searchInterfaces);
		}
Esempio n. 3
0
 /// <summary>
 /// Gets the best possible type descriptor for a specified CLR type.
 /// </summary>
 /// <param name="type">The CLR type for which the descriptor is desired.</param>
 /// <param name="searchInterfaces">if set to <c>true</c> interfaces are used in the search.</param>
 /// <returns></returns>
 public static IUserDataDescriptor GetDescriptorForType(Type type, bool searchInterfaces)
 {
     return(TypeDescriptorRegistry.GetDescriptorForType(type, searchInterfaces));
 }
Esempio n. 4
0
 /// <summary>
 /// Gets the best possible type descriptor for a specified CLR object.
 /// </summary>
 /// <param name="o">The object.</param>
 /// <returns></returns>
 public static IUserDataDescriptor GetDescriptorForObject <T>(T t)
 {
     return(TypeDescriptorRegistry.GetDescriptorForType(typeof(T).IsValueType ? typeof(T) : t.GetType(), true));
 }