Prechádzať zdrojové kódy

Add CLSCompliant attribute and fixup warnings from WinRT types

Oren Novotny 9 rokov pred
rodič
commit
cbd03ce47f

+ 1 - 0
Rx.NET/Source/System.Reactive.Windows.Threading/Reactive/Concurrency/CoreDispatcherScheduler.cs

@@ -18,6 +18,7 @@ namespace System.Reactive.Concurrency
     /// <remarks>
     /// This scheduler type is typically used indirectly through the <see cref="System.Reactive.Linq.DispatcherObservable.ObserveOnDispatcher&lt;TSource&gt;(IObservable&lt;TSource&gt;)"/> and <see cref="System.Reactive.Linq.DispatcherObservable.SubscribeOnDispatcher&lt;TSource&gt;(IObservable&lt;TSource&gt;)"/> methods that use the current Dispatcher.
     /// </remarks>
+    [CLSCompliant(false)]
     public sealed class CoreDispatcherScheduler : LocalScheduler, ISchedulerPeriodic
     {
         private readonly CoreDispatcher _dispatcher;

+ 1 - 0
Rx.NET/Source/System.Reactive.Windows.Threading/Reactive/Linq/CoreDispatcherObservable.cs

@@ -12,6 +12,7 @@ namespace System.Reactive.Linq
     /// <summary>
     /// Provides a set of extension methods for scheduling actions performed through observable sequences on UI dispatchers.
     /// </summary>
+    [CLSCompliant(false)]
     public static class DispatcherObservable
     {
         #region ObserveOn[Dispatcher]

+ 1 - 0
Rx.NET/Source/System.Reactive.WindowsRuntime/Foundation/AsyncInfoExtensions.cs

@@ -14,6 +14,7 @@ namespace System.Reactive.Windows.Foundation
     /// <summary>
     /// Provides conversions from Windows Runtime asynchronous actions and operations to observable sequences.
     /// </summary>
+    [CLSCompliant(false)]
     public static class AsyncInfoObservableExtensions
     {
         #region IAsyncAction and IAsyncActionWithProgress

+ 1 - 0
Rx.NET/Source/System.Reactive.WindowsRuntime/IEventPatternSource.cs

@@ -12,6 +12,7 @@ namespace System.Reactive
     /// </summary>
     /// <typeparam name="TSender">Sender type.</typeparam>
     /// <typeparam name="TEventArgs">Event arguments type.</typeparam>
+    [CLSCompliant(false)]
     public interface IEventPatternSource<TSender, TEventArgs>
     {
         /// <summary>

+ 1 - 0
Rx.NET/Source/System.Reactive.WindowsRuntime/Linq/AsyncInfoObservable.cs

@@ -16,6 +16,7 @@ namespace System.Reactive.Linq
     /// <summary>
     /// Provides a set of extension methods to expose observable sequences as Windows Runtime asynchronous actions and operations.
     /// </summary>
+    [CLSCompliant(false)]
     public static class AsyncInfoObservable
     {
         #region IAsyncAction

+ 1 - 0
Rx.NET/Source/System.Reactive.WindowsRuntime/Linq/WindowsObservable.Events.cs

@@ -11,6 +11,7 @@ namespace System.Reactive.Linq
     /// <summary>
     /// Provides a set of static methods for importing typed events from Windows Runtime APIs.
     /// </summary>
+    [CLSCompliant(false)]
     public static partial class WindowsObservable
     {
         /// <summary>

+ 9 - 0
Rx.NET/Source/System.Reactive/Properties/AssemblyInfo.cs

@@ -0,0 +1,9 @@
+using System;
+using System.Runtime.InteropServices;
+using System.Security;
+
+
+
+[assembly: ComVisible(false)]
+[assembly: CLSCompliant(true)]
+[assembly: AllowPartiallyTrustedCallers]

+ 7 - 0
Rx.NET/Source/System.Reactive/Properties/System.Reactive.rd.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
+  <Library>
+    <Assembly Name="System.Reactive" Dynamic="Required All" />
+    <!-- TODO optimize this for types that actually need reflection -->
+  </Library>
+</Directives>

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

@@ -45,6 +45,7 @@
   <ItemGroup>
     <Compile Include="**\*.cs" />
     <EmbeddedResource Include="**\*.resx" />
+    <EmbeddedResource Include="Properties\*.xml" />
     <PackageReference Include="GitVersionTask" Version="4.0.0-pullrequest1119-1208">
       <PrivateAssets>All</PrivateAssets>
     </PackageReference>