public static TupleLength createInstance(int note_length, int type) { if (NoteLengthExtensions.intIsValidNoteLength(note_length) && TupletTypeExtensions.intIsValidTupletType(type)) { return(new TupleLength((NoteLength)note_length, (TupletType)type)); } else { return(null); } }
public Dictionary <TupletType, ImageBrush> genTupletImages(Dictionary <string, string> uri_dict) { var image_dict = new Dictionary <TupletType, ImageBrush>(); foreach (var entry in uri_dict) { TupletType type = TupletTypeExtensions.getTupletTypeFromString(entry.Key); var brush = new ImageBrush(); brush.ImageSource = SettingsReader.getImageFromLocation(entry.Value); image_dict[type] = brush; } return(image_dict); }