/// <summary> /// The main entrance to the MFC. /// </summary> /// <param name="sender">Opject which triggered the call.</param> /// <param name="e">Arguments for this event handler</param> private void OnLoad(object sender, EventArgs e) { Kernel.Glue.SetModuleInstance("MainForm", this); // Set plugin Directory pluginDirectory = GetPluginDirectory(configFileName); try { BootLoader.HandleStartup(); } catch (Exception ex) { ex.ToString(); } Text = BootLoader.ApplicationName; if (BootLoader.UseTray) { if (!isService) { InitTrayIcon(); InitTaskbar(); taskbarNotifier.Show(BootLoader.ApplicationName, BootLoader.ApplicationVersion + "\n" + Convert.ToString(Kernel.Glue.GetModulesByType <ICommModule>().Count) + " connections created.\n\n\n", 1500, 2000, 2500); } } }
private void DisplayNotificationWindow(string title, string body, int timeout, int winId) { TaskbarNotifier notifyWind = null; switch (winId) { case 1: notifyWind = taskbarNotifier1; break; case 2: notifyWind = taskbarNotifier2; break; case 3: default: notifyWind = taskbarNotifier3; break; } if (notifyWind == null) { // recreate the window notifyWind = CreateNotificationWindow(winId); } notifyWind.Show(title, body, 500, timeout, 500); }
private void ShowIssue(int issueId) { if (!Connect()) { return; } Issue issue; try { issue = session.Request.IssueGet(issueId); } catch (System.Net.WebException) { Disconnect(); return; } taskbarNotifier.CloseClickable = true; taskbarNotifier.TitleClickable = true; taskbarNotifier.ContentClickable = true; taskbarNotifier.EnableSelectionRectangle = true; taskbarNotifier.KeepVisibleOnMousOver = true; taskbarNotifier.ReShowOnMouseOver = true; taskbarNotifier.Show("Mantis Notifier", string.Format("{0}: {1}", issueId, issue.Summary), timeToShowNotificationInMs, timeToStayNotificationInMs, timeToHideNotificationInMs); }
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); }
/// <summary> /// tipo de cuadro ecisten 3 tipos /// </summary> /// <param name="titulo">Titulo del mensaje</param> /// <param name="mensaje">Mensaje</param> public void cuadro1(string titulo, string mensaje) { 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.Show(titulo, mensaje, 250, 5000, 500); //sonido(@Application.StartupPath+"\\a.wav"); }
public void ShowMsg(string textBoxContent) { string textBoxTitle = "提示消息"; // textBoxContent = "错误显示消息,啊哈哈胜多负少蓝色的肌肤了开始就了开始就地方塑料袋肌肤是的水电费 水电费水电费事情啊 矮人是否撒俄方啥地方艾丝凡错误显示消息,啊哈哈胜多负少蓝色的肌肤了开始就了开始就地方塑料袋肌肤是的水电费 水电费水电费事情啊 矮人是否撒俄方啥地方艾丝凡"; //taskbarNotifier3.CloseClickable = true; //taskbarNotifier3.TitleClickable = false; //taskbarNotifier3.ContentClickable = true; //taskbarNotifier3.EnableSelectionRectangle = true; //taskbarNotifier3.KeepVisibleOnMousOver = true;// Added Rev 002 //taskbarNotifier3.ReShowOnMouseOver = true; // Added Rev 002 textContent = textBoxContent; taskbarNotifier3.Show(textBoxTitle, textBoxContent, 300, 5000, 400); }
void Show_popUP() { string t1 = "500"; string t2 = "3000"; string t3 = "500"; taskbarNotifier1.CloseClickable = true; taskbarNotifier1.TitleClickable = false; taskbarNotifier1.ContentClickable = true; taskbarNotifier1.EnableSelectionRectangle = true; taskbarNotifier1.KeepVisibleOnMousOver = true; // Added Rev 002 taskbarNotifier1.ReShowOnMouseOver = true; // Added Rev 002 taskbarNotifier1.Show("Monitoring", RemoteUserName + "\n Is Now Accessing Your System ", Int32.Parse(t1), Int32.Parse(t2), Int32.Parse(t3)); }
public void NotifierSub(string title, string msg, int level, int delay) { TaskbarNotifier notifier = InitTaskBarNotifier(new TaskbarNotifier()); switch (level) { case 1: notifier.SetBackgroundBitmap(new Bitmap(GetType(), "skinw.bmp"), Color.FromArgb(255, 0, 255)); break; case 2: notifier.SetBackgroundBitmap(new Bitmap(GetType(), "skine.bmp"), Color.FromArgb(255, 0, 255)); break; default: notifier.SetBackgroundBitmap(new Bitmap(GetType(), "skini.bmp"), Color.FromArgb(255, 0, 255)); break; } notifier.AppearBySliding = (mUseFading == 0); notifier.Show(title, msg, mFadeInMSecs, delay * 1000, mFadeOutMSecs); }
private void ShowNotify(object sender) { int countChanged; while (sender is Control && !((Control)sender).IsDisposed && isRunning && QLBHUtils.IsShowNotify) { try { if (!((Control)sender).IsDisposed && (countChanged = HasChanged(notifyDateTime)) > 0) { ((Control)sender).Invoke((MethodInvoker) delegate() { if (!TaskbarNotifier.IsDisposed && TaskbarNotifier.IsHandleCreated) { TaskbarNotifier.Show(TaskbarNotifier.TitleText, String.Format(TaskbarNotifier.ContentText, countChanged), 500, 6000, 500); notifyDateTime = CommonProvider.Instance.GetSysDate(); } }); } //int timeDelay = 0; //while (!((Control)sender).IsDisposed && isRunning && timeDelay < 300000) //{ // timeDelay += 500; // Thread.Sleep(500); //} Thread.CurrentThread.Join(15000); } catch (Exception ex) { if (!((Control)sender).IsDisposed) { EventLogProvider.Instance.WriteLog(ex.ToString(), "ShowNotify"); } } } }
// Added Rev 002 private void ButtonShowPopup3_Click(object sender, System.EventArgs e) { if (textBoxTitle.Text.Length == 0 || textBoxContent.Text.Length == 0) { MessageBox.Show("Enter a title and a content Text"); return; } if (!IsNumeric(textBoxDelayShowing.Text) || !IsNumeric(textBoxDelayStaying.Text) || !IsNumeric(textBoxDelayHiding.Text)) { MessageBox.Show("Enter valid Delays (integers)"); return; } taskbarNotifier3.CloseClickable = checkBoxCloseClickable.Checked; taskbarNotifier3.TitleClickable = checkBoxTitleClickable.Checked; taskbarNotifier3.ContentClickable = checkBoxContentClickable.Checked; taskbarNotifier3.EnableSelectionRectangle = checkBoxSelectionRectangle.Checked; taskbarNotifier3.KeepVisibleOnMousOver = checkBoxKeepVisibleOnMouseOver.Checked; // Added Rev 002 taskbarNotifier3.ReShowOnMouseOver = checkBoxReShowOnMouseOver.Checked; // Added Rev 002 taskbarNotifier3.Show(textBoxTitle.Text, textBoxContent.Text, Int32.Parse(textBoxDelayShowing.Text), Int32.Parse(textBoxDelayStaying.Text), Int32.Parse(textBoxDelayHiding.Text)); }
private void Node_NodeClick(object sender, EventArgs e) { DevComponents.AdvTree.Node nNode = sender as DevComponents.AdvTree.Node; string sID = nNode.Name; DataRow[] drrProjectUpdates = dtProjectUpdates.Select("ID = '" + sID + "'"); if (drrProjectUpdates.Length > 0) { wBrowser.DocumentText = drrProjectUpdates[0]["DESCRIPTION_HTML"].ToString(); lblFrom.Text = "<b>" + drrProjectUpdates[0]["CREATED_BY"] + "</b> : " + drrProjectUpdates[0]["SUBJECT"]; if (drrProjectUpdates[0]["REQUIRE_ACKNOWLEDGEMENT"].ToString().ToUpper() == "Y" && !drrProjectUpdates[0]["USER_ACKNOWLEDGEMENT"].ToString().ToUpper().Contains("|" + GV.sEmployeeNo + "~")) { btnAknowledge.Visible = true; btnAknowledge.Tag = sID; } else { btnAknowledge.Visible = false; btnAknowledge.Tag = string.Empty; nNode.Style = elementStyle1; } tNotifier.CloseClickable = true; tNotifier.TitleClickable = true; tNotifier.ContentClickable = false; tNotifier.EnableSelectionRectangle = false; tNotifier.KeepVisibleOnMousOver = false; // Added Rev 002 tNotifier.ReShowOnMouseOver = false; // Added Rev 002 tNotifier.Show(drrProjectUpdates[0]["CREATED_BY"].ToString(), drrProjectUpdates[0]["Subject"].ToString(), 500, 3000, 500); if (!drrProjectUpdates[0]["USER_READ"].ToString().ToUpper().Contains("|" + GV.sEmployeeNo.ToUpper() + "~")) { GV.MSSQL1.BAL_ExecuteNonReturnQuery("UPDATE c_project_instructions set USER_READ = '" + drrProjectUpdates[0]["USER_READ"].ToString().Replace("'", "''").ToUpper() + "|" + GV.sEmployeeNo.ToUpper() + "~" + GM.GetDateTime().ToString("dd/MM/yyyy hh:mm:ss tt") + "|' WHERE ID = '" + sID + "'"); } } }
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 ButtonShowPopup1_Click(object sender, EventArgs e) { TaskbarNotifier.Show(TaskbarNotifier.TitleText, TaskbarNotifier.ContentText, 500, 3000, 500); }