/// <summary>
        /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed.
        /// <example>
        /// statusbardrawitemeventhandler.BeginInvoke(sender, sbdevent, callback);
        /// </example>
        /// </summary>
        public static IAsyncResult BeginInvoke(this StatusBarDrawItemEventHandler statusbardrawitemeventhandler, Object sender, StatusBarDrawItemEventArgs sbdevent, AsyncCallback callback)
        {
            if (statusbardrawitemeventhandler == null)
            {
                throw new ArgumentNullException("statusbardrawitemeventhandler");
            }

            return(statusbardrawitemeventhandler.BeginInvoke(sender, sbdevent, callback, null));
        }
コード例 #2
0
        protected virtual void OnDrawItem(StatusBarDrawItemEventArgs sbdievent)
        {
            StatusBarDrawItemEventHandler eh = (StatusBarDrawItemEventHandler)(Events [DrawItemEvent]);

            if (eh != null)
            {
                eh(this, sbdievent);
            }
        }
コード例 #3
0
 private void InitializeComponent()
 {
     iconPanel     = new StatusBarPanel();
     textPanel     = new StatusBarPanel();
     progressPanel = new StatusBarPanel();
     locationPanel = new StatusBarPanel();
     sizePanel     = new StatusBarPanel();
     ((ISupportInitialize)(iconPanel)).BeginInit();
     ((ISupportInitialize)(textPanel)).BeginInit();
     ((ISupportInitialize)(progressPanel)).BeginInit();
     ((ISupportInitialize)(locationPanel)).BeginInit();
     ((ISupportInitialize)(sizePanel)).BeginInit();
     //
     // iconPanel
     //
     iconPanel.BorderStyle = StatusBarPanelBorderStyle.None;
     iconPanel.MinWidth    = 20;
     iconPanel.Style       = StatusBarPanelStyle.OwnerDraw;
     iconPanel.Width       = 20;
     //
     // textPanel
     //
     textPanel.AutoSize    = StatusBarPanelAutoSize.Spring;
     textPanel.BorderStyle = StatusBarPanelBorderStyle.None;
     textPanel.Text        = "Ready";
     textPanel.Width       = 10;
     //
     // progressPanel
     //
     progressPanel.BorderStyle = StatusBarPanelBorderStyle.None;
     progressPanel.MinWidth    = 0;
     progressPanel.Style       = StatusBarPanelStyle.OwnerDraw;
     progressPanel.Width       = 120;
     //
     // locationPanel
     //
     locationPanel.AutoSize    = StatusBarPanelAutoSize.Contents;
     locationPanel.BorderStyle = StatusBarPanelBorderStyle.None;
     locationPanel.MinWidth    = 1;
     locationPanel.Style       = StatusBarPanelStyle.OwnerDraw;
     locationPanel.Width       = 10;
     //
     // sizePanel
     //
     sizePanel.AutoSize    = StatusBarPanelAutoSize.Contents;
     sizePanel.BorderStyle = StatusBarPanelBorderStyle.None;
     sizePanel.Style       = StatusBarPanelStyle.OwnerDraw;
     sizePanel.Width       = 10;
     //
     // MpeStatusBar
     //
     Panels.AddRange(new StatusBarPanel[]
     {
         iconPanel,
         textPanel,
         locationPanel,
         sizePanel,
         progressPanel
     });
     ShowPanels  = true;
     PanelClick += new StatusBarPanelClickEventHandler(OnPanelClick);
     DrawItem   += new StatusBarDrawItemEventHandler(OnDrawItem);
     ((ISupportInitialize)(iconPanel)).EndInit();
     ((ISupportInitialize)(textPanel)).EndInit();
     ((ISupportInitialize)(progressPanel)).EndInit();
     ((ISupportInitialize)(locationPanel)).EndInit();
     ((ISupportInitialize)(sizePanel)).EndInit();
 }
コード例 #4
0
ファイル: MpeStatusBar.cs プロジェクト: arangas/MediaPortal-1
 private void InitializeComponent()
 {
   iconPanel = new StatusBarPanel();
   textPanel = new StatusBarPanel();
   progressPanel = new StatusBarPanel();
   locationPanel = new StatusBarPanel();
   sizePanel = new StatusBarPanel();
   ((ISupportInitialize) (iconPanel)).BeginInit();
   ((ISupportInitialize) (textPanel)).BeginInit();
   ((ISupportInitialize) (progressPanel)).BeginInit();
   ((ISupportInitialize) (locationPanel)).BeginInit();
   ((ISupportInitialize) (sizePanel)).BeginInit();
   // 
   // iconPanel
   // 
   iconPanel.BorderStyle = StatusBarPanelBorderStyle.None;
   iconPanel.MinWidth = 20;
   iconPanel.Style = StatusBarPanelStyle.OwnerDraw;
   iconPanel.Width = 20;
   // 
   // textPanel
   // 
   textPanel.AutoSize = StatusBarPanelAutoSize.Spring;
   textPanel.BorderStyle = StatusBarPanelBorderStyle.None;
   textPanel.Text = "Ready";
   textPanel.Width = 10;
   // 
   // progressPanel
   // 
   progressPanel.BorderStyle = StatusBarPanelBorderStyle.None;
   progressPanel.MinWidth = 0;
   progressPanel.Style = StatusBarPanelStyle.OwnerDraw;
   progressPanel.Width = 120;
   // 
   // locationPanel
   // 
   locationPanel.AutoSize = StatusBarPanelAutoSize.Contents;
   locationPanel.BorderStyle = StatusBarPanelBorderStyle.None;
   locationPanel.MinWidth = 1;
   locationPanel.Style = StatusBarPanelStyle.OwnerDraw;
   locationPanel.Width = 10;
   // 
   // sizePanel
   // 
   sizePanel.AutoSize = StatusBarPanelAutoSize.Contents;
   sizePanel.BorderStyle = StatusBarPanelBorderStyle.None;
   sizePanel.Style = StatusBarPanelStyle.OwnerDraw;
   sizePanel.Width = 10;
   // 
   // MpeStatusBar
   // 
   Panels.AddRange(new StatusBarPanel[]
                     {
                       iconPanel,
                       textPanel,
                       locationPanel,
                       sizePanel,
                       progressPanel
                     });
   ShowPanels = true;
   PanelClick += new StatusBarPanelClickEventHandler(OnPanelClick);
   DrawItem += new StatusBarDrawItemEventHandler(OnDrawItem);
   ((ISupportInitialize) (iconPanel)).EndInit();
   ((ISupportInitialize) (textPanel)).EndInit();
   ((ISupportInitialize) (progressPanel)).EndInit();
   ((ISupportInitialize) (locationPanel)).EndInit();
   ((ISupportInitialize) (sizePanel)).EndInit();
 }