public MinLengthValidator( Expression <Func <TObject, int> > minLengthExpression, ValidationMessageType validationMessageType) : base(new LanguageStringSource(ValidatorsNames.MinLengthValidator), minLengthExpression, _ => int.MaxValue, validationMessageType) { }
public MaxLengthValidator( Expression <Func <TObject, int> > maxLengthExpression, ValidationMessageType validationMessageType) : base(new LanguageStringSource(ValidatorsNames.MaxLengthValidator), _ => 0, maxLengthExpression, validationMessageType) { }
public ValidationMessage(Severity severity, ValidationMessageType messageType, string content, string path, string pathAlternate) : this(severity, messageType, content, path) { PathAlternate = pathAlternate; }
public PredicateValidator(Func <ValidationContext <TObject, TProp>, bool> predicate, ValidationMessageType validationMessageType) : base(new LanguageStringSource(ValidatorsNames.PredicateValidator), validationMessageType) { _predicate = predicate; }
protected virtual ImageSource MessageType2ImageOverride(ValidationMessageType type) { ImageSource src = null; switch (_validationMessageType) { case ValidationMessageType.Information: src = _imageOK; break; case ValidationMessageType.Warning: src = _imageWarning; break; case ValidationMessageType.Error: case ValidationMessageType.FatalError: src = _imageError; break; } return src; }
protected void SetStatus(bool isValid, String validationMessage, ValidationMessageType validationMessageType) { this.IsValid = isValid; this.ValidationMessage = validationMessage; this.ValidationMessageType = validationMessageType; }
public ExactCountValidator( Expression <Func <TObject, int> > countExpression, ValidationMessageType validationMessageType) : base(new LanguageStringSource(ValidatorsNames.ExactCountValidator), countExpression, countExpression, validationMessageType) { }
public ValidationMessage(ErrorLevel error, string message, ValidationMessageType type) { this.Error = error; this.Message = message; this.Type = type; }
public ValidationResultBase(ValidationMessageType validationTreshold = ValidationMessageType.Error) { _validationTreshold = validationTreshold; }
public NotNullValidator(ValidationMessageType validationMessageType) : base(new LanguageStringSource(ValidatorsNames.NotNullValidator), validationMessageType) { }
public ValidationMessage(ValidationMessageType type) { Type = type; }
/// <summary> /// Constructor that creates a validation error with the specified type, field and message. /// </summary> /// <param name="type">The type of the error.</param> /// <param name="field">The field that this message relates to.</param> /// <param name="text">The error message.</param> public ValidationMessage(ValidationMessageType type, string field, string text) { _type = type; _field = field; _text = text; }
public ValidationResult(ValidationMessageType validationTreshold = ValidationMessageType.Error) : base(validationTreshold) { }
public ExactLengthValidator( Expression <Func <TObject, int> > lengthExpression, ValidationMessageType validationMessageType) : base(new LanguageStringSource(ValidatorsNames.ExactLengthValidator), lengthExpression, lengthExpression, validationMessageType) { }
public APIException(string message) : base(MessageLib.GetMultilingualMessage(message)) { MessageType = ValidationMessageType.Info; }
public CollectionElementsAreValidValidator(ValidationMessageType validationMessageType) : base(new LanguageStringSource(ValidatorsNames.CollectionElementsAreValidValidator), validationMessageType) { }
public APIException(ValidationMessageType messageType, string message) : base(MessageLib.GetMultilingualMessage(message)) { MessageType = messageType; }
public ValidationMessage(ValidationMessageType type, EmailDtoField targetField) { this.Type = type; this.TargetField = targetField; }
public EachElementValidator(Func <TProp, bool> validCondition, ValidationMessageType validationMessageType) : base(new LanguageStringSource(ValidatorsNames.EachElementValidator), validationMessageType) { _validCondition = validCondition; }
protected void ResetStatus() { this._valid = true; this._validationMessage = String.Empty; this._validationMessageType = ValidationMessageType.Information; }
public void ShowStatusMessage(int windowHandle, string windowName, string message, ValidationMessageType validationMessageType, ValidationMessageStatus validationMessageStatus) { // There are 3 types of nodes: // 1) Top Level (for a comparion window) // 2) Type Node (for grouping of messages by type, e.g. DataSources, tables, etc.) // 3) Message node (that contains the actual message), which can be either a warning or informational //This method will add at least 1 message node and its parent nodes only if necessary. //The nodes are differentiated and identified based on their level and the .Tag property TreeGridNode messageNode; //node that will contain the actual message when we are done TreeGridNode topLevelNodeForHandle = null; foreach (TreeGridNode topLevelNode in this.Nodes) { if (topLevelNode.Tag != null && Convert.ToInt32(topLevelNode.Tag) == windowHandle) { topLevelNodeForHandle = topLevelNode; break; } } if (topLevelNodeForHandle == null) { //Didn't find match, so need to create new node topLevelNodeForHandle = this.Nodes.Add(); topLevelNodeForHandle.Tag = windowHandle; topLevelNodeForHandle.Cells[1].Value = windowName; topLevelNodeForHandle.Cells[1].Style.Font = new Font(Font.SystemFontName, 8, FontStyle.Bold); topLevelNodeForHandle.ImageIndex = 17; //topLevelNodeForHandle.Visible = false; } TreeGridNode particularTypeNode = null; switch (validationMessageType) { case ValidationMessageType.Model: particularTypeNode = FindOrCreateTypeNode(topLevelNodeForHandle, "Model"); particularTypeNode.ImageIndex = 25; break; case ValidationMessageType.DataSource: particularTypeNode = FindOrCreateTypeNode(topLevelNodeForHandle, "Data Sources"); particularTypeNode.ImageIndex = 0; break; case ValidationMessageType.Table: particularTypeNode = FindOrCreateTypeNode(topLevelNodeForHandle, "Tables"); particularTypeNode.ImageIndex = 1; break; case ValidationMessageType.Relationship: particularTypeNode = FindOrCreateTypeNode(topLevelNodeForHandle, "Relationships"); particularTypeNode.ImageIndex = 2; break; case ValidationMessageType.Measure: particularTypeNode = FindOrCreateTypeNode(topLevelNodeForHandle, "Measures"); particularTypeNode.ImageIndex = 3; break; case ValidationMessageType.Kpi: particularTypeNode = FindOrCreateTypeNode(topLevelNodeForHandle, "KPIs"); particularTypeNode.ImageIndex = 4; break; case ValidationMessageType.CalculationItem: particularTypeNode = FindOrCreateTypeNode(topLevelNodeForHandle, "Calculation Items"); particularTypeNode.ImageIndex = 24; break; case ValidationMessageType.CalculationGroup: particularTypeNode = FindOrCreateTypeNode(topLevelNodeForHandle, "Calculation Groups"); particularTypeNode.ImageIndex = 23; break; case ValidationMessageType.Expression: particularTypeNode = FindOrCreateTypeNode(topLevelNodeForHandle, "Expression"); particularTypeNode.ImageIndex = 22; break; case ValidationMessageType.Perspective: particularTypeNode = FindOrCreateTypeNode(topLevelNodeForHandle, "Perspectives"); particularTypeNode.ImageIndex = 15; break; case ValidationMessageType.Culture: particularTypeNode = FindOrCreateTypeNode(topLevelNodeForHandle, "Culture"); particularTypeNode.ImageIndex = 21; break; case ValidationMessageType.Role: particularTypeNode = FindOrCreateTypeNode(topLevelNodeForHandle, "Roles"); particularTypeNode.ImageIndex = 14; break; case ValidationMessageType.Action: particularTypeNode = FindOrCreateTypeNode(topLevelNodeForHandle, "Actions"); particularTypeNode.ImageIndex = 16; break; //case ValidationMessageType.RefreshPolicy: // particularTypeNode = FindOrCreateTypeNode(topLevelNodeForHandle, "Refresh Policy"); // particularTypeNode.ImageIndex = 26; // break; case ValidationMessageType.MeasureCalculationDependency: particularTypeNode = FindOrCreateTypeNode(topLevelNodeForHandle, "Measure Calculation Dependencies"); particularTypeNode.ImageIndex = 3; break; case ValidationMessageType.AggregationDependency: particularTypeNode = FindOrCreateTypeNode(topLevelNodeForHandle, "Aggregation Dependencies"); particularTypeNode.ImageIndex = 2; break; default: //Something is wrong, better get out of here. return; } messageNode = particularTypeNode.Nodes.Add(); topLevelNodeForHandle.Expand(); particularTypeNode.Expand(); messageNode.Visible = false; if (validationMessageStatus == ValidationMessageStatus.Informational) { messageNode.ImageIndex = 11; if (_informationalMessagesVisible) { messageNode.Visible = true; messageNode.Parent.Visible = true; } } else { messageNode.ImageIndex = 12; if (_warningsVisible) { messageNode.Visible = true; messageNode.Parent.Visible = true; } } messageNode.Tag = validationMessageStatus; messageNode.Cells[1].Value = message; if (messageNode.Visible && this.Height > 0) { // autoscroll this.FirstDisplayedCell = this.Rows[this.Rows.Count - 1].Cells[0]; this.Refresh(); } }
public ValidationMessage(ValidationMessageType type, string field, string text) { _type = type; _field = field; _text = text; }
public void AddMessage(string property, string message, ValidationMessageType type = ValidationMessageType.Error) { this._messages.Add(new ValidationMessage(property, message, type)); }