internal static List <ModelSensitiveInformation> Handle(List <string> listArgs, List <ModelSensitiveInformation> listSI)
        {
            if (listArgs.Count == 0)
            {
                return(listSI);
            }

            ValidatorOptionCommandAll.Validate(listArgs[0]);
            string optionCommand = listArgs[0];

            if (!CommandOption.SI_FAVORITE.Equals(optionCommand))
            {
                listArgs.RemoveAt(0);
            }

            ValidatorArgument.Validate(listArgs);
            listSI = BuilderFilteredListSI.Build(optionCommand, listArgs[0], listSI);
            listArgs.RemoveAt(0);

            if (listArgs.Count >= 1)
            {
                Handle(listArgs, listSI);
            }

            return(listSI);
        }
        internal static SensitiveInformation Handle(List <string> listArgs, SensitiveInformation modelSI)
        {
            if (listArgs.Count == 0)
            {
                return(modelSI);
            }

            ValidatorOptionCommand.Validate(listArgs[0]);
            string optionCommand = listArgs[0];

            if (!CommandOption.SI_FAVORITE.Equals(optionCommand))
            {
                listArgs.RemoveAt(0);
            }

            ValidatorArgument.Validate(listArgs);
            modelSI = BuilderSensitiveInformation.Build(optionCommand, modelSI, listArgs[0]);
            listArgs.RemoveAt(0);

            if (listArgs.Count >= 1)
            {
                Handle(listArgs, modelSI);
            }

            return(modelSI);
        }
        public void Handle(List <string> listArgs)
        {
            ValidatorArgument.Validate(listArgs);
            ValidatorOptionCommandKey.Validate(listArgs[0]);
            string optionCommandKey = listArgs[0];

            listArgs.RemoveAt(0);
            ValidatorArgument.Validate(listArgs);
            string idOrUuid = listArgs[0];

            listArgs.RemoveAt(0);
            List <ModelSensitiveInformation> listSI = CoreManagerSensitiveInformation.Read();

            if (optionCommandKey.Equals(CommandOptionKey.SI_UUID))
            {
                ModelSensitiveInformation modelSI = listSI.Find(si => si.uuid.Equals(idOrUuid));
                ValidatorIsNull.Validate(modelSI);
                modelSI = HandlerAddHelper.Handle(listArgs, modelSI);
                CoreManagerSensitiveInformation.Update(idOrUuid, modelSI);
            }
            else if (optionCommandKey.Equals(CommandOptionKey.SI_ID))
            {
                ModelSensitiveInformation modelSI = listSI.Find(si => si.id.ToString().Equals(idOrUuid));
                ValidatorIsNull.Validate(modelSI);
                modelSI = HandlerAddHelper.Handle(listArgs, modelSI);
                CoreManagerSensitiveInformation.Update(Int32.Parse(idOrUuid), modelSI);
            }

            Console.WriteLine("Update sucessfully");
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            List <string> listArgs = new List <string>(args);

            ValidatorArgument.Validate(listArgs);
            ValidatorEntryCommand.Validate(listArgs[0]);
            listArgs.RemoveAt(0);
            IHandler handler = HandlerFactory.GetHandler(args[0]);

            handler.Handle(listArgs);
        }
Esempio n. 5
0
 public DummyConstructor
 (
     DetailFormSettings form,
     DetailFieldSetting field,
     DetailGroupSetting group,
     DetailListSetting list,
     FormControlSettings formControlSettings,
     FormGroupArraySettings formGroupArraySettings,
     FormGroupSettings formGroupSettings,
     MultiSelectFormControlSettings multiSelectFormControlSettings,
     CommandButtonData commandButtonData,
     ValidatorArgument validatorArguments
 )
 {
 }
        public void Handle(List <string> listArgs)
        {
            ValidatorArgument.Validate(listArgs);
            ValidatorOptionCommandKey.Validate(listArgs[0]);
            string optionCommand = listArgs[0];

            listArgs.RemoveAt(0);
            ValidatorArgument.Validate(listArgs);

            if (optionCommand.Equals(CommandOptionKey.SI_UUID))
            {
                ContainerUseCase.getUseCaseCrud().Delete(listArgs[0]);
            }
            else if (optionCommand.ToString().Equals(CommandOptionKey.SI_ID))
            {
                ContainerUseCase.getUseCaseCrud().Delete(Int32.Parse(listArgs[0]));
            }

            Console.WriteLine("Remove sucessfully");
        }
        public void Handle(List <string> listArgs)
        {
            ValidatorArgument.Validate(listArgs);
            ValidatorOptionCommandKey.Validate(listArgs[0]);
            string optionCommand = listArgs[0];

            listArgs.RemoveAt(0);
            ValidatorArgument.Validate(listArgs);

            if (optionCommand.Equals(CommandOptionKey.SI_UUID))
            {
                CoreManagerSensitiveInformation.Delete(listArgs[0]);
            }
            else if (optionCommand.ToString().Equals(CommandOptionKey.SI_ID))
            {
                CoreManagerSensitiveInformation.Delete(Int32.Parse(listArgs[0]));
            }

            Console.WriteLine("Remove sucessfully");
        }