public virtual string GetGKDescriptorName(GKNameGenerationType gkNameGenerationType) { var result = PresentationName; if (result == null) return ""; if (result.Length > 32) result = result.Substring(0, 32); return result.TrimEnd(' '); }
public override string GetGKDescriptorName(GKNameGenerationType gkNameGenerationType) { var result = ShortName + " " + DottedAddress; switch (gkNameGenerationType) { case GKNameGenerationType.DriverTypePlusAddressPlusDescription: if (!string.IsNullOrEmpty(Description)) result += "(" + Description + ")"; break; case GKNameGenerationType.Description: if (!string.IsNullOrEmpty(Description)) result = Description; break; case GKNameGenerationType.ProjectAddress: if (!string.IsNullOrEmpty(ProjectAddress)) result = ProjectAddress; break; case GKNameGenerationType.DescriptionOrProjectAddress: if (!string.IsNullOrEmpty(Description)) result = Description; else if (!string.IsNullOrEmpty(ProjectAddress)) result = ProjectAddress; break; case GKNameGenerationType.ProjectAddressOrDescription: if (!string.IsNullOrEmpty(ProjectAddress)) result = ProjectAddress; else if (!string.IsNullOrEmpty(Description)) result = Description; break; } if (result.Length > 32) result = result.Substring(0, 32); return result.TrimEnd(' '); }