Exemplo n.º 1
0
        void UpdateMenu()
        {
            var props = Model.GetType().GetProperties().Where(prop => Attribute.IsDefined(prop, typeof(TrackMenuEntryAttribute)));

            foreach (var p in props)
            {
                var item = (SvgValueWidget)Menu.GetItem(p.Name);
                if (p.PropertyType.GenericTypeArguments[0] == typeof(float))
                {
                    var prop = (EditableProperty <float>)p.GetValue(Model);
                    item.Value = prop.Value;
                }
                else if (p.PropertyType.GenericTypeArguments[0] == typeof(int))
                {
                    var prop = (EditableProperty <int>)p.GetValue(Model);
                    item.Value = prop.Value;
                }
                else if (p.PropertyType.GenericTypeArguments[0] == typeof(bool))
                {
                    var prop = (EditableProperty <bool>)p.GetValue(Model);
                    item.Value = prop.Value ? 1 : 0;
                }
            }
        }
Exemplo n.º 2
0
        public virtual void UpdateKeyframeMenu(KeyframeView kf)
        {
            var item = (SvgValueWidget)KeyframeMenu.GetItem("Time");

            item.Value = kf.Model.Time.Value;
        }