public frmNewAlert() { InitializeComponent(); taskbarNotifier1 = new TaskbarNotifier(); taskbarNotifier1.SetBackgroundBitmap(new Bitmap(GetType(), "BackGround1.bmp"), Color.FromArgb(255, 0, 255)); taskbarNotifier1.SetCloseBitmap(new Bitmap(GetType(), "Close1.bmp"), Color.FromArgb(255, 0, 255), new Point(580, 4)); System.IO.FileInfo fi = new System.IO.FileInfo(path); if (fi.Exists) { ds.ReadXml(path); } if (ds.Tables.Count <= 0) { dc = new DataColumn(); dc.DataType = System.Type.GetType("System.String"); dc.ColumnName = "DateTime"; dc.Caption = "Date and Time "; dt.Columns.Add(dc); dc = new DataColumn(); dc.DataType = System.Type.GetType("System.String"); dc.ColumnName = "AlertMessage"; dc.Caption = "Message to be display"; dt.Columns.Add(dc); ds.Tables.Add(dt); } timer1.Enabled = true; }
public static void ShowTaskbarNotifier(string msg) { var taskBarNotifier = new TaskbarNotifier(); taskBarNotifier.SetBackgroundBitmap(); taskBarNotifier.SetCloseBitmap(); taskBarNotifier.KeepVisibleOnMouseOver = true; taskBarNotifier.ReShowOnMouseOver = true; taskBarNotifier.Show("ConnectWise\nMessage", msg, 500, 3000, 500); }
public MsgNotice() { taskbarNotifier3 = new TaskbarNotifier(); taskbarNotifier3.SetBackgroundBitmap(new Bitmap(GetType(), "skin3.bmp"), Color.FromArgb(255, 0, 255)); taskbarNotifier3.SetCloseBitmap(new Bitmap(GetType(), "close.bmp"), Color.FromArgb(255, 0, 255), new Point(280, 57)); taskbarNotifier3.TitleRectangle = new Rectangle(150, 57, 125, 28); taskbarNotifier3.ContentRectangle = new Rectangle(75, 92, 215, 55); taskbarNotifier3.TitleClick += new EventHandler(TitleClick); taskbarNotifier3.ContentClick += new EventHandler(ContentClick); taskbarNotifier3.CloseClick += new EventHandler(CloseClick); }
public FormTest() { InitializeComponent(); TaskbarNotifier = new TaskbarNotifier(); TaskbarNotifier.SetBackgroundBitmap(Resources.skin2, Color.FromArgb(255, 0, 255)); TaskbarNotifier.SetCloseBitmap(Resources.close2, Color.FromArgb(255, 0, 255), new Point(300, 74)); TaskbarNotifier.TitleRectangle = new Rectangle(123, 80, 176, 16); TaskbarNotifier.ContentRectangle = new Rectangle(116, 97, 197, 22); TaskbarNotifier.TitleText = "haha title"; TaskbarNotifier.ContentText = "hihi content"; }
private TaskbarNotifier CreateNotificationWindow(int winId) { TaskbarNotifier notify = new TaskbarNotifier(); switch (winId) { case 1: // skin 1 notify.SetBackgroundBitmap(Resource.skin, Color.FromArgb(255, 0, 255)); notify.SetCloseBitmap(Resource.close, Color.FromArgb(255, 0, 255), new Point(280, 57)); notify.TitleRectangle = new Rectangle(150, 57, 125, 28); notify.ContentRectangle = new Rectangle(75, 92, 215, 55); break; case 2: //skin 2 notify.SetBackgroundBitmap(Resource.skin2, Color.FromArgb(255, 0, 255)); notify.SetCloseBitmap(Resource.close2, Color.FromArgb(255, 0, 255), new Point(280, 57)); notify.TitleRectangle = new Rectangle(150, 57, 125, 28); notify.ContentRectangle = new Rectangle(75, 92, 215, 55); break; case 3: default: //skin 3 notify.SetBackgroundBitmap(Resource.skin3, Color.FromArgb(255, 0, 255)); notify.SetCloseBitmap(Resource.close, Color.FromArgb(255, 0, 255), new Point(280, 57)); notify.TitleRectangle = new Rectangle(150, 57, 125, 28); notify.ContentRectangle = new Rectangle(75, 92, 215, 55); break; } notify.CloseClickable = true; notify.TitleClickable = false; notify.ContentClickable = false; notify.EnableSelectionRectangle = true; notify.KeepVisibleOnMousOver = true; notify.ReShowOnMouseOver = true; return(notify); }
private void TaskBar_Initilization() { //taskbarNotifier1.SetBackgroundBitmap(new Bitmap(GetType(), "skin"), Color.FromArgb(255, 0, 255)); taskbarNotifier1.SetBackgroundBitmap("Skin.bmp", Color.FromArgb(255, 0, 255)); //taskbarNotifier1.SetCloseBitmap(new Bitmap(GetType(), "close"), Color.FromArgb(255, 0, 255), new Point(127, 8)); taskbarNotifier1.SetCloseBitmap("close.bmp", Color.FromArgb(255, 0, 255), new Point(127, 8)); taskbarNotifier1.TitleRectangle = new Rectangle(40, 9, 70, 25); taskbarNotifier1.ContentRectangle = new Rectangle(8, 41, 133, 68); taskbarNotifier1.TitleClick += new EventHandler(TitleClick); taskbarNotifier1.ContentClick += new EventHandler(ContentClick); taskbarNotifier1.CloseClick += new EventHandler(CloseClick); }
private void InitNotifier() { Image skinBmp = Bitmap.FromFile("images/skin.bmp"); Image closeBmp = Bitmap.FromFile("images/close.bmp"); this.m_TaskbarNotifier = new TaskbarNotifier(); m_TaskbarNotifier.SetBackgroundBitmap(skinBmp, Color.FromArgb(255, 0, 255)); m_TaskbarNotifier.SetCloseBitmap(closeBmp, Color.FromArgb(255, 0, 255), new Point(127, 8)); m_TaskbarNotifier.TitleRectangle = new Rectangle(40, 9, 70, 25); m_TaskbarNotifier.ContentRectangle = new Rectangle(8, 41, 133, 68); m_TaskbarNotifier.KeepVisibleOnMousOver = true; m_TaskbarNotifier.ContentClick += m_TaskbarNotifier_ContentClick; }
//右下角提示框状态初始化 private void InitTaskBar() { taskbarNotifier1 = new TaskbarNotifier(); taskbarNotifier1.SetBackgroundBitmap(new Bitmap(Image.FromFile(@"../../pic/skin_big.bmp")), Color.FromArgb(255, 0, 255)); taskbarNotifier1.SetCloseBitmap(new Bitmap(Image.FromFile(@"../../pic/close_logo.bmp")), Color.FromArgb(255, 0, 255), new Point(300, 12)); taskbarNotifier1.TitleRectangle = new Rectangle(90, 25, 135, 60); taskbarNotifier1.ContentRectangle = new Rectangle(29, 70, 315, 250); taskbarNotifier1.CloseClickable = true; taskbarNotifier1.TitleClickable = false; taskbarNotifier1.ContentClickable = false; taskbarNotifier1.EnableSelectionRectangle = false; taskbarNotifier1.KeepVisibleOnMousOver = true; taskbarNotifier1.ReShowOnMouseOver = true; }
protected NotifiyBase() { notifyDateTime = CommonProvider.Instance.GetSysDate(); TaskbarNotifier = new TaskbarNotifier(); TaskbarNotifier.SetBackgroundBitmap(Resources.skin2, Color.FromArgb(255, 0, 255)); TaskbarNotifier.SetCloseBitmap(Resources.close2, Color.FromArgb(255, 0, 255), new Point(300, 74)); TaskbarNotifier.TitleRectangle = new Rectangle(123, 80, 176, 16); TaskbarNotifier.ContentRectangle = new Rectangle(116, 97, 197, 22); TaskbarNotifier.KeepVisibleOnMousOver = true; TaskbarNotifier.ReShowOnMouseOver = true; TaskbarNotifier.TitleClick += new EventHandler(TaskbarNotifier_TitleClick);; TaskbarNotifier.ContentClick += new EventHandler(TaskbarNotifier_ContentClick); TaskbarNotifier.CloseClick += new EventHandler(TaskbarNotifier_CloseClick); isRunning = true; }
TaskbarNotifier taskbarNotifier3; // Added Rev 002 public Form1() { // // Requis pour la prise en charge du Concepteur Windows Forms // InitializeComponent(); textBoxContent.Text = "This is a sample content, it can spread on multiple lines"; textBoxTitle.Text = "Title"; textBoxDelayShowing.Text = "500"; textBoxDelayStaying.Text = "3000"; textBoxDelayHiding.Text = "500"; checkBoxSelectionRectangle.Checked = true; checkBoxTitleClickable.Checked = false; checkBoxContentClickable.Checked = true; checkBoxCloseClickable.Checked = true; checkBoxKeepVisibleOnMouseOver.Checked = true; // Added Rev 002 checkBoxReShowOnMouseOver.Checked = false; // Added Rev 002 taskbarNotifier1 = new TaskbarNotifier(); taskbarNotifier1.SetBackgroundBitmap(new Bitmap(GetType(), "skin.bmp"), Color.FromArgb(255, 0, 255)); taskbarNotifier1.SetCloseBitmap(new Bitmap(GetType(), "close.bmp"), Color.FromArgb(255, 0, 255), new Point(127, 8)); taskbarNotifier1.TitleRectangle = new Rectangle(40, 9, 70, 25); taskbarNotifier1.ContentRectangle = new Rectangle(8, 41, 133, 68); taskbarNotifier1.TitleClick += new EventHandler(TitleClick); taskbarNotifier1.ContentClick += new EventHandler(ContentClick); taskbarNotifier1.CloseClick += new EventHandler(CloseClick); taskbarNotifier2 = new TaskbarNotifier(); taskbarNotifier2.SetBackgroundBitmap(new Bitmap(GetType(), "skin2.bmp"), Color.FromArgb(255, 0, 255)); taskbarNotifier2.SetCloseBitmap(new Bitmap(GetType(), "close2.bmp"), Color.FromArgb(255, 0, 255), new Point(300, 74)); taskbarNotifier2.TitleRectangle = new Rectangle(123, 80, 176, 16); taskbarNotifier2.ContentRectangle = new Rectangle(116, 97, 197, 22); taskbarNotifier2.TitleClick += new EventHandler(TitleClick); taskbarNotifier2.ContentClick += new EventHandler(ContentClick); taskbarNotifier2.CloseClick += new EventHandler(CloseClick); // Added Rev 002 taskbarNotifier3 = new TaskbarNotifier(); taskbarNotifier3.SetBackgroundBitmap(new Bitmap(GetType(), "skin3.bmp"), Color.FromArgb(255, 0, 255)); taskbarNotifier3.SetCloseBitmap(new Bitmap(GetType(), "close.bmp"), Color.FromArgb(255, 0, 255), new Point(280, 57)); taskbarNotifier3.TitleRectangle = new Rectangle(150, 57, 125, 28); taskbarNotifier3.ContentRectangle = new Rectangle(75, 92, 215, 55); taskbarNotifier3.TitleClick += new EventHandler(TitleClick); taskbarNotifier3.ContentClick += new EventHandler(ContentClick); taskbarNotifier3.CloseClick += new EventHandler(CloseClick); }
private TaskbarNotifier InitTaskBarNotifier(TaskbarNotifier notifier) { notifier.Base = m_ColToast; notifier.SetCloseBitmap(new Bitmap(GetType(), "close.bmp"), Color.FromArgb(255, 0, 255), new Point(230, 8)); notifier.TitleRectangle = new Rectangle(45, 9, 200, 25); notifier.ContentRectangle = new Rectangle(45, 40, 220, 68); notifier.ContentTextAlignement = ContentAlignment.TopLeft; notifier.CloseClickable = true; notifier.TitleClickable = false; notifier.ContentClickable = false; notifier.EnableSelectionRectangle = false; notifier.KeepVisibleOnMousOver = true; notifier.ReShowOnMouseOver = true; notifier.Padding = 0; return(notifier); }
private void InitNotify(TaskbarNotifier taskbarNotifier, Image inputImage) { taskbarNotifier.SetBackgroundBitmap(inputImage, Color.FromArgb(255, 0, 255)); taskbarNotifier.SetCloseBitmap( Resources.close_buttons, Color.FromArgb(255, 0, 255), new Point(inputImage.Width - 40, 13)); taskbarNotifier.ContentRectangle = new Rectangle(15, 30, inputImage.Width - 40, inputImage.Height - 50); taskbarNotifier.CloseClickable = true; taskbarNotifier.TitleClickable = false; taskbarNotifier.ContentClickable = true; taskbarNotifier.EnableSelectionRectangle = false; taskbarNotifier.KeepVisibleOnMousOver = true; taskbarNotifier.ReShowOnMouseOver = true; }
/// <summary> /// crea los notificadores /// </summary> public barra() { taskbarNotifier2 = new TaskbarNotifier(); taskbarNotifier2.SetBackgroundBitmap(new Bitmap(GetType(), "Multimedia.skin2.bmp"), Color.FromArgb(255, 0, 255)); taskbarNotifier2.SetCloseBitmap(new Bitmap(GetType(), "Multimedia.close2.bmp"), Color.FromArgb(255, 0, 255), new Point(300, 74)); taskbarNotifier2.TitleRectangle = new Rectangle(123, 80, 176, 16); taskbarNotifier2.ContentRectangle = new Rectangle(116, 97, 120, 22); taskbarNotifier2.TitleClick += new EventHandler(TitleClick); taskbarNotifier2.ContentClick += new EventHandler(ContentClick); taskbarNotifier2.CloseClick += new EventHandler(CloseClick); taskbarNotifier1 = new TaskbarNotifier(); taskbarNotifier1.SetBackgroundBitmap(new Bitmap(GetType(), "Multimedia.skin.bmp"), Color.FromArgb(255, 0, 255)); taskbarNotifier1.SetCloseBitmap(new Bitmap(GetType(), "Multimedia.close.bmp"), Color.FromArgb(255, 0, 255), new Point(127, 8)); taskbarNotifier1.TitleRectangle = new Rectangle(40, 9, 70, 25); taskbarNotifier1.ContentRectangle = new Rectangle(8, 21, 133, 68); taskbarNotifier1.TitleClick += new EventHandler(TitleClick); taskbarNotifier1.ContentClick += new EventHandler(ContentClick); taskbarNotifier1.CloseClick += new EventHandler(CloseClick); }
private void InitTaskbar() { taskbarNotifier = new TaskbarNotifier(); taskbarNotifier.SetBackgroundBitmap(new Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream("VI.Images.mfcstartupskin.bmp")), Color.FromArgb(255, 255, 255)); taskbarNotifier.SetCloseBitmap(new Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream("VI.Images.close.bmp")), Color.FromArgb(0, 0, 0), new Point(187, 60)); taskbarNotifier.titleRectangle = new Rectangle(70, 50, 155, 35); taskbarNotifier.contentRectangle = new Rectangle(60, 50, 100, 150); taskbarNotifier.OnTitleClick += TitleClick; taskbarNotifier.OnContentClick += ContentClick; taskbarNotifier.OnCloseClick += CloseClick; taskbarNotifier.closeClickable = true; taskbarNotifier.titleClickable = true; taskbarNotifier.contentClickable = true; taskbarNotifier.enableSelectionRectangle = false; taskbarNotifier.KeepVisibleOnMousOver = true; taskbarNotifier.ReShowOnMouseOver = true; }
private TaskbarNotifier NewMessageForm() { TaskbarNotifier notifier = new TaskbarNotifier(); notifier.SetBackgroundBitmap(Properties.Resources.skin, Color.FromArgb(255, 0, 255)); notifier.SetCloseBitmap(Properties.Resources.close, Color.FromArgb(255, 0, 255), new Point(127, 8)); notifier.TitleRectangle = new Rectangle(40, 9, 70, 25); notifier.ContentRectangle = new Rectangle(8, 41, 133, 68); notifier.TitleClick += new EventHandler(TitleClick); notifier.ContentClick += new EventHandler(ContentClick); notifier.CloseClick += new EventHandler(CloseClick); notifier.MessageHide += new IndexEventHandler(MessageHide); notifier.CloseClickable = true; //关闭按钮是否可单击 notifier.TitleClickable = true; //标题是否可单击 notifier.ContentClickable = true; //内容是否可单击 notifier.EnableSelectionRectangle = true; //是否显示内容的框 notifier.KeepVisibleOnMousOver = true; // 鼠标停留时是否一直保持可见 notifier.ReShowOnMouseOver = true; //当消隐时鼠标划过是否重现 notifier.TimeToShow = 500; notifier.TimeToStay = 3000; notifier.TimeToHide = 500; return(notifier); }
private void MantisNotifyForm_Load(object sender, System.EventArgs e) { Hide(); NameValueCollection appSettings = ConfigurationManager.AppSettings; checkMantisTimer.Interval = Convert.ToInt32(appSettings["CheckForNewIssuesEverySecs"]) * 1000; timeToShowNotificationInMs = Convert.ToInt32(appSettings["TimeToShowNotificationSecs"]) * 1000; timeToStayNotificationInMs = Convert.ToInt32(appSettings["TimeToStayNotificationSecs"]) * 1000; timeToHideNotificationInMs = Convert.ToInt32(appSettings["TimeToHideNotificationSecs"]) * 1000; taskbarNotifier = new TaskbarNotifier(); taskbarNotifier.SetBackgroundBitmap(new Bitmap(GetType(), "skin.bmp"), Color.FromArgb(255, 0, 255)); taskbarNotifier.SetCloseBitmap(new Bitmap(GetType(), "close.bmp"), Color.FromArgb(255, 0, 255), new Point(280, 55)); taskbarNotifier.TitleRectangle = new Rectangle(150, 57, 125, 28); taskbarNotifier.ContentRectangle = new Rectangle(75, 92, 215, 55); taskbarNotifier.TitleClick += new EventHandler(TitleClick); taskbarNotifier.ContentClick += new EventHandler(ContentClick); taskbarNotifier.CloseClick += new EventHandler(CloseClick); Connect(); checkMantisTimer.Enabled = true; }
void webBrowser_NavigateComplete2(object pDisp, ref object URL) { // If the site or url is null, do not continue if (pDisp == null || URL == null) { return; } // Access both the web browser object and the url passed // to this event handler SHDocVw.WebBrowser browser = (SHDocVw.WebBrowser)pDisp; // 웹브라우저가 페이지 이동 중에 만드는 웹브라우저 메소드(webBrowser와 browser은 페이지 이동 중에 딱 한 번 일치한다.) // 이를 이용해 한번만 검사하도록 변경한게 if (webBrowser.LocationURL.Equals(browser.LocationURL)) string url = URL.ToString(); int rating = 0; IHTMLDocument2 document = null; if (webBrowser.LocationURL.Equals(browser.LocationURL) && check) // 현재 이동하는 페이지가 사용자가 URL창에 입력한 주소와 동일한지 체크 // 혹은 이미 체크했는지 체크(안하면 차단 페이지에 못들어가고 // 원래 URL -> 차단 페이지의 버튼 누르면 들어가지는 URL(php 페이지의 burl)의 변수로 들어감 -> 또들어감 -> 또들어감 의 반복 { /* 6월 18~19일 내용 수정 * 차단 php 페이지 띄우도록 변경 */ // Grab the document object off of the Web Browser control document = (IHTMLDocument2)webBrowser.Document; if (document == null) { return; } rating = DBConnector.GetSiteInfo(url); if (rating > 0) { check = false; } } if (rating <= 0) { // This is Safe Site. // Pass the current URL to the broker PassUrlToBroker(url); } else if (rating >= 1 && rating <= 25) { // 낮은 점수의 페이지에 접근하면 화면 오른쪽 하단에서 메신저 // 알림 올라오듯이 만드려고 한거, 근데 작동안함, 하지만 에러가 아예 없어 뭐가 문제인지 파악불가 // This is Reported Site. But Not Blocked Site // Pass the current URL to the broker TaskbarNotifier tNotify = new TaskbarNotifier(); tNotify.SetBackgroundBitmap("popup.bmp", Color.FromArgb(0, 0, 0)); tNotify.SetCloseBitmap("close.bmp", Color.FromArgb(0, 0, 0), new Point(127, 8)); tNotify.TitleRectangle = new Rectangle(40, 9, 70, 25); tNotify.ContentRectangle = new Rectangle(8, 41, 133, 68); tNotify.TitleClick += new EventHandler(TitleClick); tNotify.ContentClick += new EventHandler(ContentClick); tNotify.CloseClick += new EventHandler(CloseClick); tNotify.Show("경고", "신고된 페이지입니다. 주의하여 사용해주세요", 100, 300, 100); // 수정이 필요하면 이 위에까지 잘라내고 새로 넣어도 무방함. 아래는 페이지를 띄워주는 코드이므로 안됨 PassUrlToBroker(url); } else if (rating >= 26 && rating <= 75) { // This is Reported Site. // Move to weak Blocked page // 점수가 그냥 높은 수준일 때 차단 페이지로 이동. // webBrowser.LocationURL : URL을 직접 입력, 혹은 Navigate2로 이동할 때 기록되는 페이지 // BeforeURL : 이전 주소 browser.Stop(); browser.Navigate2("http://siteblocker.iptime.org/blocked.php?lvl=0&url=" + webBrowser.LocationURL + "&burl=" + BeforeURL, true); } else if (rating >= 76 && rating <= 100) { // This is Reported Site. // Move to String Blocked Page browser.Stop(); browser.Navigate2("http://siteblocker.iptime.org/blocked.php?lvl=1&url=" + webBrowser.LocationURL + "&burl=" + BeforeURL, true); } rating = 0; }
private void showMessage(int type, string nr) { TaskbarNotifier taskbarNotifier1 = new TaskbarNotifier(); switch (type) { case 1: taskbarNotifier1.SetBackgroundBitmap(new Bitmap(Image.FromStream(typeof(DownFileControl).Assembly.GetManifestResourceStream("Ebada.Scgl.Lcgl.Resources.skin1.bmp"))), Color.FromArgb(255, 0, 255)); taskbarNotifier1.SetCloseBitmap(new Bitmap(Image.FromStream(typeof(DownFileControl).Assembly.GetManifestResourceStream("Ebada.SCGL.Lcgl.Resources.close.bmp"))), Color.FromArgb(255, 0, 255), new Point(127, 8)); taskbarNotifier1.TitleRectangle = new Rectangle(40, 9, 70, 25); taskbarNotifier1.ContentRectangle = new Rectangle(8, 41, 133, 68); break; case 2: taskbarNotifier1.SetBackgroundBitmap(new Bitmap(Image.FromStream(typeof(DownFileControl).Assembly.GetManifestResourceStream("Ebada.Scgl.Lcgl.Resources.skin2.bmp"))), Color.FromArgb(255, 0, 255)); taskbarNotifier1.SetCloseBitmap(new Bitmap(Image.FromStream(typeof(DownFileControl).Assembly.GetManifestResourceStream("Ebada.Scgl.Lcgl.Resources.close.bmp"))), Color.FromArgb(255, 0, 255), new Point(300, 74)); taskbarNotifier1.TitleRectangle = new Rectangle(123, 80, 176, 16); taskbarNotifier1.ContentRectangle = new Rectangle(116, 97, 197, 22); break; default: taskbarNotifier1.SetBackgroundBitmap(new Bitmap(Image.FromStream(typeof(DownFileControl).Assembly.GetManifestResourceStream("Ebada.Scgl.Lcgl.Resources.skin3.bmp"))), Color.FromArgb(255, 0, 255)); taskbarNotifier1.SetCloseBitmap(new Bitmap(Image.FromStream(typeof(DownFileControl).Assembly.GetManifestResourceStream("Ebada.Scgl.Lcgl.Resources.close.bmp"))), Color.FromArgb(255, 0, 255), new Point(280, 57)); taskbarNotifier1.TitleRectangle = new Rectangle(150, 57, 125, 28); taskbarNotifier1.ContentRectangle = new Rectangle(75, 92, 215, 55); break; } taskbarNotifier1.CloseClickable = true; taskbarNotifier1.TitleClickable = false; taskbarNotifier1.ContentClickable = true; taskbarNotifier1.EnableSelectionRectangle = true; taskbarNotifier1.KeepVisibleOnMousOver = true; // Added Rev 002 taskbarNotifier1.ReShowOnMouseOver = false; // Added Rev 002 //taskbarNotifier1.TitleClick += new EventHandler(TitleClick); //taskbarNotifier1.CloseClick += new EventHandler(CloseClick); taskbarNotifier1.Show("农电生产系统", nr, 10, 5000, 50); }
//private void bw_ProgressChanged(object sender, ProgressChangedEventArgs e) //{ // lblStatusBarInfo.Visible = true; // progressStatusBar.Visible = true; // this.lblStatusBarInfo.Text = "Updating message list"; // this.progressStatusBar.Value = e.ProgressPercentage; //} #endregion public MesajeApplication() { InitializeComponent(); notifyIcon = new NotifyIcon(); contextMenu = new ContextMenu(); exitMenuItem = new MenuItem(); newMessageMenuItem = new MenuItem(); optionsMenuItem = new MenuItem(); // set up the Message Updater backWorker.WorkerReportsProgress = true; backWorker.WorkerSupportsCancellation = true; backWorker.DoWork += new DoWorkEventHandler(bw_DoWork); //backWorker.ProgressChanged += new ProgressChangedEventHandler(bw_ProgressChanged); backWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted); // initialize the context menu contextMenu.MenuItems.AddRange(new MenuItem[] { exitMenuItem, optionsMenuItem, newMessageMenuItem }); // initialize the menu items exitMenuItem.Index = 2; exitMenuItem.Text = "E&xit"; exitMenuItem.Click += new EventHandler(exitMenuItem_Click); optionsMenuItem.Index = 1; optionsMenuItem.Text = "&Options"; optionsMenuItem.Click += new EventHandler(optionsMenuItem_Click); newMessageMenuItem.Index = 0; newMessageMenuItem.Text = "Arata mesaj &nou"; newMessageMenuItem.Click += new EventHandler(newMessageMenuItem_Click); // create the notification icon notifyIcon = new NotifyIcon(); notifyIcon.Icon = Resource.Application; notifyIcon.ContextMenu = contextMenu; notifyIcon.Text = "Mesaje diverse"; notifyIcon.BalloonTipIcon = ToolTipIcon.Info; notifyIcon.BalloonTipText = "Apasati pe icoana pentru mesaje diverse."; notifyIcon.BalloonTipTitle = "Mesaje diverse"; notifyIcon.Visible = true; notifyIcon.DoubleClick += new EventHandler(notifyIcon_DoubleClick); // add the resize event this.Resize += new EventHandler(MesajeApplication_Resize); notifyIcon.Visible = true; notifyIcon.DoubleClick += new EventHandler(notifyIcon_DoubleClick); AppSettingsReader appSettings = new AppSettingsReader(); // set the timer messageDisplayTimer = new Timer(); messageDisplayTimer.Interval = Config.Instance.PublishInterval; messageDisplayTimer.Tick += new EventHandler(MessageTimeout); messageDisplayTimer.Enabled = true; messageDisplayTimer.Start(); messageUpdateTimer = new Timer(); messageUpdateTimer.Interval = Config.Instance.MessageUpdateInterval; messageUpdateTimer.Tick += new EventHandler(UpdateMessagesTimeout); messageUpdateTimer.Enabled = true; messageUpdateTimer.Start(); // initialize the Notification windows taskbarNotifier1 = new TaskbarNotifier(); taskbarNotifier1.SetBackgroundBitmap(Resource.skin, Color.FromArgb(255, 0, 255)); taskbarNotifier1.SetCloseBitmap(Resource.close, Color.FromArgb(255, 0, 255), new Point(280, 57)); taskbarNotifier1.TitleRectangle = new Rectangle(150, 57, 125, 28); taskbarNotifier1.ContentRectangle = new Rectangle(75, 92, 215, 55); taskbarNotifier1.TitleClick += new EventHandler(TitleClick); taskbarNotifier1.ContentClick += new EventHandler(ContentClick); taskbarNotifier1.CloseClick += new EventHandler(CloseClick); taskbarNotifier1.EnableSelectionRectangle = true; taskbarNotifier1.KeepVisibleOnMousOver = true; taskbarNotifier1.ReShowOnMouseOver = true; taskbarNotifier2 = new TaskbarNotifier(); taskbarNotifier2.SetBackgroundBitmap(Resource.skin2, Color.FromArgb(255, 0, 255)); taskbarNotifier2.SetCloseBitmap(Resource.close2, Color.FromArgb(255, 0, 255), new Point(280, 57)); taskbarNotifier2.TitleRectangle = new Rectangle(150, 57, 125, 28); taskbarNotifier2.ContentRectangle = new Rectangle(75, 92, 215, 55); taskbarNotifier2.TitleClick += new EventHandler(TitleClick); taskbarNotifier2.ContentClick += new EventHandler(ContentClick); taskbarNotifier2.CloseClick += new EventHandler(CloseClick); taskbarNotifier2.EnableSelectionRectangle = true; taskbarNotifier2.KeepVisibleOnMousOver = true; taskbarNotifier2.ReShowOnMouseOver = true; taskbarNotifier3 = new TaskbarNotifier(); taskbarNotifier3.SetBackgroundBitmap(Resource.skin3, Color.FromArgb(255, 0, 255)); taskbarNotifier3.SetCloseBitmap(Resource.close, Color.FromArgb(255, 0, 255), new Point(280, 57)); taskbarNotifier3.TitleRectangle = new Rectangle(150, 57, 125, 28); taskbarNotifier3.ContentRectangle = new Rectangle(75, 92, 215, 55); taskbarNotifier3.TitleClick += new EventHandler(TitleClick); taskbarNotifier3.ContentClick += new EventHandler(ContentClick); taskbarNotifier3.CloseClick += new EventHandler(CloseClick); taskbarNotifier3.EnableSelectionRectangle = true; taskbarNotifier3.KeepVisibleOnMousOver = true; taskbarNotifier3.ReShowOnMouseOver = true; //LoadItems(); //MessageManagement.UpdateXml(); // start updating the message list UpdateMessagesTimeout(null, null); // add a dummy item Mesaje.Data.Message dummy = new Data.Message(); dummy.ID = 1; dummy.Body = "Dummy body,the red cow is crossing the street."; dummy.Title = "Dummy title"; lock (lockMessages) { messages.Add(dummy); } this.WindowState = FormWindowState.Minimized; }