ScrumPowerTools.Services.TfsQueryShortcutStore.GetShortcut C# (CSharp) Method

GetShortcut() public method

public GetShortcut ( uint shortcutNr ) : QueryPath
shortcutNr uint
return QueryPath
        public QueryPath GetShortcut(uint shortcutNr)
        {
            if (shortcutNr < MaxShortcuts)
            {
                return shortcuts[shortcutNr];
            }

            return null;
        }
    }

Usage Example

        public void Open(uint shortcutNr)
        {
            shortcutNr = shortcutNr & 0x0f;

            var queryPath = store.GetShortcut(shortcutNr);

            if (queryPath != null)
            {
                try
                {
                    var workItemStore = visualStudioAdapter.GetCurrent().GetService <WorkItemStore>();

                    QueryDefinition queryDefinition = workItemStore.GetQueryDefinition(queryPath);

                    if (queryDefinition != null)
                    {
                        ShowQueryResults(queryDefinition);
                    }
                }
                catch (Exception)
                {
                }
            }
        }