@@ -12,6 +12,7 @@ static EmailSenderConfigurationEntity()
12
12
DescriptionManager.ExternalEnums.Add(typeof(SmtpDeliveryFormat), m => m.Name);
13
13
DescriptionManager.ExternalEnums.Add(typeof(SmtpDeliveryMethod), m => m.Name);
14
14
DescriptionManager.ExternalEnums.Add(typeof(ExchangeVersion), m => m.Name);
15
+
15
16
}
16
17
17
18
[UniqueIndex]
@@ -24,29 +25,23 @@ static EmailSenderConfigurationEntity()
24
25
[NoRepeatValidator]
25
26
public MList<EmailRecipientEmbedded> AdditionalRecipients { get; set; } = new MList<EmailRecipientEmbedded>();
26
27
27
-
[ImplementedBy(typeof(SmtpEntity), typeof(ExchangeWebServiceEntity), typeof(MicrosoftGraphEntity))]
28
-
public EmailSenderServiceConfigurationEntity Service { get; set; }
28
+
[ImplementedBy(typeof(SmtpEmailServiceEntity), typeof(ExchangeWebServiceEmailServiceEntity), typeof(MicrosoftGraphEmailServiceEntity))]
29
+
public EmailServiceEntity Service { get; set; }
29
30
30
-
public override string ToString() => $"{Name} - {Service}";
31
+
[AutoExpressionField]
32
+
public override string ToString() => As.Expression(() => Name);
31
33
32
34
protected override string? ChildPropertyValidation(ModifiableEntity sender, PropertyInfo pi)
33
35
{
34
36
if (sender == DefaultFrom && pi.Name == nameof(DefaultFrom.AzureUserId))
35
37
{
36
-
if (DefaultFrom.AzureUserId == null && Service is MicrosoftGraphEntity microsoftGraph)
38
+
if (DefaultFrom.AzureUserId == null && Service is MicrosoftGraphEmailServiceEntity microsoftGraph)
37
39
return ValidationMessage._0IsMandatoryWhen1IsSet.NiceToString(pi.NiceName(), NicePropertyName(() => microsoftGraph));
38
40
}
39
41
40
42
return base.ChildPropertyValidation(sender, pi);
41
43
}
42
44
43
-
protected override bool IsPropertyReadonly(PropertyInfo pi)
44
-
{
45
-
if (!IsNew && pi.Name == nameof(Service))
46
-
return true;
47
-
48
-
return base.IsPropertyReadonly(pi);
49
-
}
50
45
public EmailSenderConfigurationEntity Clone()
51
46
{
52
47
return new EmailSenderConfigurationEntity
@@ -66,14 +61,16 @@ public static class EmailSenderConfigurationOperation
66
61
public static readonly ConstructSymbol<EmailSenderConfigurationEntity>.From<EmailSenderConfigurationEntity> Clone;
67
62
}
68
63
69
-
public abstract class EmailSenderServiceConfigurationEntity : Entity
64
+
public abstract class EmailServiceEntity : Entity
70
65
{
71
-
public abstract EmailSenderServiceConfigurationEntity Clone();
66
+
public abstract EmailServiceEntity Clone();
72
67
}
73
68
74
69
[EntityKind(EntityKind.Part, EntityData.Master)]
75
-
public class SmtpEntity : EmailSenderServiceConfigurationEntity
70
+
public class SmtpEmailServiceEntity : EmailServiceEntity
76
71
{
72
+
73
+
77
74
public SmtpDeliveryFormat DeliveryFormat { get; set; }
78
75
79
76
public SmtpDeliveryMethod DeliveryMethod { get; set; }
@@ -83,7 +80,7 @@ public class SmtpEntity : EmailSenderServiceConfigurationEntity
83
80
[StringLengthValidator(Min = 3, Max = 300), FileNameValidator]
84
81
public string? PickupDirectoryLocation { get; set; }
85
82
86
-
static StateValidator<SmtpEntity, SmtpDeliveryMethod> stateValidator = new StateValidator<SmtpEntity, SmtpDeliveryMethod>(
83
+
static StateValidator<SmtpEmailServiceEntity, SmtpDeliveryMethod> stateValidator = new StateValidator<SmtpEmailServiceEntity, SmtpDeliveryMethod>(
87
84
a => a.DeliveryMethod, a => a.Network, a => a.PickupDirectoryLocation)
88
85
{
89
86
{SmtpDeliveryMethod.Network, true, null },
@@ -96,15 +93,14 @@ public class SmtpEntity : EmailSenderServiceConfigurationEntity
96
93
return stateValidator.Validate(this, pi) ?? base.PropertyValidation(pi);
97
94
}
98
95
99
-
public override SmtpEntity Clone()
96
+
public override SmtpEmailServiceEntity Clone()
100
97
{
101
-
return new SmtpEntity
98
+
return new SmtpEmailServiceEntity
102
99
{
103
100
DeliveryFormat = DeliveryFormat,
104
101
DeliveryMethod = DeliveryMethod,
105
102
Network = Network?.Clone(),
106
103
PickupDirectoryLocation = PickupDirectoryLocation
107
-
108
104
};
109
105
}
110
106
}
@@ -162,8 +158,10 @@ public enum CertFileType
162
158
}
163
159
164
160
[EntityKind(EntityKind.Part, EntityData.Master)]
165
-
public class ExchangeWebServiceEntity : EmailSenderServiceConfigurationEntity
161
+
public class ExchangeWebServiceEmailServiceEntity : EmailServiceEntity
166
162
{
163
+
164
+
167
165
public ExchangeVersion ExchangeVersion { get; set; }
168
166
169
167
[StringLengthValidator(Max = 300)]
@@ -177,9 +175,9 @@ public class ExchangeWebServiceEntity : EmailSenderServiceConfigurationEntity
177
175
178
176
public bool UseDefaultCredentials { get; set; } = true;
179
177
180
-
public override ExchangeWebServiceEntity Clone()
178
+
public override ExchangeWebServiceEmailServiceEntity Clone()
181
179
{
182
-
return new ExchangeWebServiceEntity
180
+
return new ExchangeWebServiceEmailServiceEntity
183
181
{
184
182
ExchangeVersion = ExchangeVersion,
185
183
Url = Url,
@@ -192,7 +190,7 @@ public override ExchangeWebServiceEntity Clone()
192
190
}
193
191
194
192
[EntityKind(EntityKind.Part, EntityData.Master)]
195
-
public class MicrosoftGraphEntity : EmailSenderServiceConfigurationEntity
193
+
public class MicrosoftGraphEmailServiceEntity : EmailServiceEntity
196
194
{
197
195
public bool UseActiveDirectoryConfiguration { get; set; }
198
196
@@ -221,9 +219,9 @@ public class MicrosoftGraphEntity : EmailSenderServiceConfigurationEntity
221
219
222
220
return base.PropertyValidation(pi);
223
221
}
224
-
public override MicrosoftGraphEntity Clone()
222
+
public override MicrosoftGraphEmailServiceEntity Clone()
225
223
{
226
-
return new MicrosoftGraphEntity
224
+
return new MicrosoftGraphEmailServiceEntity
227
225
{
228
226
UseActiveDirectoryConfiguration = UseActiveDirectoryConfiguration,
229
227
Azure_ApplicationID = Azure_ApplicationID,
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4