コード例 #1
0
ファイル: NiCommandManager.cs プロジェクト: vector-man/netide
        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));
            }
        }
コード例 #2
0
ファイル: NiCommandManager.cs プロジェクト: vector-man/netide
        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));
            }
        }
コード例 #3
0
ファイル: NiCommandManager.cs プロジェクト: netide/netide
        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);
            }
        }
コード例 #4
0
ファイル: NiCommandManager.cs プロジェクト: netide/netide
        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);
            }
        }