Skip to content

Commit

Permalink
further refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveDunn committed Sep 21, 2023
1 parent e8fff9e commit 9fd5100
Show file tree
Hide file tree
Showing 7 changed files with 256 additions and 184 deletions.
25 changes: 14 additions & 11 deletions src/Vogen.SharedTypes/StringComparisonGeneration.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
namespace Vogen
using System.Diagnostics;
// ReSharper disable UnusedMember.Global

namespace Vogen;

public enum StringComparisonGeneration
{
public enum StringComparisonGeneration
{
Unspecified = -1,
CurrentCulture = 0,
CurrentCultureIgnoreCase = 1,
InvariantCulture = 2,
InvariantCultureIgnoreCase = 3,
Ordinal = 4,
OrdinalIgnoreCase = 5,
}
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
Unspecified = -1,
CurrentCulture = 0,
CurrentCultureIgnoreCase = 1,
InvariantCulture = 2,
InvariantCultureIgnoreCase = 3,
Ordinal = 4,
OrdinalIgnoreCase = 5,
}
69 changes: 24 additions & 45 deletions src/Vogen.SharedTypes/VogenDefaultsAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,30 @@
// ReSharper disable UnusedType.Global

// ReSharper disable UnusedParameter.Local
namespace Vogen
{
using System;
namespace Vogen;

[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
public class VogenDefaultsAttribute : Attribute
{
/// <summary>
/// Creates a new instance of a type that represents the default
/// values used for value object generation.
/// </summary>
/// <param name="underlyingType">The primitive underlying type.</param>
/// <param name="conversions">Any conversions that need to be done for this type, e.g. to be serialized etc.</param>
/// <param name="throws">The type of exception that is thrown when validation fails.</param>
/// <param name="customizations">Any customizations, for instance, treating numbers in [de]serialization as strings.</param>
/// <param name="deserializationStrictness">The strictness of validation when deserializing.</param>
/// <param name="debuggerAttributes">Controls how debugger attributes are generated. This is useful in Rider where the attributes crash Rider's debugger.</param>
public VogenDefaultsAttribute(
Type? underlyingType = null,
Conversions conversions = Conversions.Default,
Type? throws = null,
Customizations customizations = Customizations.None,
DeserializationStrictness deserializationStrictness = DeserializationStrictness.AllowValidAndKnownInstances,
DebuggerAttributeGeneration debuggerAttributes = DebuggerAttributeGeneration.Default)
{
// UnderlyingType = underlyingType ?? typeof(int);
// TypeOfValidationException = throws ?? typeof(ValueObjectValidationException);
// Conversions = conversions;
// Customizations = customizations;
// DeserializationStrictness = deserializationStrictness;
// OmitDebugAttributes = omitDebugAttributes;
}
using System;

// public Type UnderlyingType { get; } = typeof(int);
//
// public Type TypeOfValidationException { get; } = typeof(ValueObjectValidationException);
//
// public Conversions Conversions { get; } = Conversions.Default;
//
// public Customizations Customizations { get; }
//
// public DeserializationStrictness DeserializationStrictness { get; } =
// DeserializationStrictness.AllowValidAndKnownInstances;
//
// public bool? OmitDebugAttributes { get; }
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
public class VogenDefaultsAttribute : Attribute
{
/// <summary>
/// Creates a new instance of a type that represents the default
/// values used for value object generation.
/// </summary>
/// <param name="underlyingType">The primitive underlying type.</param>
/// <param name="conversions">Any conversions that need to be done for this type, e.g. to be serialized etc.</param>
/// <param name="throws">The type of exception that is thrown when validation fails.</param>
/// <param name="customizations">Any customizations, for instance, treating numbers in [de]serialization as strings.</param>
/// <param name="deserializationStrictness">The strictness of validation when deserializing.</param>
/// <param name="debuggerAttributes">Controls how debugger attributes are generated. This is useful in Rider where the attributes crash Rider's debugger.</param>
public VogenDefaultsAttribute(
Type? underlyingType = null,
Conversions conversions = Conversions.Default,
Type? throws = null,
Customizations customizations = Customizations.None,
DeserializationStrictness deserializationStrictness = DeserializationStrictness.AllowValidAndKnownInstances,
DebuggerAttributeGeneration debuggerAttributes = DebuggerAttributeGeneration.Default)
{
}
}

}
Loading

0 comments on commit 9fd5100

Please sign in to comment.