Example #1
0
        //ncrunch: no coverage end

        public void UpdateOnContentChange(ContentType type, string addedName)
        {
            if (type == ContentType.ParticleSystem && !EffectsInProject.Contains(addedName))
            {
                EffectsInProject.Add(addedName);
                RaisePropertyChanged("EffectsInProject");
            }
            if (type == ContentType.ParticleEmitter && !EmittersInProject.Contains(addedName))
            {
                EmittersInProject.Add(addedName);
                RaisePropertyChanged("EmittersInProject");
            }
            if (type == ContentType.Material && !MaterialList.Contains(addedName))
            {
                MaterialList.Add(addedName);
                RaisePropertyChanged("MaterialList");
            }
        }
Example #2
0
 public void UpdateOnContentDeletion(string removedName)
 {
     if (EffectsInProject.Contains(removedName))
     {
         EffectsInProject.Remove(removedName);
     }
     else if (EmittersInProject.Contains(removedName))
     {
         EmittersInProject.Remove(removedName);
     }
     else if (MaterialList.Contains(removedName))
     {
         MaterialList.Remove(removedName);
         foreach (var emitter in currentEffect.AttachedEmitters)
         {
             if (emitter.EmitterData.ParticleMaterial.Name.Equals(removedName))
             {
                 emitter.EmitterData.ParticleMaterial = ContentExtensions.CreateDefaultMaterial2D();                         //ncrunch: no coverage
             }
         }
     }
     RaisePropertyChanged("EffectsInProject");
 }