public static void Main()
EmailAttribute attribute = new EmailAttribute("SomeValue", "%%Recipient.SomeField%%");
Console.WriteLine("attribute = {0}", attribute);
Console.WriteLine("attribute.Value = {0}", attribute.Value);
Console.WriteLine("attribute.FieldName = {0}", attribute.FieldName);
attribute.FieldName = "%%Recipient.TestField%%";
Console.WriteLine("attribute == 'test': {0}", attribute == "test");
Console.WriteLine("attribute == '%%Recipient.TestField%%': {0}", attribute == "%%Recipient.SomeField%%");
Console.WriteLine("attribute = {0}", attribute);
Console.WriteLine("attribute.Value = {0}", attribute.Value);
Console.WriteLine("attribute.FieldName = {0}", attribute.FieldName);
public class EmailAttribute
public string Value { get; set; }
public string FieldName { get; set; }
public EmailAttribute(string value)
public EmailAttribute(string value, string fieldName)
static public implicit operator EmailAttribute(string value)
return new EmailAttribute(value);
static public implicit operator string(EmailAttribute value)
public static bool operator == (EmailAttribute a, string b)
public static bool operator != (EmailAttribute a, string b)
public override bool Equals(object value)
return this.Value == (string)value;
public override string ToString()
public override int GetHashCode()
return this.FieldName.GetHashCode();