private static bool ShouldShow(ModelMetadata metadata, TemplateInfo templateInfo) { if (metadata.ShowForEdit && metadata.ModelType != typeof(System.Data.EntityState) // do not show internal Entity State && (metadata.DataTypeName == "Upload" || metadata.TemplateHint == "Upload" || !metadata.IsComplexType)) { return !templateInfo.Visited(metadata); } else { return false; } }
/// <summary> /// Determines whether [is property visible] [the specified metadata]. /// </summary> /// <param name="metadata">The metadata.</param> /// <param name="template">The template.</param> /// <returns><c>true</c> if [is property visible] [the specified metadata]; otherwise, <c>false</c>.</returns> public static bool IsPropertyVisible(this ModelMetadata metadata, TemplateInfo template) { return !metadata.HideSurroundingHtml && metadata.ShowForEdit && !template.Visited(metadata); }