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/

  • 相关阅读:
    chrome浏览页面常用快捷键 && 常见的HTTP状态码
    hasCode详解
    队例初始化问题(Queue)
    新手问题--双链表最后一个节点无法删除问题
    高级排序--快速排序
    高级排序--归并排序
    高级排序--希尔排序
    简单排序--插入排序
    简单排序--选择排序
    简单排序--冒泡排序
  • 原文地址:https://www.cnblogs.com/Tonyyang/p/1806637.html
Copyright © 2011-2022 走看看