From 1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 Mon Sep 17 00:00:00 2001 From: Lucas Faria Mendes Date: Mon, 30 Mar 2026 10:38:18 -0300 Subject: chore: location --- .../EnumBindingSourceExtension.cs | 59 ---------------------- 1 file changed, 59 deletions(-) delete mode 100644 Gestor.Common/Gestor.Common.Helpers/EnumBindingSourceExtension.cs (limited to 'Gestor.Common/Gestor.Common.Helpers/EnumBindingSourceExtension.cs') diff --git a/Gestor.Common/Gestor.Common.Helpers/EnumBindingSourceExtension.cs b/Gestor.Common/Gestor.Common.Helpers/EnumBindingSourceExtension.cs deleted file mode 100644 index 7ce699e..0000000 --- a/Gestor.Common/Gestor.Common.Helpers/EnumBindingSourceExtension.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using System.Windows.Markup; - -namespace Gestor.Common.Helpers -{ - public class EnumBindingSourceExtension : MarkupExtension - { - private Type _enumType; - - public Type EnumType - { - get - { - return this._enumType; - } - set - { - if (value == this._enumType) - { - return; - } - if (null != value) - { - if (!(Nullable.GetUnderlyingType(value) ?? value).IsEnum) - { - throw new ArgumentException("Type must be for an Enum."); - } - } - this._enumType = value; - } - } - - public EnumBindingSourceExtension() - { - } - - public EnumBindingSourceExtension(Type enumType) - { - this.EnumType = enumType; - } - - public override object ProvideValue(IServiceProvider serviceProvider) - { - if (null == this._enumType) - { - throw new InvalidOperationException("The EnumType must be specified."); - } - Type underlyingType = Nullable.GetUnderlyingType(this._enumType) ?? this._enumType; - Array values = Enum.GetValues(underlyingType); - if (underlyingType == this._enumType) - { - return values; - } - Array arrays = Array.CreateInstance(underlyingType, values.Length + 1); - values.CopyTo(arrays, 1); - return arrays; - } - } -} \ No newline at end of file -- cgit v1.2.3