Beispiel #1
0
 public static Javascript Load(string Id)
 {
     Javascript result = new Javascript ();
     result._filename = Path.GetFileNameWithoutExtension (Id) + SorentoLib.Services.Config.Get<string> (Enums.ConfigKey.scms_javascriptfileextension);
     return result;
 }
Beispiel #2
0
 public void AddJavascript(Javascript Javascript)
 {
     this._stylesheetids.Add (Javascript.Id);
 }
Beispiel #3
0
        public static Javascript FromXmlDocument(XmlDocument xmlDocument)
        {
            Hashtable item;
            Javascript result;

            try
            {
                item = (Hashtable)SNDK.Convert.FromXmlDocument (SNDK.Convert.XmlNodeToXmlDocument (xmlDocument.SelectSingleNode ("(//scms.javascript)[1]")));
            }
            catch
            {
                item = (Hashtable)SNDK.Convert.FromXmlDocument (xmlDocument);
            }

            if (item.ContainsKey ("id"))
            {
                try
                {
                    result = Load ((string)item["id"]);
                }
                catch
                {
                    result = new Javascript ((string)item["id"]);
                }
            }
            else
            {
                throw new Exception (Strings.Exception.StylesheetFromXMLDocument);
            }

            if (item.ContainsKey ("content"))
            {
                result.Content = (string)item["content"];
            }

            return result;
        }