public HResult RegisterPriorityCommandTarget(INiCommandTarget commandTarget, out int cookie) { cookie = 0; try { if (commandTarget == null) { throw new ArgumentNullException("commandTarget"); } cookie = _nextPriorityCommandTargetCookie++; _priorityCommandTargets.Add(cookie, commandTarget); _priorityCommandTargetsOrdered.Add(commandTarget); // The available command targets have changed; force a requery. ErrorUtil.ThrowOnFailure(((INiShell)GetService(typeof(INiShell))).InvalidateRequerySuggested()); return(HResult.OK); } catch (Exception ex) { return(ErrorUtil.GetHResult(ex)); } }
public HResult RegisterCommandTarget(INiCommandTarget commandTarget, out int cookie) { cookie = 0; try { if (commandTarget == null) { throw new ArgumentNullException("commandTarget"); } cookie = _nextCommandTargetCookie++; _commandTargets.Add(cookie, commandTarget); return(HResult.OK); } catch (Exception ex) { return(ErrorUtil.GetHResult(ex)); } }
public HResult RegisterPriorityCommandTarget(INiCommandTarget commandTarget, out int cookie) { cookie = 0; try { if (commandTarget == null) throw new ArgumentNullException("commandTarget"); cookie = _nextPriorityCommandTargetCookie++; _priorityCommandTargets.Add(cookie, commandTarget); _priorityCommandTargetsOrdered.Add(commandTarget); // The available command targets have changed; force a requery. ErrorUtil.ThrowOnFailure(((INiShell)GetService(typeof(INiShell))).InvalidateRequerySuggested()); return HResult.OK; } catch (Exception ex) { return ErrorUtil.GetHResult(ex); } }
public HResult RegisterCommandTarget(INiCommandTarget commandTarget, out int cookie) { cookie = 0; try { if (commandTarget == null) throw new ArgumentNullException("commandTarget"); cookie = _nextCommandTargetCookie++; _commandTargets.Add(cookie, commandTarget); return HResult.OK; } catch (Exception ex) { return ErrorUtil.GetHResult(ex); } }