Debian Codegraph @

external/rx/Rx/NET/Source/Tests.System.Reactive/Utils.cs

raw
1 // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
2
3 using System.Linq;
4 using System.Reactive.Subjects;
5 using System.Runtime.Versioning;
6
7 namespace ReactiveTests
8 {
9 static class Utils
10 {
11 public static bool IsRunningWithPortableLibraryBinaries()
12 {
13 #if DESKTOPCLR20
14 return false;
15 #else
16
17 var a = typeof(ISubject<int>).Assembly.GetCustomAttributes(typeof(TargetFrameworkAttribute), false).Cast<TargetFrameworkAttribute>().SingleOrDefault();
18 return a != null && a.FrameworkDisplayName == ".NET Portable Subset";
19 #endif
20 }
21
22 public static string GetTestBaseDirectory()
23 {
24 #if MONODROID || MONOTOUCH
25 // There is no accessible file system inside android application.
26 return System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData);
27 #else
28 return System.AppDomain.CurrentDomain.BaseDirectory;
29 #endif
30 }
31 }
32 }