zoukankan      html  css  js  c++  java
  • XAF 如何使用AlertControl?

    http://www.devexpress.com/Support/Center/e/E1041.aspx

    using System;
    using System.Windows.Forms;
    using DevExpress.ExpressApp;
    using DevExpress.XtraBars.Alerter;
    using DevExpress.ExpressApp.Utils;

    namespace WinSolution.Module {
        
    public class ShowAlertControlMainWindowController : WindowController {
            
    private AlertControl alertControlCore;
            
    private Timer alertTimerCore;
            
    public ShowAlertControlMainWindowController() {
                TargetWindowType 
    = WindowType.Main;
            }
            
    protected override void OnActivated() {
                
    base.OnActivated();
                InitAlertControlCore();
                InitAlertTimerCore();
            }
            
    protected virtual void InitAlertControlCore() {
                alertControlCore 
    = new AlertControl();
            }
            
    protected virtual void InitAlertTimerCore() {
                alertTimerCore 
    = new Timer();
                alertTimerCore.Tick 
    += alertTimerCore_Tick;
                alertTimerCore.Interval 
    = 2000;
                alertTimerCore.Start();
            }
            
    private void alertTimerCore_Tick(object sender, EventArgs e) {
                ShowAlertInfo();
            }
            
    protected override void OnDeactivating() {
                
    if (alertTimerCore != null)
                    alertTimerCore.Stop();
                
    base.OnDeactivating();
            }
            
    protected virtual void ShowAlertInfo() {
                Form mainForm 
    = (Form)Application.MainWindow.Template;
                AlertInfo info 
    = new AlertInfo("Frohe Weihnachten! (Merry Christmas!)", DateTime.Now.ToString(), ImageLoader.Instance.GetImageInfo("Attention").Image);
                AlertControl.Show(mainForm, info);
            }
            
    public AlertControl AlertControl { get { return alertControlCore; } }
            
    public Timer AlertTimer { get { return alertTimerCore; } }
        }
    }

    欢迎转载,转载请注明出处:http://www.cnblogs.com/Tonyyang/

  • 相关阅读:
    eclipse的快捷键【转载】
    eclipse调试断点【转载】
    eclipse打断点的调试
    Oracle存储过程的调试
    QT5线程关闭
    QT5 Thread线程
    QT5 文件读写操作
    QT5 Even 事件
    Qt 5 常用类及基本函数
    静态库lib、动态库dll基础
  • 原文地址:https://www.cnblogs.com/Tonyyang/p/1806637.html
Copyright © 2011-2022 走看看