Abcbokesdfklsdjlf※
11111111111111111111111111111111111111111111111111111111111111111111111 |
?
1111111 |
Uuiu |
Iii |
Iooo |
Pppp |
ppppoj |
? | ? | ? |
? | ? | ? |
? | ? | ? |
? | ? | ? |
? | ? | ? |
?
var htmlstr = "<object classid=‘clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95‘ id=‘MediaPlayer1‘ width=‘" + getFullHeight().width + "‘ height=‘450‘>"; htmlstr htmlstr htmlstr $("#player").html(htmlstr); |
?
<?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section </configSections> <unity> <!--定义类型别名--> <aliases> <add <add <add ? <add <add </aliases> ? <!--容器--> <container <!--映射关系--> <register <register <register </container> </unity> </configuration> |
?
static void Main(string[] args) { //ContainerCode(); ? ContainerConfiguration(); ? ? Console.ReadKey(); } ? ? static { IUnityContainer container = new ? //默认注册(无命名),如果后面还有默认注册会覆盖前面的 container.RegisterType<IProduct, Milk>(); ? //ContainerControlledLifetimeManager,注册为单例类 //container.RegisterType<IProduct, Milk>(new ContainerControlledLifetimeManager()); ? //命名注册 container.RegisterType<IProduct, Sugar>("Sugar"); ? //解析默认对象 IProduct _product = container.Resolve<IProduct>(); _product.ClassName = _product.GetType().ToString(); _product.ShowInfo(); ? //指定命名解析对象 IProduct _sugar = container.Resolve<IProduct>("Sugar"); _sugar.ClassName = _sugar.GetType().ToString(); _sugar.ShowInfo(); ? IEnumerable<IProduct> classList = container.ResolveAll<IProduct>(); ? foreach (var item in classList) { item.ClassName = item.GetType().ToString(); item.ShowInfo(); } } ? ? //配置文件注入代码 static { IUnityContainer container = new ? UnityConfigurationSection section = (UnityConfigurationSection)ConfigurationManager.GetSection("unity"); section.Configure(container, "mycontainer");//mycontainer ? IProduct product = container.Resolve<IProduct>("Sugar"); product.ClassName = "fjsdkjflksd"; product.ShowInfo(); ? IPerson p = container.Resolve<IPerson>("c"); string a = p.Speak(); Console.WriteLine(a); } |