Exemplo n.º 1
0
 public ProcessKillerButton(ProcessButton processButton, Color highlightColor, Color unhighlightColor, Color disableColor, string defaultText, string highlightedText, string killingMessage)
 {
     SetStyle(ControlStyles.Selectable, false);
     ProcessButton     = processButton;
     _highlightColor   = highlightColor;
     _unhighlightColor = unhighlightColor;
     _disableColor     = disableColor;
     _defaultText      = defaultText;
     _highlightedText  = highlightedText;
     _killingMessage   = killingMessage;
 }
Exemplo n.º 2
0
        private Button GetProcessKillerButton(ProcessButton processButton)
        {
            var button = new ProcessKillerButton(processButton, _processKillerHighlightedBackColor, _processKillerBackColor, _buttonDisabledBackColor,
                                                 Resources.MainForm_InitializeButtons_ClickToKillProcessMessage,
                                                 Resources.MainForm_InitializeButtons_ClickToKillProcessHighlightedMessage,
                                                 Resources.MainForm_button_click_KillingProcessMessage
                                                 )
            {
                Width     = DefaultClientRectangleWidth - (_buttonsContainer.Padding.Left + _buttonsContainer.Margin.Left + _container.Padding.Left + _container.Margin.Left) * 2,
                Height    = DefaultProcessKillerButtonHeight,
                Font      = new Font(_defaultFontFamily, 11, FontStyle.Regular),
                Margin    = new Padding(3, 0, 3, 5),
                Text      = Resources.MainForm_InitializeButtons_ClickToKillProcessMessage,
                FlatStyle = FlatStyle.Flat,
            };

            button.FlatAppearance.BorderSize = 0;
            button.Click += process_killer_button_click;

            return(button);
        }
Exemplo n.º 3
0
        private ProcessButton GetProcessButton(Process process)
        {
            var button = new ProcessButton(_processButtonHighlightedBackColor, _processButtonBackColor, _buttonDisabledBackColor,
                                           Resources.MainForm_button_click_KillingProcessMessage,
                                           Resources.MainForm_GetProcessButton_ProcessButtonTitle + " (PID:" + process.Id + ")",
                                           Resources.MainForm_GetProcessButton_ProcessButtonHighlightedTitle + " (PID:" + process.Id + ")")
            {
                Width     = DefaultClientRectangleWidth - (_buttonsContainer.Padding.Left + _buttonsContainer.Margin.Left + _container.Padding.Left + _container.Margin.Left) * 2,
                Height    = DefaultProcessButtonHeight,
                Font      = new Font(_defaultFontFamily, 12, FontStyle.Regular),
                Text      = Resources.MainForm_GetProcessButton_ProcessButtonTitle + " (PID:" + process.Id + ")",
                Process   = process,
                Margin    = _disableProcessKiller ? new Padding(3, 3, 3, 3) : new Padding(3, 5, 3, 1),
                FlatStyle = FlatStyle.Flat,
            };

            button.FlatAppearance.BorderSize = 0;
            button.Click += process_button_click;

            return(button);
        }