public AutoCloseMessageBox(int seconds, string message) { Icon = Properties.Resources.icon_main_icon; Width = 400; Height = 120; StartPosition = FormStartPosition.CenterScreen; BackColor = Color.Azure; FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; _titleBar = new TitleBarControl(); _titleBar.WithLogo = false; Controls.Add(_titleBar); _seconds = seconds; _message = message; _messageLabel = new Label(); _messageLabel.Font = new System.Drawing.Font("微软雅黑", 14, GraphicsUnit.Point); _messageLabel.Text = _message; _messageLabel.TextAlign = ContentAlignment.MiddleCenter; _messageLabel.AutoSize = true; _messageLabel.Location = new System.Drawing.Point(Width / 2 - _messageLabel.Width / 2, _titleBar.Height + 10); Controls.Add(_messageLabel); _yesButton = new Button(); _yesButton.AutoSize = true; _yesButton.Font = new System.Drawing.Font("微软雅黑", 14, GraphicsUnit.Point); //_yesButton.Text = string.Format("确认({0})", _seconds); _yesButton.Text = string.Format("确认"); _yesButton.Location = new System.Drawing.Point(0, 100); Controls.Add(_yesButton); AcceptButton = _yesButton; Load += AutoCloseMessageBoxOnLoad; _yesButton.Click += _yesButtonOnClick; }
public MainPanelControl() { Location = new Point(0, 0); Size = new System.Drawing.Size(MainForm.MainFormWidth, MainForm.MainFormHeight); //Dock = DockStyle.Fill; titleBar = new TitleBarControl(); titleBar.Height = 252; mainFuncBtn = new Label(); mainFuncBtn.BackColor = Color.Transparent; mainFuncBtn.Image = Properties.Resources.home_fh_icon_animation_h; mainFuncBtn.Size = mainFuncBtn.Image.Size; mainFuncBtn.Location = new Point(24, 60); mainFuncBtn.MouseEnter += mainFuncBtnOnMouseEnter; mainFuncBtn.MouseLeave += mainFuncBtnOnMouseLeave; titleBar.Controls.Add(mainFuncBtn); ToolTip mainFuncTip = new ToolTip(); mainFuncTip.SetToolTip(mainFuncBtn, "设置防护功能和查看防护记录"); titleBar.ProtectionCenterItem.Click += ProtectionCenterItemOnClick; wechatBindingBtn = new TextButton(); wechatBindingBtn.BackColor = Color.Transparent; wechatBindingBtn.Text = "绑定微信"; wechatBindingBtn.Font = new System.Drawing.Font("微软雅黑", 14, GraphicsUnit.Pixel);; wechatBindingBtn.ForeColor = Color.FromArgb(0x4f, 0x4f, 0x00); wechatBindingBtn.HoverColor = Color.FromArgb(0xff, 0xa4, 0x05); wechatBindingBtn.Location = new Point(788, 214); titleBar.Controls.Add(wechatBindingBtn); wechatBindingBtn.Click += wechatBindingBtnOnClick; wechatHeadImage = new PictureBox(); wechatHeadImage.SizeMode = PictureBoxSizeMode.Zoom; wechatHeadImage.Size = new System.Drawing.Size(32, 32); wechatHeadImage.ImageLocation = Program.AppLocalDir + "UserHeadImage"; //wechatHeadImage.Location = new Point(wechatxLocation, // mainFuncBtn.Location.Y+mainFuncBtn.Height/2-wechatHeadImage.Height/2); wechatHeadImage.Location = new Point(788, 214); titleBar.Controls.Add(wechatHeadImage); ToolTip wechatHeadImageTip = new ToolTip(); wechatHeadImageTip.SetToolTip(wechatHeadImage, "绑定者微信头像"); wechatNickname = new Label(); wechatNickname.BackColor = Color.Transparent; wechatNickname.AutoSize = true; //wechatNickname.TextAlign = ContentAlignment.MiddleCenter; wechatNickname.Text = Properties.Settings.Default.userNickname; wechatNickname.Font = new System.Drawing.Font("微软雅黑", 10, GraphicsUnit.Pixel); wechatNickname.ForeColor = Color.White; wechatNickname.MaximumSize = new System.Drawing.Size(80, 0); wechatNickname.AutoEllipsis = true; titleBar.Controls.Add(wechatNickname); ToolTip wechatNicknameTip = new ToolTip(); wechatNicknameTip.SetToolTip(wechatNickname, "绑定者微信昵称"); guradNormalPanel = new Panel(); guradNormalPanel.BackColor = Color.Transparent; guradNormalPanel.AutoSize = true; guradNormalPanel.Location = new Point(mainFuncBtn.Location.X + mainFuncBtn.Width, 120); titleBar.Controls.Add(guradNormalPanel); guardDescLabel = new Label(); guardDescLabel.AutoSize = true; guardDescLabel.Text = Properties.Resources.ProductionName + "正在守护您的电脑"; guardDescLabel.Font = new System.Drawing.Font("微软雅黑", 22, GraphicsUnit.Pixel); guardDescLabel.ForeColor = Color.White; guradNormalPanel.Controls.Add(guardDescLabel); analysisItemsDescLabel = new Label(); analysisItemsDescLabel.AutoSize = true; analysisItemsDescLabel.Text = "已监控项目:"; analysisItemsDescLabel.Font = new System.Drawing.Font("微软雅黑", 14, GraphicsUnit.Pixel); analysisItemsDescLabel.ForeColor = Color.White; guradNormalPanel.Controls.Add(analysisItemsDescLabel); analysisItemsNumLabel = new Label(); analysisItemsNumLabel.AutoSize = true; analysisItemsNumLabel.Text = "0"; analysisItemsNumLabel.Font = new System.Drawing.Font("微软雅黑", 14, GraphicsUnit.Pixel); analysisItemsNumLabel.ForeColor = Color.White; guradNormalPanel.Controls.Add(analysisItemsNumLabel); analysisResultViewBtn = new TextButton(); analysisResultViewBtn.Text = "立即查看"; analysisResultViewBtn.Font = new System.Drawing.Font("微软雅黑", 14, GraphicsUnit.Pixel);; analysisResultViewBtn.ForeColor = Color.FromArgb(0x4f, 0x4f, 0x00); analysisResultViewBtn.HoverColor = Color.FromArgb(0xff, 0xa4, 0x05); guradNormalPanel.Controls.Add(analysisResultViewBtn); analysisResultViewBtn.Click += mainFuncBtnOnClick; analysisResultDescLabel = new Label(); analysisResultDescLabel.AutoSize = true; analysisResultDescLabel.Text = "新检测到不良项目!"; analysisResultDescLabel.Font = new System.Drawing.Font("微软雅黑", 14, GraphicsUnit.Pixel); analysisResultDescLabel.ForeColor = Color.FromArgb(0x4f, 0x4f, 0x00); analysisResultDescLabel.SizeChanged += analysisResultDescLabelOnSizeChanged; guradNormalPanel.Controls.Add(analysisResultDescLabel); //analysisItemsDescLabel.Visible = false; //analysisItemsNumLabel.Visible = false; analysisResultDescLabel.Visible = false; analysisResultViewBtn.Visible = false; scanningPanel = new Panel(); scanningPanel.BackColor = Color.Transparent; scanningPanel.AutoSize = true; scanningPanel.Location = new Point(mainFuncBtn.Location.X + mainFuncBtn.Width, 128); titleBar.Controls.Add(scanningPanel); scanningLabel = new Label(); scanningLabel.AutoSize = true; scanningLabel.Text = "正在进行本地扫描..."; scanningLabel.Font = new System.Drawing.Font("微软雅黑", 22, GraphicsUnit.Pixel); scanningLabel.ForeColor = Color.White; scanningLabel.Location = new Point(0, 0); scanningPanel.Controls.Add(scanningLabel); viewScanningBtn = new TextButton(); viewScanningBtn.Text = "查看详情"; viewScanningBtn.Font = new System.Drawing.Font("微软雅黑", 14, GraphicsUnit.Pixel);; viewScanningBtn.ForeColor = Color.FromArgb(0x4f, 0x4f, 0x00); viewScanningBtn.HoverColor = Color.FromArgb(0xff, 0xa4, 0x05); scanningPanel.Controls.Add(viewScanningBtn); viewScanningBtn.Click += viewScanningBtnOnClick; scanBtnsPanel = new Panel(); scanBtnsPanel.BackColor = Color.FromArgb(0xf8, 0xf8, 0xf8); scanBtnsPanel.Size = new System.Drawing.Size(MainForm.MainFormWidth, 318); scanBtnsPanel.Location = new Point(0, titleBar.Height); Controls.Add(scanBtnsPanel); allScanBtn = new ImageButton(); allScanBtn.Image = Properties.Resources.home_scanner_qp_n; allScanBtn.Size = allScanBtn.Image.Size; allScanBtn.NormalBack = Properties.Resources.home_scanner_qp_n; allScanBtn.HoverBack = Properties.Resources.home_scanner_qp_h; allScanBtn.PressBack = Properties.Resources.home_scanner_qp_n; allScanBtn.Location = new Point(130, scanBtnTopPadding); ToolTip allScanTip = new ToolTip(); allScanTip.AutoPopDelay = 32000; allScanTip.SetToolTip(allScanBtn, "扫描所有磁盘上的图片和视频"); fastScanBtn = new ImageButton(); fastScanBtn.Image = Properties.Resources.home_scanner_ks_n; fastScanBtn.Size = fastScanBtn.Image.Size; fastScanBtn.NormalBack = Properties.Resources.home_scanner_ks_n; fastScanBtn.HoverBack = Properties.Resources.home_scanner_ks_h; fastScanBtn.PressBack = Properties.Resources.home_scanner_ks_n; fastScanBtn.Location = new Point(allScanBtn.Location.X + allScanBtn.Width * 2, scanBtnTopPadding); ToolTip fastScanTip = new ToolTip(); fastScanTip.AutoPopDelay = 32000; fastScanTip.SetToolTip(fastScanBtn, "扫描上网记录中的图片"); customScanBtn = new ImageButton(); customScanBtn.Image = Properties.Resources.home_scanner_zdy_n; customScanBtn.Size = customScanBtn.Image.Size; customScanBtn.NormalBack = Properties.Resources.home_scanner_zdy_n; customScanBtn.HoverBack = Properties.Resources.home_scanner_zdy_h; customScanBtn.PressBack = Properties.Resources.home_scanner_zdy_n; customScanBtn.Location = new Point(fastScanBtn.Location.X + fastScanBtn.Width * 2, scanBtnTopPadding); ToolTip customScanTip = new ToolTip(); customScanTip.AutoPopDelay = 32000; customScanTip.SetToolTip(customScanBtn, "扫描指定文件夹内的图片和视频"); allScanLabel = new Label(); allScanLabel.AutoSize = true; allScanLabel.Text = "全盘扫描"; allScanLabel.Font = new System.Drawing.Font("微软雅黑", 16, GraphicsUnit.Pixel); fastScanLabel = new Label(); fastScanLabel.AutoSize = true; fastScanLabel.Text = "上网记录扫描"; fastScanLabel.Font = new System.Drawing.Font("微软雅黑", 16, GraphicsUnit.Pixel); customScanLabel = new Label(); customScanLabel.AutoSize = true; customScanLabel.Text = "自定义扫描"; customScanLabel.Font = new System.Drawing.Font("微软雅黑", 16, GraphicsUnit.Pixel); scanBtnsPanel.Controls.Add(allScanBtn); scanBtnsPanel.Controls.Add(fastScanBtn); scanBtnsPanel.Controls.Add(customScanBtn); scanBtnsPanel.Controls.Add(allScanLabel); scanBtnsPanel.Controls.Add(fastScanLabel); scanBtnsPanel.Controls.Add(customScanLabel); edgeAboveStatusPanel = new Label(); edgeAboveStatusPanel.BackColor = Color.FromArgb(0xee, 0xee, 0xee); edgeAboveStatusPanel.Size = new System.Drawing.Size(MainForm.MainFormWidth, 3); edgeAboveStatusPanel.Location = new Point(0, scanBtnsPanel.Location.Y + scanBtnsPanel.Height); edgeBelowStatusPanel = new Label(); edgeBelowStatusPanel.BackColor = Color.FromArgb(0xee, 0xee, 0xee); edgeBelowStatusPanel.Size = new System.Drawing.Size(MainForm.MainFormWidth, 3); edgeBelowStatusPanel.Location = new Point(0, MainForm.MainFormHeight - edgeBelowStatusPanel.Height); statusPanel = new Panel(); statusPanel.Location = new Point(0, edgeAboveStatusPanel.Location.Y + edgeAboveStatusPanel.Height); statusPanel.Size = new System.Drawing.Size(MainForm.MainFormWidth, edgeBelowStatusPanel.Location.Y - edgeAboveStatusPanel.Location.Y - edgeAboveStatusPanel.Height); statusPanel.BackColor = Color.White; checkUpdateBtn = new TextButton(); //checkUpdateBtn.BackColor = Color.Red; checkUpdateBtn.Text = "检查更新"; checkUpdateBtn.Font = new System.Drawing.Font("微软雅黑", 11, GraphicsUnit.Pixel); checkUpdateBtn.ForeColor = Color.FromArgb(0x4f, 0xb5, 0x2c); checkUpdateBtn.HoverColor = Color.FromArgb(0xff, 0xa4, 0x05); checkUpdateBtn.Click += checkUpdateBtnOnClick; statusPanel.Controls.Add(checkUpdateBtn); versionLabel = new Label(); versionLabel.AutoSize = true; FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo(Assembly.GetEntryAssembly().Location); Version curVersion = new Version(versionInfo.ProductVersion); versionLabel.Text = "程序版本 " + curVersion.ToString(); versionLabel.Font = new System.Drawing.Font("微软雅黑", 11, GraphicsUnit.Pixel); versionLabel.ForeColor = Color.FromArgb(0x5e, 0x5e, 0x5e); statusPanel.Controls.Add(versionLabel); qqGroupLabel = new TextButton(); //qqGroupLabel.AutoSize = true; qqGroupLabel.Text = "反馈QQ群:" + qqGroupNum; qqGroupLabel.Font = new System.Drawing.Font("微软雅黑", 11, GraphicsUnit.Pixel); qqGroupLabel.ForeColor = Color.FromArgb(0x5e, 0x5e, 0x5e); qqGroupLabel.HoverColor = Color.FromArgb(0xff, 0xa4, 0x05); //qqGroupLabel.Location = new Point(, statusPanel.Height / 2 - wechatStatusIcon.Height / 2); ToolTip qqGroupTip = new ToolTip(); qqGroupTip.AutoPopDelay = 32000; qqGroupTip.InitialDelay = 10; qqGroupTip.SetToolTip(qqGroupLabel, "复制QQ群号"); qqGroupLabel.Click += qqGroupLabelOnClick; statusPanel.Controls.Add(qqGroupLabel); wechatStatusIcon = new Label(); //wechatStatusIcon.Image = Properties.Resources.wechatauth; wechatStatusIcon.Image = Properties.Resources.wechatnotauth; wechatStatusIcon.Size = wechatStatusIcon.Image.Size; wechatStatusIcon.Location = new Point(statusPanel.Width - 12 - wechatStatusIcon.Width, statusPanel.Height / 2 - wechatStatusIcon.Height / 2); statusPanel.Controls.Add(wechatStatusIcon); wechatStatusLabel = new Label(); wechatStatusLabel.AutoSize = true; wechatStatusLabel.Text = "微信未授权"; wechatStatusLabel.Font = new System.Drawing.Font("微软雅黑", 11, GraphicsUnit.Pixel); wechatStatusLabel.ForeColor = Color.FromArgb(0x5e, 0x5e, 0x5e); statusPanel.Controls.Add(wechatStatusLabel); wechatStatusLabel.SizeChanged += wechatStatusLabelOnSizeChanged; Controls.Add(titleBar); Controls.Add(statusPanel); Load += MainPanelControlOnLoad; fastScanBtn.Click += fastScanBtnOnClick; allScanBtn.Click += allScanBtnOnClick; customScanBtn.Click += customScanBtnOnClick; mainFuncBtn.Click += mainFuncBtnOnClick; MainForm.Instance.TargetProcessedProgress.ProgressChanged += TargetProcessedProgressOnProgressChanged; //Paint += MainPanelOnPaint; //RefreshWechatInfo(); mainPanelRightClickMenu = new ContextMenuStrip(); openProtectionPanel = new ToolStripMenuItem("设置防护功能和查看防护记录"); openAllScan = new ToolStripMenuItem("扫描所有磁盘上的图片和视频"); openFastScan = new ToolStripMenuItem("扫描上网记录中的图片"); openCustomScan = new ToolStripMenuItem("扫描指定文件夹内的图片和视频"); openProtectionPanel.Click += mainFuncBtnOnClick; openAllScan.Click += allScanBtnOnClick; openFastScan.Click += fastScanBtnOnClick; openCustomScan.Click += customScanBtnOnClick; mainPanelRightClickMenu.Items.AddRange(new ToolStripItem[] { openProtectionPanel, openAllScan, openFastScan, openCustomScan }); this.ContextMenuStrip = mainPanelRightClickMenu; }
public ScanPanelControl() { //InitializeComponent(); //Dock = DockStyle.Fill; Location = new Point(0, 0); Size = new System.Drawing.Size(MainForm.MainFormWidth, MainForm.MainFormHeight); titleBar = new TitleBarControl(); Controls.Add(titleBar); _scanningStatusPanel = new Panel(); _scanningStatusPanel.BackgroundImage = Properties.Resources.top_gray_bg; _scanningStatusPanel.BackgroundImageLayout = ImageLayout.Tile; _scanningStatusPanel.Size = new System.Drawing.Size(MainForm.MainFormWidth, 106); _scanningStatusPanel.Location = new Point(0, titleBar.Height); Controls.Add(_scanningStatusPanel); _scanningLogo = new Label(); //_scanningLogo.Image = Properties.Resources.scanning; _scanningLogo.Image = Properties.Resources.scanning_work; _scanningLogo.Size = _scanningLogo.Image.Size; _scanningLogo.BackColor = Color.Transparent; _scanningLogo.Location = new Point(32, 20); _scanningStatusPanel.Controls.Add(_scanningLogo); _progressLabel = new Label(); _progressLabel.Text = "正在准备"; _progressLabel.ForeColor = Color.FromArgb(0x47, 0x47, 0x47); _progressLabel.BackColor = Color.Transparent; _progressLabel.Font = new System.Drawing.Font("微软雅黑", 12, GraphicsUnit.Pixel); _progressLabel.TextAlign = ContentAlignment.MiddleLeft; _progressLabel.AutoEllipsis = true; _progressLabel.Width = 750; //_progressLabel.MaximumSize = new System.Drawing.Size(750, 0); //_progressLabel.AutoSize = true; _progressLabel.SizeChanged += _progressLabelOnSizeChanged; _scanningStatusPanel.Controls.Add(_progressLabel); _progressBar = new ProgressBar(); _progressBar.Value = 90; _progressBar.Size = new System.Drawing.Size(600, 14); _progressBar.Location = new Point(20, 52); _scanningStatusPanel.Controls.Add(_progressBar); _pauseBtn = new ImageButton(); _pauseBtn.Text = "暂停"; _pauseBtn.Image = Properties.Resources.btn_primary_n; _pauseBtn.Size = _pauseBtn.Image.Size; _pauseBtn.NormalBack = Properties.Resources.btn_primary_n; _pauseBtn.HoverBack = Properties.Resources.btn_primary_h; _pauseBtn.PressBack = Properties.Resources.btn_primary_p; _pauseBtn.ForeColor = Color.WhiteSmoke; _pauseBtn.Font = new System.Drawing.Font("微软雅黑", 14, GraphicsUnit.Pixel); _pauseBtn.TextAlign = ContentAlignment.MiddleCenter; _pauseBtn.Location = new Point(_progressBar.Location.X + _progressBar.Width + 32, 52 + _progressBar.Height / 2 - _pauseBtn.Height / 2); _scanningStatusPanel.Controls.Add(_pauseBtn); _stopBtn = new ImageButton(); _stopBtn.Text = "停止"; _stopBtn.Image = Properties.Resources.btn_primary_n; _stopBtn.Size = _stopBtn.Image.Size; _stopBtn.NormalBack = Properties.Resources.btn_primary_n; _stopBtn.HoverBack = Properties.Resources.btn_primary_h; _stopBtn.PressBack = Properties.Resources.btn_primary_p; _stopBtn.ForeColor = Color.WhiteSmoke; _stopBtn.Font = new System.Drawing.Font("微软雅黑", 14, GraphicsUnit.Pixel); _stopBtn.TextAlign = ContentAlignment.MiddleCenter; _stopBtn.Location = new Point(_pauseBtn.Location.X + _pauseBtn.Width + 12, _pauseBtn.Location.Y); _scanningStatusPanel.Controls.Add(_stopBtn); _scanStatusSummary = new Label(); _scanStatusSummary.Text = "共扫描sdfsdfs"; _scanStatusSummary.AutoSize = true; _scanStatusSummary.Font = new System.Drawing.Font("微软雅黑", 12, GraphicsUnit.Pixel); _scanStatusSummary.BackColor = Color.Transparent; _scanStatusSummary.TextAlign = ContentAlignment.MiddleLeft; _scanStatusSummary.ForeColor = Color.FromArgb(0x47, 0x47, 0x47); _scanStatusSummary.Location = new Point(32, _progressBar.Location.Y + _progressBar.Height); _scanningStatusPanel.Controls.Add(_scanStatusSummary); _returnBackImage = new Panel(); _returnBackImage.BackColor = Color.Transparent; _returnBackImage.BackgroundImage = Properties.Resources.btn_return_n; _returnBackImage.Width = _returnBackImage.Height = 64; _returnBackImage.Location = new Point(MainForm.MainFormWidth - _returnBackImage.Width, 0); _scanningStatusPanel.Controls.Add(_returnBackImage); _returnBtn = new Label(); //_returnBtn.BackColor = Color.Red; _returnBtn.Width = _returnBtn.Height = 24; _returnBtn.Location = new Point(_returnBackImage.Width - 8 - _returnBtn.Width, 6); _returnBackImage.Controls.Add(_returnBtn); _returnBtn.MouseEnter += _returnBtnOnMouseEnter; _returnBtn.MouseLeave += _returnBtnOnMouseLeave; _returnBtn.MouseDown += _returnBtnOnMouseDown; _returnBtn.MouseUp += _returnBtnOnMouseUp; //scanning result panel _scanningResultPanel = new Panel(); _scanningResultPanel.BackgroundImage = Properties.Resources.top_gray_bg; _scanningResultPanel.BackgroundImageLayout = ImageLayout.Tile; _scanningResultPanel.Size = new System.Drawing.Size(MainForm.MainFormWidth, 106); _scanningResultPanel.Location = new Point(0, titleBar.Height); Controls.Add(_scanningResultPanel); _scanningResultLogo = new Label(); _scanningResultLogo.Image = Properties.Resources.warning; _scanningResultLogo.Image = Properties.Resources.Complete; _scanningResultLogo.Size = _scanningResultLogo.Image.Size; _scanningResultLogo.Location = new Point(32, 20); _scanningResultPanel.Controls.Add(_scanningResultLogo); _scanningResultTitleWarning = new Label(); _scanningResultTitleWarning.Text = "本次扫描发现0个待处理文件!"; _scanningResultTitleWarning.AutoSize = true; _scanningResultTitleWarning.BackColor = Color.Transparent; _scanningResultTitleWarning.TextAlign = ContentAlignment.MiddleLeft; _scanningResultTitleWarning.Font = new System.Drawing.Font("微软雅黑", 18, GraphicsUnit.Pixel); _scanningResultTitleWarning.ForeColor = Color.FromArgb(0xcf, 0x49, 0x2c); _scanningResultTitleWarning.Location = new Point(120, 30); _scanningResultPanel.Controls.Add(_scanningResultTitleWarning); _scanningResultTitleSucceed = new Label(); _scanningResultTitleSucceed.Text = "已成功处理扫描中发现的文件!"; _scanningResultTitleSucceed.AutoSize = true; _scanningResultTitleSucceed.BackColor = Color.Transparent; _scanningResultTitleSucceed.TextAlign = ContentAlignment.MiddleLeft; _scanningResultTitleSucceed.Font = new System.Drawing.Font("微软雅黑", 18, GraphicsUnit.Pixel); _scanningResultTitleSucceed.ForeColor = Color.FromArgb(0x4f, 0xb5, 0x2c); _scanningResultTitleSucceed.Location = new Point(120, 30); _scanningResultPanel.Controls.Add(_scanningResultTitleSucceed); _scanResultSummary = new Label(); _scanResultSummary.Text = ""; _scanResultSummary.AutoSize = true; _scanResultSummary.Font = new System.Drawing.Font("微软雅黑", 12, GraphicsUnit.Pixel); _scanResultSummary.BackColor = Color.Transparent; _scanResultSummary.TextAlign = ContentAlignment.MiddleLeft; _scanResultSummary.ForeColor = Color.FromArgb(0x84, 0x84, 0x84); _scanResultSummary.Location = new Point(120, _scanningResultTitleWarning.Location.Y + _scanningResultTitleWarning.Height); _scanningResultPanel.Controls.Add(_scanResultSummary); _handleBtn = new ImageButton(); _handleBtn.Text = "一键处理"; _handleBtn.Image = Properties.Resources.btn_primary_n; _handleBtn.Size = _handleBtn.Image.Size; _handleBtn.NormalBack = Properties.Resources.btn_primary_n; _handleBtn.HoverBack = Properties.Resources.btn_primary_h; _handleBtn.PressBack = Properties.Resources.btn_primary_p; _handleBtn.ForeColor = Color.WhiteSmoke; _handleBtn.Font = new System.Drawing.Font("微软雅黑", 14, GraphicsUnit.Pixel); _handleBtn.TextAlign = ContentAlignment.MiddleCenter; _handleBtn.Location = new Point(652, 42); _scanningResultPanel.Controls.Add(_handleBtn); _giveupBtn = new ImageButton(); _giveupBtn.Text = "暂不处理"; _giveupBtn.Image = Properties.Resources.btn_primary_n; _giveupBtn.Size = _giveupBtn.Image.Size; _giveupBtn.NormalBack = Properties.Resources.btn_primary_n; _giveupBtn.HoverBack = Properties.Resources.btn_primary_h; _giveupBtn.PressBack = Properties.Resources.btn_primary_p; _giveupBtn.ForeColor = Color.WhiteSmoke; _giveupBtn.Font = new System.Drawing.Font("微软雅黑", 14, GraphicsUnit.Pixel); _giveupBtn.TextAlign = ContentAlignment.MiddleCenter; _giveupBtn.Location = new Point(_handleBtn.Location.X + _handleBtn.Width + 12, 42); _scanningResultPanel.Controls.Add(_giveupBtn); _confirmBtn = new ImageButton(); _confirmBtn.Text = "确认"; _confirmBtn.Image = Properties.Resources.btn_primary_n; _confirmBtn.Size = _confirmBtn.Image.Size; _confirmBtn.NormalBack = Properties.Resources.btn_primary_n; _confirmBtn.HoverBack = Properties.Resources.btn_primary_h; _confirmBtn.PressBack = Properties.Resources.btn_primary_p; _confirmBtn.ForeColor = Color.WhiteSmoke; _confirmBtn.Font = new System.Drawing.Font("微软雅黑", 14, GraphicsUnit.Pixel); _confirmBtn.TextAlign = ContentAlignment.MiddleCenter; _confirmBtn.Location = new Point(710, 42); _scanningResultPanel.Controls.Add(_confirmBtn); _divider = new Label(); _divider.Size = new System.Drawing.Size(MainForm.MainFormWidth, 20); _divider.Location = new Point(0, _scanningStatusPanel.Location.Y + _scanningStatusPanel.Height); _divider.BackColor = Color.FromArgb(0xf8, 0xf8, 0xf8); Controls.Add(_divider); _pornItemResultView = new PornItemTableViewWithPreview(false); _pornItemResultView.Location = new Point(0, _divider.Location.Y + _divider.Height); _pornItemResultView.Height = MainForm.MainFormHeight - _pornItemResultView.Location.Y - 30; _pornItemResultView.Width = MainForm.MainFormWidth; Controls.Add(_pornItemResultView); _footerPanel = new Panel(); _footerPanel.Size = new System.Drawing.Size(MainForm.MainFormWidth, 30); _footerPanel.Location = new Point(0, _pornItemResultView.Location.Y + _pornItemResultView.Height); _footerPanel.BackColor = Color.FromArgb(0xf8, 0xf8, 0xf8); Controls.Add(_footerPanel); //_autoShutdownCheckBox = new CheckBox(); //_autoShutdownCheckBox.FlatStyle = FlatStyle.Flat; //_autoShutdownCheckBox.CheckAlign = ContentAlignment.MiddleCenter; //_autoShutdownCheckBox.Location = new Point(20, 12); //_footerPanel.Controls.Add(_autoShutdownCheckBox); //_autoShutdownDescLabel = new Label(); //_autoShutdownDescLabel.Text = "扫描完成自动处理并关机"; Load += ScanPanelControlOnLoad; _returnBtn.Click += _returnBtnOnClick; //_scanningStatusPanel.Visible = false; //_handleBtn.Visible = false; //_giveupBtn.Visible = false; _scanningResultPanel.Visible = false; _confirmBtn.Visible = false; _localScan = new LocalScan(); _localScan.ScanProgressChanged += _localScanOnScanProgressChanged; _localScan.ScanComplete += _localScanOnScanComplete; _pauseBtn.Click += _pauseBtnOnClick; _stopBtn.Click += _stopBtnOnClick; _giveupBtn.Click += _giveupBtnOnClick; _handleBtn.Click += _handleBtnOnClick; _confirmBtn.Click += _confirmBtnOnClick; Disposed += ScanPanelControlOnDisposed; _checkAll = new CheckBox(); _checkAll.AutoSize = true; //_checkAll.Size = new System.Drawing.Size(115, 22); _checkAll.Text = "选中全部扫描项"; _checkAll.BackColor = Color.FromArgb(0xf8, 0xf8, 0xf8); //_checkAll.UseVisualStyleBackColor = true; _footerPanel.Controls.Add(_checkAll); _checkAll.Location = new System.Drawing.Point(40, _footerPanel.Height / 2 - _checkAll.Height / 2); _checkAll.CheckedChanged += _checkAllOnChanged; //_checkAll.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged); _unCheckAll = new CheckBox(); _unCheckAll.AutoSize = true; //_checkAll.Size = new System.Drawing.Size(115, 22); _unCheckAll.Text = "不选中扫描项"; _unCheckAll.BackColor = Color.FromArgb(0xf8, 0xf8, 0xf8); //_checkAll.UseVisualStyleBackColor = true; _footerPanel.Controls.Add(_unCheckAll); _unCheckAll.Location = new System.Drawing.Point(_checkAll.Location.X + _checkAll.Width + 40, _footerPanel.Height / 2 - _unCheckAll.Height / 2); _unCheckAll.CheckedChanged += _unCheckAllOnChanged; _unCheckAll.Checked = true; }
public ProtectionPanelControl() { //InitializeComponent(); //Dock = DockStyle.Fill; Location = new Point(0, 0); Size = new System.Drawing.Size(MainForm.MainFormWidth, MainForm.MainFormHeight); _titleBar = new TitleBarControl(); //_titleBar.TitleText = "山妖卫士-安全防护中心"; _titleBar.Height = 44; Controls.Add(_titleBar); _settingPanel = new Panel(); Controls.Add(_settingPanel); //_settingPanel.BackColor = Color.Red; _settingPanel.BackgroundImage = Properties.Resources.top_green_bg; _settingPanel.BackgroundImageLayout = ImageLayout.Tile; _settingPanel.Height = 204; _settingPanel.Width = MainForm.MainFormWidth; _settingPanel.Location = new Point(0, _titleBar.Height); _logoLabel = new Label(); //_logoLabel.Image = Properties.Resources.fh_icon_animation_n; SetLogoImage(); _logoLabel.BackColor = Color.Transparent; _logoLabel.Height = 150; _logoLabel.Width = 174; _logoLabel.Location = new Point(54, 30); _settingPanel.Controls.Add(_logoLabel); int btnsX = 300; int heightDist = 30; _websiteBtn = new ImageSwitchButton(Properties.Settings.Default.IsPornWebsiteProtectionTurnOn, Properties.Resources.switch_on, Properties.Resources.switch_off); _websiteBtn.Location = new Point(btnsX, 36); _websiteDescLabel = new Label(); _websiteDescLabel.AutoSize = true; _websiteDescLabel.Text = "不良网站检测防护"; _websiteDescLabel.ForeColor = Color.FromArgb(0x5e, 0x5e, 0x5e); _websiteDescLabel.Font = new System.Drawing.Font("微软雅黑", 16, GraphicsUnit.Pixel); _websiteDescLabel.Location = new Point(btnsX + _websiteBtn.Width + 4, _websiteBtn.Location.Y + _websiteBtn.Height / 2 - _websiteDescLabel.Height / 2); _websiteDescLabel.BackColor = Color.Transparent; _settingPanel.Controls.Add(_websiteBtn); _settingPanel.Controls.Add(_websiteDescLabel); _websiteBtn.SwitchChanged += _websiteBtnOnSwitchChanged; ToolTip websiteTip = new ToolTip(); websiteTip.AutoPopDelay = 32000; websiteTip.SetToolTip(_websiteDescLabel, "自动检测色情网站并屏蔽"); _activeImageBtn = new ImageSwitchButton(Properties.Settings.Default.IsLocalActiveImageTurnOn, Properties.Resources.switch_on, Properties.Resources.switch_off); _activeImageBtn.Location = new Point(btnsX, _websiteBtn.Location.Y + _websiteBtn.Height + heightDist); _activeImageDescLabel = new Label(); _activeImageDescLabel.AutoSize = true; _activeImageDescLabel.Text = "本地活跃图片文件监控"; _activeImageDescLabel.ForeColor = Color.FromArgb(0x5e, 0x5e, 0x5e); _activeImageDescLabel.Font = new System.Drawing.Font("微软雅黑", 16, GraphicsUnit.Pixel); _activeImageDescLabel.BackColor = Color.Transparent; _activeImageDescLabel.Location = new Point(btnsX + _activeImageBtn.Width + 4, _activeImageBtn.Location.Y + _activeImageBtn.Height / 2 - _activeImageDescLabel.Height / 2); _settingPanel.Controls.Add(_activeImageBtn); _settingPanel.Controls.Add(_activeImageDescLabel); _activeImageBtn.SwitchChanged += _activeImageBtnOnSwitchChanged; if (Properties.Settings.Default.IsLocalActiveImageTurnOn) { MainForm.Instance._activeFileMonitor.EnableImageDetection(); } ToolTip activImageTip = new ToolTip(); activImageTip.AutoPopDelay = 32000; activImageTip.SetToolTip(_activeImageDescLabel, "监控本地活跃图片文件,记录本地色情图片文件的创建"); _activeVideoBtn = new ImageSwitchButton(Properties.Settings.Default.IsLocalActiveVideoTurnOn, Properties.Resources.switch_on, Properties.Resources.switch_off); _activeVideoBtn.Location = new Point(btnsX, _activeImageBtn.Location.Y + _activeImageBtn.Height + heightDist); _activeVideoDescLabel = new Label(); _activeVideoDescLabel.AutoSize = true; _activeVideoDescLabel.Text = "本地活跃视频文件监控"; _activeVideoDescLabel.ForeColor = Color.FromArgb(0x5e, 0x5e, 0x5e); _activeVideoDescLabel.Font = new System.Drawing.Font("微软雅黑", 16, GraphicsUnit.Pixel); _activeVideoDescLabel.BackColor = Color.Transparent; _activeVideoDescLabel.Location = new Point(btnsX + _activeVideoBtn.Width + 4, _activeVideoBtn.Location.Y + _activeVideoBtn.Height / 2 - _activeVideoDescLabel.Height / 2); _settingPanel.Controls.Add(_activeVideoBtn); _settingPanel.Controls.Add(_activeVideoDescLabel); _activeVideoBtn.SwitchChanged += _activeVideoBtnOnSwitchChanged; //_activeVideoBtn.Enabled = false; ToolTip activeVideoTip = new ToolTip(); activeVideoTip.AutoPopDelay = 32000; activeVideoTip.SetToolTip(_activeVideoDescLabel, "监控本地活跃视频文件,记录本地色情视频文件的创建"); if (Properties.Settings.Default.IsLocalActiveVideoTurnOn) { MainForm.Instance._activeFileMonitor.EnableVideoDetection(); } _networkImageBtn = new ImageSwitchButton(Properties.Settings.Default.IsNetworkImageTurnOn, Properties.Resources.switch_on, Properties.Resources.switch_off); _networkImageBtn.Location = new Point(btnsX, _activeVideoBtn.Location.Y + _activeVideoBtn.Height + heightDist); _networkImageDescLabel = new Label(); _networkImageDescLabel.AutoSize = true; _networkImageDescLabel.Text = "网页不良图片过滤"; _networkImageDescLabel.ForeColor = Color.FromArgb(0x5e, 0x5e, 0x5e); _networkImageDescLabel.Font = new System.Drawing.Font("微软雅黑", 16, GraphicsUnit.Pixel); _networkImageDescLabel.BackColor = Color.Transparent; _networkImageDescLabel.Location = new Point(btnsX + _networkImageBtn.Width + 4, _networkImageBtn.Location.Y + _networkImageBtn.Height / 2 - _networkImageDescLabel.Height / 2); _settingPanel.Controls.Add(_networkImageBtn); _settingPanel.Controls.Add(_networkImageDescLabel); _networkImageBtn.SwitchChanged += _networkImageBtnOnSwitchChanged; ToolTip networkImageTip = new ToolTip(); networkImageTip.AutoPopDelay = 32000; networkImageTip.SetToolTip(_networkImageDescLabel, "过滤网页中的色情图片,此项功能在开启或关闭后,如页面未刷新,请使用Ctrl+F5强制刷新"); _strongNetworkImageFilter = new CheckBox(); _strongNetworkImageFilter.Location = new Point(CheckBoxLocationX, _networkImageDescLabel.Location.Y); _strongNetworkImageFilter.BackColor = Color.Transparent; _strongNetworkImageFilter.Text = "强力过滤"; _strongNetworkImageFilter.ForeColor = Color.FromArgb(0x5e, 0x5e, 0x5e); _strongNetworkImageFilter.Font = new System.Drawing.Font("微软雅黑", 16, GraphicsUnit.Pixel); _strongNetworkImageFilter.BackColor = Color.Transparent; _strongNetworkImageFilter.Checked = Properties.Settings.Default.IsStrongNetworkImageFilter; if (!Properties.Settings.Default.IsNetworkImageTurnOn) { _strongNetworkImageFilter.Enabled = false; } _strongNetworkImageFilter.CheckedChanged += _strongNetworkImageFilterOnCheckedChanged; _settingPanel.Controls.Add(_strongNetworkImageFilter); ToolTip strongNetworkImageFilterTip = new ToolTip(); strongNetworkImageFilterTip.AutoPopDelay = 32000; strongNetworkImageFilterTip.SetToolTip(_strongNetworkImageFilter, "包含擦边球色情图片,此项功能在开启或关闭后,如页面未刷新,请使用Ctrl+F5强制刷新"); //自启动checkbox _autoStartCheckbox = new CheckBox(); _autoStartCheckbox.Location = new Point(CheckBoxLocationX, _websiteDescLabel.Location.Y); _autoStartCheckbox.BackColor = Color.Transparent; _autoStartCheckbox.Text = "开机启动"; _autoStartCheckbox.ForeColor = Color.FromArgb(0x5e, 0x5e, 0x5e); _autoStartCheckbox.Font = new System.Drawing.Font("微软雅黑", 16, GraphicsUnit.Pixel); _autoStartCheckbox.BackColor = Color.Transparent; _autoStartCheckbox.Checked = GetAutoStart(); _autoStartCheckbox.CheckedChanged += _autoStartCheckboxOnCheckedChanged; _settingPanel.Controls.Add(_autoStartCheckbox); ToolTip autoStartToolTip = new ToolTip(); autoStartToolTip.AutoPopDelay = 32000; autoStartToolTip.SetToolTip(_autoStartCheckbox, "不良网站或是网络图片过滤功能必须与开机启动设置匹配"); //ToolTip strongNetworkImageFilterTip = new ToolTip(); //strongNetworkImageFilterTip.SetToolTip(_strongNetworkImageFilter, "包含擦边球色情图片"); //增量快速扫描 //_fastLocalScanIncrementalCheckbox = new CheckBox(); //_fastLocalScanIncrementalCheckbox.Location = new Point(CheckBoxLocationX, _activeImageDescLabel.Location.Y); //_fastLocalScanIncrementalCheckbox.BackColor = Color.Transparent; //_fastLocalScanIncrementalCheckbox.Text = "增量上网记录扫描"; //_fastLocalScanIncrementalCheckbox.AutoSize = true; //_fastLocalScanIncrementalCheckbox.ForeColor = Color.FromArgb(0x5e, 0x5e, 0x5e); //_fastLocalScanIncrementalCheckbox.Font = new System.Drawing.Font("微软雅黑", 16, GraphicsUnit.Pixel); //_fastLocalScanIncrementalCheckbox.BackColor = Color.Transparent; //_fastLocalScanIncrementalCheckbox.Checked = Properties.Settings.Default.isFastLocalScanIncremental; //_fastLocalScanIncrementalCheckbox.CheckedChanged += _fastLocalScanIncrementalCheckboxOnCheckedChanged; //_settingPanel.Controls.Add(_fastLocalScanIncrementalCheckbox); //增量全盘扫描 //_allLocalScanIncrementalCheckbox = new CheckBox(); //_allLocalScanIncrementalCheckbox.Location = new Point(CheckBoxLocationX, _activeVideoDescLabel.Location.Y); //_allLocalScanIncrementalCheckbox.BackColor = Color.Transparent; //_allLocalScanIncrementalCheckbox.Text = "增量全盘扫描"; //_allLocalScanIncrementalCheckbox.AutoSize = true; //_allLocalScanIncrementalCheckbox.ForeColor = Color.FromArgb(0x5e, 0x5e, 0x5e); //_allLocalScanIncrementalCheckbox.Font = new System.Drawing.Font("微软雅黑", 16, GraphicsUnit.Pixel); //_allLocalScanIncrementalCheckbox.BackColor = Color.Transparent; //_allLocalScanIncrementalCheckbox.Checked = Properties.Settings.Default.isAllLocalScanIncremental; //_allLocalScanIncrementalCheckbox.CheckedChanged += _allLocalScanIncrementalCheckboxOnCheckedChanged; //_settingPanel.Controls.Add(_allLocalScanIncrementalCheckbox ); _returnBackImage = new Panel(); _returnBackImage.BackColor = Color.Transparent; _returnBackImage.BackgroundImage = Properties.Resources.btn_return_n; _returnBackImage.Width = _returnBackImage.Height = 64; _returnBackImage.Location = new Point(MainForm.MainFormWidth - _returnBackImage.Width, 0); _settingPanel.Controls.Add(_returnBackImage); _returnBtn = new Label(); //_returnBtn.BackColor = Color.Red; _returnBtn.Width = _returnBtn.Height = 24; _returnBtn.Location = new Point(_returnBackImage.Width - 8 - _returnBtn.Width, 6); _returnBackImage.Controls.Add(_returnBtn); _returnBtn.MouseEnter += _returnBtnOnMouseEnter; _returnBtn.MouseLeave += _returnBtnOnMouseLeave; _returnBtn.MouseDown += _returnBtnOnMouseDown; _returnBtn.MouseUp += _returnBtnOnMouseUp; _tabHeaderPanel = new Panel(); _tabHeaderPanel.BackColor = Color.FromArgb(0xf3, 0xf3, 0xf3); //_tabHeaderPanel.BackColor = Color.Green; _tabHeaderPanel.Height = 24; _tabHeaderPanel.Width = MainForm.MainFormWidth; _tabHeaderPanel.Location = new Point(0, _settingPanel.Location.Y + _settingPanel.Height); Controls.Add(_tabHeaderPanel); _pornItemTableView = new PornItemTableViewWithPreview(true); _pornItemTableView.Height = 264 + 30; _pornItemTableView.Width = MainForm.MainFormWidth; _pornItemTableView.Location = new Point(0, _tabHeaderPanel.Location.Y + _tabHeaderPanel.Height); Controls.Add(_pornItemTableView); _processPanel = new Panel(); _processPanel.Width = MainForm.MainFormWidth; _processPanel.Height = 34; _processPanel.BackColor = Color.FromArgb(0xf3, 0xf3, 0xf3); _processPanel.Location = new Point(0, _pornItemTableView.Location.Y + _pornItemTableView.Height); Controls.Add(_processPanel); _clearAllBtn = new ImageButton(); _clearAllBtn.Size = Properties.Resources.btn_Clear_n.Size; _clearAllBtn.Image = _clearAllBtn.NormalBack = Properties.Resources.btn_Clear_n; _clearAllBtn.HoverBack = Properties.Resources.btn_Clear_h; _clearAllBtn.PressBack = Properties.Resources.btn_Clear_p; _clearAllBtn.Location = new Point(32, _processPanel.Height / 2 - _clearAllBtn.Height / 2); _processPanel.Controls.Add(_clearAllBtn); _clearAllBtn.Click += _clearAllBtnOnClick; _returnBtn.Click += _returnBtnOnClick; Load += ProtectionPanelControlOnLoad; //只有有功能打开时才操作,否则会导致默认关闭时,总是操作,导致杀毒软件报警 if (Properties.Settings.Default.IsNetworkImageTurnOn || Properties.Settings.Default.IsPornWebsiteProtectionTurnOn) { TurnOnProxy(); } //SetSystemProxy(); }