Beispiel #1
0
        void ReactivePropertyEmit(IBindable bindable, List <MemberEmitter> ret)
        {
            LazyPropertyEmitter property = new LazyPropertyEmitter();
            string name = bindable.Path.Replace("/", "").Replace(".", "");

            if (bindable is IViewEvent)
            {
                name += m_Config.EventValueSuffix;
            }

            property.Name    = name;
            property.Summary = $"BindingPath : {bindable.Path}\nTarget: {bindable.ToString()}";

            if (!IsList(bindable.BindType()))
            {
                string type = GetTypeString(bindable.BindType());
                property.Type   = $"ReactiveProperty<{type}>";
                property.Create = $"new ReactiveProperty<{type}>(\"{bindable.Path}\", this)";
            }
            else
            {
                string type = GetGenericTypeString(bindable.BindType());
                property.Type   = $"ReactiveListProperty<{type}>";
                property.Create = $"new ReactiveListProperty<{type}>(\"{bindable.Path}\", this)";
            }
            ret.Add(property);
        }
Beispiel #2
0
        void PropertyEmit(IBindable bindable, List <MemberEmitter> ret)
        {
            PropertyEmitter property = new PropertyEmitter();
            string          name     = bindable.Path.Replace("/", "").Replace(".", "");

            if (bindable is IViewEvent)
            {
                name += m_Config.EventValueSuffix;
            }
            string type = GetTypeString(bindable.BindType());

            property.Name    = name;
            property.Type    = type;
            property.Setter  = new WriteLineEmitter($"set {{ SetImpl<{type}>(\"{bindable.Path}\", value); }}");
            property.Getter  = new WriteLineEmitter($"get {{ return GetImpl<{type}>(\"{bindable.Path}\"); }}");
            property.Summary = $"BindingPath : {bindable.Path}\nTarget: {bindable.ToString()}";
            ret.Add(property);
        }