// ProductNameRibbonUICommand.cs
// Copyright (c) 2016 Bentley Systems, Incorporated. All Rights Reserved.

using Haestad.Support.Library;
using Haestad.Support.Support;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Threading;
using Telerik.Windows.Controls;
using Telerik.Windows.Controls.RibbonView;

namespace Haestad.Framework.UI.Integration
{
    /// <summary>
    /// A RibbonUICommand that supports setting the LabelKey after instantiation.
    /// Intended to be used sparingly, for product specific commands only, where the actual product name needs to be displayed.
    /// This as opposed to requiring every product to have it's own concrete command factory (although some products do).
    /// </summary>
    public class ProductNameRibbonUICommand : RibbonUICommand
    {
        #region Constructors
        /// <summary>
        /// Instantiates a new ProductNameRibbonUICommand.
        /// </summary>
        /// <param name="command">The associated ICommand.</param>
        /// <param name="name">The *unique* name of the ribbon UI command.</param>
        /// <param name="labelKey">The resource key used to look up the ribbon UI command label from TextManager.</param>
        /// <param name="toolTipTitleKey">The resource key used to look up the ribbon UI command label from TextManager.</param>
        /// <param name="toolTipDescriptionKey">The resource key used to look up the ribbon UI command label from TextManager.</param>
        /// <param name="graphicResourceKey">The graphic resource key for the regular (small) image size.</param>
        public ProductNameRibbonUICommand(ICommand command, string name, string labelKey, string toolTipTitleKey, string toolTipDescriptionKey,
            string graphicResourceKey)
            : this(command, name, labelKey, toolTipTitleKey, toolTipDescriptionKey, graphicResourceKey, String.Empty)
        {
        }

        /// <summary>
        /// Instantiates a new ProductNameRibbonUICommand.
        /// </summary>
        /// <param name="command">The associated ICommand.</param>
        /// <param name="name">The *unique* name of the ribbon UI command.</param>
        /// <param name="labelKey">The resource key used to look up the ribbon UI command label from TextManager.</param>
        /// <param name="toolTipTitleKey">The resource key used to look up the ribbon UI command label from TextManager.</param>
        /// <param name="toolTipDescriptionKey">The resource key used to look up the ribbon UI command label from TextManager.</param>
        /// <param name="graphicResourceKey">The graphic resource key for the regular (small) image size.</param>
        /// <param name="largeGraphicResourceKey">The graphic resource key for the large image size.</param>
        public ProductNameRibbonUICommand(ICommand command, string name, string labelKey, string toolTipTitleKey, string toolTipDescriptionKey,
            string graphicResourceKey, string largeGraphicResourceKey)
            : this(command, name, labelKey, toolTipTitleKey, toolTipDescriptionKey, graphicResourceKey, largeGraphicResourceKey, RibbonHotKey.None)
        {
        }

        /// <summary>
        /// Instantiates a new ProductNameRibbonUICommand.
        /// </summary>
        /// <param name="command">The associated ICommand.</param>
        /// <param name="name">The *unique* name of the ribbon UI command.</param>
        /// <param name="labelKey">The resource key used to look up the ribbon UI command label from TextManager.</param>
        /// <param name="toolTipTitleKey">The resource key used to look up the ribbon UI command label from TextManager.</param>
        /// <param name="toolTipDescriptionKey">The resource key used to look up the ribbon UI command label from TextManager.</param>
        /// <param name="graphicResourceKey">The graphic resource key for the regular (small) image size.</param>
        /// <param name="largeGraphicResourceKey">The graphic resource key for the large image size.</param>
        /// <param name="hotKey">The ribbon hot key to use for the command.</param>
        public ProductNameRibbonUICommand(ICommand command, string name, string labelKey, string toolTipTitleKey, string toolTipDescriptionKey,
            string graphicResourceKey, string largeGraphicResourceKey, RibbonHotKey hotKey) :
            base (command, name, labelKey, toolTipTitleKey, toolTipDescriptionKey, graphicResourceKey, largeGraphicResourceKey, hotKey)
        {
        }
        #endregion

        #region Public Methods
        public void SetLabelKey(string labelKey)
        {
            LabelKey = labelKey;
        }
        #endregion
    }
}
