public PropertyReferenceProperty(ObjectSetBase objectSet, PropertyReference propertyReference, AttributeCollection attributes, PropertyValue parentValue, Type proxyType) : base(parentValue) { if (attributes == null) { DependencyPropertyReferenceStep propertyReferenceStep = propertyReference.LastStep as DependencyPropertyReferenceStep; if (propertyReferenceStep != null) { attributes = propertyReferenceStep.Attributes; } } this.proxyType = proxyType; this.attributes = attributes; this.objectSet = objectSet; this.propertyReference = propertyReference; if (propertyReference.LastStep.IsAttachable) { this.SetName(propertyReference.LastStep.DeclaringType.Name + "." + propertyReference.LastStep.Name); } else { this.SetName(propertyReference.LastStep.Name); } this.InitializeConverter(base.get_PropertyName()); this.InitializeValueEditorParameters(); if (!JoltHelper.TypeHasEnumValues(this.PropertyTypeId)) { return; } this.objectSet.DesignerContext.ProjectManager.ProjectOpened += new EventHandler <ProjectEventArgs>(this.ProjectManager_ProjectOpened); }
public override void OnRemoveFromCategory() { if (!JoltHelper.TypeHasEnumValues(this.PropertyTypeId) || this.objectSet.DesignerContext.ProjectManager == null) { return; } this.objectSet.DesignerContext.ProjectManager.ProjectOpened -= new EventHandler <ProjectEventArgs>(this.ProjectManager_ProjectOpened); }