예제 #1
0
        public void Put()
        {
            Dictionary <string, ConfigParameter> changedParameters = new Dictionary <string, ConfigParameter>();

            foreach (KeyValuePair <string, ConfigParameter> parameter in _dictionary)
            {
                if (parameter.Value.DataPending)
                {
                    changedParameters.Add(parameter.Key, parameter.Value);
                }
            }
            if (changedParameters.Count == 0)
            {
                return;
            }

            if (_type == RPCParameterSetType.rpcLink)
            {
                _rpc.PutParamset(_peerId, _channel, _remotePeerID, _remoteChannel, changedParameters);
            }
            else
            {
                _rpc.PutParamset(_peerId, _channel, _type, changedParameters);
            }

            bool reloadRequired = false;

            foreach (KeyValuePair <string, ConfigParameter> parameter in changedParameters)
            {
                parameter.Value.DataPending = false;
                if (parameter.Value.UIFlags == VariableUIFlags.fTransform)
                {
                    reloadRequired = true;
                }

                if (parameter.Key == "AES_ACTIVE")
                {
                    VariableReloadRequiredEvent(this, true);
                }
            }
            if (reloadRequired && VariableReloadRequiredEvent != null)
            {
                VariableReloadRequiredEvent(this, false);
            }
        }