Exemple #1
0
 public void ResolveProperties(IProjectContext projectContext, IPropertyManager propertyManager, Microsoft.Expression.DesignSurface.Documents.PropertyReferenceChangedEventHandler referenceChangedCallback)
 {
     this.Clear(false);
     this.resolvedProperties       = new HashSet <ReferenceStep>();
     this.propertyManager          = propertyManager;
     this.referenceChangedCallback = referenceChangedCallback;
     foreach (IPropertyId propertyId in this.NeutralProperties)
     {
         ReferenceStep singleStep = projectContext.ResolveProperty(propertyId) as ReferenceStep;
         if (singleStep != null)
         {
             this.resolvedProperties.Add(singleStep);
             propertyManager.RegisterPropertyReferenceChangedHandler(new PropertyReference(singleStep), referenceChangedCallback, true);
         }
     }
 }
 public override void UnregisterPropertyChangedHandler(PropertyReference propertyReference, Microsoft.Expression.DesignSurface.Documents.PropertyReferenceChangedEventHandler handler)
 {
     this.designerContext.ResourceManager.UnregisterPropertyChangedEventHandler(this.resource.Resource.Marker, this.resource.Resource.ResourceNode.Context, propertyReference, handler);
 }
 public override void UnregisterPropertyChangedHandler(PropertyReference propertyReference, Microsoft.Expression.DesignSurface.Documents.PropertyReferenceChangedEventHandler handler)
 {
     this.baseSet.UnregisterPropertyChangedHandler(propertyReference, handler);
 }
        private void DeferredUnregisterPropertyReferenceChangedHandler(PropertyReference propertyReference, Microsoft.Expression.DesignSurface.Documents.PropertyReferenceChangedEventHandler handler)
        {
            List <PropertyManager.HandlerInfo> list = this.propertyReferenceChangedHandlerList[propertyReference];

            for (int index = 0; index < list.Count; ++index)
            {
                if (list[index].Handler == handler)
                {
                    list.RemoveAt(index);
                    break;
                }
            }
            if (list.Count != 0)
            {
                return;
            }
            this.propertyReferenceChangedHandlerList.Remove(propertyReference);
        }
 public void UnregisterPropertyReferenceChangedHandler(PropertyReference propertyReference, Microsoft.Expression.DesignSurface.Documents.PropertyReferenceChangedEventHandler handler)
 {
     if (this.deferUpdateHandlerList > 0)
     {
         this.deferredRemoveHandlerPairs.Add(new KeyValuePair <PropertyReference, Microsoft.Expression.DesignSurface.Documents.PropertyReferenceChangedEventHandler>(propertyReference, handler));
         List <PropertyManager.HandlerInfo> list;
         if (!this.propertyReferenceChangedHandlerList.TryGetValue(propertyReference, out list))
         {
             return;
         }
         foreach (PropertyManager.HandlerInfo handlerInfo in list)
         {
             if (handlerInfo.Handler == handler)
             {
                 handlerInfo.SetHasBeenUnregistered(true);
             }
         }
     }
     else
     {
         this.DeferredUnregisterPropertyReferenceChangedHandler(propertyReference, handler);
     }
 }
 public HandlerInfo(Microsoft.Expression.DesignSurface.Documents.PropertyReferenceChangedEventHandler handler, bool includeSubpropertyChanges)
 {
     this.handler = handler;
     this.includeSubpropertyChanges = includeSubpropertyChanges;
 }
 public void RegisterPropertyReferenceChangedHandler(PropertyReference propertyReference, Microsoft.Expression.DesignSurface.Documents.PropertyReferenceChangedEventHandler handler, bool includeSubpropertyChanges)
 {
     PropertyManager.HandlerInfo handlerInfo = new PropertyManager.HandlerInfo(handler, includeSubpropertyChanges);
     if (this.deferUpdateHandlerList > 0)
     {
         this.deferredAddHandlerPairs.Add(new KeyValuePair <PropertyReference, PropertyManager.HandlerInfo>(propertyReference, handlerInfo));
     }
     else
     {
         this.DeferredRegisterPropertyReferenceChangedHandler(propertyReference, handlerInfo);
     }
 }
Exemple #8
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);
        }
Exemple #9
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);
        }