Files
Disco/Disco.Services/Plugins/Features/UIExtension/Results/PluginResourceCssResult.cs
T
Gary Sharp 4cd57f4a90 Update: SignalR 2.0.3 Migration; Noticeboards
Migrate all SignalR 1.x Persistent Connections to SignalR 2.x Hubs.
Abstracts ScheduledTaskStatus with core interface and adds a Mock for
optional status reporting. Noticeboards rewritten (with new theme) to be
more resilient and accurate.
2014-06-01 23:27:07 +10:00

40 lines
1.2 KiB
C#

using Disco.Services.Web.Bundles;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
namespace Disco.Services.Plugins.Features.UIExtension.Results
{
public class PluginResourceCssResult : UIExtensionResult
{
private string _resource;
private string _resourceUrl;
public PluginResourceCssResult(PluginFeatureManifest Source, string Resource)
: base(Source)
{
this._resource = Resource;
this._resourceUrl = Source.PluginManifest.WebResourceUrl(Resource);
var deferredBundles = HttpContext.Current.Items[BundleTable.UIExtensionCssKey] as List<string>;
if (deferredBundles == null)
{
deferredBundles = new List<string>();
HttpContext.Current.Items[BundleTable.UIExtensionCssKey] = deferredBundles;
}
if (!deferredBundles.Contains(this._resourceUrl))
deferredBundles.Add(this._resourceUrl);
}
public override void ExecuteResult<T>(System.Web.Mvc.WebViewPage<T> page)
{
// Nothing Done
}
}
}