public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { if (value is string) { SOBGroup type = SOBGroup.GetByName((string)value); if (type != null) { return(type); } else { return(null); } } return(base.ConvertFrom(context, culture, value)); }
public static void AddToSOBGroup(string squadronName, string sobGroupName) { Squadron squadron = Squadron.GetByName(squadronName); SOBGroup sobGroup = SOBGroup.GetByName(sobGroupName); if (squadron == null) { new Problem(ProblemTypes.WARNING, "Squadron \"" + squadronName + "\" not found. Skipping adding to SOB group \"" + sobGroupName + "\"."); return; } if (sobGroup == null) { new Problem(ProblemTypes.WARNING, "SOB group \"" + sobGroupName + "\" not found. Skipping adding \"" + squadronName + "\" to group."); return; } sobGroup.AddSquadron(squadron); }