private void Target_Click(Microsoft.Office.Core.CommandBarButton control, ref bool cancelDefault) { var button = new CommandBarButton(control); var handler = _clickHandler; if (handler == null || IsWrappingNullReference) { button.Dispose(); return; } System.Diagnostics.Debug.Assert(handler.GetInvocationList().Length == 1, "Multicast delegate is registered more than once."); //note: event is fired for every parent the command exists under. not sure why. using (var parent = Parent) { _logger.Trace($"Executing handler for: {parent.GetType().Name} '{Target.Caption}' (tag: {Tag}, hashcode:{Target.GetHashCode()})"); } var args = new CommandBarButtonClickEventArgs(button); handler.Invoke(this, args); cancelDefault = args.Cancel; //button.Release(final:true); }
private void Target_Click(Microsoft.Office.Core.CommandBarButton ctrl, ref bool cancelDefault) { var handler = _clickHandler; if (handler == null || IsWrappingNullReference) { return; } System.Diagnostics.Debug.Assert(handler.GetInvocationList().Length == 1, "Multicast delegate is registered more than once."); //note: event is fired for every parent the command exists under. not sure why. System.Diagnostics.Debug.WriteLine("Executing handler for: {0} '{1}' (tag: {2}, hashcode:{3})", Parent.GetType().Name, Target.Caption, Tag, Target.GetHashCode()); var button = new CommandBarButton(ctrl); var args = new CommandBarButtonClickEventArgs(button); handler.Invoke(this, args); cancelDefault = args.Cancel; //button.Release(final:true); }
public void DefineOrderBy(Microsoft.Office.Core.CommandBarButton Ctrl, ref bool CancelDefault) { try { DataIntegrationManager bmMgr = new DataIntegrationManager(); Word.Bookmark foreachBm = bmMgr.GetForeachTag(Wkl.MainCtrl.CommonCtrl.CommonProfile.CurrentSelection); List <Word.Bookmark> dataTags = bmMgr.GetInsideBookmarks(foreachBm.Name, foreachBm.Name.Replace(ProntoMarkup.KeyStartForeach, ProntoMarkup.KeyEndForeach)); if (dataTags.Count > 0) { DefineOrderByControl defineOrderByCtrl = new DefineOrderByControl(foreachBm, dataTags); defineOrderByCtrl.ShowDialog(); if (!string.IsNullOrEmpty(defineOrderByCtrl.OrderByValue)) { bmMgr.UpdateBookmarkText(foreachBm, defineOrderByCtrl.OrderByValue); } } } catch { } }
public CommandBarButton(Microsoft.Office.Core.CommandBarButton target) : base(target) { }
void btn_Click(Microsoft.Office.Core.CommandBarButton Ctrl, ref bool CancelDefault) { dlg.ShowDialog(); }
public CommandBarButton(Microsoft.Office.Core.CommandBarButton target, bool rewrapping = false) : base(target, rewrapping) { }