static private Lookup ( IntPtr native ) : |
||
native | IntPtr | |
Результат |
internal DependencyPropertyChangedEventArgs(IntPtr raw) : this() { IntPtr uprop = NativeMethods.property_changed_event_args_get_property(raw); Property = DependencyProperty.Lookup(uprop); if (Property == null) { throw new Exception(string.Format("DependencyPropertyChangedEventArgs.ctor: Couldn't find the managed DependencyProperty corresponding with native {0}/{1}", uprop, NativeMethods.property_changed_event_args_get_id(raw))); } OldValue = Value.ToObject(Property.PropertyType, NativeMethods.property_changed_event_args_get_old_value(raw)); NewValue = Value.ToObject(Property.PropertyType, NativeMethods.property_changed_event_args_get_new_value(raw)); }
private static void FlattenTimelines(Storyboard storyboard, Dictionary <TimelineDataToken, Timeline> result) { if (storyboard == null) { return; } storyboard.FlattenTimelines((timeline_ptr, do_ptr, dp_ptr) => { var timeline = (Timeline)NativeDependencyObjectHelper.Lookup(timeline_ptr); var dep_ob = (DependencyObject)NativeDependencyObjectHelper.Lookup(do_ptr); var dp = (DependencyProperty)DependencyProperty.Lookup(dp_ptr); result [new TimelineDataToken(dep_ob, dp)] = timeline; }); }
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); }