Example #1
0
        public void ProcessCSS(string filename, EventHandler e)
        {
            if (!_cssObjects.ContainsKey(filename))
            {
                string filePath = CssPath + filename + ".css?" + Date.Now.GetMilliseconds().ToString();

                //jQuery.Get(filePath, delegate(object css)
                //{
                //    string current = jQuery.Select("style").GetHtml();
                //    jQuery.Select("style").Html(current + (string)css);
                //    e.Invoke(this, null);
                //});

                Element fileref = Document.CreateElement("link");
                fileref.SetAttribute("rel", "stylesheet");
                fileref.SetAttribute("type", "text/css");
                fileref.SetAttribute("href", CssPath + filename + ".css?" + Date.Now.GetMilliseconds().ToString());
                Document.GetElementsByTagName("head")[0].AppendChild(fileref);
                _cssObjects.Add(filename, fileref);
                //_loadedCss.Add(filename);
                if (e != null)
                {
                    e.Invoke(this, null);
                }
            }
            else
            {
                Logging.Debug("Already Processed CSS File", new object[] { filename });
                if (e != null)
                {
                    e.Invoke(this, null);
                }
            }
        }
Example #2
0
 public static void AddLogEvent(LoggingType logType, LogEventHandler e)
 {
     if (_logEvents == null)
     {
         _logEvents = new RealDictionary();
     }
     if (!_logEvents.ContainsKey(logType))
     {
         _logEvents.Add(logType, new List <LogEventHandler>());
     }
     ((List <LogEventHandler>)_logEvents[logType]).Add(e);
 }