EaseFilter Demo Project
FileMonitor/TrayForm.cs
Go to the documentation of this file.
1 //
3 // (C) Copyright 2012 EaseFilter Technologies Inc.
4 // All Rights Reserved
5 //
6 // This software is part of a licensed software product and may
7 // only be used or copied in accordance with the terms of that license.
8 //
10 
11 using System;
12 using System.Collections.Generic;
13 using System.ComponentModel;
14 using System.Data;
15 using System.Drawing;
16 using System.Linq;
17 using System.Text;
18 using System.Windows.Forms;
19 using System.IO;
20 
22 
23 namespace FileMonitor
24 {
25  public partial class TrayForm : Form
26  {
27  MonitorForm monitorForm = new MonitorForm();
28 
29  public TrayForm()
30  {
32  InitializeComponent();
33 
34  EventManager.ShowNotificationDlgt showNotificationDlgt = new EventManager.ShowNotificationDlgt(ShowNotification);
35  EventManager.showNotificationDlgt = showNotificationDlgt;
36  }
37 
38  private void TrayForm_Load(object sender, EventArgs e)
39  {
40  this.Hide();
41  this.notifyIcon.Visible = true;
42  monitorForm.ShowDialog();
43  }
44 
45  private void consoleToolStripMenuItem_Click(object sender, EventArgs e)
46  {
47  if (!monitorForm.Visible)
48  {
49  monitorForm.StartPosition = FormStartPosition.CenterScreen;
50  monitorForm.ShowDialog();
51  }
52  }
53 
54  private void settingsToolStripMenuItem_Click(object sender, EventArgs e)
55  {
56  SettingsForm settingForm = new SettingsForm();
57  settingForm.StartPosition = FormStartPosition.CenterScreen;
58  settingForm.ShowDialog();
59  }
60 
61  private void helpTopicsToolStripMenuItem1_Click(object sender, EventArgs e)
62  {
63  System.Diagnostics.Process.Start("http://www.easefilter.com/Forums_Files/FileMonitor.htm");
64  }
65 
66  private void reportAProblemToolStripMenuItem_Click(object sender, EventArgs e)
67  {
68  System.Diagnostics.Process.Start("http://www.easefilter.com/ReportIssue.htm");
69  }
70 
71  private void exitToolStripMenuItem1_Click(object sender, EventArgs e)
72  {
74  monitorForm.Close();
75 
76  Application.Exit();
77  }
78 
79  private void sdkToolStripMenuItem_Click(object sender, EventArgs e)
80  {
81  System.Diagnostics.Process.Start("http://www.easefilter.com/info/easefilter_manual.pdf");
82  }
83 
84  private void openSourceCodeToolStripMenuItem_Click(object sender, EventArgs e)
85  {
86  System.Reflection.Assembly assembly = System.Reflection.Assembly.GetEntryAssembly();
87  string AssemblyPath = Path.Combine(Path.GetDirectoryName(assembly.Location), "Demo");
88  System.Diagnostics.Process.Start("explorer.exe", AssemblyPath);
89  }
90 
91  private void uninstallDriverToolStripMenuItem_Click(object sender, EventArgs e)
92  {
93  FilterAPI.UnInstallDriver();
94  }
95 
96  private void ShowNotification(string message, bool isErrorMessage)
97  {
99  {
100  return;
101  }
102 
103  if (this.InvokeRequired)
104  {
105  this.Invoke(new EventManager.ShowNotificationDlgt(ShowNotification), new Object[] { message, isErrorMessage });
106  }
107  else
108  {
109  popupNotifier1.ShowInternalImage(isErrorMessage, !isErrorMessage);
110  popupNotifier1.TitleText = "";
111  popupNotifier1.ContentText = message;
112  popupNotifier1.Popup();
113  }
114 
115  }
116 
117  }
118 }
System.Windows.Forms.NotifyIcon notifyIcon
static void CopyOSPlatformDependentFiles()
Definition: Utils.cs:92

Social Network


Services Overview

Architect, implement and test file system filter drivers for a wide range of functionality. We can offer several levels of assistance to meet your specific.

Contact Us

You are welcome to contact us for salse or partnership.

Sales: sales@easefilter.com
Support: support@easefilter.com
Info: info@easefilter.com