コード例 #1
0
        /// <summary>
        /// Applies the dataset on the line
        /// </summary>
        /// <param name="line">The line.</param>
        /// <param name="arg">The argument.</param>
        /// <param name="dataSets">The data sets.</param>
        /// <returns></returns>
        internal string applyLine(string line, docScriptArguments arg, PropertyCollection[] dataSets)
        {
            string cline = line.applyToContent(false, dataSets);

            if (cline.isTemplate())
            {
                keyListForFailedStrings.AddUnique(arg);
                reportTemplatePlaceholderCollection plcs = cline.getPlaceHolders();
                foreach (KeyValuePair <string, reportTemplatePlaceholder> plcp in plcs)
                {
                    missingData.AddUnique(plcp.Key);
                }
            }
            return(cline);
        }
コード例 #2
0
        /// <summary>
        /// Arguments to string.
        /// </summary>
        /// <param name="textFormat">The text format.</param>
        /// <param name="key">The key.</param>
        /// <param name="value">The value.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentOutOfRangeException"></exception>
        public string ArgumentToString(docScriptInstructionTextFormatEnum textFormat, docScriptArguments key, object value)
        {
            string output = "";

            if (defaultInstruction[key].toStringSafe() == this[key].toStringSafe())
            {
                return(output);
            }

            switch (textFormat)
            {
            case docScriptInstructionTextFormatEnum.unknown:
            case docScriptInstructionTextFormatEnum.none:
                return("");

                break;

            case docScriptInstructionTextFormatEnum.meta:
                output = key.ToString() + "=" + this[key].toExpressionString();
                break;

            case docScriptInstructionTextFormatEnum.cs_compose:
                output = "arg(" + key.toExpressionString() + ", " + this[key].toExpressionString() + ")";

                return(output);

                break;

            case docScriptInstructionTextFormatEnum.xml:

                output = key.ToString() + "=" + this[key].toExpressionString() + ")";

                return(output);

                break;

            case docScriptInstructionTextFormatEnum.json:

                output = key.ToString() + ":" + this[key].toExpressionString() + ";";

                return(output);

                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
            return(output);
        }
コード例 #3
0
 /// <summary>
 /// Define new argument KeyValuePair
 /// </summary>
 /// <param name="key">The key.</param>
 /// <param name="value">The value.</param>
 /// <returns></returns>
 public docScriptInstruction arg(docScriptArguments key, object value)
 {
     this.add(key, value);
     return(this);
 }