Permalink
Browse files

Merge branch 'master' of github.com:lunchtimemama/Mono.Upnp

  • Loading branch information...
2 parents 24623a8 + 5bb0d45 commit 7fd9a9fc3368ce9a769eb35e81dcc1e51eed3d45 @lunchtimemama lunchtimemama committed Jul 14, 2010
Showing with 4,732 additions and 533 deletions.
  1. +6 −0 AUTHORS
  2. +19 −0 COPYING
  3. +106 −0 HACKING
  4. +21 −2 Mono.Upnp.sln
  5. +31 −0 README
  6. +9 −6 ....Upnp.Dcp.MSMediaServerRegistrar1/Mono.Upnp.Dcp.MSMediaServerRegistrar1/MSMediaServerRegistrar.cs
  7. +1 −1 ....MediaServer1.FileSystem.ConsoleServer/Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer.csproj
  8. +1 −1 ...er1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ConnectionManager1/ConnectionManager.cs
  9. +1 −1 ...rver1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/ContentDirectory.cs
  10. +14 −5 ...Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/ObjectBasedContentDirectory.cs
  11. +74 −0 ...no.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/ObjectBasedQueryProvider.cs
  12. +245 −0 ...er1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/ObjectQueryContext.cs
  13. +109 −0 ...er1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/ObjectQueryVisitor.cs
  14. +31 −0 ...Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/Query.cs
  15. +866 −0 ...diaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/QueryParser.cs
  16. +39 −0 .../Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/QueryParsingException.cs
  17. +110 −0 ...iaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.ContentDirectory1/QueryVisitor.cs
  18. +7 −6 ...o.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.Internal/Helper.cs}
  19. +113 −0 ...np.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.Xml/FilteringContext.cs
  20. +109 −0 ...no.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.Xml/FilteringDelegateSerializationCompiler.cs
  21. +53 −0 ...o.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.Xml/PropertyName.cs
  22. +22 −7 .../Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.Xml/UpdateDelegateSerializationCompiler.cs
  23. +7 −4 ...Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.Xml/UpdateXmlSerializer.cs
  24. +11 −0 ....Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.csproj
  25. +1 −1 ...p/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/MediaServer.cs
  26. +0 −7 src/Mono.Upnp/Mono.Upnp.GtkClient/Mono.Upnp.GtkClient.csproj
  27. +6 −3 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/AllowedValueRange.cs
  28. +10 −13 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/Argument.cs
  29. +1 −1 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/ArgumentDirection.cs
  30. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/IMap.cs
  31. +16 −15 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/ServiceAction.cs
  32. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/ServiceActionExecutor.cs
  33. +38 −23 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/ServiceController.cs
  34. +24 −17 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/StateVariable.cs
  35. +1 −1 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/StateVariableChangedArgs.cs
  36. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/StateVariableEventer.cs
  37. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/StateVariableOptions.cs
  38. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/UpnpActionAttribute.cs
  39. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/UpnpArgumentAttribute.cs
  40. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/UpnpControlException.cs
  41. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/UpnpEnumAttribute.cs
  42. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/UpnpError.cs
  43. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/UpnpRelatedStateVariableAttribute.cs
  44. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/UpnpServiceDefinitionException.cs
  45. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Control/UpnpStateVariableAttribute.cs
  46. +6 −3 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/Arguments.cs
  47. +5 −3 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/CollectionMap.cs
  48. +31 −14 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/ControlClient.cs
  49. +7 −3 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/ControlServer.cs
  50. +3 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/DataServer.cs
  51. +6 −3 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/EventClient.cs
  52. +6 −4 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/EventServer.cs
  53. +1 −1 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/Helper.cs
  54. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/IMappable.cs
  55. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/Map.cs
  56. +3 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/Protocol.cs
  57. +70 −28 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/ServiceControllerBuilder.cs
  58. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/SoapEnvelope.cs
  59. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/SoapFault.cs
  60. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/SoapHeader.cs
  61. +1 −1 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/UpnpServer.cs
  62. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Internal/XmlShell.cs
  63. +0 −12 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml.Compilation/Compiler.cs
  64. +10 −5 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml.Compilation/DelegateDeserializationCompiler.cs
  65. +63 −23 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml.Compilation/DelegateSerializationCompiler.cs
  66. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml.Compilation/DeserializationCompiler.cs
  67. +6 −11 ....Xml.Compilation/{DelegateDeserializationCompilerFactory.cs → DeserializationCompilerProvider.cs}
  68. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml.Compilation/Deserializer.cs
  69. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml.Compilation/ObjectDeserializer.cs
  70. +4 −3 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml.Compilation/SerializationCompilerProvider.cs
  71. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml.Compilation/Serializer.cs
  72. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/DoNotDeserializeAttribute.cs
  73. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/DoNotSerializeAttribute.cs
  74. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/IXmlDeserializable.cs
  75. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/IXmlSerializable.cs
  76. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/XmlArrayAttribute.cs
  77. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/XmlArrayItemAttribute.cs
  78. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/XmlAttributeAttribute.cs
  79. +40 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/XmlAutomatable.cs
  80. +23 −3 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/XmlDeserializable.cs
  81. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/XmlDeserializationContext.cs
  82. +9 −7 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/XmlDeserializer.cs
  83. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/XmlElementAttribute.cs
  84. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/XmlEnumAttribute.cs
  85. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/XmlFlagAttribute.cs
  86. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/XmlNamespaceAttribute.cs
  87. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/XmlSerializable.cs
  88. +6 −4 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/XmlSerializationContext.cs
  89. +9 −6 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/XmlSerializer.cs
  90. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/XmlTypeAttribute.cs
  91. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.Xml/XmlValueAttribute.cs
  92. +2 −3 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.csproj
  93. +16 −12 src/Mono.Upnp/Mono.Upnp/Mono.Upnp/Client.cs
  94. +7 −4 src/Mono.Upnp/Mono.Upnp/Mono.Upnp/Description.cs
  95. +14 −7 src/Mono.Upnp/Mono.Upnp/Mono.Upnp/Deserializer.cs
  96. +5 −10 src/Mono.Upnp/Mono.Upnp/Mono.Upnp/{DeserializerFactory.cs → DeserializerProducer.cs}
  97. +40 −22 src/Mono.Upnp/Mono.Upnp/Mono.Upnp/Device.cs
  98. +1 −1 src/Mono.Upnp/Mono.Upnp/Mono.Upnp/DeviceAnnouncement.cs
  99. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp/DeviceOptions.cs
  100. +13 −3 src/Mono.Upnp/Mono.Upnp/Mono.Upnp/DeviceType.cs
  101. +1 −1 src/Mono.Upnp/Mono.Upnp/Mono.Upnp/DisposedEventArgs.cs
  102. +22 −16 src/Mono.Upnp/Mono.Upnp/Mono.Upnp/Icon.cs
  103. +15 −16 src/Mono.Upnp/Mono.Upnp/Mono.Upnp/Root.cs
  104. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp/RootDeviceOptions.cs
  105. +4 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp/Server.cs
  106. +25 −17 src/Mono.Upnp/Mono.Upnp/Mono.Upnp/Service.cs
  107. +1 −1 src/Mono.Upnp/Mono.Upnp/Mono.Upnp/ServiceAnnouncement.cs
  108. +13 −3 src/Mono.Upnp/Mono.Upnp/Mono.Upnp/ServiceType.cs
  109. +2 −2 src/Mono.Upnp/Mono.Upnp/Mono.Upnp/SpecVersion.cs
  110. +47 −15 src/Mono.Upnp/Mono.Upnp/Mono.Upnp/TypeInfo.cs
  111. +1 −1 src/Mono.Upnp/Mono.Upnp/Mono.Upnp/UpnpDeserializationException.cs
  112. +1 −1 src/Mono.Upnp/Mono.Upnp/Mono.Upnp/UpnpEventArgs.cs
  113. +1 −1 src/Mono.Upnp/Mono.Upnp/Mono.Upnp/UpnpException.cs
  114. +2 −4 tests/Mono.Ssdp.Tests/Mono.Ssdp.Tests.csproj
  115. +2 −4 tests/Mono.Upnp.Dcp.MediaServer1.FileSystem.Tests/Mono.Upnp.Dcp.MediaServer1.FileSystem.Tests.csproj
  116. +31 −0 tests/Mono.Upnp.Dcp.MediaServer1.Tests/Consumer.cs
  117. +57 −0 tests/Mono.Upnp.Dcp.MediaServer1.Tests/DummyContentDirectory.cs
  118. +49 −0 tests/Mono.Upnp.Dcp.MediaServer1.Tests/DummyObject.cs
  119. +436 −0 tests/Mono.Upnp.Dcp.MediaServer1.Tests/FilteringXmlSerializerTests.cs
  120. +14 −6 tests/Mono.Upnp.Dcp.MediaServer1.Tests/Mono.Upnp.Dcp.MediaServer1.Tests.csproj
  121. +287 −0 tests/Mono.Upnp.Dcp.MediaServer1.Tests/ObjectQueryContextTests.cs
  122. +58 −0 tests/Mono.Upnp.Dcp.MediaServer1.Tests/ObjectQueryTests.cs
  123. +815 −0 tests/Mono.Upnp.Dcp.MediaServer1.Tests/QueryParserTests.cs
  124. +124 −0 tests/Mono.Upnp.Dcp.MediaServer1.Tests/QueryStringifier.cs
  125. +6 −2 tests/Mono.Upnp.Dcp.MediaServer1.Tests/UpdateXmlSerializerTests.cs
  126. +14 −14 tests/Mono.Upnp.Tests/ClientTests.cs
  127. +12 −12 tests/Mono.Upnp.Tests/DeviceDescriptionTests.cs
  128. +1 −1 tests/Mono.Upnp.Tests/DummyDeserializer.cs
  129. +3 −7 tests/Mono.Upnp.Tests/DummyDeserializerFactory.cs
  130. +1 −2 tests/Mono.Upnp.Tests/Mono.Upnp.Tests.csproj
  131. +10 −10 tests/Mono.Upnp.Tests/ServerTests.cs
  132. +89 −0 tests/Mono.Upnp.Tests/TypeInfoTests.cs
  133. +1 −1 tests/Mono.Upnp.Tests/XmlSerializationTests.cs
View
@@ -0,0 +1,6 @@
+Mono.Ssdp:
+ Aaron Bockover
+ Scott Thomas
+
+Mono.Upnp:
+ Scott Thomas
View
19 COPYING
@@ -0,0 +1,19 @@
+Copyright (C) 2008-2010 Novell
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
View
106 HACKING
@@ -0,0 +1,106 @@
+Follow these simple guidelines when hacking on Mono.Upnp and you too will loose weight and find happiness!
+
+C# Style Guidelines
+===================
+
+ 1. Indent with 4 spaces. Tabs are bad. Obviously.
+
+ 2. Leave room for the Holy Ghost; put a space before parenthesis, like so:
+
+ this.ToString ();
+
+ 2. With namespaces, types, and methods, Ms. Brace gets her own line, like so:
+
+ namespace Foo
+ { // This
+ class Bar
+ { // Is
+ public void Bat ()
+ { // Stylish
+ }
+ }
+ }
+
+ 3. Ms. Brace shares a line with statements, however. Now you try sharing:
+
+ if (foo != null) {
+ foo.Bar ();
+ }
+
+ Statements such as else, else-if, catch, and do-while share a line with Ms. Closing Brace. Know what I mean?
+
+ if (something) {
+ ...
+ } else { // This is what I mean
+ ...
+ }
+
+ Always use braces with statements. Always use braces with statements. Always use braces with statements.
+
+ 4. Properties look like this:
+
+ public string Foo { get; set; } // Automatic property
+
+ public string Bar { // 1-line accessor
+ get { return "bar"; }
+ }
+
+ public string Bat { // Multi-line accessor
+ get {
+ /* Your
+ Code
+ Here */
+ }
+ }
+
+ 5. Private fileds and local variables look_like_this:
+
+ string all_lower_case_with_underscores = null;
+
+ Method parameters lookLikeThis:
+
+ public void Foo (string lowerCaseAndThenUpperCase) // Camal casing
+ {
+ }
+
+ Everything else (namespaces, types, methods, properties, events, and non-private fields) LookLikeThis:
+
+ public class MyClass // Pascal casing
+ {
+ protected string NonPrivateField; // Pascal casing
+
+ void PrivateMethod () // Pascal casing
+ {
+ }
+
+ public string PublicProperty { get; set; } // You get the idea
+ }
+
+ 6. Lines should not exceed 120 columns. Overlong method and constructor definitions should break for EACH parameter
+ and indent to the opening parenthesis, like so:
+
+ public void CrazySuperLongMethodNameOhEmGeeThisThingIsPracticallyANovel (string parameter1,
+ string parameter2,
+ string parameter3)
+ {
+ }
+
+ Overlong expressions should break at a logical location and indent 4 spaces, like so:
+
+ throw new InvalidOperationExceltion (string.Format (
+ "There is no action named {0} and the device {1}.", actionName, deviceName));
+
+ Overlong expressions in a statement declaration should break logically and indent to the opening parenthesis.
+ In these cases, Ms. Brace gets her own line, like so:
+
+ while (parameter1 == null ||
+ parameter2 == null ||
+ parameter3 == null)
+ {
+ ...
+ }
+
+ 7. Use the var keyword and array type-inference as much as you possible can!
+
+ 8. Use NEITHER the "private" visibility modifier on members, NOR the "internal" visibility modifier on types; those
+ are the default visibility levels. Github is paying for these bits, you know.
View
@@ -33,6 +33,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Upnp.Dcp.MediaServer1.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Upnp.Dcp.MSMediaServerRegistrar1", "src\Mono.Upnp.Dcp\Mono.Upnp.Dcp.MediaServer1\Mono.Upnp.Dcp.MSMediaServerRegistrar1\Mono.Upnp.Dcp.MSMediaServerRegistrar1.csproj", "{1203E9D4-B1F3-4838-8275-91782C8EC6E4}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{DEA343EA-6B89-4360-B169-F0474A32B259}"
+ ProjectSection(SolutionItems) = preProject
+ README = README
+ AUTHORS = AUTHORS
+ COPYING = COPYING
+ HACKING = HACKING
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -129,7 +137,7 @@ Global
{1203E9D4-B1F3-4838-8275-91782C8EC6E4} = {E2789A20-B336-4121-8C5A-2EC6DBD031CA}
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
- StartupItem = src\Mono.Upnp.Dcp\Mono.Upnp.Dcp.MediaServer1\Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer\Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer.csproj
+ StartupItem = src\Mono.Upnp\Mono.Upnp.GtkClient\Mono.Upnp.GtkClient.csproj
Policies = $0
$0.DotNetNamingPolicy = $1
$1.DirectoryNamespaceAssociation = Flat
@@ -141,9 +149,20 @@ Global
$3.inheritsSet = VisualStudio
$3.inheritsScope = text/plain
$0.TextStylePolicy = $4
- $4.inheritsSet = null
+ $4.FileWidth = 120
+ $4.NoTabsAfterNonTabs = True
+ $4.RemoveTrailingWhitespace = True
+ $4.EolMarker = Unix
+ $4.inheritsSet = VisualStudio
+ $4.inheritsScope = text/plain
$4.scope = text/x-csharp
$0.CSharpFormattingPolicy = $5
+ $5.IfElseBraceForcement = AddBraces
+ $5.ForBraceForcement = AddBraces
+ $5.ForEachBraceForcement = AddBraces
+ $5.WhileBraceForcement = AddBraces
+ $5.UsingBraceForcement = AddBraces
+ $5.FixedBraceForcement = AddBraces
$5.inheritsSet = Mono
$5.inheritsScope = text/x-csharp
$5.scope = text/x-csharp
View
31 README
@@ -0,0 +1,31 @@
+Mono.Upnp is set of client/server libraries for the Universal Plug 'n Play specifications. See http://www.upnp.org.
+
+To build with Visual Studio or MonoDevelop, open Mono.Upnp.sln and build the solution.
+
+To build with from the command line with Mono:
+ xbuild Mono.Upnp.sln
+
+To build with from the command line with .NET:
+ msbuild Mono.Upnp.sln
+
+About the projects:
+ Mono.Ssdp:
+ An implementation of the Simple Discovery Protocol (see UPnP Device Architecture 1.1, Section 1).
+
+ Mono.Upnp:
+ An implementation of the UPnP Device Archetecture 1.1, Secions 2-5.
+
+ Mono.Upnp.GtkClient:
+ An executable GTK+ user interface for inspecting UPnP devices and services on the network.
+
+ Mono.Upnp.Dcp.MediaServer1:
+ An implementation of the UPnP Audio/Video MediaServer1 Device Control Protocol.
+
+ Mono.Upnp.Dcp.MediaServer1.FileSystem:
+ A MediaServer1 implementation which serves media from the file system.
+
+ Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer:
+ An executable console program which serves media from the file system.
+
+ Mono.Upnp.Dcp.MSMediaServerRegistrar1:
+ An implementation of the Microsoft MSMediaServerRegistrar1 Device Control Protocol.
@@ -32,10 +32,12 @@ namespace Mono.Upnp.Dcp.MSMediaServerRegistrar1
{
public abstract class MSMediaServerRegistrar
{
- public static readonly ServiceType ServiceType = new ServiceType ("urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1");
+ public static readonly ServiceType ServiceType =
+ new ServiceType ("microsoft.com", "X_MS_MediaReceiverRegistrar", new Version (1, 0));
[UpnpAction]
- public virtual void IsAuthorized ([UpnpArgument ("DeviceId")] string deviceId, [UpnpArgument ("Result")] out long result)
+ public virtual void IsAuthorized ([UpnpArgument ("DeviceId")] string deviceId,
+ [UpnpArgument ("Result")] out long result)
{
result = IsAuthorized (deviceId);
}
@@ -44,17 +46,18 @@ public virtual void IsAuthorized ([UpnpArgument ("DeviceId")] string deviceId, [
[UpnpAction]
public virtual void RegisterDevice ([UpnpArgument ("RegistrationRegMsg")]
- [UpnpRelatedStateVariable (DataType = "bin.base64")] byte[] registrationRequestMessage,
- [UpnpArgument ("RegistrationRespMsg")]
- [UpnpRelatedStateVariable (DataType = "bin.base64")] out byte [] registrationResponseMessage)
+ [UpnpRelatedStateVariable (DataType = "bin.base64")] byte[] registrationRequestMessage,
+ [UpnpArgument ("RegistrationRespMsg")]
+ [UpnpRelatedStateVariable (DataType = "bin.base64")] out byte [] registrationResponseMessage)
{
registrationResponseMessage = RegisterDevice (registrationRequestMessage);
}
protected abstract byte[] RegisterDevice (byte[] registrationRequestMessage);
[UpnpAction]
- public virtual void IsValidated ([UpnpArgument ("DeviceId")] string deviceId, [UpnpArgument ("Result")] out long result)
+ public virtual void IsValidated ([UpnpArgument ("DeviceId")] string deviceId,
+ [UpnpArgument ("Result")] out long result)
{
result = IsAuthorized (deviceId);
}
@@ -20,7 +20,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <Commandlineparameters>-f "FOOBAR: upnp:" -n "Windows Media Player Sharing" "/home/scott/glee"</Commandlineparameters>
+ <Commandlineparameters>-f "mac: upnp" "/home/scott/Music/Starfucker - Starfucker (V0)"</Commandlineparameters>
<Externalconsole>true</Externalconsole>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
@@ -32,7 +32,7 @@ namespace Mono.Upnp.Dcp.MediaServer1.ConnectionManager1
{
public abstract class ConnectionManager
{
- public static readonly ServiceType ServiceType = new ServiceType ("urn:schemas-upnp-org:service:ConnectionManager:1");
+ public static readonly ServiceType ServiceType = new ServiceType ("schemas-upnp-org", "ConnectionManager", new Version (1, 0));
[UpnpAction]
public virtual void GetProtocolInfo ([UpnpArgumentAttribute ("Source")]
@@ -61,7 +61,7 @@ public virtual void Stop ()
}
public static readonly ServiceType ServiceType = new ServiceType (
- "urn:schemas-upnp-org:service:ContentDirectory:1");
+ "schemas-upnp-org", "ContentDirectory", new Version (1, 0));
[UpnpAction]
public virtual void GetSearchCapabilities ([UpnpArgument ("SearchCaps")]
@@ -77,9 +77,15 @@ public void SerializeMembersOnly (XmlSerializationContext context)
readonly XmlSerializer serializer = new XmlSerializer ();
- protected override string Browse (string objectId, BrowseFlag browseFlag, string filter, int startIndex,
- int requestCount, string sortCriteria, out int numberReturned,
- out int totalMatches, out string updateId)
+ protected override string Browse (string objectId,
+ BrowseFlag browseFlag,
+ string filter,
+ int startIndex,
+ int requestCount,
+ string sortCriteria,
+ out int numberReturned,
+ out int totalMatches,
+ out string updateId)
{
updateId = "0";
if (browseFlag == BrowseFlag.BrowseDirectChildren) {
@@ -103,8 +109,11 @@ public void SerializeMembersOnly (XmlSerializationContext context)
}
}
- protected abstract IEnumerable<IXmlSerializable> GetChildren (string objectId, int startIndex, int requestCount,
- string sortCriteria, out int totalMatches);
+ protected abstract IEnumerable<IXmlSerializable> GetChildren (string objectId,
+ int startIndex,
+ int requestCount,
+ string sortCriteria,
+ out int totalMatches);
protected abstract IXmlSerializable GetObject (string objectId);
}
@@ -0,0 +1,74 @@
+//
+// ObjectBasedQueryProvider.cs
+//
+// Author:
+// Scott Thomas <lunchtimemama@gmail.com>
+//
+// Copyright (c) 2010 Scott Thomas
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+
+namespace Mono.Upnp.Dcp.MediaServer1.ContentDirectory1
+{
+ public class ObjectBasedQueryProvider
+ {
+ Dictionary<Type, ObjectQueryContext> queryContexts = new Dictionary<Type, ObjectQueryContext>();
+
+ public IEnumerable<Object> Query (Query query, IEnumerable<Object> objects)
+ {
+ if (query == null) {
+ throw new ArgumentNullException ("query");
+ } else if (objects == null) {
+ throw new ArgumentNullException ("objects");
+ }
+
+ foreach (var @object in objects) {
+ if (Matches (query, @object)) {
+ yield return @object;
+ }
+ }
+ }
+
+ bool Matches (Query query, Object @object)
+ {
+ var match = false;
+ query (new ObjectQueryVisitor (GetQueryContext (@object.GetType ()), @object, result => match = result));
+ return match;
+ }
+
+ ObjectQueryContext GetQueryContext (Type type)
+ {
+ if (type == null) {
+ return null;
+ }
+
+ ObjectQueryContext context;
+ if (!queryContexts.TryGetValue (type, out context)) {
+ context = new ObjectQueryContext (type, GetQueryContext (type.BaseType));
+ queryContexts[type] = context;
+ }
+
+ return context;
+ }
+ }
+}
+
Oops, something went wrong.

0 comments on commit 7fd9a9f

Please sign in to comment.