using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Forms; using System.Drawing; namespace RDPAddins.Common { /// /// Represents UI parts of the IChannel /// public interface IUI { /// /// Occurs when the balloon tip is clicked. /// event BalloonTipClickedHandler BalloonTipClicked; /// /// Occurs when the hannel is trying create addin's control. If not hooked addin will not have control. /// event ControlCreatingHandler ControlCreating; /// /// Occurs when Channel is trying create addin's menu. If not hooked addin will not have menu. /// event MenuCreatingHandler MenuCreating; /// /// Occurs when Channel is trying create addin's tray menu. If not hooked addin will not have tray menu. /// event MenuCreatingHandler TrayMenuCreating; /// /// Occurs when Channel is trying to get addin's icon. Only appears when addin has control. If not hooked addin and addin has control then addin will have default icon. /// event IconCreatingHandler IconCreating; /// /// Get UI's channel /// IChannel Parent { get; } /// /// Displays the balloon tip in the taskbar. /// /// The time period, in milliseconds, the balloon tip should display. /// The title to display on the balloon tip. /// The text to display on the balloon tip. /// One of the System.Windows.Forms.ToolTipIcon values. /// This object will sent to BalloonTipClicked event. void ShowBalloonTip(int timeout, string tipTitle, string tipText, ToolTipIcon tipIcon, object context); /// /// Shows main form and selct tab with addin's control(if exists). /// void ShowControl(); /// /// Executes a action on the UI thread. (It calls System.Windows.Forms.Form.Invoke). /// /// The action delegate. void DoOnUIThread(Action action); /// /// Gets or sets visibility of addin's control(if exists). /// bool Visible { get; set; } } /// /// Represents the method that will handle the BalloonTipClicked event of a IUI. /// /// The source of the event. /// Parameter sent by IUI.ShowBalloonTip method. public delegate void BalloonTipClickedHandler(IUI sender, object context); /// /// Represents the method that will handle the ControlCreating event of a IUI. /// /// The source of the event. /// Should returns addin's control if needed. public delegate Control ControlCreatingHandler(IUI sender); /// /// Represents the method that will handle the MenuCreating and TrayMenuCreating event of a IUI. /// /// The source of the event. /// Should returns addin's menu or tray menu if needed. public delegate Menu MenuCreatingHandler(IUI sender); /// /// Represents the method that will handle the IconCreating event of a IUI. /// /// The source of the event. /// Should returns addin's icon if needed. public delegate Image IconCreatingHandler(IUI sender); }