Ejemplo n.º 1
0
        public static AmRegistrySettings Spawn()
        {
            AmRegistrySettings self = new AmRegistrySettings();

            self.ReadRegistry();
            return(self);
        }
Ejemplo n.º 2
0
 public static AmRegistrySettings Spawn()
 {
     AmRegistrySettings self = new AmRegistrySettings();
     self.ReadRegistry();
     return self;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Reads the registry and update the object's variables. Includes updating the
        /// attachment management specific settings.
        /// </summary>
        public void ReadRegistry()
        {
            RegistryKey regKey = null;

            try
            {
                regKey = Base.GetOtcRegKey();

                int val;

                if (Int32.TryParse(regKey.GetValue("EnableOtc", "1") as String, out val))
                {
                    OtcEnabledFlag = Convert.ToBoolean(val);
                }
                else
                {
                    OtcEnabledFlag = true;
                }

                // First, look up the legacy key name. Use its value if present.
                String skurl = regKey.GetValue("Public_Workspace", "DEFAULT") as String;
                if (skurl != null && skurl != "DEFAULT" && Int32.TryParse(skurl, out val))
                {
                    // Convert to new key name.
                    SkurlEnabledFlag = Convert.ToBoolean(val);
                    regKey.DeleteValue("Public_Workspace", false);
                    regKey.SetValue("EnableSkurl", val.ToString());
                }
                else
                {
                    if (Int32.TryParse(regKey.GetValue("EnableSkurl", "1") as String, out val))
                    {
                        SkurlEnabledFlag = Convert.ToBoolean(val);
                    }
                    else
                    {
                        SkurlEnabledFlag = true;
                    }
                }

                if (Int32.TryParse(regKey.GetValue("EnableOtcDebugging", "0") as String, out val))
                {
                    if (val > 0)
                    {
                        LogToFileFlag = true;
                        Logging.Log("Enabling OTC logging.");
                    }
                    else
                    {
                        Logging.Log("Disabling OTC logging.");
                        LogToFileFlag = false;
                    }
                }

                else
                {
                    LogToFileFlag = true;
                }

                if (Int32.TryParse(regKey.GetValue("HideAmWelcomeFlag", "0") as String, out val))
                {
                    HideAmWelcomeFlag = Convert.ToBoolean(val);
                }
                else
                {
                    HideAmWelcomeFlag = false;
                }

                // Update the attachment management settings.
                AmSettings.ReadRegistry();
            }

            finally
            {
                if (regKey != null)
                {
                    regKey.Close();
                }
            }
        }