public static PatternImage Create( string designerDirectory, string categoryDirectory, string reference, string version, PatternImageSize size) { Require.NotNullOrEmpty(designerDirectory, "directory"); Require.NotNullOrEmpty(reference, "reference"); Contract.Ensures(Contract.Result <PatternImage>() != null); switch (size) { case PatternImageSize.Preview: return(new Preview_ { CategoryDirectory = categoryDirectory, DesignerDirectory = designerDirectory, Reference = reference, Version = version, }); case PatternImageSize.Original: return(new Original_ { CategoryDirectory = categoryDirectory, DesignerDirectory = designerDirectory, Reference = reference, Version = version, }); default: throw Acknowledge.Unreachable( "The pattern size '" + size.ToString() + "' is not yet handled."); } }
public PatternVisibility GetVisibility(PatternImageSize size) { if (Published) { switch (size) { case PatternImageSize.Original: return(PatternVisibility.Members); case PatternImageSize.Preview: return((Preferred || Showcased) ? PatternVisibility.Public : PatternVisibility.Members); default: throw Acknowledge.Unreachable( "The pattern size '" + size.ToString() + "' is not yet handled."); } } else { return(PatternVisibility.None); } }