예제 #1
0
        public void AddBoundVariable(string name, BindingGetDlg getDelegate, BindingSetDlg setDelegate)
        {
            BoundVariable variable;
            if (_vars.ContainsKey(name))
            {
                variable = _vars[name];
            }
            else
            {
                variable = new BoundVariable();
                variable.Name = name;
                variable.cpu = _shared.Cpu;
                _vars.Add(name, variable);
                _shared.Cpu.AddVariable(variable, name);
            }

            if (getDelegate != null)
                variable.Get = getDelegate;

            if (setDelegate != null)
                variable.Set = setDelegate;
        }