private static IHttpHandler CreateHanlderInfoCreator(PageSourceInfo info) { var handler = PlugInFactoryManager.CreateInstance <IHttpHandler>( HttpHandlerPlugInFactory.REG_NAME, info.Parser); return(handler); }
internal static IObjectSerializer CreateSerializer(string method) { IObjectSerializer serializer = PlugInFactoryManager.CreateInstance <IObjectSerializer>( SerializerPlugInFactory.REG_NAME, method); return(serializer); }
protected override object InternalConvertFromString(string text, ReadSettings settings) { if (string.IsNullOrEmpty(text)) { return(null); } return(PlugInFactoryManager.CreateInstance <T>(FactoryName, text)); }
protected BaseGlobalVariable() { FactoryManager = new PlugInFactoryManager(); CacheManager = new CacheManager(); fPlugInErrorLog = new PlugInErrorLog(); DefaultValue = new ToolkitDefaultValue(); Config = new DefaultToolkitConfig(); InitializeToolkitCore(); }
public static IModule CreateModule(this PageSourceInfo info) { TkDebug.AssertArgumentNull(info, "info", null); IModuleCreator moduleCreator = PlugInFactoryManager.CreateInstance <IModuleCreator>( ModuleCreatorPlugInFactory.REG_NAME, info.ModuleCreator); return(moduleCreator.Create(info.Source)); }
internal void AddPlugInFactory(PlugInFactoryManager manager) { foreach (Assembly assembly in fBinAssembly) { if (assembly == ToolkitConst.TOOLKIT_CORE_ASSEMBLY) { continue; } AddPlugInFactory(manager, assembly); } }
private void Initialize(string userId) { TempIndentity = Guid.NewGuid(); var appRightBuilder = PlugInFactoryManager.CreateInstance <IAppRightBuilder>( AppRightBuilderPlugInFactory.REG_NAME, WebAppSetting.WebCurrent.AppRightBuilder); AppRight = new WebAppRight(appRightBuilder); SessionId = WebGlobalVariable.Session?.Id; if (userId != EMPTY_KEY) { AppRight.Initialize(Info); } }
internal static void AddPlugInFactory(PlugInFactoryManager manager, Assembly assembly) { Attribute[] attrs = Attribute.GetCustomAttributes(assembly, typeof(AssemblyPlugInFactoryAttribute)); if (attrs.Length > 0) { foreach (AssemblyPlugInFactoryAttribute attribute in attrs) { BasePlugInFactory factory = ObjectUtil.CreateObject( attribute.PlugInFactoryType).Convert <BasePlugInFactory>(); TkTrace.LogInfo($"添加工厂:{factory.Description}"); manager.Add(factory); } } }