예제 #1
0
 public MiniSourceBindingDialogModel(DataSchemaNodePath bindingPath, SceneNode targetElement, IType targetPropertyType)
     : base(bindingPath, targetElement, (ReferenceStep)null)
 {
     this.targetPropertyType      = targetPropertyType;
     this.sourceBindingProperties = MiniSourceBindingDialogModel.GetBindableProperties(targetElement, targetPropertyType);
     this.Initialize();
 }
예제 #2
0
        public static BindingSceneNode CreateElementNameBinding(DataSchemaNodePath bindingPath, SceneNode target, IType targetPropertyType)
        {
            MiniSourceBindingDialogModel bindingDialogModel = new MiniSourceBindingDialogModel(bindingPath, target, targetPropertyType);
            bool?nullable = new MiniBindingDialog((MiniBindingDialogModel)bindingDialogModel).ShowDialog();

            if ((!nullable.GetValueOrDefault() ? 1 : (!nullable.HasValue ? true : false)) != 0)
            {
                return((BindingSceneNode)null);
            }
            return(bindingDialogModel.CreateElementNameBinding(target));
        }
예제 #3
0
        public static IList <ReferenceStep> GetBindableProperties(SceneNode sceneNode, IType targetPropertyType)
        {
            IList <ReferenceStep> sourceProperties = BindingPropertyHelper.GetBindableSourceProperties(sceneNode);

            for (int index = sourceProperties.Count - 1; index >= 0; --index)
            {
                if (!MiniSourceBindingDialogModel.IsValidProperty(sceneNode, sourceProperties[index], targetPropertyType))
                {
                    sourceProperties.RemoveAt(index);
                }
            }
            return(sourceProperties);
        }
예제 #4
0
 public static bool AnyBindableProperties(SceneNode sceneNode, IType targetPropertyType)
 {
     return(Enumerable.Any <ReferenceStep>((IEnumerable <ReferenceStep>)BindingPropertyHelper.GetBindableSourceProperties(sceneNode), (Func <ReferenceStep, bool>)(prop => MiniSourceBindingDialogModel.IsValidProperty(sceneNode, prop, targetPropertyType))));
 }