资源简介

类似spy++,专门针对.net程序的专版。 微软的那个ManagedSpy太旧了,只能在fm2.0下面玩,编译也不过运行也不过。 这个是朋友给我的,能编译并运行。 我vs2013,win7x64.相信其他的vs版本也能运行。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Collections;

namespace ManagedSpy {
    /// 
    /// This dialog allows the user to filter events.
    /// Note that this could be improved to actually show _all_ events.
    /// To do this you would have to look at TypeDescriptor.GetEvents of
    /// the ComponentType property of the ControlProxy.
    /// 

    public partial class EventFilterDialog : Form {
        EventFilterList eventlist = new EventFilterList();

        internal EventFilterList EventList {
            get { return eventlist; }
            set { eventlist = value; }
        }

        public EventFilterDialog() {
            InitializeComponent();
            this.dataGridView1.DataSource = EventList;
            this.dataGridView1.Columns[0].Width = 47;
            this.dataGridView1.Columns[1].Width = 170;
        }

        private void buttonOK_Click(object sender EventArgs e) {
            this.Close();
        }

        private void dataGridView1_KeyPress(object sender KeyPressEventArgs e) {
            if (e.KeyChar == (char)Keys.Space) {
                ToggleSelectedCells();
            }
        }
        private void ToggleSelectedCells() {
            if (dataGridView1.SelectedCells.Count > 0) {
                bool newValue = !EventList[dataGridView1.SelectedCells[0].RowIndex].Display;
                foreach (DataGridViewCell cell in dataGridView1.SelectedCells) {
                    if (cell.ColumnIndex == 0) {
                        cell.Value = newValue;
                    }
                }
            }
        }

        private void dataGridView1_CellDoubleClick(object sender DataGridViewCellEventArgs e) {
            ToggleSelectedCells();
        }
    }

    class EventFilterList : List {
        public EventFilterList() {
            EventDescriptorCollection edColl = TypeDescriptor.GetEvents(typeof(Control));
            edColl = edColl.Sort();
            Add(new EventFilterLine(“Custom Events“ true));
            for (int i =0; i < edColl.Count;i++) {
                Add(new EventFilterLine(edColl[i].Name true));
            }
        }

        public EventFilterLine this[string eventName] {
            get {
                foreach (EventFilterLine line in this) {
                    if (line.EventName == eventName) {
                        return line;
                    }
                }
                return this[0]; //custom
            }
        }
    }

    class EventFilterLine {
        string eventName;
        bool isChecked;

        public EventFilterLine(string eventName bool isChecked)  {
            this.eventName = eventName;
            this.isChecked = isChecked;
        }

        public string EventName {
        

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-01-04 09:29  ManagedSpy-master\
     文件          80  2015-01-04 09:29  ManagedSpy-master\.editorconfig
     文件         154  2015-01-04 09:29  ManagedSpy-master\.gitignore
     文件       46080  2015-01-04 09:29  ManagedSpy-master\EULA.doc
     文件        1713  2015-01-04 09:29  ManagedSpy-master\ManagedSpy.sln
     目录           0  2015-01-04 09:29  ManagedSpy-master\ManagedSpy\
     文件         824  2015-01-04 09:29  ManagedSpy-master\ManagedSpy\Delete.bmp
     文件        5152  2015-01-04 09:29  ManagedSpy-master\ManagedSpy\EventFilterDialog.Designer.cs
     文件        3263  2015-01-04 09:29  ManagedSpy-master\ManagedSpy\EventFilterDialog.cs
     文件        5814  2015-01-04 09:29  ManagedSpy-master\ManagedSpy\EventFilterDialog.resx
     文件         824  2015-01-04 09:29  ManagedSpy-master\ManagedSpy\Filter2.bmp
     文件        5083  2015-01-04 09:29  ManagedSpy-master\ManagedSpy\HelpAbout.Designer.cs
     文件         328  2015-01-04 09:29  ManagedSpy-master\ManagedSpy\HelpAbout.cs
     文件       51004  2015-01-04 09:29  ManagedSpy-master\ManagedSpy\HelpAbout.resx
     文件       21465  2015-01-04 09:29  ManagedSpy-master\ManagedSpy\MainForm.Designer.cs
     文件        7804  2015-01-04 09:29  ManagedSpy-master\ManagedSpy\MainForm.cs
     文件       55098  2015-01-04 09:29  ManagedSpy-master\ManagedSpy\MainForm.resx
     文件        7945  2015-01-04 09:29  ManagedSpy-master\ManagedSpy\ManagedSpy.csproj
     文件        1777  2015-01-04 09:29  ManagedSpy-master\ManagedSpy\NativeMethods.cs
     文件         824  2015-01-04 09:29  ManagedSpy-master\ManagedSpy\Play.bmp
     文件         467  2015-01-04 09:29  ManagedSpy-master\ManagedSpy\Program.cs
     目录           0  2015-01-04 09:29  ManagedSpy-master\ManagedSpy\Properties\
     文件        1286  2015-01-04 09:29  ManagedSpy-master\ManagedSpy\Properties\AssemblyInfo.cs
     文件        3962  2015-01-04 09:29  ManagedSpy-master\ManagedSpy\Properties\Resources.Designer.cs
     文件        6645  2015-01-04 09:29  ManagedSpy-master\ManagedSpy\Properties\Resources.resx
     文件        1093  2015-01-04 09:29  ManagedSpy-master\ManagedSpy\Properties\Settings.Designer.cs
     文件         249  2015-01-04 09:29  ManagedSpy-master\ManagedSpy\Properties\Settings.settings
     文件         824  2015-01-04 09:29  ManagedSpy-master\ManagedSpy\Refresh.bmp
     文件         824  2015-01-04 09:29  ManagedSpy-master\ManagedSpy\Stop.bmp
     文件         146  2015-01-04 09:29  ManagedSpy-master\ManagedSpy\app.config
     文件       29926  2015-01-04 09:29  ManagedSpy-master\ManagedSpy\search.ico
............此处省略25个文件信息

评论

共有 条评论