|
using System;
using System.Collections.Generic;
using Microsoft.VisualStudio.Modeling;
using Microsoft.VisualStudio.Modeling.Validation;
using Dawliasoft.Sculpture;
using Dawliasoft.Sculpture.SerializableTypes;
using Dawliasoft.Sculpture.CommonHelpers;
namespace WPFMold.Helpers
{
public static class ValidationHelper
{
public static void ValidateNull(ModelElement element, string PropertyName, string DisplayName, ValidationContext context)
{
if (string.IsNullOrEmpty(MoldHelper.GetPropertyValue(element, PropertyName)))
context.LogError(string.Format("The {0} '{1}' {2} property is not set.", element.GetType().ToString(), MoldHelper.GetPropertyValue(element, "Name"), DisplayName), "Null Error", element);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Program Manager in Sculpture project, Interesting in .NET Model driven development.