Пример #1
0
        public MemoryList()
        {
            InitializeComponent();

            _highlightingContext = new HighlightingContext(listMemory);
            listMemory.KeyDown += new KeyEventHandler(listMemory_KeyDown);
            listMemory.MouseDown += new MouseEventHandler(listMemory_MouseDown);
            listMemory.MouseUp += new MouseEventHandler(listMemory_MouseUp);

            ColumnSettings.LoadSettings(Properties.Settings.Default.MemoryListViewColumns, listMemory);
            listMemory.ContextMenu = menuMemory;
            GenericViewMenu.AddMenuItems(copyMemoryMenuItem.MenuItems, listMemory, null);

            listMemory.ListViewItemSorter = new SortedListViewComparer(listMemory)
                {
                    SortColumn = 1,
                    SortOrder = SortOrder.Ascending
                };

            (listMemory.ListViewItemSorter as SortedListViewComparer).CustomSorters.Add(2,
                (x, y) =>
                {
                    MemoryItem ix = (MemoryItem)x.Tag;
                    MemoryItem iy = (MemoryItem)y.Tag;

                    return ix.Size.CompareTo(iy.Size);
                });
        }
Пример #2
0
        public HandleList()
        {
            InitializeComponent();

            _highlightingContext = new HighlightingContext(listHandles);
            listHandles.KeyDown += new KeyEventHandler(listHandles_KeyDown);
            listHandles.MouseDown += new MouseEventHandler(listHandles_MouseDown);
            listHandles.MouseUp += new MouseEventHandler(listHandles_MouseUp);
            listHandles.DoubleClick += new EventHandler(listHandles_DoubleClick);
            listHandles.SelectedIndexChanged += new System.EventHandler(listHandles_SelectedIndexChanged);

            var comparer = (SortedListViewComparer)
                (listHandles.ListViewItemSorter = new SortedListViewComparer(listHandles));

            comparer.ColumnSortOrder.Add(0);
            comparer.ColumnSortOrder.Add(2);
            comparer.ColumnSortOrder.Add(1);

            listHandles.ContextMenu = menuHandle;
            GenericViewMenu.AddMenuItems(copyHandleMenuItem.MenuItems, listHandles, null);
            ColumnSettings.LoadSettings(Properties.Settings.Default.HandleListViewColumns, listHandles);

            if (KProcessHacker.Instance == null)
            {
                protectedMenuItem.Visible = false;
                inheritMenuItem.Visible = false;
            }
        }
Пример #3
0
        public ThreadList()
        {
            InitializeComponent();

            // Use Cycles instead of Context Switches on Vista
            if (OSVersion.HasCycleTime)
                listThreads.Columns[1].Text = "Cycles Delta";

            // On x64, the first four arguments are passed in registers, 
            // which means Analyze won't work properly.
            if (IntPtr.Size != 4)
            {
                analyzeWaitMenuItem.Visible = false;
                analyzeMenuItem.Visible = false;
            }

            _highlightingContext = new HighlightingContext(listThreads);
            var comparer = (SortedListViewComparer)
                (listThreads.ListViewItemSorter = new SortedListViewComparer(listThreads));

            comparer.CustomSorters.Add(1,
                (x, y) =>
                {
                    if (OSVersion.HasCycleTime)
                    {
                        return (x.Tag as ThreadItem).CyclesDelta.CompareTo((y.Tag as ThreadItem).CyclesDelta);
                    }
                    else
                    {
                        return (x.Tag as ThreadItem).ContextSwitchesDelta.CompareTo((y.Tag as ThreadItem).ContextSwitchesDelta);
                    }
                });
            comparer.CustomSorters.Add(3,
                (x, y) =>
                    {
                        return (x.Tag as ThreadItem).PriorityI.CompareTo((y.Tag as ThreadItem).PriorityI);
                    });
            comparer.ColumnSortOrder.Add(0);
            comparer.ColumnSortOrder.Add(2);
            comparer.ColumnSortOrder.Add(3);
            comparer.ColumnSortOrder.Add(1);
            comparer.SortColumn = 1;
            comparer.SortOrder = SortOrder.Descending;

            listThreads.KeyDown += new KeyEventHandler(ThreadList_KeyDown);
            listThreads.MouseDown += new MouseEventHandler(listThreads_MouseDown);
            listThreads.MouseUp += new MouseEventHandler(listThreads_MouseUp);
            listThreads.SelectedIndexChanged += new System.EventHandler(listThreads_SelectedIndexChanged);

            ColumnSettings.LoadSettings(Properties.Settings.Default.ThreadListViewColumns, listThreads);
            listThreads.ContextMenu = menuThread;
            GenericViewMenu.AddMenuItems(copyThreadMenuItem.MenuItems, listThreads, null);
            listThreads_SelectedIndexChanged(null, null);

            _dontCalculate = false;
        }
Пример #4
0
        public ServiceList()
        {
            InitializeComponent();

            _highlightingContext = new HighlightingContext(listServices);
            listServices.KeyDown += this.ServiceList_KeyDown;
            listServices.MouseDown += this.listServices_MouseDown;
            listServices.MouseUp += this.listServices_MouseUp;
            listServices.DoubleClick += this.listServices_DoubleClick;
            listServices.SelectedIndexChanged += this.listServices_SelectedIndexChanged;
            listServices.ListViewItemSorter = new SortedListViewComparer(listServices);
        }
Пример #5
0
        public ServiceList()
        {
            InitializeComponent();

            _highlightingContext = new HighlightingContext(listServices);
            listServices.SetTheme("explorer");
            listServices.KeyDown += new KeyEventHandler(ServiceList_KeyDown);
            listServices.MouseDown += new MouseEventHandler(listServices_MouseDown);
            listServices.MouseUp += new MouseEventHandler(listServices_MouseUp);
            listServices.DoubleClick += new EventHandler(listServices_DoubleClick);
            listServices.SelectedIndexChanged += new System.EventHandler(listServices_SelectedIndexChanged);
            listServices.ListViewItemSorter = new SortedListViewComparer(listServices);
        }
Пример #6
0
        public NetworkList()
        {
            InitializeComponent();

            _highlightingContext = new HighlightingContext(listNetwork);
            listNetwork.SetTheme("explorer");
            listNetwork.ListViewItemSorter = new SortedListViewComparer(listNetwork);
            listNetwork.KeyDown += new KeyEventHandler(NetworkList_KeyDown);
            listNetwork.MouseDown += new MouseEventHandler(listNetwork_MouseDown);
            listNetwork.MouseMove += new MouseEventHandler(listNetwork_MouseMove);
            listNetwork.MouseUp += new MouseEventHandler(listNetwork_MouseUp);
            listNetwork.DoubleClick += new EventHandler(listNetwork_DoubleClick);
            listNetwork.SelectedIndexChanged += new System.EventHandler(listNetwork_SelectedIndexChanged);
        }
Пример #7
0
        public ModuleList()
        {
            InitializeComponent();

            _highlightingContext = new HighlightingContext(listModules);
            listModules.KeyDown += new KeyEventHandler(ModuleList_KeyDown);
            listModules.MouseDown += new MouseEventHandler(listModules_MouseDown);
            listModules.MouseUp += new MouseEventHandler(listModules_MouseUp);
            listModules.DoubleClick += new EventHandler(listModules_DoubleClick);

            ColumnSettings.LoadSettings(Properties.Settings.Default.ModuleListViewColumns, listModules);
            listModules.ContextMenu = menuModule;
            GenericViewMenu.AddMenuItems(copyModuleMenuItem.MenuItems, listModules, null);
        }
Пример #8
0
        public NetworkList()
        {
            InitializeComponent();

            _highlightingContext = new HighlightingContext(listNetwork);

            listNetwork.ListViewItemSorter = new SortedListViewComparer(listNetwork);
            listNetwork.KeyDown += this.NetworkList_KeyDown;
            listNetwork.MouseDown += this.listNetwork_MouseDown;
            listNetwork.MouseMove += this.listNetwork_MouseMove;
            listNetwork.MouseUp += this.listNetwork_MouseUp;
            listNetwork.DoubleClick += this.listNetwork_DoubleClick;
            listNetwork.SelectedIndexChanged += this.listNetwork_SelectedIndexChanged;
        }
Пример #9
0
        public ModuleList()
        {
            InitializeComponent();

            _highlightingContext = new HighlightingContext(listModules);
            listModules.KeyDown += this.ModuleList_KeyDown;
            listModules.MouseDown += this.listModules_MouseDown;
            listModules.MouseUp += this.listModules_MouseUp;
            listModules.DoubleClick += this.listModules_DoubleClick;

            ColumnSettings.LoadSettings(Settings.Instance.ModuleListViewColumns, listModules);
            listModules.ContextMenu = menuModule;
            GenericViewMenu.AddMenuItems(copyModuleMenuItem.MenuItems, listModules, null);
        }
Пример #10
0
        public ThreadList()
        {
            InitializeComponent();

            // Hide the I/O Priority menu item on XP and below.
            ioPriorityThreadMenuItem.Visible = OSVersion.HasIoPriority;

            // On x64, the first four arguments are passed in registers, 
            // which means Analyze won't work properly.
            if (OSVersion.Architecture != OSArch.I386)
            {
                analyzeWaitMenuItem.Visible = false;
                analyzeMenuItem.Visible = false;
            }

            _highlightingContext = new HighlightingContext(listThreads);
            var comparer = (SortedListViewComparer)
                (listThreads.ListViewItemSorter = new SortedListViewComparer(listThreads));

            comparer.CustomSorters.Add(1, (x, y) =>
            {
                if (OSVersion.HasCycleTime)
                {
                    return ((ThreadItem)x.Tag).CyclesDelta.CompareTo((y.Tag as ThreadItem).CyclesDelta);
                }

                return ((ThreadItem)x.Tag).ContextSwitchesDelta.CompareTo((y.Tag as ThreadItem).ContextSwitchesDelta);
            });
            comparer.CustomSorters.Add(3, (x, y) => ((ThreadItem)x.Tag).PriorityI.CompareTo((y.Tag as ThreadItem).PriorityI));
            comparer.ColumnSortOrder.Add(0);
            comparer.ColumnSortOrder.Add(2);
            comparer.ColumnSortOrder.Add(3);
            comparer.ColumnSortOrder.Add(1);
            comparer.SortColumn = 1;
            comparer.SortOrder = SortOrder.Descending;

            listThreads.KeyDown += this.ThreadList_KeyDown;
            listThreads.MouseDown += this.listThreads_MouseDown;
            listThreads.MouseUp += this.listThreads_MouseUp;
            listThreads.SelectedIndexChanged += this.listThreads_SelectedIndexChanged;

            ColumnSettings.LoadSettings(Settings.Instance.ThreadListViewColumns, listThreads);
            listThreads.ContextMenu = menuThread;
            GenericViewMenu.AddMenuItems(copyThreadMenuItem.MenuItems, listThreads, null);
            listThreads_SelectedIndexChanged(null, null);
        }
Пример #11
0
        public HighlightedListViewItem(HighlightingContext context, string text, bool highlight)
            : base(text)
        {
            _context = context;

            if (HighlightingContext.StateHighlighting && highlight)
            {
                this.BackColor = HighlightingContext.Colors[ListViewItemState.New];
                this.ForeColor = PhUtils.GetForeColor(this.BackColor);
                _state         = ListViewItemState.New;

                _context.EnqueuePost(delegate
                {
                    this.BackColor = _normalColor;
                    this.ForeColor = PhUtils.GetForeColor(this.BackColor);
                    _state         = ListViewItemState.Normal;
                });
            }
            else
            {
                this.BackColor = _normalColor;
            }
        }
        public HighlightedListViewItem(HighlightingContext context, string text, bool highlight)
            : base(text)
        {
            _context = context;

            if (HighlightingContext.StateHighlighting && highlight)
            {
                this.BackColor = HighlightingContext.Colors[ListViewItemState.New];
                this.ForeColor = PhUtils.GetForeColor(this.BackColor);
                _state = ListViewItemState.New;

                _context.Enqueue(delegate
                    {
                        this.BackColor = _normalColor;
                        this.ForeColor = PhUtils.GetForeColor(this.BackColor);
                        _state = ListViewItemState.Normal;
                    });
            }
            else
            {
                this.BackColor = _normalColor;
            }
        }
 public HighlightedListViewItem(HighlightingContext context, string text)
     : this(context, text, true)
 { }
 public HighlightedListViewItem(HighlightingContext context, bool highlight)
     : this(context, "", highlight)
 { }
Пример #15
0
 public HighlightedListViewItem(HighlightingContext context, string text)
     : this(context, text, true)
 {
 }
Пример #16
0
 public HighlightedListViewItem(HighlightingContext context, bool highlight)
     : this(context, "", highlight)
 {
 }