private Expression(string expressionString) { TkDebug.AssertArgumentNullOrEmpty(expressionString, "expressionString", null); fParser = ExpressionParser.ParseExpression(expressionString); TkDebug.ThrowIfNoGlobalVariable(); PlugInFactoryManager factories = BaseGlobalVariable.Current.FactoryManager; BasePlugInFactory paramFactory = factories.GetCodeFactory( ParamExpressionPlugInFactory.REG_NAME); BasePlugInFactory exprFactory = factories.GetCodeFactory( ExpressionPlugInFactory.REG_NAME); fExpressions = new List <BaseExpressionItem>(); foreach (string item in fParser.ParamArray) { string firstChar = item[0].ToString(); BaseExpressionItem expressionItem; if (paramFactory.Contains(firstChar)) { IParamExpression expression = paramFactory.CreateInstance <IParamExpression>(firstChar); string parameter = item.Substring(1); expressionItem = new ParamExpressionItem(expression, parameter); } else { IExpression expression = exprFactory.CreateInstance <IExpression>(item); expressionItem = new ExpressionItem(expression, item); } fExpressions.Add(expressionItem); } }
private static IDecoder GetDecoder(IFieldDecoder decoder) { BasePlugInFactory factory = BaseGlobalVariable.Current.FactoryManager.GetCodeFactory( CodeTablePlugInFactory.REG_NAME); CodeTable ct = factory.CreateInstance <CodeTable>(decoder.RegName); return(ct); }
private static string GetCtrlHtml(Tk5FieldInfoEx field, IFieldValueProvider provider, String ctrl, BasePlugInFactory factroy, bool needId) { if (factroy.Contains(ctrl)) { IControlHtml html = factroy.CreateInstance <IControlHtml>(ctrl); return(html.GetHtml(field, provider, needId)); } else { return(string.Format(ObjectUtil.SysCulture, "<!--系统当前没有注册{0}的控件,请完善-->", ctrl)); } }
private static IDecoder GetDecoder(IFieldDecoder decoder) { if (decoder.Type == DecoderType.CodeTable) { BasePlugInFactory factory = BaseGlobalVariable.Current.FactoryManager.GetCodeFactory( CodeTablePlugInFactory.REG_NAME); CodeTable ct = factory.CreateInstance <CodeTable>(decoder.RegName); return(ct); } else if (decoder.Type == DecoderType.EasySearch) { BasePlugInFactory factory = BaseGlobalVariable.Current.FactoryManager.GetCodeFactory( EasySearchPlugInFactory.REG_NAME); EasySearch ct = factory.CreateInstance <EasySearch>(decoder.RegName); return(ct); } return(null); }