protected override bool Execute(CodeActivityContext context)
        {
            Error.Set(context, null);

            if (Parameters == null)
            {
                Error.Set(context, "Не определены параметры управления");
                return(false);
            }

            if (string.IsNullOrEmpty(LoginInfo.UserName) || string.IsNullOrEmpty(LoginInfo.Password))
            {
                Error.Set(context, "Не определены параметры авторизации");
                return(false);
            }

            int         tiId = UspdId.Get(context);
            CommandInfo paramscommand;

            try
            {
                try
                {
                    paramscommand = Parameters.DeserializeFromString <CommandInfo>();
                }
                catch (Exception ex)
                {
                    Error.Set(context, "Ошибка преобразования параметров команды" + ex.Message);
                    return(false);
                }

                //command.SerializeToString<CommandInfo>()   - в строку
                //command.DeserializeFromString<CommandInfo>()   - из строки

                List <KeyValuePair <int, FailReason> > res = ARM_Service.DM_Set_USPD_Methods(LoginInfo.UserName, LoginInfo.Password, paramscommand.Request,
                                                                                             new List <Tuple <int, List <KeyValuePair <long, DeviceMethodDescription> > > >()
                {
                    new Tuple <int, List <KeyValuePair <long, DeviceMethodDescription> > >(paramscommand.DeviceToClass_ID, paramscommand.Methods)
                }, new List <int>()
                {
                    tiId
                });
                if (res.Count == 1)
                {
                    Error.Set(context, GlobalEnumsDictionary.ConvertFailReasonToString(res[0].Value));
                }
            }
            catch (Exception ex)
            {
                Error.Set(context, ex.Message);
                if (!HideException.Get(context))
                {
                    throw ex;
                }
            }
            return(string.IsNullOrEmpty(Error.Get(context)));
        }