Browse Source

combine Core, interfaces, platform services and providers

Oren Novotny 9 năm trước cách đây
mục cha
commit
618817a75b

+ 2 - 30
Rx.NET/Source/System.Reactive.Core/Reactive/Internal/PlatformEnlightenmentProvider.cs

@@ -60,37 +60,9 @@ namespace System.Reactive.PlatformServices
 
         private static IPlatformEnlightenmentProvider CreatePlatformProvider()
         {
-            //
-            // TODO: Investigate whether we can simplify this logic to just use "System.Reactive.PlatformServices.PlatformEnlightenmentProvider, System.Reactive.PlatformServices".
-            //       It turns out this doesn't quite work on Silverlight. On the other hand, in .NET Compact Framework 3.5, we mysteriously have to use that path.
-            //
-
-#if NETCF35
-            var name = "System.Reactive.PlatformServices.CurrentPlatformEnlightenmentProvider, System.Reactive.PlatformServices";
-#else
-#if CRIPPLED_REFLECTION && HAS_WINRT
-            var ifType = typeof(IPlatformEnlightenmentProvider).GetTypeInfo();
-#else
-            var ifType = typeof(IPlatformEnlightenmentProvider);
-#endif
-            var asm = new AssemblyName(ifType.Assembly.FullName);
-            asm.Name = "System.Reactive.PlatformServices";
-            var name = "System.Reactive.PlatformServices.CurrentPlatformEnlightenmentProvider, " + asm.FullName;
-#endif
-
-            var t = Type.GetType(name, false);
-            if (t != null)
-                return (IPlatformEnlightenmentProvider)Activator.CreateInstance(t);
-            else
-                return new DefaultPlatformEnlightenmentProvider();
+            return new CurrentPlatformEnlightenmentProvider();
         }
     }
 
-    class DefaultPlatformEnlightenmentProvider : IPlatformEnlightenmentProvider
-    {
-        public T GetService<T>(object[] args) where T : class
-        {
-            return null;
-        }
-    }
+
 }

+ 1 - 1
Rx.NET/Source/System.Reactive.Core/Reactive/Internal/Stubs.cs

@@ -19,7 +19,7 @@ namespace System.Reactive
 #if !NO_THREAD
     internal static class TimerStubs
     {
-#if NETCOREAPP1_0
+#if NETSTANDARD1_3
         public static readonly System.Threading.Timer Never = new System.Threading.Timer(_ => { }, null, System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite);
 #else
         public static readonly System.Threading.Timer Never = new System.Threading.Timer(_ => { });

+ 2 - 2
Rx.NET/Source/System.Reactive.Core/Strings_Core.Generated.cs

@@ -54,9 +54,9 @@ namespace System.Reactive
                 if (object.ReferenceEquals(resourceMan, null))
                 {
 #if (CRIPPLED_REFLECTION && HAS_WINRT)
-                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("System.Reactive.Core.Strings_Core", typeof(Strings_Core).GetTypeInfo().Assembly);
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("System.Reactive.Strings_Core", typeof(Strings_Core).GetTypeInfo().Assembly);
 #else
-                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("System.Reactive.Core.Strings_Core", typeof(Strings_Core).Assembly);
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("System.Reactive.Strings_Core", typeof(Strings_Core).Assembly);
 #endif
                     resourceMan = temp;
                 }

+ 2 - 2
Rx.NET/Source/System.Reactive.Linq/Strings_Linq.Generated.cs

@@ -54,9 +54,9 @@ namespace System.Reactive
                 if (object.ReferenceEquals(resourceMan, null))
                 {
 #if (CRIPPLED_REFLECTION && HAS_WINRT)
-                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("System.Reactive.Linq.Strings_Linq", typeof(Strings_Linq).GetTypeInfo().Assembly);
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("System.Reactive.Strings_Linq", typeof(Strings_Linq).GetTypeInfo().Assembly);
 #else
-                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("System.Reactive.Linq.Strings_Linq", typeof(Strings_Linq).Assembly);
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("System.Reactive.Strings_Linq", typeof(Strings_Linq).Assembly);
 #endif
                     resourceMan = temp;
                 }

+ 1 - 1
Rx.NET/Source/System.Reactive.PlatformServices/Reactive/Internal/Stubs.cs

@@ -7,7 +7,7 @@ namespace System.Reactive.Concurrency
 #if !NO_THREAD
     internal static class TimerStubs
     {
-#if NETCOREAPP1_0
+#if NETSTANDARD1_3
         public static readonly System.Threading.Timer Never = new System.Threading.Timer(_ => { }, null, System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite);
 #else
         public static readonly System.Threading.Timer Never = new System.Threading.Timer(_ => { });

+ 2 - 2
Rx.NET/Source/System.Reactive.PlatformServices/Strings_PlatformServices.Generated.cs

@@ -54,9 +54,9 @@ namespace System.Reactive
                 if (object.ReferenceEquals(resourceMan, null))
                 {
 #if (CRIPPLED_REFLECTION && HAS_WINRT)
-                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("System.Reactive.PlatformServices.Strings_PlatformServices", typeof(Strings_PlatformServices).GetTypeInfo().Assembly);
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("System.Reactive.Strings_PlatformServices", typeof(Strings_PlatformServices).GetTypeInfo().Assembly);
 #else
-                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("System.Reactive.PlatformServices.Strings_PlatformServices", typeof(Strings_PlatformServices).Assembly);
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("System.Reactive.Strings_PlatformServices", typeof(Strings_PlatformServices).Assembly);
 #endif
                     resourceMan = temp;
                 }

+ 0 - 15
Rx.NET/Source/System.Reactive.Providers/Reactive/ObservableQuery.cs

@@ -502,19 +502,4 @@ namespace System.Reactive
             }
         }
     }
-
-#if (CRIPPLED_REFLECTION && HAS_WINRT)
-    static class Helpers
-    {
-        public static MethodInfo GetMethod(this Type type, string name)
-        {
-            return type.GetTypeInfo().GetDeclaredMethod(name);
-        }
-
-        public static bool IsAssignableFrom(this Type type1, Type type2)
-        {
-            return type1.GetTypeInfo().IsAssignableFrom(type2.GetTypeInfo());
-        }
-    }
-#endif
 }

+ 2 - 2
Rx.NET/Source/System.Reactive.Providers/Strings_Providers.Generated.cs

@@ -54,9 +54,9 @@ namespace System.Reactive
                 if (object.ReferenceEquals(resourceMan, null))
                 {
 #if (CRIPPLED_REFLECTION && HAS_WINRT)
-                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("System.Reactive.Providers.Strings_Providers", typeof(Strings_Providers).GetTypeInfo().Assembly);
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("System.Reactive.Strings_Providers", typeof(Strings_Providers).GetTypeInfo().Assembly);
 #else
-                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("System.Reactive.Providers.Strings_Providers", typeof(Strings_Providers).Assembly);
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("System.Reactive.Strings_Providers", typeof(Strings_Providers).Assembly);
 #endif
                     resourceMan = temp;
                 }

+ 34 - 1
Rx.NET/Source/System.Reactive/System.Reactive.csproj

@@ -34,11 +34,44 @@
     <Compile Include="**\*.cs" />
     <EmbeddedResource Include="**\*.resx" />
   </ItemGroup>
+  <ItemGroup>    
+    <Compile Include="..\System.Reactive.Interfaces\Reactive\**\*.cs" />
+  </ItemGroup>
+  <ItemGroup>    
+    <Compile Include="..\System.Reactive.Core\Reactive\**\*.cs" />
+    <Compile Include="..\System.Reactive.Core\Strings_Core.Generated.cs" />
+    <Compile Include="..\System.Reactive.Core\Observable.Extensions.cs" />
+    <Compile Include="..\System.Reactive.Core\Observer.Extensions.cs" />
+    <EmbeddedResource Include="..\System.Reactive.Core\**\*.resx" />
+  </ItemGroup>
+  <ItemGroup>    
+    <Compile Include="..\System.Reactive.PlatformServices\Reactive\**\*.cs" />
+    <Compile Include="..\System.Reactive.PlatformServices\Strings_PlatformServices.Generated.cs" />
+    <EmbeddedResource Include="..\System.Reactive.PlatformServices\**\*.resx" />
+  </ItemGroup>
+  <ItemGroup>    
+    <Compile Include="..\System.Reactive.Providers\Reactive\**\*.cs" Exclude="..\System.Reactive.Providers\Reactive\Internal\*.cs" />
+    <Compile Include="..\System.Reactive.Providers\Strings_Providers.Generated.cs" />
+    <EmbeddedResource Include="..\System.Reactive.Providers\**\*.resx" />
+  </ItemGroup>
+<!--  <ItemGroup>    
+    <Compile Include="..\System.Reactive.Observable.Aliases\Reactive\**\*.cs" />
+    <Compile Include="..\System.Reactive.Observable.Aliases\Observable.Aliases.cs" />
+    <Compile Include="..\System.Reactive.Observable.Aliases\Qbservable.Aliases.Generated.cs" />
+  </ItemGroup>
+-->
+  <ItemGroup>    
+    <Compile Include="..\System.Reactive.Linq\Reactive\**\*.cs" Exclude="..\System.Reactive.Linq\Reactive\Internal\Observers.cs;..\System.Reactive.Linq\Reactive\Observer.Extensions.cs;..\System.Reactive.Linq\Reactive\Internal\Producer.cs;..\System.Reactive.Linq\Reactive\Internal\ImmutableList.cs" />
+    <Compile Include="..\System.Reactive.Linq\Strings_Linq.Generated.cs" />
+    <EmbeddedResource Include="..\System.Reactive.Linq\**\*.resx" />
+  </ItemGroup>  
   <ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' or '$(TargetFramework)' == 'uap10.0' ">
     <PackageReference Include="NETStandard.Library" Version="1.6.1" />
     <PackageReference Include="System.ComponentModel" Version="4.3.0" />
     <PackageReference Include="System.Diagnostics.Contracts" Version="4.3.0" />
-    <PackageReference Include="System.Dynamic.Runtime" Version="4.3.0" />
+    <PackageReference Include="System.Dynamic.Runtime" Version="4.3.0" />    
+    <PackageReference Include="System.Linq.Queryable" Version="4.3.0" />
+    <PackageReference Include="System.Runtime.InteropServices.WindowsRuntime" Version="4.3.0" />
   </ItemGroup>
   <ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
     <PackageReference Include="System.Threading.Thread" Version="4.3.0" />