Skip to content

Instantly share code, notes, and snippets.

@chuongmep
Created June 9, 2022 10:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuongmep/ecc5a3c1dc11d68b6b02591a8b788359 to your computer and use it in GitHub Desktop.
Save chuongmep/ecc5a3c1dc11d68b6b02591a8b788359 to your computer and use it in GitHub Desktop.
public override void Action()
{
Application.ActiveDocument.CurrentSelection.Changed += CurrentSelection_Changed;
}
public void CurrentSelection_Changed(object sender, EventArgs e)
{
var selection = Application.ActiveDocument.CurrentSelection;
MessageBox.Show(selection.SelectedItems.First.ClassDisplayName.ToString());
Application.ActiveDocument.CurrentSelection.Changed -= CurrentSelection_Changed;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment