private void hostCatchStatusLabel_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { if (hostCatchStatusLabel.Content.ToString() == "לא פעיל") { FilteringSystem.PostDefenceStatus(); } }
public void SetWelcomeLabel() { int hour = DateTime.Now.Hour; string welcomeText = ""; if (hour >= 0 && hour <= 4) { welcomeText = "לילה טוב לך, "; } if (hour >= 5 && hour <= 11) { welcomeText = "בוקר טוב לך, "; } if (hour >= 12 && hour <= 15) { welcomeText = "צהריים טובים לך, "; } if (hour >= 16 && hour <= 19) { welcomeText = "אחר הצהריים טובים, "; } if (hour >= 20 && hour <= 23) { welcomeText = "לילה טוב לך, "; } welcomeLabel.Content = welcomeText + FilteringSystem.GetCurrentFilteringSettings().GetAdminName(); }
public static void FullExit() { FilteringSystem.StopDefenceCheck(); InternetBlocker.Block(false); CustomNotifyIcon.Hide(); ServiceAdapter.CustomCommend((int)ServiceAdapter.CustomCommends._pause); Environment.Exit(Environment.ExitCode); }
private void UpdateSafeServerStatus() { new Thread(() => { if ((DnsController.IsSafe(false) == false) && (FilteringSystem.GetCurrentFilteringSettings().isSafeServerOn) && (FilteringSystem.GetSystemStatus() == true)) { DnsController.SetMode(true); } UpdateGUIStatus("/images/statusPage/safeserver_on.png", "/images/statusPage/safeserver_off.png", DnsController.IsSafe(false), safeServerToggle); }).Start(); }
private void Application_Startup(object sender, StartupEventArgs e) { // if app data's folder doesn't exists - create it. if (!System.IO.Directory.Exists(GetAppDataFolder())) { System.IO.Directory.CreateDirectory(GetAppDataFolder()); } //start the program Application.Current.ShutdownMode = ShutdownMode.OnExplicitShutdown; if (NoOtherProcessOpen()) { FilteringSystem.LoadSavedFilteringSettings(); if (IsFirstOpening()) { if (HasAdministratorPrivilege()) { new SignUpWindowFiles.SignUpWindow().Show(); } else { if (StartAgainAsAdmin()) { //By opening a new administrator-privileged process, close the current process. Application.Current.Shutdown(); } else { CustomMessageBox.ShowDialog(null, "בהפעלה הראשונית יש לספק הרשאות מנהל מערכת, נסה להריץ את התוכנה שנית עם הרשאות אלו.", "שגיאה", CustomMessageBox.CustomMessageBoxTypes.Error, "הבנתי"); Application.Current.Shutdown(); } } } else { FilteringSystem.Load(); new MainWindow().Show(); } } else { if (Environment.GetCommandLineArgs().Length > 1) { if (Environment.GetCommandLineArgs()[0] != "runAgainAsAdmin") { Application.Current.Shutdown(); } } else { BringProcessToFront("F4E by MMB"); } } }
private void UpdateHostCatchingStatus() { FilteringSystem.PreventSystemFilesEdit(); Dispatcher.Invoke(new Action(() => { if (FilteringSystem.preventSystemFilesEditStatus == true) { hostCatchStatusLabel.Content = "פעיל"; hostCatchStatusLabel.Foreground = new SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 9, 163, 3)); } else { hostCatchStatusLabel.Content = "לא פעיל"; hostCatchStatusLabel.Foreground = new SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 252, 104, 78)); } })); }
private void HelpButton_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { ServiceAdapter.CustomCommend((int)ServiceAdapter.CustomCommends.startCatchFiles); FilteringSystem.RunInStartUp(); //Process.Start("http://f4e.mmb.org.il"); }
private static void Update_Click(object sender, EventArgs e) { FilteringSystem.UpdateAllSettings(); }
private void systemStatusToggle_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { FilteringSystem.SetSystemStatus(!FilteringSystem.GetSystemStatus()); }
private void sceduelToggle_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { FilteringSystem.SetBlockScheduelingStatus(!FilteringSystem.GetBlockSchedulingStatus()); }
private void UpdateSystemStatus() { new Thread(() => { UpdateGUIStatus("/images/statusPage/status_on.png", "/images/statusPage/status_off.png", FilteringSystem.GetSystemStatus(), systemStatusToggle); }).Start(); }
private void UpdateScheduelingSystemStatus() { new Thread(() => { UpdateGUIStatus("/images/statusPage/scheduel_on.png", "/images/statusPage/scheduel_off.png", FilteringSystem.GetBlockSchedulingStatus(), scheduelToggle); }).Start(); }
private bool IsFirstOpening() { // return false; return(FilteringSystem.GetCurrentFilteringSettings() == null); }