Exemple #1
0
        protected void OnCurrentInfoChanged()
        {
            nativePropertyGrid.SelectedObject = CurrentInfo;

            dumpButton.Enabled = CurrentInfo != null;
            if (CurrentInfo == null)
            {
                return;                      // nope
            }
            hwndBox.Text = CurrentInfo.ToShortString();

            // Inject ourself if possible
            if (HawkeyeApplication.CanInject(CurrentInfo))
            {
                HawkeyeApplication.Inject(CurrentInfo);
                return;
            }

            // Injection was not needed.

            CurrentInfo.DetectDotNetProperties();
            var controlInfo = CurrentInfo.ControlInfo;

            if (controlInfo != null)
            {
                if (!tabs.TabPages.Contains(dotNetTabPage))
                {
                    tabs.TabPages.Add(dotNetTabPage);
                }
                FillControlInfo(controlInfo);
                tabs.SelectedTab = dotNetTabPage;
            }
            else
            {
                if (tabs.TabPages.Contains(dotNetTabPage))
                {
                    tabs.TabPages.Remove(dotNetTabPage);
                }
                tabs.SelectedTab = nativeTabPage;
            }

            // Update the hwnd box in case we detected .NET properties.
            hwndBox.Text = CurrentInfo.ToShortString();

            if (CurrentInfoChanged != null)
            {
                CurrentInfoChanged(this, EventArgs.Empty);
            }
        }
Exemple #2
0
 protected override void OnClosed(EventArgs e)
 {
     base.OnClosed(e);
     HawkeyeApplication.Close();
 }