public RegularArticlePanel(IControllerPlugin ctrl, Article a) : base(ctrl, a) { InitializeComponent(); if (a.IsNew()==true ) { BackColor = plugins.Default.EmphasizedBackColor; } splitContainer1.Panel2.BackColor = plugins.Default.MouseOverArticleBackColor; splitContainer1.Panel2Collapsed = true; TextControl titleControl = new TextControl( Toolkit.UnHTML(a.Title) ); titleControl.Dock = DockStyle.Fill; titleControl.MouseEnter += new EventHandler(titleControl_MouseEnter); titleControl.MouseClick += new MouseEventHandler(TextControl_MouseClick); splitContainer1.Panel1.Controls.Add(titleControl); TextControl contentControl = new TextControl( Toolkit.UnHTML(a.Content) ); contentControl.Cursor = Cursors.Hand; contentControl.Dock = DockStyle.Fill; contentControl.MouseLeave += new EventHandler(contentControl_MouseLeave); contentControl.MouseClick += new MouseEventHandler(TextControl_MouseClick); splitContainer1.Panel2.Controls.Add(contentControl); mediaControl = MediaControl.Get(); mediaControl.Dock = DockStyle.Fill; panel1.Controls.Add(mediaControl); Resize += new EventHandler(RegularArticlePanel_Resize); RegularArticlePanel_Load(null, EventArgs.Empty); }
/// <summary> /// Handles the DropDownItemClicked event of the uxAddControllerMenuItem 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 uxAddControllerMenuItem_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e) { try { EmitterTreeNode parentNode = this.uxEffectTree.SelectedNode as EmitterTreeNode; IControllerPlugin plugin = e.ClickedItem.Tag as IControllerPlugin; AbstractEmitter parent = parentNode.Emitter; var args = new NewControllerEventArgs(parent, plugin); this.OnControllerAdded(args); if (args.AddedController != null) { AbstractController controller = args.AddedController; ControllerTreeNode node = new ControllerTreeNode(controller); parentNode.Nodes.Add(node); node.EnsureVisible(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void AddControllerPlugin(IControllerPlugin plugin) { Trace.WriteLine("Adding menu item for '" + plugin.Name + "' plugin...", "UI"); ToolStripMenuItem item = new ToolStripMenuItem { Text = plugin.Name, ToolTipText = plugin.Description, Image = Icons.ParticleEffect.ToBitmap(), //plugin.DisplayIcon, Tag = plugin }; this.uxAddControllerMenuItem.DropDownItems.Add(item); }
public ArticleControl(IControllerPlugin ctrl, Article a) { controller = ctrl; article = a; }
public NewControllerEventArgs(AbstractEmitter parentEmitter, IControllerPlugin plugin) { this.ParentEmitter = parentEmitter; this.Plugin = plugin; }