Esempio n. 1
0
        public void Install(Version lastInstalledVersion)
        {
            #region Install SQL
            if (lastInstalledVersion == null || lastInstalledVersion.Major == 0)
            {
                InternalApi.PollingDataService.Install();
            }

            if (lastInstalledVersion == null || lastInstalledVersion <= new Version(1, 1))
            {
                InternalApi.PollingDataService.Install("update-1.1.sql");
            }

            if (lastInstalledVersion == null || lastInstalledVersion <= new Version(1, 3))
            {
                InternalApi.PollingDataService.Install("update-1.3.sql");
            }

            InternalApi.PollingDataService.Install("storedprocedures.sql");
            #endregion

            #region Install Widgets

            _widgetProvider = Telligent.Evolution.Extensibility.Version1.PluginManager.Get <PollFactoryDefaultWidgetProvider>().FirstOrDefault();
            UIApi.FactoryDefaultScriptedContentFragmentProviderFiles.DeleteAllFiles(_widgetProvider);

            var definitionFiles = new string[] {
                "PollingBreadcrumbs-Widget.xml",
                "PollingCreateEditPoll-Widget.xml",
                "PollingLinks-Widget.xml",
                "PollingPoll-Widget.xml",
                "PollingPollList-Widget.xml",
                "PollingTitle-Widget.xml",
            };

            foreach (var definitionFile in definitionFiles)
            {
                using (var stream = InternalApi.EmbeddedResources.GetStream("Telligent.BigSocial.Polling.Resources.Widgets." + definitionFile))
                {
                    UIApi.FactoryDefaultScriptedContentFragmentProviderFiles.AddUpdateDefinitionFile(_widgetProvider, definitionFile, stream);
                }
            }

            var supplementaryFiles = new Dictionary <Guid, string[]>();
            supplementaryFiles[new Guid("86f521cd27fb43919261b3383c2ccb15")] = new string[] {
                "PollingCreateEditPoll/ui.js"
            };
            supplementaryFiles[new Guid("5f93753d405f4eca8faef2f9ed07b946")] = new string[] {
                "PollingPollList/pagedContent.vm"
            };

            foreach (var instanceId in supplementaryFiles.Keys)
            {
                foreach (var relativePath in supplementaryFiles[instanceId])
                {
                    using (var stream = InternalApi.EmbeddedResources.GetStream("Telligent.BigSocial.Polling.Resources.Widgets." + relativePath.Replace("/", ".")))
                    {
                        UIApi.FactoryDefaultScriptedContentFragmentProviderFiles.AddUpdateSupplementaryFile(_widgetProvider, instanceId, relativePath.Substring(relativePath.LastIndexOf("/", StringComparison.InvariantCultureIgnoreCase) + 1), stream);
                    }
                }
            }

            foreach (var theme in UIApi.Themes.List(UIApi.ThemeTypes.Group))
            {
                //if fiji theme is found install fiji version widgets
                if (theme.Name == "7e987e474b714b01ba29b4336720c446" || theme.Name == "424eb7d9138d417b994b64bff44bf274")
                {
                    if (theme.Name == "7e987e474b714b01ba29b4336720c446")
                    {
                        definitionFiles = new string[] {
                            "PollingPoll-Fiji-Widget.xml",
                            "PollingCreateEditPoll-Fiji-Widget.xml",
                            "PollingPollList-Fiji-Widget.xml"
                        };
                    }
                    else if (theme.Name == "424eb7d9138d417b994b64bff44bf274")
                    {
                        definitionFiles = new string[] {
                            "PollingPoll-Enterprise-Widget.xml",
                            "PollingCreateEditPoll-Enterprise-Widget.xml",
                            "PollingPollList-Enterprise-Widget.xml"
                        };
                    }

                    foreach (var definitionFile in definitionFiles)
                    {
                        using (var stream = InternalApi.EmbeddedResources.GetStream("Telligent.BigSocial.Polling.Resources.Widgets." + definitionFile))
                        {
                            UIApi.FactoryDefaultScriptedContentFragmentProviderFiles.AddUpdateDefinitionFile(_widgetProvider, definitionFile, stream);
                        }
                    }

                    //Enterprise and Fiji supplementary files are identical, installing the Fiji versions for both themes.
                    supplementaryFiles = new Dictionary <Guid, string[]>();
                    supplementaryFiles[new Guid("86f521cd27fb43919261b3383c2ccb15")] = new string[] {
                        "PollingCreateEditPollFiji/ui.js"
                    };

                    supplementaryFiles[new Guid("86f521cd27fb43919261b3383c2ccb15")] = new string[] {
                        "PollingPollListFiji/pagedContent.vm"
                    };

                    foreach (var instanceId in supplementaryFiles.Keys)
                    {
                        foreach (var relativePath in supplementaryFiles[instanceId])
                        {
                            using (var stream = InternalApi.EmbeddedResources.GetStream("Telligent.BigSocial.Polling.Resources.Widgets." + relativePath.Replace("/", ".")))
                            {
                                UIApi.FactoryDefaultScriptedContentFragmentProviderFiles.AddUpdateSupplementaryFile(_widgetProvider, instanceId, theme.Name, relativePath.Substring(relativePath.LastIndexOf("/", StringComparison.InvariantCultureIgnoreCase) + 1), stream);
                            }
                        }
                    }
                }
            }

            #endregion

            #region Install latest version of the poll page into all group themes (and revert any configured defaults or contextul versions of these pages)

            XmlDocument xml;
            foreach (var theme in UIApi.Themes.List(UIApi.ThemeTypes.Group))
            {
                var themeName = String.Empty;
                if (theme.Name == "7e987e474b714b01ba29b4336720c446")
                {
                    themeName = "Fiji";
                }
                else if (theme.Name == "424eb7d9138d417b994b64bff44bf274")
                {
                    themeName = "Enterprise";
                }

                if (!String.IsNullOrEmpty(themeName))
                {
                    if (theme.IsConfigurationBased)
                    {
                        xml = new XmlDocument();
                        xml.LoadXml(InternalApi.EmbeddedResources.GetString("Telligent.BigSocial.Polling.Resources.Pages.createeditpoll-" + themeName + "-Groups-Page.xml"));
                        UIApi.ThemePages.AddUpdateFactoryDefault(theme, xml.SelectSingleNode("theme/contentFragmentPages/contentFragmentPage"));

                        xml = new XmlDocument();
                        xml.LoadXml(InternalApi.EmbeddedResources.GetString("Telligent.BigSocial.Polling.Resources.Pages.poll-" + themeName + "-Groups-Page.xml"));
                        UIApi.ThemePages.AddUpdateFactoryDefault(theme, xml.SelectSingleNode("theme/contentFragmentPages/contentFragmentPage"));

                        xml = new XmlDocument();
                        xml.LoadXml(InternalApi.EmbeddedResources.GetString("Telligent.BigSocial.Polling.Resources.Pages.polls-" + themeName + "-Groups-Page.xml"));
                        UIApi.ThemePages.AddUpdateFactoryDefault(theme, xml.SelectSingleNode("theme/contentFragmentPages/contentFragmentPage"));

                        UIApi.ThemePages.DeleteDefault(theme, "createeditpoll", true);
                        UIApi.ThemePages.DeleteDefault(theme, "poll", true);
                        UIApi.ThemePages.DeleteDefault(theme, "polls", true);
                    }
                    else
                    {
                        // non-configured-based themes don't support editing factory default pages.

                        xml = new XmlDocument();
                        xml.LoadXml(InternalApi.EmbeddedResources.GetString("Telligent.BigSocial.Polling.Resources.Pages.createeditpoll-" + themeName + "-Groups-Page.xml"));
                        UIApi.ThemePages.AddUpdateDefault(theme, xml.SelectSingleNode("theme/contentFragmentPages/contentFragmentPage"));

                        xml = new XmlDocument();
                        xml.LoadXml(InternalApi.EmbeddedResources.GetString("Telligent.BigSocial.Polling.Resources.Pages.poll-" + themeName + "-Groups-Page.xml"));
                        UIApi.ThemePages.AddUpdateDefault(theme, xml.SelectSingleNode("theme/contentFragmentPages/contentFragmentPage"));

                        xml = new XmlDocument();
                        xml.LoadXml(InternalApi.EmbeddedResources.GetString("Telligent.BigSocial.Polling.Resources.Pages.polls-" + themeName + "-Groups-Page.xml"));
                        UIApi.ThemePages.AddUpdateDefault(theme, xml.SelectSingleNode("theme/contentFragmentPages/contentFragmentPage"));
                    }

                    UIApi.ThemePages.Delete(theme, "createeditpoll", true);
                    UIApi.ThemePages.Delete(theme, "poll", true);
                    UIApi.ThemePages.Delete(theme, "polls", true);
                }
            }

            xml = null;
            foreach (var theme in UIApi.Themes.List(UIApi.ThemeTypes.Site))
            {
                var themeName = String.Empty;
                if (theme.Name == "7e987e474b714b01ba29b4336720c446")
                {
                    themeName = "Fiji";
                }
                else if (theme.Name == "424eb7d9138d417b994b64bff44bf274")
                {
                    themeName = "Enterprise";
                }

                if (!String.IsNullOrEmpty(themeName))
                {
                    if (theme.IsConfigurationBased)
                    {
                        xml = new XmlDocument();
                        xml.LoadXml(InternalApi.EmbeddedResources.GetString("Telligent.BigSocial.Polling.Resources.Pages.user-polllist-" + themeName + "-Page.xml"));
                        UIApi.ThemePages.AddUpdateFactoryDefault(theme, xml.SelectSingleNode("theme/contentFragmentPages/contentFragmentPage"));

                        UIApi.ThemePages.DeleteDefault(theme, "user-polllist", true);
                    }
                    else
                    {
                        // non-configured-based themes don't support editing factory default pages.

                        xml = new XmlDocument();
                        xml.LoadXml(InternalApi.EmbeddedResources.GetString("Telligent.BigSocial.Polling.Resources.Pages.user-polllist-" + themeName + "-Page.xml"));
                        UIApi.ThemePages.AddUpdateDefault(theme, xml.SelectSingleNode("theme/contentFragmentPages/contentFragmentPage"));
                    }

                    UIApi.ThemePages.Delete(theme, "user-polllist", true);
                }
            }

            #endregion

            #region Install CSS Files

            foreach (var theme in UIApi.Themes.List(UIApi.ThemeTypes.Site))
            {
                if (theme.IsConfigurationBased)
                {
                    var themeName = "Social";
                    if (theme.Name == "7e987e474b714b01ba29b4336720c446")
                    {
                        themeName = "Fiji";
                    }
                    else if (theme.Name == "424eb7d9138d417b994b64bff44bf274")
                    {
                        themeName = "Enterprise";
                    }

                    if (themeName != "Social")
                    {
                        using (var stream = InternalApi.EmbeddedResources.GetStream("Telligent.BigSocial.Polling.Resources.Css.polling-" + themeName + ".css"))
                        {
                            if (stream != null)
                            {
                                UIApi.ThemeFiles.AddUpdateFactoryDefault(theme, UIApi.ThemeProperties.CssFiles, "polling.css", stream, (int)stream.Length);
                                stream.Seek(0, System.IO.SeekOrigin.Begin);
                                UIApi.ThemeFiles.AddUpdate(theme, UIApi.ThemeableApplicationIds.Site, UIApi.ThemeProperties.CssFiles, "polling.css", stream, (int)stream.Length);
                            }
                        }
                    }

                    else
                    {
                        using (var stream = InternalApi.EmbeddedResources.GetStream("Telligent.BigSocial.Polling.Resources.Css.polling-" + themeName + ".css"))
                        {
                            if (stream != null)
                            {
                                UIApi.ThemeFiles.AddUpdateFactoryDefault(theme, UIApi.ThemeProperties.CssFiles, "polling.css", stream, (int)stream.Length);
                                stream.Seek(0, System.IO.SeekOrigin.Begin);
                                UIApi.ThemeFiles.AddUpdate(theme, UIApi.ThemeableApplicationIds.Site, UIApi.ThemeProperties.CssFiles, "polling.css", stream, (int)stream.Length);
                            }
                        }

                        //using (var stream = InternalApi.EmbeddedResources.GetStream("Telligent.BigSocial.Polling.Resources.Css.polling-handheld-" + themeName + ".css"))
                        //{
                        //    if (stream != null)
                        //    {
                        //        UIApi.ThemeFiles.AddUpdateFactoryDefault(theme, UIApi.ThemeProperties.CssFiles, "polling-handheld.css", stream, (int) stream.Length,
                        //            new UIApi.CssThemeFileOptions() { MediaQuery = "(max-width: 570px)", ApplyToModals = true, ApplyToNonModals = true });
                        //        stream.Seek(0, System.IO.SeekOrigin.Begin);
                        //        UIApi.ThemeFiles.AddUpdate(theme, UIApi.ThemeableApplicationIds.Site, UIApi.ThemeProperties.CssFiles, "polling-handheld.css", stream, (int) stream.Length,
                        //            new UIApi.CssThemeFileOptions() { MediaQuery = "(max-width: 570px)", ApplyToModals = true, ApplyToNonModals = true });
                        //    }
                        //}
                    }
                }
            }

            #endregion
        }
        public void Install(Version lastInstalledVersion)
        {
            #region Install SQL
            if (lastInstalledVersion == null || lastInstalledVersion.Major == 0)
                InternalApi.PollingDataService.Install();

            if (lastInstalledVersion == null || lastInstalledVersion <= new Version(1, 1))
                InternalApi.PollingDataService.Install("update-1.1.sql");

            if (lastInstalledVersion == null || lastInstalledVersion <= new Version(1, 3))
                InternalApi.PollingDataService.Install("update-1.3.sql");

            InternalApi.PollingDataService.Install("storedprocedures.sql");
            #endregion

            #region Install Widgets

            _widgetProvider = Telligent.Evolution.Extensibility.Version1.PluginManager.Get<PollFactoryDefaultWidgetProvider>().FirstOrDefault();
            UIApi.FactoryDefaultScriptedContentFragmentProviderFiles.DeleteAllFiles(_widgetProvider);

            var definitionFiles = new string[] {
                "PollingBreadcrumbs-Widget.xml",
                "PollingCreateEditPoll-Widget.xml",
                "PollingLinks-Widget.xml",
                "PollingPoll-Widget.xml",
                "PollingPollList-Widget.xml",
                "PollingTitle-Widget.xml",
            };

            foreach (var definitionFile in definitionFiles)
            {
                using (var stream = InternalApi.EmbeddedResources.GetStream("Telligent.BigSocial.Polling.Resources.Widgets." + definitionFile))
                {
                    UIApi.FactoryDefaultScriptedContentFragmentProviderFiles.AddUpdateDefinitionFile(_widgetProvider, definitionFile, stream);
                }
            }

            var supplementaryFiles = new Dictionary<Guid,string[]>();
            supplementaryFiles[new Guid("86f521cd27fb43919261b3383c2ccb15")] = new string[] {
                "PollingCreateEditPoll/ui.js"
            };
            supplementaryFiles[new Guid("5f93753d405f4eca8faef2f9ed07b946")] = new string[] {
                "PollingPollList/pagedContent.vm"
            };

            foreach (var instanceId in supplementaryFiles.Keys)
            {
                foreach (var relativePath in supplementaryFiles[instanceId])
                {
                    using (var stream = InternalApi.EmbeddedResources.GetStream("Telligent.BigSocial.Polling.Resources.Widgets." + relativePath.Replace("/", ".")))
                    {
                        UIApi.FactoryDefaultScriptedContentFragmentProviderFiles.AddUpdateSupplementaryFile(_widgetProvider, instanceId, relativePath.Substring(relativePath.LastIndexOf("/", StringComparison.InvariantCultureIgnoreCase) + 1), stream);
                    }
                }
            }

            foreach (var theme in UIApi.Themes.List(UIApi.ThemeTypes.Group))
            {
                //if fiji theme is found install fiji version widgets
                if (theme.Name == "7e987e474b714b01ba29b4336720c446" || theme.Name == "424eb7d9138d417b994b64bff44bf274")
                {
                    if (theme.Name == "7e987e474b714b01ba29b4336720c446")
                    {
                        definitionFiles = new string[] {
                            "PollingPoll-Fiji-Widget.xml",
                            "PollingCreateEditPoll-Fiji-Widget.xml",
               				"PollingPollList-Fiji-Widget.xml"
                        };
                    }
                    else if (theme.Name == "424eb7d9138d417b994b64bff44bf274")
                    {
                        definitionFiles = new string[] {
                            "PollingPoll-Enterprise-Widget.xml",
                            "PollingCreateEditPoll-Enterprise-Widget.xml",
               				"PollingPollList-Enterprise-Widget.xml"
                        };
                    }

                    foreach (var definitionFile in definitionFiles)
                    {
                        using (var stream = InternalApi.EmbeddedResources.GetStream("Telligent.BigSocial.Polling.Resources.Widgets." + definitionFile))
                        {
                            UIApi.FactoryDefaultScriptedContentFragmentProviderFiles.AddUpdateDefinitionFile(_widgetProvider, definitionFile, stream);
                        }
                    }

                    //Enterprise and Fiji supplementary files are identical, installing the Fiji versions for both themes.
                    supplementaryFiles = new Dictionary<Guid, string[]>();
                    supplementaryFiles[new Guid("86f521cd27fb43919261b3383c2ccb15")] = new string[] {
                        "PollingCreateEditPollFiji/ui.js"
                    };

                    supplementaryFiles[new Guid("86f521cd27fb43919261b3383c2ccb15")] = new string[] {
                        "PollingPollListFiji/pagedContent.vm"
                    };

                    foreach (var instanceId in supplementaryFiles.Keys)
                    {
                        foreach (var relativePath in supplementaryFiles[instanceId])
                        {
                            using (var stream = InternalApi.EmbeddedResources.GetStream("Telligent.BigSocial.Polling.Resources.Widgets." + relativePath.Replace("/", ".")))
                            {
                                UIApi.FactoryDefaultScriptedContentFragmentProviderFiles.AddUpdateSupplementaryFile(_widgetProvider, instanceId, theme.Name, relativePath.Substring(relativePath.LastIndexOf("/", StringComparison.InvariantCultureIgnoreCase) + 1), stream);
                            }
                        }
                    }
                }
            }

            #endregion

            #region Install latest version of the poll page into all group themes (and revert any configured defaults or contextul versions of these pages)

            XmlDocument xml;
            foreach (var theme in UIApi.Themes.List(UIApi.ThemeTypes.Group))
            {
                var themeName = String.Empty;
                if (theme.Name == "7e987e474b714b01ba29b4336720c446")
                    themeName = "Fiji";
                else if (theme.Name == "424eb7d9138d417b994b64bff44bf274")
                    themeName = "Enterprise";

                if (!String.IsNullOrEmpty(themeName))
                {
                    if (theme.IsConfigurationBased)
                    {
                        xml = new XmlDocument();
                        xml.LoadXml(InternalApi.EmbeddedResources.GetString("Telligent.BigSocial.Polling.Resources.Pages.createeditpoll-" + themeName + "-Groups-Page.xml"));
                        UIApi.ThemePages.AddUpdateFactoryDefault(theme, xml.SelectSingleNode("theme/contentFragmentPages/contentFragmentPage"));

                        xml = new XmlDocument();
                        xml.LoadXml(InternalApi.EmbeddedResources.GetString("Telligent.BigSocial.Polling.Resources.Pages.poll-" + themeName + "-Groups-Page.xml"));
                        UIApi.ThemePages.AddUpdateFactoryDefault(theme, xml.SelectSingleNode("theme/contentFragmentPages/contentFragmentPage"));

                        xml = new XmlDocument();
                        xml.LoadXml(InternalApi.EmbeddedResources.GetString("Telligent.BigSocial.Polling.Resources.Pages.polls-" + themeName + "-Groups-Page.xml"));
                        UIApi.ThemePages.AddUpdateFactoryDefault(theme, xml.SelectSingleNode("theme/contentFragmentPages/contentFragmentPage"));

                        UIApi.ThemePages.DeleteDefault(theme, "createeditpoll", true);
                        UIApi.ThemePages.DeleteDefault(theme, "poll", true);
                        UIApi.ThemePages.DeleteDefault(theme, "polls", true);
                    }
                    else
                    {
                        // non-configured-based themes don't support editing factory default pages.

                        xml = new XmlDocument();
                        xml.LoadXml(InternalApi.EmbeddedResources.GetString("Telligent.BigSocial.Polling.Resources.Pages.createeditpoll-" + themeName + "-Groups-Page.xml"));
                        UIApi.ThemePages.AddUpdateDefault(theme, xml.SelectSingleNode("theme/contentFragmentPages/contentFragmentPage"));

                        xml = new XmlDocument();
                        xml.LoadXml(InternalApi.EmbeddedResources.GetString("Telligent.BigSocial.Polling.Resources.Pages.poll-" + themeName + "-Groups-Page.xml"));
                        UIApi.ThemePages.AddUpdateDefault(theme, xml.SelectSingleNode("theme/contentFragmentPages/contentFragmentPage"));

                        xml = new XmlDocument();
                        xml.LoadXml(InternalApi.EmbeddedResources.GetString("Telligent.BigSocial.Polling.Resources.Pages.polls-" + themeName + "-Groups-Page.xml"));
                        UIApi.ThemePages.AddUpdateDefault(theme, xml.SelectSingleNode("theme/contentFragmentPages/contentFragmentPage"));
                    }

                    UIApi.ThemePages.Delete(theme, "createeditpoll", true);
                    UIApi.ThemePages.Delete(theme, "poll", true);
                    UIApi.ThemePages.Delete(theme, "polls", true);
                }
            }

            xml = null;
            foreach (var theme in UIApi.Themes.List(UIApi.ThemeTypes.Site))
            {
                var themeName = String.Empty;
                if (theme.Name == "7e987e474b714b01ba29b4336720c446")
                    themeName = "Fiji";
                else if (theme.Name == "424eb7d9138d417b994b64bff44bf274")
                    themeName = "Enterprise";

                if (!String.IsNullOrEmpty(themeName))
                {
                    if (theme.IsConfigurationBased)
                    {
                        xml = new XmlDocument();
                        xml.LoadXml(InternalApi.EmbeddedResources.GetString("Telligent.BigSocial.Polling.Resources.Pages.user-polllist-" + themeName + "-Page.xml"));
                        UIApi.ThemePages.AddUpdateFactoryDefault(theme, xml.SelectSingleNode("theme/contentFragmentPages/contentFragmentPage"));

                        UIApi.ThemePages.DeleteDefault(theme, "user-polllist", true);
                    }
                    else
                    {
                        // non-configured-based themes don't support editing factory default pages.

                        xml = new XmlDocument();
                        xml.LoadXml(InternalApi.EmbeddedResources.GetString("Telligent.BigSocial.Polling.Resources.Pages.user-polllist-" + themeName + "-Page.xml"));
                        UIApi.ThemePages.AddUpdateDefault(theme, xml.SelectSingleNode("theme/contentFragmentPages/contentFragmentPage"));
                    }

                    UIApi.ThemePages.Delete(theme, "user-polllist", true);
               }
               }

            #endregion

            #region Install CSS Files

            foreach (var theme in UIApi.Themes.List(UIApi.ThemeTypes.Site))
            {
                if (theme.IsConfigurationBased)
                {
                    var themeName = "Social";
                    if (theme.Name == "7e987e474b714b01ba29b4336720c446")
                        themeName = "Fiji";
                    else if (theme.Name == "424eb7d9138d417b994b64bff44bf274")
                        themeName = "Enterprise";

                    if (themeName != "Social")
                    {
                        using (var stream = InternalApi.EmbeddedResources.GetStream("Telligent.BigSocial.Polling.Resources.Css.polling-" + themeName + ".css"))
                        {
                            if (stream != null)
                            {
                                UIApi.ThemeFiles.AddUpdateFactoryDefault(theme, UIApi.ThemeProperties.CssFiles, "polling.css", stream, (int) stream.Length);
                                stream.Seek(0, System.IO.SeekOrigin.Begin);
                                UIApi.ThemeFiles.AddUpdate(theme, UIApi.ThemeableApplicationIds.Site, UIApi.ThemeProperties.CssFiles, "polling.css", stream, (int) stream.Length);
                            }
                        }
                    }

                    else
                    {
                        using (var stream = InternalApi.EmbeddedResources.GetStream("Telligent.BigSocial.Polling.Resources.Css.polling-" + themeName + ".css"))
                        {
                            if (stream != null)
                            {
                                UIApi.ThemeFiles.AddUpdateFactoryDefault(theme, UIApi.ThemeProperties.CssFiles, "polling.css", stream, (int)stream.Length);
                                stream.Seek(0, System.IO.SeekOrigin.Begin);
                                UIApi.ThemeFiles.AddUpdate(theme, UIApi.ThemeableApplicationIds.Site, UIApi.ThemeProperties.CssFiles, "polling.css", stream, (int)stream.Length);
                            }
                        }

                        //using (var stream = InternalApi.EmbeddedResources.GetStream("Telligent.BigSocial.Polling.Resources.Css.polling-handheld-" + themeName + ".css"))
                        //{
                        //    if (stream != null)
                        //    {
                        //        UIApi.ThemeFiles.AddUpdateFactoryDefault(theme, UIApi.ThemeProperties.CssFiles, "polling-handheld.css", stream, (int) stream.Length,
                        //            new UIApi.CssThemeFileOptions() { MediaQuery = "(max-width: 570px)", ApplyToModals = true, ApplyToNonModals = true });
                        //        stream.Seek(0, System.IO.SeekOrigin.Begin);
                        //        UIApi.ThemeFiles.AddUpdate(theme, UIApi.ThemeableApplicationIds.Site, UIApi.ThemeProperties.CssFiles, "polling-handheld.css", stream, (int) stream.Length,
                        //            new UIApi.CssThemeFileOptions() { MediaQuery = "(max-width: 570px)", ApplyToModals = true, ApplyToNonModals = true });
                        //    }
                        //}
                    }
                }
            }

            #endregion
        }
Esempio n. 3
0
 public void Initialize()
 {
     _widgetProvider = Telligent.Evolution.Extensibility.Version1.PluginManager.Get <PollFactoryDefaultWidgetProvider>().FirstOrDefault();
 }
 public void Initialize()
 {
     _widgetProvider = Telligent.Evolution.Extensibility.Version1.PluginManager.Get<PollFactoryDefaultWidgetProvider>().FirstOrDefault();
 }