Exemplo n.º 1
0
        public MainFrm()
        {
            InitializeComponent();
            Connection = new HConnection();

            UpdateUI  = new UpdateFrm(this);
            ConnectUI = new ConnectFrm(this);
            if (!IsDebugging)
            {
                Load  += MainFrm_Load;
                Shown += MainFrm_Shown;

                Connection.Connected    += Connected;
                Connection.Disconnected += Disconnected;
            }

            // Data Priority - #1 | Notify Extensions
            ExtensionMngr = new ExtensionManager(this);
            // Data Priority - #2 | Process Handshake
            HandshakeMngr = new HandshakeManager(this);
            // Data Priority - #3 | Display Data
            PacketLoggerUI = new PacketLoggerFrm(this);

            EncoderMngr   = new EncoderManager(this);
            InjectionMngr = new InjectionManager(this);
        }
Exemplo n.º 2
0
        protected override void Initialize()
        {
            //这里是插件被第一次执行的时候进行的操作,只会在第一次执行的时候执行一次
            base.Initialize();

            //绑定命令
            //new Setting(this).Bind();
            //new UpdateModelFromDB(this).Bind();
            //new AddModelProject(this).Bind();
            //new QuickRegion(this).Bind();
            //new CloneCurrentLine(this).Bind();
            //new About(this).Bind();
            //new Suggestion(this).Bind();
            //new Update(this).Bind();
            //new OpenInExplore(this).Bind();
            //new RestartVS(this).Bind();

            //自动绑定所有的命令,使用反射查找继承了MenuCommand的子类
            //为了提高效率,只在MenuCommand所在的程序集中查找子类
            foreach (var type in this.GetType().Assembly.GetTypes())
            {
                if (type.IsSubclassOf(typeof(MenuCommand)))
                {
                    MenuCommand command = Activator.CreateInstance(type, this) as MenuCommand;
                    if (command != null)
                    {
                        command.Bind();
                    }
                }
            }

            CheckOpenLessTab();
            CheckOpenAutoHeader();
            CheckOpenAutoBrace();
            //TextManagerEventSink.AddCommandFilter<CollapseXmlComment>();
            //TextManagerEventSink.RegisterViewEvent += new CollapseComment().TextManagerEventSink_RegisterViewEvent;
            VSBase.ApplicationObject.Events.DTEEvents.OnBeginShutdown += DTEEvents_OnBeginShutdown;

            hookVs.MouseEvent   += new HookVS.MouseEventHandle(TripleClick.MouseEvent);
            hookVs.KeyUpEvent   += new HookVS.KeyUpEventHandle(JumpInsert.KeyUpEvent);
            hookVs.KeyDownEvent += new HookVS.KeyUpEventHandle(JumpInsert.KeyDownEvent);

            ThreadPool.QueueUserWorkItem(delegate
            {
                if (UpdateFrm.IsNeedUpdate())
                {
                    MessageBox.Show("detected a new version for easyvs, please use menu easyvs->help->update for update");
                }
            });
        }
Exemplo n.º 3
0
        protected override void OnExecute(Microsoft.VisualStudio.Shell.OleMenuCommand command)
        {
            UpdateFrm about = new UpdateFrm();

            about.ShowDialog();
        }