RIM.VSNDK_Package.Settings.Models.SettingsData.getSimulatorInfo C# (CSharp) Method

getSimulatorInfo() public method

Function to retrieve simulator info from the registry
public getSimulatorInfo ( ) : void
return void
        public void getSimulatorInfo()
        {
            RegistryKey rkHKCU = Registry.CurrentUser;
            RegistryKey rkSettingsPath = null;

            try
            {
                rkSettingsPath = rkHKCU.CreateSubKey("Software\\BlackBerry\\BlackBerryVSPlugin");

                object pwd = rkSettingsPath.GetValue("simulator_password");
                if (pwd != null)
                    SimulatorPassword = GlobalFunctions.Decrypt(pwd.ToString());

                object ip = rkSettingsPath.GetValue("simulator_IP");
                if (ip != null)
                    SimulatorIP = ip.ToString();
            }
            catch
            {

            }

            rkSettingsPath.Close();
            rkHKCU.Close();
        }

Usage Example

        /// <summary>
        /// Settings Dialog Constructor
        /// </summary>
        public SettingsDialog()
        {
            InitializeComponent();

            _data = new SettingsData();
            gridMain.DataContext = _data;

            _data.getSimulatorInfo();
            _data.getDeviceInfo();
            tbDevicePassword.Password = _data.DevicePassword;
            tbSimulatorPassword.Password = _data.SimulatorPassword;
        }