public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { if (value != default(object)) { Dynamics365Team team = (Dynamics365Team)value; return(string.Format("{0} ({1})", team.Name, team.ID.ToString())); } return(base.ConvertTo(context, culture, value, destinationType)); }
/// <summary> /// Compares the object with another TeamInfo object. /// </summary> /// <param name="other">The other TeamInfo object.</param> /// <returns>The comparison result.</returns> public int CompareTo(Dynamics365Team other) { if (other == null) { return(1); } else { return(Name.CompareTo(other.Name)); } }
/// <summary> /// Gets a list of Dynamics 365 teams. /// </summary> /// <returns>A list of Dynamics365Team objects.</returns> public List <Dynamics365Team> GetTeams() { List <Dynamics365Team> teams = new List <Dynamics365Team>(); try { teams.AddRange(Dynamics365Team.GetTeams(Connection).ToList()); } catch { } return(teams); }