public CompositeLicenseExpressionSegmentViewModel(CompositeLicenseExpressionSegment segment) { if (segment == null) { throw new ArgumentNullException(nameof(segment)); } Value = segment.Value; IsLicenseOrException = segment.Type == CompositeLicenseExpressionSegmentType.LicenseIdentifier || segment.Type == CompositeLicenseExpressionSegmentType.ExceptionIdentifier; if (IsLicenseOrException) { LicenseUrl = LicenseExpressionRedirectUrlHelper.GetLicenseExpressionRedirectUrl(segment.Value); } else { LicenseUrl = null; } }
private bool IsLicenseOrException(CompositeLicenseExpressionSegment segment) => segment.Type == CompositeLicenseExpressionSegmentType.LicenseIdentifier || segment.Type == CompositeLicenseExpressionSegmentType.ExceptionIdentifier;