Beispiel #1
0
        /// <summary>
        /// Handles the ControllerRemoved event of the Interface.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="ProjectMercury.EffectEditor.ControllerEventArgs"/> instance containing the event data.</param>
        public void Interface_ControllerRemoved(Object sender, ControllerEventArgs e)
        {
            Trace.WriteLine("Removing controller...", "CORE");

            try
            {
                foreach (AbstractEmitter emitter in this.ParticleEffect.Emitters)
                {
                    foreach (AbstractController controller in emitter.Controllers)
                    {
                        if (Object.ReferenceEquals(controller, e.Controller))
                        {
                            emitter.Controllers.Remove(e.Controller);

                            e.Result = CoreOperationResult.OK;

                            return;
                        }
                    }
                }

                e.Result = new CoreOperationResult(new Exception("Could not find the specified controller."));
            }
            catch (Exception error)
            {
                e.Result = new CoreOperationResult(error);
            }
        }
Beispiel #2
0
        protected virtual void OnControllerRemoved(ControllerEventArgs e)
        {
            Trace.WriteLine("User requires removing a controller...");

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

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

            this.AssertOperationOK(e.Result);
        }
Beispiel #3
0
        protected virtual void OnControllerRemoved(ControllerEventArgs e)
        {
            Trace.WriteLine("User requires removing a controller...");

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

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

            this.AssertOperationOK(e.Result);
        }
Beispiel #4
0
        /// <summary>
        /// Handles the ControllerRemoved event of the Interface.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="ProjectMercury.EffectEditor.ControllerEventArgs"/> instance containing the event data.</param>
        public void Interface_ControllerRemoved(Object sender, ControllerEventArgs e)
        {
            Trace.WriteLine("Removing controller...", "CORE");

            try
            {
                foreach (AbstractEmitter emitter in this.ParticleEffect.Emitters)
                {
                    foreach (AbstractController controller in emitter.Controllers)
                    {
                        if (Object.ReferenceEquals(controller, e.Controller))
                        {
                            emitter.Controllers.Remove(e.Controller);

                            e.Result = CoreOperationResult.OK;

                            return;
                        }
                    }
                }

                e.Result = new CoreOperationResult(new Exception("Could not find the specified controller."));
            }
            catch (Exception error)
            {
                e.Result = new CoreOperationResult(error);
            }
        }