This class, and its descendants implement specific handling for the specific type of clients.
        /// <summary>
        /// Assigns the <see cref="Current"/> <see cref="TortoiseHgClient"/> implementation based on the
        /// <see cref="GuiClientType"/> specified.
        /// </summary>
        /// <param name="clientType">
        /// The <see cref="GuiClientType"/> to assign the client for.
        /// </param>
        /// <exception cref="InvalidOperationException">Internal error, unknown client type passed to TortoiseHgClient.AssignCurrent</exception>
        internal static void AssignCurrent(GuiClientType clientType)
        {
            switch (clientType)
            {
                case GuiClientType.PyGTK:
                    Current = new TortoiseHgPyGTKClient();
                    break;

                case GuiClientType.PyQT:
                    Current = new TortoiseHgPyQTClient();
                    break;

                default:
                    throw new InvalidOperationException("Internal error, unknown client type passed to TortoiseHgClient.AssignCurrent");
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Assigns the <see cref="Current"/> <see cref="TortoiseHgClient"/> implementation based on the
        /// <see cref="GuiClientType"/> specified.
        /// </summary>
        /// <param name="clientType">
        /// The <see cref="GuiClientType"/> to assign the client for.
        /// </param>
        /// <exception cref="InvalidOperationException">Internal error, unknown client type passed to TortoiseHgClient.AssignCurrent</exception>
        internal static void AssignCurrent(GuiClientType clientType)
        {
            switch (clientType)
            {
            case GuiClientType.PyGTK:
                Current = new TortoiseHgPyGTKClient();
                break;

            case GuiClientType.PyQT:
                Current = new TortoiseHgPyQTClient();
                break;

            default:
                throw new InvalidOperationException("Internal error, unknown client type passed to TortoiseHgClient.AssignCurrent");
            }
        }