From f52ed8c8edbec67e19cb398c602f07bd01511f49 Mon Sep 17 00:00:00 2001 From: ioancrisan Date: Fri, 8 Feb 2013 17:13:44 +0200 Subject: [PATCH 1/4] Added support for Silverlight 4 --- Common.Logging.2010-sl40.sln | 262 ++++++++++++++++++ .../Collections/NameValueCollection.cs | 25 ++ .../Common.Logging.2010-sl40.csproj | 112 ++++++++ src/Common.Logging/Common.Logging.nuspec | 3 + .../Logging/Configuration/ArgUtils.cs | 40 ++- .../DefaultConfigurationReader.cs | 4 + .../Logging/ConfigurationException.cs | 9 +- .../AbstractCachingLoggerFactoryAdapter.cs | 18 +- .../Logging/Factory/AbstractLogger.cs | 3 + src/Common.Logging/Logging/LogManager.cs | 8 + .../Logging/Simple/AbstractSimpleLogger.cs | 3 + .../Simple/CapturingLoggerFactoryAdapter.cs | 12 +- .../Logging/Simple/ConsoleOutLogger.cs | 3 + .../Logging/Simple/NoOpLogger.cs | 3 + src/CommonAssemblyInfo.cs | 3 + 15 files changed, 477 insertions(+), 31 deletions(-) create mode 100644 Common.Logging.2010-sl40.sln create mode 100644 src/Common.Logging/Collections/NameValueCollection.cs create mode 100644 src/Common.Logging/Common.Logging.2010-sl40.csproj diff --git a/Common.Logging.2010-sl40.sln b/Common.Logging.2010-sl40.sln new file mode 100644 index 0000000..dc27fd8 --- /dev/null +++ b/Common.Logging.2010-sl40.sln @@ -0,0 +1,262 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{EC54316A-A3B9-4EF5-A74C-1EC2344D0EA4}" + ProjectSection(SolutionItems) = preProject + changelog.txt = changelog.txt + Common.Logging.build = Common.Logging.build + src\CommonAssemblyInfo.cs.template = src\CommonAssemblyInfo.cs.template + doc\api\introduction.html = doc\api\introduction.html + Logging.ndoc = Logging.ndoc + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logging.2010-net40", "src\Common.Logging\Common.Logging.2010-net40.csproj", "{440D903A-D409-48FC-A6C4-3EE69CCD663B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logging.EntLib31.2010-net40", "src\Common.Logging.EntLib31\Common.Logging.EntLib31.2010-net40.csproj", "{C493B9F9-EB13-4D07-BBBD-A333DCF15164}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logging.EntLib41.2010-net40", "src\Common.Logging.EntLib41\Common.Logging.EntLib41.2010-net40.csproj", "{F2C864F8-4BD9-431F-9810-70E377F95027}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logging.Log4Net1210.2010-net40", "src\Common.Logging.Log4Net1210\Common.Logging.Log4Net1210.2010-net40.csproj", "{0FEA262C-4EAF-49DB-8D32-8E90DDEF23B6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logging.Log4Net129.2010-net40", "src\Common.Logging.Log4Net129\Common.Logging.Log4Net129.2010-net40.csproj", "{A6A7257A-D1AE-4A09-8C1C-F55E099C8A8A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logging.Tests.2010-net40", "test\Common.Logging.Tests\Common.Logging.Tests.2010-net40.csproj", "{94E4E1B4-D424-4EB9-BF34-2EE8CC3D7048}" +EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Common.Logging.Tests.Integration.Vb.2010-net40", "test\Common.Logging.Integration.Tests.Vb\Common.Logging.Tests.Integration.Vb.2010-net40.vbproj", "{3DFB4EAE-A2DD-43F1-ABA6-E28EB1C7DC67}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logging.EntLib31.Tests.2010-net40", "test\Common.Logging.EntLib31.Tests\Common.Logging.EntLib31.Tests.2010-net40.csproj", "{74434B76-0465-45E6-8262-1745638E19D8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logging.EntLib31.Tests.Integration.2010-net40", "test\Common.Logging.EntLib31.Integration.Tests\Common.Logging.EntLib31.Tests.Integration.2010-net40.csproj", "{63F2C13B-4377-4BAA-9104-5BEA389A4621}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logging.EntLib41.Tests.2010-net40", "test\Common.Logging.EntLib41.Tests\Common.Logging.EntLib41.Tests.2010-net40.csproj", "{B7DF833E-8260-40CC-9384-7CF747E30B12}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logging.EntLib41.Tests.Integration.2010-net40", "test\Common.Logging.EntLib41.Integration.Tests\Common.Logging.EntLib41.Tests.Integration.2010-net40.csproj", "{E641F51F-1B51-4B94-B419-F902EABCE4D5}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logging.Tests.Integration.2010-net40", "test\Common.Logging.Integration.Tests\Common.Logging.Tests.Integration.2010-net40.csproj", "{E641F51F-1B51-4B94-B419-F902EABCE4D4}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logging.Log4Net1210.Tests.2010-net40", "test\Common.Logging.Log4Net1210.Tests\Common.Logging.Log4Net1210.Tests.2010-net40.csproj", "{8FBECEDA-78A0-4429-B791-B9219ED49B36}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logging.Log4Net1210.Tests.Integration.2010-net40", "test\Common.Logging.Log4Net1210.Integration.Tests\Common.Logging.Log4Net1210.Tests.Integration.2010-net40.csproj", "{F7D4B5FA-16FC-4C8A-97B4-FCD391ADE0AF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logging.Log4Net129.Tests.2010-net40", "test\Common.Logging.Log4Net129.Tests\Common.Logging.Log4Net129.Tests.2010-net40.csproj", "{EDA14ED0-E442-4FBD-9FD6-E6F9732500A0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logging.Log4Net129.Tests.Integration.2010-net40", "test\Common.Logging.Log4Net129.Integration.Tests\Common.Logging.Log4Net129.Tests.Integration.2010-net40.csproj", "{F8F786C4-6B20-4E71-9693-6BF367ED6AA1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logging.Tests.BinaryCompatibility.2010-net40", "test\Common.Logging.BinaryCompatibility.Tests\Common.Logging.Tests.BinaryCompatibility.2010-net40.csproj", "{E641F51F-1B51-4B94-B419-A902EABCE4D4}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logging.TestUtils-net40", "test\Common.Logging.TestUtils\Common.Logging.TestUtils-net40.csproj", "{F5193CD8-B431-48ED-B101-D8DBEF766140}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logging.Log4Net1211.2010-net40", "src\Common.Logging.Log4Net1211\Common.Logging.Log4Net1211.2010-net40.csproj", "{2756B5D0-B576-417F-A107-1695DF76D34A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logging.Log4Net1211.Tests.2010-net40", "test\Common.Logging.Log4Net1211.Tests\Common.Logging.Log4Net1211.Tests.2010-net40.csproj", "{C1C5EA00-6553-4C57-B9BC-39B116021715}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logging.Log4Net1211.Tests.Integration.2010-net40", "test\Common.Logging.Log4Net1211.Integration.Tests\Common.Logging.Log4Net1211.Tests.Integration.2010-net40.csproj", "{AA8A77A4-143E-4BD5-B188-7133C65E5050}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NLog-1.0", "NLog-1.0", "{4F43F098-FBFF-4DA7-97E8-E8ACC4968600}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "EntLib-3.1", "EntLib-3.1", "{ED9F22F6-586F-442E-A102-18D0F192520A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "EntLib-4.1", "EntLib-4.1", "{BD64C6A8-FE60-470F-89CD-1412076FDEF4}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Log4Net-1.2.10", "Log4Net-1.2.10", "{32768117-3FA1-4EE4-B464-0AD8565AC606}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Log4Net-1.2.9", "Log4Net-1.2.9", "{37709784-DCD6-4A6A-8EC5-7B1BF4EA0BAF}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Log4Net-1.2.11", "Log4Net-1.2.11", "{67DEB60F-761A-41F0-9E0F-6D374D82C090}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CommonLogging", "CommonLogging", "{D26BC7B2-718C-4F97-AF36-4377E19ECE62}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NLog-2.0", "NLog-2.0", "{B325DB50-238B-4B85-A03F-DA92E611C73D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "EntLib-5.0", "EntLib-5.0", "{7E15F131-2DB4-4E83-9DF0-3A3A272B4FAD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logging.EntLib50.2010-net40", "src\Common.Logging.EntLib50\Common.Logging.EntLib50.2010-net40.csproj", "{8E5D50C8-85AC-41EA-AA26-2667494D4FAF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logging.EntLib50.Tests.2010-net40", "test\Common.Logging.EntLib50.Tests\Common.Logging.EntLib50.Tests.2010-net40.csproj", "{9FD3F78B-90B7-47DC-B4B5-05EBF2267227}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logging.EntLib50.Tests.Integration.2010-net40", "test\Common.Logging.EntLib50.Tests.Integration\Common.Logging.EntLib50.Tests.Integration.2010-net40.csproj", "{4520C7E5-2532-4AC5-9CE8-0CDDADF006CB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logging.NLog20.2010-net40", "src\Common.Logging.NLog20\Common.Logging.NLog20.2010-net40.csproj", "{AC34A9CF-F893-4D1F-99C3-9B703CE6A035}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logging.NLog20.Tests.2010-net40", "test\Common.Logging.NLog20.Tests\Common.Logging.NLog20.Tests.2010-net40.csproj", "{45AFA285-AB51-450E-8C56-C1D41B17FD00}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logging.NLog20.Tests.Integration.2010-net40", "test\Common.Logging.NLog20.Integration.Tests\Common.Logging.NLog20.Tests.Integration.2010-net40.csproj", "{21CAAB7F-6775-4277-AEFB-6A1A3799C0E6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logging.NLog10.Tests.2010-net40", "test\Common.Logging.NLog10.Tests\Common.Logging.NLog10.Tests.2010-net40.csproj", "{B4BB1353-924A-40F0-9AA5-A7C28AB68F69}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logging.NLog10.Tests.Integration.2010-net40", "test\Common.Logging.NLog10.Integration.Tests\Common.Logging.NLog10.Tests.Integration.2010-net40.csproj", "{EE5CA38F-3F29-43E1-B385-03798EDDC765}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logging.NLog10.2010-net40", "src\Common.Logging.NLog10\Common.Logging.NLog10.2010-net40.csproj", "{C3FAAF50-CA05-42A5-9616-B48C21643D03}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logging.2010-sl40", "src\Common.Logging\Common.Logging.2010-sl40.csproj", "{C185F156-BEFC-44A0-8F25-065558AEDB6A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {440D903A-D409-48FC-A6C4-3EE69CCD663B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {440D903A-D409-48FC-A6C4-3EE69CCD663B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {440D903A-D409-48FC-A6C4-3EE69CCD663B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {440D903A-D409-48FC-A6C4-3EE69CCD663B}.Release|Any CPU.Build.0 = Release|Any CPU + {C493B9F9-EB13-4D07-BBBD-A333DCF15164}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C493B9F9-EB13-4D07-BBBD-A333DCF15164}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C493B9F9-EB13-4D07-BBBD-A333DCF15164}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C493B9F9-EB13-4D07-BBBD-A333DCF15164}.Release|Any CPU.Build.0 = Release|Any CPU + {F2C864F8-4BD9-431F-9810-70E377F95027}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F2C864F8-4BD9-431F-9810-70E377F95027}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F2C864F8-4BD9-431F-9810-70E377F95027}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F2C864F8-4BD9-431F-9810-70E377F95027}.Release|Any CPU.Build.0 = Release|Any CPU + {0FEA262C-4EAF-49DB-8D32-8E90DDEF23B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0FEA262C-4EAF-49DB-8D32-8E90DDEF23B6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0FEA262C-4EAF-49DB-8D32-8E90DDEF23B6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0FEA262C-4EAF-49DB-8D32-8E90DDEF23B6}.Release|Any CPU.Build.0 = Release|Any CPU + {A6A7257A-D1AE-4A09-8C1C-F55E099C8A8A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A6A7257A-D1AE-4A09-8C1C-F55E099C8A8A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A6A7257A-D1AE-4A09-8C1C-F55E099C8A8A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A6A7257A-D1AE-4A09-8C1C-F55E099C8A8A}.Release|Any CPU.Build.0 = Release|Any CPU + {94E4E1B4-D424-4EB9-BF34-2EE8CC3D7048}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {94E4E1B4-D424-4EB9-BF34-2EE8CC3D7048}.Debug|Any CPU.Build.0 = Debug|Any CPU + {94E4E1B4-D424-4EB9-BF34-2EE8CC3D7048}.Release|Any CPU.ActiveCfg = Release|Any CPU + {94E4E1B4-D424-4EB9-BF34-2EE8CC3D7048}.Release|Any CPU.Build.0 = Release|Any CPU + {3DFB4EAE-A2DD-43F1-ABA6-E28EB1C7DC67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3DFB4EAE-A2DD-43F1-ABA6-E28EB1C7DC67}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3DFB4EAE-A2DD-43F1-ABA6-E28EB1C7DC67}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3DFB4EAE-A2DD-43F1-ABA6-E28EB1C7DC67}.Release|Any CPU.Build.0 = Release|Any CPU + {74434B76-0465-45E6-8262-1745638E19D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {74434B76-0465-45E6-8262-1745638E19D8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {74434B76-0465-45E6-8262-1745638E19D8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {74434B76-0465-45E6-8262-1745638E19D8}.Release|Any CPU.Build.0 = Release|Any CPU + {63F2C13B-4377-4BAA-9104-5BEA389A4621}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {63F2C13B-4377-4BAA-9104-5BEA389A4621}.Debug|Any CPU.Build.0 = Debug|Any CPU + {63F2C13B-4377-4BAA-9104-5BEA389A4621}.Release|Any CPU.ActiveCfg = Release|Any CPU + {63F2C13B-4377-4BAA-9104-5BEA389A4621}.Release|Any CPU.Build.0 = Release|Any CPU + {B7DF833E-8260-40CC-9384-7CF747E30B12}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B7DF833E-8260-40CC-9384-7CF747E30B12}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B7DF833E-8260-40CC-9384-7CF747E30B12}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B7DF833E-8260-40CC-9384-7CF747E30B12}.Release|Any CPU.Build.0 = Release|Any CPU + {E641F51F-1B51-4B94-B419-F902EABCE4D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E641F51F-1B51-4B94-B419-F902EABCE4D5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E641F51F-1B51-4B94-B419-F902EABCE4D5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E641F51F-1B51-4B94-B419-F902EABCE4D5}.Release|Any CPU.Build.0 = Release|Any CPU + {E641F51F-1B51-4B94-B419-F902EABCE4D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E641F51F-1B51-4B94-B419-F902EABCE4D4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E641F51F-1B51-4B94-B419-F902EABCE4D4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E641F51F-1B51-4B94-B419-F902EABCE4D4}.Release|Any CPU.Build.0 = Release|Any CPU + {8FBECEDA-78A0-4429-B791-B9219ED49B36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8FBECEDA-78A0-4429-B791-B9219ED49B36}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8FBECEDA-78A0-4429-B791-B9219ED49B36}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8FBECEDA-78A0-4429-B791-B9219ED49B36}.Release|Any CPU.Build.0 = Release|Any CPU + {F7D4B5FA-16FC-4C8A-97B4-FCD391ADE0AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F7D4B5FA-16FC-4C8A-97B4-FCD391ADE0AF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F7D4B5FA-16FC-4C8A-97B4-FCD391ADE0AF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F7D4B5FA-16FC-4C8A-97B4-FCD391ADE0AF}.Release|Any CPU.Build.0 = Release|Any CPU + {EDA14ED0-E442-4FBD-9FD6-E6F9732500A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EDA14ED0-E442-4FBD-9FD6-E6F9732500A0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EDA14ED0-E442-4FBD-9FD6-E6F9732500A0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EDA14ED0-E442-4FBD-9FD6-E6F9732500A0}.Release|Any CPU.Build.0 = Release|Any CPU + {F8F786C4-6B20-4E71-9693-6BF367ED6AA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F8F786C4-6B20-4E71-9693-6BF367ED6AA1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F8F786C4-6B20-4E71-9693-6BF367ED6AA1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F8F786C4-6B20-4E71-9693-6BF367ED6AA1}.Release|Any CPU.Build.0 = Release|Any CPU + {E641F51F-1B51-4B94-B419-A902EABCE4D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E641F51F-1B51-4B94-B419-A902EABCE4D4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E641F51F-1B51-4B94-B419-A902EABCE4D4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E641F51F-1B51-4B94-B419-A902EABCE4D4}.Release|Any CPU.Build.0 = Release|Any CPU + {F5193CD8-B431-48ED-B101-D8DBEF766140}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F5193CD8-B431-48ED-B101-D8DBEF766140}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F5193CD8-B431-48ED-B101-D8DBEF766140}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F5193CD8-B431-48ED-B101-D8DBEF766140}.Release|Any CPU.Build.0 = Release|Any CPU + {2756B5D0-B576-417F-A107-1695DF76D34A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2756B5D0-B576-417F-A107-1695DF76D34A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2756B5D0-B576-417F-A107-1695DF76D34A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2756B5D0-B576-417F-A107-1695DF76D34A}.Release|Any CPU.Build.0 = Release|Any CPU + {C1C5EA00-6553-4C57-B9BC-39B116021715}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C1C5EA00-6553-4C57-B9BC-39B116021715}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C1C5EA00-6553-4C57-B9BC-39B116021715}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C1C5EA00-6553-4C57-B9BC-39B116021715}.Release|Any CPU.Build.0 = Release|Any CPU + {AA8A77A4-143E-4BD5-B188-7133C65E5050}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AA8A77A4-143E-4BD5-B188-7133C65E5050}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AA8A77A4-143E-4BD5-B188-7133C65E5050}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AA8A77A4-143E-4BD5-B188-7133C65E5050}.Release|Any CPU.Build.0 = Release|Any CPU + {8E5D50C8-85AC-41EA-AA26-2667494D4FAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E5D50C8-85AC-41EA-AA26-2667494D4FAF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E5D50C8-85AC-41EA-AA26-2667494D4FAF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E5D50C8-85AC-41EA-AA26-2667494D4FAF}.Release|Any CPU.Build.0 = Release|Any CPU + {9FD3F78B-90B7-47DC-B4B5-05EBF2267227}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9FD3F78B-90B7-47DC-B4B5-05EBF2267227}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9FD3F78B-90B7-47DC-B4B5-05EBF2267227}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9FD3F78B-90B7-47DC-B4B5-05EBF2267227}.Release|Any CPU.Build.0 = Release|Any CPU + {4520C7E5-2532-4AC5-9CE8-0CDDADF006CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4520C7E5-2532-4AC5-9CE8-0CDDADF006CB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4520C7E5-2532-4AC5-9CE8-0CDDADF006CB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4520C7E5-2532-4AC5-9CE8-0CDDADF006CB}.Release|Any CPU.Build.0 = Release|Any CPU + {AC34A9CF-F893-4D1F-99C3-9B703CE6A035}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AC34A9CF-F893-4D1F-99C3-9B703CE6A035}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AC34A9CF-F893-4D1F-99C3-9B703CE6A035}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AC34A9CF-F893-4D1F-99C3-9B703CE6A035}.Release|Any CPU.Build.0 = Release|Any CPU + {45AFA285-AB51-450E-8C56-C1D41B17FD00}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {45AFA285-AB51-450E-8C56-C1D41B17FD00}.Debug|Any CPU.Build.0 = Debug|Any CPU + {45AFA285-AB51-450E-8C56-C1D41B17FD00}.Release|Any CPU.ActiveCfg = Release|Any CPU + {45AFA285-AB51-450E-8C56-C1D41B17FD00}.Release|Any CPU.Build.0 = Release|Any CPU + {21CAAB7F-6775-4277-AEFB-6A1A3799C0E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {21CAAB7F-6775-4277-AEFB-6A1A3799C0E6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {21CAAB7F-6775-4277-AEFB-6A1A3799C0E6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {21CAAB7F-6775-4277-AEFB-6A1A3799C0E6}.Release|Any CPU.Build.0 = Release|Any CPU + {B4BB1353-924A-40F0-9AA5-A7C28AB68F69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B4BB1353-924A-40F0-9AA5-A7C28AB68F69}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B4BB1353-924A-40F0-9AA5-A7C28AB68F69}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B4BB1353-924A-40F0-9AA5-A7C28AB68F69}.Release|Any CPU.Build.0 = Release|Any CPU + {EE5CA38F-3F29-43E1-B385-03798EDDC765}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EE5CA38F-3F29-43E1-B385-03798EDDC765}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EE5CA38F-3F29-43E1-B385-03798EDDC765}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EE5CA38F-3F29-43E1-B385-03798EDDC765}.Release|Any CPU.Build.0 = Release|Any CPU + {C3FAAF50-CA05-42A5-9616-B48C21643D03}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C3FAAF50-CA05-42A5-9616-B48C21643D03}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C3FAAF50-CA05-42A5-9616-B48C21643D03}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C3FAAF50-CA05-42A5-9616-B48C21643D03}.Release|Any CPU.Build.0 = Release|Any CPU + {C185F156-BEFC-44A0-8F25-065558AEDB6A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C185F156-BEFC-44A0-8F25-065558AEDB6A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C185F156-BEFC-44A0-8F25-065558AEDB6A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C185F156-BEFC-44A0-8F25-065558AEDB6A}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {94E4E1B4-D424-4EB9-BF34-2EE8CC3D7048} = {D26BC7B2-718C-4F97-AF36-4377E19ECE62} + {E641F51F-1B51-4B94-B419-F902EABCE4D4} = {D26BC7B2-718C-4F97-AF36-4377E19ECE62} + {E641F51F-1B51-4B94-B419-A902EABCE4D4} = {D26BC7B2-718C-4F97-AF36-4377E19ECE62} + {F5193CD8-B431-48ED-B101-D8DBEF766140} = {D26BC7B2-718C-4F97-AF36-4377E19ECE62} + {440D903A-D409-48FC-A6C4-3EE69CCD663B} = {D26BC7B2-718C-4F97-AF36-4377E19ECE62} + {C185F156-BEFC-44A0-8F25-065558AEDB6A} = {D26BC7B2-718C-4F97-AF36-4377E19ECE62} + {74434B76-0465-45E6-8262-1745638E19D8} = {ED9F22F6-586F-442E-A102-18D0F192520A} + {63F2C13B-4377-4BAA-9104-5BEA389A4621} = {ED9F22F6-586F-442E-A102-18D0F192520A} + {C493B9F9-EB13-4D07-BBBD-A333DCF15164} = {ED9F22F6-586F-442E-A102-18D0F192520A} + {B7DF833E-8260-40CC-9384-7CF747E30B12} = {BD64C6A8-FE60-470F-89CD-1412076FDEF4} + {E641F51F-1B51-4B94-B419-F902EABCE4D5} = {BD64C6A8-FE60-470F-89CD-1412076FDEF4} + {F2C864F8-4BD9-431F-9810-70E377F95027} = {BD64C6A8-FE60-470F-89CD-1412076FDEF4} + {8FBECEDA-78A0-4429-B791-B9219ED49B36} = {32768117-3FA1-4EE4-B464-0AD8565AC606} + {F7D4B5FA-16FC-4C8A-97B4-FCD391ADE0AF} = {32768117-3FA1-4EE4-B464-0AD8565AC606} + {0FEA262C-4EAF-49DB-8D32-8E90DDEF23B6} = {32768117-3FA1-4EE4-B464-0AD8565AC606} + {EDA14ED0-E442-4FBD-9FD6-E6F9732500A0} = {37709784-DCD6-4A6A-8EC5-7B1BF4EA0BAF} + {F8F786C4-6B20-4E71-9693-6BF367ED6AA1} = {37709784-DCD6-4A6A-8EC5-7B1BF4EA0BAF} + {A6A7257A-D1AE-4A09-8C1C-F55E099C8A8A} = {37709784-DCD6-4A6A-8EC5-7B1BF4EA0BAF} + {C1C5EA00-6553-4C57-B9BC-39B116021715} = {67DEB60F-761A-41F0-9E0F-6D374D82C090} + {AA8A77A4-143E-4BD5-B188-7133C65E5050} = {67DEB60F-761A-41F0-9E0F-6D374D82C090} + {2756B5D0-B576-417F-A107-1695DF76D34A} = {67DEB60F-761A-41F0-9E0F-6D374D82C090} + {B4BB1353-924A-40F0-9AA5-A7C28AB68F69} = {4F43F098-FBFF-4DA7-97E8-E8ACC4968600} + {EE5CA38F-3F29-43E1-B385-03798EDDC765} = {4F43F098-FBFF-4DA7-97E8-E8ACC4968600} + {C3FAAF50-CA05-42A5-9616-B48C21643D03} = {4F43F098-FBFF-4DA7-97E8-E8ACC4968600} + {AC34A9CF-F893-4D1F-99C3-9B703CE6A035} = {B325DB50-238B-4B85-A03F-DA92E611C73D} + {45AFA285-AB51-450E-8C56-C1D41B17FD00} = {B325DB50-238B-4B85-A03F-DA92E611C73D} + {21CAAB7F-6775-4277-AEFB-6A1A3799C0E6} = {B325DB50-238B-4B85-A03F-DA92E611C73D} + {8E5D50C8-85AC-41EA-AA26-2667494D4FAF} = {7E15F131-2DB4-4E83-9DF0-3A3A272B4FAD} + {9FD3F78B-90B7-47DC-B4B5-05EBF2267227} = {7E15F131-2DB4-4E83-9DF0-3A3A272B4FAD} + {4520C7E5-2532-4AC5-9CE8-0CDDADF006CB} = {7E15F131-2DB4-4E83-9DF0-3A3A272B4FAD} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + NAntAddinLastFileName = Common.Logging.build + EndGlobalSection +EndGlobal diff --git a/src/Common.Logging/Collections/NameValueCollection.cs b/src/Common.Logging/Collections/NameValueCollection.cs new file mode 100644 index 0000000..3c7e41c --- /dev/null +++ b/src/Common.Logging/Collections/NameValueCollection.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; + +namespace Common.Logging +{ +#if SILVERLIGHT + + /// + /// Substitute NameValueCollection in System.Collections.Specialized. + /// + public class NameValueCollection : Dictionary + { + /// + /// Creates a new instance of NameValueCollection. + /// + public NameValueCollection() + : base(StringComparer.OrdinalIgnoreCase) + { + + } + } + +#else +#endif +} \ No newline at end of file diff --git a/src/Common.Logging/Common.Logging.2010-sl40.csproj b/src/Common.Logging/Common.Logging.2010-sl40.csproj new file mode 100644 index 0000000..ba4c8a7 --- /dev/null +++ b/src/Common.Logging/Common.Logging.2010-sl40.csproj @@ -0,0 +1,112 @@ + + + + Debug + AnyCPU + 8.0.50727 + 2.0 + {C185F156-BEFC-44A0-8F25-065558AEDB6A} + {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + Common.Logging + Common.Logging + Silverlight + v4.0 + $(TargetFrameworkVersion) + false + true + true + + + + v3.5 + + + true + full + false + ..\..\build\sl40\Common.Logging\Debug\ + DEBUG;TRACE;SILVERLIGHT + true + true + prompt + 4 + ..\..\build\sl40\Common.Logging\Debug\Common.Logging.XML + + + pdbonly + true + ..\..\build\sl40\Common.Logging\Release\ + TRACE;SILVERLIGHT + true + true + prompt + 4 + ..\..\build\sl40\Common.Logging\Release\Common.Logging.XML + + + + + + + + + + + + + CommonAssemblyInfo.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Common.Logging/Common.Logging.nuspec b/src/Common.Logging/Common.Logging.nuspec index 5dd4fc4..8306680 100644 --- a/src/Common.Logging/Common.Logging.nuspec +++ b/src/Common.Logging/Common.Logging.nuspec @@ -17,5 +17,8 @@ + + + \ No newline at end of file diff --git a/src/Common.Logging/Logging/Configuration/ArgUtils.cs b/src/Common.Logging/Logging/Configuration/ArgUtils.cs index fa1cc73..443e13a 100644 --- a/src/Common.Logging/Logging/Configuration/ArgUtils.cs +++ b/src/Common.Logging/Logging/Configuration/ArgUtils.cs @@ -20,6 +20,7 @@ using System; using System.Collections; +using System.Collections.Generic; using System.Collections.Specialized; using System.Diagnostics; @@ -36,21 +37,21 @@ public static class ArgUtils /// public delegate T ParseHandler(string strValue); - private static readonly Hashtable s_parsers; + private static readonly Dictionary s_parsers; /// /// Initialize all members before any of this class' methods can be accessed (avoids beforeFieldInit) /// static ArgUtils() { - s_parsers = new Hashtable(); - RegisterTypeParser(delegate(string s) { return Convert.ToBoolean(s); }); - RegisterTypeParser(delegate(string s) { return Convert.ToInt16(s); }); - RegisterTypeParser(delegate(string s) { return Convert.ToInt32(s); }); - RegisterTypeParser(delegate(string s) { return Convert.ToInt64(s); }); - RegisterTypeParser(delegate(string s) { return Convert.ToSingle(s); }); - RegisterTypeParser(delegate(string s) { return Convert.ToDouble(s); }); - RegisterTypeParser(delegate(string s) { return Convert.ToDecimal(s); }); + s_parsers = new Dictionary(); + RegisterTypeParser(Convert.ToBoolean); + RegisterTypeParser(Convert.ToInt16); + RegisterTypeParser(Convert.ToInt32); + RegisterTypeParser(Convert.ToInt64); + RegisterTypeParser(Convert.ToSingle); + RegisterTypeParser(Convert.ToDouble); + RegisterTypeParser(Convert.ToDecimal); } /// @@ -86,9 +87,9 @@ public static string GetValue(NameValueCollection values, string name, string de { if (values != null) { - foreach (string key in values.AllKeys) + foreach (string key in values.Keys) { - if (string.Compare(name, key, true) == 0) + if (string.Compare(name, key, StringComparison.OrdinalIgnoreCase) == 0) { return values[name]; } @@ -162,7 +163,11 @@ public static T TryParseEnum(T defaultValue, string stringValue) where T : st } catch { +#if SILVERLIGHT + Debug.WriteLine(string.Format("WARN: failed converting value '{0}' to enum type '{1}'", stringValue, defaultValue.GetType().FullName)); +#else Trace.WriteLine(string.Format("WARN: failed converting value '{0}' to enum type '{1}'", stringValue, defaultValue.GetType().FullName)); +#endif } return result; } @@ -181,19 +186,24 @@ public static T TryParse(T defaultValue, string stringValue) return defaultValue; } - ParseHandler parser = s_parsers[typeof(T)] as ParseHandler; - if (parser == null) + object untypedParser; + if (!s_parsers.TryGetValue(typeof(T), out untypedParser) || !(untypedParser is ParseHandler)) { throw new ArgumentException(string.Format("There is no parser registered for type {0}", typeof(T).FullName)); } + var parser = (ParseHandler)untypedParser; try { result = parser(stringValue); } catch { +#if SILVERLIGHT + Debug.WriteLine(string.Format("WARN: failed converting value '{0}' to type '{1}' - returning default '{2}'", stringValue, typeof(T).FullName, result)); +#else Trace.WriteLine(string.Format("WARN: failed converting value '{0}' to type '{1}' - returning default '{2}'", stringValue, typeof(T).FullName, result)); +#endif } return result; } @@ -250,7 +260,11 @@ public static Type AssertIsAssignable(string paramName, Type valType, string if (!typeof(T).IsAssignableFrom(valType)) { +#if SILVERLIGHT + throw new ArgumentOutOfRangeException(paramName, string.Format(messageFormat, args)); +#else throw new ArgumentOutOfRangeException(paramName, valType, string.Format(messageFormat, args)); +#endif } return valType; } diff --git a/src/Common.Logging/Logging/Configuration/DefaultConfigurationReader.cs b/src/Common.Logging/Logging/Configuration/DefaultConfigurationReader.cs index 6a941c1..aa34bd3 100644 --- a/src/Common.Logging/Logging/Configuration/DefaultConfigurationReader.cs +++ b/src/Common.Logging/Logging/Configuration/DefaultConfigurationReader.cs @@ -47,7 +47,11 @@ public class DefaultConfigurationReader : IConfigurationReader /// public object GetSection(string sectionName) { +#if SILVERLIGHT + return null; +#else return ConfigurationManager.GetSection(sectionName); +#endif } } } \ No newline at end of file diff --git a/src/Common.Logging/Logging/ConfigurationException.cs b/src/Common.Logging/Logging/ConfigurationException.cs index 6254b54..3c9edda 100644 --- a/src/Common.Logging/Logging/ConfigurationException.cs +++ b/src/Common.Logging/Logging/ConfigurationException.cs @@ -27,8 +27,12 @@ namespace Common.Logging /// The exception that is thrown when a configuration system error has occurred with Common.Logging /// /// Mark Pollack +#if SILVERLIGHT + public class ConfigurationException : Exception +#else [Serializable] public class ConfigurationException : ApplicationException +#endif { #region Constructor (s) / Destructor @@ -62,7 +66,9 @@ public ConfigurationException(string message, Exception rootCause) { } - /// +#if SILVERLIGHT +#else + /// /// Creates a new instance of the ConfigurationException class. /// /// @@ -78,6 +84,7 @@ protected ConfigurationException( : base(info, context) { } +#endif #endregion } diff --git a/src/Common.Logging/Logging/Factory/AbstractCachingLoggerFactoryAdapter.cs b/src/Common.Logging/Logging/Factory/AbstractCachingLoggerFactoryAdapter.cs index 6a5fc61..a4393a7 100644 --- a/src/Common.Logging/Logging/Factory/AbstractCachingLoggerFactoryAdapter.cs +++ b/src/Common.Logging/Logging/Factory/AbstractCachingLoggerFactoryAdapter.cs @@ -19,8 +19,7 @@ #endregion using System; -using System.Collections; -using System.Collections.Specialized; +using System.Collections.Generic; namespace Common.Logging.Factory { @@ -33,7 +32,7 @@ namespace Common.Logging.Factory /// Erich Eichinger public abstract class AbstractCachingLoggerFactoryAdapter : ILoggerFactoryAdapter { - private readonly Hashtable _cachedLoggers; + private readonly Dictionary _cachedLoggers; /// /// Creates a new instance, the logger cache being case-sensitive. @@ -47,9 +46,9 @@ protected AbstractCachingLoggerFactoryAdapter():this(true) /// protected AbstractCachingLoggerFactoryAdapter(bool caseSensitiveLoggerCache) { - _cachedLoggers = (caseSensitiveLoggerCache) - ? new Hashtable() - : CollectionsUtil.CreateCaseInsensitiveHashtable(); + _cachedLoggers = (caseSensitiveLoggerCache) + ? new Dictionary() + : new Dictionary(StringComparer.OrdinalIgnoreCase); } /// @@ -107,13 +106,12 @@ public ILog GetLogger(string name) /// private ILog GetLoggerInternal(string name) { - ILog log = _cachedLoggers[name] as ILog; - if (log == null) + ILog log; + if (!_cachedLoggers.TryGetValue(name, out log)) { lock (_cachedLoggers) { - log = _cachedLoggers[name] as ILog; - if (log == null) + if (!_cachedLoggers.TryGetValue(name, out log)) { log = CreateLogger(name); if (log == null) diff --git a/src/Common.Logging/Logging/Factory/AbstractLogger.cs b/src/Common.Logging/Logging/Factory/AbstractLogger.cs index 012a20b..426356c 100644 --- a/src/Common.Logging/Logging/Factory/AbstractLogger.cs +++ b/src/Common.Logging/Logging/Factory/AbstractLogger.cs @@ -27,7 +27,10 @@ namespace Common.Logging.Factory /// Provides base implementation suitable for almost all logger adapters /// /// Erich Eichinger +#if SILVERLIGHT +#else [Serializable] +#endif public abstract class AbstractLogger : ILog { #region FormatMessageCallbackFormattedMessage diff --git a/src/Common.Logging/Logging/LogManager.cs b/src/Common.Logging/Logging/LogManager.cs index 2f3b306..7cefd5e 100644 --- a/src/Common.Logging/Logging/LogManager.cs +++ b/src/Common.Logging/Logging/LogManager.cs @@ -260,7 +260,11 @@ private static ILoggerFactoryAdapter BuildLoggerFactoryAdapter() string message = (ConfigurationReader.GetType() == typeof(DefaultConfigurationReader)) ? string.Format("no configuration section <{0}> found - suppressing logging output", COMMON_LOGGING_SECTION) : string.Format("Custom ConfigurationReader '{0}' returned - suppressing logging output", ConfigurationReader.GetType().FullName); +#if SILVERLIGHT + Debug.WriteLine(message); +#else Trace.WriteLine(message); +#endif ILoggerFactoryAdapter defaultFactory = new NoOpLoggerFactoryAdapter(); return defaultFactory; } @@ -268,7 +272,11 @@ private static ILoggerFactoryAdapter BuildLoggerFactoryAdapter() // ready to use ILoggerFactoryAdapter? if (sectionResult is ILoggerFactoryAdapter) { +#if SILVERLIGHT + Debug.WriteLine(string.Format("Using ILoggerFactoryAdapter returned from custom ConfigurationReader '{0}'", ConfigurationReader.GetType().FullName)); +#else Trace.WriteLine(string.Format("Using ILoggerFactoryAdapter returned from custom ConfigurationReader '{0}'", ConfigurationReader.GetType().FullName)); +#endif return (ILoggerFactoryAdapter)sectionResult; } diff --git a/src/Common.Logging/Logging/Simple/AbstractSimpleLogger.cs b/src/Common.Logging/Logging/Simple/AbstractSimpleLogger.cs index fb541ed..7daf841 100644 --- a/src/Common.Logging/Logging/Simple/AbstractSimpleLogger.cs +++ b/src/Common.Logging/Logging/Simple/AbstractSimpleLogger.cs @@ -29,7 +29,10 @@ namespace Common.Logging.Simple /// Abstract class providing a standard implementation of simple loggers. /// /// Erich Eichinger +#if SILVERLIGHT +#else [Serializable] +#endif public abstract class AbstractSimpleLogger : AbstractLogger { private readonly string _name; diff --git a/src/Common.Logging/Logging/Simple/CapturingLoggerFactoryAdapter.cs b/src/Common.Logging/Logging/Simple/CapturingLoggerFactoryAdapter.cs index f6ab97f..56a679b 100644 --- a/src/Common.Logging/Logging/Simple/CapturingLoggerFactoryAdapter.cs +++ b/src/Common.Logging/Logging/Simple/CapturingLoggerFactoryAdapter.cs @@ -1,7 +1,6 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Collections.Specialized; namespace Common.Logging.Simple { @@ -33,7 +32,7 @@ namespace Common.Logging.Simple /// Erich Eichinger public class CapturingLoggerFactoryAdapter : ILoggerFactoryAdapter { - private readonly Hashtable _cachedLoggers = CollectionsUtil.CreateCaseInsensitiveHashtable(); + private readonly Dictionary _cachedLoggers = new Dictionary(StringComparer.OrdinalIgnoreCase); private volatile CapturingLoggerEvent _lastEvent; @@ -98,13 +97,12 @@ public ILog GetLogger(Type type) /// public ILog GetLogger(string name) { - ILog logger = (ILog)_cachedLoggers[name]; - if (logger == null) + ILog logger; + if(!_cachedLoggers.TryGetValue(name, out logger)) { - lock (_cachedLoggers.SyncRoot) + lock (((ICollection)_cachedLoggers).SyncRoot) { - logger = (ILog)_cachedLoggers[name]; - if (logger == null) + if (!_cachedLoggers.TryGetValue(name, out logger)) { logger = new CapturingLogger(this, name); _cachedLoggers[name] = logger; diff --git a/src/Common.Logging/Logging/Simple/ConsoleOutLogger.cs b/src/Common.Logging/Logging/Simple/ConsoleOutLogger.cs index 735e35f..04797f8 100644 --- a/src/Common.Logging/Logging/Simple/ConsoleOutLogger.cs +++ b/src/Common.Logging/Logging/Simple/ConsoleOutLogger.cs @@ -27,7 +27,10 @@ namespace Common.Logging.Simple /// Sends log messages to . /// /// Gilles Bayon +#if SILVERLIGHT +#else [Serializable] +#endif public class ConsoleOutLogger : AbstractSimpleLogger { /// diff --git a/src/Common.Logging/Logging/Simple/NoOpLogger.cs b/src/Common.Logging/Logging/Simple/NoOpLogger.cs index 3d5f287..2619a45 100644 --- a/src/Common.Logging/Logging/Simple/NoOpLogger.cs +++ b/src/Common.Logging/Logging/Simple/NoOpLogger.cs @@ -28,7 +28,10 @@ namespace Common.Logging.Simple /// /// Gilles Bayon /// Erich Eichinger +#if SILVERLIGHT +#else [Serializable] +#endif [CoverageExclude] public sealed class NoOpLogger : ILog { diff --git a/src/CommonAssemblyInfo.cs b/src/CommonAssemblyInfo.cs index 2e686b2..9a4a5cd 100644 --- a/src/CommonAssemblyInfo.cs +++ b/src/CommonAssemblyInfo.cs @@ -16,7 +16,10 @@ [assembly: CLSCompliantAttribute(true)] [assembly: ComVisibleAttribute(false)] +#if SILVERLIGHT +#else [assembly: AllowPartiallyTrustedCallersAttribute()] +#endif [assembly: AssemblyCompanyAttribute("http://netcommon.sourceforge.net/")] [assembly: AssemblyCopyrightAttribute("Copyright 2006-2011 the Common Infrastructure Libraries Team.")] [assembly: AssemblyTrademarkAttribute("Apache License, Version 2.0")] From ce25dfa97bd0bd29f9b0e1f0abee7f52cce0edff Mon Sep 17 00:00:00 2001 From: ioancrisan Date: Tue, 5 Mar 2013 10:17:03 +0200 Subject: [PATCH 2/4] Portable support added --- Common.Logging.2010-sl40.sln | 13 +- .../Common.Logging.2010-portable.csproj | 80 +++++++++++++ .../Common.Logging.2010-sl40.csproj | 112 ++++++++++++++++++ .../Collections/NameValueCollection.cs | 2 +- .../Common.Logging.2010-net40.csproj | 2 +- .../Common.Logging.2010-sl40.csproj | 6 +- .../Logging/Configuration/ArgUtils.cs | 14 ++- .../DefaultConfigurationReader.cs | 5 +- .../Logging/Configuration/LogSetting.cs | 3 + .../Logging/ConfigurationException.cs | 7 +- .../Logging/Factory/AbstractLogger.cs | 2 +- .../Logging/IConfigurationReader.cs | 3 + src/Common.Logging/Logging/LogManager.cs | 26 ++-- .../Logging/Simple/AbstractSimpleLogger.cs | 2 +- .../AbstractSimpleLoggerFactoryAdapter.cs | 4 + .../Logging/Simple/ConsoleOutLogger.cs | 2 +- .../Simple/ConsoleOutLoggerFactoryAdapter.cs | 3 + .../Logging/Simple/NoOpLogger.cs | 2 +- .../Simple/NoOpLoggerFactoryAdapter.cs | 3 + src/CommonAssemblyInfo.cs | 8 +- 20 files changed, 268 insertions(+), 31 deletions(-) create mode 100644 src/Common.Logging.Portable/Common.Logging.2010-portable.csproj create mode 100644 src/Common.Logging.Silverlight/Common.Logging.2010-sl40.csproj diff --git a/Common.Logging.2010-sl40.sln b/Common.Logging.2010-sl40.sln index dc27fd8..c5c826e 100644 --- a/Common.Logging.2010-sl40.sln +++ b/Common.Logging.2010-sl40.sln @@ -1,6 +1,6 @@  -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{EC54316A-A3B9-4EF5-A74C-1EC2344D0EA4}" ProjectSection(SolutionItems) = preProject changelog.txt = changelog.txt @@ -88,7 +88,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logging.NLog10.Tests EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logging.NLog10.2010-net40", "src\Common.Logging.NLog10\Common.Logging.NLog10.2010-net40.csproj", "{C3FAAF50-CA05-42A5-9616-B48C21643D03}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logging.2010-sl40", "src\Common.Logging\Common.Logging.2010-sl40.csproj", "{C185F156-BEFC-44A0-8F25-065558AEDB6A}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logging.2010-portable", "src\Common.Logging.Portable\Common.Logging.2010-portable.csproj", "{34E2A46F-8D61-4AA8-9094-DF0D5035427E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Logging.2010-sl40", "src\Common.Logging.Silverlight\Common.Logging.2010-sl40.csproj", "{C185F156-BEFC-44A0-8F25-065558AEDB6A}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -216,6 +218,10 @@ Global {C3FAAF50-CA05-42A5-9616-B48C21643D03}.Debug|Any CPU.Build.0 = Debug|Any CPU {C3FAAF50-CA05-42A5-9616-B48C21643D03}.Release|Any CPU.ActiveCfg = Release|Any CPU {C3FAAF50-CA05-42A5-9616-B48C21643D03}.Release|Any CPU.Build.0 = Release|Any CPU + {34E2A46F-8D61-4AA8-9094-DF0D5035427E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {34E2A46F-8D61-4AA8-9094-DF0D5035427E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {34E2A46F-8D61-4AA8-9094-DF0D5035427E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {34E2A46F-8D61-4AA8-9094-DF0D5035427E}.Release|Any CPU.Build.0 = Release|Any CPU {C185F156-BEFC-44A0-8F25-065558AEDB6A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C185F156-BEFC-44A0-8F25-065558AEDB6A}.Debug|Any CPU.Build.0 = Debug|Any CPU {C185F156-BEFC-44A0-8F25-065558AEDB6A}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -230,6 +236,7 @@ Global {E641F51F-1B51-4B94-B419-A902EABCE4D4} = {D26BC7B2-718C-4F97-AF36-4377E19ECE62} {F5193CD8-B431-48ED-B101-D8DBEF766140} = {D26BC7B2-718C-4F97-AF36-4377E19ECE62} {440D903A-D409-48FC-A6C4-3EE69CCD663B} = {D26BC7B2-718C-4F97-AF36-4377E19ECE62} + {34E2A46F-8D61-4AA8-9094-DF0D5035427E} = {D26BC7B2-718C-4F97-AF36-4377E19ECE62} {C185F156-BEFC-44A0-8F25-065558AEDB6A} = {D26BC7B2-718C-4F97-AF36-4377E19ECE62} {74434B76-0465-45E6-8262-1745638E19D8} = {ED9F22F6-586F-442E-A102-18D0F192520A} {63F2C13B-4377-4BAA-9104-5BEA389A4621} = {ED9F22F6-586F-442E-A102-18D0F192520A} diff --git a/src/Common.Logging.Portable/Common.Logging.2010-portable.csproj b/src/Common.Logging.Portable/Common.Logging.2010-portable.csproj new file mode 100644 index 0000000..fcc2fe1 --- /dev/null +++ b/src/Common.Logging.Portable/Common.Logging.2010-portable.csproj @@ -0,0 +1,80 @@ + + + + + 10.0 + Debug + AnyCPU + {34E2A46F-8D61-4AA8-9094-DF0D5035427E} + Library + Properties + Common + Common.Logging + v4.0 + Profile1 + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + + + true + full + false + ..\..\build\portable\Common.Logging\Debug\ + TRACE;DEBUG;PORTABLE + prompt + 4 + + + pdbonly + true + ..\..\build\portable\Common.Logging\Release\ + TRACE;PORTABLE + prompt + 4 + + + + + CommonAssemblyInfo.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Common.Logging.Silverlight/Common.Logging.2010-sl40.csproj b/src/Common.Logging.Silverlight/Common.Logging.2010-sl40.csproj new file mode 100644 index 0000000..61ecddb --- /dev/null +++ b/src/Common.Logging.Silverlight/Common.Logging.2010-sl40.csproj @@ -0,0 +1,112 @@ + + + + Debug + AnyCPU + 8.0.50727 + 2.0 + {C185F156-BEFC-44A0-8F25-065558AEDB6A} + {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + Common + Common.Logging + Silverlight + v4.0 + $(TargetFrameworkVersion) + false + true + true + + + + v3.5 + + + true + full + false + ..\..\build\sl40\Common.Logging\Debug\ + TRACE;DEBUG;SILVERLIGHT PORTABLE + true + true + prompt + 4 + ..\..\build\sl40\Common.Logging\Debug\Common.Logging.XML + + + pdbonly + true + ..\..\build\sl40\Common.Logging\Release\ + TRACE;SILVERLIGHT PORTABLE + true + true + prompt + 4 + ..\..\build\sl40\Common.Logging\Release\Common.Logging.XML + + + + + + + + + + + + + CommonAssemblyInfo.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Common.Logging/Collections/NameValueCollection.cs b/src/Common.Logging/Collections/NameValueCollection.cs index 3c7e41c..42eba6d 100644 --- a/src/Common.Logging/Collections/NameValueCollection.cs +++ b/src/Common.Logging/Collections/NameValueCollection.cs @@ -3,7 +3,7 @@ namespace Common.Logging { -#if SILVERLIGHT +#if PORTABLE /// /// Substitute NameValueCollection in System.Collections.Specialized. diff --git a/src/Common.Logging/Common.Logging.2010-net40.csproj b/src/Common.Logging/Common.Logging.2010-net40.csproj index 6b04a6c..4d44fff 100644 --- a/src/Common.Logging/Common.Logging.2010-net40.csproj +++ b/src/Common.Logging/Common.Logging.2010-net40.csproj @@ -55,7 +55,7 @@ ..\..\build\net40\Common.Logging\Release\ TRACE;NET_4_0 prompt - 4 + 3 Common.Logging.xml true 1607 diff --git a/src/Common.Logging/Common.Logging.2010-sl40.csproj b/src/Common.Logging/Common.Logging.2010-sl40.csproj index ba4c8a7..d335d84 100644 --- a/src/Common.Logging/Common.Logging.2010-sl40.csproj +++ b/src/Common.Logging/Common.Logging.2010-sl40.csproj @@ -9,7 +9,7 @@ {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} Library Properties - Common.Logging + Common Common.Logging Silverlight v4.0 @@ -29,7 +29,7 @@ full false ..\..\build\sl40\Common.Logging\Debug\ - DEBUG;TRACE;SILVERLIGHT + TRACE;DEBUG;SILVERLIGHT PORTABLE true true prompt @@ -40,7 +40,7 @@ pdbonly true ..\..\build\sl40\Common.Logging\Release\ - TRACE;SILVERLIGHT + TRACE;SILVERLIGHT PORTABLE true true prompt diff --git a/src/Common.Logging/Logging/Configuration/ArgUtils.cs b/src/Common.Logging/Logging/Configuration/ArgUtils.cs index 443e13a..523a41b 100644 --- a/src/Common.Logging/Logging/Configuration/ArgUtils.cs +++ b/src/Common.Logging/Logging/Configuration/ArgUtils.cs @@ -19,11 +19,15 @@ #endregion using System; -using System.Collections; using System.Collections.Generic; -using System.Collections.Specialized; using System.Diagnostics; +#if PORTABLE +#else +using System.Collections; +using System.Collections.Specialized; +#endif + namespace Common.Logging.Configuration { /// @@ -163,7 +167,7 @@ public static T TryParseEnum(T defaultValue, string stringValue) where T : st } catch { -#if SILVERLIGHT +#if PORTABLE Debug.WriteLine(string.Format("WARN: failed converting value '{0}' to enum type '{1}'", stringValue, defaultValue.GetType().FullName)); #else Trace.WriteLine(string.Format("WARN: failed converting value '{0}' to enum type '{1}'", stringValue, defaultValue.GetType().FullName)); @@ -199,7 +203,7 @@ public static T TryParse(T defaultValue, string stringValue) } catch { -#if SILVERLIGHT +#if PORTABLE Debug.WriteLine(string.Format("WARN: failed converting value '{0}' to type '{1}' - returning default '{2}'", stringValue, typeof(T).FullName, result)); #else Trace.WriteLine(string.Format("WARN: failed converting value '{0}' to type '{1}' - returning default '{2}'", stringValue, typeof(T).FullName, result)); @@ -260,7 +264,7 @@ public static Type AssertIsAssignable(string paramName, Type valType, string if (!typeof(T).IsAssignableFrom(valType)) { -#if SILVERLIGHT +#if PORTABLE throw new ArgumentOutOfRangeException(paramName, string.Format(messageFormat, args)); #else throw new ArgumentOutOfRangeException(paramName, valType, string.Format(messageFormat, args)); diff --git a/src/Common.Logging/Logging/Configuration/DefaultConfigurationReader.cs b/src/Common.Logging/Logging/Configuration/DefaultConfigurationReader.cs index aa34bd3..e1c3b53 100644 --- a/src/Common.Logging/Logging/Configuration/DefaultConfigurationReader.cs +++ b/src/Common.Logging/Logging/Configuration/DefaultConfigurationReader.cs @@ -18,8 +18,11 @@ #endregion +#if PORTABLE +#else using System.Collections.Specialized; using System.Configuration; +#endif namespace Common.Logging.Configuration { @@ -47,7 +50,7 @@ public class DefaultConfigurationReader : IConfigurationReader /// public object GetSection(string sectionName) { -#if SILVERLIGHT +#if PORTABLE return null; #else return ConfigurationManager.GetSection(sectionName); diff --git a/src/Common.Logging/Logging/Configuration/LogSetting.cs b/src/Common.Logging/Logging/Configuration/LogSetting.cs index d54a622..52a5845 100644 --- a/src/Common.Logging/Logging/Configuration/LogSetting.cs +++ b/src/Common.Logging/Logging/Configuration/LogSetting.cs @@ -19,7 +19,10 @@ #endregion using System; +#if PORTABLE +#else using System.Collections.Specialized; +#endif namespace Common.Logging.Configuration { diff --git a/src/Common.Logging/Logging/ConfigurationException.cs b/src/Common.Logging/Logging/ConfigurationException.cs index 3c9edda..5d5e26c 100644 --- a/src/Common.Logging/Logging/ConfigurationException.cs +++ b/src/Common.Logging/Logging/ConfigurationException.cs @@ -19,7 +19,10 @@ #endregion using System; +#if PORTABLE +#else using System.Runtime.Serialization; +#endif namespace Common.Logging { @@ -27,7 +30,7 @@ namespace Common.Logging /// The exception that is thrown when a configuration system error has occurred with Common.Logging /// /// Mark Pollack -#if SILVERLIGHT +#if PORTABLE public class ConfigurationException : Exception #else [Serializable] @@ -66,7 +69,7 @@ public ConfigurationException(string message, Exception rootCause) { } -#if SILVERLIGHT +#if PORTABLE #else /// /// Creates a new instance of the ConfigurationException class. diff --git a/src/Common.Logging/Logging/Factory/AbstractLogger.cs b/src/Common.Logging/Logging/Factory/AbstractLogger.cs index 426356c..45beb72 100644 --- a/src/Common.Logging/Logging/Factory/AbstractLogger.cs +++ b/src/Common.Logging/Logging/Factory/AbstractLogger.cs @@ -27,7 +27,7 @@ namespace Common.Logging.Factory /// Provides base implementation suitable for almost all logger adapters /// /// Erich Eichinger -#if SILVERLIGHT +#if PORTABLE #else [Serializable] #endif diff --git a/src/Common.Logging/Logging/IConfigurationReader.cs b/src/Common.Logging/Logging/IConfigurationReader.cs index 2822a08..6ea2f1e 100644 --- a/src/Common.Logging/Logging/IConfigurationReader.cs +++ b/src/Common.Logging/Logging/IConfigurationReader.cs @@ -18,7 +18,10 @@ #endregion +#if PORTABLE +#else using System.Configuration; +#endif namespace Common.Logging { diff --git a/src/Common.Logging/Logging/LogManager.cs b/src/Common.Logging/Logging/LogManager.cs index 7cefd5e..9461460 100644 --- a/src/Common.Logging/Logging/LogManager.cs +++ b/src/Common.Logging/Logging/LogManager.cs @@ -19,15 +19,19 @@ #endregion using System; -using System.Configuration; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; -using System.Security; -using System.Security.Permissions; using Common.Logging.Simple; using Common.Logging.Configuration; +#if PORTABLE +#else +using System.Configuration; +using System.Security; +using System.Security.Permissions; +#endif + namespace Common.Logging { /// @@ -185,6 +189,8 @@ public static ILoggerFactoryAdapter Adapter } } +#if PORTABLE && !SILVERLIGHT +#else /// /// Gets the logger by calling /// on the currently configured using the type of the calling class. @@ -199,13 +205,15 @@ public static ILoggerFactoryAdapter Adapter [MethodImpl(MethodImplOptions.NoInlining)] public static ILog GetCurrentClassLogger() { - StackFrame frame = new StackFrame(1, false); - ILoggerFactoryAdapter adapter = Adapter; - MethodBase method = frame.GetMethod(); - Type declaringType = method.DeclaringType; + var frame = new StackFrame(1, false); + var adapter = Adapter; + var method = frame.GetMethod(); + var declaringType = method.DeclaringType; return adapter.GetLogger(declaringType); } +#endif + /// /// Gets the logger by calling /// on the currently configured using the specified type. @@ -260,7 +268,7 @@ private static ILoggerFactoryAdapter BuildLoggerFactoryAdapter() string message = (ConfigurationReader.GetType() == typeof(DefaultConfigurationReader)) ? string.Format("no configuration section <{0}> found - suppressing logging output", COMMON_LOGGING_SECTION) : string.Format("Custom ConfigurationReader '{0}' returned - suppressing logging output", ConfigurationReader.GetType().FullName); -#if SILVERLIGHT +#if PORTABLE Debug.WriteLine(message); #else Trace.WriteLine(message); @@ -272,7 +280,7 @@ private static ILoggerFactoryAdapter BuildLoggerFactoryAdapter() // ready to use ILoggerFactoryAdapter? if (sectionResult is ILoggerFactoryAdapter) { -#if SILVERLIGHT +#if PORTABLE Debug.WriteLine(string.Format("Using ILoggerFactoryAdapter returned from custom ConfigurationReader '{0}'", ConfigurationReader.GetType().FullName)); #else Trace.WriteLine(string.Format("Using ILoggerFactoryAdapter returned from custom ConfigurationReader '{0}'", ConfigurationReader.GetType().FullName)); diff --git a/src/Common.Logging/Logging/Simple/AbstractSimpleLogger.cs b/src/Common.Logging/Logging/Simple/AbstractSimpleLogger.cs index 7daf841..b6f0e33 100644 --- a/src/Common.Logging/Logging/Simple/AbstractSimpleLogger.cs +++ b/src/Common.Logging/Logging/Simple/AbstractSimpleLogger.cs @@ -29,7 +29,7 @@ namespace Common.Logging.Simple /// Abstract class providing a standard implementation of simple loggers. /// /// Erich Eichinger -#if SILVERLIGHT +#if PORTABLE #else [Serializable] #endif diff --git a/src/Common.Logging/Logging/Simple/AbstractSimpleLoggerFactoryAdapter.cs b/src/Common.Logging/Logging/Simple/AbstractSimpleLoggerFactoryAdapter.cs index ae9aea1..78e8bab 100644 --- a/src/Common.Logging/Logging/Simple/AbstractSimpleLoggerFactoryAdapter.cs +++ b/src/Common.Logging/Logging/Simple/AbstractSimpleLoggerFactoryAdapter.cs @@ -18,7 +18,11 @@ #endregion +#if PORTABLE +#else using System.Collections.Specialized; +#endif + using Common.Logging.Factory; using Common.Logging.Configuration; diff --git a/src/Common.Logging/Logging/Simple/ConsoleOutLogger.cs b/src/Common.Logging/Logging/Simple/ConsoleOutLogger.cs index 04797f8..71adcbe 100644 --- a/src/Common.Logging/Logging/Simple/ConsoleOutLogger.cs +++ b/src/Common.Logging/Logging/Simple/ConsoleOutLogger.cs @@ -27,7 +27,7 @@ namespace Common.Logging.Simple /// Sends log messages to . /// /// Gilles Bayon -#if SILVERLIGHT +#if PORTABLE #else [Serializable] #endif diff --git a/src/Common.Logging/Logging/Simple/ConsoleOutLoggerFactoryAdapter.cs b/src/Common.Logging/Logging/Simple/ConsoleOutLoggerFactoryAdapter.cs index 4526227..f6d6ca0 100644 --- a/src/Common.Logging/Logging/Simple/ConsoleOutLoggerFactoryAdapter.cs +++ b/src/Common.Logging/Logging/Simple/ConsoleOutLoggerFactoryAdapter.cs @@ -19,7 +19,10 @@ #endregion using System; +#if PORTABLE +#else using System.Collections.Specialized; +#endif namespace Common.Logging.Simple { diff --git a/src/Common.Logging/Logging/Simple/NoOpLogger.cs b/src/Common.Logging/Logging/Simple/NoOpLogger.cs index 2619a45..0b0ef41 100644 --- a/src/Common.Logging/Logging/Simple/NoOpLogger.cs +++ b/src/Common.Logging/Logging/Simple/NoOpLogger.cs @@ -28,7 +28,7 @@ namespace Common.Logging.Simple /// /// Gilles Bayon /// Erich Eichinger -#if SILVERLIGHT +#if PORTABLE #else [Serializable] #endif diff --git a/src/Common.Logging/Logging/Simple/NoOpLoggerFactoryAdapter.cs b/src/Common.Logging/Logging/Simple/NoOpLoggerFactoryAdapter.cs index d1aa14b..f20e2e4 100644 --- a/src/Common.Logging/Logging/Simple/NoOpLoggerFactoryAdapter.cs +++ b/src/Common.Logging/Logging/Simple/NoOpLoggerFactoryAdapter.cs @@ -19,7 +19,10 @@ #endregion using System; +#if PORTABLE +#else using System.Collections.Specialized; +#endif namespace Common.Logging.Simple { diff --git a/src/CommonAssemblyInfo.cs b/src/CommonAssemblyInfo.cs index 9a4a5cd..9c72b34 100644 --- a/src/CommonAssemblyInfo.cs +++ b/src/CommonAssemblyInfo.cs @@ -1,8 +1,12 @@ using System; using System.Reflection; + +#if PORTABLE +#else using System.Runtime.InteropServices; using System.Security; using System.Security.Permissions; +#endif //------------------------------------------------------------------------------ // @@ -15,9 +19,9 @@ //------------------------------------------------------------------------------ [assembly: CLSCompliantAttribute(true)] -[assembly: ComVisibleAttribute(false)] -#if SILVERLIGHT +#if PORTABLE #else +[assembly: ComVisibleAttribute(false)] [assembly: AllowPartiallyTrustedCallersAttribute()] #endif [assembly: AssemblyCompanyAttribute("http://netcommon.sourceforge.net/")] From b6a9a6f43a5dd540164661feadea90c8e3f0b81b Mon Sep 17 00:00:00 2001 From: ioancrisan Date: Tue, 5 Mar 2013 10:17:55 +0200 Subject: [PATCH 3/4] Silverlight moved to seperate folder --- .../Common.Logging.2010-sl40.csproj | 112 ------------------ 1 file changed, 112 deletions(-) delete mode 100644 src/Common.Logging/Common.Logging.2010-sl40.csproj diff --git a/src/Common.Logging/Common.Logging.2010-sl40.csproj b/src/Common.Logging/Common.Logging.2010-sl40.csproj deleted file mode 100644 index d335d84..0000000 --- a/src/Common.Logging/Common.Logging.2010-sl40.csproj +++ /dev/null @@ -1,112 +0,0 @@ - - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {C185F156-BEFC-44A0-8F25-065558AEDB6A} - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - Common - Common.Logging - Silverlight - v4.0 - $(TargetFrameworkVersion) - false - true - true - - - - v3.5 - - - true - full - false - ..\..\build\sl40\Common.Logging\Debug\ - TRACE;DEBUG;SILVERLIGHT PORTABLE - true - true - prompt - 4 - ..\..\build\sl40\Common.Logging\Debug\Common.Logging.XML - - - pdbonly - true - ..\..\build\sl40\Common.Logging\Release\ - TRACE;SILVERLIGHT PORTABLE - true - true - prompt - 4 - ..\..\build\sl40\Common.Logging\Release\Common.Logging.XML - - - - - - - - - - - - - CommonAssemblyInfo.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From 40be02d17fba2298d4ace9dc2af89c5b38b01cf2 Mon Sep 17 00:00:00 2001 From: ioancrisan Date: Tue, 5 Mar 2013 10:29:18 +0200 Subject: [PATCH 4/4] nuspec updated for portable --- src/Common.Logging/Common.Logging.nuspec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Common.Logging/Common.Logging.nuspec b/src/Common.Logging/Common.Logging.nuspec index 8306680..a23c14e 100644 --- a/src/Common.Logging/Common.Logging.nuspec +++ b/src/Common.Logging/Common.Logging.nuspec @@ -20,5 +20,8 @@ + + + \ No newline at end of file