public MiniSourceBindingDialogModel(DataSchemaNodePath bindingPath, SceneNode targetElement, IType targetPropertyType) : base(bindingPath, targetElement, (ReferenceStep)null) { this.targetPropertyType = targetPropertyType; this.sourceBindingProperties = MiniSourceBindingDialogModel.GetBindableProperties(targetElement, targetPropertyType); this.Initialize(); }
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)); }
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); }
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)))); }