Example #1
0
        public static void WriteTranslatedEquality(this StringBuilder builder, string viewName, string propertyName, string value, ICodeRenderService codeRenderService, bool instanciate = false, bool textCondition = true)
        {
            bool   needQuotes;
            string result;

            if (textCondition && !string.IsNullOrEmpty(value))
            {
                if (codeRenderService.Options != null && codeRenderService.Options.TranslateLabels)
                {
                    result     = codeRenderService.GetTranslatedText(value);
                    needQuotes = false;
                }
                else
                {
                    result     = value;
                    needQuotes = true;
                }
            }
            else
            {
                result     = string.Empty;
                needQuotes = true;
            }
            builder.AppendLine(CodeGenerationHelpers.GetPropertyEquality(viewName, propertyName, result, inQuotes: needQuotes, instanciate: instanciate));
        }
Example #2
0
 public static void WritePropertyEquality(this StringBuilder builder, string viewName, string propertyName, string value, bool inQuotes = false, bool instanciate = false)
 {
     builder.AppendLine(CodeGenerationHelpers.GetPropertyEquality(viewName, propertyName, value, inQuotes, instanciate));
 }
Example #3
0
 public static string GetPropertyEquality(this Services.CodeNode sender, string propertyName, string value, bool inQuotes = false)
 {
     return(CodeGenerationHelpers.GetPropertyEquality(sender.Name, propertyName, value, inQuotes));
 }