示例#1
0
 /// <summary>
 /// Creates a userdata DynValue from the specified object, using a specific descriptor
 /// </summary>
 /// <param name="o">The object</param>
 /// <param name="descr">The descriptor.</param>
 /// <returns></returns>
 public static DynValue Create(object o, IUserDataDescriptor descr)
 {
     return(DynValue.NewUserData(new UserData()
     {
         Descriptor = descr,
         Object = o
     }));
 }
示例#2
0
文件: UserData.cs 项目: amseet/Orion
		/// <summary>
		/// Creates a static userdata DynValue from the specified IUserDataDescriptor
		/// </summary>
		/// <param name="descr">The IUserDataDescriptor</param>
		/// <returns></returns>
		public static DynValue CreateStatic(IUserDataDescriptor descr)
		{
			if (descr == null) return null;

			return DynValue.NewUserData(new UserData()
			{
				Descriptor = descr,
				Object = null
			});
		}