Esempio n. 1
0
        public static string GetText(string funcName, string[] funcParamArray)
        {
            //*common
            if (funcName.ToLower() == "empty" | funcName.ToLower() == "null")
            {
                return(string.Empty);
            }
            else if (funcName.ToLower() == "DateTime".ToLower())
            {
                var customFormat = "yyyy-MM-dd HH:mm:ss";
                if (funcParamArray[0].ToLower() == "UtcNow".ToLower())
                {
                    var time = SystemTimeHelper.UtcNow(); //
                    return(time.ToString(customFormat, DateTimeFormatInfo.InvariantInfo));
                }
                else if (funcParamArray[0].ToLower() == "Now".ToLower())
                {
                    var time = SystemTimeHelper.Now(); //
                    return(time.ToString(customFormat, DateTimeFormatInfo.InvariantInfo));
                }
                else
                {
                    throw new ArgumentException("funcName: " + funcName + " has no param " + funcParamArray[0] + "! ");
                }
            }
            else if (funcName.ToLower() == "UniqueCode".ToLower())
            {
                if (funcParamArray[0] == "ByNow")
                {
                    var baseStr   = funcParamArray.Length > 1 ? funcParamArray[1] : "";
                    var separator = funcParamArray.Length > 2 ? funcParamArray[2] : "";
                    return(baseStr.ToUniqueStringByNow(separator));
                }
                else if (funcName.ToLower() == "ShortGuid".ToLower())
                {
                    var baseStr   = funcParamArray.Length > 1 ? funcParamArray[1] : "";
                    var separator = funcParamArray.Length > 2 ? funcParamArray[2] : "";
                    return(baseStr.ToUniqueStringByShortGuid(separator));
                }
                else
                {
                    throw new ArgumentException("funcName: " + funcName + " has no param '" + funcParamArray[0] + "'! ");
                }
            }

            else if (funcName.ToLower() == "Format".ToLower())
            {
                if (funcParamArray[0].ToLower() == "upper")
                {
                    return(funcParamArray[1].ToUpper());
                }
                else if (funcParamArray[0].ToLower() == "lower")
                {
                    return(funcParamArray[1].ToLower());
                }
                else if (funcParamArray[0].ToLower() == "timespan")
                {
                    return(SystemTimeHelper.GetTimeSpanString(Convert.ToDouble(funcParamArray[1]), funcParamArray[2],
                                                              false));
                }
                else if (funcParamArray[0].ToLower() == "real")
                {
                    return(string.Format(funcParamArray[2], Convert.ToDouble(funcParamArray[1])));
                }

                else if (funcParamArray[0].ToLower() == "FormatString")
                {
                    return(string.Format(funcParamArray[1], funcParamArray[2]));
                }
                else
                {
                    throw new ArgumentException(funcName + " has no param '" + funcParamArray[0] + "'! ");
                }
            }
            else if (funcName.ToLower() == "Replace".ToLower())
            {
                return(funcParamArray[1].Length == 0 ? funcParamArray[0]
                    : funcParamArray[0].Replace(funcParamArray[1], funcParamArray[2]));
            }
            else if (funcName.ToLower() == "Split".ToLower())
            {
                var separator   = funcParamArray[1][0];
                var tmpStrArray = funcParamArray[0].Split(separator);
                var index       = Convert.ToInt16(funcParamArray[2]);
                if (index > tmpStrArray.Length || index == tmpStrArray.Length)
                {
                    return("");
                }
                else
                {
                    return(tmpStrArray[index]);
                }
            }
            else if (funcName.ToLower() == "Combine".ToLower())
            {
                var tmpStrArray = funcParamArray[0].GetSubParamArray(false, false);
                var rtStr       = "";
                if (funcParamArray.Length > 1)
                {
                    var joinSeparator = funcParamArray[1].Length == 1 ? Convert.ToChar(funcParamArray[1]) : ' ';
                    rtStr = Ligg.Infrastructure.Base.Helpers.StringHelper.UnwrapStringArrayBySeparator(tmpStrArray, joinSeparator);
                }
                else
                {
                    foreach (var tmpStr in tmpStrArray)
                    {
                        rtStr = rtStr + tmpStr;
                    }
                }
                return(rtStr);
            }
            else if (funcName.ToLower() == "SubString".ToLower())
            {
                var   tmStr    = funcParamArray[0];
                Int16 sttIndex = Convert.ToInt16(funcParamArray[1]);
                Int16 len      = Convert.ToInt16(funcParamArray[2]);
                return(tmStr.Substring(sttIndex, len));
            }
            else if (funcName.ToLower() == "AddOrRemoveSubParam".ToLower())
            {
                var separator = ',';
                if (funcParamArray[0].ContainsSubParamSeparator())
                {
                    separator = funcParamArray[0].GetSubParamSeparator();
                }

                var add = funcParamArray[2].ToLower() == "true" ? true : false;
                return(funcParamArray[0].AddOrDelToSeparatedStrings(funcParamArray[1], add, separator));
            }

            //*get
            else if (funcName.ToLower() == "GetLineQty".ToLower())
            {
                int qty = funcParamArray[0].Split('\n').Length;
                return(Convert.ToString(qty));
            }
            else if (funcName.ToLower() == "GetLinesBySearch".ToLower())
            {
                var strArry    = funcParamArray[0].Split('\n');
                var schStrArry = funcParamArray[1].Split(',');
                var strList    = new List <string>();
                foreach (var v in strArry)
                {
                    foreach (var s in schStrArry)
                    {
                        if (v.ToLower().Contains(s.ToLower()))
                        {
                            strList.Add(v);
                        }
                    }
                }

                var strList1 = strList.Distinct();
                var strBlder = new StringBuilder();
                foreach (var v in strList1)
                {
                    if (!string.IsNullOrEmpty(v))
                    {
                        strBlder.AppendLine(v);
                    }
                }

                return(strBlder.ToString());
            }

            //*convert
            else if (funcName.ToLower() == "ConvertJsonToRichText".ToLower())
            {
                var  jsonStr = funcParamArray[0];
                var  dt      = JsonHelper.ConvertToDataTable(jsonStr);
                bool hasHead = false;
                if (funcParamArray.Length > 1)
                {
                    if (funcParamArray[1].ToLower() == "true")
                    {
                        hasHead = true;
                    }
                }

                String[] strArray = null;
                if (funcParamArray.Length > 2)
                {
                    if (!funcParamArray[2].IsNullOrEmpty())
                    {
                        strArray = funcParamArray[2].GetSubParamArray(true, true);
                    }
                }
                var rtStr = DataTableHelper.ConvertToRichText(dt, hasHead, strArray);

                return(rtStr);
            }

            //*file
            else if (funcName.ToLower() == "FileDetail".ToLower())
            {
                if (funcParamArray[1].IsNullOrEmpty())
                {
                    throw new ArgumentException("file path can't be empty! ");
                }
                if (funcParamArray[0].ToLower() == "Directory".ToLower())
                {
                    return(FileHelper.GetFileDetailByOption(funcParamArray[1], FilePathComposition.Directory));
                }
                else if (funcParamArray[0].ToLower() == "FileName".ToLower())
                {
                    return(FileHelper.GetFileDetailByOption(funcParamArray[1], FilePathComposition.FileName));
                }
                else if (funcParamArray[0].ToLower() == "FileTitle".ToLower())
                {
                    return(FileHelper.GetFileDetailByOption(funcParamArray[1], FilePathComposition.FileTitle));
                }
                else if (funcParamArray[0].ToLower() == "Suffix".ToLower())
                {
                    return(FileHelper.GetFileDetailByOption(funcParamArray[1], FilePathComposition.Suffix));
                }
                else if (funcParamArray[0].ToLower() == "Postfix".ToLower())
                {
                    return(FileHelper.GetFileDetailByOption(funcParamArray[1], FilePathComposition.Postfix));
                }
                else
                {
                    throw new ArgumentException("funcName: " + funcName + " has no param '" + funcParamArray[0] + "'! ");
                }
            }
            //*no use yet
            else if (funcName.ToLower() == "CompareFile".ToLower())
            {
                //var result = FileHelper.Compare2Files(funcParamArray[1], funcParamArray[2]).ToString();
                return(string.Empty);
            }


            else if (funcName.ToLower() == "GetContentFromTextFile".ToLower() | funcName.ToLower() == "GetCttFrTextFile".ToLower())
            {
                return(FileHelper.GetContentFromTextFile(funcParamArray[0]));
            }

            else if (funcName.ToLower() == "GetIniFileSetting".ToLower())
            {
                var filePath = funcParamArray[0];
                FileHelper.CheckFilePathExistence(filePath);
                var key    = funcParamArray[1];
                var defVal = funcParamArray.Length > 2 ? funcParamArray[2] : "";
                return(IniFileHelper.ReadIniString(filePath, "setting", key, defVal));
            }

            //*Json

            //*calc
            else if (funcName.ToLower() == "Calc".ToLower())
            {
                if (funcParamArray[0].ToLower() == "add".ToLower())
                {
                    return((Convert.ToDouble(funcParamArray[1]) + Convert.ToDouble(funcParamArray[2])).ToString());
                }
                else if (funcParamArray[0].ToLower() == "sub".ToLower())
                {
                    return((Convert.ToDouble(funcParamArray[1]) - Convert.ToDouble(funcParamArray[2])).ToString());
                }
                else if (funcParamArray[0].ToLower() == "mtp".ToLower())
                {
                    return((Convert.ToDouble(funcParamArray[1]) * Convert.ToDouble(funcParamArray[2])).ToString());
                }
                else if (funcParamArray[0].ToLower() == "div".ToLower())
                {
                    return((Convert.ToDouble(funcParamArray[1]) / Convert.ToDouble(funcParamArray[2])).ToString());
                }
                else if (funcParamArray[0].ToLower() == "rnd".ToLower())
                {
                    return((Math.Round(Convert.ToDouble(funcParamArray[1]))).ToString());
                }
                else if (funcParamArray[0].ToLower() == "spls".ToLower())
                {
                    return((Convert.ToDouble(funcParamArray[1]) % (Convert.ToDouble(funcParamArray[2]))).ToString());
                }
                else
                {
                    throw new ArgumentException("funcName: " + funcName + " has no param: " + funcParamArray[0] + "! ");
                }
            }

            //*Status
            else if (funcName.ToLower() == "GetFinalStatus".ToLower())
            {
                if (funcParamArray.All(v => v.ToLower() == "true"))
                {
                    return("true");
                }
                if (funcParamArray.Any(v => v.ToLower() == "unknown"))
                {
                    return("unknown");
                }
                return("false");
            }

            //*bool
            else if (funcName.ToLower() == "GetBool".ToLower())
            {
                if (funcParamArray[0].ToLower() == "TotalStatus".ToLower())
                {
                    var returnStr         = "true";
                    var subfuncParamArray = funcParamArray[1].Split(',');
                    if (subfuncParamArray.Any(v => v.ToLower() != "1"))
                    {
                        returnStr = "false";
                    }
                    return(returnStr);
                }
                else if (funcParamArray[0].ToLower() == "And".ToLower())
                {
                    var returnStr         = "true";
                    var subfuncParamArray = funcParamArray[1].Split(',');
                    if (subfuncParamArray.Any(v => v.ToLower() != "true"))
                    {
                        returnStr = "false";
                    }
                    return(returnStr);
                }
                else if (funcParamArray[0].ToLower() == "Or".ToLower())
                {
                    var returnStr         = "false";
                    var subfuncParamArray = funcParamArray[1].Split(',');
                    if (subfuncParamArray.Any(v => v.ToLower() == "true"))
                    {
                        returnStr = "true";
                    }
                    return(returnStr);
                }
                else if (funcParamArray[0].ToLower() == "Not".ToLower())
                {
                    var returnStr = "true";
                    if (funcParamArray[1].ToLower() == "true")
                    {
                        returnStr = "false";
                    }
                    return(returnStr);
                }

                else if (funcParamArray[0].ToLower() == "IsDirectoryExisting".ToLower())
                {
                    var returnStr = "false";
                    if (Directory.Exists(funcParamArray[1]))
                    {
                        returnStr = "true";
                    }
                    return(returnStr);
                }
                else if (funcParamArray[0].ToLower() == "IsDirectoryHidden".ToLower())
                {
                    if (!Directory.Exists(funcParamArray[1]))
                    {
                        return("false");
                    }
                    var returnStr = "false";
                    var di        = new DirectoryInfo(funcParamArray[1]);
                    if ((di.Attributes & FileAttributes.Hidden) == FileAttributes.Hidden)
                    {
                        returnStr = "true";
                    }
                    return(returnStr);
                }
                else if (funcParamArray[0].ToLower() == "IsFileExisting".ToLower())
                {
                    var returnStr = "false";
                    if (File.Exists(funcParamArray[1]))
                    {
                        returnStr = "true";
                    }
                    return(returnStr);
                }

                else if (funcParamArray[0].ToLower() == "IfElse".ToLower())
                {
                    var con        = funcParamArray[1];
                    var conArry    = con.GetSubParamArray(true, false);
                    var judgedText = conArry[0];
                    var judgeFlag  = conArry[1];
                    var val        = "";
                    if (conArry.Length > 2)
                    {
                        val = conArry[2];
                    }
                    if (GetHelper.Judge(judgeFlag, judgedText, val))
                    {
                        return("true");
                    }
                    return("false");
                }

                else
                {
                    throw new ArgumentException("funcName: " + funcName + " has no param: " + funcParamArray[0] + "! ");
                }
            }

            //*if
            else if (funcName.ToLower() == "IfElse".ToLower())
            {
                var con        = funcParamArray[0];
                var returnVal  = funcParamArray[1];
                var returnVal1 = funcParamArray[2];
                var conArry    = con.GetSubParamArray(true, false);
                var judgedText = conArry[0];
                var judgeFlag  = conArry[1];
                var val        = "";
                if (conArry.Length > 2)
                {
                    val = conArry[2];
                }
                if (GetHelper.Judge(judgeFlag, judgedText, val))
                {
                    return(returnVal);
                }
                return(returnVal1);
            }
            //*encrypt
            else if (funcName.ToLower() == "EncryptText".ToLower())
            {
                if (funcParamArray[0].ToLower() == "Md5".ToLower())
                {
                    return(EncryptionHelper.Md5Encrypt(funcParamArray[1]));
                }

                else
                {
                    throw new ArgumentException("funcName: " + funcName + " has no param: " + funcParamArray[0] + "! ");
                }
            }


            else if (funcName.ToLower() == "Validate".ToLower())
            {
                var retStr = Validator.Validate(funcParamArray[0], funcParamArray[1]);
                if (retStr == "OutOfScopeOfValidator")
                {
                    return("OutOfScope");
                }
                else
                {
                    return(retStr);
                }
            }

            else
            {
                return("OutOfScope");
            }
        }
Esempio n. 2
0
        //#GetText
        public static string GetText(string funcName, string[] funcParamArray)
        {
            try
            {
                //common
                if (funcName.ToLower() == "empty" | funcName.ToLower() == "null")
                {
                    return(string.Empty);
                }


                else if (funcName.ToLower() == "GetInputText".ToLower())
                {
                    var dlg          = new TextInputDialog();
                    var verifyRule   = funcParamArray.Length > 0 ? funcParamArray[0] : "";
                    var verifyParams = funcParamArray.Length > 1 ? funcParamArray[1] : "";
                    dlg.VerificationRule   = verifyRule;
                    dlg.VerificationParams = verifyParams;
                    dlg.ShowDialog();
                    return(dlg.InputText);
                }

                else if (funcName.ToLower() == "GetInputDateTime".ToLower())
                {
                    var dlg          = new DateTimeInputDialog();
                    var customFormat = funcParamArray.Length > 0 ? funcParamArray[0] : "";
                    var verifyRule   = funcParamArray.Length > 1 ? funcParamArray[1] : "";
                    var verifyParams = funcParamArray.Length > 2 ? funcParamArray[2] : "";

                    dlg.VerificationRule   = verifyRule;
                    dlg.VerificationParams = verifyParams;
                    dlg.CustomFormat       = customFormat;
                    dlg.ShowDialog();
                    return(dlg.InputText);
                }

                else if (funcName.ToLower() == "LineQty".ToLower())
                {
                    int qty = funcParamArray[0].Split('\n').Length;
                    return(Convert.ToString(qty));
                }
                else if (funcName.ToLower() == "LinesBySearch".ToLower())
                {
                    var strArry    = funcParamArray[0].Split('\n');
                    var schStrArry = funcParamArray[1].Split(',');
                    var strList    = new List <string>();
                    foreach (var v in strArry)
                    {
                        foreach (var s in schStrArry)
                        {
                            if (v.ToLower().Contains(s.ToLower()))
                            {
                                strList.Add(v);
                            }
                        }
                    }

                    var strList1 = strList.Distinct();
                    var strBlder = new StringBuilder();
                    foreach (var v in strList1)
                    {
                        if (!string.IsNullOrEmpty(v))
                        {
                            strBlder.AppendLine(v);
                        }
                    }

                    return(strBlder.ToString());
                }

                else if (funcName.ToLower() == "DateTime".ToLower())
                {
                    var customFormat = "yyyy-MM-dd HH:mm:ss";
                    if (funcParamArray[0].ToLower() == "UtcNow".ToLower())
                    {
                        var time = SystemTimeHelper.UtcNow(); //
                        return(time.ToString(customFormat, DateTimeFormatInfo.InvariantInfo));
                    }
                    else if (funcParamArray[0].ToLower() == "Now".ToLower())
                    {
                        var time = SystemTimeHelper.Now(); //
                        return(time.ToString(customFormat, DateTimeFormatInfo.InvariantInfo));
                    }
                    else
                    {
                        throw new ArgumentException("funcName: " + funcName + " has no param " + funcParamArray[0] + "! ");
                    }
                }
                else if (funcName.ToLower() == "UniqueString".ToLower())
                {
                    if (funcParamArray[0] == "ByNow")
                    {
                        var seperator = funcParamArray[1];
                        return(funcParamArray[2].ToUniqueStringByNow(seperator));
                    }
                    else
                    {
                        throw new ArgumentException("funcName: " + funcName + " has no param '" + funcParamArray[0] + "'! ");
                    }
                }

                else if (funcName.ToLower() == "Format".ToLower())
                {
                    if (funcParamArray[0].ToLower() == "upper")
                    {
                        return(funcParamArray[1].ToUpper());
                    }
                    else if (funcParamArray[0].ToLower() == "lower")
                    {
                        return(funcParamArray[1].ToLower());
                    }
                    else if (funcParamArray[0].ToLower() == "timespan")
                    {
                        return(SystemTimeHelper.GetTimeSpanString(Convert.ToDouble(funcParamArray[1]), funcParamArray[2],
                                                                  false));
                    }
                    else if (funcParamArray[0].ToLower() == "real")
                    {
                        return(string.Format(funcParamArray[2], Convert.ToDouble(funcParamArray[1])));
                    }

                    else if (funcParamArray[0].ToLower() == "FormatString")
                    {
                        return(string.Format(funcParamArray[1], funcParamArray[2]));
                    }
                    else
                    {
                        throw new ArgumentException(funcName + " has no param '" + funcParamArray[0] + "'! ");
                    }
                }
                else if (funcName.ToLower() == "Replace".ToLower())
                {
                    return(funcParamArray[1].Length == 0 ? funcParamArray[0]
                        : funcParamArray[0].Replace(funcParamArray[1], funcParamArray[2]));
                }

                else if (funcName.ToLower() == "Split".ToLower())
                {
                    var seperator   = funcParamArray[1][0];
                    var tmpStrArray = funcParamArray[0].Split(seperator);
                    var index       = Convert.ToInt16(funcParamArray[2]);
                    if (index > tmpStrArray.Length || index == tmpStrArray.Length)
                    {
                        return("");
                    }
                    else
                    {
                        return(tmpStrArray[index]);
                    }
                }
                else if (funcName.ToLower() == "Combine".ToLower())
                {
                    var separator   = funcParamArray[0].GetSubParamSeparator();
                    var tmpStrArray = funcParamArray[0].Split(separator);
                    var rtStr       = "";
                    var i           = 0;
                    foreach (var tmpStr in tmpStrArray)
                    {
                        rtStr = rtStr + tmpStr;
                    }
                    return(rtStr);
                }
                else if (funcName.ToLower() == "SubString".ToLower())
                {
                    var   tmStr    = funcParamArray[0];
                    Int16 sttIndex = Convert.ToInt16(funcParamArray[1]);
                    Int16 len      = Convert.ToInt16(funcParamArray[2]);
                    return(tmStr.Substring(sttIndex, len));
                }

                //file
                else if (funcName.ToLower() == "FileDetail".ToLower())
                {
                    if (funcParamArray[1].IsNullOrEmpty())
                    {
                        throw new ArgumentException("file path can't be empty! ");
                    }
                    if (funcParamArray[0].ToLower() == "Directory".ToLower())
                    {
                        return(FileHelper.GetFileDetailByOption(funcParamArray[1], FilePathComposition.Directory));
                    }
                    else if (funcParamArray[0].ToLower() == "FileName".ToLower())
                    {
                        return(FileHelper.GetFileDetailByOption(funcParamArray[1], FilePathComposition.FileName));
                    }
                    else if (funcParamArray[0].ToLower() == "FileTitle".ToLower())
                    {
                        return(FileHelper.GetFileDetailByOption(funcParamArray[1], FilePathComposition.FileTitle));
                    }
                    else if (funcParamArray[0].ToLower() == "Suffix".ToLower())
                    {
                        return(FileHelper.GetFileDetailByOption(funcParamArray[1], FilePathComposition.Suffix));
                    }
                    else if (funcParamArray[0].ToLower() == "Postfix".ToLower())
                    {
                        return(FileHelper.GetFileDetailByOption(funcParamArray[1], FilePathComposition.Postfix));
                    }
                    else
                    {
                        throw new ArgumentException("funcName: " + funcName + " has no param '" + funcParamArray[0] + "'! ");
                    }
                }
                else if (funcName.ToLower() == "ChooseFile".ToLower())
                {
                    var dlg = new OpenFileDialog();
                    dlg.Title = "Choose File";
                    if (!string.IsNullOrEmpty(funcParamArray[0]))
                    {
                        dlg.InitialDirectory = funcParamArray[0];
                    }
                    if (!string.IsNullOrEmpty(funcParamArray[1]))
                    {
                        dlg.Filter = funcParamArray[1];
                    }

                    dlg.Multiselect      = false;
                    dlg.RestoreDirectory = true;
                    if (dlg.ShowDialog() == DialogResult.OK)
                    {
                        if (dlg.FileNames.Count() > 0)
                        {
                            var firstFilePath = dlg.FileNames[0];
                            return(firstFilePath);
                        }
                    }
                    return(string.Empty);
                }

                //no use yet
                else if (funcName.ToLower() == "CompareFile".ToLower())
                {
                    //var result = FileHelper.Compare2Files(funcParamArray[1], funcParamArray[2]).ToString();
                    return(string.Empty);
                }

                //dir
                else if (funcName.ToLower() == "ChooseDirectory".ToLower())
                {
                    var dlg = new FolderBrowserDialog();
                    dlg.Description  = @"Choose Directory";
                    dlg.SelectedPath = funcParamArray[0];
                    if (dlg.ShowDialog() == DialogResult.OK)
                    {
                        return(dlg.SelectedPath);
                    }
                    return(string.Empty);
                }

                //calc
                else if (funcName.ToLower() == "Calc".ToLower())
                {
                    if (funcParamArray[0].ToLower() == "add".ToLower())
                    {
                        return((Convert.ToDouble(funcParamArray[1]) + Convert.ToDouble(funcParamArray[2])).ToString());
                    }
                    else if (funcParamArray[0].ToLower() == "sub".ToLower())
                    {
                        return((Convert.ToDouble(funcParamArray[1]) - Convert.ToDouble(funcParamArray[2])).ToString());
                    }
                    else if (funcParamArray[0].ToLower() == "mtp".ToLower())
                    {
                        return((Convert.ToDouble(funcParamArray[1]) * Convert.ToDouble(funcParamArray[2])).ToString());
                    }
                    else if (funcParamArray[0].ToLower() == "div".ToLower())
                    {
                        return((Convert.ToDouble(funcParamArray[1]) / Convert.ToDouble(funcParamArray[2])).ToString());
                    }
                    else if (funcParamArray[0].ToLower() == "rnd".ToLower())
                    {
                        return((Math.Round(Convert.ToDouble(funcParamArray[1]))).ToString());
                    }
                    else if (funcParamArray[0].ToLower() == "spls".ToLower())
                    {
                        return((Convert.ToDouble(funcParamArray[1]) % (Convert.ToDouble(funcParamArray[2]))).ToString());
                    }
                    else
                    {
                        throw new ArgumentException("funcName: " + funcName + " has no param: " + funcParamArray[0] + "! ");
                    }
                }
                //ifelse
                else if (funcName.ToLower() == "IfElse".ToLower())
                {
                    var con         = funcParamArray[0];
                    var returnVal   = funcParamArray[1];
                    var returnVal1  = funcParamArray[2];
                    var conArry     = con.Split(con.GetSubParamSeparator());
                    var compareVar  = conArry[0];
                    var compareFlag = conArry[1];
                    var compareVal  = "";
                    if (conArry.Length > 2)
                    {
                        compareVal = conArry[2];
                    }
                    if (compareFlag.ToLower().Trim() == "Contain".ToLower().Trim())
                    {
                        if (compareVar.Contains(compareVal))
                        {
                            if (!string.IsNullOrEmpty(compareVal))
                            {
                                return(returnVal);
                            }
                        }
                    }
                    else if (compareFlag.ToLower().Trim() == "Equal".ToLower().Trim())
                    {
                        if (compareVar == compareVal)
                        {
                            return(returnVal);
                        }
                    }
                    else if (compareFlag.ToLower() == "VEqual".ToLower())
                    {
                        if (Convert.ToDouble(compareVar) == Convert.ToDouble(compareVal))
                        {
                            return(returnVal);
                        }
                    }
                    else if (compareFlag.ToLower() == "VGreater".ToLower())
                    {
                        if (Convert.ToDouble(compareVar) > Convert.ToDouble(compareVal))
                        {
                            return(returnVal);
                        }
                    }
                    else if (compareFlag.ToLower() == "VGreaterEqual".ToLower())
                    {
                        if (Convert.ToDouble(compareVar) >= Convert.ToDouble(compareVal))
                        {
                            return(returnVal);
                        }
                    }
                    else if (compareFlag.ToLower() == "VLess".ToLower())
                    {
                        if (Convert.ToDouble(compareVar) < Convert.ToDouble(compareVal))
                        {
                            return(returnVal);
                        }
                    }
                    else if (compareFlag.ToLower() == "VLessEqual".ToLower())
                    {
                        if (Convert.ToDouble(compareVar) <= Convert.ToDouble(compareVal))
                        {
                            return(returnVal);
                        }
                    }
                    else if (compareFlag.ToLower() == "NotEqual".ToLower())
                    {
                        if (compareVar.Trim() != compareVal.Trim())
                        {
                            return(returnVal);
                        }
                    }
                    else if (compareFlag.ToLower() == "IsNull".ToLower())
                    {
                        if (compareVar.IsNullOrEmpty())
                        {
                            return(returnVal);
                        }
                    }
                    else if (compareFlag.ToLower() == "IsNotNull".ToLower())
                    {
                        if (!compareVar.IsNullOrEmpty())
                        {
                            return(returnVal);
                        }
                    }
                    else
                    {
                        throw new ArgumentException("funcName: " + funcName + " has no compare Flag: '" + compareFlag + "'! ");
                    }

                    return(returnVal1);
                } //IfElse ends

                //Status
                else if (funcName.ToLower() == "GetFinalStatus".ToLower())
                {
                    if (funcParamArray.All(v => v.ToLower() == "true"))
                    {
                        return("true");
                    }
                    if (funcParamArray.Any(v => v.ToLower() == "unknown"))
                    {
                        return("unknown");
                    }
                    return("false");
                }

                //getbool
                else if (funcName.ToLower() == "GetBool".ToLower())
                {
                    if (funcParamArray[0].ToLower() == "TotalStatus".ToLower())
                    {
                        var returnStr         = "true";
                        var subfuncParamArray = funcParamArray[1].Split(',');
                        if (subfuncParamArray.Any(v => v.ToLower() != "1"))
                        {
                            returnStr = "false";
                        }
                        return(returnStr);
                    }
                    else if (funcParamArray[0].ToLower() == "And".ToLower())
                    {
                        var returnStr         = "true";
                        var subfuncParamArray = funcParamArray[1].Split(',');
                        if (subfuncParamArray.Any(v => v.ToLower() != "true"))
                        {
                            returnStr = "false";
                        }
                        return(returnStr);
                    }
                    else if (funcParamArray[0].ToLower() == "Or".ToLower())
                    {
                        var returnStr         = "false";
                        var subfuncParamArray = funcParamArray[1].Split(',');
                        if (subfuncParamArray.Any(v => v.ToLower() == "true"))
                        {
                            returnStr = "true";
                        }
                        return(returnStr);
                    }
                    else if (funcParamArray[0].ToLower() == "Not".ToLower())
                    {
                        var returnStr = "true";
                        if (funcParamArray[1].ToLower() == "true")
                        {
                            returnStr = "false";
                        }
                        return(returnStr);
                    }

                    else if (funcParamArray[0].ToLower() == "JudgeStringIsNull".ToLower())
                    {
                        var returnStr = "false";
                        if (string.IsNullOrEmpty(funcParamArray[1]))
                        {
                            returnStr = "true";
                        }
                        return(returnStr);
                    }
                    else if (funcParamArray[0].ToLower() == "JudgeStringIsNotNull".ToLower())
                    {
                        var returnStr = "false";
                        if (!string.IsNullOrEmpty(funcParamArray[1]))
                        {
                            returnStr = "true";
                        }
                        return(returnStr);
                    }
                    else if (funcParamArray[0].ToLower() == "JudgeIfDirectoryExists".ToLower())
                    {
                        var returnStr = "false";
                        if (Directory.Exists(funcParamArray[1]))
                        {
                            returnStr = "true";
                        }
                        return(returnStr);
                    }
                    else if (funcParamArray[0].ToLower() == "JudgeIsDirectoryHidden".ToLower())
                    {
                        if (!Directory.Exists(funcParamArray[1]))
                        {
                            return("false");
                        }
                        var returnStr = "false";
                        var di        = new DirectoryInfo(funcParamArray[1]);
                        if ((di.Attributes & FileAttributes.Hidden) == FileAttributes.Hidden)
                        {
                            returnStr = "true";
                        }
                        return(returnStr);
                    }

                    else if (funcParamArray[0].ToLower() == "VerifyInput".ToLower())
                    {
                        var returnStr    = "false";
                        var dlg          = new TextInputDialog();
                        var verifyRule   = funcParamArray[1];
                        var verifyParams = funcParamArray.Length > 2 ? funcParamArray[2] : "";
                        dlg.VerificationRule   = verifyRule;
                        dlg.VerificationParams = verifyParams;
                        dlg.ShowDialog();
                        returnStr = dlg.IsOk.ToString().ToLower();
                        return(returnStr);
                    }
                    else
                    {
                        throw new ArgumentException("funcName: " + funcName + " has no param: " + funcParamArray[0] + "! ");
                    }
                }

                else if (funcName.ToLower() == "GetEncryptedText".ToLower())
                {
                    if (funcParamArray[0].ToLower() == "Md5".ToLower())
                    {
                        //return EncryptionHelper.Md5Encrypt(funcParamArray[1]);
                        return(string.Empty);
                    }
                    else if (funcParamArray[0].ToLower() == "Rsa".ToLower())
                    {
                        //return EncryptionHelper.RsaEncrypt(funcParamArray[1]);
                        return(string.Empty);
                    }
                    else if (funcParamArray[0].ToLower() == "Bitwise".ToLower())
                    {
                        //return EncryptionHelper.BitwiseEncrypt(funcParamArray[1]);
                        return(string.Empty);
                    }
                    else if (funcParamArray[0].ToLower() == "Symmetric".ToLower())
                    {
                        return(EncryptionHelper.SmEncrypt(funcParamArray[1]));
                    }
                    else if (funcParamArray[0].ToLower() == "TimeDynamic".ToLower())
                    {
                        return(string.Empty);
                    }
                    else
                    {
                        throw new ArgumentException("funcName: " + funcName + " has no param: " + funcParamArray[0] + "! ");
                    }
                }

                else if (funcName.ToLower() == "GetDecryptedText".ToLower())
                {
                    if (funcParamArray[0].ToLower() == "Rsa".ToLower())
                    {
                        //return EncryptionHelper.RsaDecrypt(funcParamArray[1]);
                        return(string.Empty);
                    }
                    if (funcParamArray[0].ToLower() == "Symmetric".ToLower())
                    {
                        //return EncryptionHelper.SmDecrypt(funcParamArray[1]);
                        return(string.Empty);
                    }
                    else
                    {
                        throw new ArgumentException("funcName: " + funcName + " has no param: " + funcParamArray[0] + "! ");
                    }
                }

                //xml
                else if (funcName.ToLower() == "GetTableXmlNodeVal".ToLower())
                {
                    var path   = funcParamArray[0];
                    var xmlMgr = new XmlHandler(path);
                    return(xmlMgr.GetNodeInnerTextByTagName(funcParamArray[1], 0));
                }

                //following can be extended to impl in AdapterGetHelper
                else if (funcName.ToLower() == "GetValidationResult".ToLower())
                {
                    var retStr = TextValidationHelper.Validate(funcParamArray[0], funcParamArray[1]);
                    if (retStr == "OutOfScopeOfTextValidationHelper")
                    {
                        return("OutOfScope");
                    }
                    else
                    {
                        return(retStr);
                    }
                }

                else if (funcName.ToLower() == "GetJson".ToLower())
                {
                    return("OutOfScope");
                }

                else
                {
                    return("OutOfScope");
                }
            }
            catch (Exception ex)
            {
                throw new ArgumentException("\n>> " + TypeName + ".GetText error: " + ex.Message);
            }
        }