/// <summary>
        /// This command shows the basic functionality of how to remove the reference of a Reviewer Session from the current project.
        /// In this example the first Reviewer Session that is referenced in the current project will be removed.
        /// </summary>
        /// <returns></returns>
        internal static async Task RemoveSession_Basic()
        {
            try
            {
                //Step 1: Get Reviewer Results project item
                //A project can contain only one Reviewer Results project item
                IEnumerable <ProjectItem>  projectItems       = Project.Current.GetItems <ReviewerResultsProjectItem>();
                ReviewerResultsProjectItem resultsProjectItem = null;
                if (projectItems.Count() > 0)
                {
                    resultsProjectItem = projectItems.FirstOrDefault() as ReviewerResultsProjectItem;
                }
                else
                {
                    return;
                }

                if (null != resultsProjectItem)
                {
                    //Step 2: Get all session items that are currently referenced in the project.
                    IEnumerable <Item> sessionItems = await resultsProjectItem.GetItemsAsync();

                    if (null != sessionItems && sessionItems.Count() > 0)
                    {
                        //Step 3: Remove the first Session from Project
                        await resultsProjectItem.RemoveSessionItemAsync(sessionItems.FirstOrDefault());
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Error);
            }
        }
        /// <summary>
        /// This command shows how to mark a Reviewer Session as default.
        /// In this example you can right click a session in the Reviewer Session gallery and mark it as default
        /// </summary>
        /// <returns></returns>
        internal static async Task MarkDefaultSession_Advanced()
        {
            try
            {
                //Step 1: Get the Reviewer Session that is right clicked
                var galleryItem = Utilities.GetContext <GalleryItem>().FirstOrDefault();
                if (null == galleryItem)
                {
                    return;
                }

                //Step 2: Get Reviewer Results project item
                //A project can contain only one Reviewer Results project item
                IEnumerable <ProjectItem>  projectItems       = Project.Current.GetItems <ReviewerResultsProjectItem>();
                ReviewerResultsProjectItem resultsProjectItem = null;
                if (projectItems.Count() > 0)
                {
                    resultsProjectItem = projectItems.FirstOrDefault() as ReviewerResultsProjectItem;
                }
                else
                {
                    MessageBox.Show(string.Format("Current project does not have a connection to the Reviewer Results.{0}Please add a connection to the Reviewer Results and add Reviewer Sessions.", Environment.NewLine), "Warning", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Warning);
                    return;
                }

                if (null != resultsProjectItem)
                {
                    //Step 3: Get all session items that are currently referenced in the project.
                    IEnumerable <Item> sessionItems = await resultsProjectItem.GetItemsAsync();

                    if (null != sessionItems && sessionItems.Count() > 0)
                    {
                        //Step 4: Find the session item (in the project) that is right clicked in the gallery
                        Item markDefaultItem = sessionItems.Where(p => (p as Item).Path == galleryItem.Path).FirstOrDefault() as Item;
                        if (null != markDefaultItem)
                        {
                            //Step 5: Mark this session as Default
                            resultsProjectItem.DefaultSessionItem = markDefaultItem;

                            //Step 6: Update Default Session property
                            DefaultSession = resultsProjectItem.GetSessionFromItem(markDefaultItem);
                        }
                    }
                    else
                    {
                        MessageBox.Show(string.Format("There are no Reviewer Sessions referenced in the current project.{0}Please add at least one Reviewer Session to the current project.", Environment.NewLine), "Warning", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Warning);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Error);
            }
        }
        /// <summary>
        /// This command shows how to remove the reference of a Reviewer Session from the current project.
        /// In this example you can right click a session in the Reviewer Session gallery and remove it from the current project.
        /// </summary>
        /// <returns></returns>
        internal static async Task RemoveSessions_Advanced()
        {
            try
            {
                //Step 1: Get the session that is right clicked
                var galleryItem = Utilities.GetContext <GalleryItem>().FirstOrDefault();
                if (null == galleryItem)
                {
                    return;
                }
                else
                {
                    //Step 2: Remove the Session from Gallery
                    GalleryItemsChangedEvent.Publish(galleryItem, false);
                }

                //Step 3: Get Reviewer Results project item
                //A project can contain only one Reviewer Results project item
                IEnumerable <ProjectItem>  projectItems       = Project.Current.GetItems <ReviewerResultsProjectItem>();
                ReviewerResultsProjectItem resultsProjectItem = null;
                if (projectItems.Count() > 0)
                {
                    resultsProjectItem = projectItems.FirstOrDefault() as ReviewerResultsProjectItem;
                }

                if (null != resultsProjectItem)
                {
                    //Step 4: Get all session items that are currently referenced in the project
                    IEnumerable <Item> sessionItems = await resultsProjectItem.GetItemsAsync();

                    if (null != sessionItems)
                    {
                        //Step 5: Find the session item (in the project) that is right clicked in the gallery
                        Item itemToRemove = sessionItems.Where(p => (p as Item).Path == galleryItem.Path).FirstOrDefault() as Item;
                        if (null != itemToRemove)
                        {
                            //Step 6: Remove this Session from the current project
                            await resultsProjectItem.RemoveSessionItemAsync(itemToRemove);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Error);
            }
        }
        /// <summary>
        /// This command shows the basic functionality of how to mark a Reviewer Session as default.
        /// In this example the first Reviewer Session that is referenced in the current project will be be marked as default
        /// </summary>
        /// <returns></returns>
        internal static async Task MarkDefaultSession_Basic()
        {
            try
            {
                //Step 1: Get Reviewer Results project item
                //A project can contain only one Reviewer Results project item
                IEnumerable <ProjectItem>  projectItems       = Project.Current.GetItems <ReviewerResultsProjectItem>();
                ReviewerResultsProjectItem resultsProjectItem = null;
                if (projectItems.Count() > 0)
                {
                    resultsProjectItem = projectItems.FirstOrDefault() as ReviewerResultsProjectItem;
                }
                else
                {
                    MessageBox.Show(string.Format("Current project does not have a connection to the Reviewer Results.{0}Please add a connection to the Reviewer Results and add Reviewer Sessions.", Environment.NewLine), "Warning", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Warning);
                    return;
                }

                if (null != resultsProjectItem)
                {
                    //Step 2: Get all session items that are currently referenced in the project.
                    IEnumerable <Item> sessionItems = await resultsProjectItem.GetItemsAsync();

                    if (null != sessionItems && sessionItems.Count() > 0)
                    {
                        //Step 3: Mark first session as Default
                        resultsProjectItem.DefaultSessionItem = sessionItems.FirstOrDefault();
                    }
                    else
                    {
                        MessageBox.Show(string.Format("There are no Reviewer Sessions referenced in the current project.{0}Please add at least one Reviewer Session to the current project.", Environment.NewLine), "Warning", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Warning);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Error);
            }
        }