示例#1
0
        /// <summary>
        /// Handles the ModifierRemoved event of the Interface.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="ProjectMercury.EffectEditor.ModifierEventArgs"/> instance containing the event data.</param>
        public void Interface_ModifierRemoved(object sender, ModifierEventArgs e)
        {
            Trace.WriteLine("Removing modifier...", "CORE");

            try
            {
                foreach (Emitter emitter in this.ParticleEffect)
                {
                    foreach (Modifier modifier in emitter.Modifiers)
                    {
                        if (Object.ReferenceEquals(modifier, e.Modifier))
                        {
                            emitter.Modifiers.Remove(e.Modifier);

                            e.Result = CoreOperationResult.OK;

                            return;
                        }
                    }
                }

                e.Result = new CoreOperationResult(new Exception("Could not find the specified Modifier."));
            }
            catch (Exception error)
            {
                e.Result = new CoreOperationResult(error);
            }
        }
示例#2
0
        protected virtual void OnModifierRemoved(ModifierEventArgs e)
        {
            Trace.WriteLine("User requires removing a modifier...");

            using (new HourglassCursor())
            {
                var handler = Interlocked.CompareExchange(ref this.ModifierRemoved, null, null);

                if (handler != null)
                {
                    handler.Invoke(this, e);
                }
            }

            this.AssertOperationOK(e.Result);
        }
示例#3
0
        protected virtual void OnModifierRemoved(ModifierEventArgs e)
        {
            Trace.WriteLine("User requires removing a modifier...");

            using (new HourglassCursor())
            {
                var handler = Interlocked.CompareExchange(ref this.ModifierRemoved, null, null);

                if (handler != null)
                    handler.Invoke(this, e);
            }

            this.AssertOperationOK(e.Result);
        }
示例#4
0
文件: Core.cs 项目: kishoreVen/mpe
        /// <summary>
        /// Handles the ModifierRemoved event of the Interface.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="ProjectMercury.EffectEditor.ModifierEventArgs"/> instance containing the event data.</param>
        public void Interface_ModifierRemoved(Object sender, ModifierEventArgs e)
        {
            Trace.WriteLine("Removing modifier...", "CORE");

            try
            {
                foreach (AbstractEmitter emitter in this.ParticleEffect.Emitters)
                {
                    foreach (AbstractModifier modifier in emitter.Modifiers)
                    {
                        if (Object.ReferenceEquals(modifier, e.Modifier))
                        {
                            emitter.Modifiers.Remove(e.Modifier);

                            e.Result = CoreOperationResult.OK;

                            return;
                        }
                    }
                }

                e.Result = new CoreOperationResult(new Exception("Could not find the specified Modifier."));
            }
            catch (Exception error)
            {
                e.Result = new CoreOperationResult(error);
            }
        }
 protected virtual void OnModifierRemoved(ModifierEventArgs e)
 {
     if (this.ModifierRemoved != null)
         this.ModifierRemoved(this, e);
 }
示例#6
0
        /// <summary>
        /// Handles the ModifierRemoved event of the Interface.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="ProjectMercury.EffectEditor.ModifierEventArgs"/> instance containing the event data.</param>
        public void Interface_ModifierRemoved(object sender, ModifierEventArgs e)
        {
            foreach (Emitter emitter in this.ParticleEffect)
            {
                foreach (Modifier modifier in emitter.Modifiers)
                {
                    if (Object.ReferenceEquals(modifier, e.Modifier))
                    {
                        emitter.Modifiers.Remove(e.Modifier);

                        return;
                    }
                }
            }

            throw new ApplicationException("Could not find the specified Modifier.");
        }