public static void CreateAndSetElementNameBinding(SceneNodeProperty sceneNodeProperty, SceneNode nodeToTarget) { BehaviorHelper.CreateAndSetElementNameBinding(sceneNodeProperty.PropertyName, nodeToTarget, (Action <BindingSceneNode>)(bindingNode => sceneNodeProperty.SetValue((object)bindingNode.DocumentNode))); }
public void Rebuild() { foreach (PropertyBase propertyBase in this.subProperties) { propertyBase.Associated = false; } PropertyDescriptorCollection descriptorCollection = (PropertyDescriptorCollection)null; Type targetType = ((PropertyEntry)this.parentProperty).get_PropertyType(); bool isMixed; DocumentNode valueAsDocumentNode = this.parentProperty.GetLocalValueAsDocumentNode(true, out isMixed); if (valueAsDocumentNode == null || !(valueAsDocumentNode is DocumentPrimitiveNode) && !valueAsDocumentNode.Type.IsBinding) { TypeConverter converterFromAttributes = MetadataStore.GetTypeConverterFromAttributes(targetType.Assembly, this.parentProperty.Attributes); if (converterFromAttributes != null) { object obj = this.parentProperty.SceneNodeObjectSet.GetValue(this.parentProperty.Reference, this.parentProperty.IsExpression ? PropertyReference.GetValueFlags.Computed : PropertyReference.GetValueFlags.Local); if (obj != null && obj != MixedProperty.Mixed) { descriptorCollection = converterFromAttributes.GetProperties(obj); targetType = obj.GetType(); } } if (descriptorCollection == null) { object component = this.parentProperty.SceneNodeObjectSet.GetValue(this.parentProperty.Reference, this.parentProperty.IsExpression ? PropertyReference.GetValueFlags.Computed : PropertyReference.GetValueFlags.Local); if (component != null && component != MixedProperty.Mixed) { descriptorCollection = TypeUtilities.GetProperties(component); targetType = component.GetType(); } } } this.objectSet.RebuildObjects(); IProjectContext projectContext = this.parentProperty.SceneNodeObjectSet.ProjectContext; if (projectContext != null && descriptorCollection != null) { SceneNode[] objects = this.objectSet.Objects; foreach (PropertyDescriptor propertyDescriptor in descriptorCollection) { ReferenceStep referenceStep = PlatformTypeHelper.GetProperty((ITypeResolver)projectContext, targetType, propertyDescriptor) as ReferenceStep; if (referenceStep != null) { TargetedReferenceStep targetedReferenceStep = new TargetedReferenceStep(referenceStep, this.objectSet.ObjectTypeId); if (PropertyInspectorModel.IsPropertyBrowsable(objects, targetedReferenceStep) && PropertyInspectorModel.IsAttachedPropertyBrowsable(objects, this.objectSet.ObjectTypeId, targetedReferenceStep, (ITypeResolver)this.parentProperty.SceneNodeObjectSet.ProjectContext)) { PropertyReference propertyReference = new PropertyReference(referenceStep); SceneNodeProperty property = this.FindProperty(propertyReference); if (property == null) { SceneNodeProperty sceneNodeProperty = this.objectSet.CreateProperty(propertyReference, referenceStep.Attributes) as SceneNodeProperty; int index = this.subProperties.BinarySearch(sceneNodeProperty, (IComparer <SceneNodeProperty>) new SceneNodePropertyCollection.PropertyNameComparer()); if (index < 0) { index = ~index; } this.subProperties.Insert(index, sceneNodeProperty); this.OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, (object)sceneNodeProperty, index)); } else if (!property.UpdateAndRefresh(propertyReference, referenceStep.Attributes, (Type)null)) { property.Associated = true; } } } } } for (int index = this.subProperties.Count - 1; index >= 0; --index) { if (!this.subProperties[index].Associated) { PropertyEntry propertyEntry = (PropertyEntry)this.subProperties[index]; this.subProperties[index].OnRemoveFromCategory(); this.subProperties.RemoveAt(index); this.OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, (object)propertyEntry, index)); } } this.OnPropertyChanged("Item[]"); }
private static DocumentCompositeNode GetLocalValueAsDocumentNode(SceneNodeProperty parentProperty, bool resolved, out bool isMixed) { GetLocalValueFlags flags = resolved ? GetLocalValueFlags.Resolve : GetLocalValueFlags.None; return(parentProperty.SceneNodeObjectSet.GetLocalValueAsDocumentNode(parentProperty, flags, out isMixed) as DocumentCompositeNode); }
internal void AddProperty(PropertyReference propertyReference, SceneNodeProperty property) { this.cachedProperties[propertyReference] = new KeyValuePair <SceneNodeProperty, bool>(property, false); }
public PickWhipEngine(FrameworkElement editor, SceneNodeProperty editingProperty, IElementSelectionStrategy strategy, Cursor cursor) : this((IPickWhipHost) new PickWhipHost(editor, editingProperty, strategy, cursor)) { }
public abstract DocumentNode GetLocalValueAsDocumentNode(SceneNodeProperty property, GetLocalValueFlags flags, out bool isMixed);
public abstract SceneNode CreateAndSetBindingOrData(SceneNodeProperty property);
public abstract void SetValueToTemplateBinding(SceneNodeProperty propertyKey, ReferenceStep referenceStep);
public abstract void SetValueToSystemResource(SceneNodeProperty propertyKey, SystemResourceModel systemResource);
public abstract void SetValueToLocalResource(SceneNodeProperty propertyKey, LocalResourceModel localResource);