Esempio n. 1
0
                public void EmitCall(IXamlILEmitter emitter)
                {
                    var method = Parent._avaloniaObject
                                 .FindMethod(m => m.IsPublic && !m.IsStatic && m.Name == "GetValue"
                                             &&
                                             m.Parameters.Count == 1 &&
                                             m.Parameters[0].Equals(Parent._avaloniaPropertyType));

                    if (method == null)
                    {
                        throw new XamlTypeSystemException(
                                  "Unable to find T GetValue<T>(AvaloniaProperty<T>) on AvaloniaObject");
                    }
                    emitter
                    .Ldsfld(Parent._field)
                    .EmitCall(method);
                    if (Parent.PropertyType.IsValueType)
                    {
                        emitter.Unbox_Any(Parent.PropertyType);
                    }
                }