示例#1
0
        public void RebuildObjects()
        {
            List <SceneNode> list = new List <SceneNode>();
            int length            = this.parent.Objects.Length;

            for (int index = 0; index < length; ++index)
            {
                using (this.parent.ViewModel.ForceBaseValue())
                {
                    SceneNode valueAsSceneNode = this.parent.Objects[index].GetLocalValueAsSceneNode(this.parentProperty.Reference);
                    if (valueAsSceneNode != null)
                    {
                        list.Add(valueAsSceneNode);
                    }
                }
            }
            this.objects = list.ToArray();
            if (this.baseReference != null && this.baseReference.PlatformMetadata == this.parentProperty.Reference.PlatformMetadata)
            {
                return;
            }
            SceneNodeCollectionObjectSet collectionObjectSet = this.parentProperty.SceneNodeObjectSet as SceneNodeCollectionObjectSet;

            if (collectionObjectSet != null)
            {
                this.baseReference = collectionObjectSet.BaseReference.Append(this.parentProperty.Reference);
            }
            else
            {
                this.baseReference = this.parentProperty.Reference;
            }
        }
示例#2
0
 public SceneNodePropertyCollection(SceneNodeProperty parentProperty, SceneNodePropertyValue parentValue)
     : base((PropertyValue)parentValue)
 {
     if (parentProperty == null)
     {
         throw new ArgumentNullException("parentProperty");
     }
     this.parentProperty = parentProperty;
     this.parentProperty.PropertyReferenceChanged += new Microsoft.Expression.DesignSurface.Documents.PropertyReferenceChangedEventHandler(this.OnPropertyReferenceChanged);
     this.objectSet = new SceneNodeCollectionObjectSet(this.parentProperty);
     this.Rebuild();
 }
示例#3
0
        public override void RegisterPropertyChangedHandler(PropertyReference propertyReference, Microsoft.Expression.DesignSurface.Documents.PropertyReferenceChangedEventHandler handler)
        {
            SceneNodeObjectSet sceneNodeObjectSet = (SceneNodeObjectSet)this;

            for (SceneNodeCollectionObjectSet collectionObjectSet = this; collectionObjectSet != null; collectionObjectSet = sceneNodeObjectSet as SceneNodeCollectionObjectSet)
            {
                sceneNodeObjectSet = collectionObjectSet.parent;
            }
            PropertyReference propertyReference1 = this.baseReference.Append(propertyReference);

            this.RegisteredReferences[handler] = propertyReference1;
            sceneNodeObjectSet.RegisterPropertyChangedHandler(propertyReference1, handler);
        }
示例#4
0
 public void Unhook()
 {
     foreach (SceneNodeProperty sceneNodeProperty in this.subProperties)
     {
         sceneNodeProperty.Associated = false;
         sceneNodeProperty.OnRemoveFromCategory();
     }
     this.subProperties.Clear();
     if (this.objectSet == null)
     {
         return;
     }
     this.objectSet.Dispose();
     this.objectSet = (SceneNodeCollectionObjectSet)null;
 }
示例#5
0
        public override void UnregisterPropertyChangedHandler(PropertyReference propertyReference, Microsoft.Expression.DesignSurface.Documents.PropertyReferenceChangedEventHandler handler)
        {
            SceneNodeObjectSet sceneNodeObjectSet = (SceneNodeObjectSet)this;

            for (SceneNodeCollectionObjectSet collectionObjectSet = this; collectionObjectSet != null; collectionObjectSet = sceneNodeObjectSet as SceneNodeCollectionObjectSet)
            {
                sceneNodeObjectSet = collectionObjectSet.parent;
            }
            PropertyReference propertyReference1;

            if (!this.RegisteredReferences.TryGetValue(handler, out propertyReference1))
            {
                return;
            }
            this.RegisteredReferences.Remove(handler);
            sceneNodeObjectSet.UnregisterPropertyChangedHandler(propertyReference1, handler);
        }
 public void Unhook()
 {
     if (this.children != null)
     {
         for (int index = 0; index < this.children.Count; ++index)
         {
             this.children[index].OnRemoveFromCategory();
         }
         this.children = (List <SceneNodeProperty>)null;
     }
     if (this.objectSet == null)
     {
         return;
     }
     this.objectSet.Dispose();
     this.objectSet = (SceneNodeCollectionObjectSet)null;
     this.parentProperty.PropertyReferenceChanged -= new Microsoft.Expression.DesignSurface.Documents.PropertyReferenceChangedEventHandler(this.OnPropertyReferenceChanged);
 }
 public SceneNodeCollectionProperty(SceneNodeCollectionObjectSet objectSet, PropertyReference propertyReference, AttributeCollection attributes, PropertyValue parentValue)
     : base((SceneNodeObjectSet)objectSet, propertyReference, attributes, parentValue)
 {
     this.baseReference = objectSet.BaseReference;
 }