mirror of https://github.com/abpframework/abp.git
6 changed files with 69 additions and 37 deletions
@ -0,0 +1,26 @@ |
|||
using System; |
|||
using JetBrains.Annotations; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers |
|||
{ |
|||
public class BundleTagHelperContributorTypeItem : BundleTagHelperItem |
|||
{ |
|||
[NotNull] |
|||
public Type Type { get; } |
|||
|
|||
public BundleTagHelperContributorTypeItem([NotNull] Type type) |
|||
{ |
|||
Type = Check.NotNull(type, nameof(type)); |
|||
} |
|||
|
|||
public override string ToString() |
|||
{ |
|||
return Type.FullName; |
|||
} |
|||
|
|||
public override void AddToConfiguration(BundleConfiguration configuration) |
|||
{ |
|||
configuration.AddContributors(Type); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
using JetBrains.Annotations; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers |
|||
{ |
|||
public class BundleTagHelperFileItem : BundleTagHelperItem |
|||
{ |
|||
[NotNull] |
|||
public string File { get; } |
|||
|
|||
public BundleTagHelperFileItem([NotNull] string file) |
|||
{ |
|||
File = Check.NotNull(file, nameof(file)); |
|||
} |
|||
|
|||
public override string ToString() |
|||
{ |
|||
return File; |
|||
} |
|||
|
|||
public override void AddToConfiguration(BundleConfiguration configuration) |
|||
{ |
|||
configuration.AddFiles(File); |
|||
} |
|||
} |
|||
} |
|||
@ -1,38 +1,7 @@ |
|||
using System; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers |
|||
namespace Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers |
|||
{ |
|||
public class BundleTagHelperItem |
|||
public abstract class BundleTagHelperItem |
|||
{ |
|||
public string File { get; } |
|||
|
|||
public Type Type { get; } |
|||
|
|||
public BundleTagHelperItem(string file) |
|||
{ |
|||
File = file; |
|||
} |
|||
|
|||
public BundleTagHelperItem(Type type) |
|||
{ |
|||
Type = type; |
|||
} |
|||
|
|||
public override string ToString() |
|||
{ |
|||
return File ?? Type.FullName ?? "?"; |
|||
} |
|||
|
|||
public void AddToConfiguration(BundleConfiguration configuration) |
|||
{ |
|||
if (File != null) |
|||
{ |
|||
configuration.AddFiles(File); |
|||
} |
|||
else if (Type != null) |
|||
{ |
|||
configuration.AddContributors(Type); |
|||
} |
|||
} |
|||
public abstract void AddToConfiguration(BundleConfiguration configuration); |
|||
} |
|||
} |
|||
Loading…
Reference in new issue