Configures the detection section. This class cannot be inherited.
Inheritance: System.Configuration.ConfigurationSection
 static Manager()
 {
     _configurationSection = Support.GetWebApplicationSection("fiftyOne/detection", false) as DetectionSection;
     if (_configurationSection == null)
     {
         _configurationSection = new DetectionSection();
     }
 }
        /// <summary>
        /// Sets the shared usage value.
        /// </summary>
        /// <param name="value"></param>
        private static void SetShareUsage(bool value)
        {
            DetectionSection element = GetDetectionElement();

            element.ShareUsage = value;
            Support.SetWebApplicationSection(element);
            Refresh();
        }
        /// <summary>
        /// Creates a new configuration instance checking for
        /// fresh data.
        /// </summary>
        internal static void Refresh()
        {
            // Ensure the managers detection section is refreshed in case the
            // process is not going to restart as a result of the change.
            ConfigurationManager.RefreshSection("fiftyOne/detection");

            _configurationSection = Support.GetWebApplicationSection("fiftyOne/detection", false) as DetectionSection;
        }
        /// <summary>
        /// Sets the memory mode value.
        /// </summary>
        /// <param name="value"></param>
        private static void SetMemoryMode(bool value)
        {
            DetectionSection element = GetDetectionElement();

            element.MemoryMode = value;
            Support.SetWebApplicationSection(element);
            Refresh();
        }
        /// <summary>
        /// Sets the shared usage value.
        /// </summary>
        /// <param name="value"></param>
        private static void SetAutoUpdate(bool value)
        {
            DetectionSection element = GetDetectionElement();

            element.AutoUpdate = value;
            Support.SetWebApplicationSection(element);
            Refresh();
        }
        /// <summary>
        /// Sets the device detection value.
        /// </summary>
        /// <param name="value"></param>
        private static void SetDeviceDetection(bool value)
        {
            DetectionSection element = GetDetectionElement();

            element.Enabled = value;
            Support.SetWebApplicationSection(element);
            WebConfig.SetWebConfigurationModules();
            Refresh();
        }
        /// <summary>
        /// Checks 
        /// </summary>
        private static void CheckConfig()
        {
            // Get the current section.
            DetectionSection section = Support.GetWebApplicationSection("fiftyOne/detection", false) as DetectionSection;

            // If the section is valid then do nothing.
            if (section != null &&
                String.IsNullOrEmpty(section.BinaryFilePath) == false)
                return;

            // If the section does not exist then create it.
            if (section == null)
                section = new DetectionSection();

            // Set the binary path to the default.
            section.BinaryFilePath = Detection.Constants.DefaultBinaryFilePath;

            // Add the section back to the configuration.
            FiftyOne.Foundation.Mobile.Configuration.Support.SetWebApplicationSection(section);

            // Refresh the configuration.
            Detection.Configuration.Manager.Refresh();
        }
Beispiel #8
0
 static Manager()
 {
     _configurationSection = Support.GetWebApplicationSection("fiftyOne/detection", false) as DetectionSection;
 }
 static Manager()
 {
     _configurationSection = Support.GetWebApplicationSection("fiftyOne/detection", false) as DetectionSection;
     if (_configurationSection == null)
         _configurationSection = new DetectionSection();
 }
        /// <summary>
        /// Creates a new configuration instance checking for
        /// fresh data.
        /// </summary>
        internal static void Refresh()
        {
            // Ensure the managers detection section is refreshed in case the
            // process is not going to restart as a result of the change.
            ConfigurationManager.RefreshSection("fiftyOne/detection");

            _configurationSection = Support.GetWebApplicationSection("fiftyOne/detection", false) as DetectionSection;
        }