Replace F extension with string interpolation

This commit is contained in:
teinarss
2021-04-24 17:46:24 +02:00
committed by reaperrr
parent 1385aca783
commit 10676be377
300 changed files with 752 additions and 799 deletions

View File

@@ -80,7 +80,7 @@ namespace OpenRA.Widgets
if (LoadWidget(id, parent, args) is T widget)
return widget;
throw new InvalidOperationException("Widget {0} is not of type {1}".F(id, typeof(T).Name));
throw new InvalidOperationException($"Widget {id} is not of type {typeof(T).Name}");
}
public static Widget LoadWidget(string id, Widget parent, WidgetArgs args)
@@ -236,7 +236,7 @@ namespace OpenRA.Widgets
public virtual Widget Clone()
{
throw new InvalidOperationException("Widget type `{0}` is not cloneable.".F(GetType().Name));
throw new InvalidOperationException($"Widget type `{GetType().Name}` is not cloneable.");
}
public virtual int2 RenderOrigin
@@ -579,9 +579,7 @@ namespace OpenRA.Widgets
{
var t = GetOrNull<T>(id);
if (t == null)
throw new InvalidOperationException(
"Widget {0} has no child {1} of type {2}".F(
Id, id, typeof(T).Name));
throw new InvalidOperationException($"Widget {Id} has no child {id} of type {typeof(T).Name}");
return t;
}

View File

@@ -30,7 +30,7 @@ namespace OpenRA
{
var key = w.Key.Substring(w.Key.IndexOf('@') + 1);
if (widgets.ContainsKey(key))
throw new InvalidDataException("Widget has duplicate Key `{0}` at {1}".F(w.Key, w.Location));
throw new InvalidDataException($"Widget has duplicate Key `{w.Key}` at {w.Location}");
widgets.Add(key, w);
}
}
@@ -38,7 +38,7 @@ namespace OpenRA
public Widget LoadWidget(WidgetArgs args, Widget parent, string w)
{
if (!widgets.TryGetValue(w, out var ret))
throw new InvalidDataException("Cannot find widget with Id `{0}`".F(w));
throw new InvalidDataException($"Cannot find widget with Id `{w}`");
return LoadWidget(args, parent, ret);
}