Example #1
0
 private void hostCatchStatusLabel_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     if (hostCatchStatusLabel.Content.ToString() == "לא פעיל")
     {
         FilteringSystem.PostDefenceStatus();
     }
 }
Example #2
0
        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();
        }
Example #3
0
 public static void FullExit()
 {
     FilteringSystem.StopDefenceCheck();
     InternetBlocker.Block(false);
     CustomNotifyIcon.Hide();
     ServiceAdapter.CustomCommend((int)ServiceAdapter.CustomCommends._pause);
     Environment.Exit(Environment.ExitCode);
 }
Example #4
0
 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();
 }
Example #5
0
        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");
                }
            }
        }
Example #6
0
 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));
         }
     }));
 }
Example #7
0
 private void HelpButton_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     ServiceAdapter.CustomCommend((int)ServiceAdapter.CustomCommends.startCatchFiles);
     FilteringSystem.RunInStartUp();
     //Process.Start("http://f4e.mmb.org.il");
 }
Example #8
0
 private static void Update_Click(object sender, EventArgs e)
 {
     FilteringSystem.UpdateAllSettings();
 }
Example #9
0
 private void systemStatusToggle_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     FilteringSystem.SetSystemStatus(!FilteringSystem.GetSystemStatus());
 }
Example #10
0
 private void sceduelToggle_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     FilteringSystem.SetBlockScheduelingStatus(!FilteringSystem.GetBlockSchedulingStatus());
 }
Example #11
0
 private void UpdateSystemStatus()
 {
     new Thread(() =>
     {
         UpdateGUIStatus("/images/statusPage/status_on.png", "/images/statusPage/status_off.png", FilteringSystem.GetSystemStatus(), systemStatusToggle);
     }).Start();
 }
Example #12
0
 private void UpdateScheduelingSystemStatus()
 {
     new Thread(() =>
     {
         UpdateGUIStatus("/images/statusPage/scheduel_on.png", "/images/statusPage/scheduel_off.png", FilteringSystem.GetBlockSchedulingStatus(), scheduelToggle);
     }).Start();
 }
Example #13
0
 private bool IsFirstOpening()
 {
     // return false;
     return(FilteringSystem.GetCurrentFilteringSettings() == null);
 }