Beispiel #1
0
        /// <summary>
        /// Evaluates the macro with the given id, with an optional context override.
        /// </summary>
        public string Evaluate(int inMacroId, MacroBank inContext = null)
        {
            string macro;

            TryEvaluate(inMacroId, out macro, inContext);
            return(macro);
        }
Beispiel #2
0
        /// <summary>
        /// Attempts to evaluate the macro with the given id, with an optional context override.
        /// </summary>
        public bool TryEvaluate(int inMacroId, out string outValue, MacroBank inContext = null)
        {
            bool bSuccess;

            outValue = m_Runtime.Evaluate(inMacroId, Banks, inContext, out bSuccess);
            return(bSuccess);
        }
Beispiel #3
0
        /// <summary>
        /// Evaluates the given string, with an optional context override.
        /// </summary>
        public string Evaluate(string inString, MacroBank inContext = null)
        {
            string str = inString;

            TryEvaluate(ref str, inContext);
            return(str);
        }
Beispiel #4
0
        /// <summary>
        /// Attempts to evaluate the given string, with an optional context override.
        /// </summary>
        public bool TryEvaluate(ref string ioString, MacroBank inContext = null)
        {
            int hash;

            if (MacroUtil.IsMacroKey(ref ioString, out hash))
            {
                bool bSuccess;
                if (ioString == null)
                {
                    ioString = m_Runtime.Evaluate(hash, Banks, inContext, out bSuccess);
                }
                else
                {
                    ioString = m_Runtime.Evaluate(ioString, Banks, inContext, out bSuccess);
                }
                return(bSuccess);
            }

            return(true);
        }