private void ShowNotification(string alarmString) { Notify.ClearUserNotification(this.timerNotificationHandle); FormEngine.BringWindowToTop(this); if (this.notificationAlarm != null) { this.notificationAlarm.Dispose(); } this.notificationAlarm = new Microsoft.WindowsCE.Forms.Notification(); this.notificationAlarm.Caption = this.Text; this.notificationAlarm.Critical = false; this.notificationAlarm.InitialDuration = 60; this.notificationAlarm.BalloonChanged += new Microsoft.WindowsCE.Forms.BalloonChangedEventHandler(notificationAlarm_BalloonChanged); this.notificationAlarm.ResponseSubmitted += new Microsoft.WindowsCE.Forms.ResponseSubmittedEventHandler(notificationAlarm_ResponseSubmitted); int minute = this.timeRemaining.Minutes; if (this.timeRemaining.Seconds > 0) { minute++; } this.notificationAlarm.Text = string.Format(alarmString, minute); this.notificationAlarm.Critical = true; //this.notificationAlarm.Icon = global::AdaTimerPpc.Properties.Resources.AlarmIcon; this.notificationAlarm.Visible = true; }
void notification1_ResponseSubmitted(object sender, Microsoft.WindowsCE.Forms.ResponseSubmittedEventArgs e) { notification1.Visible = false; notification1 = null; notification1.Dispose(); }
public void Dispose() { notification1.Visible = false; notification1 = null; notification1.Dispose(); Dispose(); }
private void CleanupNotifications() { if (this.notificationAlarm != null) { this.notificationAlarm.Dispose(); this.notificationAlarm = null; } Notify.ClearUserNotification(this.timerNotificationHandle); Notify.RunAppAtTime(this.application, DateTime.Now); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.mainMenu = new System.Windows.Forms.MainMenu(); this.menuItem1 = new System.Windows.Forms.MenuItem(); this.gravLabel = new System.Windows.Forms.Label(); this.secondPanel = new System.Windows.Forms.Panel(); this.btnReset = new System.Windows.Forms.Button(); this.label6 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); this.avgLabel = new System.Windows.Forms.Label(); this.avgContextMenu1 = new System.Windows.Forms.ContextMenu(); this.menuItem2 = new System.Windows.Forms.MenuItem(); this.yMax = new System.Windows.Forms.TextBox(); this.yMin = new System.Windows.Forms.TextBox(); this.gravPictureBox = new System.Windows.Forms.PictureBox(); this.msgFileexists = new System.Windows.Forms.Panel(); this.label7 = new System.Windows.Forms.Label(); this.btnCancel = new System.Windows.Forms.Button(); this.btnAppend = new System.Windows.Forms.Button(); this.btnOverwrite = new System.Windows.Forms.Button(); this.textBox2 = new System.Windows.Forms.TextBox(); this.firstPanel = new System.Windows.Forms.Panel(); this.txtLogFile = new System.Windows.Forms.TextBox(); this.label4 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.textBox1 = new System.Windows.Forms.TextBox(); this.panel1 = new System.Windows.Forms.Panel(); this.radClosed = new System.Windows.Forms.RadioButton(); this.label2 = new System.Windows.Forms.Label(); this.radOpen = new System.Windows.Forms.RadioButton(); this.panel2 = new System.Windows.Forms.Panel(); this.radLogOn = new System.Windows.Forms.RadioButton(); this.radLogOff = new System.Windows.Forms.RadioButton(); this.label1 = new System.Windows.Forms.Label(); this.timer1 = new System.Windows.Forms.Timer(); this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); this.notification1 = new Microsoft.WindowsCE.Forms.Notification(); this.secondPanel.SuspendLayout(); this.msgFileexists.SuspendLayout(); this.firstPanel.SuspendLayout(); this.panel1.SuspendLayout(); this.panel2.SuspendLayout(); this.SuspendLayout(); // // mainMenu // this.mainMenu.MenuItems.Add(this.menuItem1); // // menuItem1 // this.menuItem1.Text = "Plot"; this.menuItem1.Click += new System.EventHandler(this.menuItem1_Click); // // gravLabel // this.gravLabel.Font = new System.Drawing.Font("Tahoma", 13F, System.Drawing.FontStyle.Bold); this.gravLabel.Location = new System.Drawing.Point(97, 140); this.gravLabel.Name = "gravLabel"; this.gravLabel.Size = new System.Drawing.Size(108, 24); this.gravLabel.Text = "<Gravity>"; // // secondPanel // this.secondPanel.Controls.Add(this.btnReset); this.secondPanel.Controls.Add(this.label6); this.secondPanel.Controls.Add(this.label5); this.secondPanel.Controls.Add(this.avgLabel); this.secondPanel.Controls.Add(this.gravLabel); this.secondPanel.Controls.Add(this.yMax); this.secondPanel.Controls.Add(this.yMin); this.secondPanel.Controls.Add(this.gravPictureBox); this.secondPanel.Location = new System.Drawing.Point(248, 0); this.secondPanel.Name = "secondPanel"; this.secondPanel.Size = new System.Drawing.Size(240, 269); this.secondPanel.Visible = false; // // btnReset // this.btnReset.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.btnReset.Location = new System.Drawing.Point(197, 176); this.btnReset.Name = "btnReset"; this.btnReset.Size = new System.Drawing.Size(40, 20); this.btnReset.TabIndex = 5; this.btnReset.Text = " rst"; this.btnReset.Click += new System.EventHandler(this.btnReset_Click); // // label6 // this.label6.Font = new System.Drawing.Font("Tahoma", 13F, System.Drawing.FontStyle.Bold); this.label6.Location = new System.Drawing.Point(-2, 173); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(93, 33); this.label6.Text = "Average"; // // label5 // this.label5.Font = new System.Drawing.Font("Tahoma", 13F, System.Drawing.FontStyle.Bold); this.label5.Location = new System.Drawing.Point(-2, 140); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(93, 30); this.label5.Text = "Current"; // // avgLabel // this.avgLabel.ContextMenu = this.avgContextMenu1; this.avgLabel.Font = new System.Drawing.Font("Tahoma", 13F, System.Drawing.FontStyle.Bold); this.avgLabel.Location = new System.Drawing.Point(97, 173); this.avgLabel.Name = "avgLabel"; this.avgLabel.Size = new System.Drawing.Size(108, 24); this.avgLabel.Text = "<Avg>"; // // avgContextMenu1 // this.avgContextMenu1.MenuItems.Add(this.menuItem2); // // menuItem2 // this.menuItem2.Text = "Copy"; this.menuItem2.Click += new System.EventHandler(this.menuItem2_Click); // // yMax // this.yMax.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold); this.yMax.Location = new System.Drawing.Point(5, 9); this.yMax.Name = "yMax"; this.yMax.Size = new System.Drawing.Size(24, 25); this.yMax.TabIndex = 10; this.yMax.Text = "2"; this.yMax.TextChanged += new System.EventHandler(this.yMax_TextChanged); // // yMin // this.yMin.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold); this.yMin.Location = new System.Drawing.Point(6, 117); this.yMin.Name = "yMin"; this.yMin.Size = new System.Drawing.Size(24, 25); this.yMin.TabIndex = 11; this.yMin.Text = "1"; this.yMin.TextChanged += new System.EventHandler(this.yMin_TextChanged); // // gravPictureBox // this.gravPictureBox.Location = new System.Drawing.Point(3, 3); this.gravPictureBox.Name = "gravPictureBox"; this.gravPictureBox.Size = new System.Drawing.Size(237, 134); // // msgFileexists // this.msgFileexists.Controls.Add(this.label7); this.msgFileexists.Controls.Add(this.btnCancel); this.msgFileexists.Controls.Add(this.btnAppend); this.msgFileexists.Controls.Add(this.btnOverwrite); this.msgFileexists.Controls.Add(this.textBox2); this.msgFileexists.Location = new System.Drawing.Point(7, 156); this.msgFileexists.Name = "msgFileexists"; this.msgFileexists.Size = new System.Drawing.Size(230, 91); this.msgFileexists.Visible = false; // // label7 // this.label7.Location = new System.Drawing.Point(10, 14); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(116, 20); this.label7.Text = "Log file exists."; // // btnCancel // this.btnCancel.Font = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Bold); this.btnCancel.Location = new System.Drawing.Point(158, 47); this.btnCancel.Name = "btnCancel"; this.btnCancel.Size = new System.Drawing.Size(65, 20); this.btnCancel.TabIndex = 19; this.btnCancel.Text = "Cancel"; this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); // // btnAppend // this.btnAppend.Font = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Bold); this.btnAppend.Location = new System.Drawing.Point(10, 47); this.btnAppend.Name = "btnAppend"; this.btnAppend.Size = new System.Drawing.Size(65, 20); this.btnAppend.TabIndex = 18; this.btnAppend.Text = "Append"; this.btnAppend.Click += new System.EventHandler(this.btnAppend_Click); // // btnOverwrite // this.btnOverwrite.Font = new System.Drawing.Font("Tahoma", 7.5F, System.Drawing.FontStyle.Bold); this.btnOverwrite.Location = new System.Drawing.Point(81, 47); this.btnOverwrite.Name = "btnOverwrite"; this.btnOverwrite.Size = new System.Drawing.Size(71, 20); this.btnOverwrite.TabIndex = 17; this.btnOverwrite.Text = "Overwrite"; this.btnOverwrite.Click += new System.EventHandler(this.btnOverwrite_Click); // // textBox2 // this.textBox2.Location = new System.Drawing.Point(0, 0); this.textBox2.Multiline = true; this.textBox2.Name = "textBox2"; this.textBox2.Size = new System.Drawing.Size(227, 88); this.textBox2.TabIndex = 20; // // firstPanel // this.firstPanel.Controls.Add(this.msgFileexists); this.firstPanel.Controls.Add(this.txtLogFile); this.firstPanel.Controls.Add(this.label4); this.firstPanel.Controls.Add(this.label3); this.firstPanel.Controls.Add(this.textBox1); this.firstPanel.Controls.Add(this.panel1); this.firstPanel.Controls.Add(this.panel2); this.firstPanel.Location = new System.Drawing.Point(0, 0); this.firstPanel.Name = "firstPanel"; this.firstPanel.Size = new System.Drawing.Size(240, 266); // // txtLogFile // this.txtLogFile.Location = new System.Drawing.Point(32, 180); this.txtLogFile.Name = "txtLogFile"; this.txtLogFile.Size = new System.Drawing.Size(179, 25); this.txtLogFile.TabIndex = 10; // // label4 // this.label4.Location = new System.Drawing.Point(20, 157); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(100, 20); this.label4.Text = "Log File"; // // label3 // this.label3.Location = new System.Drawing.Point(20, 50); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(178, 20); this.label3.Text = "Averaging Interval (sec.)"; // // textBox1 // this.textBox1.Location = new System.Drawing.Point(32, 78); this.textBox1.Name = "textBox1"; this.textBox1.Size = new System.Drawing.Size(100, 25); this.textBox1.TabIndex = 6; this.textBox1.Text = "10"; this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged); // // panel1 // this.panel1.Controls.Add(this.radClosed); this.panel1.Controls.Add(this.label2); this.panel1.Controls.Add(this.radOpen); this.panel1.Location = new System.Drawing.Point(0, 6); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(237, 47); // // radClosed // this.radClosed.Checked = true; this.radClosed.Location = new System.Drawing.Point(90, 23); this.radClosed.Name = "radClosed"; this.radClosed.Size = new System.Drawing.Size(100, 20); this.radClosed.TabIndex = 3; this.radClosed.Text = "Closed"; this.radClosed.CheckedChanged += new System.EventHandler(this.radClosed_CheckedChanged); // // label2 // this.label2.Location = new System.Drawing.Point(20, 0); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(100, 20); this.label2.Text = "Serial Port"; // // radOpen // this.radOpen.Location = new System.Drawing.Point(14, 23); this.radOpen.Name = "radOpen"; this.radOpen.Size = new System.Drawing.Size(100, 20); this.radOpen.TabIndex = 2; this.radOpen.TabStop = false; this.radOpen.Text = "Open"; this.radOpen.CheckedChanged += new System.EventHandler(this.radOpen_CheckedChanged); // // panel2 // this.panel2.Controls.Add(this.radLogOn); this.panel2.Controls.Add(this.radLogOff); this.panel2.Controls.Add(this.label1); this.panel2.Location = new System.Drawing.Point(0, 97); this.panel2.Name = "panel2"; this.panel2.Size = new System.Drawing.Size(240, 57); // // radLogOn // this.radLogOn.Location = new System.Drawing.Point(11, 33); this.radLogOn.Name = "radLogOn"; this.radLogOn.Size = new System.Drawing.Size(53, 20); this.radLogOn.TabIndex = 18; this.radLogOn.TabStop = false; this.radLogOn.Text = "On"; this.radLogOn.CheckedChanged += new System.EventHandler(this.radLogOn_CheckedChanged); // // radLogOff // this.radLogOff.Checked = true; this.radLogOff.Location = new System.Drawing.Point(113, 33); this.radLogOff.Name = "radLogOff"; this.radLogOff.Size = new System.Drawing.Size(100, 20); this.radLogOff.TabIndex = 19; this.radLogOff.Text = "Off"; this.radLogOff.CheckedChanged += new System.EventHandler(this.radLogOff_CheckedChanged); // // label1 // this.label1.Location = new System.Drawing.Point(20, 10); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(100, 20); this.label1.Text = "Logging"; // // openFileDialog1 // this.openFileDialog1.FileName = "openFileDialog1"; // // notification1 // this.notification1.Text = "notification1"; // // MainForm // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; this.ClientSize = new System.Drawing.Size(503, 269); this.Controls.Add(this.secondPanel); this.Controls.Add(this.firstPanel); this.KeyPreview = true; this.Menu = this.mainMenu; this.MinimizeBox = false; this.Name = "MainForm"; this.Text = "USGS Gravity"; this.Load += new System.EventHandler(this.MainForm_Load); this.secondPanel.ResumeLayout(false); this.msgFileexists.ResumeLayout(false); this.firstPanel.ResumeLayout(false); this.panel1.ResumeLayout(false); this.panel2.ResumeLayout(false); this.ResumeLayout(false); }
public void Dispose(){ notification1.Visible = false; notification1 = null; notification1.Dispose(); Dispose(); }