Exemplo n.º 1
0
        private BehaviorCommandCategory.PropertyEntryCollectionWrapper GetTriggerProperties(PropertyEntry triggerProperty)
        {
            BehaviorCommandCategory.PropertyEntryCollectionWrapper collectionWrapper = new BehaviorCommandCategory.PropertyEntryCollectionWrapper(triggerProperty.PropertyValue.SubProperties);
            SceneNodeProperty       sceneNodeProperty       = (SceneNodeProperty)triggerProperty;
            BehaviorTriggerBaseNode behaviorTriggerBaseNode = (BehaviorTriggerBaseNode)this.behaviorNode.GetLocalValueAsSceneNode(sceneNodeProperty.Reference);

            foreach (BehaviorTriggerActionNode triggerActionNode in (IEnumerable <SceneNode>)behaviorTriggerBaseNode.Actions)
            {
                if (ProjectNeutralTypes.InvokeCommandAction.IsAssignableFrom((ITypeId)triggerActionNode.Type) && ((InvokeCommandActionNode)triggerActionNode).CommandName.Equals(this.CategoryName, StringComparison.Ordinal))
                {
                    PropertyReference propertyReference = sceneNodeProperty.Reference.Append(BehaviorTriggerBaseNode.BehaviorActionsProperty).Append((ReferenceStep)IndexedClrPropertyReferenceStep.GetReferenceStep((ITypeResolver)triggerActionNode.ProjectContext, ProjectNeutralTypes.BehaviorTriggerActionCollection, behaviorTriggerBaseNode.Actions.IndexOf((SceneNode)triggerActionNode))).Append(InvokeCommandActionNode.CommandParameterProperty);
                    collectionWrapper.AddCustomProperty(sceneNodeProperty.SceneNodeObjectSet.CreateProperty(propertyReference, propertyReference.LastStep.Attributes));
                    break;
                }
            }
            return(collectionWrapper);
        }
Exemplo n.º 2
0
        private void UpdateProperties()
        {
            PropertyEntry triggerProperty = (PropertyEntry)this.TriggerNodeView.CurrentItem;

            if (this.triggerBasicPropertiesViewSource == null)
            {
                this.triggerBasicPropertiesViewSource         = new CollectionViewSource();
                this.triggerBasicPropertiesViewSource.Filter += new FilterEventHandler(this.TriggerBasicPropertiesFilter);
                this.triggerBasicPropertiesViewSource.SortDescriptions.Add(new SortDescription("PropertyOrder", ListSortDirection.Ascending));
                this.triggerBasicPropertiesViewSource.SortDescriptions.Add(new SortDescription("PropertyName", ListSortDirection.Ascending));
            }
            if (this.triggerAdvancedPropertiesViewSource == null)
            {
                this.triggerAdvancedPropertiesViewSource         = new CollectionViewSource();
                this.triggerAdvancedPropertiesViewSource.Filter += new FilterEventHandler(this.TriggerAdvancedPropertiesFilter);
                this.triggerAdvancedPropertiesViewSource.SortDescriptions.Add(new SortDescription("PropertyOrder", ListSortDirection.Ascending));
                this.triggerAdvancedPropertiesViewSource.SortDescriptions.Add(new SortDescription("PropertyName", ListSortDirection.Ascending));
            }
            if (this.properties != null)
            {
                this.properties.ClearProperties();
                this.properties = (BehaviorCommandCategory.PropertyEntryCollectionWrapper)null;
            }
            if (triggerProperty != null)
            {
                this.properties = this.GetTriggerProperties(triggerProperty);
                this.triggerBasicPropertiesViewSource.Source    = (object)this.properties.Properties;
                this.triggerAdvancedPropertiesViewSource.Source = (object)this.properties.Properties;
            }
            else
            {
                this.triggerBasicPropertiesViewSource.Source    = (object)null;
                this.triggerAdvancedPropertiesViewSource.Source = (object)null;
            }
            this.UpdateViews();
        }