コード例 #1
0
ファイル: BrailBase.cs プロジェクト: kermina/Brail
        /// <summary>
        /// this is called by ReplaceUnknownWithParameters step to create a more dynamic experiance
        /// any uknown identifier will be translate into a call for GetParameter('identifier name').
        /// This mean that when an uknonwn identifier is in the script, it will only be found on runtime.
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public object GetParameter(string name)
        {
            ParameterSearch search = GetParameterInternal(name);

            if (search.Found == false)
            {
                throw new Exception("Parameter '" + name + "' was not found!");
            }
            return(search.Value);
        }
コード例 #2
0
        //[TestMethod, DeploymentItem("Resources/DataSets/OCR/characters/cmr_hex.xml")]
        public void ExecuteParameterSearch()
        {
            ParameterSearch search = new ParameterSearch();

            search.Execute(dataSet: "cmr_hex.xml");
        }
コード例 #3
0
ファイル: BrailBase.cs プロジェクト: kermina/Brail
        /// <summary>
        /// Allows to check that a parameter was defined
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public bool IsDefined(string name)
        {
            ParameterSearch search = GetParameterInternal(name);

            return(search.Found);
        }
コード例 #4
0
ファイル: BrailBase.cs プロジェクト: kermina/Brail
        /// <summary>
        /// this is called by ReplaceUnknownWithParameters step to create a more dynamic experiance
        /// any uknown identifier with the prefix of ? will be translated into a call for
        /// TryGetParameter('identifier name without the ? prefix').
        /// This method will return null if the value it not found.
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public object TryGetParameter(string name)
        {
            ParameterSearch search = GetParameterInternal(name);

            return(new IgnoreNull(search.Value));
        }