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)); }
public override string ConvertToCode(string propertyName, FigmaCodeNode currentNode, FigmaCodeNode parentNode, FigmaCodeRendererService rendererService) { if (propertyName == CodeProperties.AddChild) { if (parentNode != null) { return(CodeGenerationHelpers.GetMethod(parentNode.Name, nameof(AppKit.NSView.AddSubview), currentNode.Name)); } } if (propertyName == CodeProperties.Constraints) { } if (propertyName == CodeProperties.Frame) { } return(base.ConvertToCode(propertyName, currentNode, parentNode, rendererService)); }
public static string GetConstructor(this Services.CodeNode sender, string typeFullName, bool includesVar = true) { return(CodeGenerationHelpers.GetConstructor(sender.Name, typeFullName, includesVar)); }
public static string GetMethod(this Type type, string methodName, string parameters, bool inQuotes = false, bool includesSemicolon = true) { return(CodeGenerationHelpers.GetMethod(type.FullName, methodName, parameters, inQuotes, includesSemicolon)); }
public static void WriteMethod(this StringBuilder builder, string viewName, string methodName, string parameters, bool inQuotes = false) { builder.AppendLine(CodeGenerationHelpers.GetMethod(viewName, methodName, parameters, inQuotes)); }
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)); }
public static void WriteConstructor(this StringBuilder builder, string viewName, string typeFullName, bool includesVar = true) { builder.AppendLine(CodeGenerationHelpers.GetConstructor(viewName, typeFullName, includesVar)); }
public static string GetMethod(this Services.CodeNode sender, string methodName, string parameters, bool inQuotes = false) { return(CodeGenerationHelpers.GetMethod(sender.Name, methodName, parameters, inQuotes)); }
public static string GetMethod(this Services.CodeNode sender, string methodName, bool parameter) { return(CodeGenerationHelpers.GetMethod(sender.Name, methodName, parameter)); }
public static string GetPropertyEquality(this Services.CodeNode sender, string propertyName, string value, bool inQuotes = false) { return(CodeGenerationHelpers.GetPropertyEquality(sender.Name, propertyName, value, inQuotes)); }