Files
acceptance-tests
data
debian
docs
external
ikvm-native
libgc
llvm
m4
man
mcs
build
class
Accessibility
Commons.Xml.Relaxng
Cscompmgd
CustomMarshalers
Facades
I18N
IBM.Data.DB2
ICSharpCode.SharpZipLib
Microsoft.Build
Microsoft.Build.Engine
Microsoft.Build.Framework
Microsoft.Build.Tasks
Microsoft.Build.Utilities
Microsoft.CSharp
Microsoft.NuGet.Build.Tasks
Microsoft.VisualC
Microsoft.Web.Infrastructure
MicrosoftAjaxLibrary
Mono.Btls.Interface
Mono.C5
Mono.CSharp
Mono.Cairo
Mono.Cecil
Mono.Cecil.Mdb
Mono.CodeContracts
Mono.CompilerServices.SymbolWriter
Mono.Data.Sqlite
Mono.Data.Tds
Mono.Debugger.Soft
Mono.Http
Mono.Management
Mono.Messaging
Mono.Messaging.RabbitMQ
Mono.Options
Mono.Parallel
Mono.Posix
Mono.Profiler.Log
Mono.Runtime.Tests
Mono.Security
Mono.Security.Win32
Mono.Simd
Mono.Tasklets
Mono.WebBrowser
Mono.XBuild.Tasks
Novell.Directory.Ldap
PEAPI
RabbitMQ.Client
SMDiagnostics
System
System.ComponentModel.Composition.4.5
System.ComponentModel.DataAnnotations
System.Configuration
System.Configuration.Install
System.Core
System.Data
System.Data.DataSetExtensions
System.Data.Entity
System.Data.Linq
System.Data.OracleClient
System.Data.Services
System.Data.Services.Client
System.Deployment
System.Design
System.DirectoryServices
System.DirectoryServices.Protocols
System.Drawing
System.Drawing.Design
System.Dynamic
System.EnterpriseServices
System.IO.Compression
System.IO.Compression.FileSystem
System.IdentityModel
System.IdentityModel.Selectors
System.Json
System.Json.Microsoft
System.Management
System.Messaging
System.Net
System.Net.Http
System.Net.Http.Formatting
System.Net.Http.WebRequest
System.Net.Http.WinHttpHandler
System.Numerics
System.Numerics.Vectors
System.Private.CoreLib
Microsoft.Win32
Microsoft.Win32.SafeHandles
Mono
Resources
System
System.Collections.Generic
System.Diagnostics
System.Globalization
System.IO
System.Reflection
Assembly.cs
AssemblyName.cs
CustomAttributeData.cs
CustomAttributeTypedArgument.cs
FieldInfo.cs
MemberInfo.cs
MethodBase.cs
RuntimeAssembly.cs
RuntimeEventInfo.cs
RuntimeExceptionHandlingClause.cs
RuntimeFieldInfo.cs
RuntimeLocalVariableInfo.cs
RuntimeMethodBody.cs
RuntimeMethodInfo.cs
RuntimeModule.cs
RuntimeParameterInfo.cs
RuntimePropertyInfo.cs
System.Reflection.Emit
System.Reflection.Metadata
System.Resources
System.Runtime
System.Runtime.CompilerServices
System.Runtime.InteropServices
System.Runtime.Loader
System.Runtime.Remoting.Contexts
System.Security
System.Threading
Makefile
System.Private.CoreLib.csproj
System.Reactive.Core
System.Reactive.Debugger
System.Reactive.Experimental
System.Reactive.Interfaces
System.Reactive.Linq
System.Reactive.Observable.Aliases
System.Reactive.PlatformServices
System.Reactive.Providers
System.Reactive.Runtime.Remoting
System.Reactive.Windows.Forms
System.Reactive.Windows.Threading
System.Reflection.Context
System.Runtime.Caching
System.Runtime.CompilerServices.Unsafe
System.Runtime.DurableInstancing
System.Runtime.Remoting
System.Runtime.Serialization
System.Runtime.Serialization.Formatters.Soap
System.Security
System.ServiceModel
System.ServiceModel.Activation
System.ServiceModel.Discovery
System.ServiceModel.Internals
System.ServiceModel.Routing
System.ServiceModel.Web
System.ServiceProcess
System.Threading.Tasks.Dataflow
System.Transactions
System.Web
System.Web.Abstractions
System.Web.ApplicationServices
System.Web.DynamicData
System.Web.Extensions
System.Web.Extensions.Design
System.Web.Http
System.Web.Http.SelfHost
System.Web.Http.WebHost
System.Web.Mobile
System.Web.Mvc3
System.Web.Razor
System.Web.RegularExpressions
System.Web.Routing
System.Web.Services
System.Web.WebPages
System.Web.WebPages.Deployment
System.Web.WebPages.Razor
System.Windows
System.Windows.Forms
System.Windows.Forms.DataVisualization
System.Workflow.Activities
System.Workflow.ComponentModel
System.Workflow.Runtime
System.XML
System.Xaml
System.Xml.Linq
System.Xml.Serialization
SystemWebTestShim
WebMatrix.Data
WindowsBase
aot-compiler
corlib
dlr
doc
legacy
lib
monodoc
notes
reference-assemblies
referencesource
test-helpers
LICENSE
Makefile
Open.snk
README
ecma.pub
mono.pub
mono.snk
msfinal.pub
reactive.pub
silverlight.pub
winfx.pub
winfx3.pub
docs
errors
ilasm
jay
mcs
packages
tests
tools
AUTHORS
COPYING
INSTALL.txt
Makefile
MonoIcon.png
README
ScalableMonoIcon.svg
mkinstalldirs
mk
mono
msvc
po
runtime
samples
scripts
support
tools
COPYING.LIB
LICENSE
Makefile.am
Makefile.in
NEWS
README.md
acinclude.m4
aclocal.m4
autogen.sh
code_of_conduct.md
compile
config.guess
config.h.in
config.rpath
config.sub
configure.REMOVED.git-id
configure.ac.REMOVED.git-id
depcomp
install-sh
ltmain.sh.REMOVED.git-id
missing
mkinstalldirs
mono-uninstalled.pc.in
test-driver
winconfig.h
Xamarin Public Jenkins (auto-signing) ef583813eb Imported Upstream version 6.4.0.137
Former-commit-id: 943baa9f16a098c33e129777827f3a9d20da00d6
2019-07-26 19:53:28 +00:00

97 lines
3.5 KiB
C#

using System.IO;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Loader;
using System.Threading;
namespace System.Reflection
{
[StructLayout (LayoutKind.Sequential)]
partial class Assembly
{
internal bool IsRuntimeImplemented () => this is RuntimeAssembly;
internal virtual IntPtr MonoAssembly {
get {
throw new NotImplementedException ();
}
}
[System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod
public static Assembly? LoadWithPartialName (string partialName)
{
if (partialName == null)
throw new ArgumentNullException (nameof (partialName));
if (partialName.Length == 0 || partialName [0] == '\0')
throw new ArgumentException (SR.Format_StringZeroLength, nameof (partialName));
try {
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RuntimeAssembly.InternalLoad (partialName, ref stackMark, IntPtr.Zero);
} catch (FileNotFoundException) {
return null;
}
}
[System.Security.DynamicSecurityMethod]
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static Assembly GetExecutingAssembly()
{
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return GetExecutingAssembly(ref stackMark);
}
[MethodImplAttribute (MethodImplOptions.InternalCall)]
internal static extern RuntimeAssembly GetExecutingAssembly (ref StackCrawlMark stackMark);
[MethodImplAttribute (MethodImplOptions.InternalCall)]
public static extern Assembly GetCallingAssembly ();
[MethodImplAttribute (MethodImplOptions.InternalCall)]
public static extern Assembly GetEntryAssembly ();
[System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod
public static Assembly Load (string assemblyString)
{
if (assemblyString == null)
throw new ArgumentNullException (nameof (assemblyString));
var name = new AssemblyName (assemblyString);
// TODO: trigger assemblyFromResolveEvent
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return Load (name, ref stackMark, AssemblyLoadContext.CurrentContextualReflectionContext);
}
[System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod
public static Assembly Load (AssemblyName assemblyRef)
{
if (assemblyRef == null)
throw new ArgumentNullException (nameof (assemblyRef));
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return Load (assemblyRef, ref stackMark, AssemblyLoadContext.CurrentContextualReflectionContext);
}
internal static Assembly Load (AssemblyName assemblyRef, ref StackCrawlMark stackMark, AssemblyLoadContext assemblyLoadContext)
{
// TODO: pass AssemblyName
// TODO: pass assemblyLoadContext
var assembly = InternalLoad (assemblyRef.FullName, ref stackMark, IntPtr.Zero);
if (assembly == null)
throw new FileNotFoundException (null, assemblyRef.Name);
return assembly;
}
[MethodImplAttribute (MethodImplOptions.InternalCall)]
internal static extern Assembly InternalLoad (string assemblyName, ref StackCrawlMark stackMark, IntPtr ptrLoadContextBinder);
[MethodImplAttribute (MethodImplOptions.InternalCall)]
internal extern Type InternalGetType (Module module, string name, bool throwOnError, bool ignoreCase);
[MethodImplAttribute (MethodImplOptions.InternalCall)]
internal extern static void InternalGetAssemblyName (string assemblyFile, out Mono.MonoAssemblyName aname, out string codebase);
}
}