System.Windows.Application.convert_keyframe_value_cb C# (CSharp) Method

convert_keyframe_value_cb() private method

private convert_keyframe_value_cb ( Kind kind, IntPtr property_ptr, IntPtr original, Value &converted ) : void
kind Kind
property_ptr IntPtr
original IntPtr
converted Value
return void
		void convert_keyframe_value_cb (Kind kind, IntPtr property_ptr, IntPtr original, out Value converted)
		{
			Type type = Deployment.Current.Types.KindToType (kind);
			if (type != null)
				Types.Ensure (type);
			
			DependencyProperty property = DependencyProperty.Lookup (property_ptr);
			if (property == null) {
				Console.WriteLine ("Moonlight Error: Property couldn't be looked up");
				converted = Value.Empty;
				return;
			}
			
			object o = Value.ToObject (null, original);
			if (o == null) {
				Console.WriteLine ("Moonlight Error: Object was null");
				converted = Value.Empty;
				return;
			}
			
			o = MoonlightTypeConverter.ConvertObject (property, o, null, true);
			
			if (o == null) {
				Console.WriteLine ("Moonlight Error: Converted to null");
				converted = Value.Empty;
				return;
			}

			// This is freed in native code
			converted = Value.FromObject (o);
		}