/// <summary> /// Gets the license text with appropriate substitutions (e.g. year, owner) /// </summary> /// <returns>The finalised text of the license</returns> public string GetLicenseText() { var yearstring = ""; if (Years == null || Years.Length == 0) { yearstring = DateTime.Now.Year.ToString(); } else if (Years.Length == 1) { yearstring = Years.First().ToString(); } else if (ShowYearsAsRange) { yearstring = $"{Years.First()}-{Years.Last()}"; } else { yearstring = string.Join(", ", Years); } if (_type == LicenseType.Mit) { return(string.Format(Resources.MIT, Environment.NewLine, Copyright)); } if (_type == LicenseType.CustomOrNone) { return(_customLicense); } return(null); }