コード例 #1
0
 public BlockOrIgnoreDialog(ApplicationHandler handler)
 {
     InitializeComponent();
     Handler = handler;
     AppName.Content = handler.Handled.ProcessName;
     Blocked = false;
 }
コード例 #2
0
ファイル: ProcessManager.cs プロジェクト: cbacon91/Blacklist
        public void Update()
        {
            if (!_blockingEnabled && TotalFreeTime == 60)
            {
                TotalFreeTime -= 1;
                FreeTimeOver(this, new EventArgs());
            }
            else if (!_blockingEnabled)
            {
                TotalFreeTime -= 1;
            }
            else if (TotalFreeTime <= 0)
            {
                _blockingEnabled = true;
                TotalFreeTime = 0;
            }
            var processes = GetProcesses();
            foreach (var process in processes)
            {
                var handler = GetHandler(process);
                if (handler == null)
                {
                    var ignored = IgnoredApps.Contains(process.ProcessName);
                    var blocked = BlockedApps.Contains(process.ProcessName + ".exe");
                    handler = new ApplicationHandler(process, ignored, blocked);
                    handler.LaunchPrompt += BlockAppPrompt;
                    Handlers.Add(handler);
                }
                handler.Update();

            }
        }
コード例 #3
0
ファイル: ProcessManager.cs プロジェクト: cbacon91/Blacklist
 public void LoadHandlersIntoManager()
 {
     var load = PersistenceManager.LoadHandlers();
     var handlerList = new List<ApplicationHandler>();
     foreach (var model in load)
     {
         var handler = new ApplicationHandler(model);
         handler.LaunchPrompt += BlockAppPrompt;
         handlerList.Add(handler);
         Handlers.Add(handler);
     }
 }