Added a manual grid refresh after validation since this seems not to work automatically anymore
This commit is contained in:
parent
9d4f608383
commit
79ddbf1572
@ -838,7 +838,7 @@ namespace ENI2
|
|||||||
{
|
{
|
||||||
List<MessageViolation> vViolations = new List<MessageViolation>();
|
List<MessageViolation> vViolations = new List<MessageViolation>();
|
||||||
List<MessageError> vErrors = new List<MessageError>();
|
List<MessageError> vErrors = new List<MessageError>();
|
||||||
Dictionary<Message, MessageValidationCounts> counts = new Dictionary<Message, MessageValidationCounts>();
|
Dictionary<Message, MessageValidationCounts> counts = new Dictionary<Message, MessageValidationCounts>();
|
||||||
|
|
||||||
RuleEngine ruleEngine = new RuleEngine();
|
RuleEngine ruleEngine = new RuleEngine();
|
||||||
foreach (Message aMessage in messagesSnapshot)
|
foreach (Message aMessage in messagesSnapshot)
|
||||||
@ -855,7 +855,7 @@ namespace ENI2
|
|||||||
ViolationCount = violations.Count > 0 ? (int?)violations.Count : null,
|
ViolationCount = violations.Count > 0 ? (int?)violations.Count : null,
|
||||||
PositionViolationCount = violations.Count > 0 ? (int?)violations.Count(v => !v.Identifier.IsNullOrEmpty()) : null
|
PositionViolationCount = violations.Count > 0 ? (int?)violations.Count(v => !v.Identifier.IsNullOrEmpty()) : null
|
||||||
};
|
};
|
||||||
counts[aMessage] = messageCounts;
|
counts[aMessage] = messageCounts;
|
||||||
|
|
||||||
string messageGroup = this.MessageGroupForMessage(aMessage);
|
string messageGroup = this.MessageGroupForMessage(aMessage);
|
||||||
|
|
||||||
@ -1393,20 +1393,20 @@ namespace ENI2
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new ValidationResult(vViolations, vErrors, counts);
|
return new ValidationResult(vViolations, vErrors, counts);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ApplyValidationResult(ValidationResult result, bool showMessages)
|
private void ApplyValidationResult(ValidationResult result, bool showMessages)
|
||||||
{
|
{
|
||||||
// TODO: clear highlighting
|
// TODO: clear highlighting
|
||||||
foreach (KeyValuePair<Message, MessageValidationCounts> entry in result.Counts)
|
foreach (KeyValuePair<Message, MessageValidationCounts> entry in result.Counts)
|
||||||
{
|
{
|
||||||
Message aMessage = entry.Key;
|
Message aMessage = entry.Key;
|
||||||
MessageValidationCounts messageCounts = entry.Value;
|
MessageValidationCounts messageCounts = entry.Value;
|
||||||
aMessage.ErrorCount = messageCounts.ErrorCount;
|
aMessage.ErrorCount = messageCounts.ErrorCount;
|
||||||
aMessage.ViolationCount = messageCounts.ViolationCount;
|
aMessage.ViolationCount = messageCounts.ViolationCount;
|
||||||
aMessage.PositionViolationCount = messageCounts.PositionViolationCount;
|
aMessage.PositionViolationCount = messageCounts.PositionViolationCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (MessageError me in result.Errors)
|
foreach (MessageError me in result.Errors)
|
||||||
{
|
{
|
||||||
@ -1461,6 +1461,12 @@ namespace ENI2
|
|||||||
MessageBox.Show(Properties.Resources.textValidationOK, Properties.Resources.textValidation, MessageBoxButton.OK, MessageBoxImage.Information);
|
MessageBox.Show(Properties.Resources.textValidationOK, Properties.Resources.textValidation, MessageBoxButton.OK, MessageBoxImage.Information);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (controlCache.TryGetValue(Properties.Resources.textOverview, out DetailBaseControl overviewControl) &&
|
||||||
|
overviewControl is OverViewDetailControl ovdc)
|
||||||
|
{
|
||||||
|
ovdc.RefreshMessageGrid();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ApplyCrewEffectsWarningSuppression()
|
private void ApplyCrewEffectsWarningSuppression()
|
||||||
@ -1486,17 +1492,17 @@ namespace ENI2
|
|||||||
|
|
||||||
private sealed class ValidationResult
|
private sealed class ValidationResult
|
||||||
{
|
{
|
||||||
internal ValidationResult(List<MessageViolation> violations, List<MessageError> errors, Dictionary<Message, MessageValidationCounts> counts)
|
internal ValidationResult(List<MessageViolation> violations, List<MessageError> errors, Dictionary<Message, MessageValidationCounts> counts)
|
||||||
{
|
{
|
||||||
Violations = violations;
|
Violations = violations;
|
||||||
Errors = errors;
|
Errors = errors;
|
||||||
Counts = counts;
|
Counts = counts;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal List<MessageViolation> Violations { get; }
|
internal List<MessageViolation> Violations { get; }
|
||||||
internal List<MessageError> Errors { get; }
|
internal List<MessageError> Errors { get; }
|
||||||
internal Dictionary<Message, MessageValidationCounts> Counts { get; }
|
internal Dictionary<Message, MessageValidationCounts> Counts { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
private sealed class MessageValidationCounts
|
private sealed class MessageValidationCounts
|
||||||
{
|
{
|
||||||
|
|||||||
@ -341,8 +341,8 @@ namespace ENI2.DetailViewControls
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateCore()
|
public void UpdateCore()
|
||||||
{
|
{
|
||||||
this.UnregisterTextboxChange(this.textBoxDisplayId);
|
this.UnregisterTextboxChange(this.textBoxDisplayId);
|
||||||
|
|
||||||
this.textBoxDisplayId.DataContext = null;
|
this.textBoxDisplayId.DataContext = null;
|
||||||
@ -367,8 +367,13 @@ namespace ENI2.DetailViewControls
|
|||||||
//};
|
//};
|
||||||
//sid.UpdateId(this.Core.DisplayId);
|
//sid.UpdateId(this.Core.DisplayId);
|
||||||
//sid.Show();
|
//sid.Show();
|
||||||
this.Core.IsDirty = false; // ist ja schon gespeichert..
|
this.Core.IsDirty = false; // ist ja schon gespeichert..
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal void RefreshMessageGrid()
|
||||||
|
{
|
||||||
|
this.dataGridMessages?.Items?.Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user