예제 #1
0
        private void Rebuild()
        {
            if (this.EditingProperty == null)
            {
                return;
            }
            SceneNode representativeSceneNode = this.EditingProperty.SceneNodeObjectSet.RepresentativeSceneNode;

            if (representativeSceneNode == null || this.EditingProperty.SceneNodeObjectSet.ViewModel == null)
            {
                return;
            }
            foreach (Asset asset in (representativeSceneNode.DesignerContext.AssetLibrary as AssetLibrary).Assets)
            {
                TypeAsset typeAsset = asset as TypeAsset;
                if (typeAsset != null && ProjectNeutralTypes.TransitionEffect.IsAssignableFrom((ITypeId)asset.TargetType))
                {
                    if (this.hasLoadingPlaceholder)
                    {
                        this.transitionEffects.RemoveAt(this.transitionEffects.Count - 1);
                        this.hasLoadingPlaceholder = false;
                    }
                    TransitionEffectInfo transitionEffectInfo = new TransitionEffectInfo((Asset)typeAsset);
                    int num = this.transitionEffects.BinarySearch(transitionEffectInfo, (IComparer <TransitionEffectInfo>)TransitionEffectPickerEditor.alphabeticalTransitionEffectComparer);
                    if (num < 0)
                    {
                        this.transitionEffects.Insert(~num, transitionEffectInfo);
                    }
                }
            }
            this.transitionEffectsView = CollectionViewSource.GetDefaultView(this.transitionEffects);
            this.OnPropertyChanged("CurrentTransitionEffect");
            this.OnPropertyChanged("TransitionEffects");
            this.OnPropertyChanged("SubProperties");
        }
예제 #2
0
        private void ProjectContext_TypesChanged(object sender, TypesChangedEventArgs e)
        {
            TransitionEffectInfo transitionEffect = this.CurrentTransitionEffect;

            this.transitionEffects.Clear();
            this.transitionEffects.Add(new TransitionEffectInfo((Asset)null));
            if (transitionEffect != null && transitionEffect.Asset != null)
            {
                this.transitionEffects.Add(transitionEffect);
                if (this.CurrentTransitionEffect == null)
                {
                    this.CurrentTransitionEffect = transitionEffect;
                }
            }
            this.transitionEffects.Add(new TransitionEffectInfo((Asset)null)
            {
                IsLoadingPlaceholder = true
            });
            this.hasLoadingPlaceholder = true;
            this.UpdateFromDataContext();
        }