public void AddOrUpdate(VariableDescription variable)
        {
            VariableDescription vd;

            if (_variables.TryGetValue(variable.Name, out vd))
            {
                variable.SelectedOption = vd.SelectedOption;
            }
            _variables[variable.Name] = variable;
            _updated = true;
        }
        public void AddOrUpdate(string variableName, string selectedOption)
        {
            VariableDescription vd;

            if (_variables.TryGetValue(variableName, out vd))
            {
                vd.SelectedOption = selectedOption;
            }
            else
            {
                _variables[variableName] = new VariableDescription()
                {
                    Name = variableName, SelectedOption = selectedOption
                }
            };
            _updated = true;
        }
        protected bool SetVariables(IntPtr data)
        {
            void **variablesPtr = (void **)data.ToPointer();

            for (;;)
            {
                IntPtr pKey = new IntPtr(*variablesPtr++);
                if (pKey == IntPtr.Zero)
                {
                    break;
                }
                IntPtr pValue = new IntPtr(*variablesPtr++);
                VariableDescription variable = new VariableDescription(pKey, pValue);
                _variables.AddOrUpdate(variable);
                Log(RETRO_LOG_LEVEL.DEBUG, "Set variable: {0}", variable);
            }
            return(true);
        }
 public bool TryGet(string variableName, out VariableDescription variable)
 {
     _updated = false;
     return(_variables.TryGetValue(variableName, out variable));
 }