/// <summary> /// Sends metric data into /// </summary> /// <param name="target">The target.</param> /// <param name="formatDouble">The format double.</param> /// <returns></returns> public reportExpandedData SendTo(reportExpandedData target, String formatDouble = "F5") { if (target == null) { target = new reportExpandedData(); } foreach (var pi in Integers) { target.Add(pi.Name, ((Int32)pi.GetValue(this, null)).ToString()); } foreach (var pi in Doubles) { target.Add(pi.Name, ((Double)pi.GetValue(this, null)).ToString(formatDouble)); } foreach (var pi in Decimals) { target.Add(pi.Name, ((Decimal)pi.GetValue(this, null)).ToString(formatDouble)); } foreach (var pi in IgnoreComputations) { target.Add(pi.Name, ((Decimal)pi.GetValue(this, null)).ToString(formatDouble)); } return(target); }
public static String ReportSave(this reportExpandedData report, folderNode folder, String filename, String fileDescription = "") { builderForText reporter = new builderForText(); if (filename.isNullOrEmpty()) { filename = "expandedData"; } filename = Path.GetFileNameWithoutExtension(filename); foreach (reportExpandedDataPair entry in report) { if (entry.value.StartsWith("<?xml")) { String filepath = folder.pathFor(filename + "_" + entry.key + ".xml", Data.enums.getWritableFileMode.overwrite, "Stored type value from [" + filename + "]"); File.WriteAllText(filepath, entry.value); } else { reporter.AppendLine($"{entry.key} = {entry.value} \t\t\t //{entry.description}"); } } return(reporter.ReportSave(folder, filename, fileDescription)); }
/// <summary> /// Creates WordPress shortcode code to embedd the specified js content. /// </summary> /// <param name="js_content">JavaScript content to be enbedded. If the string contains {0}, it will be replaced with <c>custom_id</c></param> /// <param name="custom_id">DIV identifier, the custom value. Leave empty to have automatically assigned unique ID for created DIV</param> /// <param name="extendedAttributes">Optional pair of additional shortcode attributes</param> /// <returns>WP shortcode code. If <see cref="UseGutenbergContainerBlock"/> it will be wrapped in given gutenberg container, <see cref="GutenbergContainerBlock"/></returns> public String Create(String js_content, String custom_id = "", reportExpandedData extendedAttributes = null) { currentID++; if (custom_id.isNullOrEmpty()) { custom_id = "block" + currentID.ToString("D6"); } if (js_content.Contains("{0}")) { js_content = js_content.Replace("{0}", custom_id); //js_content = String.Format(js_content, custom_id); } String attributes = ""; if (extendedAttributes != null) { StringBuilder sb = new StringBuilder(); foreach (reportExpandedDataPair pair in extendedAttributes) { sb.Append(" " + pair.key + "=\"" + pair.value + "\""); } attributes = sb.ToString(); } String content = Base64Encode(js_content); String template = GetShortCodeTemplate(); String output = String.Format(template, custom_id, attributes, content); if (UseGutenbergContainerBlock) { output = String.Format(GutenbergContainerBlock, output); } return(output); }
//public reportExpandedData ExtractorCustomizationSettings { get; set; } = new reportExpandedData(); public virtual void DeployCustomizationSettings(reportExpandedData ExtractorCustomizationSettings) { ExtractorTools.SetSettingsFromData(this, ExtractorCustomizationSettings); }