Exemple #1
0
        protected IDataflowProvider <ComponentType> CoalescedPropertyComponentValue <ComponentType>(Func <T, ComponentType> selector, ComponentType defaultValue = default(ComponentType))
        {
            var indexParameters = EditorParams.PropertyInfo.GetIndexParameters();

            if (indexParameters.Length == 0)
            {
                IDataflowProvider <ComponentType> provider = null;
                foreach (var o in EditorParams.Objects)
                {
                    var p = new Property <T>(o, EditorParams.PropertyName).Select(selector);
                    provider = (provider == null) ? p : provider.SameOrDefault(p, defaultValue);
                }
                return(provider);
            }
            else if (indexParameters.Length == 1 && indexParameters.First().ParameterType == typeof(int))
            {
                IDataflowProvider <ComponentType> provider = null;
                foreach (var o in EditorParams.Objects)
                {
                    var p = new IndexedProperty <T>(o, EditorParams.PropertyName, EditorParams.IndexInList).Select(selector);
                    provider = (provider == null) ? p : provider.SameOrDefault(p, defaultValue);
                }
                return(provider);
            }
            else
            {
                throw new NotSupportedException();
            }
        }
Exemple #2
0
        public static IDataflowProvider <R> GetProvider <R>(IPropertyEditorParams context, Func <IKeyframe, R> selector)
        {
            IDataflowProvider <R> provider = null;

            foreach (var obj in context.RootObjects)
            {
                var p = new DataflowProvider <IKeyframe>(() => new KeyframeDataflow(obj, context.PropertyPath)).Select(selector);
                provider = (provider == null) ? p : provider.SameOrDefault(p);
            }
            return(provider);
        }
Exemple #3
0
        protected IDataflowProvider <ComponentType> CoalescedPropertyComponentValue <ComponentType>(Func <T, ComponentType> selector, ComponentType defaultValue = default(ComponentType))
        {
            IDataflowProvider <ComponentType> provider = null;

            foreach (var o in EditorParams.Objects)
            {
                var p = new Property <T>(o, EditorParams.PropertyName).Select(selector);
                provider = (provider == null) ? p : provider.SameOrDefault(p, defaultValue);
            }
            return(provider);
        }
Exemple #4
0
        protected IDataflowProvider <T> CoalescedPropertyValue(T defaultValue = default(T))
        {
            IDataflowProvider <T> provider = null;

            foreach (var o in EditorParams.Objects)
            {
                var p = new Property <T>(o, EditorParams.PropertyName);
                provider = (provider == null) ? p : provider.SameOrDefault(p, defaultValue);
            }
            return(provider);
        }