Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

View File

@ -0,0 +1,44 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Web;
using ApplicationPreStartMethods.Tests;
//[assembly: PreApplicationStartMethod (typeof (ApplicationPreStartMethods.Tests.PreStartMethods), "PublicStaticMethod")]
//[assembly: PreApplicationStartMethod (typeof (ApplicationPreStartMethods.Tests.PreStartMethods), "PublicInstanceMethod")]
//[assembly: PreApplicationStartMethod (typeof (ApplicationPreStartMethods.Tests.PreStartMethods), "InternalInstanceMethod")]
//[assembly: PreApplicationStartMethod (typeof (ApplicationPreStartMethods.Tests.PreStartMethods), "InternalStaticMethod")]
[assembly: PreApplicationStartMethod (typeof (ApplicationPreStartMethods.Tests.PreStartMethods), "PrivateInstanceMethod")]
//[assembly: PreApplicationStartMethod (typeof (ApplicationPreStartMethods.Tests.PreStartMethods), "PrivateStaticMethod")]
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle ("ApplicationPreStartMethods")]
[assembly: AssemblyDescription ("")]
[assembly: AssemblyConfiguration ("")]
[assembly: AssemblyCompany ("")]
[assembly: AssemblyProduct ("ApplicationPreStartMethods")]
[assembly: AssemblyCopyright ("Copyright © Novell, Inc 2010")]
[assembly: AssemblyTrademark ("")]
[assembly: AssemblyCulture ("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible (false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid ("28185baf-2e09-4393-9746-be86a5617cab")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion ("1.0.0.0")]
[assembly: AssemblyFileVersion ("1.0.0.0")]

View File

@ -0,0 +1,54 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Web;
using System.Web.Compilation;
using ApplicationPreStartMethods;
namespace ApplicationPreStartMethods.Tests
{
public class PreStartMethods
{
public void PublicInstanceMethod (string param)
{
}
public static void PublicStaticMethod ()
{
//throw new InvalidOperationException ("test");
_default.PreApplicationStartMessages.Add ("Public static method called");
try {
string path = Path.Combine (HttpRuntime.AppDomainAppPath, "ExternalAssemblies", "ExternalAssembly1.dll");
if (!File.Exists (path))
return;
Assembly asm = Assembly.LoadFrom (path);
BuildManager.AddReferencedAssembly (asm);
} catch (Exception ex){
// ignore
}
}
public static void PublicStaticMethod (string val)
{
}
internal void InternalInstanceMethod ()
{
}
static internal void InternalStaticMethod ()
{
}
void PrivateInstanceMethod ()
{
}
static void PrivateStaticMethod ()
{
}
}
}

View File

@ -0,0 +1,15 @@
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0">
</compilation>
</system.web>
</configuration>

View File

@ -0,0 +1,14 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="ApplicationPreStartMethods._default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<%= AppDomain.CurrentDomain.GetData ("BEGIN_CODE_MARKER") %><div>Report:<pre runat="server" id="report" /></div><%= AppDomain.CurrentDomain.GetData ("END_CODE_MARKER") %>
</form>
</body>
</html>

View File

@ -0,0 +1,65 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Text;
using System.Web;
using System.Web.Compilation;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace ApplicationPreStartMethods
{
public partial class _default : System.Web.UI.Page
{
static List <string> messages = new List <string> ();
public static List<string> PreApplicationStartMessages {
get { return messages; }
}
protected void Page_Load (object sender, EventArgs e)
{
var sb = new StringBuilder ();
foreach (string s in messages)
sb.AppendLine (s);
AppendMessageFromExternalAssembly (sb);
foreach (object o in BuildManager.GetReferencedAssemblies ()) {
var asm = o as Assembly;
if (asm == null)
continue;
if (asm.FullName.Contains ("ExternalAssembly1")) {
sb.AppendLine ("ExternalAssembly1 added");
break;
}
}
report.InnerText = sb.ToString ();
}
void AppendMessageFromExternalAssembly (StringBuilder sb)
{
try {
string path = Path.Combine (HttpRuntime.AppDomainAppPath, "ExternalAssemblies", "ExternalAssembly1.dll");
if (!File.Exists (path))
return;
Assembly asm = Assembly.LoadFrom (path);
Type t = asm.GetType ("ExternalAssemblyPreStartMethods", false);
if (t == null)
return;
FieldInfo fi = t.GetField ("Message");
if (fi == null)
return;
sb.Append (fi.GetValue (null));
} catch {
// ignore
}
}
}
}

View File

@ -0,0 +1,33 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace ApplicationPreStartMethods {
public partial class _default {
/// <summary>
/// form1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// report control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl report;
}
}

View File

@ -0,0 +1,32 @@
thisdir = class/System.Web/Test/standalone/ApplicationPreStartMethods/test_05
include ../../../../../../build/rules.make
APPLICATION_ASSEMBLY = ApplicationPreStartMethods/bin/ApplicationPreStartMethods_test_05.dll
APPLICATION_ASSEMBLY_SOURCES = \
ApplicationPreStartMethods/default.aspx.cs \
ApplicationPreStartMethods/default.aspx.designer.cs \
ApplicationPreStartMethods/Properties/AssemblyInfo.cs \
ApplicationPreStartMethods/Tests/PreStartMethods.cs
APPLICATION_ASSEMBLY_MCS_FLAGS = \
-debug:full \
-r:System.Web.dll
VALID_PROFILE := $(filter 4.0, $(FRAMEWORK_VERSION))
ifndef VALID_PROFILE
all:
else
all: $(APPLICATION_ASSEMBLY)
$(APPLICATION_ASSEMBLY): ApplicationPreStartMethods/bin/.stamp $(APPLICATION_ASSEMBLY_SOURCES)
$(CSCOMPILE) $(APPLICATION_ASSEMBLY_MCS_FLAGS) $(APPLICATION_ASSEMBLY_SOURCES) -target:library -out:$(APPLICATION_ASSEMBLY)
ApplicationPreStartMethods/bin/.stamp:
install -d -m 755 ApplicationPreStartMethods/bin/
touch ApplicationPreStartMethods/bin/.stamp
endif
clean:
rm -rf ApplicationPreStartMethods/bin/