EaseFilter Demo Project
FileProtector/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 FileProtector
24 {
25  public partial class TrayForm: Form
26  {
27  ProtectorForm protectorForm = new ProtectorForm();
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  protectorForm.ShowDialog();
43  Utils.ToDebugger("ShowDialog");
44  }
45 
46  private void consoleToolStripMenuItem_Click(object sender, EventArgs e)
47  {
48  if (!protectorForm.Visible)
49  {
50  protectorForm.StartPosition = FormStartPosition.CenterScreen;
51  protectorForm.ShowDialog();
52  }
53  }
54 
55  private void settingsToolStripMenuItem_Click(object sender, EventArgs e)
56  {
57  SettingsForm settingForm = new SettingsForm();
58  settingForm.StartPosition = FormStartPosition.CenterScreen;
59  settingForm.ShowDialog();
60  }
61 
62  private void helpTopicsToolStripMenuItem1_Click(object sender, EventArgs e)
63  {
64  System.Diagnostics.Process.Start("http://www.easefilter.com/Forums_Files/FileMonitor.htm");
65  }
66 
67  private void reportAProblemToolStripMenuItem_Click(object sender, EventArgs e)
68  {
69  System.Diagnostics.Process.Start("http://www.easefilter.com/ReportIssue.htm");
70  }
71 
72 
73  private void exitToolStripMenuItem1_Click(object sender, EventArgs e)
74  {
76  protectorForm.Close();
77 
78  Application.Exit();
79  }
80 
81  private void sdkToolStripMenuItem_Click(object sender, EventArgs e)
82  {
83  System.Diagnostics.Process.Start("http://www.easefilter.com/info/easefilter_manual.pdf");
84  }
85 
86 
87  private void openProtectorSourceCodeToolStripMenuItem_Click(object sender, EventArgs e)
88  {
89  System.Reflection.Assembly assembly = System.Reflection.Assembly.GetEntryAssembly();
90  string AssemblyPath = Path.Combine(Path.GetDirectoryName(assembly.Location), "Demo");
91  System.Diagnostics.Process.Start("explorer.exe", AssemblyPath);
92  }
93 
94  private void uninstallDriverToolStripMenuItem_Click(object sender, EventArgs e)
95  {
96  FilterAPI.UnInstallDriver();
97  }
98 
99  private void ShowNotification(string message, bool isErrorMessage)
100  {
102  {
103  return;
104  }
105 
106  if (this.InvokeRequired)
107  {
108  this.Invoke(new EventManager.ShowNotificationDlgt(ShowNotification), new Object[] { message, isErrorMessage });
109  }
110  else
111  {
112  popupNotifier1.ShowInternalImage(isErrorMessage, !isErrorMessage);
113  popupNotifier1.TitleText = "";
114  popupNotifier1.ContentText = message;
115  popupNotifier1.Popup();
116  }
117 
118  }
119 
120  }
121 }
System.Windows.Forms.NotifyIcon notifyIcon
static void CopyOSPlatformDependentFiles()
Definition: Utils.cs:92
static void ToDebugger(string message)
Definition: Utils.cs:284

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