/// <summary> /// /// </summary> /// <param name="typeName">配置的type元素的Name属性</param> /// <param name="methodName">调用的方法名</param> /// <param name="param">调用方法的输入参数</param> /// <returns>调用方法的返回值</returns> public object Invoke(string typeName, string methodName, object[] param) { InvokeMethodAssembly s = null; string key = string.Format("{0}_{1}", typeName, methodName); if (callBackAssemblyCache.ContainsKey(key)) { s = callBackAssemblyCache[key]; if (s.FromXml) { IControlAddress controlAddress = ServiceContainer.CreateInstance().Resolve <IControlAddress>("ControlAddressService"); string name = controlAddress.GetNameByTypeName(typeName, typeName); s = callBackAssemblyCache[key]; if (s.IsPlugin) { return(callControlMethod(s, param)); } else { return(callNormalMethod(s, param)); } } else { if (s.IsPlugin) { return(callControlMethod(s, param)); } else { return(callNormalMethod(s, param)); } } } if (s == null) { throw new ApplicationException("找不到调用方法,方法调用失败"); } return(null); }
private void FanRibbonFormContainer_FormClosed(object sender, FormClosedEventArgs e) { //string xml = Directory.GetCurrentDirectory() + "\\Config\\layout.xml"; //this.dockManager1.SaveLayoutToXml(xml); HookHolder.Dispose(); IControlAddress controlAddressService = ServiceContainer.CreateInstance().Resolve <IControlAddress>("ControlAddressService"); if (controlAddressService != null) { controlAddressService.Unregister(); } this.image16Collection.Images.Clear(); this.image32Collection.Images.Clear(); GlobalParamService.Clear(); }