Telerik.Web.Mvc.UI.StyleSheetRegistrar.Write C# (CSharp) Method

Write() protected method

Writes all stylesheet source.
protected Write ( TextWriter writer ) : void
writer System.IO.TextWriter The writer.
return void
        protected virtual void Write(TextWriter writer)
        {
            IList<string> mergedList = new List<string>();

            bool isSecured = ViewContext.HttpContext.Request.IsSecureConnection;
            bool canCompress = ViewContext.HttpContext.Request.CanCompress();

            Action<WebAssetItemCollection> append = assets =>
                                                    {
                                                        IList<string> result = AssetMerger.Merge("text/css", AssetHandlerPath, isSecured, canCompress, assets);

                                                        if (!result.IsNullOrEmpty())
                                                        {
                                                            mergedList.AddRange(result);
                                                        }
                                                    };

            if (!StyleSheets.IsEmpty())
            {
                append(StyleSheets);
            }

            if (!mergedList.IsEmpty())
            {
                foreach (string stylesheet in mergedList)
                {
                    writer.WriteLine("<link type=\"text/css\" href=\"{0}\" rel=\"stylesheet\"/>".FormatWith(stylesheet));
                }
            }
        }