private void button2_Click(object sender, RibbonControlEventArgs e) { var currentShape = Globals.ThisAddIn.Application.ActiveWindow.Selection.PrimaryItem; if (currentShape == null) { return; } Window win = new Insert_latex_view(new Visio_Insert_latex_viewmodel(currentShape)); win.ShowDialog(); }
private void RightClickLatexImageEvent(Visio.Application app, int SequenceNum, string ContextString) { Regex rx = new Regex(@"/shape=(Sheet.[0-9]+)", RegexOptions.Compiled | RegexOptions.IgnoreCase); var rxMatch = rx.Match(ContextString); if (!rxMatch.Success) { return; } Visio.Shape currentShape = Globals.ThisAddIn.Application.ActivePage.Shapes.ItemU[rxMatch.Groups[1].ToString()]; Window win = new Insert_latex_view(new Visio_Insert_latex_viewmodel(currentShape)); win.ShowDialog(); }
private void button1_Click(object sender, RibbonControlEventArgs e) { Window win = new Insert_latex_view(new Visio_Insert_latex_viewmodel()); win.ShowDialog(); }