示例#1
0
        private static XmlDocument RetrieveXml()
        {
            WidgetSettings ws = new WidgetSettings("be_WIDGET_ZONE");

            ws.SettingsBehavior = new XMLDocumentBehavior();
            XmlDocument doc = (XmlDocument)ws.GetSettings();

            return(doc);
        }
示例#2
0
        private XmlDocument RetrieveXml()
        {
            WidgetSettings ws = new WidgetSettings(_ZoneName);

            ws.SettingsBehavior = new XMLDocumentBehavior();
            XmlDocument doc = (XmlDocument)ws.GetSettings();

            return(doc);
        }
示例#3
0
        private static XmlDocument RetrieveXml(string zoneName)
        {
            var ws = new WidgetSettings(zoneName)
            {
                SettingsBehavior = new XmlDocumentBehavior()
            };
            var doc = (XmlDocument)ws.GetSettings();

            return(doc);
        }
示例#4
0
    /// <summary>
    /// Get settings from data store
    /// </summary>
    /// <returns>Settings</returns>
    public StringDictionary GetSettings()
    {
        string cacheId = "be_widget_" + WidgetID;

        if (Cache[cacheId] == null)
        {
            WidgetSettings ws = new WidgetSettings(WidgetID.ToString());
            Cache[cacheId] = (StringDictionary)ws.GetSettings();
        }
        return((StringDictionary)Cache[cacheId]);
    }
示例#5
0
        /// <summary>
        /// Gets widget settings
        /// </summary>
        /// <param name="id">Widget ID</param>
        /// <returns>Settings object</returns>
        public static StringDictionary GetSettings(string id)
        {
            var cacheId = $"be_widget_{id}";

            if (Blog.CurrentInstance.Cache[cacheId] == null)
            {
                var ws = new WidgetSettings(id);
                Blog.CurrentInstance.Cache[cacheId] = ws.GetSettings();
            }
            return((StringDictionary)Blog.CurrentInstance.Cache[cacheId]);
        }
        /// <summary>
        /// Get settings from data store
        /// </summary>
        /// <returns>
        /// The settings
        /// </returns>
        public StringDictionary GetSettings()
        {
            var cacheId = string.Format("be_widget_{0}", this.WidgetId);

            if (Blog.CurrentInstance.Cache[cacheId] == null)
            {
                var ws = new WidgetSettings(this.WidgetId.ToString());
                Blog.CurrentInstance.Cache[cacheId] = ws.GetSettings();
            }

            return((StringDictionary)Blog.CurrentInstance.Cache[cacheId]);
        }
示例#7
0
        /// <summary>
        /// Get settings from data store
        /// </summary>
        /// <returns>
        /// The settings
        /// </returns>
        public StringDictionary GetSettings()
        {
            var cacheId = string.Format("be_widget_{0}", this.WidgetId);

            if (Blog.CurrentInstance.Cache[cacheId] == null)
            {
                var ws = new WidgetSettings(this.WidgetId.ToString());
                Blog.CurrentInstance.Cache[cacheId] = ws.GetSettings();
            }
            if (this.WidgetId.ToString() == "000dedbe-1801-466e-96b7-bda022750886")
            {
            }
            return((StringDictionary)Blog.CurrentInstance.Cache[cacheId]);
        }
示例#8
0
    /// <summary>
    /// Gets the XML document.
    /// </summary>
    /// <param name="zone">The zone Xml Document to get.</param>
    /// <returns></returns>
    private XmlDocument GetXmlDocument(string zone)
    {
        XmlDocument doc;

        if (Cache[zone] == null)
        {
            WidgetSettings ws = new WidgetSettings(zone);
            ws.SettingsBehavior = new XMLDocumentBehavior();
            doc = (XmlDocument)ws.GetSettings();
            if (doc.SelectSingleNode("widgets") == null)
            {
                XmlNode widgets = doc.CreateElement("widgets");
                doc.AppendChild(widgets);
            }
            Cache[zone] = doc;
        }
        return((XmlDocument)Cache[zone]);
    }
        /// <summary>
        /// Gets the XML document.
        /// </summary>
        /// <param name="zone">
        /// The zone Xml Document to get.
        /// </param>
        /// <returns>
        /// An Xml Document.
        /// </returns>
        private XmlDocument GetXmlDocument(string zone)
        {
            XmlDocument doc;

            if (Blog.CurrentInstance.Cache[zone] == null)
            {
                var ws = new WidgetSettings(zone)
                {
                    SettingsBehavior = new XmlDocumentBehavior()
                };
                doc = (XmlDocument)ws.GetSettings();
                if (doc.SelectSingleNode("widgets") == null)
                {
                    XmlNode widgets = doc.CreateElement("widgets");
                    doc.AppendChild(widgets);
                }

                Blog.CurrentInstance.Cache[zone] = doc;
            }

            return((XmlDocument)Blog.CurrentInstance.Cache[zone]);
        }