//使用简易方法生成代理或动态创建对象,在子类中重写 protected virtual IChainRoutingNodeProxy CreateProxy(object node, object identify) { return(FrameManager.CreateInstence <IChainRoutingNodeProxy>("", "", new Dictionary <string, object>() { { "node", node }, { "identify", identify } })); }
static IInitializer GetInitializer(string initializerName) { if (!initializers.ContainsKey(initializerName)) { initializers.Add(initializerName, FrameManager.CreateInstence <IInitializer>(initializerName)); } return(initializers[initializerName]); }
public static object GetParameterInstence(this Type type, string name, string injectionType = "") { if (injectionType == "") { if (type.IsPrimitive) { return(Activator.CreateInstance(type)); } else if (type == typeof(string)) { return(""); } else { return(FrameManager.CreateInstence(type)); } } else { switch (injectionType) { case AppConst.Injection_Additional: foreach (var tar in CreateInstenceState.GetBottomToTop()) { if (tar is Dictionary <string, object> ) { Dictionary <string, object> dic = tar as Dictionary <string, object>; if (dic.ContainsKey(name)) { return(dic[name]); } } } return(null); case AppConst.Injection_InternalData: return(FrameManager.GetInstence <IGameData>().GetData(name)); case AppConst.Injection_ExternalData: return(FrameManager.GetData(name)); case AppConst.Injection_NewInstence: return(FrameManager.CreateInstence(type, "", name)); case AppConst.Injection_NewGameObject: return(FrameManager.GetNewGameObject(name)); case AppConst.Injection_GameObject: return(FrameManager.GetGameObject(name)); default: return(injectionType.ConvertToSimpleType(type)); } } }
public void LoadResources(string layer, Action <string> LoadOverAction) { ResourcesLayerID = layer; Debug.Log(ResourcesLayerID); loadResourcesState = new ListState <string>(""); foreach (string s in resourcesManagers.Keys) { IResourcesProvider manager = FrameManager.CreateInstence <IResourcesProvider>(); //resourcesManagers[s].AddNode(manager); } loadResourcesState.TmpReductionStateEvent = LoadOverAction; }
protected override object CreateNode() { return(FrameManager.CreateInstence <IResourcesProvider>()); }