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); }
public static String ControlHtml(this Tk5FieldInfoEx field, IFieldValueProvider provider, bool needId) { string ctrl = field.ControlName; BasePlugInFactory factroy = BaseGlobalVariable.Current .FactoryManager.GetCodeFactory(ControlHtmlPlugInFactory.REG_NAME); return(GetCtrlHtml(field, provider, ctrl, factroy, needId)); }
public override string ConvertToString(object value, WriteSettings settings) { BasePlugInFactory factory = value as BasePlugInFactory; if (factory != null) { return(factory.Name); } return(null); }
internal PlugInFactoryInfo(BasePlugInFactory factory) { TkDebug.AssertArgumentNull(factory, "factory", null); Name = factory.Name; Description = factory.Description; Type type = factory.GetType(); Count = factory.Count; TypeName = type.ToString(); AssemblyName = GetFileName(type); }
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); }
internal PlugInFactoryData(BasePlugInFactory factory) { FactoryInfo = new PlugInFactoryInfo(factory); List <PlugInInfo> list = new List <PlugInInfo>(); factory.EnumableCodePlugIn((regName, type, attr) => list.Add(new PlugInInfo(regName, type, attr))); BaseInstancePlugInFactory instanceFactory = factory as BaseInstancePlugInFactory; if (instanceFactory != null) { instanceFactory.EnumableInstancePlugIn((regName, obj, attr) => list.Add(new PlugInInfo(regName, attr, obj))); } BaseXmlPlugInFactory xmlFactory = factory as BaseXmlPlugInFactory; if (xmlFactory != null) { xmlFactory.EnumableXmlPlugIn((item, fileName, type, attr) => list.Add(new PlugInInfo(item, fileName, type, attr))); } PlugIns = list; }