Пример #1
0
 private void ExcludeListOnExcludedWindowRemoving(ExcludedWindow excludedWindow)
 {
     if (excludedWindow.CheckWindow(_skinWindow.Parent) && excludedWindow.HasSkin)
     {
         _skinWindow.Skin = Settings.Settings.Skin;
     }
 }
Пример #2
0
 private void IncludeListOnExcludedWindowRemoving(ExcludedWindow includedWindow)
 {
     if (includedWindow.CheckWindow(_skinWindow.Parent))
     {
         _skinWindow.Dispose();
     }
 }
Пример #3
0
 private IntPtr FindFirstWindowLike(ExcludedWindow Window)
 {
     IntPtr[] Windows = WindowsTaskManager.GetWindowHandles();
     foreach (IntPtr Handle in Windows)
     {
         if (WindowsTaskManager.GetWindowClass(Handle) == Window.ClassName &&
             System.IO.Path.GetFileName(WindowsTaskManager.GetExecutableName(Handle)).ToLower() == Window.ProcessName.ToLower())
         {
             return(Handle);
         }
     }
     return(IntPtr.Zero);
 }
Пример #4
0
 private void SettingsOnExclusionListAdded(ExcludedWindow excludedWindow)
 {
     if (excludedWindow.CheckWindow(_skinWindow.Parent))
     {
         if (excludedWindow.HasSkin)
         {
             _skinWindow.Skin = excludedWindow.Skin;
         }
         else
         {
             _skinWindow.Dispose();
         }
     }
 }
Пример #5
0
        private void SaveExcludedTasks()
        {
            // copy to array
            ExcludedWindow[] ExcludedTasks = new ExcludedWindow[this.TasksListPanel.Controls.Count];
            int i = 0;

            while (i < ExcludedTasks.Length)
            {
                TaskItemControl tic = (TaskItemControl)this.TasksListPanel.Controls[i];
                ExcludedTasks[i] = new ExcludedWindow(tic.ClassName, tic.ProcessName);
                i++;
            }

            // save
            WindowsTaskManager.SaveExcludedClassWindows(System.IO.Path.Combine(System.IO.Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath), @"profiles\" + System.Environment.UserName + @"\ExcludedTasks.xml"), ExcludedTasks);
        }
Пример #6
0
 private void SettingsOnInclusionListAdded(ExcludedWindow newIncludedWindow)
 {
     if (!newIncludedWindow.CheckWindow(_skinWindow.Parent))
     {
         // This means that this is the first addition of included window, all non included windows should be diposed
         if (Settings.Settings.IncludeList.Count == 1)
         {
             _skinWindow.Dispose();
         }
     }
     else
     {
         if (newIncludedWindow.HasSkin)
         {
             _skinWindow.Skin = newIncludedWindow.Skin;
         }
     }
 }
Пример #7
0
        /// <summary>
        /// Adds a window class name to the exclusion list
        /// </summary>
        public void IgnoreWindow()
        {
            // create the new excluded window
            ExcludedWindow me = new ExcludedWindow(WindowsTaskManager.GetWindowClass(Handle), System.IO.Path.GetFileName(WindowsTaskManager.GetExecutableName(Handle)));

            //System.Diagnostics.Debug.WriteLine("ignoring "+me.ClassName+" from "+me.ProcessName);

            // load the custom list
            ExcludedWindow[] CustomExcludeList = WindowsTaskManager.LoadExcludedClassWindows(Orbit.Configuration.ConfigurationInfo.LocationsConfig.GetExcludedTasksFilePath());

            if (CustomExcludeList == null)
            {
                ExcludedWindow[] NewExcludedList = new ExcludedWindow[1];
                NewExcludedList[0] = me;
                WindowsTaskManager.SaveExcludedClassWindows(Orbit.Configuration.ConfigurationInfo.LocationsConfig.GetExcludedTasksFilePath(), NewExcludedList);
                return;
            }

            // set our new list
            ExcludedWindow[] ExcludeList = new ExcludedWindow[CustomExcludeList.Length + 1];
            // set our mandatory excluded tasks

            // add our new class
            ExcludeList[0] = me;

            // copy our custom exclusion list
            int i = 0;

            while (i < CustomExcludeList.Length)
            {
                ExcludeList[i + 1] = CustomExcludeList[i];
                i++;
            }

            WindowsTaskManager.SaveExcludedClassWindows(Orbit.Configuration.ConfigurationInfo.LocationsConfig.GetExcludedTasksFilePath(), ExcludeList);
        }
Пример #8
0
        private static ExcludedWindow[] LoadExcludedClassWindows()
        {
            // create orbit's own excluded window
            ExcludedWindow me = new ExcludedWindow("WindowsForms10.Window.8.app2", "Orbit.exe");

            // load the list
            ExcludedWindow[] CustomExcludeList = WindowsTaskManager.LoadExcludedClassWindows(Orbit.Configuration.ConfigurationInfo.LocationsConfig.GetExcludedTasksFilePath());

            if (CustomExcludeList == null)
            {
                return new ExcludedWindow[] { me }
            }
            ;

            // set our new list
            ExcludedWindow[] ExcludeList = new ExcludedWindow[CustomExcludeList.Length + 1];
            // set our mandatory excluded tasks

            // excluding all orbit windows
            ExcludeList[0] = me;

            // copy our custom exclusion list
            int i = 0;

            while (i < CustomExcludeList.Length)
            {
                ExcludeList[i + 1] = CustomExcludeList[i];

                i++;
            }

            return(ExcludeList);
        }

        #endregion
    }