/// <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);
            }
        }
 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
 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();
 }