using System; namespace Uigenx { /// /// Thrown when a screen asks for an element its UXML does not contain. The message names the /// screen, the element and the expected type so the fix is obvious without a debugger. /// public sealed class UgxElementNotFoundException : Exception { public string ScreenKey { get; } public string ElementName { get; } public Type ExpectedType { get; } public UgxElementNotFoundException(string screenKey, string elementName, Type expectedType) : base("screen '" + screenKey + "' has no element named '" + elementName + "' of type " + (expectedType != null ? expectedType.Name : "VisualElement") + ". Re-export the screen from UI Creator, or check that the element still carries that name.") { ScreenKey = screenKey; ElementName = elementName; ExpectedType = expectedType; } } }