//------------------------------------------------------------
// Game Framework
// Copyright © 2013-2021 loyalsoft. All rights reserved.
// Homepage: http://www.game7000.com/
// Feedback: http://www.game7000.com/
//------------------------------------------------------------
namespace GameFramework
{
public static partial class Utility
{
///
/// 字符相关的实用函数。
///
public static partial class Text
{
private static ITextHelper s_TextHelper = null;
///
/// 设置字符辅助器。
///
/// 要设置的字符辅助器。
public static void SetTextHelper(ITextHelper textHelper)
{
s_TextHelper = textHelper;
}
///
/// 获取格式化字符串。
///
/// 字符串参数的类型。
/// 字符串格式。
/// 字符串参数。
/// 格式化后的字符串。
public static string Format(string format, T arg)
{
if (format == null)
{
throw new GameFrameworkException("Format is invalid.");
}
if (s_TextHelper == null)
{
return string.Format(format, arg);
}
return s_TextHelper.Format(format, arg);
}
///
/// 获取格式化字符串。
///
/// 字符串参数 1 的类型。
/// 字符串参数 2 的类型。
/// 字符串格式。
/// 字符串参数 1。
/// 字符串参数 2。
/// 格式化后的字符串。
public static string Format(string format, T1 arg1, T2 arg2)
{
if (format == null)
{
throw new GameFrameworkException("Format is invalid.");
}
if (s_TextHelper == null)
{
return string.Format(format, arg1, arg2);
}
return s_TextHelper.Format(format, arg1, arg2);
}
///
/// 获取格式化字符串。
///
/// 字符串参数 1 的类型。
/// 字符串参数 2 的类型。
/// 字符串参数 3 的类型。
/// 字符串格式。
/// 字符串参数 1。
/// 字符串参数 2。
/// 字符串参数 3。
/// 格式化后的字符串。
public static string Format(string format, T1 arg1, T2 arg2, T3 arg3)
{
if (format == null)
{
throw new GameFrameworkException("Format is invalid.");
}
if (s_TextHelper == null)
{
return string.Format(format, arg1, arg2, arg3);
}
return s_TextHelper.Format(format, arg1, arg2, arg3);
}
///
/// 获取格式化字符串。
///
/// 字符串参数 1 的类型。
/// 字符串参数 2 的类型。
/// 字符串参数 3 的类型。
/// 字符串参数 4 的类型。
/// 字符串格式。
/// 字符串参数 1。
/// 字符串参数 2。
/// 字符串参数 3。
/// 字符串参数 4。
/// 格式化后的字符串。
public static string Format(string format, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
{
if (format == null)
{
throw new GameFrameworkException("Format is invalid.");
}
if (s_TextHelper == null)
{
return string.Format(format, arg1, arg2, arg3, arg4);
}
return s_TextHelper.Format(format, arg1, arg2, arg3, arg4);
}
///
/// 获取格式化字符串。
///
/// 字符串参数 1 的类型。
/// 字符串参数 2 的类型。
/// 字符串参数 3 的类型。
/// 字符串参数 4 的类型。
/// 字符串参数 5 的类型。
/// 字符串格式。
/// 字符串参数 1。
/// 字符串参数 2。
/// 字符串参数 3。
/// 字符串参数 4。
/// 字符串参数 5。
/// 格式化后的字符串。
public static string Format(string format, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)
{
if (format == null)
{
throw new GameFrameworkException("Format is invalid.");
}
if (s_TextHelper == null)
{
return string.Format(format, arg1, arg2, arg3, arg4, arg5);
}
return s_TextHelper.Format(format, arg1, arg2, arg3, arg4, arg5);
}
///
/// 获取格式化字符串。
///
/// 字符串参数 1 的类型。
/// 字符串参数 2 的类型。
/// 字符串参数 3 的类型。
/// 字符串参数 4 的类型。
/// 字符串参数 5 的类型。
/// 字符串参数 6 的类型。
/// 字符串格式。
/// 字符串参数 1。
/// 字符串参数 2。
/// 字符串参数 3。
/// 字符串参数 4。
/// 字符串参数 5。
/// 字符串参数 6。
/// 格式化后的字符串。
public static string Format(string format, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6)
{
if (format == null)
{
throw new GameFrameworkException("Format is invalid.");
}
if (s_TextHelper == null)
{
return string.Format(format, arg1, arg2, arg3, arg4, arg5, arg6);
}
return s_TextHelper.Format(format, arg1, arg2, arg3, arg4, arg5, arg6);
}
///
/// 获取格式化字符串。
///
/// 字符串参数 1 的类型。
/// 字符串参数 2 的类型。
/// 字符串参数 3 的类型。
/// 字符串参数 4 的类型。
/// 字符串参数 5 的类型。
/// 字符串参数 6 的类型。
/// 字符串参数 7 的类型。
/// 字符串格式。
/// 字符串参数 1。
/// 字符串参数 2。
/// 字符串参数 3。
/// 字符串参数 4。
/// 字符串参数 5。
/// 字符串参数 6。
/// 字符串参数 7。
/// 格式化后的字符串。
public static string Format(string format, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7)
{
if (format == null)
{
throw new GameFrameworkException("Format is invalid.");
}
if (s_TextHelper == null)
{
return string.Format(format, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
}
return s_TextHelper.Format(format, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
}
///
/// 获取格式化字符串。
///
/// 字符串参数 1 的类型。
/// 字符串参数 2 的类型。
/// 字符串参数 3 的类型。
/// 字符串参数 4 的类型。
/// 字符串参数 5 的类型。
/// 字符串参数 6 的类型。
/// 字符串参数 7 的类型。
/// 字符串参数 8 的类型。
/// 字符串格式。
/// 字符串参数 1。
/// 字符串参数 2。
/// 字符串参数 3。
/// 字符串参数 4。
/// 字符串参数 5。
/// 字符串参数 6。
/// 字符串参数 7。
/// 字符串参数 8。
/// 格式化后的字符串。
public static string Format(string format, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8)
{
if (format == null)
{
throw new GameFrameworkException("Format is invalid.");
}
if (s_TextHelper == null)
{
return string.Format(format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
}
return s_TextHelper.Format(format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
}
///
/// 获取格式化字符串。
///
/// 字符串参数 1 的类型。
/// 字符串参数 2 的类型。
/// 字符串参数 3 的类型。
/// 字符串参数 4 的类型。
/// 字符串参数 5 的类型。
/// 字符串参数 6 的类型。
/// 字符串参数 7 的类型。
/// 字符串参数 8 的类型。
/// 字符串参数 9 的类型。
/// 字符串格式。
/// 字符串参数 1。
/// 字符串参数 2。
/// 字符串参数 3。
/// 字符串参数 4。
/// 字符串参数 5。
/// 字符串参数 6。
/// 字符串参数 7。
/// 字符串参数 8。
/// 字符串参数 9。
/// 格式化后的字符串。
public static string Format(string format, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9)
{
if (format == null)
{
throw new GameFrameworkException("Format is invalid.");
}
if (s_TextHelper == null)
{
return string.Format(format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
}
return s_TextHelper.Format(format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
}
///
/// 获取格式化字符串。
///
/// 字符串参数 1 的类型。
/// 字符串参数 2 的类型。
/// 字符串参数 3 的类型。
/// 字符串参数 4 的类型。
/// 字符串参数 5 的类型。
/// 字符串参数 6 的类型。
/// 字符串参数 7 的类型。
/// 字符串参数 8 的类型。
/// 字符串参数 9 的类型。
/// 字符串参数 10 的类型。
/// 字符串格式。
/// 字符串参数 1。
/// 字符串参数 2。
/// 字符串参数 3。
/// 字符串参数 4。
/// 字符串参数 5。
/// 字符串参数 6。
/// 字符串参数 7。
/// 字符串参数 8。
/// 字符串参数 9。
/// 字符串参数 10。
/// 格式化后的字符串。
public static string Format(string format, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10)
{
if (format == null)
{
throw new GameFrameworkException("Format is invalid.");
}
if (s_TextHelper == null)
{
return string.Format(format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
}
return s_TextHelper.Format(format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
}
///
/// 获取格式化字符串。
///
/// 字符串参数 1 的类型。
/// 字符串参数 2 的类型。
/// 字符串参数 3 的类型。
/// 字符串参数 4 的类型。
/// 字符串参数 5 的类型。
/// 字符串参数 6 的类型。
/// 字符串参数 7 的类型。
/// 字符串参数 8 的类型。
/// 字符串参数 9 的类型。
/// 字符串参数 10 的类型。
/// 字符串参数 11 的类型。
/// 字符串格式。
/// 字符串参数 1。
/// 字符串参数 2。
/// 字符串参数 3。
/// 字符串参数 4。
/// 字符串参数 5。
/// 字符串参数 6。
/// 字符串参数 7。
/// 字符串参数 8。
/// 字符串参数 9。
/// 字符串参数 10。
/// 字符串参数 11。
/// 格式化后的字符串。
public static string Format(string format, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11)
{
if (format == null)
{
throw new GameFrameworkException("Format is invalid.");
}
if (s_TextHelper == null)
{
return string.Format(format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11);
}
return s_TextHelper.Format(format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11);
}
///
/// 获取格式化字符串。
///
/// 字符串参数 1 的类型。
/// 字符串参数 2 的类型。
/// 字符串参数 3 的类型。
/// 字符串参数 4 的类型。
/// 字符串参数 5 的类型。
/// 字符串参数 6 的类型。
/// 字符串参数 7 的类型。
/// 字符串参数 8 的类型。
/// 字符串参数 9 的类型。
/// 字符串参数 10 的类型。
/// 字符串参数 11 的类型。
/// 字符串参数 12 的类型。
/// 字符串格式。
/// 字符串参数 1。
/// 字符串参数 2。
/// 字符串参数 3。
/// 字符串参数 4。
/// 字符串参数 5。
/// 字符串参数 6。
/// 字符串参数 7。
/// 字符串参数 8。
/// 字符串参数 9。
/// 字符串参数 10。
/// 字符串参数 11。
/// 字符串参数 12。
/// 格式化后的字符串。
public static string Format(string format, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12)
{
if (format == null)
{
throw new GameFrameworkException("Format is invalid.");
}
if (s_TextHelper == null)
{
return string.Format(format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12);
}
return s_TextHelper.Format(format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12);
}
///
/// 获取格式化字符串。
///
/// 字符串参数 1 的类型。
/// 字符串参数 2 的类型。
/// 字符串参数 3 的类型。
/// 字符串参数 4 的类型。
/// 字符串参数 5 的类型。
/// 字符串参数 6 的类型。
/// 字符串参数 7 的类型。
/// 字符串参数 8 的类型。
/// 字符串参数 9 的类型。
/// 字符串参数 10 的类型。
/// 字符串参数 11 的类型。
/// 字符串参数 12 的类型。
/// 字符串参数 13 的类型。
/// 字符串格式。
/// 字符串参数 1。
/// 字符串参数 2。
/// 字符串参数 3。
/// 字符串参数 4。
/// 字符串参数 5。
/// 字符串参数 6。
/// 字符串参数 7。
/// 字符串参数 8。
/// 字符串参数 9。
/// 字符串参数 10。
/// 字符串参数 11。
/// 字符串参数 12。
/// 字符串参数 13。
/// 格式化后的字符串。
public static string Format(string format, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13)
{
if (format == null)
{
throw new GameFrameworkException("Format is invalid.");
}
if (s_TextHelper == null)
{
return string.Format(format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13);
}
return s_TextHelper.Format(format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13);
}
///
/// 获取格式化字符串。
///
/// 字符串参数 1 的类型。
/// 字符串参数 2 的类型。
/// 字符串参数 3 的类型。
/// 字符串参数 4 的类型。
/// 字符串参数 5 的类型。
/// 字符串参数 6 的类型。
/// 字符串参数 7 的类型。
/// 字符串参数 8 的类型。
/// 字符串参数 9 的类型。
/// 字符串参数 10 的类型。
/// 字符串参数 11 的类型。
/// 字符串参数 12 的类型。
/// 字符串参数 13 的类型。
/// 字符串参数 14 的类型。
/// 字符串格式。
/// 字符串参数 1。
/// 字符串参数 2。
/// 字符串参数 3。
/// 字符串参数 4。
/// 字符串参数 5。
/// 字符串参数 6。
/// 字符串参数 7。
/// 字符串参数 8。
/// 字符串参数 9。
/// 字符串参数 10。
/// 字符串参数 11。
/// 字符串参数 12。
/// 字符串参数 13。
/// 字符串参数 14。
/// 格式化后的字符串。
public static string Format(string format, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14)
{
if (format == null)
{
throw new GameFrameworkException("Format is invalid.");
}
if (s_TextHelper == null)
{
return string.Format(format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14);
}
return s_TextHelper.Format(format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14);
}
///
/// 获取格式化字符串。
///
/// 字符串参数 1 的类型。
/// 字符串参数 2 的类型。
/// 字符串参数 3 的类型。
/// 字符串参数 4 的类型。
/// 字符串参数 5 的类型。
/// 字符串参数 6 的类型。
/// 字符串参数 7 的类型。
/// 字符串参数 8 的类型。
/// 字符串参数 9 的类型。
/// 字符串参数 10 的类型。
/// 字符串参数 11 的类型。
/// 字符串参数 12 的类型。
/// 字符串参数 13 的类型。
/// 字符串参数 14 的类型。
/// 字符串参数 15 的类型。
/// 字符串格式。
/// 字符串参数 1。
/// 字符串参数 2。
/// 字符串参数 3。
/// 字符串参数 4。
/// 字符串参数 5。
/// 字符串参数 6。
/// 字符串参数 7。
/// 字符串参数 8。
/// 字符串参数 9。
/// 字符串参数 10。
/// 字符串参数 11。
/// 字符串参数 12。
/// 字符串参数 13。
/// 字符串参数 14。
/// 字符串参数 15。
/// 格式化后的字符串。
public static string Format(string format, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15)
{
if (format == null)
{
throw new GameFrameworkException("Format is invalid.");
}
if (s_TextHelper == null)
{
return string.Format(format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15);
}
return s_TextHelper.Format(format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15);
}
///
/// 获取格式化字符串。
///
/// 字符串参数 1 的类型。
/// 字符串参数 2 的类型。
/// 字符串参数 3 的类型。
/// 字符串参数 4 的类型。
/// 字符串参数 5 的类型。
/// 字符串参数 6 的类型。
/// 字符串参数 7 的类型。
/// 字符串参数 8 的类型。
/// 字符串参数 9 的类型。
/// 字符串参数 10 的类型。
/// 字符串参数 11 的类型。
/// 字符串参数 12 的类型。
/// 字符串参数 13 的类型。
/// 字符串参数 14 的类型。
/// 字符串参数 15 的类型。
/// 字符串参数 16 的类型。
/// 字符串格式。
/// 字符串参数 1。
/// 字符串参数 2。
/// 字符串参数 3。
/// 字符串参数 4。
/// 字符串参数 5。
/// 字符串参数 6。
/// 字符串参数 7。
/// 字符串参数 8。
/// 字符串参数 9。
/// 字符串参数 10。
/// 字符串参数 11。
/// 字符串参数 12。
/// 字符串参数 13。
/// 字符串参数 14。
/// 字符串参数 15。
/// 字符串参数 16。
/// 格式化后的字符串。
public static string Format(string format, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15, T16 arg16)
{
if (format == null)
{
throw new GameFrameworkException("Format is invalid.");
}
if (s_TextHelper == null)
{
return string.Format(format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16);
}
return s_TextHelper.Format(format, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16);
}
}
}
}