Example #1
0
 private static string GetMessageForAlreadySetItem(IConfigurationItemViewModel configurationItemViewModel)
 {
     return
         ($"{StaticContainer.Container.Resolve<ILocalizerService>().GetLocalizedString("ThisBitSetIn")} {Environment.NewLine} {configurationItemViewModel.BuildItemPath()}");
 }
Example #2
0
        public static bool ValidateConfigItem(IConfigurationItemViewModel configurationViewModel, bool initial)
        {
            bool res = initial;

            if (configurationViewModel is ICanBeHidden canBeHidden && !canBeHidden.IsHidden)
            {
                if (configurationViewModel is ILocalAndDeviceValueContainingViewModel
                    localAndDeviceValueContainingViewModel &&
                    localAndDeviceValueContainingViewModel.LocalValue != null &&
                    localAndDeviceValueContainingViewModel.LocalValue.HasErrors)
                {
                    var errorMes =
                        $"{StaticContainer.Container.Resolve<ILocalizerService>().GetLocalizedString(ApplicationGlobalNames.StatusMessages.ERROR)}: {configurationViewModel.BuildItemPath()}";
                    StaticContainer.Container.Resolve <ILogService>().LogMessage(errorMes, LogMessageTypeEnum.Error);
                    res = false;
                }
            }

            if (configurationViewModel.ChildStructItemViewModels.Count > 0)
            {
                foreach (var configurationItemViewModel in configurationViewModel.ChildStructItemViewModels)
                {
                    res = ValidateConfigItem(configurationItemViewModel, res);
                }
            }
            return(res);
        }