コード例 #1
0
ファイル: UserInterface.cs プロジェクト: matrix4x4/Space
        /// <summary>
        /// Handles the Click event of the uxReinitialiseEmitter control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void uxReinitialiseEmitter_Click(object sender, EventArgs e)
        {
            EmitterTreeNode node = this.uxEffectTree.SelectedNode as EmitterTreeNode;

            using (NewEmitterDialog dialog = new NewEmitterDialog(node.Emitter.Budget, node.Emitter.Term))
            {
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    var args = new EmitterReinitialisedEventArgs(node.Emitter, dialog.EmitterBudget, dialog.EmitterTerm);

                    this.OnEmitterReinitialised(args);
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// Handles the EmitterReinitialised event of the Interface.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="ProjectMercury.EffectEditor.EmitterReinitialisedEventArgs"/> instance containing the event data.</param>
        public void Interface_EmitterReinitialised(object sender, EmitterReinitialisedEventArgs e)
        {
            Trace.WriteLine("Reinitialising emitter...", "CORE");

            try
            {
                e.Emitter.Initialise(e.Budget, e.Term);

                e.Result = CoreOperationResult.OK;
            }
            catch (Exception error)
            {
                e.Result = new CoreOperationResult(error);
            }
        }
コード例 #3
0
ファイル: UserInterface.cs プロジェクト: matrix4x4/Space
        protected virtual void OnEmitterReinitialised(EmitterReinitialisedEventArgs e)
        {
            Trace.WriteLine("User requires reinitialising emitter...", "UI");

            using (new TraceIndenter())
            {
                Trace.WriteLine("Budget: " + e.Budget);
                Trace.WriteLine("Term: " + e.Term);
            }

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

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

            this.AssertOperationOK(e.Result);
        }
コード例 #4
0
ファイル: UserInterface.cs プロジェクト: kishoreVen/mpe
        protected virtual void OnEmitterReinitialised(EmitterReinitialisedEventArgs e)
        {
            Trace.WriteLine("User requires reinitialising emitter...", "UI");

            using (new TraceIndenter())
            {
                Trace.WriteLine("Budget: " + e.Budget);
                Trace.WriteLine("Term: " + e.Term);
            }

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

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

            this.AssertOperationOK(e.Result);
        }
コード例 #5
0
ファイル: UserInterface.cs プロジェクト: kishoreVen/mpe
        /// <summary>
        /// Handles the Click event of the uxReinitialiseEmitter control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void uxReinitialiseEmitter_Click(object sender, EventArgs e)
        {
            EmitterTreeNode node = this.uxEffectTree.SelectedNode as EmitterTreeNode;

            using (NewEmitterDialog dialog = new NewEmitterDialog(node.Emitter.Budget, node.Emitter.Term))
            {
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    var args = new EmitterReinitialisedEventArgs(node.Emitter, dialog.EmitterBudget, dialog.EmitterTerm);

                    this.OnEmitterReinitialised(args);
                }
            }
        }
コード例 #6
0
ファイル: Core.cs プロジェクト: kishoreVen/mpe
        /// <summary>
        /// Handles the EmitterReinitialised event of the Interface.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="ProjectMercury.EffectEditor.EmitterReinitialisedEventArgs"/> instance containing the event data.</param>
        public void Interface_EmitterReinitialised(Object sender, EmitterReinitialisedEventArgs e)
        {
            Trace.WriteLine("Reinitialising emitter...", "CORE");

            try
            {
                e.Emitter.Initialise(e.Budget, e.Term);

                e.Result = CoreOperationResult.OK;
            }
            catch (Exception error)
            {
                e.Result = new CoreOperationResult(error);
            }
        }
コード例 #7
0
 protected virtual void OnEmitterReinitialised(EmitterReinitialisedEventArgs e)
 {
     if (this.EmitterReinitialised != null)
         this.EmitterReinitialised(this, e);
 }
コード例 #8
0
ファイル: Core.cs プロジェクト: Andrea/MercuryParticleEngine
 /// <summary>
 /// Handles the EmitterReinitialised event of the Interface.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="ProjectMercury.EffectEditor.EmitterReinitialisedEventArgs"/> instance containing the event data.</param>
 public void Interface_EmitterReinitialised(object sender, EmitterReinitialisedEventArgs e)
 {
     e.Emitter.Initialise(e.Budget, e.Term);
 }