/// <summary> /// Initializes a new instance of the <see cref="NewEmitterEventArgs"/> class. /// </summary> /// <param name="plugin">The plugin.</param> /// <param name="budget">The budget.</param> /// <param name="term">The term.</param> public NewEmitterEventArgs(IEmitterPlugin plugin, int budget, float term) : base() { this.Plugin = plugin; this.Budget = budget; this.Term = term; }
/// <summary> /// Handles the DropDownItemClicked event of the uxAddEmitterMenuItem control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.Windows.Forms.ToolStripItemClickedEventArgs"/> instance containing the event data.</param> private void uxAddEmitterMenuItem_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e) { try { using (NewEmitterDialog dialog = new NewEmitterDialog()) { if (dialog.ShowDialog() == DialogResult.OK) { IEmitterPlugin plugin = e.ClickedItem.Tag as IEmitterPlugin; var args = new NewEmitterEventArgs(plugin, dialog.EmitterBudget, dialog.EmitterTerm); this.OnEmitterAdded(args); if (args.AddedEmitter != null) { Emitter emitter = args.AddedEmitter; EmitterTreeNode node = new EmitterTreeNode(emitter); this.uxEffectTree.Nodes[0].Nodes.Add(node); node.EnsureVisible(); } } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
/// <summary> /// Adds the copy plugin to the interface. /// </summary> /// <param name="plugin">The plugin.</param> private void AddEmitterPlugin(IEmitterPlugin plugin) { Trace.WriteLine("Adding menu item for '" + plugin.Name + "' plugin...", "UI"); ToolStripMenuItem item = new ToolStripMenuItem { Text = plugin.DisplayName, ToolTipText = plugin.Description, Image = plugin.DisplayIcon.ToBitmap(), Tag = plugin }; this.uxAddEmitterMenuItem.DropDownItems.Add(item); }
/// <summary> /// Adds the copy plugin to the interface. /// </summary> /// <param name="plugin">The plugin.</param> private void AddEmitterPlugin(IEmitterPlugin plugin) { Trace.WriteLine("Adding menu item for '" + plugin.Name + "' plugin...", "UI"); ToolStripMenuItem item = new ToolStripMenuItem { Text = plugin.Name, ToolTipText = plugin.Description, Image = Icons.Emitter.ToBitmap(), //plugin.DisplayIcon, Tag = plugin }; this.uxAddEmitterMenuItem.DropDownItems.Add(item); }
/// Adds the copy plugin to the interface. /// </summary> /// <param name="plugin">The plugin.</param> private void AddEmitterPlugin(IEmitterPlugin plugin) { ToolStripMenuItem item = new ToolStripMenuItem { Text = plugin.DisplayName, ToolTipText = plugin.Description, Image = plugin.DisplayIcon.ToBitmap(), Tag = plugin }; this.uxAddEmitterMenuItem.DropDownItems.Add(item); }