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;
            }
        }
コード例 #2
0
 private bool IsLicenseOrException(CompositeLicenseExpressionSegment segment) => segment.Type == CompositeLicenseExpressionSegmentType.LicenseIdentifier || segment.Type == CompositeLicenseExpressionSegmentType.ExceptionIdentifier;