[assembly: AssemblyTrademark("")]\r
[assembly: AssemblyCulture("")]\r
\r
-#if NET_4_0\r
[assembly: AssemblyVersion("4.84.0.0")]\r
-#else\r
-[assembly: AssemblyVersion("2.84.0.0")]\r
-#endif\r
\r
[assembly: AssemblyDelaySign(true)]\r
[assembly: AssemblyKeyFile("SharpZipLib.pub")]\r
[Docking (DockingBehavior.AutoDock)]
[Designer ("System.Windows.Forms.Design.SplitContainerDesigner, " + Consts.AssemblySystem_Design)]
public class SplitContainer : ContainerControl
-#if NET_4_0
, ISupportInitialize
-#endif
{
#region Local Variables
private FixedPanel fixed_panel;
#endregion
#region Public Methods
-#if NET_4_0
[MonoTODO]
public void BeginInit ()
{
public void EndInit ()
{
}
-#endif
public void OnSplitterMoved (SplitterEventArgs e)
{
// Hence we expect sender as a valid object only if it is IBuildEngine4 -
// only Microsoft.Build.Internal.BuildEngine4 implements it so far.
// (Used IBuildEngine3 because it needs to build for NET_4_0).
-#if NET_4_0
var key = sender as IBuildEngine3 ?? dummy_key;
-#else
- var key = dummy_key;
-#endif
if (!build_records.TryGetValue (key, out r)) {
r = new BuildRecord (this);
build_records.Add (key, r);
Toolsets.Add (new Toolset ("3.5",
ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version35)));
#endif
-#if NET_4_0
Toolsets.Add (new Toolset ("4.0",
ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version40)));
-#endif
#if XBUILD_12
Toolsets.Add (new Toolset ("12.0", ToolLocationHelper.GetPathToBuildTools ("12.0")));
#endif
// project can't find a version to use
return String.IsNullOrEmpty (defaultToolsVersion)
?
-#if NET_4_0
"4.0"
-#else
- "2.0"
-#endif
: defaultToolsVersion;
}
set {
if (String.IsNullOrEmpty (parsed_import))
throw new InvalidProjectFileException ("The required attribute \"Project\" in Import is empty");
-#if NET_4_0
if (DirectoryScanner.HasWildcard (parsed_import)) {
var directoryScanner = new DirectoryScanner () {
Includes = new ITaskItem [] { new TaskItem (parsed_import) },
foreach (ITaskItem matchedItem in directoryScanner.MatchedItems)
yield return matchedItem.ItemSpec;
} else
-#endif
yield return parsed_import;
}
Reevaluate ();
}
-#if NET_4_0
ProcessBeforeAndAfterTargets ();
-#endif
if (targetNames == null || targetNames.Length == 0) {
if (defaultTargets != null && defaultTargets.Length != 0) {
return sb.ToString ();
}
-#if NET_4_0
void ProcessBeforeAndAfterTargets ()
{
var beforeTable = Targets.AsIEnumerable ()
expr.Parse (targets, ParseOptions.AllowItemsNoMetadataAndSplit);
return (string []) expr.ConvertTo (this, typeof (string []));
}
-#endif
[MonoTODO]
public string [] GetConditionedPropertyValues (string propertyName)
try {
buildState = BuildState.Started;
-#if NET_4_0
result = BuildDependencies (out executeOnErrors) &&
BuildBeforeThisTargets (out executeOnErrors) &&
DoBuild (out executeOnErrors) && // deps & Before targets built fine, do main build
BuildAfterThisTargets (out executeOnErrors);
-#else
- result = BuildDependencies (out executeOnErrors) && DoBuild (out executeOnErrors);
-#endif
buildState = BuildState.Finished;
} catch (Exception e) {
return result;
}
-#if NET_4_0
bool BuildBeforeThisTargets (out bool executeOnErrors)
{
executeOnErrors = false;
return result;
}
-#endif
bool BuildOtherTargets (IEnumerable<string> targetNames, Action<string> missing_target, out bool executeOnErrors)
{
}
}
-#if NET_4_0
internal string BeforeTargets {
get { return targetElement.GetAttribute ("BeforeTargets"); }
}
internal List<string> BeforeThisTargets { get; set; }
internal List<string> AfterThisTargets { get; set; }
-#endif
internal List<IBuildTask> BuildTasks {
get { return buildTasks; }
namespace Microsoft.Build.Framework {
[Serializable]
public class BuildErrorEventArgs
-#if NET_4_0
: LazyFormattedBuildEventArgs {
-#else
- : BuildEventArgs {
-#endif
string code;
int columnNumber;
string file;
int lineNumber;
string subcategory;
-#if NET_4_0
string projectFile;
-#endif
protected BuildErrorEventArgs ()
{
this.endColumnNumber = endColumnNumber;
}
-#if NET_4_0
public BuildErrorEventArgs (string subcategory, string code,
string file, int lineNumber, int columnNumber,
int endLineNumber, int endColumnNumber, string message,
this.endColumnNumber = endColumnNumber;
}
-#endif
public string Code {
get {
}
}
-#if NET_4_0
public string ProjectFile {
get { return projectFile; }
set { projectFile = value; }
}
-#endif
}
}
{
}
-#if NET_4_0
protected
-#endif
BuildEventArgs (string message, string helpKeyword,
string senderName, DateTime eventTimestamp)
{
}
}
-#if NET_4_0
virtual
-#endif
public string Message {
get {
return message;
}
-#if NET_4_0
protected set {
message = value;
}
-#endif
}
public string SenderName {
this.succeeded = succeeded;
}
-#if NET_4_0
public BuildFinishedEventArgs (string message,
string helpKeyword,
bool succeeded,
{
this.succeeded = succeeded;
}
-#endif
public bool Succeeded {
get {
[Serializable]
public class BuildStartedEventArgs : BuildStatusEventArgs {
-#if NET_4_0
IDictionary<string, string> buildEnvironment;
-#endif
protected BuildStartedEventArgs ()
{
{
}
-#if NET_4_0
public BuildStartedEventArgs (string message,
string helpKeyword,
IDictionary<string, string> environmentOfBuild)
public IDictionary<string, string> BuildEnvironment {
get { return buildEnvironment; }
}
-#endif
}
}
{
[Serializable]
public abstract class BuildStatusEventArgs
-#if NET_4_0
: LazyFormattedBuildEventArgs {
-#else
- : BuildEventArgs {
-#endif
protected BuildStatusEventArgs ()
{
{
}
-#if NET_4_0
protected BuildStatusEventArgs (string message,
string helpKeyword,
string senderName,
: base (message, helpKeyword, senderName, eventTimestamp, messageArgs)
{
}
-#endif
}
}
namespace Microsoft.Build.Framework {
[Serializable]
public class BuildWarningEventArgs
-#if NET_4_0
: LazyFormattedBuildEventArgs {
-#else
- : BuildEventArgs {
-#endif
string subcategory;
string code;
int columnNumber;
int endLineNumber;
int endColumnNumber;
-#if NET_4_0
string projectFile;
-#endif
protected BuildWarningEventArgs ()
{
this.endColumnNumber = endColumnNumber;
}
-#if NET_4_0
public BuildWarningEventArgs (string subcategory, string code,
string file, int lineNumber, int columnNumber,
int endLineNumber, int endColumnNumber, string message,
this.endColumnNumber = endColumnNumber;
}
-#endif
public string Code {
get {
}
}
-#if NET_4_0
public string ProjectFile {
get { return projectFile; }
set { projectFile = value; }
}
-#endif
}
}
-#if NET_4_0
using System;
namespace Microsoft.Build.Framework
}
}
-#endif
using System;
-#if NET_4_0
namespace Microsoft.Build.Framework
{
}
}
-#endif
//
-#if NET_4_0
using System;
using System.Collections;
}
}
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.Collections;
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#if NET_4_0
using System;
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using Microsoft.Build.Framework;
using System.Collections.Generic;
}
}
-#endif
///// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/////
-#if !NET_4_0
-
-using System;
-using Microsoft.Build.Framework;
-using Microsoft.Build.Utilities;
-
-namespace Microsoft.Build.Tasks
-{
- public class CreateTemporaryVCProject : TaskExtension
- {
- [MonoTODO]
- public CreateTemporaryVCProject ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- [Required]
- public string Configuration {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- [Required]
- public ITaskItem OutputProjectFile {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- [Required]
- public ITaskItem ProjectFile {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public ITaskItem[] ReferenceAssemblies {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- [Required]
- public ITaskItem[] ReferenceGuids {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public ITaskItem[] ReferenceImportLibraries {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public override bool Execute ()
- {
- throw new NotImplementedException ();
- }
- }
-}
-
-#endif
protected internal override void AddResponseFileCommands (CommandLineBuilderExtension commandLine)
{
-#if !NET_4_0
- //pre-MSBuild 2 targets don't support multi-targeting, so tell compiler to use 2.0 corlib
- commandLine.AppendSwitch ("/sdk:2");
-#endif
base.AddResponseFileCommands (commandLine);
if (AdditionalLibPaths != null && AdditionalLibPaths.Length > 0)
string workingDirectory;
string scriptFile;
-#if NET_4_0
Func<string, bool> errorMatcher, warningMatcher;
-#endif
public Exec ()
{
string commandLineCommands)
{
try {
-#if NET_4_0
errorMatcher = GetTryMatchRegexFunc (CustomErrorRegularExpression, true);
warningMatcher = GetTryMatchRegexFunc (CustomWarningRegularExpression, false);
-#endif
return base.ExecuteTool (pathToTool, responseFileCommands, commandLineCommands);
} finally {
if (scriptFile != null)
protected override void LogEventsFromTextOutput (string singleLine, MessageImportance messageImportance)
{
-#if NET_4_0
if (IgnoreStandardErrorWarningFormat ||
(!errorMatcher (singleLine) && !warningMatcher (singleLine)))
-#endif
Log.LogMessage (messageImportance, singleLine);
}
-#if NET_4_0
// @is_error_type - log as errors, else warnings
Func<string, bool> GetTryMatchRegexFunc (string regex_str, bool is_error_type)
{
return true;
};
}
-#endif
[MonoTODO]
protected override bool ValidateParameters ()
get { return base.StandardOutputLoggingImportance; }
}
-#if NET_4_0
public bool IgnoreStandardErrorWarningFormat { get; set; }
public string CustomErrorRegularExpression { get; set; }
public string CustomWarningRegularExpression { get; set; }
-#endif
[MonoTODO]
[Output]
}
#endif
-#if NET_4_0
[Output]
public string FrameworkVersion40Path {
get {
TargetDotNetFrameworkVersion.Version40);
}
}
-#endif
#if NET_4_5
[Output]
using Mono.XBuild.Utilities;
-#if NET_4_0
namespace Microsoft.Build.Tasks
{
}
}
-#endif
}
public
-#if NET_4_0
ITaskItem[]
-#else
- string[]
-#endif
InstalledAssemblyTables { get; set; }
[Output]
get { return suggestedRedirects; }
}
-#if NET_4_0
public string TargetFrameworkMoniker { get; set; }
public string TargetFrameworkMonikerDisplayName { get; set; }
-#endif
public string TargetFrameworkVersion { get; set; }
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !NET_4_0
-
-using System;
-using System.Collections.Specialized;
-using Microsoft.Build.Framework;
-
-namespace Microsoft.Build.Tasks {
-
- [MonoTODO]
- public class VCBuild : ToolTaskExtension {
-
- [MonoTODO]
- public VCBuild ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public ITaskItem[] AdditionalLibPaths {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public string AdditionalOptions {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public bool Clean {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public string Configuration {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public ITaskItem Override {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public string Platform {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- [Required]
- public ITaskItem[] Projects {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public bool Rebuild {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public ITaskItem SolutionFile {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public bool UserEnvironment {
- get {
- throw new NotImplementedException ();
- }
- set {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- protected override StringDictionary EnvironmentOverride {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- protected override string ToolName {
- get {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- public override bool Execute ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected internal override void AddCommandLineCommands (
- CommandLineBuilderExtension commandLine )
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected override string GenerateFullPathToTool ()
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- protected override bool ValidateParameters ()
- {
- throw new NotImplementedException ();
- }
- }
-}
-
-#endif
[MonoTODO]
protected override string ToolName {
get {
-#if NET_4_0
return MSBuildUtils.RunningOnWindows ? "vbnc.bat" : "vbnc";
-#else
- return MSBuildUtils.RunningOnWindows ? "vbnc2.bat" : "vbnc2";
-#endif
}
}
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.IO;
}
}
-#endif
}
}
-#if NET_4_0
public
-#else
- protected
-#endif
void AppendTextUnquoted (string textToAppend)
{
commandLine.Append (textToAppend);
Version30,
Version35,
#endif
-#if NET_4_0
Version40,
-#endif
#if NET_4_5
Version45,
#endif
VersionLatest = Version451
#elif NET_4_5
VersionLatest = Version45
-#elif NET_4_0
- VersionLatest = Version40
-#elif NET_3_5
- VersionLatest = Version35
#else
- VersionLatest = Version20
+ VersionLatest = Version40
#endif
}
}
public
#endif
sealed class TaskItem : MarshalByRefObject, ITaskItem
-#if NET_4_0
, ITaskItem2
-#endif
{
IDictionary escapedMetadata;
string escapedItemSpec;
if (sourceItem == null)
throw new ArgumentNullException ("sourceItem");
-#if NET_4_0
var ti2 = sourceItem as ITaskItem2;
if (ti2 != null) {
escapedItemSpec = ti2.EvaluatedIncludeEscaped;
escapedMetadata = ti2.CloneCustomMetadataEscaped ();
} else
-#endif
{
escapedItemSpec = MSBuildUtils.Escape (sourceItem.ItemSpec);
escapedMetadata = sourceItem.CloneCustomMetadata ();
return CollectionsUtil.CreateCaseInsensitiveHashtable (escapedMetadata);
}
-#if NET_4_0
IDictionary ITaskItem2.CloneCustomMetadataEscaped ()
{
return CloneCustomMetadataEscaped ();
}
-#endif
public void CopyMetadataTo (ITaskItem destinationItem)
{
return ((string) escapedMetadata [metadataName]) ?? String.Empty;
}
-#if NET_4_0
string ITaskItem2.GetMetadataValueEscaped (string metadataName)
{
return GetMetadataValue (metadataName);
}
-#endif
public override object InitializeLifetimeService ()
{
escapedMetadata [metadataName] = metadataValue;
}
-#if NET_4_0
void ITaskItem2.SetMetadataValueLiteral (string metadataName, string metadataValue)
{
SetMetadata (metadataName, MSBuildUtils.Escape (metadataValue));
}
-#endif
public override string ToString ()
{
return escapedItemSpec;
set { escapedItemSpec = value; }
}
-#if NET_4_0
string ITaskItem2.EvaluatedIncludeEscaped {
get { return escapedItemSpec; }
set { escapedItemSpec = value; }
}
-#endif
public int MetadataCount {
get { return escapedMetadata.Count + 11; }
lib_mono_dir = t2.FullName;
-#if NET_4_0
var windowsPath = Environment.GetFolderPath (Environment.SpecialFolder.Windows);
runningOnDotNet = !string.IsNullOrEmpty (windowsPath) && lib_mono_dir.StartsWith (windowsPath);
-#endif
if (Environment.GetEnvironmentVariable ("TESTING_MONO") != null) {
mono_dir = new string [] {
throw new NotImplementedException ();
}
- #if NET_4_0
public static string GetPathToStandardLibraries (string targetFrameworkIdentifier,
string targetFrameworkVersion,
string targetFrameworkProfile)
// I'm not sure if this is completely valid assumption...
return path;
}
- #endif
[MonoTODO]
public static string GetPathToSystemFile (string fileName)
namespace Microsoft.Build.Utilities
{
public abstract class ToolTask : Task
-#if NET_4_0
, ICancelableTask
-#endif
{
int exitCode;
int timeout;
MessageImportance standardOutputLoggingImportance;
StringBuilder toolOutput;
bool typeLoadException;
-#if NET_4_0
ManualResetEvent canceled;
-#endif
protected ToolTask ()
: this (null, null)
this.HelpKeywordPrefix = helpKeywordPrefix;
this.responseFileEncoding = Encoding.UTF8;
this.timeout = Int32.MaxValue;
-#if NET_4_0
canceled = new ManualResetEvent (false);
-#endif
}
[MonoTODO]
set { toolPath = value; }
}
-#if NET_4_0
protected ManualResetEvent ToolCanceled {
get {
return canceled;
{
canceled.Set ();
}
-#endif
#if XBUILD_12
protected MessageImportance StandardErrorImportanceToUse {
//FIXME: should also support config file, depending on ToolsetLocations
void LoadDefaultToolsets ()
{
-#if NET_4_0
AddToolset (new Toolset ("4.0",
ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version40), this, null));
-#endif
#if XBUILD_12
AddToolset (new Toolset ("12.0", ToolLocationHelper.GetPathToBuildTools ("12.0"), this, null));
#endif
#if !PLATFORM_COMPACTFRAMEWORK
[assembly: AllowPartiallyTrustedCallers]
[assembly: ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
- #if NET_4_0
[assembly: SecurityRules(SecurityRuleSet.Level1)]
- #else
- [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
- #endif
#endif
// Version information for an assembly consists of the following four values:
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
#if !MOBILE
- #if NET_4_0
[assembly: AssemblyVersion("4.0.0.0")]
- #else // NET_4_0
- [assembly: AssemblyVersion("2.0.0.0")]
- #endif // NET_4_0
#else
[assembly: AssemblyVersion(Consts.FxVersion)]
#endif
//
//
-#if NET_4_0
using System;
using System.Threading;
using System.Collections;
}
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Threading;
}
}
}
-#endif
//
//
-#if NET_4_0
using System;
using System.Threading;
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Threading;
}
}
}
-#endif
//
//
-#if NET_4_0
using System;
using System.Threading;
}
}
}
-#endif
break;
case CipherAlgorithmType.Rijndael:
-#if MOBILE || NET_4_0
// only AES is really used - and we can use CommonCrypto for iOS and OSX this way
this.encryptionAlgorithm = Aes.Create();
-#else
- this.encryptionAlgorithm = Rijndael.Create();
-#endif
break;
}
break;
case CipherAlgorithmType.Rijndael:
-#if MOBILE || NET_4_0
// only AES is really used - and we can use CommonCrypto for iOS and OSX this way
this.decryptionAlgorithm = Aes.Create();
-#else
- this.decryptionAlgorithm = Rijndael.Create();
-#endif
break;
}
private static readonly uint max3BitSmlIx = 0x1FFF;
private static readonly uint max5BitSmlIx = 0x7FF;
// NOTE: version and stream name strings MUST always be quad padded
-#if NET_4_0
private static readonly string version = "v4.0.30319\0\0";
-#else
- private static readonly string version = "v2.0.50727\0\0";
-#endif
private static readonly char[] tildeName = {'#','~','\0','\0'};
private static readonly char[] stringsName = {'#','S','t','r','i','n','g','s','\0','\0','\0','\0'};
private static readonly char[] usName = {'#','U','S','\0'};
[assembly: ComVisible (false)]
-#if NET_4_0
[assembly: TypeForwardedTo (typeof (System.Security.Cryptography.Aes))]
[assembly: TypeForwardedTo (typeof (System.Threading.LazyThreadSafetyMode ))]
[assembly: TypeForwardedTo (typeof (System.Lazy<>))]
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.IO;
}
}
-#endif
[DebuggerDisplay ("Count={Count}")]
[DebuggerTypeProxy (typeof (CollectionDebuggerView<,>))]
public class HashSet<T> : ICollection<T>, ISerializable, IDeserializationCallback
-#if NET_4_0
, ISet<T>
-#endif
{
const int INITIAL_SIZE = 10;
const float DEFAULT_LOAD_FACTOR = (90f / 100);
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.IO;
}
}
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.IO;
}
}
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.IO;
}
}
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.IO;
}
}
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System.Security.AccessControl;
}
}
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.IO;
}
}
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.IO;
}
}
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !NET_4_0
-
-using System;
-using System.Collections.ObjectModel;
-
-namespace System.Linq.Expressions {
-
- abstract class ExpressionVisitor {
-
- protected virtual void Visit (Expression expression)
- {
- if (expression == null)
- return;
-
- switch (expression.NodeType) {
- case ExpressionType.Negate:
- case ExpressionType.NegateChecked:
- case ExpressionType.Not:
- case ExpressionType.Convert:
- case ExpressionType.ConvertChecked:
- case ExpressionType.ArrayLength:
- case ExpressionType.Quote:
- case ExpressionType.TypeAs:
- case ExpressionType.UnaryPlus:
- VisitUnary ((UnaryExpression) expression);
- break;
- case ExpressionType.Add:
- case ExpressionType.AddChecked:
- case ExpressionType.Subtract:
- case ExpressionType.SubtractChecked:
- case ExpressionType.Multiply:
- case ExpressionType.MultiplyChecked:
- case ExpressionType.Divide:
- case ExpressionType.Modulo:
- case ExpressionType.Power:
- case ExpressionType.And:
- case ExpressionType.AndAlso:
- case ExpressionType.Or:
- case ExpressionType.OrElse:
- case ExpressionType.LessThan:
- case ExpressionType.LessThanOrEqual:
- case ExpressionType.GreaterThan:
- case ExpressionType.GreaterThanOrEqual:
- case ExpressionType.Equal:
- case ExpressionType.NotEqual:
- case ExpressionType.Coalesce:
- case ExpressionType.ArrayIndex:
- case ExpressionType.RightShift:
- case ExpressionType.LeftShift:
- case ExpressionType.ExclusiveOr:
- VisitBinary ((BinaryExpression) expression);
- break;
- case ExpressionType.TypeIs:
- VisitTypeIs ((TypeBinaryExpression) expression);
- break;
- case ExpressionType.Conditional:
- VisitConditional ((ConditionalExpression) expression);
- break;
- case ExpressionType.Constant:
- VisitConstant ((ConstantExpression) expression);
- break;
- case ExpressionType.Parameter:
- VisitParameter ((ParameterExpression) expression);
- break;
- case ExpressionType.MemberAccess:
- VisitMemberAccess ((MemberExpression) expression);
- break;
- case ExpressionType.Call:
- VisitMethodCall ((MethodCallExpression) expression);
- break;
- case ExpressionType.Lambda:
- VisitLambda ((LambdaExpression) expression);
- break;
- case ExpressionType.New:
- VisitNew ((NewExpression) expression);
- break;
- case ExpressionType.NewArrayInit:
- case ExpressionType.NewArrayBounds:
- VisitNewArray ((NewArrayExpression) expression);
- break;
- case ExpressionType.Invoke:
- VisitInvocation ((InvocationExpression) expression);
- break;
- case ExpressionType.MemberInit:
- VisitMemberInit ((MemberInitExpression) expression);
- break;
- case ExpressionType.ListInit:
- VisitListInit ((ListInitExpression) expression);
- break;
- default:
- throw new ArgumentException (string.Format ("Unhandled expression type: '{0}'", expression.NodeType));
- }
- }
-
- protected virtual void VisitBinding (MemberBinding binding)
- {
- switch (binding.BindingType) {
- case MemberBindingType.Assignment:
- VisitMemberAssignment ((MemberAssignment) binding);
- break;
- case MemberBindingType.MemberBinding:
- VisitMemberMemberBinding ((MemberMemberBinding) binding);
- break;
- case MemberBindingType.ListBinding:
- VisitMemberListBinding ((MemberListBinding) binding);
- break;
- default:
- throw new ArgumentException (string.Format ("Unhandled binding type '{0}'", binding.BindingType));
- }
- }
-
- protected virtual void VisitElementInitializer (ElementInit initializer)
- {
- VisitExpressionList (initializer.Arguments);
- }
-
- protected virtual void VisitUnary (UnaryExpression unary)
- {
- Visit (unary.Operand);
- }
-
- protected virtual void VisitBinary (BinaryExpression binary)
- {
- Visit (binary.Left);
- Visit (binary.Right);
- Visit (binary.Conversion);
- }
-
- protected virtual void VisitTypeIs (TypeBinaryExpression type)
- {
- Visit (type.Expression);
- }
-
- protected virtual void VisitConstant (ConstantExpression constant)
- {
- }
-
- protected virtual void VisitConditional (ConditionalExpression conditional)
- {
- Visit (conditional.Test);
- Visit (conditional.IfTrue);
- Visit (conditional.IfFalse);
- }
-
- protected virtual void VisitParameter (ParameterExpression parameter)
- {
- }
-
- protected virtual void VisitMemberAccess (MemberExpression member)
- {
- Visit (member.Expression);
- }
-
- protected virtual void VisitMethodCall (MethodCallExpression methodCall)
- {
- Visit (methodCall.Object);
- VisitExpressionList (methodCall.Arguments);
- }
-
- protected virtual void VisitList<T> (ReadOnlyCollection<T> list, Action<T> visitor)
- {
- foreach (T element in list) {
- visitor (element);
- }
- }
-
- protected virtual void VisitExpressionList (ReadOnlyCollection<Expression> list)
- {
- VisitList (list, Visit);
- }
-
- protected virtual void VisitMemberAssignment (MemberAssignment assignment)
- {
- Visit (assignment.Expression);
- }
-
- protected virtual void VisitMemberMemberBinding (MemberMemberBinding binding)
- {
- VisitBindingList (binding.Bindings);
- }
-
- protected virtual void VisitMemberListBinding (MemberListBinding binding)
- {
- VisitElementInitializerList (binding.Initializers);
- }
-
- protected virtual void VisitBindingList (ReadOnlyCollection<MemberBinding> list)
- {
- VisitList (list, VisitBinding);
- }
-
- protected virtual void VisitElementInitializerList (ReadOnlyCollection<ElementInit> list)
- {
- VisitList (list, VisitElementInitializer);
- }
-
- protected virtual void VisitLambda (LambdaExpression lambda)
- {
- Visit (lambda.Body);
- }
-
- protected virtual void VisitNew (NewExpression nex)
- {
- VisitExpressionList (nex.Arguments);
- }
-
- protected virtual void VisitMemberInit (MemberInitExpression init)
- {
- VisitNew (init.NewExpression);
- VisitBindingList (init.Bindings);
- }
-
- protected virtual void VisitListInit (ListInitExpression init)
- {
- VisitNew (init.NewExpression);
- VisitElementInitializerList (init.Initializers);
- }
-
- protected virtual void VisitNewArray (NewArrayExpression newArray)
- {
- VisitExpressionList (newArray.Expressions);
- }
-
- protected virtual void VisitInvocation (InvocationExpression invocation)
- {
- VisitExpressionList (invocation.Arguments);
- Visit (invocation.Expression);
- }
- }
-}
-
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Threading;
using System.Threading.Tasks;
internal abstract IEnumerable<T> GetSequential ();
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Threading;
using System.Threading.Tasks;
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
namespace System.Linq.Parallel.QueryNodes
}
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Threading;
using System.Collections;
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Threading;
using System.Collections;
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Threading;
using System.Collections;
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Threading;
using System.Collections;
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Threading;
using System.Collections;
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Linq;
using System.Collections.Generic;
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Threading;
using System.Collections.Generic;
}
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Threading;
using System.Collections;
}
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Collections.Generic;
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
namespace System.Linq.Parallel.QueryNodes
}
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Linq;
using System.Threading;
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Threading;
using System.Collections;
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Linq;
using System.Collections.Generic;
}
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Linq;
using System.Collections.Generic;
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Collections;
using System.Collections.Generic;
}
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Threading;
using System.Threading.Tasks;
}
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Linq;
using System.Threading;
}
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Threading;
using System.Linq;
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Linq;
using System.Collections.Generic;
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Linq;
using System.Collections;
}
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Collections;
using System.Collections.Generic;
}
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Threading;
using System.Collections;
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Threading;
using System.Collections;
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Linq.Parallel.QueryNodes;
void Visit (QueryHeadWorkerNode node);
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
namespace System.Linq.Parallel
void Visit (INodeVisitor visitor);
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Threading;
using System.Collections;
}
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Threading;
using System.Threading.Tasks;
}
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Collections.Generic;
}
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Threading;
using System.Collections;
}
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Linq;
using System.Collections;
}
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Threading;
using System.Linq.Parallel.QueryNodes;
}
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Threading;
using System.Linq.Parallel.QueryNodes;
#endregion
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Threading;
}
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Collections;
using System.Collections.Generic;
}
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Collections;
using System.Collections.Generic;
}
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System.Linq;
using System.Threading;
using System.Collections;
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Threading;
using System.Collections.Generic;
}
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Threading;
using System.Collections;
}
}
-#endif
#endregion
-#if NET_4_0
#region Zip
public static IEnumerable<TResult> Zip<TFirst, TSecond, TResult> (this IEnumerable<TFirst> first, IEnumerable<TSecond> second, Func<TFirst, TSecond, TResult> resultSelector)
}
#endregion
-#endif
#region Where
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
namespace System.Linq
{
}
}
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System.Linq.Expressions;
}
}
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
namespace System.Linq
{
}
}
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System.Collections;
using System.Collections.Generic;
}
}
-#endif
using System.Collections.Generic;
namespace System.Linq {
-#if NET_4_0
public interface IGrouping<out TKey, out TElement> : IEnumerable<TElement>
-#else
- public interface IGrouping<TKey, TElement> : IEnumerable<TElement>
-#endif
{
TKey Key { get; }
}
//
namespace System.Linq {
-#if NET_4_0
public interface IOrderedQueryable<out T> : IOrderedQueryable, IQueryable<T>
-#else
- public interface IOrderedQueryable<T> : IOrderedQueryable, IQueryable<T>
-#endif
{
}
}
namespace System.Linq {
-#if NET_4_0
public interface IQueryable<out T> : IQueryable, IEnumerable<T>
-#else
- public interface IQueryable<T> : IQueryable, IEnumerable<T>
-#endif
{
}
}
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Threading;
using System.Collections;
}
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Threading;
using System.Collections;
#endregion
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
namespace System.Linq
ForceParallelism = 1
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
namespace System.Linq
FullyBuffered
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Threading;
}
}
}
-#endif
#endregion
-#if NET_4_0
#region Zip
public static IQueryable<TResult> Zip<TFirst, TSecond, TResult> (this IQueryable<TFirst> source1, IEnumerable<TSecond> source2, Expression<Func<TFirst, TSecond, TResult>> resultSelector)
}
#endregion
-#endif
}
}
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.Collections.Generic;
}
}
-#endif
public T Value;
-#if NET_4_0
public StrongBox ()
{
}
-#endif
public StrongBox (T value)
{
#if MOBILE
// version has not changed between SL3 (System.Core) and SL4
[TypeForwardedFrom (Consts.AssemblySystem_Core)]
- #elif NET_4_0
+ #else
// use 3.5 version
[TypeForwardedFrom ("System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
namespace System.Threading.Tasks
{
}
}
-#endif
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#if NET_4_0
using System;
using System.Runtime.CompilerServices;
[assembly:TypeForwardedTo (typeof(System.Threading.LockRecursionException))]
-#else
-
-using System;
-using System.Runtime.Serialization;
-
-namespace System.Threading
-{
- [Serializable]
- public class LockRecursionException : Exception
- {
- public LockRecursionException ()
- : base ()
- {
- }
-
- public LockRecursionException (string message)
- : base (message)
- {
- }
-
- public LockRecursionException (string message, Exception e)
- : base (message, e)
- {
- }
-
- protected LockRecursionException (SerializationInfo info, StreamingContext sc)
- : base (info, sc)
- {
- }
- }
-}
-
-#endif
return (state & value) > 0;
}
-#if !NET_4_0
- internal static bool Wait (this ManualResetEvent self, int timeout)
- {
- return self.WaitOne (timeout);
- }
-
- internal static bool IsSet (this ManualResetEvent self)
- {
- return self.WaitOne (0);
- }
-#else
internal static bool IsSet (this ManualResetEventSlim self)
{
return self.IsSet;
}
-#endif
}
}
\ No newline at end of file
using System;
using System.Runtime.CompilerServices;
-#if NET_4_0
[assembly:TypeForwardedTo (typeof(Action<>))]
[assembly:TypeForwardedTo (typeof(Action<,>))]
[assembly:TypeForwardedTo (typeof(Action<,,>))]
[assembly:TypeForwardedTo (typeof(Action<,,,>))]
[assembly:TypeForwardedTo (typeof (Action))]
-#endif
namespace System
{
-#if NET_4_0
public delegate void Action<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9> (
T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9);
public delegate void Action<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11, in T12, in T13, in T14, in T15, in T16> (
T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15, T16 arg16);
-#else
- public delegate void Action ();
- public delegate void Action<T1, T2> (T1 arg1, T2 arg2);
- public delegate void Action<T1, T2, T3> (T1 arg1, T2 arg2, T3 arg3);
- public delegate void Action<T1, T2, T3, T4> (T1 arg1, T2 arg2, T3 arg3, T4 arg4);
-#endif
}
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
//
-#if NET_4_0
using System;
using System.Runtime.CompilerServices;
[assembly:TypeForwardedTo (typeof(Func<,,>))]
[assembly:TypeForwardedTo (typeof(Func<,,,>))]
[assembly:TypeForwardedTo (typeof(Func<,,,,>))]
-#endif
namespace System
{
-#if NET_4_0
public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, out TResult> (
T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9);
public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11, in T12, in T13, in T14, in T15, in T16, out TResult> (
T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15, T16 arg16);
-#else
- public delegate TResult Func<TResult> ();
- public delegate TResult Func<T, TResult> (T arg);
- public delegate TResult Func<T1, T2, TResult> (T1 arg1, T2 arg2);
- public delegate TResult Func<T1, T2, T3, TResult> (T1 arg1, T2 arg2, T3 arg3);
- public delegate TResult Func<T1, T2, T3, T4, TResult> (T1 arg1, T2 arg2, T3 arg3, T4 arg4);
-#endif
}
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#if NET_4_0
using System;
using System.Runtime.CompilerServices;
[assembly:TypeForwardedTo (typeof(InvalidTimeZoneException))]
-#else
-
-namespace System
-{
- [Serializable]
- public class InvalidTimeZoneException : Exception
- {
- public InvalidTimeZoneException () : base ()
- {}
-
- public InvalidTimeZoneException (string message) : base (message)
- {}
-
- public InvalidTimeZoneException (string message, Exception e) : base (message, e)
- {}
-
- protected InvalidTimeZoneException (Runtime.Serialization.SerializationInfo info, Runtime.Serialization.StreamingContext sc) : base (info, sc)
- {}
- }
-}
-
-#endif
namespace System
{
-#if NET_4_0 || !INSIDE_CORLIB
public
-#endif
sealed partial class TimeZoneInfo {
[SerializableAttribute]
#if MOBILE
[TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#elif NET_4_0
+#else
[TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
#endif
public sealed class AdjustmentRule : IEquatable<TimeZoneInfo.AdjustmentRule>, ISerializable, IDeserializationCallback
daylightTransitionEnd.GetHashCode ();
}
-#if NET_4_0
void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)
-#else
- public void GetObjectData (SerializationInfo info, StreamingContext context)
-#endif
{
if (info == null)
throw new ArgumentNullException ("info");
info.AddValue ("DaylightTransitionStart", DaylightTransitionStart);
info.AddValue ("DaylightTransitionEnd", DaylightTransitionEnd);
}
-#if NET_4_0
void IDeserializationCallback.OnDeserialization (object sender)
-#else
- public void OnDeserialization (object sender)
-#endif
{
try {
TimeZoneInfo.AdjustmentRule.Validate (dateStart, dateEnd, daylightDelta,
namespace System
{
-#if NET_4_0 || !INSIDE_CORLIB
public
-#endif
partial class TimeZoneInfo
{
public static TimeZoneInfo FromSerializedString (string source)
namespace System
{
-#if NET_4_0 || !INSIDE_CORLIB
public
-#endif
sealed partial class TimeZoneInfo
{
[SerializableAttribute]
#if MOBILE
[TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#elif NET_4_0
+#else
[TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
#endif
public struct TransitionTime : IEquatable<TimeZoneInfo.TransitionTime>, ISerializable, IDeserializationCallback
}
-#if NET_4_0
void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)
-#else
- public void GetObjectData (SerializationInfo info, StreamingContext context)
-#endif
{
if (info == null)
throw new ArgumentNullException ("info");
return (day ^ (int)dayOfWeek ^ month ^ (int)timeOfDay.Ticks ^ week);
}
-#if NET_4_0
void IDeserializationCallback.OnDeserialization (object sender)
-#else
- public void OnDeserialization (object sender)
-#endif
{
try {
TimeZoneInfo.TransitionTime.Validate (timeOfDay, month, week, day, dayOfWeek, isFixedDateRule);
{
#if MOBILE
[TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#elif NET_4_0
+#else
[TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
#endif
[SerializableAttribute]
-#if NET_4_0 || !INSIDE_CORLIB
public
-#endif
sealed partial class TimeZoneInfo : IEquatable<TimeZoneInfo>, ISerializable, IDeserializationCallback
{
TimeSpan baseUtcOffset;
//FIXME: do not rely on DateTime implementation !
if (this == TimeZoneInfo.Local)
{
-#if NET_4_0
return dateTime.ToLocalTime ();
-#else
- return DateTime.SpecifyKind (dateTime.ToLocalTime (), DateTimeKind.Unspecified);
-#endif
}
return hash_code;
}
-#if NET_4_0
void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)
-#else
- public void GetObjectData (SerializationInfo info, StreamingContext context)
-#endif
{
if (info == null)
throw new ArgumentNullException ("info");
return false;
}
-#if NET_4_0
void IDeserializationCallback.OnDeserialization (object sender)
-#else
- public void OnDeserialization (object sender)
-#endif
{
try {
TimeZoneInfo.Validate (id, baseUtcOffset, adjustmentRules);
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#if NET_4_0
using System;
using System.Runtime.CompilerServices;
[assembly:TypeForwardedTo (typeof(TimeZoneNotFoundException))]
-#else
-
-namespace System
-{
- [Serializable]
- public class TimeZoneNotFoundException : Exception
- {
- public TimeZoneNotFoundException () : base ()
- {}
-
- public TimeZoneNotFoundException (string message) : base (message)
- {}
-
- public TimeZoneNotFoundException (string message, Exception e) : base (message, e)
- {}
-
- protected TimeZoneNotFoundException (Runtime.Serialization.SerializationInfo info, Runtime.Serialization.StreamingContext sc) : base (info, sc)
- {}
- }
-}
-
-#endif
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../ecma.pub")]
-#if NET_4_0
[assembly: System.Security.SecurityCritical]
[assembly: ComVisible(false)]
[assembly: CLSCompliant(true)]
internal const string EcmaPublicKeyToken = "b77a5c561934e089";
}
-#endif
[AspNetCompatibilityRequirements (RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]\r
public class DataService<T> : IRequestHandler\r
{\r
-#if NET_4_0\r
DataServiceProcessingPipeline processingPipeline;\r
-#endif\r
public void AttachHost (IDataServiceHost host)\r
{\r
if (host == null)\r
protected T CurrentDataSource {\r
get; private set;\r
}\r
-#if NET_4_0\r
public DataServiceProcessingPipeline ProcessingPipeline {\r
get {\r
if (processingPipeline == null)\r
return processingPipeline;\r
}\r
}\r
-#endif\r
protected virtual T CreateDataSource()\r
{\r
throw new NotImplementedException();\r
using System.Collections.Generic;\r
using System.Linq;\r
using System.Linq.Expressions;\r
-#if NET_4_0\r
using System.Data.Services.Providers;\r
-#endif\r
\r
namespace System.Data.Services\r
{\r
this.Name = name;\r
this.Filter = filter;\r
}\r
-#if NET_4_0\r
public ResourceProperty ExpandedProperty {\r
get {\r
throw new NotImplementedException ();\r
}\r
}\r
-#endif\r
public string Name {\r
get;\r
private set;\r
{\r
public sealed class ProcessRequestArgs\r
{\r
-#if NET_4_0\r
public DataServiceOperationContext OperationContext {\r
get; private set;\r
}\r
-#endif\r
public bool IsBatchOperation {\r
get; private set;\r
}\r
private static bool TryGuidParse (string value, out Guid guid)
{
-#if NET_4_0
return Guid.TryParse (value, out guid);
-#else
- try {
- guid = new Guid (value);
- return true;
- } catch (Exception) {
- guid = Guid.Empty;
- return false;
- }
-#endif
}
private static ConvertResult StringToGuid(string valueString)
}
sb.Append(val, startIndex, count);
-#if NET_4_0
Contract.Assert(i < val.Length, "Found that a '\' was the last character in a string, which is invalid JSON. Verify the calling method uses a valid JSON string as the input parameter of this method.");
-#endif
switch (val[i])
{
case '"':
sb.Append('\t');
break;
case 'u':
-#if NET_4_0
Contract.Assert((i + 3) < val.Length, String.Format(CultureInfo.CurrentCulture, "Unexpected char {0} at position {1}. The unicode escape sequence should be followed by 4 digits.", val[i], i));
-#endif
sb.Append(ParseChar(val.Substring(i + 1, 4), NumberStyles.HexNumber));
i += 4;
break;
if (jsonType == JsonType.String)
{
string str = UnescapeJsonString(ToString());
-#if NET_4_0
Contract.Assert(str.Length >= 2 && str.StartsWith("\"", StringComparison.Ordinal) && str.EndsWith("\"", StringComparison.Ordinal), "The unescaped string must begin and end with quotes.");
-#endif
str = str.Substring(1, str.Length - 2);
if (stringConverters.ContainsKey(type))
[assembly: InternalsVisibleTo ("System.Windows, PublicKey=00240000048000009400000006020000002400005253413100040000010001008D56C76F9E8649383049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B37AB")]
[assembly: InternalsVisibleTo ("System.Windows.Browser, PublicKey=00240000048000009400000006020000002400005253413100040000010001008D56C76F9E8649383049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B37AB")]
[assembly: InternalsVisibleTo ("System.Xml, PublicKey=00240000048000009400000006020000002400005253413100040000010001008D56C76F9E8649383049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B37AB")]
-#elif NET_4_0
- [assembly: AssemblyKeyFile ("../msfinal.pub")]
- [assembly: AllowPartiallyTrustedCallers]
- [assembly: SecurityCritical]
#else
- [assembly: AssemblyKeyFile ("../ecma.pub")]
+ [assembly: AssemblyKeyFile ("../msfinal.pub")]
[assembly: AllowPartiallyTrustedCallers]
[assembly: SecurityCritical]
#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Cookie))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.CookieCollection))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.NetworkInformation.NetworkChange))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.NetworkInformation.NetworkInterface))]
-#endif
[assembly: AllowPartiallyTrustedCallers]
[assembly: ComCompatibleVersion (1, 0, 3300, 0)]
[assembly: SecurityCritical (SecurityCriticalScope.Explicit)]
-#if NET_4_0
// for SyndicationElementExtension
// FIXME: mcs in 2-10 branch breaks System.ServiceModel build on resolving this. So, disabling it so far.
// [assembly: InternalsVisibleTo ("System.ServiceModel, PublicKey=00000000000000000400000000000000")]
-#else
-// for SyndicationElementExtension
-[assembly: InternalsVisibleTo ("System.ServiceModel.Web, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
-#endif
#endif
[assembly: ComVisible (false)]
namespace System.Runtime.Serialization
{
// See http://msdn.microsoft.com/en-us/library/ee358759.aspx
-#if NET_4_0
public
-#else
- internal
-#endif
abstract class DataContractResolver
{
public abstract Type ResolveName (string typeName, string typeNamespace, Type declaredType, DataContractResolver knownTypeResolver);
dataContractSurrogate);
}
-#if NET_4_0
public DataContractSerializer (Type type,
IEnumerable<Type> knownTypes,
int maxObjectsInGraph,
{
DataContractResolver = dataContractResolver;
}
-#endif
#if NET_4_5
public DataContractSerializer (Type type, DataContractSerializerSettings settings)
surrogate = dataContractSurrogate;
}
-#if NET_4_0
public
-#else
- internal
-#endif
DataContractResolver DataContractResolver {
get { return resolver; }
private set {
return ret;
}
-#if NET_4_0
public object ReadObject (XmlDictionaryReader reader, bool verifyObjectName, DataContractResolver resolver)
{
var bak = DataContractResolver;
DataContractResolver = bak;
}
}
-#endif
// SP1
public override void WriteObject (XmlWriter writer, object graph)
WriteObject (w, graph);
}
-#if NET_4_0
public void WriteObject (XmlDictionaryWriter writer, object graph, DataContractResolver resolver)
{
var bak = DataContractResolver;
DataContractResolver = bak;
}
}
-#endif
[MonoTODO ("use DataContractSurrogate")]
/*
namespace System.Security.Cryptography.X509Certificates {
-#if NET_4_0
public static class X509Certificate2UI {
-#else
- public sealed class X509Certificate2UI {
-
- // sadly this isn't a static class
- private X509Certificate2UI ()
- {
- }
-#endif
[MonoTODO]
public static void DisplayCertificate (X509Certificate2 certificate)
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.ComponentModel;
using System.Configuration;
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.ComponentModel;
using System.Configuration;
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.ComponentModel;
using System.Configuration;
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.ComponentModel;
using System.Configuration;
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.ComponentModel;
using System.Configuration;
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.ComponentModel;
using System.Configuration;
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.ComponentModel;
using System.Configuration;
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.ComponentModel;
using System.Configuration;
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.ComponentModel;
using System.Configuration;
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.ComponentModel;
using System.Configuration;
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.ComponentModel;
using System.Configuration;
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.ComponentModel;
using System.Configuration;
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.ComponentModel;
using System.Configuration;
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.ComponentModel;
using System.Configuration;
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.ComponentModel;
using System.Configuration;
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.ComponentModel;
using System.Configuration;
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.ComponentModel;
using System.Configuration;
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.ComponentModel;
using System.Configuration;
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.ComponentModel;
using System.Configuration;
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.ComponentModel;
using System.Configuration;
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.ComponentModel;
using System.Configuration;
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.ComponentModel;
using System.Configuration;
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.ComponentModel;
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.Collections;
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.ComponentModel;
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.Collections;
}
}
-#endif
DefaultOutgoingResponseFormat = WebMessageFormat.Xml;
}
-#if NET_4_0
public virtual bool AutomaticFormatSelectionEnabled { get; set; }
public virtual bool FaultExceptionEnabled { get; set; }
public virtual bool HelpEnabled { get; set; }
-#endif
public virtual WebMessageBodyStyle DefaultBodyStyle { get; set; }
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
}
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
}
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
}
}
}
-#endif
var ms = Stream as MemoryStream;
if (ms == null) {
ms = new MemoryStream ();
-#if NET_4_0
Stream.CopyTo (ms);
-#else
- byte [] tmp = new byte [0x1000];
- int size;
- do {
- size = Stream.Read (tmp, 0, tmp.Length);
- ms.Write (tmp, 0, size);
- } while (size > 0);
-#endif
this.Stream = ms;
}
return new RawMessageBuffer (ms.ToArray (), headers, properties);
{
if (serializer == null)
serializer = new DataContractSerializer (extension.GetType ());
-#if NET_4_0
// FIXME: this is a nasty workaround that mcs somehow fails to resolve InternalVisibleTo(System.ServiceModel) in System.Runtime.Serialization.dll and thus rejects the use of KnownTypeCollection unlike NET_2_0 case (where System.ServiceModel.Web.dll is referenced).
XmlQualifiedName qname = null;
if (name == null || ns == null) {
xr.MoveToContent ();
qname = new XmlQualifiedName (xr.LocalName, xr.NamespaceURI);
}
-#else
- var qname = name == null || ns == null ? KnownTypeCollection.GetStaticQName (extension.GetType ()) : null;
-#endif
this.Name = name ?? qname.Name;
this.Namespace = ns ?? qname.Namespace;
this.extension = extension;
}
#if !NET_2_1
-#if NET_4_0
[DefaultValue (false)]
-#endif
public bool AllowCookies {
get { return t.AllowCookies; }
set { t.AllowCookies = value; }
}
-#if NET_4_0
[DefaultValue (false)]
-#endif
public bool BypassProxyOnLocal {
get { return t.BypassProxyOnLocal; }
set { t.BypassProxyOnLocal = value; }
}
-#if NET_4_0
[MonoTODO]
public bool CrossDomainScriptAccessEnabled { get; set; }
get { return msgenc.ContentTypeMapper; }
set { msgenc.ContentTypeMapper = value; }
}
-#endif
-#if NET_4_0
[DefaultValue (HostNameComparisonMode.StrongWildcard)]
-#endif
public HostNameComparisonMode HostNameComparisonMode {
get { return t.HostNameComparisonMode; }
set { t.HostNameComparisonMode = value; }
}
-#if NET_4_0
[DefaultValue (0x10000)]
-#endif
public long MaxBufferPoolSize {
get { return t.MaxBufferPoolSize; }
set { t.MaxBufferPoolSize = value; }
}
-#if NET_4_0
[DefaultValue (TransferMode.Buffered)]
-#endif
public TransferMode TransferMode {
get { return t.TransferMode; }
set { t.TransferMode = value; }
}
-#if NET_4_0
[DefaultValue (true)]
-#endif
public bool UseDefaultWebProxy {
get { return t.UseDefaultWebProxy; }
set { t.UseDefaultWebProxy = value; }
}
-#if NET_4_0
[DefaultValue (null)]
-#endif
public Uri ProxyAddress {
get { return t.ProxyAddress; }
set { t.ProxyAddress = value; }
}
#endif
-#if NET_4_0
[DefaultValue (0x80000)]
-#endif
public int MaxBufferSize {
get { return t.MaxBufferSize; }
set { t.MaxBufferSize = value; }
}
-#if NET_4_0
[DefaultValue (0x10000)]
-#endif
public long MaxReceivedMessageSize {
get { return t.MaxReceivedMessageSize; }
set { t.MaxReceivedMessageSize = value; }
public WebHttpSecurity Security {
get { return security; }
-#if NET_4_0
set {
if (value == null)
throw new ArgumentNullException ("value");
security = value;
}
-#endif
}
public Encoding WriteEncoding {
get { return receive_synchronously; }
}
-#if NET_4_0
[EditorBrowsable (EditorBrowsableState.Advanced)]
public bool ShouldSerializeReaderQuotas ()
{
{
return false;
}
-#endif
}
}
{
public sealed class WebHttpSecurity
{
-#if NET_4_0
public WebHttpSecurity ()
-#else
- internal WebHttpSecurity ()
-#endif
{
// there is no public constructor for transport ...
#if !NET_2_1
set { mode = value; }
}
-#if NET_4_0
public HttpTransportSecurity Transport { get; set; }
-#elif !NET_2_1
- public HttpTransportSecurity Transport { get; private set; }
-#endif
-#if NET_4_0
[EditorBrowsable (EditorBrowsableState.Advanced)]
public bool ShouldSerializeMode ()
{
{
return false;
}
-#endif
}
}
namespace System.ServiceModel.Activation
{
-#if NET_4_0
[System.Runtime.CompilerServices.TypeForwardedFrom (Consts.AssemblySystemServiceModel_3_0)]
-#endif
public class ServiceHostFactory : ServiceHostFactoryBase
{
[MonoTODO]
public XmlDictionaryReaderQuotas ReaderQuotas {
get { return quotas; }
-#if NET_4_0
set { quotas = value; }
-#endif
}
public override IChannelFactory<TChannel> BuildChannelFactory<TChannel> (
{
internal class HttpChannelFactory<TChannel> : TransportChannelFactoryBase<TChannel>
{
-#if NET_2_1 || NET_4_0
IHttpCookieContainerManager cookie_manager;
-#endif
public HttpChannelFactory (HttpTransportBindingElement source, BindingContext ctx)
: base (source, ctx)
MessageEncoder = CreateEncoder<TChannel> (mbe);
continue;
}
-#if NET_2_1 || NET_4_0
var tbe = be as HttpTransportBindingElement;
if (tbe != null)
cookie_manager = tbe.GetProperty<IHttpCookieContainerManager> (ctx);
-#endif
}
if (MessageEncoder == null)
MessageEncoder = new TextMessageEncoder (MessageVersion.Default, Encoding.UTF8);
public override T GetProperty<T> ()
{
-#if NET_2_1 || NET_4_0
if (cookie_manager is T)
return (T) (object) cookie_manager;
-#endif
return base.GetProperty<T> ();
}
}
namespace System.ServiceModel.Channels
{
-#if NET_4_0
[Obsolete ("Use AllowCookies.")]
-#endif
public class HttpCookieContainerBindingElement : BindingElement
{
HttpCookieContainerManager manager;
result.WebRequest = web_request;
web_request.Method = "POST";
web_request.ContentType = Encoder.ContentType;
-#if NET_2_1 || NET_4_0
HttpWebRequest hwr = (web_request as HttpWebRequest);
var cmgr = source.GetProperty<IHttpCookieContainerManager> ();
if (cmgr != null)
hwr.CookieContainer = cmgr.CookieContainer;
-#endif
// client authentication (while SL3 has NetworkCredential class, it is not implemented yet. So, it is non-SL only.)
var httpbe = (HttpTransportBindingElement) source.Transport;
case "Expect":
web_request.Expect = hp.Headers [key];
break;
-#if NET_4_0
case "Host":
web_request.Host = hp.Headers [key];
break;
-#endif
//case "If-Modified-Since":
// web_request.IfModifiedSince = hp.Headers [key];
// break;
using System.ComponentModel;
using System.Net;
using System.Net.Security;
-#if NET_4_0
using System.Security.Authentication.ExtendedProtection;
-#endif
using System.ServiceModel.Channels;
#if !NET_2_1
using System.ServiceModel.Channels.Http;
AuthenticationSchemes proxy_auth_scheme =
AuthenticationSchemes.Anonymous;
// If you add fields, do not forget them in copy constructor.
-#if NET_4_0
HttpCookieContainerManager cookie_manager;
-#endif
public HttpTransportBindingElement ()
{
auth_scheme = other.auth_scheme;
proxy_auth_scheme = other.proxy_auth_scheme;
-#if NET_4_0
DecompressionEnabled = other.DecompressionEnabled;
LegacyExtendedProtectionPolicy = other.LegacyExtendedProtectionPolicy;
ExtendedProtectionPolicy = other.ExtendedProtectionPolicy;
cookie_manager = other.cookie_manager;
-#endif
}
-#if NET_4_0
[DefaultValue (AuthenticationSchemes.Anonymous)]
-#endif
public AuthenticationSchemes AuthenticationScheme {
get { return auth_scheme; }
set { auth_scheme = value; }
}
-#if NET_4_0
[DefaultValue (AuthenticationSchemes.Anonymous)]
-#endif
public AuthenticationSchemes ProxyAuthenticationScheme {
get { return proxy_auth_scheme; }
set { proxy_auth_scheme = value; }
}
-#if NET_4_0
[DefaultValue (false)]
-#endif
public bool AllowCookies {
get { return allow_cookies; }
set { allow_cookies = value; }
}
-#if NET_4_0
[DefaultValue (false)]
-#endif
public bool BypassProxyOnLocal {
get { return bypass_proxy_on_local; }
set { bypass_proxy_on_local = value; }
}
-#if NET_4_0
[DefaultValue (false)]
[MonoTODO]
public bool DecompressionEnabled { get; set; }
-#endif
-#if NET_4_0
[DefaultValue (HostNameComparisonMode.StrongWildcard)]
-#endif
public HostNameComparisonMode HostNameComparisonMode {
get { return host_cmp_mode; }
set { host_cmp_mode = value; }
}
-#if NET_4_0
[DefaultValue (true)]
-#endif
public bool KeepAliveEnabled {
get { return keep_alive_enabled; }
set { keep_alive_enabled = value; }
}
-#if NET_4_0
[DefaultValue (0x10000)]
-#endif
public int MaxBufferSize {
get { return max_buffer_size; }
set { max_buffer_size = value; }
}
-#if NET_4_0
[DefaultValue (null)]
[TypeConverter (typeof (UriTypeConverter))]
-#endif
public Uri ProxyAddress {
get { return proxy_address; }
set { proxy_address = value; }
}
-#if NET_4_0
[DefaultValue ("")]
-#endif
public string Realm {
get { return realm; }
set { realm = value; }
get { return Uri.UriSchemeHttp; }
}
-#if NET_4_0
[DefaultValue (TransferMode.Buffered)]
-#endif
public TransferMode TransferMode {
get { return transfer_mode; }
set { transfer_mode = value; }
}
-#if NET_4_0
[DefaultValue (false)]
-#endif
public bool UnsafeConnectionNtlmAuthentication {
get { return unsafe_ntlm_auth; }
set { unsafe_ntlm_auth = value; }
}
-#if NET_4_0
[DefaultValue (true)]
-#endif
public bool UseDefaultWebProxy {
get { return use_default_proxy; }
set { use_default_proxy = value; }
}
-#if NET_4_0
[Obsolete ("Use ExtendedProtectionPolicy")]
[MonoTODO]
public object LegacyExtendedProtectionPolicy { get; set; }
[MonoTODO]
public ExtendedProtectionPolicy ExtendedProtectionPolicy { get; set; }
-#endif
public override bool CanBuildChannelFactory<TChannel> (
BindingContext context)
return (T) (object) new HttpBindingProperties (this);
if (typeof (T) == typeof (TransferMode))
return (T) (object) TransferMode;
-#if NET_4_0
if (typeof(T) == typeof(IHttpCookieContainerManager)) {
if (!AllowCookies)
return null;
cookie_manager = new HttpCookieContainerManager ();
return (T) (object) cookie_manager;
}
-#endif
return base.GetProperty<T> (context);
}
-#if NET_2_1 || NET_4_0
using System;
using System.Net;
CookieContainer CookieContainer { get; set; }
}
}
-#endif
public XmlDictionaryReaderQuotas ReaderQuotas {
get { return quotas; }
-#if NET_4_0
set { quotas = value; }
-#endif
}
public Encoding WriteEncoding {
static ConfigurationProperty headers;
static ConfigurationProperty identity;
static ConfigurationProperty name;
-#if NET_4_0
static ConfigurationProperty endpoint_configuration;
static ConfigurationProperty kind;
-#endif
static ChannelEndpointElement ()
{
typeof (string), "", new StringConverter (), null,
ConfigurationPropertyOptions.IsKey);
-#if NET_4_0
endpoint_configuration = new ConfigurationProperty ("endpointConfiguration", typeof (string), "", null, new StringValidator (0), ConfigurationPropertyOptions.IsKey);
kind = new ConfigurationProperty ("kind", typeof (string), "", null, new StringValidator (0), ConfigurationPropertyOptions.IsKey);
-#endif
properties.Add (address);
properties.Add (behavior_configuration);
properties.Add (identity);
properties.Add (name);
-#if NET_4_0
properties.Add (endpoint_configuration);
properties.Add (kind);
-#endif
}
public ChannelEndpointElement ()
set { base [name] = value; }
}
-#if NET_4_0
[StringValidator (MinLength = 0)]
[ConfigurationProperty ("endpointConfiguration", DefaultValue = "", Options = ConfigurationPropertyOptions.IsKey)]
public string EndpointConfiguration {
get { return (string) base [kind]; }
set { base [kind] = value; }
}
-#endif
protected override ConfigurationPropertyCollection Properties {
get { return properties; }
get { return (ExtensionsSection) GetSection ("system.serviceModel/extensions"); }
}
-#if NET_4_0
public static ProtocolMappingSection ProtocolMappingSection {
get {
return (ProtocolMappingSection) GetSection ("system.serviceModel/protocolMapping");
return (StandardEndpointsSection) GetSection ("system.serviceModel/standardEndpoints");
}
}
-#endif
public static Binding CreateBinding (string binding, string bindingConfiguration)
{
if (cached_assemblies.Contains (ass))
continue;
-#if NET_4_0
if (!ass.IsDynamic)
-#endif
cached_assemblies.Add (ass);
foreach (var t in ass.GetTypes ()) {
return null;
}
-#if NET_4_0
public static Binding GetBindingByProtocolMapping (Uri address)
{
ProtocolMappingElement el = ConfigUtil.ProtocolMappingSection.ProtocolMappingCollection [address.Scheme];
return inst;
}
-#endif
public static KeyedByTypeCollection<IEndpointBehavior> CreateEndpointBehaviors (string bindingConfiguration)
{
{
// Static Fields
static ConfigurationPropertyCollection properties;
-#if NET_4_0
static ConfigurationProperty end_to_end_tracing;
static ConfigurationProperty etw_provider_id;
-#endif
static ConfigurationProperty message_logging;
static ConfigurationProperty performance_counters;
static ConfigurationProperty performance_counter_enabled;
static DiagnosticSection ()
{
properties = new ConfigurationPropertyCollection ();
-#if NET_4_0
end_to_end_tracing = new ConfigurationProperty ("endToEndTracing", typeof (EndToEndTracingElement), null, null, null, ConfigurationPropertyOptions.None);
etw_provider_id = new ConfigurationProperty ("etwProviderId", typeof (string), null, null, null, ConfigurationPropertyOptions.None);
-#endif
message_logging = new ConfigurationProperty ("messageLogging", typeof (MessageLoggingElement), null, null, null, ConfigurationPropertyOptions.None);
performance_counters = new ConfigurationProperty ("performanceCounters", typeof (PerformanceCounterScope), "Off", null, null, ConfigurationPropertyOptions.None);
wmi_provider_enabled = new ConfigurationProperty ("wmiProviderEnabled",
typeof (bool), "false", new BooleanConverter (), null, ConfigurationPropertyOptions.None);
-#if NET_4_0
properties.Add (end_to_end_tracing);
properties.Add (etw_provider_id);
-#endif
properties.Add (message_logging);
properties.Add (performance_counters);
properties.Add (performance_counter_enabled);
// Properties
-#if NET_4_0
[ConfigurationProperty ("endToEndTracing", Options = ConfigurationPropertyOptions.None)]
public EndToEndTracingElement EndToEndTracing {
get { return (EndToEndTracingElement) base [end_to_end_tracing]; }
get { return (string) base [etw_provider_id]; }
set { base [etw_provider_id] = value; }
}
-#endif
[ConfigurationProperty ("messageLogging",
Options = ConfigurationPropertyOptions.None)]
-#if NET_4_0
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
}
}
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.Collections;
using System.Collections.Generic;
protected internal abstract bool TryAdd (string name, ServiceEndpoint endpoint, ConfigurationType config);
}
}
-#endif
get { return (ExtensionElementCollection) base ["bindingExtensions"]; }
}
-#if NET_4_0
[ConfigurationProperty ("endpointExtensions",
Options = ConfigurationPropertyOptions.None)]
public ExtensionElementCollection EndpointExtensions {
get { return (ExtensionElementCollection) base ["endpointExtensions"]; }
}
-#endif
protected override ConfigurationPropertyCollection Properties {
get {
_properties.Add (new ConfigurationProperty ("behaviorExtensions", typeof (ExtensionElementCollection), null, null, null, ConfigurationPropertyOptions.None));
_properties.Add (new ConfigurationProperty ("bindingElementExtensions", typeof (ExtensionElementCollection), null, null, null, ConfigurationPropertyOptions.None));
_properties.Add (new ConfigurationProperty ("bindingExtensions", typeof (ExtensionElementCollection), null, null, null, ConfigurationPropertyOptions.None));
-#if NET_4_0
_properties.Add (new ConfigurationProperty ("endpointExtensions", typeof (ExtensionElementCollection), null, null, null, ConfigurationPropertyOptions.None));
-#endif
}
return _properties;
}
InitializeBehaviorExtensionsDefault ();
InitializeBindingElementExtensionsDefault ();
InitializeBindingExtensionsDefault ();
-#if NET_4_0
InitializeEndpointExtensionsDefault ();
-#endif
}
void InitializeBindingExtensionsDefault () {
BehaviorExtensions.Add (new ExtensionElement ("transactedBatching", typeof (TransactedBatchingElement).AssemblyQualifiedName));
}
-#if NET_4_0
void InitializeEndpointExtensionsDefault () {
EndpointExtensions.Add (new ExtensionElement ("mexEndpoint", typeof (ServiceMetadataEndpointCollectionElement).AssemblyQualifiedName));
}
-#endif
}
}
using System.Net;
using System.Net.Security;
using System.Reflection;
-#if NET_4_0
using System.Security.Authentication.ExtendedProtection;
using System.Security.Authentication.ExtendedProtection.Configuration;
-#endif
using System.Security.Cryptography.X509Certificates;
using System.Security.Principal;
using System.IdentityModel.Claims;
_properties.Add (new ConfigurationProperty ("transferMode", typeof (TransferMode), "Buffered", null, null, ConfigurationPropertyOptions.None));
_properties.Add (new ConfigurationProperty ("unsafeConnectionNtlmAuthentication", typeof (bool), "false", new BooleanConverter (), null, ConfigurationPropertyOptions.None));
_properties.Add (new ConfigurationProperty ("useDefaultWebProxy", typeof (bool), "true", new BooleanConverter (), null, ConfigurationPropertyOptions.None));
-#if NET_4_0
_properties.Add (new ConfigurationProperty ("decompressionEnabled", typeof (bool), false, new BooleanConverter (), null, ConfigurationPropertyOptions.None));
_properties.Add (new ConfigurationProperty ("extendedProtectionPolicy", typeof (ExtendedProtectionPolicyElement), null, new ExtendedProtectionPolicyTypeConverter (), null, ConfigurationPropertyOptions.None));
-#endif
}
return _properties;
}
}
-#if NET_4_0
[ConfigurationProperty ("decompressionEnabled",
Options = ConfigurationPropertyOptions.None)]
public bool DecompressionEnabled {
get { return (ExtendedProtectionPolicyElement) base ["extendedProtectionPolicy"]; }
set { base ["extendedProtectionPolicy"] = value; }
}
-#endif
[ConfigurationProperty ("proxyAddress",
Options = ConfigurationPropertyOptions.None,
b.TransferMode = TransferMode;
b.UnsafeConnectionNtlmAuthentication = UnsafeConnectionNtlmAuthentication;
b.UseDefaultWebProxy = UseDefaultWebProxy;
-#if NET_4_0
b.DecompressionEnabled = DecompressionEnabled;
// FIXME: enable this.
//b.ExtendedProtectionPolicy = ExtendedProtectionPolicy.BuildPolicy ();
-#endif
}
public override void CopyFrom (ServiceModelExtensionElement from)
TransferMode = e.TransferMode;
UnsafeConnectionNtlmAuthentication = e.UnsafeConnectionNtlmAuthentication;
UseDefaultWebProxy = e.UseDefaultWebProxy;
-#if NET_4_0
DecompressionEnabled = e.DecompressionEnabled;
// FIXME: enable this.
/*
foreach (var sne in ExtendedProtectionPolicy.CustomServiceNames)
ExtendedProtectionPolicy.CustomServiceNames.Add (sne);
*/
-#endif
}
protected override TransportBindingElement CreateDefaultBindingElement ()
TransferMode = b.TransferMode;
UnsafeConnectionNtlmAuthentication = b.UnsafeConnectionNtlmAuthentication;
UseDefaultWebProxy = b.UseDefaultWebProxy;
-#if NET_4_0
DecompressionEnabled = b.DecompressionEnabled;
// FIXME: enable this.
/*
foreach (var sn in b.ExtendedProtectionPolicy.CustomServiceNames)
ExtendedProtectionPolicy.CustomServiceNames.Add (new ServiceNameElement () { Name = sn.ToString () });
*/
-#endif
}
}
}
using System.Net;
using System.Net.Security;
using System.Reflection;
-#if NET_4_0
using System.Security.Authentication.ExtendedProtection;
using System.Security.Authentication.ExtendedProtection.Configuration;
-#endif
using System.Security.Cryptography.X509Certificates;
using System.Security.Principal;
using System.IdentityModel.Claims;
typeof (string), "", new StringConverter (), null,
ConfigurationPropertyOptions.None);
-#if NET_4_0
extended_protection_policy = new ConfigurationProperty ("extendedProtectionPolicy",
typeof (ExtendedProtectionPolicyElement), null, new ExtendedProtectionPolicyTypeConverter (), null,
ConfigurationPropertyOptions.None);
-#endif
properties.Add (client_credential_type);
properties.Add (proxy_credential_type);
properties.Add (realm);
-#if NET_4_0
properties.Add (extended_protection_policy);
-#endif
}
public HttpTransportSecurityElement ()
set { base [client_credential_type] = value; }
}
-#if NET_4_0
[ConfigurationProperty ("extendedProtectionPolicy",
Options = ConfigurationPropertyOptions.None)]
public ExtendedProtectionPolicyElement extendedProtectionPolicy {
get { return (ExtendedProtectionPolicyElement) base [extended_protection_policy]; }
set { base [extended_protection_policy] = value; }
}
-#endif
protected override ConfigurationPropertyCollection Properties {
get { return properties; }
security.ClientCredentialType = ClientCredentialType;
security.ProxyCredentialType = ProxyCredentialType;
security.Realm = Realm;
-#if NET_4_0
// FIXME: enable this
// security.ExtendedProtectionPolicy = ExtendedProtectionPolicy.BuildPolicy ();
-#endif
}
}
set { base [log_entire_message] = value; }
}
-#if NET_4_0
[ConfigurationProperty ("logKnownPii",
Options = ConfigurationPropertyOptions.None,
DefaultValue = false)]
get { return (bool) base [log_known_pii]; }
set { base [log_known_pii] = value; }
}
-#endif
[ConfigurationProperty ("logMalformedMessages",
Options = ConfigurationPropertyOptions.None,
: ServiceModelExtensionCollectionElement<TServiceModelExtensionElement>, ICollection<TServiceModelExtensionElement>, IEnumerable<TServiceModelExtensionElement>, IEnumerable
where TServiceModelExtensionElement : ServiceModelExtensionElement
{
-#if NET_4_0
const int minNameLength = 0;
-#else
- const int minNameLength = 1;
-#endif
ConfigurationPropertyCollection _properties;
internal NamedServiceModelExtensionCollectionElement ()
// Properties
-#if NET_4_0
[StringValidator ( MinLength = 0, MaxLength = int.MaxValue, InvalidCharacters = null)]
-#else
- [StringValidator ( MinLength = 1, MaxLength = int.MaxValue, InvalidCharacters = null)]
-#endif
[ConfigurationProperty ("name",
Options = ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey,
IsRequired = true,
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.Collections;
using System.Collections.Generic;
}
}
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.Collections;
using System.Collections.Generic;
}
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.Collections;
}
}
-#endif
XmlReader reader, bool serializeCollectionKey) {
base.DeserializeElement (reader, serializeCollectionKey);
}
-#if NET_4_0
protected override void BaseAdd (ConfigurationElement element)
{
var sbe = element as ServiceBehaviorElement;
base.BaseAdd (sbe);
}
-#endif
}
}
static ConfigurationProperty listen_uri;
static ConfigurationProperty listen_uri_mode;
static ConfigurationProperty name;
-#if NET_4_0
static ConfigurationProperty endpoint_configuration;
static ConfigurationProperty is_system_endpoint;
static ConfigurationProperty kind;
-#endif
static ServiceEndpointElement ()
{
typeof (string), "", new StringConverter (), new StringValidator (0, int.MaxValue, null),
ConfigurationPropertyOptions.None);
-#if NET_4_0
endpoint_configuration = new ConfigurationProperty ("endpointConfiguration", typeof (string), "", null, new StringValidator (0), ConfigurationPropertyOptions.IsKey);
is_system_endpoint = new ConfigurationProperty ("isSystemEndpoint", typeof (bool), false, null, null, ConfigurationPropertyOptions.None);
kind = new ConfigurationProperty ("kind", typeof (string), "", null, new StringValidator (0), ConfigurationPropertyOptions.IsKey);
-#endif
properties.Add (address);
properties.Add (behavior_configuration);
properties.Add (listen_uri_mode);
properties.Add (name);
-#if NET_4_0
properties.Add (endpoint_configuration);
properties.Add (is_system_endpoint);
properties.Add (kind);
-#endif
}
public ServiceEndpointElement ()
get { return (IdentityElement) base [identity]; }
}
-#if NET_4_0
[StringValidator (MinLength = 0)]
[ConfigurationProperty ("endpointConfiguration", DefaultValue = "", Options = ConfigurationPropertyOptions.IsKey)]
public string EndpointConfiguration {
get { return (string) base [kind]; }
set { base [kind] = value; }
}
-#endif
[ConfigurationProperty ("listenUri",
Options = ConfigurationPropertyOptions.None,
GetHashCode (el.BindingConfiguration) +
GetHashCode (el.BindingName) +
GetHashCode (el.BindingNamespace) +
-#if NET_4_0
GetHashCode (el.EndpointConfiguration) +
GetHashCode (el.Kind) +
-#endif
GetHashCode (el.Contract);
}
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.ComponentModel;
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.Collections;
}
}
-#endif
get { return (ServicesSection) Sections ["services"]; }
}
-#if NET_4_0
public ProtocolMappingSection ProtocolMapping {
get { return (ProtocolMappingSection) Sections ["protocolMapping"]; }
}
public StandardEndpointsSection StandardEndpoints {
get { return (StandardEndpointsSection) Sections ["standardEndpoints"]; }
}
-#endif
}
}
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.Collections;
using System.Collections.Generic;
}
}
}
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.Collections;
using System.Collections.Generic;
}
}
}
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.Collections;
using System.Collections.Generic;
}
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.Collections;
}
}
-#if NET_4_0
internal ConfigurationPropertyCollection PropertiesInternal {
get {
return Properties;
}
}
-#endif
public static StandardEndpointsSection GetSection (System.Configuration.Configuration config) {
ServiceModelSectionGroup sm = ServiceModelSectionGroup.GetSectionGroup (config);
}
-#endif
get { return format; }
}
-#if NET_4_0
public DataContractResolver DataContractResolver { get; set; }
-#endif
public bool IgnoreExtensionDataObject { get; set; }
public ContractDescription Contract {
get { return contract; }
-#if NET_4_0
set {
if (value == null)
throw new ArgumentNullException ("value");
contract = value;
}
-#endif
}
public EndpointAddress Address {
set { binding = value; }
}
-#if NET_4_0
public
-#else
- internal
-#endif
bool IsSystemEndpoint { get; set; }
public Uri ListenUri {
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
}
}
-#endif
#if !NET_2_1
var e = ConfigUtil.DiagnosticSection.MessageLogging;
LogEntireMessage = e.LogEntireMessage;
-#if NET_4_0
LogKnownPii = e.LogKnownPii;
-#endif
LogMalformedMessages = e.LogMalformedMessages;
LogMessagesAtServiceLevel = e.LogMessagesAtServiceLevel;
LogMessagesAtTransportLevel = e.LogMessagesAtTransportLevel;
set { filter_priority = value; }
}
-#if NET_4_0
public bool IsSystemEndpoint { get; private set; }
-#endif
internal void InitializeServiceEndpoint (bool isCallback, Type serviceType, ServiceEndpoint se)
{
-#if NET_4_0
IsSystemEndpoint = se.IsSystemEndpoint;
-#endif
this.ContractFilter = GetContractFilter (se.Contract, isCallback);
h.ProxyAddress = ProxyAddress;
h.UseDefaultWebProxy = UseDefaultWebProxy;
h.TransferMode = TransferMode;
-#if NET_4_0
h.ExtendedProtectionPolicy = Security.Transport.ExtendedProtectionPolicy;
-#endif
#if !NET_2_1 || MOBILE
switch (Security.Transport.ClientCredentialType) {
h.ProxyAddress = ProxyAddress;
h.UseDefaultWebProxy = UseDefaultWebProxy;
h.TransferMode = TransferMode;
-#if NET_4_0
h.ExtendedProtectionPolicy = Security.Transport.ExtendedProtectionPolicy;
-#endif
switch (Security.Transport.ClientCredentialType) {
case HttpClientCredentialType.Basic:
{
public sealed class BasicHttpSecurity
{
-#if NET_4_0
public BasicHttpSecurity ()
{
this.mode = BasicHttpSecurityMode.None;
this.message = new BasicHttpMessageSecurity ();
this.transport = new HttpTransportSecurity ();
}
-#endif
internal BasicHttpSecurity (BasicHttpSecurityMode mode)
{
public BasicHttpMessageSecurity Message {
get { return message; }
-#if NET_4_0
set { message = value; }
-#endif
}
public BasicHttpSecurityMode Mode {
public HttpTransportSecurity Transport {
get { return transport; }
-#if NET_4_0
set { transport = value; }
-#endif
}
}
}
h.UseDefaultWebProxy = UseDefaultWebProxy;
h.TransferMode = TransferMode;
-#if NET_4_0
h.ExtendedProtectionPolicy = Security.Transport.ExtendedProtectionPolicy;
-#endif
switch (Security.Transport.ClientCredentialType) {
case HttpClientCredentialType.Basic:
if (endpoint == null)
throw new InvalidOperationException (String.Format ("Client endpoint configuration '{0}' was not found in {1} endpoints.", endpointConfig, client.Endpoints.Count));
-#if NET_4_0
var binding = String.IsNullOrEmpty (endpoint.Binding) ? null : ConfigUtil.CreateBinding (endpoint.Binding, endpoint.BindingConfiguration);
var contractType = ConfigUtil.GetTypeFromConfigString (endpoint.Contract, NamedConfigCategory.Contract);
if (contractType == null)
if (binding == null && endpoint.Address != null) // look for protocol mapping
Endpoint.Binding = ConfigUtil.GetBindingByProtocolMapping (endpoint.Address);
}
-#endif
if (Endpoint.Binding == null)
Endpoint.Binding = ConfigUtil.CreateBinding (endpoint.Binding, endpoint.BindingConfiguration);
if (Endpoint.Address == null)
Initialize (instance, binding, remoteAddress);
}
-#if NET_4_0
protected ClientBase (ServiceEndpoint endpoint)
: this (null, endpoint)
{
: this (instance, new ChannelFactory<TChannel> (endpoint))
{
}
-#endif
internal ClientBase (ChannelFactory<TChannel> factory)
: this (null, factory)
public object [] Results { get; private set; }
}
-#if NET_4_0
protected internal
-#else
- internal
-#endif
class ChannelBase<T> : IClientChannel, IOutputChannel, IRequestChannel where T : class
{
ServiceEndpoint endpoint;
{
}
-#if NET_4_0
protected DuplexClientBase (object instance, ServiceEndpoint endpoint)
: this (new InstanceContext (instance), endpoint)
{
: base (instance, endpoint)
{
}
-#endif
public IDuplexContextChannel InnerDuplexChannel {
get { return (IDuplexContextChannel) base.InnerChannel; }
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
-#if NET_4_0
using System.Security.Authentication.ExtendedProtection;
-#endif
using System.ServiceModel.Security;
namespace System.ServiceModel
HttpProxyCredentialType proxy;
string realm = String.Empty;
-#if NET_4_0
public
-#else
- internal
-#endif
HttpTransportSecurity ()
{
}
set { realm = value; }
}
-#if NET_4_0
[MonoTODO]
public ExtendedProtectionPolicy ExtendedProtectionPolicy { get; set; }
-#endif
}
}
{
}
-#if NET_4_0
[MonoTODO]
public SynchronizationContext SynchronizationContext {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
-#endif
}
}
using System.ServiceModel.Description;
using System.ServiceModel.Security;
using System.ServiceModel.Security.Tokens;
-#if NET_4_0
using System.ServiceModel.Configuration;
-#endif
using System.Text;
using System.Xml;
transport = new TcpTransportBindingElement ();
}
-#if NET_4_0
public NetTcpBinding (string configurationName)
: this ()
{
var el = bindingsSection.NetTcpBinding.Bindings [configurationName];
el.ApplyConfiguration (this);
}
-#endif
internal NetTcpBinding (TcpTransportBindingElement transport,
NetTcpSecurity security,
public NetTcpSecurity Security {
get { return security; }
-#if NET_4_0
set { security = value; }
-#endif
}
public EnvelopeVersion EnvelopeVersion {
{
public sealed class NetTcpSecurity
{
-#if NET_4_0
public NetTcpSecurity ()
: this (SecurityMode.Transport)
{
}
-#endif
internal NetTcpSecurity (SecurityMode mode)
{
public MessageSecurityOverTcp Message {
get { return message; }
-#if NET_4_0
set { message = value; }
-#endif
}
public SecurityMode Mode {
public TcpTransportSecurity Transport {
get { return transport; }
-#if NET_4_0
set { transport = value; }
-#endif
}
}
}
return AddServiceEndpointCore (cd, binding, ea, listenUri);
}
-#if NET_4_0
public virtual void AddServiceEndpoint (ServiceEndpoint endpoint)
{
if (endpoint == null)
Description.Endpoints.Add (endpoint);
}
-#endif
Type PopulateType (string typeName)
{
if (service != null)
LoadConfigurationSection (service);
-#if NET_4_0
// simplified configuration
AddServiceBehaviors (String.Empty, false);
-#endif
// TODO: consider commonBehaviors here
// ensure ServiceAuthorizationBehavior
void AddServiceBehaviors (string configurationName, bool throwIfNotFound)
{
-#if NET_4_0
if (configurationName == null)
return;
-#else
- if (String.IsNullOrEmpty (configurationName))
- return;
-#endif
ServiceBehaviorElement behavior = ConfigUtil.BehaviorsSection.ServiceBehaviors [configurationName];
if (behavior == null) {
if (throwIfNotFound)
foreach (ServiceEndpointElement endpoint in service.Endpoints) {
ServiceEndpoint se;
-#if NET_4_0
var binding = String.IsNullOrEmpty (endpoint.Binding) ? null : ConfigUtil.CreateBinding (endpoint.Binding, endpoint.BindingConfiguration);
if (!String.IsNullOrEmpty (endpoint.Kind)) {
binding = ConfigUtil.GetBindingByProtocolMapping (endpoint.Address);
se = AddServiceEndpoint (endpoint.Contract, binding, endpoint.Address);
}
-#else
- var binding = ConfigUtil.CreateBinding (endpoint.Binding, endpoint.BindingConfiguration);
- se = AddServiceEndpoint (endpoint.Contract, binding, endpoint.Address);
-#endif
// endpoint behaviors
EndpointBehaviorElement epbehavior = ConfigUtil.BehaviorsSection.EndpointBehaviors [endpoint.BehaviorConfiguration];
foreach (ServiceEndpoint endPoint in Description.Endpoints)
endPoint.Validate ();
-#if NET_4_0
// In 4.0, it seems that if there is no configured ServiceEndpoint, infer them from the service type.
if (Description.Endpoints.Count == 0) {
foreach (Type iface in Description.ServiceType.GetInterfaces ())
AddServiceEndpoint (iface.FullName, binding, baddr);
}
}
-#endif
if (Description.Endpoints.FirstOrDefault (e => e.Contract != mex_contract && !e.IsSystemEndpoint) == null)
throw new InvalidOperationException ("The ServiceHost must have at least one application endpoint (that does not include metadata exchange endpoint) defined by either configuration, behaviors or call to AddServiceEndpoint methods.");
namespace System.ServiceModel {
-#if NET_4_0
[System.Runtime.CompilerServices.TypeForwardedFrom (Consts.AssemblySystemServiceModel_3_0)]
-#endif
public static class ServiceHostingEnvironment
{
internal static bool InAspNet { get; set; }
{
}
-#if NET_4_0
[MonoTODO]
public static TimeSpan SpnLookupTime {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
-#endif
}
}
[MonoTODO]
public sealed class TcpTransportSecurity
{
-#if NET_4_0
public
-#else
- internal
-#endif
TcpTransportSecurity ()
{
ClientCredentialType = TcpClientCredentialType.Windows; // huh
private string[] services_depended_on;
private ServiceStartMode start_type;
private string description;
-#if NET_4_0
private bool delayedAutoStart;
-#endif
-#if NET_4_0
[DefaultValue(false)]
[ServiceProcessDescription("Indicates that the service's start should be delayed after other automatically started services have started.")]
public bool DelayedAutoStart {
delayedAutoStart = value;
}
}
-#endif
[ComVisible (false)]
[DefaultValue ("")]
[assembly: AssemblyKeyFile ("../winfx.pub")]
[assembly: ComVisible (false)]
-#if !NET_4_0
-[assembly: ComCompatibleVersion (1, 0, 3300, 0)]
-#endif
[assembly: AllowPartiallyTrustedCallers]
// FIXME: We get collisions with this internalsVisibleTo because of Consts.cs and MonoTodo
//[assembly: InternalsVisibleTo ("System.ServiceModel.Web, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
-#if NET_4_0
[assembly: SecurityRules (SecurityRuleSet.Level2, SkipVerificationInFullTrust = true)]
[assembly: TypeForwardedTo (typeof (System.Web.HttpStaticObjectsCollectionBase))]
[assembly: TypeForwardedTo (typeof (System.Web.HttpStaticObjectsCollectionWrapper))]
[assembly: TypeForwardedTo (typeof (System.Web.HttpRequestWrapper))]
[assembly: TypeForwardedTo (typeof (System.Web.HttpResponseWrapper))]
[assembly: TypeForwardedTo (typeof (System.Web.HttpResponseBase))]
-#endif
namespace System.Web
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#endif
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public abstract class HttpApplicationStateBase : NameObjectCollectionBase, ICollection, IEnumerable
namespace System.Web
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#endif
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class HttpApplicationStateWrapper : HttpApplicationStateBase
namespace System.Web
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#endif
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public abstract class HttpBrowserCapabilitiesBase : IFilterResolutionService
namespace System.Web
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#endif
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class HttpBrowserCapabilitiesWrapper : HttpBrowserCapabilitiesBase
namespace System.Web
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#endif
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public abstract class HttpCachePolicyBase
namespace System.Web
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#endif
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class HttpCachePolicyWrapper : HttpCachePolicyBase
namespace System.Web
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#endif
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public abstract class HttpContextBase : IServiceProvider
NotImplemented ();
return null;
}
-#if NET_4_0
public virtual void RemapHandler (IHttpHandler handler)
{
NotImplemented ();
}
-#endif
public virtual void RewritePath (string path)
{
NotImplemented ();
{
NotImplemented ();
}
-#if NET_4_0
public virtual void SetSessionStateBehavior (SessionStateBehavior sessionStateBehavior)
{
NotImplemented ();
}
-#endif
}
}
namespace System.Web
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#endif
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class HttpContextWrapper : HttpContextBase
{
return ((IServiceProvider)w).GetService (serviceType);
}
-#if NET_4_0
public override void RemapHandler (IHttpHandler handler)
{
w.RemapHandler (handler);
}
-#endif
public override void RewritePath (string path)
{
w.RewritePath (path);
{
w.RewritePath (filePath, pathInfo, queryString, setClientFilePath);
}
-#if NET_4_0
public override void SetSessionStateBehavior (SessionStateBehavior sessionStateBehavior)
{
w.SetSessionStateBehavior (sessionStateBehavior);
}
-#endif
}
}
namespace System.Web
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#endif
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public abstract class HttpFileCollectionBase : NameObjectCollectionBase, ICollection, IEnumerable
namespace System.Web
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#endif
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class HttpFileCollectionWrapper : HttpFileCollectionBase
namespace System.Web
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#endif
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public abstract class HttpPostedFileBase
namespace System.Web
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#endif
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class HttpPostedFileWrapper : HttpPostedFileBase
using System.Text;
using System.Web.Caching;
-#if NET_4_0
using System.Security.Authentication.ExtendedProtection;
using System.Web.Routing;
-#endif
namespace System.Web
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#endif
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public abstract class HttpRequestBase
public virtual string HttpMethod { get { NotImplemented (); return null; } }
public virtual Stream InputStream { get { NotImplemented (); return null; } }
-#if NET_4_0
// LAMESPEC: MSDN says NotImplementedException is thrown only when the request is
// not IIS7WorkerRequest or ISAPIWorkerRequestInProc, but it is thrown always.
public virtual ChannelBinding HttpChannelBinding { get { NotImplemented (); return null; } }
-#endif
public virtual bool IsAuthenticated { get { NotImplemented (); return false; } }
public virtual bool IsLocal { get { NotImplemented (); return false; } }
public virtual string RawUrl { get { NotImplemented (); return null; } }
public virtual string RequestType { get { NotImplemented (); return null; } set { NotImplemented (); } }
-#if NET_4_0
public virtual RequestContext RequestContext {
get { NotImplemented (); return null; }
internal set { NotImplemented (); }
}
-#endif
public virtual NameValueCollection ServerVariables { get { NotImplemented (); return null; } }
public virtual int TotalBytes { get { NotImplemented (); return 0; } }
using System.Text;
using System.Web.Caching;
-#if NET_4_0
using System.Security.Authentication.ExtendedProtection;
using System.Web.Routing;
-#endif
namespace System.Web
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#endif
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class HttpRequestWrapper : HttpRequestBase
public override string HttpMethod {
get { return w.HttpMethod; }
}
-#if NET_4_0
public override ChannelBinding HttpChannelBinding {
get { return w.HttpChannelBinding; }
}
-#endif
public override Stream InputStream {
get { return w.InputStream; }
}
get { return w.RequestType; }
set { w.RequestType = value; }
}
-#if NET_4_0
public override RequestContext RequestContext {
get { return w.RequestContext; }
internal set { w.RequestContext = value; }
}
-#endif
public override NameValueCollection ServerVariables {
get { return w.ServerVariables; }
}
using System.Web.Caching;
using System.Threading;
-#if NET_4_0
using System.Web.Routing;
-#endif
namespace System.Web
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#endif
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public abstract class HttpResponseBase
{
NotImplemented ();
}
-#if NET_4_0
public virtual void RedirectPermanent (string url)
{
NotImplemented ();
{
NotImplemented ();
}
-#endif
public virtual void RemoveOutputCacheItem (string path)
{
NotImplemented ();
namespace System.Web
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#endif
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class HttpResponseWrapper : HttpResponseBase
public override TextWriter Output {
get { return w.Output; }
-#if NET_4_0
set { w.Output = value; }
-#endif
}
public override Stream OutputStream {
{
w.Redirect (url, endResponse);
}
-#if NET_4_0
public override void RedirectPermanent (string url)
{
w.RedirectPermanent (url);
{
HttpResponse.RemoveOutputCacheItem (path, providerName);
}
-#endif
public override void RemoveOutputCacheItem (string path)
{
HttpResponse.RemoveOutputCacheItem (path);
namespace System.Web
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#endif
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public abstract class HttpServerUtilityBase
namespace System.Web
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#endif
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class HttpServerUtilityWrapper : HttpServerUtilityBase
namespace System.Web
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#endif
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public abstract class HttpSessionStateBase : ICollection, IEnumerable
namespace System.Web
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#endif
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class HttpSessionStateWrapper : HttpSessionStateBase
namespace System.Web
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#endif
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public abstract class HttpStaticObjectsCollectionBase : ICollection, IEnumerable
namespace System.Web
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#endif
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class HttpStaticObjectsCollectionWrapper : HttpStaticObjectsCollectionBase
[assembly: InternalsVisibleTo ("System.Web, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
[assembly: AllowPartiallyTrustedCallers]
-#if NET_4_0
[assembly: SecurityRules (SecurityRuleSet.Level2, SkipVerificationInFullTrust=true)]
-#endif
return (T) ConvertToType (obj, typeof (T));
}
-#if NET_4_0
public
-#else
- internal
-#endif
object ConvertToType (object obj, Type targetType)
{
if (obj == null)
return base.OnBubbleEvent (source, e);
}
-#if !NET_4_0
- public virtual object DataItem {
- get;
- set;
- }
-
- public virtual int DataItemIndex {
- get;
- private set;
- }
-
- public virtual int DisplayIndex {
- get;
- private set;
- }
-#endif
}
}
#endif
{
[ToolboxItemAttribute (false)]
public class ListViewItem : Control, INamingContainer
-#if NET_4_0
, IDataItemContainer
-#endif
{
internal ListViewItem ()
: this (ListViewItemType.DataItem)
private set;
}
-#if NET_4_0
public virtual object DataItem {
get;
set;
get;
protected set;
}
-#endif
}
}
#endif
entriesCache.InsertOrUpdate ((uint)ret.GetHashCode (), ret, entries, entries);
return ret;
}
-#if NET_4_0
protected internal override bool IsAjaxFrameworkScript (ScriptManager scriptManager)
{
return false;
}
[Obsolete ("Use IsAjaxFrameworkScript(ScriptManager)")]
-#endif
protected internal override bool IsFromSystemWebExtensions ()
{
if (scripts == null || scripts.Count == 0)
return url;
}
-#if NET_4_0
protected internal override bool IsAjaxFrameworkScript (ScriptManager scriptManager)
{
return false;
}
[Obsolete ("Use IsAjaxFrameworkScript(ScriptManager)")]
-#endif
protected internal override bool IsFromSystemWebExtensions ()
{
return ResolvedAssembly == ThisAssembly;
this.NotifyScriptLoaded = true;
this.ScriptMode = ScriptMode.Auto;
}
-#if NET_4_0
protected internal virtual bool IsAjaxFrameworkScript (ScriptManager scriptManager)
{
return false;
}
[Obsolete ("Use IsAjaxFrameworkScript(ScriptManager)")]
-#endif
protected internal abstract bool IsFromSystemWebExtensions ();
protected internal abstract string GetUrl (ScriptManager scriptManager, bool zip);
[assembly: AssemblyKeyFile ("../winfx.pub")]
[assembly: ComVisible (false)]
-#if !NET_4_0
-[assembly: ComCompatibleVersion (1, 0, 3300, 0)]
-#endif
[assembly: AllowPartiallyTrustedCallers]
// FIXME: We get collisions with this internalsVisibleTo because of Consts.cs and MonoTodo
//[assembly: InternalsVisibleTo ("System.ServiceModel.Web, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
-#if NET_4_0
[assembly: SecurityRules (SecurityRuleSet.Level2, SkipVerificationInFullTrust = true)]
[assembly: SecurityTransparent]
[assembly: TypeForwardedToAttribute (typeof (System.Web.Routing.RouteBase))]
[assembly: TypeForwardedToAttribute (typeof (System.Web.Routing.RouteDirection))]
[assembly: TypeForwardedToAttribute (typeof (System.Web.Routing.StopRoutingHandler))]
[assembly: TypeForwardedToAttribute (typeof (System.Web.Routing.RouteValueDictionary))]
-#endif
namespace System.Web.Routing
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#endif
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class HttpMethodConstraint : IRouteConstraint
namespace System.Web.Routing
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#else
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-#endif
public interface IRouteConstraint
{
bool Match (HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection);
namespace System.Web.Routing
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#else
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-#endif
public interface IRouteHandler
{
IHttpHandler GetHttpHandler (RequestContext requestContext);
namespace System.Web.Routing
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#endif
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class RequestContext
{
-#if NET_4_0
public RequestContext ()
{
HttpContext = null;
RouteData = null;
}
-#endif
public RequestContext (HttpContextBase httpContext, RouteData routeData)
{
if (httpContext == null)
RouteData = routeData;
}
-#if NET_4_0
public virtual HttpContextBase HttpContext { get; set; }
public virtual RouteData RouteData { get; set; }
-#else
- public HttpContextBase HttpContext { get; private set; }
- public RouteData RouteData { get; private set; }
-#endif
}
}
namespace System.Web.Routing
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#endif
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class Route : RouteBase
{
-#if NET_4_0
static readonly Type httpRequestBaseType = typeof (HttpRequestBase);
-#endif
PatternParser url;
public RouteValueDictionary Constraints { get; set; }
if (!String.IsNullOrEmpty (v))
return MatchConstraintRegex (v, s);
-#if NET_4_0
else if (reqContext != null) {
RouteData rd = reqContext != null ? reqContext.RouteData : null;
RouteValueDictionary rdValues = rd != null ? rd.Values : null;
return MatchConstraintRegex (v, s);
}
-#endif
return false;
}
throw new NullReferenceException ();
RequestContext reqContext;
-#if NET_4_0
reqContext = SafeGetContext (httpContext != null ? httpContext.Request : null);
-#else
- reqContext = null;
-#endif
bool invalidConstraint;
bool ret = ProcessConstraintInternal (httpContext, this, constraint, parameterName, values, routeDirection, reqContext, out invalidConstraint);
return true;
}
-#if NET_4_0
RequestContext SafeGetContext (HttpRequestBase req)
{
if (req == null || req.GetType () != httpRequestBaseType)
return req.RequestContext;
}
-#endif
}
}
namespace System.Web.Routing
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#endif
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public abstract class RouteBase
namespace System.Web.Routing
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#endif
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class RouteCollection : Collection<RouteBase>
if (httpContext.Request == null)
throw new ArgumentException ("The context does not contain any request data.", "httpContext");
-#if NET_4_0
if (Count == 0)
return null;
-#endif
if (!RouteExistingFiles) {
var path = httpContext.Request.AppRelativeCurrentExecutionFilePath;
VirtualPathProvider vpp = HostingEnvironment.VirtualPathProvider;
if (path != "~/" && vpp != null && (vpp.FileExists (path) || vpp.DirectoryExists (path)))
return null;
}
-#if !NET_4_0
- if (Count == 0)
- return null;
-#endif
foreach (RouteBase rb in this) {
var rd = rb.GetRouteData (httpContext);
if (rd != null)
{
if (requestContext == null)
throw new ArgumentNullException ("httpContext");
-#if !NET_4_0
- if (Count == 0)
- return null;
-#endif
VirtualPathData vp = null;
if (!String.IsNullOrEmpty (name)) {
RouteBase rb = this [name];
if (rb != null)
vp = rb.GetVirtualPath (requestContext, values);
-#if NET_4_0
else
throw new ArgumentException ("A route named '" + name + "' could not be found in the route collection.", "name");
-#endif
} else {
foreach (RouteBase rb in this) {
vp = rb.GetVirtualPath (requestContext, values);
{
return write_lock;
}
-#if NET_4_0
public void Ignore (string url)
{
Ignore (url, null);
return route;
}
-#endif
protected override void InsertItem (int index, RouteBase item)
{
// FIXME: what happens wrt its name?
namespace System.Web.Routing
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#endif
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class RouteData
namespace System.Web.Routing
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#endif
public enum RouteDirection
{
IncomingRequest,
namespace System.Web.Routing
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#endif
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class RouteTable
namespace System.Web.Routing
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#endif
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class RouteValueDictionary : IDictionary<string, object>
namespace System.Web.Routing
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#endif
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class StopRoutingHandler : IRouteHandler
namespace System.Web.Routing
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#endif
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public abstract class UrlRoutingHandler : IHttpHandler
namespace System.Web.Routing
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#endif
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class UrlRoutingModule : IHttpModule
{
RouteCollection routes;
-#if !NET_4_0
- object module_identity_key = new object ();
- object original_path_key = new object ();
-#endif
public RouteCollection RouteCollection {
get {
if (routes == null)
var app = (HttpApplication) o;
PostResolveRequestCache (new HttpContextWrapper (app.Context));
}
-#if NET_4_0
[Obsolete]
-#endif
public virtual void PostMapRequestHandler (HttpContextBase context)
{
-#if !NET_4_0
- if (context == null)
- throw new ArgumentNullException ("context");
-
- // FIXME: find out what it actually does.
- IHttpHandler h = (IHttpHandler) context.Items [module_identity_key];
- if (h != null)
- context.Handler = h;
-
- string original_path = context.Items [original_path_key] as string;
- if (!String.IsNullOrEmpty (original_path))
- context.RewritePath (original_path);
-#endif
}
[MonoTODO]
IHttpHandler http = rd.RouteHandler.GetHttpHandler (rc);
if (http == null)
throw new InvalidOperationException ("The mapped IRouteHandler did not return an IHttpHandler");
-#if NET_4_0
context.Request.RequestContext = rc;
context.RemapHandler (http);
-#else
- // note: It does not resolve paths using GetVirtualPath():
- //var vpd = RouteCollection.GetVirtualPath (rc, rd.Values);
- //context.RewritePath (vpd.VirtualPath);
-
- context.Items [original_path_key] = context.Request.Path;
-
- // default handler (forbidden in MVC/DynamicData projects)
- context.RewritePath ("~/UrlRouting.axd");
-
- context.Items [module_identity_key] = http;
-#endif
}
}
}
namespace System.Web.Routing
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web.Routing, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
-#endif
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class VirtualPathData
[assembly: AssemblyTitle("System.Web.dll")]
[assembly: AssemblyDescription("System.Web.dll")]
-#if !NET_4_0
-[assembly: AssemblyConfiguration("Development version")]
-#endif
[assembly: AssemblyCompany (Consts.MonoCompany)]
[assembly: AssemblyProduct (Consts.MonoProduct)]
[assembly: AssemblyCopyright (Consts.MonoCopyright)]
-#if !NET_4_0
-[assembly: AssemblyTrademark("")]
-#endif
[assembly: CLSCompliant(true)]
[assembly: ComVisible(false)]
[assembly: AssemblyDefaultAlias("System.Web.dll")]
[assembly: AssemblyDelaySign(true)]
[assembly: AssemblyKeyFile("../msfinal.pub")]
-#if NET_4_0
[assembly: AssemblyFileVersion (Consts.FxVersion)]
[assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)]
[assembly: Dependency ("System", LoadHint.Always)]
[assembly: TypeForwardedTo (typeof (System.Web.Security.MembershipProvider))]
[assembly: InternalsVisibleTo ("Microsoft.Web.Infrastructure, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
-#endif
[assembly: InternalsVisibleTo ("System.Web.Extensions, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
[assembly: WebResource ("computer.gif", "image/gif")]
[assembly: WebResource ("TreeView.js", "text/javascript")]
[assembly: WebResource ("Menu.js", "text/javascript")]
-#if NET_4_0
[assembly: WebResource ("MenuModern.js", "text/javascript")]
-#endif
[assembly: WebResource ("GridView.js", "text/javascript")]
[assembly: WebResource ("webform.js", "text/javascript")]
[assembly: WebResource ("WebUIValidation_2.0.js", "text/javascript")]
remove { events.RemoveHandler (dependencyChangedEvent, value); }
}
-#if NET_4_0
protected
-#else
- public
-#endif
CacheDependency (): this (null, null, null, DateTime.Now)
{
}
namespace System.Web.Caching
{
-#if NET_4_0
[Serializable]
-#endif
sealed class CachedVaryBy
{
string[] prms;
Dictionary <string, string> keysCache;
Dictionary <string, string> entriesToInvalidate;
-#if !NET_4_0
- OutputCacheProvider provider;
-
- internal OutputCacheProvider InternalProvider {
- get { return provider; }
- }
-#endif
public OutputCacheModule ()
{
}
OutputCacheProvider FindCacheProvider (HttpApplication app)
{
-#if NET_4_0
HttpContext ctx = HttpContext.Current;
if (app == null) {
app = ctx != null ? ctx.ApplicationInstance : null;
throw new ProviderException (String.Format ("OutputCacheProvider named '{0}' cannot be found.", providerName));
return ret;
-#else
- if (provider == null)
- provider = new InMemoryOutputCacheProvider ();
-
- return provider;
-#endif
}
public void Dispose ()
namespace System.Web.Caching
{
-#if NET_4_0
public
-#endif
abstract class OutputCacheProvider : ProviderBase
{
protected OutputCacheProvider ()
throw new ArgumentNullException ("tableName");
}
-#if NET_4_0
[MonoTODO ("Needs more testing - especially the return value and database+table lookup.")]
public static CacheDependency CreateOutputCacheDependency (string dependency)
{
For dependencies that use SQL Server 9.0 notifications, specify the value 'CommandNotification'.", dependency);
}
-#endif
protected override void DependencyDispose ()
{
#if NET_4_5
static string framework_version = "4.5";
static string profile_path = "net_4_5";
-#elif NET_4_0
+#else
static string framework_version = "4.0";
static string profile_path = "net_4_0";
-#else
- static string framework_version = "2.0";
- static string profile_path = "net_2_0";
#endif
CompilationSection config;
CompilerInfo ci;
info.FileName = monoPath;
return alPath + " ";
} else {
-#if NET_4_0
info.FileName = "al";
-#else
- info.FileName = "al2";
-#endif
return String.Empty;
}
}
case TagType.DataBinding:
case TagType.CodeRenderExpression:
case TagType.CodeRender:
-#if NET_4_0
case TagType.CodeRenderEncode:
-#endif
if (isApplication)
throw new ParseException (location, "Invalid content for application file.");
return CodeConstructType.ExpressionSnippet;
case TagType.CodeRender:
-#if NET_4_0
case TagType.CodeRenderEncode:
-#endif
return CodeConstructType.CodeSnippet;
case TagType.DataBinding:
b = new CodeRenderBuilder (code, true, location);
else if (tagtype == TagType.DataBinding)
b = new DataBindingBuilder (code, location);
-#if NET_4_0
else if (tagtype == TagType.CodeRenderEncode)
b = new CodeRenderBuilder (code, true, location, true);
-#endif
else
throw new HttpException ("Should never happen");
case TagType.CodeRenderExpression:
builder.AppendSubBuilder (new CodeRenderBuilder (tagid, true, location));
break;
-#if NET_4_0
case TagType.CodeRenderEncode:
builder.AppendSubBuilder (new CodeRenderBuilder (tagid, true, location, true));
break;
-#endif
case TagType.DataBinding:
builder.AppendSubBuilder (new DataBindingBuilder (tagid, location));
break;
tokenizer.ExpectAttrValue = old;
bool varname;
bool databinding;
-#if NET_4_0
bool codeRenderEncode;
-#endif
varname = Eat ('=');
databinding = !varname && Eat ('#');
-#if NET_4_0
codeRenderEncode = !databinding && !varname && Eat (':');
-#endif
string odds = tokenizer.Odds;
tokenizer.Verbatim = true;
tagtype = TagType.DataBinding;
else if (varname)
tagtype = TagType.CodeRenderExpression;
-#if NET_4_0
else if (codeRenderEncode)
tagtype = TagType.CodeRenderEncode;
-#endif
else
tagtype = TagType.CodeRender;
}
using System.Web.Configuration;
using System.Web.Hosting;
using System.Web.Util;
-#if NET_4_0
using System.Runtime.Versioning;
-#endif
namespace System.Web.Compilation
{
static int buildCount;
static bool is_precompiled;
static bool allowReferencedAssembliesCaching;
-#if NET_4_0
static List <Assembly> dynamicallyRegisteredAssemblies;
static bool? batchCompilationEnabled;
static FrameworkName targetFramework;
static bool preStartMethodsDone;
static bool preStartMethodsRunning;
-#endif
//static bool updatable; unused
static Dictionary<string, PreCompilationData> precompiled;
remove { events.RemoveHandler (buildManagerRemoveEntryEvent, value); }
}
-#if NET_4_0
internal static bool CompilingTopLevelAssemblies {
get; set;
}
return targetFramework;
}
}
-#endif
internal static bool BatchMode {
get {
-#if NET_4_0
if (batchCompilationEnabled != null)
return (bool)batchCompilationEnabled;
-#endif
if (!hosted)
return false; // Fix for bug #380985
if (is_precompiled)
is_precompiled = LoadPrecompilationInfo (precomp_name);
}
-#if NET_4_0
internal static void AssertPreStartMethodsRunning ()
{
if (!BuildManager.PreStartMethodsRunning)
throw new InvalidOperationException ("This method must be called during the application's pre-start initialization stage.");
}
-#endif
// Deal with precompiled sites deployed in a different virtual path
static void FixVirtualPaths ()
{
codeDomProviders.Add (type, ret);
return ret;
}
-#if NET_4_0
internal static void CallPreStartMethods ()
{
if (preStartMethodsDone)
return new SimpleWebObjectFactory (type);
}
-#endif
public static object CreateInstanceFromVirtualPath (string virtualPath, Type requiredBaseType)
{
return CreateInstanceFromVirtualPath (GetAbsoluteVirtualPath (virtualPath), requiredBaseType);
{
return null; // null is ok here until we store the dependency set in the Cache.
}
-#if NET_4_0
[MonoTODO ("Not implemented, always returns null")]
public static BuildDependencySet GetCachedBuildDependencySet (HttpContext context, string virtualPath, bool ensureIsUpToDate)
{
return null; // null is ok here until we store the dependency set in the Cache.
}
-#endif
static BuildManagerCacheItem GetCachedItem (string vp)
{
try {
foreach (string assLocation in WebConfigurationManager.ExtraAssemblies)
LoadAssembly (assLocation, configReferencedAssemblies);
-#if NET_4_0
if (dynamicallyRegisteredAssemblies != null)
foreach (Assembly registeredAssembly in dynamicallyRegisteredAssemblies)
configReferencedAssemblies.Add (registeredAssembly);
-#endif
// Precompiled sites unconditionally load all assemblies from bin/ (fix for
// bug #502016)
if (is_precompiled || addAssembliesInBin) {
{
public abstract class BuildProvider
{
-#if NET_4_0
static Dictionary <string, Type> registeredBuildProviderTypes;
-#endif
ArrayList ref_assemblies;
ICollection vpath_deps;
// MS also throws a NullReferenceException here when not hosted.
return VirtualPathProvider.OpenFile (virtualPath);
}
-#if NET_4_0
public static void RegisterBuildProvider (string extension, Type providerType)
{
if (String.IsNullOrEmpty (extension))
return Activator.CreateInstance (type, null) as global::System.Web.Compilation.BuildProvider;
}
-#endif
public virtual CompilerType CodeCompilerType {
get { return null; } // Documented to return null
}
CodeMethodInvokeExpression expr = new CodeMethodInvokeExpression (thisRef, "InitializeCulture");
method.Statements.Add (AddLinePragma (new CodeExpressionStatement (expr), directiveLocation));
}
-#if NET_4_0
protected override void AddStatementsToInitMethodBottom (ControlBuilder builder, CodeMemberMethod method)
{
ILocation directiveLocation = pageParser.DirectiveLocation;
AssignPropertyWithExpression <string> (method, "MetaDescription", pageParser.MetaDescription, directiveLocation);
AssignPropertyWithExpression <string> (method, "MetaKeywords", pageParser.MetaKeywords, directiveLocation);
}
-#endif
protected override void PrependStatementsToFrameworkInitialize (CodeMemberMethod method)
{
base.PrependStatementsToFrameworkInitialize (method);
CodeRender,
CodeRenderExpression,
Include,
-#if NET_4_0
CodeRenderEncode
-#endif
}
}
protected virtual void AddStatementsToInitMethodTop (ControlBuilder builder, CodeMemberMethod method)
{
-#if NET_4_0
ClientIDMode? mode = parser.ClientIDMode;
if (mode.HasValue) {
var cimRef = new CodeTypeReferenceExpression (typeof (ClientIDMode));
method.Statements.Add (assign);
}
-#endif
}
protected virtual void AddStatementsToInitMethodBottom (ControlBuilder builder, CodeMemberMethod method)
parms.Add (new CodeDelegateCreateExpression (
new CodeTypeReference (typeof (System.Web.UI.BuildMethod)),
thisRef, child.Method.Name));
-#if NET_4_0
string value = pca.ProviderName;
if (!String.IsNullOrEmpty (value) && String.Compare (OutputCache.DEFAULT_PROVIDER_NAME, value, StringComparison.Ordinal) != 0)
parms.Add (new CodePrimitiveExpression (value));
else
parms.Add (new CodePrimitiveExpression (null));
-#endif
methodStatements.Add (AddLinePragma (build, parent));
if (parent.HasAspCode)
AddRenderControl (parent);
CodeExpression GetWrappedCodeExpression (CodeRenderBuilder cr)
{
var ret = new CodeSnippetExpression (cr.Code);
-#if NET_4_0
if (cr.HtmlEncode) {
var encodeRef = new CodeMethodReferenceExpression (new CodeTypeReferenceExpression (typeof (HttpUtility)), "HtmlEncode");
return new CodeMethodInvokeExpression (encodeRef, new CodeExpression[] { ret });
} else
-#endif
return ret;
}
AddPrimitiveArgument (arguments, parser.OutputCacheVaryByCustom);
AddPrimitiveArgument (arguments, parser.OutputCacheSqlDependency);
AddPrimitiveArgument (arguments, parser.OutputCacheShared);
-#if NET_4_0
arguments.Add (new CodeAttributeArgument ("ProviderName", new CodePrimitiveExpression (parser.ProviderName)));
-#endif
mainClass.CustomAttributes.Add (cad);
}
}
[ConfigurationProperty ("passport")]
-#if NET_4_0
[Obsolete ("This property is obsolete. The Passport authentication product is no longer supported and has been superseded by Live ID.")]
-#endif
public PassportAuthentication Passport {
get { return (PassportAuthentication) base [passportProp]; }
}
internal Type GetProviderTypeForExtension (string extension)
{
-#if NET_4_0
return global::System.Web.Compilation.BuildProvider.GetProviderTypeForExtension (extension);
-#else
- if (String.IsNullOrEmpty (extension))
- return null;
-
- BuildProvider provider = this [extension];
- if (provider == null)
- return null;
-
- Type type = HttpApplication.LoadType (provider.Type);
- if (type == null)
- return null;
-
- return type;
-#endif
}
internal global::System.Web.Compilation.BuildProvider GetProviderInstanceForExtension (string extension)
{
-#if NET_4_0
return global::System.Web.Compilation.BuildProvider.GetProviderInstanceForExtension (extension);
-#else
- Type type = GetProviderTypeForExtension (extension);
- if (type == null)
- return null;
-
- return Activator.CreateInstance (type, null) as global::System.Web.Compilation.BuildProvider;
-#endif
}
}
}
static ConfigurationProperty urlLinePragmasProp;
static ConfigurationProperty codeSubDirectoriesProp;
static ConfigurationProperty optimizeCompilationsProp;
-#if NET_4_0
static ConfigurationProperty targetFrameworkProp;
-#endif
static CompilationSection ()
{
// this hotfix: http://support.microsoft.com/kb/961884
optimizeCompilationsProp = new ConfigurationProperty ("optimizeCompilations", typeof (bool), false);
-#if NET_4_0
// Mono ignores this as there is no way to switch the runtime version
// dynamically while application is running
targetFrameworkProp = new ConfigurationProperty ("targetFramework", typeof (string), null);
-#endif
properties = new ConfigurationPropertyCollection ();
properties.Add (assembliesProp);
properties.Add (tempDirectoryProp);
properties.Add (urlLinePragmasProp);
properties.Add (optimizeCompilationsProp);
-#if NET_4_0
properties.Add (targetFrameworkProp);
-#endif
}
public CompilationSection ()
set { base [strictProp] = value; }
}
-#if NET_4_0
[ConfigurationProperty ("targetFramework", DefaultValue = null)]
public string TargetFramework {
get { return (string) base [targetFrameworkProp]; }
set { base [targetFrameworkProp] = value; }
}
-#endif
[ConfigurationProperty ("tempDirectory", DefaultValue = "")]
public string TempDirectory {
}
}
-#if NET_4_0
static HttpCapabilitiesProvider _provider = new HttpCapabilitiesDefaultProvider();
public static HttpCapabilitiesProvider BrowserCapabilitiesProvider {
get { return _provider; }
set { _provider = value; }
}
-#endif
}
}
static ConfigurationProperty shutdownTimeoutProp;
static ConfigurationProperty useFullyQualifiedRedirectUrlProp;
static ConfigurationProperty waitChangeNotificationProp;
-#if NET_4_0
static ConfigurationProperty requestPathInvalidCharactersProp;
static ConfigurationProperty requestValidationTypeProp;
static ConfigurationProperty requestValidationModeProp;
static ConfigurationProperty maxUrlLengthProp;
static ConfigurationProperty encoderTypeProp;
static ConfigurationProperty relaxedUrlToFileSystemMappingProp;
-#endif
#if NET_4_5
static ConfigurationProperty targetFrameworkProp;
#endif
TypeDescriptor.GetConverter (typeof (int)),
PropertyHelper.IntFromZeroToMaxValidator,
ConfigurationPropertyOptions.None);
-#if NET_4_0
requestPathInvalidCharactersProp = new ConfigurationProperty ("requestPathInvalidCharacters", typeof (string), "<,>,*,%,&,:,\\,?");
requestValidationTypeProp = new ConfigurationProperty ("requestValidationType", typeof (string),"System.Web.Util.RequestValidator",
TypeDescriptor.GetConverter (typeof (string)),
PropertyHelper.NonEmptyStringValidator,
ConfigurationPropertyOptions.None);
relaxedUrlToFileSystemMappingProp = new ConfigurationProperty ("relaxedUrlToFileSystemMapping", typeof (bool), false);
-#endif
#if NET_4_5
targetFrameworkProp = new ConfigurationProperty ("targetFramework", typeof (Version), new Version (4, 0),
PropertyHelper.VersionConverter,
properties.Add (shutdownTimeoutProp);
properties.Add (useFullyQualifiedRedirectUrlProp);
properties.Add (waitChangeNotificationProp);
-#if NET_4_0
properties.Add (requestPathInvalidCharactersProp);
properties.Add (requestValidationTypeProp);
properties.Add (requestValidationModeProp);
properties.Add (maxUrlLengthProp);
properties.Add (encoderTypeProp);
properties.Add (relaxedUrlToFileSystemMappingProp);
-#endif
#if NET_4_5
properties.Add (targetFrameworkProp);
#endif
set { base[waitChangeNotificationProp] = value; }
}
-#if NET_4_0
[ConfigurationProperty ("requestPathInvalidCharacters", DefaultValue = ",*,%,&,:,\\,?")]
public string RequestPathInvalidCharacters {
get { return (string) base [requestPathInvalidCharactersProp]; }
get { return (bool) base [relaxedUrlToFileSystemMappingProp]; }
set { base [relaxedUrlToFileSystemMappingProp] = value; }
}
-#endif
#if NET_4_5
[ConfigurationProperty ("targetFramework", DefaultValue = "4.0")]
[TypeConverter ("System.Web.Configuration.VersionConverter")]
static ConfigurationProperty validationKeyProp;
static ConfigurationPropertyCollection properties;
static MachineKeyValidationConverter converter = new MachineKeyValidationConverter ();
-#if NET_4_0
MachineKeyValidation validation;
-#endif
static MachineKeySection ()
{
PropertyHelper.WhiteSpaceTrimStringConverter,
PropertyHelper.NonEmptyStringValidator,
ConfigurationPropertyOptions.None);
-#if NET_4_0
validationProp = new ConfigurationProperty ("validation", typeof (string), "HMACSHA256",
PropertyHelper.WhiteSpaceTrimStringConverter,
PropertyHelper.NonEmptyStringValidator,
ConfigurationPropertyOptions.None);
-#else
- validationProp = new ConfigurationProperty ("validation", typeof (MachineKeyValidation),
- MachineKeyValidation.SHA1, converter,
- PropertyHelper.DefaultValidator,
- ConfigurationPropertyOptions.None);
-#endif
validationKeyProp = new ConfigurationProperty ("validationKey", typeof (string), "AutoGenerate,IsolateApps",
PropertyHelper.WhiteSpaceTrimStringConverter,
PropertyHelper.NonEmptyStringValidator,
Config.AutoGenerate (MachineKeyRegistryStorage.KeyType.Validation);
}
-#if NET_4_0
public MachineKeySection ()
{
// get DefaultValue from ValidationAlgorithm
public MachineKeyCompatibilityMode CompatibilityMode {
get; set;
}
-#endif
protected internal override void Reset (ConfigurationElement parentElement)
{
}
}
-#if NET_4_0
// property exists for backward compatibility
public MachineKeyValidation Validation {
get { return validation; }
base[validationProp] = value;
}
}
-#else
- [TypeConverter (typeof (MachineKeyValidationConverter))]
- [ConfigurationProperty ("validation", DefaultValue = "SHA1")]
- public MachineKeyValidation Validation {
- get { return (MachineKeyValidation) base [validationProp];}
- set { base[validationProp] = value; }
- }
-#endif
[TypeConverter (typeof (WhiteSpaceTrimStringConverter))]
[StringValidator (MinLength = 1)]
SHA1 = 1,
TripleDES = 2,
AES = 3,
-#if NET_4_0
HMACSHA256 = 4,
HMACSHA384 = 5,
HMACSHA512 = 6,
Custom = 7
-#endif
}
}
public sealed class MachineKeyValidationConverter : ConfigurationConverterBase
{
-#if NET_4_0
const string InvalidValue = "The enumeration value must be one of the following: SHA1, MD5, 3DES, AES, HMACSHA256, HMACSHA384, HMACSHA512.";
-#else
- const string InvalidValue = "The enumeration value must be one of the following: SHA1, MD5, 3DES, AES.";
-#endif
public MachineKeyValidationConverter ()
{
}
return MachineKeyValidation.TripleDES;
case "AES":
return MachineKeyValidation.AES;
-#if NET_4_0
case "HMACSHA256":
return MachineKeyValidation.HMACSHA256;
case "HMACSHA384":
return MachineKeyValidation.HMACSHA384;
case "HMACSHA512":
return MachineKeyValidation.HMACSHA512;
-#endif
default:
throw new ArgumentException (InvalidValue);
}
public override object ConvertTo (ITypeDescriptorContext ctx, CultureInfo ci, object value, Type type)
{
-#if NET_4_0
if ((value == null) || (value.GetType () != typeof (MachineKeyValidation)))
throw new ArgumentException (InvalidValue);
-#else
- if (value.GetType () != typeof (MachineKeyValidation)) {
- /* MS throws this exception on an invalid */
- throw new FormatException (InvalidValue);
- }
-#endif
switch ((MachineKeyValidation) value) {
case MachineKeyValidation.MD5:
return "3DES";
case MachineKeyValidation.AES:
return "AES";
-#if NET_4_0
case MachineKeyValidation.HMACSHA256:
return "HMACSHA256";
case MachineKeyValidation.HMACSHA384:
default:
// includes MachineKeyValidation.Custom
throw new ArgumentException (InvalidValue);
-#else
- default:
- /* MS throws this exception on an invalid */
- throw new FormatException (InvalidValue);
-#endif
}
}
}
static ConfigurationProperty omitVaryStarProp;
static ConfigurationProperty sendCacheControlHeaderProp;
static ConfigurationProperty enableKernelCacheForVaryByStarProp;
-#if NET_4_0
static ConfigurationProperty providersProp;
static ConfigurationProperty defaultProviderNameProp;
-#endif
static ConfigurationPropertyCollection properties;
omitVaryStarProp = new ConfigurationProperty ("omitVaryStar", typeof (bool), false);
sendCacheControlHeaderProp = new ConfigurationProperty ("sendCacheControlHeader", typeof (bool), true);
enableKernelCacheForVaryByStarProp = new ConfigurationProperty ("enableKernelCacheForVaryByStar", typeof (bool), false);
-#if NET_4_0
providersProp = new ConfigurationProperty ("providers", typeof (ProviderSettingsCollection));
defaultProviderNameProp = new ConfigurationProperty ("defaultProvider", typeof (string), "AspNetInternalProvider");
-#endif
properties = new ConfigurationPropertyCollection ();
properties.Add (omitVaryStarProp);
properties.Add (sendCacheControlHeaderProp);
properties.Add (enableKernelCacheForVaryByStarProp);
-#if NET_4_0
properties.Add (providersProp);
properties.Add (defaultProviderNameProp);
-#endif
}
[ConfigurationProperty ("enableFragmentCache", DefaultValue = "True")]
set { base[sendCacheControlHeaderProp] = value; }
}
-#if NET_4_0
[StringValidatorAttribute(MinLength = 1)]
[ConfigurationPropertyAttribute("defaultProvider", DefaultValue = "AspNetInternalProvider")]
public string DefaultProviderName {
public ProviderSettingsCollection Providers {
get { return base [providersProp] as ProviderSettingsCollection; }
}
-#endif
protected internal override ConfigurationPropertyCollection Properties {
get { return properties; }
static ConfigurationProperty userControlBaseTypeProp;
static ConfigurationProperty validateRequestProp;
static ConfigurationProperty viewStateEncryptionModeProp;
-#if NET_4_0
static ConfigurationProperty clientIDModeProp;
static ConfigurationProperty controlRenderingCompatibilityVersionProp;
-#endif
static PagesSection ()
{
asyncTimeoutProp = new ConfigurationProperty ("asyncTimeout", typeof (TimeSpan), TimeSpan.FromSeconds (45.0),
viewStateEncryptionModeProp = new ConfigurationProperty ("viewStateEncryptionMode", typeof (ViewStateEncryptionMode), ViewStateEncryptionMode.Auto,
new GenericEnumConverter (typeof (ViewStateEncryptionMode)), PropertyHelper.DefaultValidator,
ConfigurationPropertyOptions.None);
-#if NET_4_0
clientIDModeProp = new ConfigurationProperty ("clientIDMode", typeof (ClientIDMode), ClientIDMode.Predictable,
new GenericEnumConverter (typeof (ClientIDMode)), PropertyHelper.DefaultValidator,
ConfigurationPropertyOptions.None);
new VersionConverter (3, 5, "The value for the property 'controlRenderingCompatibilityVersion' is not valid. The error is: The control rendering compatibility version must not be less than {1}."),
PropertyHelper.DefaultValidator,
ConfigurationPropertyOptions.None);
-#endif
properties = new ConfigurationPropertyCollection ();
properties.Add (asyncTimeoutProp);
properties.Add (autoEventWireupProp);
properties.Add (userControlBaseTypeProp);
properties.Add (validateRequestProp);
properties.Add (viewStateEncryptionModeProp);
-#if NET_4_0
properties.Add (clientIDModeProp);
properties.Add (controlRenderingCompatibilityVersionProp);
-#endif
}
public PagesSection ()
get { return (ViewStateEncryptionMode) base [viewStateEncryptionModeProp]; }
set { base [viewStateEncryptionModeProp] = value; }
}
-#if NET_4_0
[ConfigurationProperty ("clientIDMode", DefaultValue = ClientIDMode.Predictable)]
public ClientIDMode ClientIDMode {
get { return (ClientIDMode) base [clientIDModeProp]; }
base [controlRenderingCompatibilityVersionProp] = value;
}
}
-#endif
protected internal override ConfigurationPropertyCollection Properties {
get { return properties; }
}
namespace System.Web.Configuration
{
-#if NET_4_0
[Obsolete ("This type is obsolete. The Passport authentication product is no longer supported and has been superseded by Live ID.")]
-#endif
public sealed class PassportAuthentication : ConfigurationElement
{
static ConfigurationProperty redirectUrlProp;
internal static IntegerValidator IntFromZeroToMaxValidator = new IntegerValidator (0, Int32.MaxValue);
internal static IntegerValidator IntFromOneToMax_1Validator = new IntegerValidator (1, Int32.MaxValue - 1);
-#if NET_4_0
internal static VersionConverter VersionConverter = new VersionConverter ();
-#endif
}
}
static ConfigurationProperty stateNetworkTimeoutProp;
static ConfigurationProperty timeoutProp;
static ConfigurationProperty useHostingIdentityProp;
-#if NET_4_0
static ConfigurationProperty compressionEnabledProp;
static ConfigurationProperty sqlConnectionRetryIntervalProp;
-#endif
static ConfigurationPropertyCollection properties;
static ConfigurationElementProperty elementProperty;
ConfigurationPropertyOptions.None);
useHostingIdentityProp = new ConfigurationProperty ("useHostingIdentity", typeof (bool), true);
-#if NET_4_0
compressionEnabledProp = new ConfigurationProperty ("compressionEnabled", typeof (bool), false);
sqlConnectionRetryIntervalProp = new ConfigurationProperty ("sqlConnectionRetryIntervalProp", typeof (TimeSpan), TimeSpan.FromSeconds (0),
PropertyHelper.TimeSpanSecondsOrInfiniteConverter,
PropertyHelper.PositiveTimeSpanValidator,
ConfigurationPropertyOptions.None);
-#endif
properties = new ConfigurationPropertyCollection ();
properties.Add (allowCustomSqlDatabaseProp);
properties.Add (stateNetworkTimeoutProp);
properties.Add (timeoutProp);
properties.Add (useHostingIdentityProp);
-#if NET_4_0
properties.Add (compressionEnabledProp);
properties.Add (sqlConnectionRetryIntervalProp);
-#endif
elementProperty = new ConfigurationElementProperty (new CallbackValidator (typeof (SessionStateSection), ValidateElement));
}
set { base[useHostingIdentityProp] = value; }
}
-#if NET_4_0
[ConfigurationPropertyAttribute("compressionEnabled", DefaultValue = false)]
public bool CompressionEnabled {
get { return (bool) base [compressionEnabledProp]; }
get { return (TimeSpan) base [sqlConnectionRetryIntervalProp]; }
set { base [sqlConnectionRetryIntervalProp] = value; }
}
-#endif
static void ValidateElement (object o)
{
}
[ConfigurationProperty ("mobileControls")]
-#if NET_4_0
[Obsolete ("System.Web.Mobile.dll is obsolete.")]
-#endif
public ConfigurationSection MobileControls {
get { return Sections ["MobileControls"]; }
}
namespace System.Web.Mail
{
-#if !NET_4_0
- // CAS
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-#endif
[Obsolete ("The recommended alternative is System.Net.Mail.Attachment. http://go.microsoft.com/fwlink/?linkid=14202")]
public class MailAttachment
{
namespace System.Web.Mail
{
-#if !NET_4_0
- // CAS
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-#endif
[Obsolete ("The recommended alternative is System.Net.Mail.MailMessage. http://go.microsoft.com/fwlink/?linkid=14202")]
public class MailMessage
{
{
// CAS
[Obsolete ("The recommended alternative is System.Net.Mail.SmtpClient. http://go.microsoft.com/fwlink/?linkid=14202")]
-#if !NET_4_0
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-#endif
public class SmtpMail
{
static string smtpServer = "localhost";
"default.aspx",
"index.html",
"index.htm" };
-#if NET_4_0
public static TimeSpan Timeout {
get; private set;
}
if (!String.IsNullOrEmpty (value))
default_url = value;
}
-#endif
public FormsAuthentication ()
{
}
FormsAuthenticationConfiguration config = section.Forms;
cookieName = config.Name;
-#if NET_4_0
Timeout = config.Timeout;
-#endif
timeout = (int)config.Timeout.TotalMinutes;
cookiePath = config.Path;
protection = config.Protection;
cookie_domain = config.Domain;
cookie_mode = config.Cookieless;
cookies_supported = true; /* XXX ? */
-#if NET_4_0
if (!String.IsNullOrEmpty (default_url))
default_url = MapUrl (default_url);
else
-#endif
default_url = MapUrl(config.DefaultUrl);
enable_crossapp_redirects = config.EnableCrossAppRedirects;
-#if NET_4_0
if (!String.IsNullOrEmpty (login_url))
login_url = MapUrl (login_url);
else
-#endif
login_url = MapUrl(config.LoginUrl);
initialized = true;
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
// attributes
[Serializable]
-#if NET_4_0
public
-#else
- public sealed
-#endif
class FormsIdentity : IIdentity
{
FormsAuthenticationTicket ticket;
namespace System.Web.Security
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web, Version=2.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a")]
-#endif
public enum MembershipCreateStatus
{
Success,
namespace System.Web.Security
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web, Version=2.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a")]
-#endif
[Serializable]
public class MembershipCreateUserException : Exception
{
namespace System.Web.Security
{
sealed class MembershipHelper
-#if NET_4_0
: IMembershipHelper
-#endif
{
internal const int SALT_BYTES = 16;
namespace System.Web.Security
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web, Version=2.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a")]
-#endif
[Serializable]
public class MembershipPasswordException : Exception
{
namespace System.Web.Security
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web, Version=2.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a")]
-#endif
public enum MembershipPasswordFormat
{
Clear = 0,
namespace System.Web.Security
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web, Version=2.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a")]
-#endif
public abstract class MembershipProvider : ProviderBase
{
-#if NET_4_0
const string HELPER_TYPE_NAME = "System.Web.Security.MembershipHelper, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
internal static IMembershipHelper Helper {
get { return helper; }
}
static IMembershipHelper helper;
-#else
- static MembershipHelper helper;
-#endif
static readonly object validatingPasswordEvent = new object ();
static MembershipProvider ()
{
-#if NET_4_0
Type type = Type.GetType (HELPER_TYPE_NAME, false);
if (type == null)
return;
} catch {
// ignore
}
-#else
- helper = new MembershipHelper ();
-#endif
}
protected MembershipProvider ()
protected virtual byte [] DecryptPassword (byte [] encodedPassword)
{
-#if NET_4_0
if (helper == null)
throw new PlatformNotSupportedException ("This method is not available.");
-#endif
return helper.DecryptPassword (encodedPassword);
}
protected virtual byte[] EncryptPassword (byte[] password)
{
-#if NET_4_0
return EncryptPassword (password, MembershipPasswordCompatibilityMode.Framework20);
-#else
- return helper.EncryptPassword (password);
-#endif
}
-#if NET_4_0
[MonoTODO ("Discover what actually is 4.0 password compatibility mode.")]
protected virtual byte[] EncryptPassword (byte[] password, MembershipPasswordCompatibilityMode legacyPasswordCompatibilityMode)
{
return helper.EncryptPassword (password);
}
-#endif
}
}
namespace System.Web.Security
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web, Version=2.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a")]
-#endif
public sealed class MembershipProviderCollection : ProviderCollection
{
public override void Add (ProviderBase provider)
namespace System.Web.Security
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web, Version=2.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a")]
-#endif
[Serializable]
public class MembershipUser
{
get { return isLockedOut; }
}
-#if NET_4_0
public virtual
-#else
- public
-#endif
bool IsOnline {
get {
int minutes;
-#if NET_4_0
IMembershipHelper helper = MembershipProvider.Helper;
if (helper == null)
throw new PlatformNotSupportedException ("The method is not available.");
minutes = helper.UserIsOnlineTimeWindow;
-#else
- minutes = Membership.UserIsOnlineTimeWindow;
-#endif
return LastActivityDate > DateTime.Now - TimeSpan.FromMinutes (minutes);
}
}
MembershipProvider Provider {
get {
MembershipProvider p;
-#if NET_4_0
IMembershipHelper helper = MembershipProvider.Helper;
if (helper == null)
throw new PlatformNotSupportedException ("The method is not available.");
p = helper.Providers [ProviderName];
-#else
- p = Membership.Providers [ProviderName];
-#endif
if (p == null)
throw new InvalidOperationException ("Membership provider '" + ProviderName + "' not found.");
return p;
namespace System.Web.Security
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web, Version=2.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a")]
-#endif
[Serializable]
public sealed class MembershipUserCollection : ICollection
{
namespace System.Web.Security
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web, Version=2.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a")]
-#endif
public delegate void MembershipValidatePasswordEventHandler (object sender, ValidatePasswordEventArgs e);
}
{
// CAS - no InheritanceDemand here as the class is sealed
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-#if NET_4_0
[Obsolete ("This type is obsolete. The Passport authentication product is no longer supported and has been superseded by Live ID.")]
-#endif
public sealed class PassportAuthenticationEventArgs : EventArgs
{
PassportIdentity identity;
namespace System.Web.Security
{
-#if NET_4_0
[Obsolete ("This type is obsolete. The Passport authentication product is no longer supported and has been superseded by Live ID.")]
-#endif
public delegate void PassportAuthenticationEventHandler (object sender,
PassportAuthenticationEventArgs e);
}
{
// CAS - no InheritanceDemand here as the class is sealed
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-#if NET_4_0
[Obsolete ("This type is obsolete. The Passport authentication product is no longer supported and has been superseded by Live ID.")]
-#endif
public sealed class PassportAuthenticationModule : IHttpModule
{
static readonly object authenticateEvent = new object ();
[MonoTODO("Not implemented")]
// CAS - no InheritanceDemand here as the class is sealed
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-#if NET_4_0
[Obsolete ("This type is obsolete. The Passport authentication product is no longer supported and has been superseded by Live ID.")]
-#endif
public sealed class PassportIdentity : IIdentity, IDisposable {
[SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
public PassportIdentity ()
[Serializable]
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-#if NET_4_0
public
-#else
- public sealed
-#endif
class RolePrincipal : IPrincipal {
IIdentity _identity;
namespace System.Web.Security
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web, Version=2.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a")]
-#endif
public abstract class RoleProvider : ProviderBase
{
protected RoleProvider ()
string alg_type = section.HashAlgorithmType;
if (alg_type.Length == 0) {
alg_type = MachineKeySection.Config.Validation.ToString ();
-#if NET_4_0
// support new (4.0) custom algorithms
if (alg_type.StartsWith ("alg:"))
alg_type = alg_type.Substring (4);
-#endif
}
using (HashAlgorithm hash = HashAlgorithm.Create (alg_type)) {
-#if NET_4_0
// for compatibility (with 2.0) we'll allow MD5 and SHA1 not to map to HMACMD5 and HMACSHA1
// but that won't work with new (4.0) algorithms, like HMACSHA256|384|512 or custom, won't work without using the key
KeyedHashAlgorithm kha = (hash as KeyedHashAlgorithm);
if (kha != null)
kha.Key = MachineKeySection.Config.GetValidationKey ();
-#endif
hash.TransformFinalBlock (hashBytes, 0, hashBytes.Length);
return Convert.ToBase64String (hash.Hash);
}
namespace System.Web.Security
{
-#if NET_4_0
[TypeForwardedFrom ("System.Web, Version=2.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a")]
-#endif
public sealed class ValidatePasswordEventArgs: EventArgs
{
bool cancel;
string Serialize (SessionStateItemCollection items)
{
-#if NET_4_0
GZipStream gzip = null;
-#endif
Stream output;
MemoryStream ms = null;
BinaryWriter writer = null;
try {
ms = new MemoryStream ();
-#if NET_4_0
if (sessionConfig.CompressionEnabled)
output = gzip = new GZipStream (ms, CompressionMode.Compress, true);
else
-#endif
output = ms;
writer = new BinaryWriter (output);
if (items != null)
items.Serialize (writer);
-#if NET_4_0
if (gzip != null)
gzip.Close ();
-#endif
writer.Close ();
return Convert.ToBase64String (ms.ToArray ());
} finally {
-#if NET_4_0
if (writer != null)
writer.Dispose ();
if (gzip != null)
gzip.Dispose ();
-#else
- if (writer != null)
- ((IDisposable)writer).Dispose ();
-#endif
if (ms != null)
ms.Dispose ();
}
MemoryStream ms = null;
Stream input;
BinaryReader reader = null;
-#if NET_4_0
GZipStream gzip = null;
-#endif
try {
ms = new MemoryStream (Convert.FromBase64String (serializedItems));
var sessionItems = new SessionStateItemCollection ();
if (ms.Length > 0) {
-#if NET_4_0
if (sessionConfig.CompressionEnabled)
input = gzip = new GZipStream (ms, CompressionMode.Decompress, true);
else
-#endif
input = ms;
reader = new BinaryReader (input);
sessionItems = SessionStateItemCollection.Deserialize (reader);
-#if NET_4_0
if (gzip != null)
gzip.Close ();
-#endif
reader.Close ();
}
return new SessionStateStoreData (sessionItems, SessionStateUtility.GetSessionStaticObjects (context), timeout);
} finally {
-#if NET_4_0
if (reader != null)
reader.Dispose ();
if (gzip != null)
gzip.Dispose ();
-#else
- if (reader != null)
- ((IDisposable)reader).Dispose ();
-#endif
if (ms != null)
ms.Dispose ();
}
MemoryStream stream = null;
BinaryReader reader = null;
Stream input = null;
-#if NET_4_0
GZipStream gzip = null;
-#endif
try {
if (item.CollectionData != null && item.CollectionData.Length > 0) {
stream = new MemoryStream (item.CollectionData);
-#if NET_4_0
if (config.CompressionEnabled)
input = gzip = new GZipStream (stream, CompressionMode.Decompress, true);
else
-#endif
input = stream;
reader = new BinaryReader (input);
items = SessionStateItemCollection.Deserialize (reader);
-#if NET_4_0
if (gzip != null)
gzip.Close ();
-#endif
reader.Close ();
} else
items = new SessionStateItemCollection ();
} finally {
if (stream != null)
stream.Dispose ();
-#if NET_4_0
if (reader != null)
reader.Dispose ();
if (gzip != null)
gzip.Dispose ();
-#else
- if (reader != null)
- ((IDisposable)reader).Dispose ();
-#endif
}
return new SessionStateStoreData (items,
MemoryStream stream = null;
BinaryWriter writer = null;
Stream output = null;
-#if NET_4_0
GZipStream gzip = null;
-#endif
try {
SessionStateItemCollection items = item.Items as SessionStateItemCollection;
if (items != null && items.Count > 0) {
stream = new MemoryStream ();
-#if NET_4_0
if (config.CompressionEnabled)
output = gzip = new GZipStream (stream, CompressionMode.Compress, true);
else
-#endif
output = stream;
writer = new BinaryWriter (output);
items.Serialize (writer);
-#if NET_4_0
if (gzip != null)
gzip.Close ();
-#endif
writer.Close ();
collection_data = stream.ToArray ();
}
throw new HttpException ("Failed to store session data.", ex);
} finally {
-#if NET_4_0
if (writer != null)
writer.Dispose ();
if (gzip != null)
gzip.Dispose ();
-#else
- if (writer != null)
- ((IDisposable)writer).Dispose ();
-#endif
if (stream != null)
stream.Dispose ();
}
if (req != null) {
XhtmlConformanceSection xhtml = WebConfigurationManager.GetSection ("system.web/xhtmlConformance") as XhtmlConformanceSection;
if (xhtml == null || xhtml.Mode != XhtmlConformanceMode.Strict)
-#if NET_4_0
if (RenderingCompatibilityLessThan40)
-#endif
// LAMESPEC: MSDN says the 'name' attribute is rendered only in
// Legacy mode, this is not true.
w.WriteAttribute ("name", Name);
[ControlBuilder (typeof(HtmlHeadBuilder))]
public sealed class HtmlHead: HtmlGenericControl, IParserAccessor
{
-#if NET_4_0
string descriptionText;
string keywordsText;
HtmlMeta descriptionMeta;
HtmlMeta keywordsMeta;
-#endif
string titleText;
HtmlTitle title;
//Hashtable metadata;
writer.Write (titleText);
writer.RenderEndTag ();
}
-#if NET_4_0
if (descriptionMeta == null && descriptionText != null) {
writer.AddAttribute ("name", "description");
writer.AddAttribute ("content", HttpUtility.HtmlAttributeEncode (descriptionText));
writer.RenderBeginTag (HtmlTextWriterTag.Meta);
writer.RenderEndTag ();
}
-#endif
if (styleSheet != null)
styleSheet.Render (writer);
}
title = t;
}
-#if NET_4_0
HtmlMeta meta = control as HtmlMeta;
if (meta != null) {
if (String.Compare ("keywords", meta.Name, StringComparison.OrdinalIgnoreCase) == 0)
else if (String.Compare ("description", meta.Name, StringComparison.OrdinalIgnoreCase) == 0)
descriptionMeta = meta;
}
-#endif
base.AddedControl (control, index);
}
if (title == control)
title = null;
-#if NET_4_0
if (keywordsMeta == control)
keywordsMeta = null;
else if (descriptionMeta == control)
descriptionMeta = null;
-#endif
base.RemovedControl (control);
}
-#if NET_4_0
public string Description {
get {
if (descriptionMeta != null)
keywordsText = value;
}
}
-#endif
public IStyleSheet StyleSheet {
get {
requiresDataBinding = value;
}
}
-#if NET_4_0
public override bool SupportsDisabledAttribute {
get { return RenderingCompatibilityLessThan40; }
}
-#endif
protected void ConfirmInitState ()
{
initialized = true;
return selectArguments;
}
}
-#if NET_4_0
public override bool SupportsDisabledAttribute {
get { return RenderingCompatibilityLessThan40; }
}
-#endif
TableStyle TableStyle {
// this will throw an InvalidCasException just like we need
get { return (TableStyle) ControlStyle; }
return weekendDayStyle;
}
}
-#if NET_4_0
public override bool SupportsDisabledAttribute {
get { return RenderingCompatibilityLessThan40; }
}
-#endif
// Private properties
DateTimeFormatInfo DateInfo {
get {
[DefaultEvent ("ChangedPassword")]
[Designer ("System.Web.UI.Design.WebControls.ChangePasswordDesigner, " + Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
public class ChangePassword : CompositeControl, INamingContainer
-#if NET_4_0
, IRenderOuterTable
-#endif
{
static readonly object cancelButtonClickEvent = new object ();
static readonly object changedPasswordEvent = new object ();
public static readonly string CancelButtonCommandName = "Cancel";
public static readonly string ChangePasswordButtonCommandName = "ChangePassword";
public static readonly string ContinueButtonCommandName = "Continue";
-#if NET_4_0
bool renderOuterTable = true;
-#endif
Style _cancelButtonStyle = null;
Style _changePasswordButtonStyle = null;
Style _continueButtonStyle = null;
get { return ViewState.GetString ("PasswordRequiredErrorMessage", String.Empty); }
set { ViewState ["PasswordRequiredErrorMessage"] = value; }
}
-#if NET_4_0
// LAMESPEC: MSDN claims it's present in 3.5, but it's not
[DefaultValue (true)]
public virtual bool RenderOuterTable {
get { return renderOuterTable; }
set { renderOuterTable = value; }
}
-#endif
[DefaultValue ("")]
[UrlProperty]
[Editor ("System.Web.UI.Design.UrlEditor, " + Consts.AssemblySystem_Design, "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
protected internal override void Render (HtmlTextWriter writer)
{
-#if NET_4_0
VerifyInlinePropertiesNotSet ();
-#endif
for (int i = 0; i < Controls.Count; i++)
if (Controls [i].Visible)
Controls [i].Render (writer);
class BaseChangePasswordContainer : Control, INamingContainer, INonBindingContainer
{
protected readonly ChangePassword _owner = null;
-#if NET_4_0
bool renderOuterTable;
-#endif
Table _table = null;
TableCell _containerCell = null;
throw new ArgumentNullException ("owner");
_owner = owner;
-#if NET_4_0
renderOuterTable = _owner.RenderOuterTable;
if (renderOuterTable)
-#endif
InitTable ();
}
public void InstantiateTemplate (ITemplate template)
{
-#if NET_4_0
if (!_owner.RenderOuterTable)
template.InstantiateIn (this);
else
-#endif
template.InstantiateIn (_containerCell);
}
void InitTable ()
{
_table = new Table ();
-#if NET_4_0
string id = _owner.ID;
if (!String.IsNullOrEmpty (id))
-#endif
_table.Attributes.Add ("id", _owner.ID);
_table.CellSpacing = 0;
{
Table table = new Table ();
table.CellPadding = 0;
-#if NET_4_0
Style ownerStyle = _owner.ControlStyle;
Style tableStyle = table.ControlStyle;
FontInfo ownerFont = ownerStyle.Font;
tableStyle.ForeColor = ownerForeColor;
ownerStyle.RemoveBit ((int)global::System.Web.UI.WebControls.Style.Styles.ForeColor);
}
-#endif
// Row #0
table.Controls.Add (
CreateRow (new LiteralControl (_owner.ChangePasswordTitleText),
bool need_span = ControlStyleCreated && !ControlStyle.IsEmpty;
bool enabled = IsEnabled;
if (!enabled) {
-#if NET_4_0
if (!RenderingCompatibilityLessThan40)
ControlStyle.PrependCssClass (DisabledCssClass);
else
-#endif
w.AddAttribute (HtmlTextWriterAttribute.Disabled, "disabled", false);
need_span = true;
}
get { return (RepeatLayout) ViewState.GetInt ("RepeatLayout", (int) RepeatLayout.Table); }
set {
bool outOfRange;
-#if NET_4_0
outOfRange = value < RepeatLayout.Table || value > RepeatLayout.OrderedList;
-#else
- outOfRange = value < RepeatLayout.Table || value > RepeatLayout.Flow;
-#endif
if (outOfRange)
throw new ArgumentOutOfRangeException ("value");
ViewState ["RepeatLayout"] = value;
check_box.Attributes.Clear ();
if (item.HasAttributes)
check_box.Attributes.CopyFrom (item.Attributes);
-#if NET_4_0
if (!RenderingCompatibilityLessThan40) {
var attrs = check_box.InputAttributes;
attrs.Clear ();
attrs.Add ("value", item.Value);
}
-#endif
check_box.RenderControl (writer);
}
[Designer ("System.Web.UI.Design.WebControls.CompositeControlDesigner, " + Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
public abstract class CompositeControl : WebControl, INamingContainer, ICompositeControlDesignerAccessor
{
-#if NET_4_0
public override bool SupportsDisabledAttribute {
get { return RenderingCompatibilityLessThan40; }
}
-#endif
protected CompositeControl ()
{
}
{
return new ControlParameter (this);
}
-#if NET_4_0
protected internal
-#else
- protected
-#endif
override object Evaluate (HttpContext ctx, Control control)
{
if (control == null)
{
return new CookieParameter (this);
}
-#if NET_4_0
protected internal
-#else
- protected
-#endif
override object Evaluate (HttpContext ctx, Control control)
{
if (ctx == null || ctx.Request == null)
namespace System.Web.UI.WebControls
{
public class DataKey : IStateManager
-#if NET_4_0
, IEquatable <DataKey>
-#endif
{
IOrderedDictionary keyTable;
string[] keyNames;
return readonlyKeyTable;
}
}
-#if NET_4_0
public bool Equals (DataKey other)
{
if (other == null)
return true;
}
-#endif
protected virtual void LoadViewState (object savedState)
{
if (savedState is Pair) {
return (o == null) ? RepeatLayout.Table : (RepeatLayout) o;
}
set {
-#if NET_4_0
if (value == RepeatLayout.OrderedList || value == RepeatLayout.UnorderedList)
throw new ArgumentOutOfRangeException (String.Format ("DataList does not support the '{0}' layout.", value));
-#endif
ViewState ["RepeatLayout"] = value;
}
}
public virtual ListItemType ItemType {
get { return type; }
}
-#if NET_4_0
public override bool SupportsDisabledAttribute {
get { return RenderingCompatibilityLessThan40; }
}
-#endif
protected override Style CreateControlStyle ()
{
return new TableItemStyle (ViewState);
[DesignerAttribute ("System.Web.UI.Design.WebControls.DetailsViewDesigner, " + Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
[ControlValuePropertyAttribute ("SelectedValue")]
[DefaultEventAttribute ("PageIndexChanging")]
-#if NET_4_0
[DataKeyProperty ("DataKey")]
-#endif
[AspNetHostingPermissionAttribute (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermissionAttribute (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class DetailsView: CompositeDataBoundControl, ICallbackEventHandler, ICallbackContainer, IDataItemContainer, INamingContainer, IPostBackEventHandler, IPostBackContainer
-#if NET_4_0
, IDataBoundItemControl, IDataBoundControl, IFieldControl
-#endif
{
object dataItem;
throw new HttpException (String.Format (unhandledEventExceptionMessage, ID, "ItemUpdating"));
}
-#if NET_4_0
DataBoundControlMode IDataBoundItemControl.Mode {
get {
switch (CurrentMode) {
throw new NotImplementedException ();
}
}
-#endif
[WebCategoryAttribute ("Paging")]
[DefaultValueAttribute (false)]
public virtual bool AllowPaging {
break;
}
}
-#if NET_4_0
public
-#endif
void SetPageIndex (int newIndex)
{
DetailsViewPageEventArgs args = new DetailsViewPageEventArgs (newIndex);
set { base.SelectedIndex = value; }
}
-#if NET_4_0
public override bool SupportsDisabledAttribute {
get { return RenderingCompatibilityLessThan40; }
}
-#endif
#endregion // Public Instance Properties
#region Protected Instance Methods
{
return new FormParameter (this);
}
-#if NET_4_0
protected internal
-#else
- protected
-#endif
override object Evaluate (HttpContext ctx, Control control)
{
HttpRequest req = ctx != null ? ctx.Request : null;
[DesignerAttribute ("System.Web.UI.Design.WebControls.FormViewDesigner, " + Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
[ControlValuePropertyAttribute ("SelectedValue")]
[DefaultEventAttribute ("PageIndexChanging")]
-#if NET_4_0
[DataKeyProperty ("DataKey")]
-#endif
[AspNetHostingPermissionAttribute (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermissionAttribute (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class FormView: CompositeDataBoundControl, IDataItemContainer, INamingContainer, IPostBackEventHandler, IPostBackContainer
-#if NET_4_0
, IDataBoundItemControl, IDataBoundControl, IRenderOuterTable
-#endif
{
object dataItem;
IOrderedDictionary _keyTable;
DataKey key;
DataKey oldEditValues;
-#if NET_4_0
bool renderOuterTable = true;
-#endif
static readonly object PageIndexChangedEvent = new object();
static readonly object PageIndexChangingEvent = new object();
static readonly object ItemCommandEvent = new object();
get;
set;
}
-#if NET_4_0
[DefaultValue (true)]
public virtual bool RenderOuterTable {
get { return renderOuterTable; }
return baseProps + ", " + props;
}
-#endif
public virtual bool IsBindableType (Type type)
{
return type.IsPrimitive || type == typeof (string) || type == typeof (DateTime) || type == typeof (Guid) || type == typeof (Decimal);
}
cell.ColumnSpan = 2;
row.Cells.Add (cell);
-#if NET_4_0
row.RenderJustCellContents = !RenderOuterTable;
-#endif
}
void FillRowDataKey (object dataItem)
break;
}
}
-#if NET_4_0
public
-#endif
void SetPageIndex (int index)
{
FormViewPageEventArgs args = new FormViewPageEventArgs (index);
protected internal override void Render (HtmlTextWriter writer)
{
-#if NET_4_0
VerifyInlinePropertiesNotSet ();
if (RenderOuterTable) {
-#endif
PrepareControlHierarchy ();
if (table != null)
table.Render (writer);
-#if NET_4_0
} else if (table != null)
table.RenderChildren (writer);
-#endif
}
PostBackOptions IPostBackContainer.GetPostBackOptions (IButtonControl control)
int rowIndex;
DataControlRowState rowState;
DataControlRowType rowType;
-#if NET_4_0
internal bool RenderJustCellContents {
get;
set;
}
-#endif
public FormViewRow (int rowIndex, DataControlRowType rowType, DataControlRowState rowState)
{
this.rowIndex = rowIndex;
}
return false;
}
-#if NET_4_0
protected internal override void Render (HtmlTextWriter writer)
{
if (!RenderJustCellContents) {
foreach (TableCell cell in Cells)
cell.RenderContents (writer);
}
-#endif
}
}
[DesignerAttribute ("System.Web.UI.Design.WebControls.GridViewDesigner, " + Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
[ControlValuePropertyAttribute ("SelectedValue")]
[DefaultEventAttribute ("SelectedIndexChanged")]
-#if NET_4_0
[DataKeyProperty ("DataKey")]
-#endif
[AspNetHostingPermissionAttribute (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermissionAttribute (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class GridView: CompositeDataBoundControl, ICallbackEventHandler, ICallbackContainer, IPostBackEventHandler, IPostBackContainer, IPersistedSelector
-#if NET_4_0
, IDataKeysControl, IDataBoundListControl, IDataBoundControl, IFieldControl
-#endif
{
Table table;
GridViewRowCollection rows;
ITemplate emptyDataTemplate;
PropertyDescriptor[] cachedKeyProperties;
-#if NET_4_0
PropertyDescriptor[] cachedSuffixKeyProperties;
-#endif
// View state
DataControlFieldCollection columns;
PagerSettings pagerSettings;
TableItemStyle pagerStyle;
TableItemStyle rowStyle;
TableItemStyle selectedRowStyle;
-#if NET_4_0
TableItemStyle sortedAscendingCellStyle;
TableItemStyle sortedAscendingHeaderStyle;
TableItemStyle sortedDescendingCellStyle;
List <DataKey> _dataKeySuffixList;
DataKeyArray rowSuffixKeys;
-#endif
List <DataKey> _dataKeyList;
DataKeyArray keys;
DataKey oldEditValues;
}
[BrowsableAttribute(false)]
-#if NET_4_0
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
-#endif
public IAutoFieldGenerator ColumnsGenerator {
get;
set;
return _dataKeyList;
}
}
-#if NET_4_0
List <DataKey> DataKeySuffixList {
get {
if (_dataKeySuffixList == null)
return _dataKeySuffixList;
}
}
-#endif
[BrowsableAttribute (false)]
[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
public virtual DataKeyArray DataKeys {
RequireBinding ();
}
}
-#if NET_4_0
[TypeConverter (typeof(StringArrayConverter))]
[DefaultValue (null)]
public virtual string[] ClientIDRowSuffix {
return sortedDescendingHeaderStyle;
}
}
-#endif
public virtual bool IsBindableType (Type type)
{
return type.IsPrimitive || type == typeof (string) || type == typeof (decimal) || type == typeof (DateTime) || type == typeof (Guid);
Table mainTable = ContainedTable;
List <DataKey> dataKeyList;
string[] dataKeyNames;
-#if NET_4_0
List <DataKey> dataKeySuffixList;
string[] clientIDRowSuffix;
-#endif
if (dataBinding) {
dataKeyList = DataKeyList;
dataKeyNames = DataKeyNames;
-#if NET_4_0
dataKeySuffixList = DataKeySuffixList;
clientIDRowSuffix = ClientIDRowSuffix;
-#endif
} else {
dataKeyList = null;
dataKeyNames = null;
-#if NET_4_0
dataKeySuffixList = null;
clientIDRowSuffix = null;
-#endif
}
while (skip_first || enumerator.MoveNext ()) {
if (EditIndex == row.RowIndex)
oldEditValues = new DataKey (GetRowValues (row, true, true));
dataKeyList.Add (new DataKey (CreateRowDataKey (row), dataKeyNames));
-#if NET_4_0
dataKeySuffixList.Add (new DataKey (CreateRowSuffixDataKey (row), clientIDRowSuffix));
-#endif
OnRowDataBound (new GridViewRowEventArgs (row));
}
}
if (list.Count == 0) {
-#if NET_4_0
if (ShowHeader && ShowHeaderWhenEmpty)
CreateHeaderRow (mainTable, fields, dataBinding);
-#endif
GridViewRow emptyRow = CreateEmptyrRow (fieldCount);
if (emptyRow != null) {
OnRowCreated (new GridViewRowEventArgs (emptyRow));
OnRowDataBound (new GridViewRowEventArgs (emptyRow));
}
}
-#if NET_4_0
if (mainTable.Rows.Count == 0)
table = null;
-#endif
return 0;
} else {
GridViewRow footerRow = CreateRow (-1, -1, DataControlRowType.Footer, DataControlRowState.Normal);
LoadAndCacheProperties (DataKeyNames, dataItem, ref cachedKeyProperties);
return CreateDictionaryFromProperties (cachedKeyProperties, dataItem);
}
-#if NET_4_0
IOrderedDictionary CreateRowSuffixDataKey (GridViewRow row)
{
object dataItem = row.DataItem;
LoadAndCacheProperties (ClientIDRowSuffix, dataItem, ref cachedSuffixKeyProperties);
return CreateDictionaryFromProperties (cachedSuffixKeyProperties, dataItem);
}
-#endif
IOrderedDictionary GetRowValues (GridViewRow row, bool includeReadOnlyFields, bool includePrimaryKey)
{
OrderedDictionary dic = new OrderedDictionary ();
default:
break;
}
-#if NET_4_0
string sortExpression = SortExpression;
bool haveSorting = !String.IsNullOrEmpty (sortExpression);
-#endif
foreach (TableCell cell in row.Cells) {
DataControlFieldCell fcell = cell as DataControlFieldCell;
if (fcell != null) {
case DataControlRowType.Header:
if (field.HeaderStyleCreated && !field.HeaderStyle.IsEmpty)
cell.ControlStyle.MergeWith (field.HeaderStyle);
-#if NET_4_0
if (haveSorting)
MergeWithSortingStyle (sortExpression, sortedAscendingHeaderStyle, sortedDescendingHeaderStyle, field, cell);
-#endif
break;
case DataControlRowType.Footer:
if (field.FooterStyleCreated && !field.FooterStyle.IsEmpty)
}
if (field.ItemStyleCreated && !field.ItemStyle.IsEmpty)
cell.ControlStyle.MergeWith (field.ItemStyle);
-#if NET_4_0
if (haveSorting)
MergeWithSortingStyle (sortExpression, sortedAscendingCellStyle, sortedDescendingCellStyle, field, cell);
-#endif
break;
}
}
}
}
}
-#if NET_4_0
void MergeWithSortingStyle (string sortExpression, TableItemStyle ascending, TableItemStyle descending, DataControlField field, TableCell cell)
{
if (String.Compare (field.SortExpression, sortExpression, StringComparison.OrdinalIgnoreCase) != 0)
cell.ControlStyle.MergeWith (SortDirection == SortDirection.Ascending ? ascending : descending);
}
-#endif
protected internal override void OnInit (EventArgs e)
{
Page page = Page;
OnSorted (EventArgs.Empty);
}
-#if NET_4_0
public
-#endif
void SelectRow (int index)
{
GridViewSelectEventArgs args = new GridViewSelectEventArgs (index);
OnSelectedIndexChanged (EventArgs.Empty);
}
}
-#if NET_4_0
public
-#endif
void SetPageIndex (int newIndex)
{
GridViewPageEventArgs args = new GridViewPageEventArgs (newIndex);
PageIndex = args.NewPageIndex;
OnPageIndexChanged (EventArgs.Empty);
}
-#if NET_4_0
public
-#endif
void SetEditRow (int index)
{
GridViewEditEventArgs args = new GridViewEditEventArgs (index);
if (state [8] != null)
((IStateManager) OldEditValues).LoadViewState (state [8]);
pageCount = (int)state [9];
-#if NET_4_0
if (state [10] != null)
ClientIDRowSuffix = (string[]) state [10];
if (state [11] != null)
LoadDataKeyArrayState ((object []) state [11], out rowSuffixKeys);
-#endif
}
protected internal override object SaveControlState ()
SaveDataKeyArrayState (keys),
(oldEditValues == null ? null : ((IStateManager)oldEditValues).SaveViewState ()),
pageCount,
-#if NET_4_0
ClientIDRowSuffix,
SaveDataKeyArrayState (rowSuffixKeys)
-#endif
};
}
((IStateManager)editRowStyle).TrackViewState();
if (emptyDataRowStyle != null)
((IStateManager)emptyDataRowStyle).TrackViewState();
-#if NET_4_0
if (sortedAscendingCellStyle != null)
((IStateManager)sortedAscendingCellStyle).TrackViewState ();
((IStateManager)sortedDescendingHeaderStyle).TrackViewState ();
if (rowSuffixKeys != null)
((IStateManager) rowSuffixKeys).TrackViewState ();
-#endif
if (keys != null)
((IStateManager)keys).TrackViewState();
if (autoFieldProperties != null) {
(editRowStyle == null ? null : ((IStateManager)editRowStyle).SaveViewState()), // 9
(emptyDataRowStyle == null ? null : ((IStateManager)emptyDataRowStyle).SaveViewState()), // 10
autoFieldsData, // 11
-#if NET_4_0
sortedAscendingCellStyle == null ? null : ((IStateManager)sortedAscendingCellStyle).SaveViewState (), // 12
sortedAscendingHeaderStyle == null ? null : ((IStateManager)sortedAscendingHeaderStyle).SaveViewState (), // 13
sortedDescendingCellStyle == null ? null : ((IStateManager)sortedDescendingCellStyle).SaveViewState (), // 14
sortedDescendingHeaderStyle == null ? null : ((IStateManager)sortedDescendingHeaderStyle).SaveViewState () // 15
-#endif
};
for (int i = states.Length - 1; i >= 0; i--) {
((IStateManager)EditRowStyle).LoadViewState (states[9]);
if (states[10] != null)
((IStateManager)EmptyDataRowStyle).LoadViewState (states[10]);
-#if NET_4_0
if (states [12] != null)
((IStateManager)sortedAscendingCellStyle).LoadViewState (states [12]);
if (states [13] != null)
((IStateManager)sortedDescendingCellStyle).LoadViewState (states [14]);
if (states [15] != null)
((IStateManager)sortedDescendingHeaderStyle).LoadViewState (states [15]);
-#endif
}
void ICallbackEventHandler.RaiseCallbackEvent (string eventArgs)
w.AddAttribute (HtmlTextWriterAttribute.Src, ResolveClientUrl (image_url));
str = Text;
-#if !NET_4_0
- if (!String.IsNullOrEmpty (str))
-#endif
w.AddAttribute (HtmlTextWriterAttribute.Alt, str);
-#if !NET_4_0
- w.AddStyleAttribute (HtmlTextWriterStyle.BorderWidth, "0px");
-#endif
w.RenderBeginTag (HtmlTextWriterTag.Img);
w.RenderEndTag ();
} else
Controls.Clear ();
}
}
-#if NET_4_0
public override bool SupportsDisabledAttribute {
get { return RenderingCompatibilityLessThan40; }
}
-#endif
}
}
namespace System.Web.UI.WebControls
{
-#if !NET_4_0
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
- [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-#endif
public interface IPersistedSelector
{
DataKey DataKey { get; set; }
}
set { ViewState ["GenerateEmptyAlternateText"] = value; }
}
-#if NET_4_0
public override bool SupportsDisabledAttribute {
get { return RenderingCompatibilityLessThan40; }
}
-#endif
protected override void AddAttributesToRender (HtmlTextWriter writer)
{
base.AddAttributesToRender (writer);
}
#if BUG_78875_FIXED
if (Context.Request.Browser.SupportsCss)
-#endif
-#if !NET_4_0
- if (BorderWidth.IsEmpty)
- writer.AddStyleAttribute (HtmlTextWriterStyle.BorderWidth, "0px");
#endif
}
get { return AlternateText; }
set { AlternateText = value; }
}
-#if NET_4_0
public override bool SupportsDisabledAttribute {
get { return RenderingCompatibilityLessThan40; }
}
-#endif
protected override void AddAttributesToRender (HtmlTextWriter writer)
{
Page page = Page;
base.Render (writer);
if (spots != null && spots.Count > 0) {
-#if NET_4_0
bool enabled = Enabled;
-#endif
writer.AddAttribute (HtmlTextWriterAttribute.Id, "ImageMap" + ClientID);
writer.AddAttribute (HtmlTextWriterAttribute.Name, "ImageMap" + ClientID);
writer.RenderBeginTag (HtmlTextWriterTag.Map);
string target = spot.Target.Length > 0 ? spot.Target : Target;
if (!String.IsNullOrEmpty (target))
writer.AddAttribute (HtmlTextWriterAttribute.Target, target);
-#if NET_4_0
if (enabled) {
-#endif
string navUrl = ResolveClientUrl (spot.NavigateUrl);
writer.AddAttribute (HtmlTextWriterAttribute.Href, navUrl);
-#if NET_4_0
}
-#endif
break;
case HotSpotMode.PostBack:
writer.AddAttribute (HtmlTextWriterAttribute.Href, Page.ClientScript.GetPostBackClientHyperlink (this, n.ToString(), true));
get { return ViewState.GetString ("AssociatedControlID", String.Empty); }
set { ViewState ["AssociatedControlID"] = value; }
}
-#if NET_4_0
public override bool SupportsDisabledAttribute {
get { return RenderingCompatibilityLessThan40; }
}
-#endif
protected override void LoadViewState (object savedState)
{
base.LoadViewState (savedState);
get { return ViewState.GetString ("ValidationGroup", String.Empty); }
set { ViewState ["ValidationGroup"] = value; }
}
-#if NET_4_0
public override bool SupportsDisabledAttribute {
get { return RenderingCompatibilityLessThan40; }
}
-#endif
}
}
[DefaultEvent ("Authenticate")]
[Designer ("System.Web.UI.Design.WebControls.LoginDesigner, " + Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
public class Login : CompositeControl
-#if NET_4_0
, IRenderOuterTable
-#endif
{
#region LoginContainer
// TODO: This class should probably be folded into a generic one with BaseChangePasswordContainer
sealed class LoginContainer : Control
{
readonly Login _owner;
-#if NET_4_0
bool renderOuterTable;
-#endif
Table _table;
TableCell _containerCell;
public LoginContainer (Login owner)
{
_owner = owner;
-#if NET_4_0
renderOuterTable = _owner.RenderOuterTable;
if (renderOuterTable)
-#endif
InitTable ();
}
public void InstantiateTemplate (ITemplate template)
{
-#if NET_4_0
if (!renderOuterTable)
template.InstantiateIn (this);
else
-#endif
template.InstantiateIn (_containerCell);
}
LoginContainer container;
string _password;
-#if NET_4_0
bool renderOuterTable = true;
-#endif
public Login ()
{
}
ViewState ["PasswordRequiredErrorMessage"] = value;
}
}
-#if NET_4_0
[DefaultValue (true)]
public virtual bool RenderOuterTable {
get { return renderOuterTable; }
set { renderOuterTable = value; }
}
-#endif
[DefaultValue (false)]
[Themeable (false)]
public virtual bool RememberMeSet {
protected internal override void Render (HtmlTextWriter writer)
{
-#if NET_4_0
VerifyInlinePropertiesNotSet ();
-#endif
// VisibleWhenLoggedIn isn't applicable to the default login page
if (!VisibleWhenLoggedIn && !IsDefaultLoginPage () && IsLoggedIn ())
return;
ViewState ["FormatString"] = value;
}
}
-#if NET_4_0
public override bool SupportsDisabledAttribute {
get { return RenderingCompatibilityLessThan40; }
}
-#endif
protected internal override void Render (HtmlTextWriter writer)
{
if (!Anonymous) {
Style staticSelectedLinkStyle;
Style dynamicHoverLinkStyle;
Style staticHoverLinkStyle;
-#if NET_4_0
bool? renderList;
bool includeStyleBlock = true;
MenuRenderingMode renderingMode = MenuRenderingMode.Default;
-#endif
static readonly object MenuItemClickEvent = new object();
static readonly object MenuItemDataBoundEvent = new object();
return renderer;
}
}
-#if NET_4_0
bool RenderList {
get {
if (renderList == null) {
renderer = CreateRenderer (renderer);
}
}
-#endif
[DefaultValueAttribute (null)]
[PersistenceMode (PersistenceMode.InnerProperty)]
[EditorAttribute ("System.Web.UI.Design.WebControls.MenuBindingsEditor, " + Consts.AssemblySystem_Design, "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
if (o != null)
return (Unit)o;
// LAMESPEC: on 4.0 it returns Unit.Empty and on 3.5 16px
-#if NET_4_0
return Unit.Empty;
-#else
- return new Unit (16);
-#endif
}
set {
ViewState["StaticSubMenuIndent"] = value;
IMenuRenderer CreateRenderer (IMenuRenderer current)
{
-#if NET_4_0
Type newType = null;
switch (RenderingMode) {
if (current == null || current.GetType () != newType)
return Activator.CreateInstance (newType, this) as IMenuRenderer;
-#else
- if (current == null)
- return new MenuTableRenderer (this);
-#endif
return current;
}
get { return ViewState.GetString ("SeparatorImageUrlField", String.Empty); }
set { ViewState ["SeparatorImageUrlField"] = value; }
}
-#if NET_4_0
public override string ToString ()
{
string dm = DataMember;
return dm;
}
-#endif
void IStateManager.LoadViewState (object savedState)
{
ViewState.LoadViewState (savedState);
if (item.Depth > 0 && !isDynamicItem) {
double value;
-#if NET_4_0
Unit unit = oc.StaticSubMenuIndent;
if (unit == Unit.Empty)
value = 16;
else
value = unit.Value;
-#else
- value = oc.StaticSubMenuIndent.Value;
-#endif
Unit indent = new Unit (value * item.Depth, oc.StaticSubMenuIndent.Type);
writer.AddStyleAttribute (HtmlTextWriterStyle.MarginLeft, indent.ToString ());
}
ViewState ["ScrollBars"] = value;
}
}
-#if NET_4_0
public override bool SupportsDisabledAttribute {
get { return RenderingCompatibilityLessThan40; }
}
-#endif
protected override Style CreateControlStyle ()
{
return new PanelStyle (ViewState);
// returns the value of the control that it is bound to, while
// the QueryStringParameter object retrieves the current name/value pair from
// the HttpRequest object.
-#if NET_4_0
protected internal
-#else
- protected
-#endif
virtual object Evaluate (HttpContext context, Control control)
{
return null;
[DefaultEvent ("SendingMail")]
[Designer ("System.Web.UI.Design.WebControls.PasswordRecoveryDesigner, " + Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
public class PasswordRecovery : CompositeControl
-#if NET_4_0
, IRenderOuterTable
-#endif
{
static readonly object answerLookupErrorEvent = new object ();
static readonly object sendingMailEvent = new object ();
static readonly object verifyingUserEvent = new object ();
public static readonly string SubmitButtonCommandName = "Submit";
-#if NET_4_0
bool renderOuterTable = true;
-#endif
TableItemStyle _failureTextStyle;
TableItemStyle _hyperLinkStyle;
TableItemStyle _instructionTextStyle;
get { return ViewState.GetString ("QuestionTitleText", "Identity Confirmation"); }
set { ViewState ["QuestionTitleText"] = value; }
}
-#if NET_4_0
[DefaultValue (true)]
public virtual bool RenderOuterTable {
get { return renderOuterTable; }
set { renderOuterTable = value; }
}
-#endif
[DefaultValue ("")]
[UrlProperty]
[Editor ("System.Web.UI.Design.ImageUrlEditor, " + Consts.AssemblySystem_Design, "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
abstract class BasePasswordRecoveryContainer : Control, INamingContainer
{
protected readonly PasswordRecovery _owner = null;
-#if NET_4_0
bool renderOuterTable;
-#endif
Table _table;
TableCell _containerCell = null;
public BasePasswordRecoveryContainer (PasswordRecovery owner)
{
_owner = owner;
-#if NET_4_0
renderOuterTable = _owner.RenderOuterTable;
if (renderOuterTable)
-#endif
InitTable ();
}
public void InstantiateTemplate (ITemplate template)
{
-#if NET_4_0
if (!renderOuterTable)
template.InstantiateIn (this);
else
-#endif
template.InstantiateIn (_containerCell);
}
{
return new ProfileParameter (this);
}
-#if NET_4_0
protected internal
-#else
- protected
-#endif
override object Evaluate (HttpContext context, Control control)
{
if (context == null || context.Profile == null)
{
return new QueryStringParameter (this);
}
-#if NET_4_0
protected internal
-#else
- protected
-#endif
override object Evaluate (HttpContext ctx, Control control)
{
if (ctx == null || ctx.Request == null)
set {
bool outOfRange;
-#if NET_4_0
outOfRange = value < RepeatLayout.Table || value > RepeatLayout.OrderedList;
-#else
- outOfRange = value < RepeatLayout.Table || value > RepeatLayout.Flow;
-#endif
if (outOfRange)
throw new ArgumentOutOfRangeException ("The radio buttons layout is not one of the RepeatLayout values.");
public void RenderRepeater (HtmlTextWriter w, IRepeatInfoUser user, Style controlStyle, WebControl baseControl)
{
PrintValues (user);
-#if NET_4_0
RepeatLayout layout = RepeatLayout;
bool listLayout = layout == RepeatLayout.OrderedList || layout == RepeatLayout.UnorderedList;
if (cols > 1)
throw new InvalidOperationException ("The UnorderedList and OrderedList layouts do not support multi-column layouts.");
}
-#endif
if (RepeatDirection == RepeatDirection.Vertical) {
-#if NET_4_0
if (listLayout)
RenderList (w, user, controlStyle, baseControl);
else
-#endif
RenderVert (w, user, controlStyle, baseControl);
} else {
-#if NET_4_0
if (listLayout)
throw new InvalidOperationException ("The UnorderedList and OrderedList layouts only support vertical layout.");
-#endif
RenderHoriz (w, user, controlStyle, baseControl);
}
}
{
w.Write ("<br />");
}
-#if NET_4_0
void RenderList (HtmlTextWriter w, IRepeatInfoUser user, Style controlStyle, WebControl baseControl)
{
int items = user.RepeatedItemCount;
w.RenderEndTag ();
}
-#endif
void RenderVert (HtmlTextWriter w, IRepeatInfoUser user, Style controlStyle, WebControl baseControl)
{
int itms = user.RepeatedItemCount;
case RepeatLayout.Flow:
c = new Label ();
break;
-#if NET_4_0
case RepeatLayout.OrderedList:
c = new WebControl (HtmlTextWriterTag.Ol);
break;
case RepeatLayout.UnorderedList:
c = new WebControl (HtmlTextWriterTag.Ul);
break;
-#endif
default:
throw new InvalidOperationException (String.Format ("Unsupported RepeatLayout value '{0}'.", RepeatLayout));
}
}
set {
bool outOfRange;
-#if NET_4_0
outOfRange = value < RepeatLayout.Table || value > RepeatLayout.OrderedList;
-#else
- outOfRange = value < RepeatLayout.Table || value > RepeatLayout.Flow;
-#endif
if (outOfRange)
throw new ArgumentOutOfRangeException ();
layout = value;
{
Table,
Flow,
-#if NET_4_0
UnorderedList,
OrderedList
-#endif
}
}
{
return new SessionParameter (this);
}
-#if NET_4_0
protected internal
-#else
- protected
-#endif
override object Evaluate (HttpContext ctx, Control control)
{
if (ctx == null || ctx.Session == null)
// LAME SPEC: the event is raised on setting only when the old value is different
// from the new one
string connectionString = String.Empty;
-#if NET_4_0
[MergableProperty (false)]
-#endif
[EditorAttribute ("System.Web.UI.Design.WebControls.SqlDataSourceConnectionStringEditor, " + Consts.AssemblySystem_Design, "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
[DefaultValueAttribute ("")]
public virtual string ConnectionString {
newClass += cssClass;
CssClass = newClass;
}
-#if NET_4_0
internal void PrependCssClass (string cssClass)
{
if (String.IsNullOrEmpty (cssClass))
cssClass += " ";
CssClass = cssClass + oldClass;
}
-#endif
public void SetDirty ()
{
if (viewstate != null)
private TableStyle TableStyle {
get { return (ControlStyle as TableStyle); }
}
-#if NET_4_0
public override bool SupportsDisabledAttribute {
get { return RenderingCompatibilityLessThan40; }
}
-#endif
protected override void AddAttributesToRender (HtmlTextWriter writer)
{
base.AddAttributesToRender (writer);
-#if !NET_4_0
- if (!ControlStyleCreated || TableStyle.IsEmpty) {
- // for some reason border=X seems to be always present
- // and isn't rendered as a style attribute
- writer.AddAttribute (HtmlTextWriterAttribute.Border, "0", false);
- }
-#endif
}
protected override ControlCollection CreateControlCollection ()
}
set { TableItemStyle.Wrap = value; }
}
-#if NET_4_0
public override bool SupportsDisabledAttribute {
get { return RenderingCompatibilityLessThan40; }
}
-#endif
TableItemStyle TableItemStyle {
get { return (ControlStyle as TableItemStyle); }
}
TableItemStyle TableItemStyle {
get { return (ControlStyle as TableItemStyle); }
}
-#if NET_4_0
public override bool SupportsDisabledAttribute {
get { return RenderingCompatibilityLessThan40; }
}
-#endif
protected override ControlCollection CreateControlCollection ()
{
return new CellControlCollection (this);
SetBit ((int) TableStyles.HorizontalAlign);
}
}
-#if NET_4_0
[MonoTODO ("collapse style should be rendered only for browsers which support that.")]
-#endif
public override void AddAttributesToRender (HtmlTextWriter writer, WebControl owner)
{
base.AddAttributesToRender (writer, owner);
writer.AddAttribute (HtmlTextWriterAttribute.Align, "justify", false);
break;
}
-#if NET_4_0
if (g != GridLines.None && BorderWidth.IsEmpty)
writer.AddAttribute (HtmlTextWriterAttribute.Border, "1", false);
-#else
- // border (=0) is always present (and base class doesn't seems to add it)
- // but border is "promoted" to 1 if gridlines are present (with BorderWidth == 0)
- if (g == GridLines.None) {
- writer.AddAttribute (HtmlTextWriterAttribute.Border, "0", false);
- } else if (BorderWidth.IsEmpty) {
- writer.AddAttribute (HtmlTextWriterAttribute.Border, "1", false);
- } else {
- writer.AddAttribute (HtmlTextWriterAttribute.Border, BorderWidth.Value.ToString (Helpers.InvariantCulture));
- }
-#endif
}
void Copy (string name, TableStyles s, Style source)
// Why didn't msft just override RenderContents!?
RenderBeginTag (w);
if (TextMode == TextBoxMode.MultiLine) {
-#if NET_4_0
w.WriteLine ();
-#endif
HttpUtility.HtmlEncode (Text, w);
}
writer.AddStyleAttribute (HtmlTextWriterStyle.BorderWidth, "0");
writer.RenderBeginTag (HtmlTextWriterTag.Table);
-#if !NET_4_0
- Unit nodeSpacing = GetNodeSpacing (node);
-
- if (nodeSpacing != Unit.Empty && (node.Depth > 0 || node.Index > 0))
- RenderMenuItemSpacing (writer, nodeSpacing);
-#endif
writer.RenderBeginTag (HtmlTextWriterTag.Tr);
// Vertical lines from previous levels
if (!String.IsNullOrEmpty (imageUrl)) {
writer.RenderBeginTag (HtmlTextWriterTag.Td); // TD
-#if NET_4_0
writer.AddAttribute (HtmlTextWriterAttribute.Tabindex, "-1");
-#endif
BeginNodeTag (writer, node, clientExpand);
writer.AddAttribute (HtmlTextWriterAttribute.Src, imageUrl);
writer.AddStyleAttribute (HtmlTextWriterStyle.BorderWidth, "0");
if (node.ShowCheckBoxInternal) {
writer.AddAttribute (HtmlTextWriterAttribute.Name, ClientID + "_cs_" + node.Path);
writer.AddAttribute (HtmlTextWriterAttribute.Type, "checkbox", false);
-#if NET_4_0
string str = node.ToolTip;
if (!String.IsNullOrEmpty (str))
writer.AddAttribute (HtmlTextWriterAttribute.Title, str);
-#else
- writer.AddAttribute (HtmlTextWriterAttribute.Title, node.Text);
-#endif
if (node.Checked)
writer.AddAttribute (HtmlTextWriterAttribute.Checked, "checked", false);
writer.RenderBeginTag (HtmlTextWriterTag.Input); // INPUT
writer.RenderEndTag (); // TD
writer.RenderEndTag (); // TR
-#if !NET_4_0
- if (nodeSpacing != Unit.Empty)
- RenderMenuItemSpacing (writer, nodeSpacing);
-#endif
writer.RenderEndTag (); // TABLE
void RenderMenuItemSpacing (HtmlTextWriter writer, Unit itemSpacing)
{
-#if !NET_4_0
- writer.AddStyleAttribute (HtmlTextWriterStyle.Height, itemSpacing.ToString ());
-#endif
writer.RenderBeginTag (HtmlTextWriterTag.Tr);
writer.RenderBeginTag (HtmlTextWriterTag.Td);
writer.RenderEndTag ();
if (Page.Header != null) {
// styles are registered
if (nodeStyle != null) {
-#if NET_4_0
style.PrependCssClass (nodeStyle.RegisteredCssClass);
style.PrependCssClass (nodeStyle.CssClass);
-#else
- style.AddCssClass (nodeStyle.CssClass);
- style.AddCssClass (nodeStyle.RegisteredCssClass);
-#endif
}
if (node.IsLeafNode) {
if (leafNodeStyle != null) {
-#if NET_4_0
style.PrependCssClass (leafNodeStyle.RegisteredCssClass);
style.PrependCssClass (leafNodeStyle.CssClass);
-#else
- style.AddCssClass (leafNodeStyle.CssClass);
- style.AddCssClass (leafNodeStyle.RegisteredCssClass);
-#endif
}
} else if (node.IsRootNode) {
if (rootNodeStyle != null) {
-#if NET_4_0
style.PrependCssClass (rootNodeStyle.RegisteredCssClass);
style.PrependCssClass (rootNodeStyle.CssClass);
-#else
- style.AddCssClass (rootNodeStyle.CssClass);
- style.AddCssClass (rootNodeStyle.RegisteredCssClass);
-#endif
}
} else if (node.IsParentNode) {
if (parentNodeStyle != null) {
-#if NET_4_0
style.AddCssClass (parentNodeStyle.RegisteredCssClass);
style.AddCssClass (parentNodeStyle.CssClass);
-#else
- style.AddCssClass (parentNodeStyle.CssClass);
- style.AddCssClass (parentNodeStyle.RegisteredCssClass);
-#endif
}
}
if (levelStyles != null && levelStyles.Count > level) {
-#if NET_4_0
style.PrependCssClass (levelStyles [level].RegisteredCssClass);
style.PrependCssClass (levelStyles [level].CssClass);
-#else
- style.AddCssClass (levelStyles [level].CssClass);
- style.AddCssClass (levelStyles [level].RegisteredCssClass);
-#endif
}
if (nodeIsSelected) {
-#if NET_4_0
style.AddCssClass (selectedNodeStyle.RegisteredCssClass);
style.AddCssClass (selectedNodeStyle.CssClass);
-#else
- style.AddCssClass (selectedNodeStyle.CssClass);
- style.AddCssClass (selectedNodeStyle.RegisteredCssClass);
-#endif
}
} else {
// styles are not registered
void AddNodeLinkStyle (HtmlTextWriter writer, TreeNode node, int level, bool nodeIsSelected)
{
Style style = new Style ();
-#if NET_4_0
bool addBorderStyle = false;
-#endif
if (Page.Header != null) {
// styles are registered
style.AddCssClass (ControlLinkStyle.RegisteredCssClass);
if (levelLinkStyles != null && levelLinkStyles.Count > level) {
style.AddCssClass (levelLinkStyles [level].CssClass);
style.AddCssClass (levelLinkStyles [level].RegisteredCssClass);
-#if NET_4_0
addBorderStyle = true;
-#endif
}
if (node.IsLeafNode) {
if (levelLinkStyles != null && levelLinkStyles.Count > level) {
style.CopyFrom (levelLinkStyles [level]);
-#if NET_4_0
addBorderStyle = true;
-#endif
}
if (node.IsLeafNode) {
style.AlwaysRenderTextDecoration = true;
}
-#if NET_4_0
if (addBorderStyle) {
// This appears not to come from any style. Instead, it's added
// whenever a level style is present.
writer.AddStyleAttribute (HtmlTextWriterStyle.BorderStyle, "none");
writer.AddStyleAttribute (HtmlTextWriterStyle.FontSize, "1em");
}
-#endif
style.AddAttributesToRender (writer);
}
ViewState["ValidationGroup"] = value;
}
}
-#if NET_4_0
public override bool SupportsDisabledAttribute {
get { return RenderingCompatibilityLessThan40; }
}
-#endif
#endregion // Public Instance Properties
#region Public Instance Methods
else
Page.ClientScript.RegisterExpandoAttribute (controlId, attributeName, attributeValue, encode);
}
-#if NET_4_0
protected internal override void OnInit (EventArgs e)
{
base.OnInit (e);
if (ForeColor == Color.Empty)
ForeColor = Color.Red;
}
-#endif
protected internal
override void OnPreRender(EventArgs e) {
base.OnPreRender (e);
[Themeable (true)]
public class WebControl : Control, IAttributeAccessor
{
-#if NET_4_0
const string DEFAULT_DISABLED_CSS_CLASS = "aspNetDisabled";
-#endif
Style style;
HtmlTextWriterTag tag;
string tag_name;
StateBag attribute_state;
bool enabled;
bool track_enabled_state;
-#if NET_4_0
static WebControl ()
{
DisabledCssClass = DEFAULT_DISABLED_CSS_CLASS;
}
-#endif
public WebControl (HtmlTextWriterTag tag)
{
this.tag = tag;
return true;
}
}
-#if NET_4_0
public static string DisabledCssClass {
get;
set;
public virtual bool SupportsDisabledAttribute {
get { return true; }
}
-#endif
public void ApplyStyle (Style s)
{
if (s != null && !s.IsEmpty)
void RenderDisabled (HtmlTextWriter writer)
{
if (!IsEnabled) {
-#if NET_4_0
if (!SupportsDisabledAttribute)
ControlStyle.PrependCssClass (DisabledCssClass);
else
-#endif
writer.AddAttribute (HtmlTextWriterAttribute.Disabled, "disabled", false);
}
protected virtual void AddAttributesToRender (HtmlTextWriter writer)
{
-#if NET_4_0
RenderDisabled (writer);
-#endif
if (ID != null)
writer.AddAttribute(HtmlTextWriterAttribute.Id, ClientID);
-#if !NET_4_0
- RenderDisabled (writer);
-#endif
if (AccessKey != string.Empty)
writer.AddAttribute (HtmlTextWriterAttribute.Accesskey, AccessKey);
enabled = ViewState.GetBool ("Enabled", enabled);
}
-#if NET_4_0
internal virtual string InlinePropertiesSet ()
{
var properties = new List <string> ();
);
}
}
-#endif
protected internal
override void Render (HtmlTextWriter writer)
{
public static readonly string MoveNextCommandName = "MoveNext";
public static readonly string MovePreviousCommandName = "MovePrevious";
public static readonly string MoveToCommandName = "Move";
-#if NET_4_0
public static readonly string HeaderPlaceholderId = "headerPlaceholder";
public static readonly string NavigationPlaceholderId = "navigationPlaceholder";
public static readonly string SideBarPlaceholderId = "sideBarPlaceholder";
public static readonly string WizardStepPlaceholderId = "wizardStepPlaceholder";
-#endif
protected static readonly string DataListID = "SideBarList";
static readonly string CancelButtonIDShort = "Cancel";
ViewState ["HeaderText"] = value;
}
}
-#if NET_4_0
[DefaultValue (null)]
[TemplateContainerAttribute(typeof(Wizard))]
[PersistenceModeAttribute(PersistenceMode.InnerProperty)]
[BrowsableAttribute(false)]
public virtual ITemplate LayoutTemplate { get; set; }
-#endif
[DefaultValueAttribute (null)]
[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Content)]
[NotifyParentPropertyAttribute (true)]
{
CreateControlHierarchy ();
}
-#if NET_4_0
InvalidOperationException MakeLayoutException (string phName, string phID, string condition = null)
{
return new InvalidOperationException (
controls.Remove (placeHolder);
controls.AddAt (index, replacement);
}
-#endif
protected virtual void CreateControlHierarchy ()
{
-#if NET_4_0
ITemplate layoutTemplate = LayoutTemplate;
if (layoutTemplate != null) {
CreateControlHierarchy_LayoutTemplate (layoutTemplate);
return;
}
-#endif
styles.Clear ();
wizardTable = new ContainedTable (this);
protected internal override void Render (HtmlTextWriter writer)
{
PrepareControlHierarchy ();
-#if NET_4_0
if (LayoutTemplate == null)
-#endif
wizardTable.Render (writer);
-#if NET_4_0
else
RenderChildren (writer);
-#endif
}
void PrepareControlHierarchy ()
{
-#if NET_4_0
if (LayoutTemplate == null) {
-#endif
// header
if (!_headerCell.Initialized) {
if (String.IsNullOrEmpty (HeaderText))
if (ActiveStep.StepType == WizardStepType.Complete)
_headerCell.Parent.Visible = false;
-#if NET_4_0
} else {
WizardStepCollection steps = WizardSteps;
if (steps == null || steps.Count == 0)
return;
}
-#endif
// sidebar
if (stepDatalist != null) {
string GetDataKey ()
{
-#if NET_4_0
if (String.IsNullOrEmpty (DataFile) && !String.IsNullOrEmpty (Data)) {
string key = CacheKeyContext;
if (!String.IsNullOrEmpty (key))
return key;
}
-#endif
Page page = Page;
string p = page != null ? page.ToString () : "NullPage";
}
}
}
-#if NET_4_0
[DefaultValue ("")]
public virtual string CacheKeyContext {
get { return ViewState.GetString ("CacheKeyContext", String.Empty); }
set { ViewState ["CacheKeyContext"] = value; }
}
-#endif
}
}
internal static List <string> FileDependencies {
get { return dependencies; }
}
-#if NET_4_0
internal override Type DefaultBaseType {
get {
Type ret = PageParser.DefaultApplicationBaseType;
return ret;
}
}
-#endif
internal override string DefaultBaseTypeName {
get { return "System.Web.HttpApplication"; }
}
get { return slidingExpiration; }
set { slidingExpiration = value; }
}
-#if NET_4_0
internal string ProviderName {
get; set;
}
-#endif
internal abstract Control CreateControl ();
public override void Dispose ()
void RetrieveCachedContents ()
{
cacheKey = CreateKey ();
-#if NET_4_0
OutputCacheProvider provider = GetProvider ();
cachedData = provider.Get (cacheKey) as string;
-#else
- Cache cache = HttpRuntime.InternalCache;
- cachedData = cache [cacheKey] as string;
-#endif
}
-#if NET_4_0
OutputCacheProvider GetProvider ()
{
string providerName = ProviderName;
base.InitRecursive (namingContainer);
}
-#else
- protected internal override void OnInit (EventArgs e)
- {
- control = CreateControl ();
- Controls.Add (control);
- }
-#endif
protected internal override void Render (HtmlTextWriter output)
{
-#if !NET_4_0
- RetrieveCachedContents ();
-#endif
if (cachedData != null) {
output.Write (cachedData);
return;
context.Response.SetTextWriter (prev);
output.Write (text);
}
-#if NET_4_0
OutputCacheProvider provider = GetProvider ();
DateTime utcExpire = DateTime.UtcNow.AddSeconds (duration);
provider.Set (cacheKey, text, utcExpire);;
context.InternalCache.Insert (cacheKey, text, dependency, utcExpire.ToLocalTime (),
Cache.NoSlidingExpiration, CacheItemPriority.Normal,
null);
-#else
- context.InternalCache.Insert (cacheKey, text, dependency,
- DateTime.Now.AddSeconds (duration),
- Cache.NoSlidingExpiration,
- CacheItemPriority.Normal, null);
-#endif
}
public ControlCachePolicy CachePolicy
return;
writer.WriteLine ();
-#if NET_4_0
writer.AddAttribute (HtmlTextWriterAttribute.Class, "aspNetHidden");
-#endif
writer.RenderBeginTag (HtmlTextWriterTag.Div);
int oldIndent = writer.Indent;
writer.Indent = 0;
{
sealed class CodeRenderBuilder : CodeBuilder
{
-#if NET_4_0
public bool HtmlEncode {
get; private set;
}
{
this.HtmlEncode = doHtmlEncode;
}
-#endif
public CodeRenderBuilder (string code, bool isAssign, ILocation location)
: base (code, isAssign, location)
using System.Web.UI.WebControls;
using System.Web.Util;
-#if NET_4_0
using System.Web.Routing;
-#endif
namespace System.Web.UI
{
TemplateControl _templateControl;
bool _isChildControlStateCleared;
string _templateSourceDirectory;
-#if NET_4_0
ViewStateMode viewStateMode;
ClientIDMode? clientIDMode;
ClientIDMode? effectiveClientIDMode;
Version renderingCompatibility;
bool? renderingCompatibilityOld;
-#endif
/*************/
int stateMask;
const int ENABLE_VIEWSTATE = 1;
stateMask = ENABLE_VIEWSTATE | VISIBLE | AUTOID | BINDING_CONTAINER | AUTO_EVENT_WIREUP;
if (this is INamingContainer)
stateMask |= IS_NAMING_CONTAINER;
-#if NET_4_0
viewStateMode = ViewStateMode.Inherit;
-#endif
}
ControlAdapter adapter;
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
[EditorBrowsable (EditorBrowsableState.Never), Browsable (false)]
-#if NET_4_0
[Bindable (false)]
-#endif
public Control BindingContainer {
get {
Control container = NamingContainer;
get {
if (clientID != null)
return clientID;
-#if NET_4_0
clientID = GetClientID ();
-#else
- clientID = UniqueID2ClientID (UniqueID);
-#endif
stateMask |= ID_SET;
return clientID;
}
}
-#if NET_4_0
[Bindable (false)]
[Browsable (false)]
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
sb.Append (value.ToString ());
}
}
-#endif
internal string UniqueID2ClientID (string uniqueId)
{
if (String.IsNullOrEmpty (uniqueId))
for (Control control = this; control != null; control = control.Parent) {
if (!control.EnableViewState)
return false;
-#if NET_4_0
ViewStateMode vsm = control.ViewStateMode;
if (vsm != ViewStateMode.Inherit)
return vsm == ViewStateMode.Enabled;
-#endif
}
return true;
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
[Browsable (false)]
[WebSysDescription ("The container that this control is part of. The control's name has to be unique within the container.")]
-#if NET_4_0
[Bindable (false)]
-#endif
public virtual Control NamingContainer {
get {
if (_namingContainer == null && _parent != null) {
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
[Browsable (false)]
[WebSysDescription ("The parent control of this control.")]
-#if NET_4_0
[Bindable (false)]
-#endif
public virtual Control Parent { //DIT
get { return _parent; }
}
[Browsable (false)]
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
-#if NET_4_0
[Bindable (false)]
-#endif
public TemplateControl TemplateControl {
get { return TemplateControlInternal; }
void NullifyUniqueID ()
{
uniqueID = null;
-#if NET_4_0
ClearCachedClientID ();
-#else
- clientID = null;
-#endif
if (!HasControls ())
return;
stateMask |= PRERENDERED;
}
-#if NET_4_0
internal virtual
-#else
- internal
-#endif
void InitRecursive (Control namingContainer)
{
#if MONO_TRACE
return false;
}
}
-#if NET_4_0
[ThemeableAttribute(false)]
[DefaultValue (ViewStateMode.Inherit)]
public virtual ViewStateMode ViewStateMode {
return UniqueID.Substring (idx + 1);
}
-#endif
}
}
bpcc.Duration = value.Minutes;
}
}
-#if NET_4_0
public string ProviderName {
get {
AssertBasePartialCachingControl ();
bpcc.ProviderName = value;
}
}
-#endif
public bool SupportsCaching
{
get {
namespace System.Web.UI
{
class KeyedList : IOrderedDictionary
-#if !NET_4_0
- , IStateManager // why do we implement it at all?
-#endif
{
Hashtable objectTable = new Hashtable ();
{
return new KeyedListEnumerator (objectList);
}
-#if !NET_4_0
- void IStateManager.LoadViewState (object state)
- {
- if (state != null)
- {
- object[] states = (object[]) state;
- if (states[0] != null) {
- objectList = (ArrayList) states[0];
- for (int i = 0; i < objectList.Count; i++)
- {
- DictionaryEntry pair = (DictionaryEntry) objectList[i];
- objectTable.Add (pair.Key, pair.Value);
- }
- }
- }
- }
-
- object IStateManager.SaveViewState ()
- {
- object[] ret = new object[] { objectList };
- if (ret[0] == null)
- return null;
-
- return ret;
- }
-
- void IStateManager.TrackViewState ()
- {
- trackViewState = true;
- }
-#endif
public int Count {
get { return objectList.Count; }
}
get { return this; }
}
-#if !NET_4_0
- bool trackViewState;
-
- bool IStateManager.IsTrackingViewState {
- get { return trackViewState; }
- }
-#endif
int IndexOf (object key)
{
for (int i = 0; i < objectList.Count; i++)
{
if (stream == null)
throw new ArgumentNullException ("stream");
-#if NET_4_0
using (StreamReader sr = new StreamReader (stream)) {
return Deserialize (sr.ReadToEnd ());
}
-#else
- long streamLength = -1;
- if (stream.CanSeek)
- streamLength = stream.Length;
- MemoryStream ms = null;
- if (streamLength != -1 && (stream is MemoryStream) && stream.Position == 0) {
- // We save allocating a new stream and reading in this case.
- ms = (MemoryStream) stream;
- } else {
- byte [] bytes = new byte [streamLength >= 0 ? streamLength : 2048];
- ms = new MemoryStream ();
- int n;
- while ((n = stream.Read (bytes, 0, bytes.Length)) > 0)
- ms.Write (bytes, 0, n);
- streamLength = ms.Length;
- }
- string b64 = Encoding.ASCII.GetString (ms.GetBuffer (),
- 0, (int) streamLength);
- return Deserialize (b64);
-#endif
}
public object Deserialize (TextReader input)
{
if (stream == null)
throw new ArgumentNullException ("stream");
-#if NET_4_0
if (!stream.CanSeek)
throw new NotSupportedException ();
-#endif
string b64 = SerializeToBase64 (value);
byte [] bytes = Encoding.ASCII.GetBytes (b64);
stream.Write (bytes, 0, bytes.Length);
return parentMasterPage;
}
}
-#if NET_4_0
public void InstantiateInContentPlaceHolder (Control contentPlaceHolder, ITemplate template)
{
// .NET compatibility...
if (contentPlaceHolder != null && template != null)
template.InstantiateIn (contentPlaceHolder);
}
-#endif
internal static MasterPage CreateMasterPage (TemplateControl owner, HttpContext context,
string masterPageFile, IDictionary contentTemplateCollection)
{
{
[Obsolete ("The recommended alternative is System.Convert and String.Format. http://go.microsoft.com/fwlink/?linkid=14202")]
// CAS - no InheritanceDemand here as the class is sealed
-#if !NET_4_0
- [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-#endif
public sealed class ObjectConverter
{
public ObjectConverter ()
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Reflection;
-#if NET_4_0
using System.Web.Routing;
-#endif
namespace System.Web.UI
{
string _title;
string _theme;
string _styleSheetTheme;
-#if NET_4_0
string _metaDescription;
string _metaKeywords;
Control _autoPostBackControl;
bool frameworkInitialized;
-#endif
Hashtable items;
bool _maintainScrollPositionOnPostBack;
viewStateEncryptionMode = ViewStateEncryptionMode.Auto;
_viewState = true;
}
-#if NET_4_0
this.ViewStateMode = ViewStateMode.Enabled;
-#endif
}
#endregion
_pageTheme.SetPage (this);
}
}
-#if NET_4_0
public Control AutoPostBackControl {
get { return _autoPostBackControl; }
set { _autoPostBackControl = value; }
htmlHeader.Keywords = value;
}
}
-#endif
[Localizable (true)]
[Bindable (true)]
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
_appCulture = Thread.CurrentThread.CurrentCulture;
_appUICulture = Thread.CurrentThread.CurrentUICulture;
FrameworkInitialize ();
-#if NET_4_0
frameworkInitialized = true;
-#endif
context.ErrorPage = _errorPage;
try {
string eventTarget = postdata [postEventSourceID];
IPostBackEventHandler target;
if (String.IsNullOrEmpty (eventTarget)) {
-#if NET_4_0
target = AutoPostBackControl as IPostBackEventHandler;
if (target != null)
RaisePostBackEvent (target, null);
else
-#endif
if (formPostedRequiresRaiseEvent != null)
RaisePostBackEvent (formPostedRequiresRaiseEvent, null);
else
}
target = FindControl (eventTarget, true) as IPostBackEventHandler;
-#if NET_4_0
if (target == null)
target = AutoPostBackControl as IPostBackEventHandler;
-#endif
if (target == null)
return;
object viewState = null;
if (EnableViewState
-#if NET_4_0
&& this.ViewStateMode == ViewStateMode.Enabled
-#endif
)
viewState = SaveViewStateRecursive ();
htmlHeader.Title = _title;
_title = null;
}
-#if NET_4_0
if (_metaDescription != null) {
htmlHeader.Description = _metaDescription;
_metaDescription = null;
htmlHeader.Keywords = _metaKeywords;
_metaKeywords = null;
}
-#endif
}
[EditorBrowsable (EditorBrowsableState.Never)]
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public sealed class PageParser : TemplateControlParser
{
-#if NET_4_0
static Type defaultPageBaseType;
static Type defaultApplicationBaseType;
static Type defaultPageParserFilterType;
static Type defaultUserControlBaseType;
static bool enableLongStringsAsResources = true;
-#endif
PagesEnableSessionState enableSessionState = PagesEnableSessionState.True;
bool enableViewStateMac;
bool enableViewStateMacSet;
MainDirectiveAttribute <string> masterPage;
MainDirectiveAttribute <string> title;
MainDirectiveAttribute <string> theme;
-#if NET_4_0
MainDirectiveAttribute <string> metaDescription;
MainDirectiveAttribute <string> metaKeywords;
-#endif
string culture;
string uiculture;
string errorPage;
int maxPageStateFieldLength = -1;
Type previousPageType;
string previousPageVirtualPath;
-#if NET_4_0
public static bool EnableLongStringsAsResources {
get { return enableLongStringsAsResources; }
set {
defaultUserControlBaseType = value;
}
}
-#endif
public PageParser ()
{
LoadConfigDefaults ();
enableViewStateMac = GetBool (atts, "EnableViewStateMac", enableViewStateMac);
enableViewStateMacSet = true;
}
-#if NET_4_0
value = GetString (atts, "MetaDescription", null);
if (value != null) {
if (!BaseParser.IsExpression (value))
else
metaKeywords = new MainDirectiveAttribute <string> (value);
}
-#endif
// Ignored by now
GetString (atts, "SmartNavigation", null);
internal TraceMode TraceMode {
get { return tracemode; }
}
-#if NET_4_0
internal override Type DefaultBaseType {
get {
Type ret = DefaultPageBaseType;
return ret;
}
}
-#endif
internal override string DefaultBaseTypeName {
get { return PagesConfig.PageBaseType; }
}
internal MainDirectiveAttribute <string> Theme {
get { return theme; }
}
-#if NET_4_0
internal MainDirectiveAttribute <string> MetaDescription {
get { return metaDescription; }
}
internal MainDirectiveAttribute <string> MetaKeywords {
get { return metaKeywords; }
}
-#endif
internal string Culture {
get { return culture; }
}
public int Duration {
get { return duration; }
}
-#if NET_4_0
public string ProviderName {
get; set;
}
-#endif
public string VaryByParams {
get { return varyByParams; }
}
{
// this.sqlDependency = sqlDependency;
}
-#if NET_4_0
public StaticPartialCachingControl (string ctrlID, string guid, int duration, string varyByParams,
string varyByControls, string varyByCustom, string sqlDependency,
BuildMethod buildMethod, string providerName)
{
ProviderName = providerName;
}
-#endif
[MonoTODO("Consider sqlDependency parameter")]
public static void BuildCachedControl (Control parent, string ctrlID, string guid,
int duration, string varyByParams, string varyByControls, string varyByCustom,
{
BuildCachedControl (parent, ctrlID, guid, duration, varyByParams, varyByControls, varyByCustom, null, buildMethod);
}
-#if NET_4_0
public static void BuildCachedControl (Control parent, string ctrlID, string guid, int duration,
string varyByParams, string varyByControls, string varyByCustom,
string sqlDependency, BuildMethod buildMethod, string providerName)
if (parent != null)
parent.Controls.Add (ctl);
}
-#endif
internal override Control CreateControl()
{
return buildMethod ();
bool autoEventWireup = true;
bool enableViewState = true;
CompilationMode compilationMode = CompilationMode.Always;
-#if NET_4_0
ClientIDMode? clientIDMode;
-#endif
TextReader reader;
protected TemplateControlParser ()
}
atts.Remove ("TargetSchema"); // Ignored
-#if NET_4_0
value = GetString (atts, "ClientIDMode", null);
if (!String.IsNullOrEmpty (value)) {
try {
ThrowParseException ("Invalid value of the ClientIDMode attribute.", ex);
}
}
-#endif
base.ProcessMainAttributes (atts);
}
internal CompilationMode CompilationMode {
get { return compilationMode; }
}
-#if NET_4_0
internal ClientIDMode? ClientIDMode {
get { return clientIDMode; }
}
-#endif
internal override TextReader Reader {
get { return reader; }
set { reader = value; }
internal Type PageParserFilterType {
get {
if (pageParserFilterType == null) {
-#if NET_4_0
pageParserFilterType = PageParser.DefaultPageParserFilterType;
if (pageParserFilterType != null)
return pageParserFilterType;
-#endif
string typeName = PagesConfig.PageParserFilterType;
if (String.IsNullOrEmpty (typeName))
return null;
return pageParserFilterType;
}
}
-#if NET_4_0
internal virtual
-#else
- internal
-#endif
Type DefaultBaseType {
get {
Type type = Type.GetType (DefaultBaseTypeName, true);
internal class UserControlParser : TemplateControlParser
{
string masterPage;
-#if NET_4_0
string providerName;
-#endif
internal UserControlParser (VirtualPath virtualPath, string inputFile, HttpContext context)
: this (virtualPath, inputFile, context, null)
{
base.ProcessMainAttributes (atts);
}
-#if NET_4_0
internal override void ProcessOutputCacheAttributes (IDictionary atts)
{
providerName = GetString (atts, "ProviderName", null);
return ret;
}
}
-#endif
internal override string DefaultBaseTypeName {
get { return PagesConfig.UserControlBaseType; }
}
internal string MasterPageFile {
get { return masterPage; }
}
-#if NET_4_0
internal string ProviderName {
get { return providerName; }
}
-#endif
}
}
namespace System.Web.Util
{
-#if NET_4_0
public
-#endif
class HttpEncoder
{
static char [] hexChars = "0123456789abcdef".ToCharArray ();
static object entitiesLock = new object ();
static SortedDictionary <string, char> entities;
-#if NET_4_0
static Lazy <HttpEncoder> defaultEncoder;
static Lazy <HttpEncoder> currentEncoderLazy;
-#else
- static HttpEncoder defaultEncoder;
-#endif
static HttpEncoder currentEncoder;
static IDictionary <string, char> Entities {
public static HttpEncoder Current {
get {
-#if NET_4_0
if (currentEncoder == null)
currentEncoder = currentEncoderLazy.Value;
-#endif
return currentEncoder;
}
-#if NET_4_0
set {
if (value == null)
throw new ArgumentNullException ("value");
currentEncoder = value;
}
-#endif
}
public static HttpEncoder Default {
get {
-#if NET_4_0
return defaultEncoder.Value;
-#else
- return defaultEncoder;
-#endif
}
}
static HttpEncoder ()
{
-#if NET_4_0
defaultEncoder = new Lazy <HttpEncoder> (() => new HttpEncoder ());
currentEncoderLazy = new Lazy <HttpEncoder> (new Func <HttpEncoder> (GetCustomEncoderFromConfig));
-#else
- defaultEncoder = new HttpEncoder ();
- currentEncoder = defaultEncoder;
-#endif
}
public HttpEncoder ()
{
}
-#if NET_4_0
protected internal virtual
-#else
- internal static
-#endif
void HeaderNameValueEncode (string headerName, string headerValue, out string encodedHeaderName, out string encodedHeaderValue)
{
if (String.IsNullOrEmpty (headerName))
return input;
}
-#if NET_4_0
protected internal virtual void HtmlAttributeEncode (string value, TextWriter output)
{
return Activator.CreateInstance (t, false) as HttpEncoder;
#endif
}
-#endif
-#if NET_4_0
protected internal virtual
-#else
- internal static
-#endif
string UrlPathEncode (string value)
{
if (String.IsNullOrEmpty (value))
for (int i = 0; i < s.Length; i++) {
char c = s [i];
if (c == '&' || c == '"' || c == '<' || c == '>' || c > 159
-#if NET_4_0
|| c == '\''
-#endif
) {
needEncode = true;
break;
case '"' :
output.Append (""");
break;
-#if NET_4_0
case '\'':
output.Append ("'");
break;
-#endif
case '\uff1c':
output.Append ("<");
break;
internal static string HtmlAttributeEncode (string s)
{
-#if NET_4_0
if (String.IsNullOrEmpty (s))
return String.Empty;
-#else
- if (s == null)
- return null;
-
- if (s.Length == 0)
- return String.Empty;
-#endif
bool needEncode = false;
for (int i = 0; i < s.Length; i++) {
char c = s [i];
if (c == '&' || c == '"' || c == '<'
-#if NET_4_0
|| c == '\''
-#endif
) {
needEncode = true;
break;
case '<':
output.Append ("<");
break;
-#if NET_4_0
case '\'':
output.Append ("'");
break;
-#endif
default:
output.Append (ch);
break;
if (s.IndexOf ('&') == -1)
return s;
-#if NET_4_0
StringBuilder rawEntity = new StringBuilder ();
-#endif
StringBuilder entity = new StringBuilder ();
StringBuilder output = new StringBuilder ();
int len = s.Length;
if (state == 0) {
if (c == '&') {
entity.Append (c);
-#if NET_4_0
rawEntity.Append (c);
-#endif
state = 1;
} else {
output.Append (c);
state = 3;
}
entity.Append (c);
-#if NET_4_0
rawEntity.Append (c);
-#endif
}
} else if (state == 2) {
entity.Append (c);
output.Append (key);
state = 0;
entity.Length = 0;
-#if NET_4_0
rawEntity.Length = 0;
-#endif
}
} else if (state == 3) {
if (c == ';') {
-#if NET_4_0
if (number == 0)
output.Append (rawEntity.ToString () + ";");
else
-#endif
if (number > 65535) {
output.Append ("&#");
output.Append (number.ToString (Helpers.InvariantCulture));
}
state = 0;
entity.Length = 0;
-#if NET_4_0
rawEntity.Length = 0;
-#endif
have_trailing_digits = false;
} else if (is_hex_value && Uri.IsHexDigit(c)) {
number = number * 16 + Uri.FromHex(c);
have_trailing_digits = true;
-#if NET_4_0
rawEntity.Append (c);
-#endif
} else if (Char.IsDigit (c)) {
number = number * 10 + ((int) c - '0');
have_trailing_digits = true;
-#if NET_4_0
rawEntity.Append (c);
-#endif
} else if (number == 0 && (c == 'x' || c == 'X')) {
is_hex_value = true;
-#if NET_4_0
rawEntity.Append (c);
-#endif
} else {
state = 2;
if (have_trailing_digits) {
internal static bool NotEncoded (char c)
{
return (c == '!' || c == '(' || c == ')' || c == '*' || c == '-' || c == '.' || c == '_'
-#if !NET_4_0
- || c == '\''
-#endif
);
}
sa = TripleDES.Create ();
break;
default:
-#if NET_4_0
if (name.StartsWith ("alg:")) {
sa = SymmetricAlgorithm.Create (name.Substring (4));
break;
}
-#endif
throw new ConfigurationErrorsException ();
}
return sa;
case MachineKeyValidation.SHA1:
kha = new HMACSHA1 ();
break;
-#if NET_4_0
case MachineKeyValidation.HMACSHA256:
kha = new HMACSHA256 ();
break;
if (algo.StartsWith ("alg:"))
kha = KeyedHashAlgorithm.Create (algo.Substring (4));
break;
-#endif
}
return kha;
}
{
}
-#if NET_4_0
public virtual string GetOutputCacheProviderName (HttpContext context)
{
// LAMESPEC: doesn't throw ProviderException if context is null
return OutputCache.DefaultProviderName;
}
-#endif
public virtual string GetVaryByCustomString (HttpContext context, string custom)
{
Delegate eventHandler;
if (stop_processing)
yield return true;
-#if NET_4_0
HttpRequest req = context.Request;
if (req != null)
req.Validate ();
-#endif
context.MapRequestHandlerDone = false;
StartTimer ("BeginRequest");
eventHandler = Events [BeginRequestEvent];
if (!File.Exists (app_file))
app_file = null;
}
-#if NET_4_0
BuildManager.CallPreStartMethods ();
BuildManager.CompilingTopLevelAssemblies = true;
-#endif
AppResourcesCompiler ac = new AppResourcesCompiler (context);
ac.Compile ();
if (Directory.Exists (app_browsers_path)) {
app_browsers_files = Directory.GetFiles (app_browsers_path, "*.browser");
}
-#if NET_4_0
BuildManager.CompilingTopLevelAssemblies = false;
-#endif
app_type = BuildManager.GetPrecompiledApplicationType ();
if (app_type == null && app_file != null) {
app_type = BuildManager.GetCompiledType ("~/" + Path.GetFileName (app_file));
{
Dictionary <string, bool> encodings;
-#if NET_4_0
public
-#else
- internal
-#endif
HttpCacheVaryByContentEncodings ()
{
encodings = new Dictionary <string, bool> ();
Hashtable fields;
-#if NET_4_0
public
-#else
- internal
-#endif
HttpCacheVaryByHeaders ()
{
/* the field names are meant to be case insensitive */
bool ignore_parms;
Hashtable parms;
-#if NET_4_0
public
-#else
- internal
-#endif
HttpCacheVaryByParams ()
{
/* the parameter names are meant to be case insensitive */
WorkerRequest = wr;
request = new HttpRequest (WorkerRequest, this);
response = new HttpResponse (WorkerRequest, this);
-#if NET_4_0
SessionStateBehavior = SessionStateBehavior.Default;
-#endif
}
public HttpContext (HttpRequest request, HttpResponse response)
this.response = response;
this.request.Context = this;
this.response.Context = this;
-#if NET_4_0
SessionStateBehavior = SessionStateBehavior.Default;
-#endif
}
internal bool IsProcessingInclude {
req.QueryStringRaw = queryString;
}
-#if NET_4_0
public void SetSessionStateBehavior (SessionStateBehavior sessionStateBehavior)
{
SessionStateBehavior = sessionStateBehavior;
}
-#endif
#region internals
internal void SetSession (HttpSessionState state)
}
}
-#if NET_4_0
internal SessionStateBehavior SessionStateBehavior {
get;
private set;
}
-#endif
void TimeoutReached(object state) {
HttpRuntime.QueuePendingRequest (false);
return pageTemplate;
}
}
-#if NET_4_0
public
-#else
- internal
-#endif
int WebEventCode
{
get { return webEventCode; }
string encName, encValue;
if (HeaderCheckingEnabled) {
-#if NET_4_0
HttpEncoder.Current.HeaderNameValueEncode (name, value, out encName, out encValue);
-#else
- HttpEncoder.HeaderNameValueEncode (name, value, out encName, out encValue);
-#endif
} else {
encName = name;
encValue = value;
using System.Web.Util;
using System.Globalization;
-#if NET_4_0
using System.Security.Authentication.ExtendedProtection;
using System.Web.Routing;
-#endif
namespace System.Web
{
bool checked_cookies, checked_query_string, checked_form;
static readonly UrlMappingCollection urlMappings;
readonly static char [] queryTrimChars = {'?'};
-#if NET_4_0
bool lazyFormValidation;
bool lazyQueryStringValidation;
bool inputValidationEnabled;
return chars;
}
-#endif
static HttpRequest ()
{
urlMappings = null;
}
-#if NET_4_0
Version validationMode = HttpRuntime.Section.RequestValidationMode;
if (validationMode >= new Version (4, 0)) {
if (!String.IsNullOrEmpty (invalidChars))
RequestPathInvalidCharacters = CharsFromList (invalidChars);
}
-#endif
} catch {
// unlikely to happen
}
public HttpBrowserCapabilities Browser {
get {
if (browser_capabilities == null)
-#if NET_4_0
browser_capabilities = HttpCapabilitiesBase.BrowserCapabilitiesProvider.GetBrowserCapabilities (this);
-#else
- browser_capabilities = (HttpBrowserCapabilities)
- HttpCapabilitiesBase.GetConfigCapabilities (null, this);
-#endif
return browser_capabilities;
}
}
bool needValidation = validate_cookies;
-#if NET_4_0
needValidation |= validateRequestNewMode;
-#endif
if (needValidation && !checked_cookies) {
// Setting this before calling the validator prevents
// possible endless recursion
return FilePath;
}
}
-#if NET_4_0
public string CurrentExecutionFilePathExtension {
get { return global::System.IO.Path.GetExtension (CurrentExecutionFilePath); }
}
-#endif
public string AppRelativeCurrentExecutionFilePath {
get {
return VirtualPathUtility.ToAppRelative (CurrentExecutionFilePath);
public NameValueCollection Form {
get {
NameValueCollection form = FormUnvalidated;
-#if NET_4_0
if (validateRequestNewMode && !checked_form) {
if (!lazyFormValidation) {
// Setting this before calling the validator prevents
ValidateNameValueCollection ("Form", form, RequestValidationSource.Form);
}
} else
-#endif
if (validate_form && !checked_form){
checked_form = true;
ValidateNameValueCollection ("Form", form);
get {
if (headers == null) {
headers = HeadersNoValidation;
-#if NET_4_0
if (validateRequestNewMode) {
RequestValidator validator = RequestValidator.Current;
int validationFailureIndex;
ThrowValidationException ("Headers", hkey, value);
}
}
-#endif
}
return headers;
} catch {}
}
}
-#if NET_4_0
public RequestContext RequestContext {
get {
if (requestContext == null)
// TODO: explicitly support the async methods if there is a convenient way of doing it
//
}
-#endif
public Stream InputStream {
get {
if (input_stream == null)
get {
if (unescaped_path == null) {
unescaped_path = PathNoValidation;
-#if NET_4_0
if (validateRequestNewMode) {
RequestValidator validator = RequestValidator.Current;
int validationFailureIndex;
if (!validator.IsValidRequestString (HttpContext.Current, unescaped_path, RequestValidationSource.Path, null, out validationFailureIndex))
ThrowValidationException ("Path", "Path", unescaped_path);
}
-#endif
}
return unescaped_path;
get {
if (path_info == null) {
path_info = PathInfoNoValidation;
-#if NET_4_0
if (validateRequestNewMode) {
RequestValidator validator = RequestValidator.Current;
int validationFailureIndex;
if (!validator.IsValidRequestString (HttpContext.Current, path_info, RequestValidationSource.PathInfo, null, out validationFailureIndex))
ThrowValidationException ("PathInfo", "PathInfo", path_info);
}
-#endif
}
return path_info;
public NameValueCollection QueryString {
get {
NameValueCollection query_string_nvc = QueryStringUnvalidated;
-#if NET_4_0
if (validateRequestNewMode && !checked_query_string) {
if (!lazyQueryStringValidation) {
// Setting this before calling the validator prevents
ValidateNameValueCollection ("QueryString", query_string_nvc, RequestValidationSource.QueryString);
}
} else
-#endif
if (validate_query_string && !checked_query_string) {
// Setting this before calling the validator prevents
// possible endless recursion
get {
if (raw_url == null) {
raw_url = RawUrlUnvalidated;
-#if NET_4_0
if (validateRequestNewMode) {
RequestValidator validator = RequestValidator.Current;
int validationFailureIndex;
if (!validator.IsValidRequestString (HttpContext.Current, raw_url, RequestValidationSource.RawUrl, null, out validationFailureIndex))
ThrowValidationException ("RawUrl", "RawUrl", raw_url);
}
-#endif
}
return raw_url;
validate_cookies = true;
validate_query_string = true;
validate_form = true;
-#if NET_4_0
inputValidationEnabled = true;
-#endif
}
-#if NET_4_0
internal void Validate ()
{
var cfg = HttpRuntime.Section;
if (validateRequestNewMode)
ValidateInput ();
}
-#endif
#region internal routines
internal string ClientTarget {
get {
string path = UrlComponents.Path;
UrlComponents.Path = path + PathInfo;
}
-#if NET_4_0
internal void SetFormCollection (WebROCollection coll, bool lazyValidation)
{
if (coll == null)
query_string_nvc = coll;
lazyQueryStringValidation = lazyValidation;
}
-#endif
// Headers is ReadOnly, so we need this hack for cookie-less sessions.
internal void SetHeader (string name, string value)
{
ThrowValidationException (name, key, val);
}
}
-#if NET_4_0
static void ValidateNameValueCollection (string name, NameValueCollection coll, RequestValidationSource source)
{
if (coll == null)
{
throw new PlatformNotSupportedException ("This method is not supported.");
}
-#endif
static void ValidateCookieCollection (HttpCookieCollection cookies)
{
if (cookies == null)
int size = cookies.Count;
HttpCookie cookie;
-#if NET_4_0
RequestValidator validator = RequestValidator.Current;
int validationFailureIndex;
HttpContext context = HttpContext.Current;
-#endif
bool invalid;
for (int i = 0 ; i < size ; i++) {
string name = cookie.Name;
if (!String.IsNullOrEmpty (value)) {
-#if NET_4_0
if (validateRequestNewMode)
invalid = !validator.IsValidRequestString (context, value, RequestValidationSource.Cookies, name, out validationFailureIndex);
else
-#endif
invalid = IsInvalidString (value);
if (invalid)
throw new HttpRequestValidationException (msg);
}
-#if NET_4_0
internal static void ValidateString (string key, string value, RequestValidationSource source)
{
if (String.IsNullOrEmpty (value))
if (IsInvalidString (value, out ignore))
ThrowValidationException (source.ToString (), key, value);
}
-#endif
internal static bool IsInvalidString (string val)
{
#pragma warning disable 219
using System.Web.Hosting;
using System.Web.SessionState;
-#if NET_4_0
using System.Web.Routing;
-#endif
namespace System.Web
{
get {
return writer;
}
-#if NET_4_0
set { writer = value; }
-#endif
}
public Stream OutputStream {
{
Redirect (url, endResponse, 302);
}
-#if NET_4_0
public void RedirectPermanent (string url)
{
RedirectPermanent (url, true);
OutputCache.RemoveFromProvider (path, providerName);
}
-#endif
public static void RemoveOutputCacheItem (string path)
{
if (path == null)
if (path [0] != '/')
throw new ArgumentException ("'" + path + "' is not an absolute virtual path.");
-#if NET_4_0
RemoveOutputCacheItem (path, OutputCache.DefaultProviderName);
-#else
- HttpContext context = HttpContext.Current;
- HttpApplication app_instance = context != null ? context.ApplicationInstance : null;
- HttpModuleCollection modules = app_instance != null ? app_instance.Modules : null;
- OutputCacheModule ocm = modules != null ? modules.Get ("OutputCache") as OutputCacheModule : null;
- OutputCacheProvider internalProvider = ocm != null ? ocm.InternalProvider : null;
- if (internalProvider == null)
- return;
-
- internalProvider.Remove (path);
-#endif
}
public void SetCookie (HttpCookie cookie)
public void Write (char ch)
{
TextWriter writer = Output;
-#if NET_4_0
// Emulating .NET
if (writer == null)
throw new NullReferenceException (".NET 4.0 emulation. A null value was found where an object was required.");
-#endif
writer.Write (ch);
}
public void Write (object obj)
{
TextWriter writer = Output;
-#if NET_4_0
// Emulating .NET
if (writer == null)
throw new NullReferenceException (".NET 4.0 emulation. A null value was found where an object was required.");
-#endif
if (obj == null)
return;
public void Write (string s)
{
TextWriter writer = Output;
-#if NET_4_0
// Emulating .NET
if (writer == null)
throw new NullReferenceException (".NET 4.0 emulation. A null value was found where an object was required.");
-#endif
writer.Write (s);
}
public void Write (char [] buffer, int index, int count)
{
TextWriter writer = Output;
-#if NET_4_0
// Emulating .NET
if (writer == null)
throw new NullReferenceException (".NET 4.0 emulation. A null value was found where an object was required.");
-#endif
writer.Write (buffer, index, count);
}
get { return headerValue; }
set {
string hname, hvalue;
-#if NET_4_0
HttpEncoder.Current.HeaderNameValueEncode (null, value, out hname, out hvalue);
-#else
- HttpEncoder.HeaderNameValueEncode (null, value, out hname, out hvalue);
-#endif
headerValue = hvalue;
}
}
get { return headerName; }
set {
string hname, hvalue;
-#if NET_4_0
HttpEncoder.Current.HeaderNameValueEncode (value, null, out hname, out hvalue);
-#else
- HttpEncoder.HeaderNameValueEncode (value, null, out hname, out hvalue);
-#endif
headerName = hname;
}
}
public static void HtmlAttributeEncode (string s, TextWriter output)
{
if (output == null) {
-#if NET_4_0
throw new ArgumentNullException ("output");
-#else
- throw new NullReferenceException (".NET emulation");
-#endif
}
-#if NET_4_0
HttpEncoder.Current.HtmlAttributeEncode (s, output);
-#else
- output.Write (HttpEncoder.HtmlAttributeEncode (s));
-#endif
}
public static string HtmlAttributeEncode (string s)
{
-#if NET_4_0
if (s == null)
return null;
HttpEncoder.Current.HtmlAttributeEncode (s, sw);
return sw.ToString ();
}
-#else
- return HttpEncoder.HtmlAttributeEncode (s);
-#endif
}
public static string UrlDecode (string str)
{
if (bytes == null)
return null;
-#if NET_4_0
return HttpEncoder.Current.UrlEncode (bytes, offset, count);
-#else
- return HttpEncoder.UrlEncodeToBytes (bytes, offset, count);
-#endif
}
public static string UrlEncodeUnicode (string str)
/// <returns>The decoded text.</returns>
public static string HtmlDecode (string s)
{
-#if NET_4_0
if (s == null)
return null;
HttpEncoder.Current.HtmlDecode (s, sw);
return sw.ToString ();
}
-#else
- return HttpEncoder.HtmlDecode (s);
-#endif
}
/// <summary>
public static void HtmlDecode(string s, TextWriter output)
{
if (output == null) {
-#if NET_4_0
throw new ArgumentNullException ("output");
-#else
- throw new NullReferenceException (".NET emulation");
-#endif
}
if (!String.IsNullOrEmpty (s)) {
-#if NET_4_0
HttpEncoder.Current.HtmlDecode (s, output);
-#else
- output.Write (HttpEncoder.HtmlDecode (s));
-#endif
}
}
public static string HtmlEncode (string s)
{
-#if NET_4_0
if (s == null)
return null;
HttpEncoder.Current.HtmlEncode (s, sw);
return sw.ToString ();
}
-#else
- return HttpEncoder.HtmlEncode (s);
-#endif
}
/// <summary>
public static void HtmlEncode(string s, TextWriter output)
{
if (output == null) {
-#if NET_4_0
throw new ArgumentNullException ("output");
-#else
- throw new NullReferenceException (".NET emulation");
-#endif
}
if (!String.IsNullOrEmpty (s)) {
-#if NET_4_0
HttpEncoder.Current.HtmlEncode (s, output);
-#else
- output.Write (HttpEncoder.HtmlEncode (s));
-#endif
}
}
-#if NET_4_0
public static string HtmlEncode (object value)
{
if (value == null)
return sb.ToString ();
}
-#endif
public static string UrlPathEncode (string s)
{
-#if NET_4_0
return HttpEncoder.Current.UrlPathEncode (s);
-#else
- return HttpEncoder.UrlPathEncode (s);
-#endif
}
public static NameValueCollection ParseQueryString (string query)
namespace System.Web
{
-#if !NET_4_0
- [AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal),
- AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-#endif
public interface IPartitionResolver
{
void Initialize ();
namespace System.Xml {
-#if NET_4_0
public enum DtdProcessing
{
Prohibit = 0,
Ignore = 1,
Parse = 2
}
-#endif
}
namespace System.Xml {
[Flags]
-#if NET_4_0
public
-#else
- internal
-#endif
enum NamespaceHandling {
Default,
OmitDuplicates = 1,
#endif
-#if NET_4_0
public static bool IsNCNameChar (char ch)
{
return XmlChar.IsNCNameChar (ch);
return content;
throw new XmlException (string.Format ("Invalid XML character was found in the content, at index {0}.", idx));
}
-#endif
}
}
get { return implementation; }
}
-#if NET_4_0
public override string InnerText {
set { throw new InvalidOperationException (); }
}
-#endif
public override string InnerXml {
get {
get { return AttributeCount > 0; }
}
-#if NET_4_0
public virtual bool HasValue {
get {
switch (NodeType) {
return false;
}
}
-#else
- public abstract bool HasValue { get; }
-#endif
public abstract bool IsEmptyElement { get; }
return xvr != null ? xvr : reader;
}
-#if NET_4_0
public void Dispose ()
-#else
- void IDisposable.Dispose()
-#endif
{
Dispose (true);
}
private XsValidationFlags validationFlags;
private ValidationType validationType;
private XmlResolver xmlResolver;
-#if NET_4_0
private DtdProcessing dtdProcessing;
-#endif
private long maxCharactersFromEntities;
private long maxCharactersInDocument;
get { return conformance; }
set { conformance = value; }
}
-#if NET_4_0
public DtdProcessing DtdProcessing {
get { return dtdProcessing; }
set {
prohibitDtd = (value == DtdProcessing.Prohibit);
}
}
-#endif
public long MaxCharactersFromEntities {
get { return maxCharactersFromEntities; }
set { maxCharactersFromEntities = value; }
set { linePositionOffset = value; }
}
-#if NET_4_0
[ObsoleteAttribute("Use DtdProcessing property instead")]
-#endif
public bool ProhibitDtd {
get { return prohibitDtd; }
set { prohibitDtd = value; }
get { return entity != null ? ReadState.Interactive : source.ReadState; }
}
-#if NET_4_0
[MonoTODO]
public DtdProcessing DtdProcessing { get; set; }
-#endif
#if !NET_4_5
public override XmlReaderSettings Settings {
Close ();
}
-#if NET_4_0
public void Dispose ()
-#else
- void IDisposable.Dispose()
-#endif
{
Dispose (false);
}
//set { outputMethod = value; }
}
-#if NET_4_0
public
-#else
- internal
-#endif
NamespaceHandling NamespaceHandling { get; set; }
#if NET_4_5
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
namespace System.Xml.Linq
OmitDuplicateNamespaces = 1
}
}
-#endif
{
None = 0,
DisableFormatting = 1,
-#if NET_4_0
OmitDuplicateNamespaces = 2
-#endif
}
}
XmlWriterSettings s = new XmlWriterSettings ();
if ((options & SaveOptions.DisableFormatting) == SaveOptions.None)
s.Indent = true;
-#if NET_4_0
if ((options & SaveOptions.OmitDuplicateNamespaces) == SaveOptions.OmitDuplicateNamespaces)
s.NamespaceHandling |= NamespaceHandling.OmitDuplicates;
-#endif
using (XmlWriter w = XmlWriter.Create (fileName, s)) {
Save (w);
XmlWriterSettings s = new XmlWriterSettings ();
if ((options & SaveOptions.DisableFormatting) == SaveOptions.None)
s.Indent = true;
-#if NET_4_0
if ((options & SaveOptions.OmitDuplicateNamespaces) == SaveOptions.OmitDuplicateNamespaces)
s.NamespaceHandling |= NamespaceHandling.OmitDuplicates;
-#endif
using (XmlWriter w = XmlWriter.Create (textWriter, s)) {
Save (w);
}
throw new InvalidOperationException ("An element cannot be added before the document type declaration");
}
}
-#if NET_4_0
public void Save (Stream stream)
{
Save (stream, SaveOptions.None);
}
}
-#endif
}
}
}
}
-#if NET_4_0
public static XElement Load (Stream stream)
{
return Load (stream, LoadOptions.None);
return LoadCore (r, options);
}
}
-#endif
internal static XElement LoadCore (XmlReader r, LoadOptions options)
{
if ((options & SaveOptions.DisableFormatting) == SaveOptions.None)
s.Indent = true;
-#if NET_4_0
if ((options & SaveOptions.OmitDuplicateNamespaces) == SaveOptions.OmitDuplicateNamespaces)
s.NamespaceHandling |= NamespaceHandling.OmitDuplicates;
-#endif
using (XmlWriter w = XmlWriter.Create (fileName, s)) {
Save (w);
}
if ((options & SaveOptions.DisableFormatting) == SaveOptions.None)
s.Indent = true;
-#if NET_4_0
if ((options & SaveOptions.OmitDuplicateNamespaces) == SaveOptions.OmitDuplicateNamespaces)
s.NamespaceHandling |= NamespaceHandling.OmitDuplicates;
-#endif
using (XmlWriter w = XmlWriter.Create (textWriter, s)) {
Save (w);
}
WriteTo (writer);
}
-#if NET_4_0
public void Save (Stream stream)
{
Save (stream, SaveOptions.None);
Save (writer);
}
}
-#endif
public IEnumerable <XElement> AncestorsAndSelf ()
{
return GetAncestorList (null, true);
return new XNodeReader (this);
}
-#if NET_4_0
public XmlReader CreateReader (ReaderOptions readerOptions)
{
var r = new XNodeReader (this);
return r;
}
-#endif
public IEnumerable<XElement> ElementsAfterSelf ()
{
start = node;
}
-#if NET_4_0
internal bool OmitDuplicateNamespaces { get; set; }
-#endif
int IXmlLineInfo.LineNumber {
get {
if ((options & SaveOptions.DisableFormatting) == SaveOptions.None)
s.Indent = true;
-#if NET_4_0
if ((options & SaveOptions.OmitDuplicateNamespaces) == SaveOptions.OmitDuplicateNamespaces)
s.NamespaceHandling |= NamespaceHandling.OmitDuplicates;
-#endif
using (XmlWriter w = XmlWriter.Create (textWriter, s))
WriteTo (w);
}
-#if NET_4_0
public void Save (Stream stream)
{
Save (stream, SaveOptions.None);
WriteTo (writer);
}
}
-#endif
public override string ToString ()
{
mcsOutput = new StringCollection ();
mcsOutMutex = new Mutex ();
-#if !NET_4_0
- /*
- * !:. KLUDGE WARNING .:!
- *
- * When running the 2.0 test suite some assemblies will invoke mcs via
- * CodeDOM and the new mcs process will find the MONO_PATH variable in its
- * environment pointing to the net_2_0 library which will cause the runtime
- * to attempt to load the 2.0 corlib into 4.0 process and thus mcs will
- * fail. At the same time, we must not touch MONO_PATH when running outside
- * the test suite, thus the kludge.
- *
- * !:. KLUDGE WARNING .:!
- */
- if (Environment.GetEnvironmentVariable ("MONO_TESTS_IN_PROGRESS") != null) {
- string monoPath = Environment.GetEnvironmentVariable ("MONO_PATH");
- if (!String.IsNullOrEmpty (monoPath)) {
- const string basePath = "/class/lib/";
- const string profile = "net_2_0";
- var basePathIndex = monoPath.IndexOf (basePath, StringComparison.Ordinal);
- if (basePathIndex > 0 && basePathIndex + basePath.Length + profile.Length <= monoPath.Length) {
- var currentProfile = monoPath.Substring (basePathIndex + basePath.Length, profile.Length);
- if (currentProfile.Equals (profile, StringComparison.OrdinalIgnoreCase))
- monoPath = monoPath.Replace (basePath + currentProfile, basePath + "net_4_0");
- }
- mcs.StartInfo.EnvironmentVariables ["MONO_PATH"] = monoPath;
- }
- }
-#endif
/*
string monoPath = Environment.GetEnvironmentVariable ("MONO_PATH");
if (monoPath != null)
string langver;
if (!providerOptions.TryGetValue ("CompilerVersion", out langver))
-#if NET_4_0
langver = "3.5";
-#else
- langver = "2.0";
-#endif
if (langver.Length >= 1 && langver [0] == 'v')
langver = langver.Substring (1);
#if NET_4_5
args.Append("/sdk:4.5");
-#elif NET_4_0
- args.Append("/sdk:4");
#else
- args.Append("/sdk:2");
+ args.Append("/sdk:4");
#endif
args.Append (" -- ");
CompilerInfo ci = GetCompilerInfo (language);
return (ci == null) ? null : ci.CreateProvider ();
}
-#if NET_4_0
[ComVisible (false)]
public static CodeDomProvider CreateProvider (string language, IDictionary<string, string> providerOptions)
{
CompilerInfo ci = GetCompilerInfo (language);
return ci == null ? null : ci.CreateProvider (providerOptions);
}
-#endif
#endif
public virtual string CreateValidIdentifier (string value)
[ConfigurationCollection (typeof (Compiler), AddItemName = "compiler", CollectionType = ConfigurationElementCollectionType.BasicMap)]
internal sealed class CompilerCollection : ConfigurationElementCollection
{
-#if NET_4_0
static readonly string defaultCompilerVersion = "3.5";
-#else
- static readonly string defaultCompilerVersion = "2.0";
-#endif
static ConfigurationPropertyCollection properties;
static List <CompilerInfo> compiler_infos;
static Dictionary <string, CompilerInfo> compiler_languages;
return CreateProvider (ProviderOptions);
}
-#if NET_4_0
public
-#endif
CodeDomProvider CreateProvider (IDictionary<string, string> providerOptions)
{
Type providerType = CodeDomProviderType;
}
}
-#if NET_4_0
[Obsolete]
-#endif
public Evidence Evidence {
get { return evidence; }
[SecurityPermission (SecurityAction.Demand, ControlEvidence = true)]
}
}
-#if NET_4_0
[Obsolete]
-#endif
public Evidence Evidence {
get { return evidence; }
[SecurityPermission (SecurityAction.Demand, ControlEvidence = true)]
// Marek Safar (marek.safar@gmail.com)
//
-#if NET_4_0
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
}
}
}
-#endif
// Chris Toshok (toshok@novell.com)
// Brian O'Keefe (zer0keefie@gmail.com)
//
-#if NET_4_0
using System.Collections.Specialized;
using System.ComponentModel;
using System.Runtime.CompilerServices;
}
}
-#endif
// Chris Toshok (toshok@ximian.com)
//
-#if NET_4_0
using System.Runtime.CompilerServices;
namespace System.Collections.Specialized {
}
}
-#endif
// Authors:
// Chris Toshok (toshok@ximian.com)
//
-#if NET_4_0
using System.Runtime.CompilerServices;
namespace System.Collections.Specialized
}
}
-#endif
// Chris Toshok (toshok@ximian.com)
// Brian O'Keefe (zer0keefie@gmail.com)
//
-#if NET_4_0
using System.Runtime.CompilerServices;
namespace System.Collections.Specialized
#endregion
}
}
-#endif
// Authors:
// Chris Toshok (toshok@ximian.com)
//
-#if NET_4_0
using System.Runtime.CompilerServices;
namespace System.Collections.Specialized
public delegate void NotifyCollectionChangedEventHandler (object sender, NotifyCollectionChangedEventArgs e);
}
-#endif
using System;
-#if NET_4_0
namespace System.Diagnostics.CodeAnalysis {
}
}
-#endif
TraceImpl.Assert (condition, message, detailMessage);
}
-#if NET_4_0
[Conditional ("DEBUG")]
public static void Assert (bool condition, string message,
string detailMessageFormat, params object [] args)
message,
string.Format (detailMessageFormat, args));
}
-#endif
[Conditional("DEBUG")]
public static void Close ()
TraceImpl.WriteLine (message);
}
-#if NET_4_0
[Conditional("DEBUG")]
public static void WriteLine (string format, params object [] args)
{
TraceImpl.WriteLine (string.Format (format, args));
}
-#endif
[Conditional("DEBUG")]
public static void WriteLine (object value, string category)
is_running = false;
}
-#if NET_4_0
public void Restart ()
{
started = GetTimestamp ();
elapsed = 0;
is_running = true;
}
-#endif
}
}
get { return (string) base ["targetName"]; }
set { base ["targetName"] = value; }
}
-#if NET_4_0
[ConfigurationPropertyAttribute("enableSsl", DefaultValue = false)]
public bool EnableSsl {
get { return (bool) base ["enableSsl"]; }
set { base ["enableSsl"] = value; }
}
-#endif
protected override ConfigurationPropertyCollection Properties {
// what to do here?
get { return base.Properties; }
set { priority = value; }
}
-#if NET_4_0
public
-#else
- internal
-#endif
Encoding HeadersEncoding {
get { return headersEncoding; }
set { headersEncoding = value; }
}
-#if NET_4_0
public
-#else
- internal
-#endif
MailAddressCollection ReplyToList {
get { return replyTo; }
}
-#if NET_4_0
[Obsolete ("Use ReplyToList instead")]
-#endif
public MailAddress ReplyTo {
get {
if (replyTo.Count == 0)
namespace System.Net.Mail {
public class SmtpClient
-#if NET_4_0
: IDisposable
-#endif
{
#region Fields
if (cfg != null) {
this.host = cfg.Network.Host;
this.port = cfg.Network.Port;
-#if NET_4_0
this.enableSsl = cfg.Network.EnableSsl;
-#endif
TargetName = cfg.Network.TargetName;
if (this.TargetName == null)
TargetName = "SMTPSVC/" + (host != null ? host : "");
}
#endif
-#if NET_4_0
public
-#endif
string TargetName { get; set; }
public ICredentialsByHost Credentials {
#endregion // Events
#region Methods
-#if NET_4_0
public void Dispose ()
{
Dispose (true);
{
// TODO: We should close all the connections and abort any async operations here
}
-#endif
private void CheckState ()
{
if (messageInProcess != null)
if (message.ReplyToList.Count > 0)
SendHeader ("Reply-To", EncodeAddresses (message.ReplyToList));
-#if NET_4_0
foreach (string s in message.Headers.AllKeys)
SendHeader (s, ContentType.EncodeSubjectRFC2047 (message.Headers [s], message.HeadersEncoding));
-#else
- foreach (string s in message.Headers.AllKeys)
- SendHeader (s, message.Headers [s]);
-#endif
AddPriorityHeader (message);
int in_progress;
internal Socket.Worker Worker;
EndPoint remote_ep;
-#if NET_4_0
public Exception ConnectByNameError { get; internal set; }
-#endif
public event EventHandler<SocketAsyncEventArgs> Completed;
public SocketFlags SocketFlags { get; set; }
public object UserToken { get; set; }
internal Socket curSocket;
-#if (NET_2_1 || NET_4_0)
public Socket ConnectSocket {
get {
switch (SocketError) {
{
PolicyRestricted = policy;
}
-#endif
public SocketAsyncEventArgs ()
{
}
}
-#if NET_4_0
public void Dispose ()
-#else
- void IDisposable.Dispose ()
-#endif
{
Dispose (true);
GC.SuppressFinalize (this);
bool GetCheckedIPs (SocketAsyncEventArgs e, out IPAddress [] addresses)
{
addresses = null;
-#if NET_4_0
// Connect to the first address that match the host name, like:
// http://blogs.msdn.com/ncl/archive/2009/07/20/new-ncl-features-in-net-4-0-beta-2.aspx
// while skipping entries that do not match the address family
e.ConnectByNameError = null;
return false;
}
-#else
- return false; // < NET_4_0 -> use remote endpoint
-#endif
}
bool ConnectAsyncReal (SocketAsyncEventArgs e)
{
bool use_remoteep = true;
-#if NET_4_0
IPAddress [] addresses = null;
use_remoteep = !GetCheckedIPs (e, out addresses);
-#endif
e.curSocket = this;
Worker w = e.Worker;
w.Init (this, e, SocketOperation.Connect);
result.EndPoint = e.RemoteEndPoint;
ares = BeginConnect (e.RemoteEndPoint, SocketAsyncEventArgs.Dispatcher, e);
}
-#if NET_4_0
else {
DnsEndPoint dep = (e.RemoteEndPoint as DnsEndPoint);
ares = BeginConnect (addresses, dep.Port, SocketAsyncEventArgs.Dispatcher, e);
}
-#endif
if (ares.IsCompleted && ares.CompletedSynchronously) {
((SocketAsyncResult) ares).CheckIfThrowDelayedException ();
return false;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System.Net.Sockets;
}
}
-#endif
GC.SuppressFinalize (this); \r
}\r
\r
-#if NET_4_0\r
protected override\r
-#endif \r
void Dispose (bool disposing)\r
{\r
if (this.disposed)\r
fileStream = null;\r
if (stream != null)\r
stream.Close (); // also closes webRequest\r
-#if NET_4_0\r
base.Dispose (disposing);\r
-#endif\r
}\r
\r
private void CheckDisposed ()\r
using System.IO;
using System.Security.Cryptography.X509Certificates;
using System.Text;
-#if NET_4_0
using System.Security.Authentication.ExtendedProtection;
-#endif
#if NET_4_5
using System.Threading.Tasks;
#endif
namespace System.Net {
public sealed class HttpListenerRequest
{
-#if NET_4_0
class Context : TransportContext
{
public override ChannelBinding GetChannelBinding (ChannelBindingKind kind)
throw new NotImplementedException ();
}
}
-#endif
string [] accept_types;
Encoding content_encoding;
return context.Connection.ClientCertificate;
}
-#if NET_4_0
[MonoTODO]
public string ServiceName {
get {
return new Context ();
}
}
-#endif
#if NET_4_5
[MonoTODO]
get { return credentials; }
set { credentials = value; }
}
-#if NET_4_0
public DateTime Date {
get {
string date = webHeaders ["Date"];
webHeaders.RemoveAndAdd ("Date", value.ToUniversalTime ().ToString ("r", CultureInfo.InvariantCulture));
}
}
-#endif
#if !NET_2_1
[MonoTODO]
}
}
-#if NET_4_0
public
-#else
- internal
-#endif
string Host {
get {
if (host == null)
internal ServicePoint ServicePointNoLock {
get { return servicePoint; }
}
-#if NET_4_0
public virtual bool SupportsCookieContainer {
get {
// The managed implementation supports the cookie container
return true;
}
}
-#endif
public override int Timeout {
get { return timeout; }
set {
{
AddRange (rangeSpecifier, (long) from, (long) to);
}
-#if NET_4_0
public
-#else
- internal
-#endif
void AddRange (long range)
{
AddRange ("bytes", (long) range);
}
-#if NET_4_0
public
-#else
- internal
-#endif
void AddRange (long from, long to)
{
AddRange ("bytes", from, to);
}
-#if NET_4_0
public
-#else
- internal
-#endif
void AddRange (string rangeSpecifier, long range)
{
if (rangeSpecifier == null)
webHeaders.RemoveAndAdd ("Range", r);
}
-#if NET_4_0
public
-#else
- internal
-#endif
void AddRange (string rangeSpecifier, long from, long to)
{
if (rangeSpecifier == null)
{
if (writeStream == null || writeStream.RequestWritten || !InternalAllowBuffering)
return false;
- #if NET_4_0
if (contentLength < 0 && writeStream.CanWrite == true && writeStream.WriteBufferLength < 0)
return false;
if (contentLength < 0 && writeStream.WriteBufferLength >= 0)
InternalContentLength = writeStream.WriteBufferLength;
- #else
- if (contentLength < 0 && writeStream.CanWrite == true)
- return false;
- #endif
// This will write the POST/PUT if the write stream already has the expected
// amount of bytes in it (ContentLength) (bug #77753) or if the write stream
Dispose (true);
}
-#if NET_4_0
protected override void Dispose (bool disposing)
{
this.disposed = true;
base.Dispose (true);
}
-#else
- void Dispose (bool disposing)
- {
- this.disposed = true;
- if (disposing)
- Close ();
- }
-#endif
private void CheckDisposed ()
{
}
}
-#if NET_4_0
public bool IsIPv6Teredo {
get {
return m_Family != AddressFamily.InterNetwork &&
m_Numbers[1] == 0;
}
}
-#endif
public long ScopeId {
get {
string password;
string domain;
-#if NET_4_0
SecureString securePassword;
-#endif
// Constructors
public NetworkCredential ()
this.domain = domain;
}
-#if NET_4_0
public NetworkCredential (string userName, SecureString password)
{
this.userName = userName;
{
this.domain = domain;
}
-#endif
// Properties
public string Domain {
set { password = value; }
}
-#if NET_4_0
public SecureString SecurePassword {
get { return securePassword; }
set {
}
}
}
-#endif
public NetworkCredential GetCredential (Uri uri, string authType)
{
throw new ArgumentNullException ("requestUri");
return GetCreator (requestUri.Scheme).Create (requestUri);
}
-#if NET_4_0
static HttpWebRequest SharedCreateHttp (Uri uri)
{
if (uri.Scheme != "http" && uri.Scheme != "https")
throw new ArgumentNullException ("requestUri");
return SharedCreateHttp (requestUri);
}
-#endif
public virtual Stream EndGetRequestStream (IAsyncResult asyncResult)
{
throw GetMustImplement ();
public virtual Uri ResponseUri { \r
get { throw new NotSupportedException (); }\r
} \r
-#if NET_4_0\r
\r
public virtual bool SupportsHeaders {\r
get {\r
return true;\r
}\r
}\r
-#endif\r
// Methods\r
\r
public virtual void Close()\r
{\r
throw new NotSupportedException ();\r
}\r
-#if NET_4_0\r
public void Dispose ()\r
-#else\r
- void IDisposable.Dispose()\r
-#endif\r
{\r
-#if NET_4_0\r
Dispose (true);\r
-#else\r
- Close ();\r
-#endif\r
}\r
\r
-#if NET_4_0\r
protected virtual void Dispose (bool disposing)\r
{\r
if (disposing)\r
Close ();\r
}\r
-#endif\r
\r
void ISerializable.GetObjectData\r
(SerializationInfo serializationInfo,\r
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
\r
-#if NET_4_0\r
using System;\r
using System.IO;\r
using System.Runtime.Serialization;\r
}\r
}\r
}\r
-#endif\r
using System;
using System.Text;
-#if NET_4_0
namespace System.Runtime.Versioning
{
[Serializable]
}
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using Microsoft.Win32.SafeHandles;
}
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
namespace System.Security.Authentication.ExtendedProtection
{
Endpoint
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.Collections;
using System.ComponentModel;
}
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.ComponentModel;
using System.Globalization;
}
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
namespace System.Security.Authentication.ExtendedProtection
{
Always
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
namespace System.Security.Authentication.ExtendedProtection
{
TrustedProxy
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.Collections;
}
}
-#endif
namespace System.Security.Cryptography.X509Certificates {
-#if NET_4_0
[Serializable]
-#endif
public class X509Certificate2 : X509Certificate {
#if !SECURITY_DEP
// Used in Mono.Security HttpsClientStream
}
} else {
path = baseEl.path;
-#if !NET_4_0
- if (relativeEl.query != null) {
- var pathEnd = path.LastIndexOf ('/');
- path = (pathEnd > 0)? path.Substring (0, pathEnd+1) : "";
- }
-#endif
}
if ((path.Length == 0 || path [0] != '/') && baseEl.delimiter == SchemeDelimiter)
//
public Uri MakeRelativeUri (Uri uri)
{
-#if NET_4_0
if (uri == null)
throw new ArgumentNullException ("uri");
-#endif
if (Host != uri.Host || Scheme != uri.Scheme)
return uri;
public bool IsBaseOf (Uri uri)
{
-#if NET_4_0
if (uri == null)
throw new ArgumentNullException ("uri");
-#endif
return Parser.IsBaseOf (this, uri);
}
result = null;
if ((baseUri == null) || !baseUri.IsAbsoluteUri)
return false;
-#if NET_4_0
if (relativeUri == null)
return false;
-#endif
try {
// FIXME: this should call UriParser.Resolve
result = new Uri (baseUri, relativeUri.OriginalString);
public UriBuilder (Uri uri)
{
-#if NET_4_0
if (uri == null)
throw new ArgumentNullException ("uri");
-#endif
Initialize (uri);
}
{
}
-#if NET_4_0
public UriFormatException (string textString, Exception e)
: base (textString, e)
{
}
-#endif
protected UriFormatException (SerializationInfo serializationInfo, StreamingContext streamingContext)
: base (serializationInfo, streamingContext)
{
if (invalidUnescape
-#if !NET_4_0
- && uriFormat == UriFormat.SafeUnescaped && char.IsControl (x)
-#endif
) {
s.Append (c);
i = iStart;
return HexEscapeMultiByte (c);
if (isEscaped && (
-#if NET_4_0
(userEscaped && c < 0xFF) ||
-#endif
!NeedToUnescape (c, scheme, component, uriKind, uriFormat, formatFlags))) {
if (IriParsing &&
(c == '<' || c == '>' || c == '^' || c == '{' || c == '|' || c == '}' || c > 0x7F) &&
// THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.Data.Common;
}
}
-#endif
// THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.Linq;
}
}
-#endif
// THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.Dynamic;
}
}
-#endif
// Marek Safar (marek.safar@gmail.com)
//
-#if NET_4_0
using System.Collections.ObjectModel;
using System.Runtime.CompilerServices;
[assembly:TypeForwardedTo (typeof (ObservableCollection<>))]
-#else
-
-using System.Collections.Generic;
-using System.Collections.Specialized;
-using System.ComponentModel;
-
-namespace System.Collections.ObjectModel
-{
- [Serializable]
- public class ObservableCollection<T> : Collection<T>, INotifyCollectionChanged, INotifyPropertyChanged {
- [Serializable]
- sealed class SimpleMonitor : IDisposable {
- private int _busyCount;
-
- public SimpleMonitor()
- {
- }
-
- public void Enter()
- {
- _busyCount++;
- }
-
- public void Dispose()
- {
- _busyCount--;
- }
-
- public bool Busy
- {
- get { return _busyCount > 0; }
- }
- }
-
- private SimpleMonitor _monitor = new SimpleMonitor ();
-
- public ObservableCollection()
- {
- }
-
- public ObservableCollection(IEnumerable<T> collection)
- {
- if (collection == null)
- throw new ArgumentNullException ("collection");
-
- foreach (var item in collection)
- Add (item);
- }
-
- public ObservableCollection(List<T> list)
- : base (list != null ? new List<T> (list) : null)
- {
- }
-
- [field:NonSerialized]
- public virtual event NotifyCollectionChangedEventHandler CollectionChanged;
- [field:NonSerialized]
- protected virtual event PropertyChangedEventHandler PropertyChanged;
-
- event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged {
- add { this.PropertyChanged += value; }
- remove { this.PropertyChanged -= value; }
- }
-
- protected IDisposable BlockReentrancy ()
- {
- _monitor.Enter ();
- return _monitor;
- }
-
- protected void CheckReentrancy ()
- {
- NotifyCollectionChangedEventHandler eh = CollectionChanged;
-
- // Only have a problem if we have more than one event listener.
- if (_monitor.Busy && eh != null && eh.GetInvocationList ().Length > 1)
- throw new InvalidOperationException ("Cannot modify the collection while reentrancy is blocked.");
- }
-
- protected override void ClearItems ()
- {
- CheckReentrancy ();
-
- base.ClearItems ();
-
- OnCollectionChanged (new NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction.Reset));
- OnPropertyChanged (new PropertyChangedEventArgs ("Count"));
- OnPropertyChanged (new PropertyChangedEventArgs ("Item[]"));
- }
-
- protected override void InsertItem (int index, T item)
- {
- CheckReentrancy ();
-
- base.InsertItem (index, item);
-
- OnCollectionChanged (new NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction.Add, item, index));
- OnPropertyChanged (new PropertyChangedEventArgs ("Count"));
- OnPropertyChanged (new PropertyChangedEventArgs ("Item[]"));
- }
-
- public void Move (int oldIndex, int newIndex)
- {
- MoveItem (oldIndex, newIndex);
- }
-
- protected virtual void MoveItem (int oldIndex, int newIndex)
- {
- CheckReentrancy ();
-
- T item = Items [oldIndex];
- base.RemoveItem (oldIndex);
- base.InsertItem (newIndex, item);
-
- OnCollectionChanged (new NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction.Move, item, newIndex, oldIndex));
- OnPropertyChanged (new PropertyChangedEventArgs ("Item[]"));
- }
-
- protected virtual void OnCollectionChanged (NotifyCollectionChangedEventArgs e)
- {
- NotifyCollectionChangedEventHandler eh = CollectionChanged;
-
- if (eh != null) {
- // Make sure that the invocation is done before the collection changes,
- // Otherwise there's a chance of data corruption.
- using (BlockReentrancy ()) {
- eh (this, e);
- }
- }
- }
-
- protected virtual void OnPropertyChanged (PropertyChangedEventArgs e)
- {
- PropertyChangedEventHandler eh = PropertyChanged;
-
- if (eh != null)
- eh (this, e);
- }
-
- protected override void RemoveItem (int index)
- {
- CheckReentrancy ();
-
- T item = Items [index];
-
- base.RemoveItem (index);
-
- OnCollectionChanged (new NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction.Remove, item, index));
- OnPropertyChanged (new PropertyChangedEventArgs ("Count"));
- OnPropertyChanged (new PropertyChangedEventArgs ("Item[]"));
- }
-
- protected override void SetItem (int index, T item)
- {
- CheckReentrancy ();
-
- T oldItem = Items [index];
-
- base.SetItem (index, item);
-
- OnCollectionChanged (new NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction.Replace, item, oldItem, index));
- OnPropertyChanged (new PropertyChangedEventArgs ("Item[]"));
- }
- }
-}
-#endif
// Brian O'Keefe (zer0keefie@gmail.com)
//
-#if NET_4_0
using System.Collections.ObjectModel;
using System.Runtime.CompilerServices;
[assembly:TypeForwardedTo (typeof (ReadOnlyObservableCollection<>))]
-#else
-
-using System.Collections.Specialized;
-using System.ComponentModel;
-
-namespace System.Collections.ObjectModel {
- public class ReadOnlyObservableCollection<T> : ReadOnlyCollection<T>, INotifyCollectionChanged, INotifyPropertyChanged {
-
- public ReadOnlyObservableCollection(ObservableCollection<T> list)
- : base (list)
- {
- ((INotifyPropertyChanged)list).PropertyChanged += SourceCollection_PropertyChanged;
- ((INotifyCollectionChanged)list).CollectionChanged += SourceCollection_CollectionChanged;
- }
-
- protected virtual event NotifyCollectionChangedEventHandler CollectionChanged;
-
- protected virtual event PropertyChangedEventHandler PropertyChanged;
-
- event NotifyCollectionChangedEventHandler INotifyCollectionChanged.CollectionChanged {
- add { this.CollectionChanged += value; }
- remove { this.CollectionChanged -= value; }
- }
-
- event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged {
- add { this.PropertyChanged += value; }
- remove { this.PropertyChanged -= value; }
- }
-
- protected virtual void OnCollectionChanged (NotifyCollectionChangedEventArgs args)
- {
- NotifyCollectionChangedEventHandler eh = CollectionChanged;
-
- if (eh != null)
- eh (this, args);
- }
-
- protected virtual void OnPropertyChanged (PropertyChangedEventArgs args)
- {
- PropertyChangedEventHandler eh = PropertyChanged;
-
- if (eh != null)
- eh (this, args);
- }
-
- private void SourceCollection_CollectionChanged (object sender, NotifyCollectionChangedEventArgs e)
- {
- OnCollectionChanged (e);
- }
-
- private void SourceCollection_PropertyChanged (object sender, PropertyChangedEventArgs e)
- {
- OnPropertyChanged (e);
- }
- }
-
-}
-#endif
// Chris Toshok (toshok@ximian.com)
//
-#if NET_4_0
using System.Collections.Specialized;
using System.Runtime.CompilerServices;
[assembly:TypeForwardedTo (typeof (INotifyCollectionChanged))]
-#else
-
-using System;
-
-namespace System.Collections.Specialized {
-
- public interface INotifyCollectionChanged {
-
- event NotifyCollectionChangedEventHandler CollectionChanged;
- }
-
-}
-#endif
// Chris Toshok (toshok@ximian.com)
//
-#if NET_4_0
using System.Collections.Specialized;
using System.Runtime.CompilerServices;
[assembly:TypeForwardedTo (typeof (NotifyCollectionChangedAction))]
-#else
-
-using System;
-
-namespace System.Collections.Specialized {
-
- public enum NotifyCollectionChangedAction {
- Add,
- Remove,
- Replace,
- Move,
- Reset
- }
-
-}
-#endif
// Brian O'Keefe (zer0keefie@gmail.com)
//
-#if NET_4_0
using System.Collections.Specialized;
using System.Runtime.CompilerServices;
[assembly:TypeForwardedTo (typeof (NotifyCollectionChangedEventArgs))]
-#else
-
-namespace System.Collections.Specialized {
- public class NotifyCollectionChangedEventArgs : EventArgs {
- private NotifyCollectionChangedAction action;
- private IList oldItems, newItems;
- private int oldIndex = -1, newIndex = -1;
-
- #region Constructors
-
- public NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction action)
- {
- this.action = action;
-
- if (action != NotifyCollectionChangedAction.Reset)
- throw new ArgumentException ("This constructor can only be used with the Reset action.", "action");
- }
-
- public NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction action, IList changedItems)
- : this (action, changedItems, -1)
- {
- }
-
- public NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction action, object changedItem)
- : this (action, changedItem, -1)
- {
- }
-
- public NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction action, IList newItems, IList oldItems)
- : this (action, newItems, oldItems, -1)
- {
- }
-
- public NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction action, IList changedItems, int startingIndex)
- {
- this.action = action;
-
- if (action == NotifyCollectionChangedAction.Add || action == NotifyCollectionChangedAction.Remove) {
- if (changedItems == null)
- throw new ArgumentNullException ("changedItems");
-
- if (startingIndex < -1)
- throw new ArgumentException ("The value of startingIndex must be -1 or greater.", "startingIndex");
-
- if (action == NotifyCollectionChangedAction.Add)
- InitializeAdd (changedItems, startingIndex);
- else
- InitializeRemove (changedItems, startingIndex);
- } else if (action == NotifyCollectionChangedAction.Reset) {
- if (changedItems != null)
- throw new ArgumentException ("This constructor can only be used with the Reset action if changedItems is null", "changedItems");
-
- if (startingIndex != -1)
- throw new ArgumentException ("This constructor can only be used with the Reset action if startingIndex is -1", "startingIndex");
- } else {
- throw new ArgumentException ("This constructor can only be used with the Reset, Add, or Remove actions.", "action");
- }
- }
-
- public NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction action, object changedItem, int index)
- {
- IList changedItems = new object [] { changedItem };
- this.action = action;
-
- if (action == NotifyCollectionChangedAction.Add)
- InitializeAdd (changedItems, index);
- else if (action == NotifyCollectionChangedAction.Remove)
- InitializeRemove (changedItems, index);
- else if (action == NotifyCollectionChangedAction.Reset) {
- if (changedItem != null)
- throw new ArgumentException ("This constructor can only be used with the Reset action if changedItem is null", "changedItem");
-
- if (index != -1)
- throw new ArgumentException ("This constructor can only be used with the Reset action if index is -1", "index");
- } else {
- throw new ArgumentException ("This constructor can only be used with the Reset, Add, or Remove actions.", "action");
- }
- }
-
- public NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction action, object newItem, object oldItem)
- : this (action, newItem, oldItem, -1)
- {
- }
-
- public NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction action, IList newItems, IList oldItems, int index)
- {
- this.action = action;
-
- if (action != NotifyCollectionChangedAction.Replace)
- throw new ArgumentException ("This constructor can only be used with the Replace action.", "action");
-
- if (newItems == null)
- throw new ArgumentNullException ("newItems");
-
- if (oldItems == null)
- throw new ArgumentNullException ("oldItems");
-
- this.oldItems = oldItems;
- this.newItems = newItems;
-
- oldIndex = index;
- newIndex = index;
- }
-
- public NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction action, IList changedItems, int index, int oldIndex)
- {
- this.action = action;
-
- if (action != NotifyCollectionChangedAction.Move)
- throw new ArgumentException ("This constructor can only be used with the Move action.", "action");
-
- if (index < -1)
- throw new ArgumentException ("The value of index must be -1 or greater.", "index");
-
- InitializeMove (changedItems, index, oldIndex);
- }
-
- public NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction action, object changedItem, int index, int oldIndex)
- : this (action, new object [] { changedItem }, index, oldIndex)
- {
- }
-
- public NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction action, object newItem, object oldItem, int index)
- {
- this.action = action;
-
- if (action != NotifyCollectionChangedAction.Replace)
- throw new ArgumentException ("This constructor can only be used with the Replace action.", "action");
-
- InitializeReplace (new object [] { newItem }, new object [] { oldItem }, index);
- }
-
- #endregion
-
- #region Accessor Properties
-
- public NotifyCollectionChangedAction Action {
- get { return action; }
- }
-
- public IList NewItems {
- get { return newItems; }
- }
-
- public int NewStartingIndex {
- get { return newIndex; }
- }
-
- public IList OldItems {
- get { return oldItems; }
- }
-
- public int OldStartingIndex {
- get { return oldIndex; }
- }
-
- #endregion
-
- #region Initialize Methods
-
- private void InitializeAdd(IList items, int index)
- {
- this.newItems = ArrayList.ReadOnly (items);
- this.newIndex = index;
- }
-
- private void InitializeRemove(IList items, int index)
- {
- this.oldItems = ArrayList.ReadOnly (items);
- this.oldIndex = index;
- }
-
- private void InitializeMove(IList changedItems, int newItemIndex, int oldItemIndex)
- {
- InitializeAdd (changedItems, newItemIndex);
- InitializeRemove (changedItems, oldItemIndex);
- }
-
- private void InitializeReplace(IList addedItems, IList removedItems, int index)
- {
- InitializeAdd (addedItems, index);
- InitializeRemove (removedItems, index);
- }
-
- #endregion
- }
-}
-#endif
// Chris Toshok (toshok@ximian.com)
//
-#if NET_4_0
using System.Collections.Specialized;
using System.Runtime.CompilerServices;
[assembly:TypeForwardedTo (typeof (NotifyCollectionChangedEventHandler))]
-#else
-
-using System;
-
-namespace System.Collections.Specialized {
-
- public delegate void NotifyCollectionChangedEventHandler (object sender, NotifyCollectionChangedEventArgs e);
-
-}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
namespace System.ComponentModel
{
}
}
-#endif
-#if !NET_4_0
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (c) 2008 Novell, Inc. (http://www.novell.com)
-//
-// Author:
-// Chris Toshok (toshok@ximian.com)
-//
-
-namespace System.Windows.Markup {
-
- [AttributeUsage (AttributeTargets.Property)]
- public class AmbientAttribute : Attribute {
- }
-}
-#endif
-#if !NET_4_0
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (c) 2008 Novell, Inc. (http://www.novell.com)
-//
-// Authors:
-// Chris Toshok (toshok@ximian.com)
-//
-
-using System;
-
-namespace System.Windows.Markup {
-
- [AttributeUsage (AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
- public sealed class ConstructorArgumentAttribute : Attribute
- {
- public ConstructorArgumentAttribute (string argumentName)
- {
- this.argumentName = argumentName;
- }
-
- public string ArgumentName {
- get { return argumentName; }
- }
-
- string argumentName;
- }
-
-}
-#endif
-#if !NET_4_0
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (c) 2007 Novell, Inc. (http://www.novell.com)
-//
-// Authors:
-// Chris Toshok (toshok@ximian.com)
-//
-
-using System;
-
-namespace System.Windows.Markup {
-
- [AttributeUsage (AttributeTargets.Class)]
- public sealed class ContentPropertyAttribute : Attribute
- {
- string name;
-
- public ContentPropertyAttribute ()
- {
- }
-
- public ContentPropertyAttribute (string name)
- {
- this.name = name;
- }
-
- public string Name {
- get { return name; }
- }
- }
-}
-#endif
-#if !NET_4_0
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (c) 2008 Novell, Inc. (http://www.novell.com)
-//
-// Authors:
-// Chris Toshok (toshok@ximian.com)
-//
-
-using System;
-
-namespace System.Windows.Markup {
-
- [AttributeUsage (AttributeTargets.Property, AllowMultiple = true, Inherited = true)]
- public sealed class ContentWrapperAttribute : Attribute
- {
- public ContentWrapperAttribute (Type contentWrapper)
- {
- this.contentWrapper = contentWrapper;
- }
-
- public Type ContentWrapper {
- get { return contentWrapper; }
- }
-
- public override object TypeId {
- get { return this; }
- }
-
- public override bool Equals (object obj)
- {
- if (obj is ContentWrapperAttribute) {
- if (((ContentWrapperAttribute)obj).ContentWrapper == contentWrapper)
- return true;
- }
-
- return false;
- }
-
- public override int GetHashCode ()
- {
- throw new NotImplementedException ();
- }
-
- Type contentWrapper;
- }
-
-}
-#endif
-#if !NET_4_0
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (c) 2007 Novell, Inc. (http://www.novell.com)
-//
-// Authors:
-// Chris Toshok (toshok@ximian.com)
-//
-
-using System;
-using System.Globalization;
-
-namespace System.Windows.Markup {
-
- public class DateTimeValueSerializer : ValueSerializer
- {
- public override bool CanConvertFromString (string value, IValueSerializerContext context)
- {
- // seems to return for any value
- return true;
- }
-
- public override bool CanConvertToString (object value, IValueSerializerContext context)
- {
- if (!(value is DateTime))
- throw new ArgumentException ("Can only convert objects of type 'DateTime'");
-
- return true;
- }
-
- public override object ConvertFromString (string value, IValueSerializerContext context)
- {
- if (value == null)
- throw new NotSupportedException ("DateTimeValueSerializer cannot convert from null value.");
- return DateTime.Parse (value);
- }
-
- public override string ConvertToString (object value, IValueSerializerContext context)
- {
- if (value == null)
- throw new NotSupportedException ("Cannot convert null value to string.");
-
- if (!(value is DateTime))
- throw new NotSupportedException ("only objects of type 'DateTime' can be converted.");
-
- return ((DateTime)value).ToString("s", CultureInfo.InvariantCulture);
- }
- }
-
-}
-#endif
-#if !NET_4_0
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (c) 2008 Novell, Inc. (http://www.novell.com)
-//
-// Authors:
-// Chris Toshok (toshok@ximian.com)
-//
-
-using System;
-
-namespace System.Windows.Markup {
-
- [AttributeUsage (AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = true)]
- public sealed class DependsOnAttribute : Attribute
- {
- public DependsOnAttribute (string name)
- {
- this.name = name;
- }
-
- public string Name {
- get { return name; }
- }
-
- public override object TypeId {
- get { return this; }
- }
-
- string name;
- }
-
-}
-#endif
-#if !NET_4_0
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (c) 2008 Novell, Inc. (http://www.novell.com)
-//
-// Author:
-// Chris Toshok (toshok@ximian.com)
-//
-
-using System;
-
-namespace System.Windows.Markup {
-
- [AttributeUsage (AttributeTargets.Class)]
- public class DictionaryKeyPropertyAttribute : Attribute {
- public DictionaryKeyPropertyAttribute (string name)
- {
- Name = name;
- }
-
- public string Name {
- get; private set;
- }
- }
-}
-#endif
-#if !NET_4_0
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (c) 2008 Novell, Inc. (http://www.novell.com)
-//
-// Authors:
-// Chris Toshok (toshok@ximian.com)
-//
-
-using System;
-
-namespace System.Windows.Markup {
-
- public interface IComponentConnector {
- void Connect (int connectionId, object target);
-
- void InitializeComponent ();
- }
-}
-#endif
-#if !NET_4_0
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (c) 2008 Novell, Inc. (http://www.novell.com)
-//
-// Authors:
-// Chris Toshok (toshok@ximian.com)
-//
-
-using System;
-
-namespace System.Windows.Markup {
-
- public interface INameScope {
- object FindName (string name);
-
- void RegisterName (string name, object scopedElement);
- void UnregisterName (string name);
- }
-}
-#endif
-#if !NET_4_0
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (c) 2008 Novell, Inc. (http://www.novell.com)
-//
-// Authors:
-// Chris Toshok (toshok@ximian.com)
-//
-
-using System;
-using System.ComponentModel;
-
-namespace System.Windows.Markup {
-
- public interface IValueSerializerContext : ITypeDescriptorContext, IServiceProvider {
- ValueSerializer GetValueSerializerFor (PropertyDescriptor descriptor);
- ValueSerializer GetValueSerializerFor (Type type);
- }
-}
-#endif
-#if !NET_4_0
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (c) 2008 Novell, Inc. (http://www.novell.com)
-//
-// Authors:
-// Chris Toshok (toshok@ximian.com)
-//
-
-using System;
-
-namespace System.Windows.Markup {
-
- public interface IXamlTypeResolver {
- Type Resolve (string qualifiedTypeName);
- }
-}
-#endif
-#if !NET_4_0
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (c) 2007 Novell, Inc. (http://www.novell.com)
-//
-// Authors:
-// Chris Toshok (toshok@ximian.com)
-//
-
-using System;
-
-namespace System.Windows.Markup {
-
- public abstract class MarkupExtension
- {
- protected MarkupExtension ()
- {
- }
-
- public abstract object ProvideValue (IServiceProvider serviceProvider);
- }
-}
-#endif
-#if !NET_4_0
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (c) 2008 Novell, Inc. (http://www.novell.com)
-//
-// Authors:
-// Chris Toshok (toshok@ximian.com)
-//
-
-using System;
-
-namespace System.Windows.Markup {
-
- [AttributeUsage (AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
- public sealed class MarkupExtensionReturnTypeAttribute : Attribute
- {
- public MarkupExtensionReturnTypeAttribute ()
- {
- }
-
- public MarkupExtensionReturnTypeAttribute (Type returnType)
- {
- ReturnType = returnType;
- }
-
- public MarkupExtensionReturnTypeAttribute (Type returnType, Type expressionType)
- {
- ReturnType = returnType;
- ExpressionType = expressionType;
- }
-
- public Type ReturnType {
- get;
- private set;
- }
-
- public Type ExpressionType {
- get;
- private set;
- }
- }
-
-}
-#endif
-#if !NET_4_0
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (c) 2008 Novell, Inc. (http://www.novell.com)
-//
-// Author:
-// Chris Toshok (toshok@ximian.com)
-//
-
-using System;
-
-namespace System.Windows.Markup {
-
- [AttributeUsage (AttributeTargets.Class)]
- public class NameScopePropertyAttribute : Attribute {
- public NameScopePropertyAttribute (string name, Type type)
- {
- Name = name;
- Type = type;
- }
-
- public NameScopePropertyAttribute (string name)
- {
- Name = name;
- }
-
- public string Name {
- get;
- private set;
- }
-
- public Type Type {
- get;
- private set;
- }
- }
-
-}
-#endif
-#if !NET_4_0
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (c) 2008 Novell, Inc. (http://www.novell.com)
-//
-// Authors:
-// Chris Toshok (toshok@ximian.com)
-//
-
-using System;
-
-namespace System.Windows.Markup {
-
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class RootNamespaceAttribute : Attribute
- {
- public RootNamespaceAttribute (string nameSpace)
- {
- this.nameSpace = nameSpace;
- }
-
- public string Namespace {
- get { return nameSpace; }
- }
-
- string nameSpace;
- }
-}
-#endif
-#if !NET_4_0
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (c) 2008 Novell, Inc. (http://www.novell.com)
-//
-// Authors:
-// Chris Toshok (toshok@ximian.com)
-//
-
-using System;
-
-namespace System.Windows.Markup {
-
- [AttributeUsage (AttributeTargets.Assembly)]
- public sealed class RuntimeNamePropertyAttribute : Attribute
- {
- public RuntimeNamePropertyAttribute (string name)
- {
- this.name = name;
- }
-
- public string Name {
- get { return name; }
- }
-
- string name;
- }
-}
-#endif
-#if !NET_4_0
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (c) 2008 Novell, Inc. (http://www.novell.com)
-//
-// Authors:
-// Chris Toshok (toshok@ximian.com)
-//
-
-using System;
-
-namespace System.Windows.Markup {
-
- [AttributeUsage (AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
- public sealed class TrimSurroundingWhitespaceAttribute : Attribute
- {
- }
-}
-#endif
-#if !NET_4_0
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (c) 2008 Novell, Inc. (http://www.novell.com)
-//
-// Author:
-// Chris Toshok (toshok@ximian.com)
-//
-
-using System;
-
-namespace System.Windows.Markup {
- [AttributeUsage (AttributeTargets.Class)]
- public class UidDuringInitializationAttribute : Attribute {
- public UidDuringInitializationAttribute (bool usable)
- {
- Usable = usable;
- }
-
- public bool Usable {
- get;
- private set;
- }
- }
-}
-#endif
-#if !NET_4_0
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (c) 2008 Novell, Inc. (http://www.novell.com)
-//
-// Author:
-// Chris Toshok (toshok@ximian.com)
-//
-
-using System;
-
-namespace System.Windows.Markup {
- [AttributeUsage (AttributeTargets.Class)]
- public class UidPropertyAttribute : Attribute {
- public UidPropertyAttribute (string name)
- {
- Name = name;
- }
-
- public string Name {
- get;
- private set;
- }
- }
-}
-#endif
-#if !NET_4_0
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (c) 2008 Novell, Inc. (http://www.novell.com)
-//
-// Author:
-// Chris Toshok (toshok@ximian.com)
-//
-
-using System;
-
-namespace System.Windows.Markup {
- [AttributeUsage (AttributeTargets.Class)]
- public class UsableDuringInitializationAttribute : Attribute {
- public UsableDuringInitializationAttribute (bool usable)
- {
- Usable = usable;
- }
-
- public bool Usable {
- get;
- private set;
- }
- }
-}
-#endif
-#if !NET_4_0
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (c) 2007 Novell, Inc. (http://www.novell.com)
-//
-// Authors:
-// Chris Toshok (toshok@ximian.com)
-//
-
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Windows.Converters;
-
-namespace System.Windows.Markup {
-
- // I don't like the idea of hardcoding the types in here, but
- // I'm not sure what else to do about it..
- class DefaultValueSerializerContext : IValueSerializerContext
- {
- public ValueSerializer GetValueSerializerFor (PropertyDescriptor descriptor)
- {
- Attribute attribute = (Attribute)descriptor.Attributes[typeof (ValueSerializerAttribute)];
- if (attribute != null)
- return (ValueSerializer)Activator.CreateInstance (((ValueSerializerAttribute)attribute).ValueSerializerType);
-
- return GetValueSerializerFor (descriptor.PropertyType);
- }
-
- public ValueSerializer GetValueSerializerFor (Type type)
- {
- Attribute attribute = (Attribute)TypeDescriptor.GetAttributes (type)[typeof (ValueSerializerAttribute)];
- if (attribute != null)
- return (ValueSerializer)Activator.CreateInstance (((ValueSerializerAttribute)attribute).ValueSerializerType);
-
- if (typeof (DateTime).IsAssignableFrom (type))
- return new DateTimeValueSerializer();
- else if (typeof (Int32Rect).IsAssignableFrom (type))
- return new Int32RectValueSerializer ();
- else if (typeof (Point).IsAssignableFrom (type))
- return new PointValueSerializer ();
- else if (typeof (Rect).IsAssignableFrom (type))
- return new RectValueSerializer ();
- else if (typeof (Size).IsAssignableFrom (type))
- return new SizeValueSerializer ();
- else if (typeof (Vector).IsAssignableFrom (type))
- return new VectorValueSerializer ();
- else
- return null;
- }
-
- public void OnComponentChanged ()
- {
- }
-
- public bool OnComponentChanging ()
- {
- return false;
- }
-
- public IContainer Container {
- get { return null; }
- }
-
- public object Instance {
- get { return null; }
- }
-
- public PropertyDescriptor PropertyDescriptor {
- get { return null; }
- }
-
- public object GetService (Type serviceType)
- {
- return null;
- }
- }
-
- public abstract class ValueSerializer
- {
- protected ValueSerializer ()
- {
- }
-
- public virtual bool CanConvertFromString (string value, IValueSerializerContext context)
- {
- throw new NotImplementedException ();
- }
-
- public virtual bool CanConvertToString (object value, IValueSerializerContext context)
- {
- throw new NotImplementedException ();
- }
-
- public virtual object ConvertFromString (string value, IValueSerializerContext context)
- {
- throw new NotImplementedException ();
- }
-
- public virtual string ConvertToString (object value, IValueSerializerContext context)
- {
- throw new NotImplementedException ();
- }
-
- protected Exception GetConvertFromException (object value)
- {
- throw new NotImplementedException ();
- }
-
- protected Exception GetConvertToException (object value, Type destinationType)
- {
- throw new NotImplementedException ();
- }
-
- public virtual IEnumerable<Type> TypeReferences (object value, IValueSerializerContext context)
- {
- throw new NotImplementedException ();
- }
-
- public static ValueSerializer GetSerializerFor (PropertyDescriptor descriptor)
- {
- DefaultValueSerializerContext defaultContext = new DefaultValueSerializerContext();
- return defaultContext.GetValueSerializerFor (descriptor);
- }
-
- public static ValueSerializer GetSerializerFor (Type type)
- {
- DefaultValueSerializerContext defaultContext = new DefaultValueSerializerContext();
- return defaultContext.GetValueSerializerFor (type);
- }
-
- public static ValueSerializer GetSerializerFor (PropertyDescriptor descriptor, IValueSerializerContext context)
- {
- ValueSerializer s = context.GetValueSerializerFor (descriptor);
- if (s == null) {
- DefaultValueSerializerContext defaultContext = new DefaultValueSerializerContext();
- s = defaultContext.GetValueSerializerFor (descriptor);
- }
- return s;
- }
-
- public static ValueSerializer GetSerializerFor (Type type, IValueSerializerContext context)
- {
- ValueSerializer s = context.GetValueSerializerFor (type);
- if (s == null) {
- DefaultValueSerializerContext defaultContext = new DefaultValueSerializerContext();
- s = defaultContext.GetValueSerializerFor (type);
- }
- return s;
- }
- }
-
-}
-#endif
-#if !NET_4_0
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (c) 2008 Novell, Inc. (http://www.novell.com)
-//
-// Authors:
-// Chris Toshok (toshok@ximian.com)
-//
-
-using System;
-
-namespace System.Windows.Markup {
-
- [AttributeUsage (AttributeTargets.Class |
- AttributeTargets.Struct |
- AttributeTargets.Enum |
- AttributeTargets.Method |
- AttributeTargets.Property |
- AttributeTargets.Interface, AllowMultiple = false, Inherited = true)]
- public sealed class ValueSerializerAttribute : Attribute
- {
- public ValueSerializerAttribute (string valueSerializerTypeName)
- {
- valueSerializerType = Type.GetType (valueSerializerTypeName);
- }
-
- public ValueSerializerAttribute (Type valueSerializerType)
- {
- this.valueSerializerType = valueSerializerType;
- }
-
- public Type ValueSerializerType {
- get { return valueSerializerType; }
- }
-
- public string ValueSerializerTypeName {
- get { return valueSerializerType.Name; }
- }
-
- Type valueSerializerType;
- }
-}
-#endif
-#if !NET_4_0
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (c) 2008 Novell, Inc. (http://www.novell.com)
-//
-// Authors:
-// Chris Toshok (toshok@ximian.com)
-//
-
-using System;
-
-namespace System.Windows.Markup {
-
- [AttributeUsage (AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
- public sealed class WhitespaceSignificantCollectionAttribute : Attribute
- {
- }
-}
-#endif
-#if !NET_4_0
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (c) 2008 Novell, Inc. (http://www.novell.com)
-//
-// Authors:
-// Chris Toshok (toshok@ximian.com)
-//
-
-using System;
-
-namespace System.Windows.Markup {
-
- [AttributeUsage (AttributeTargets.Class, AllowMultiple = false)]
- public sealed class XmlLangPropertyAttribute : Attribute
- {
- public XmlLangPropertyAttribute (string name)
- {
- this.name = name;
- }
-
- public string Name {
- get { return name; }
- }
-
- string name;
- }
-}
-#endif
-#if !NET_4_0
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (c) 2008 Novell, Inc. (http://www.novell.com)
-//
-// Authors:
-// Chris Toshok (toshok@ximian.com)
-//
-
-using System;
-
-namespace System.Windows.Markup {
-
- [AttributeUsage (AttributeTargets.Assembly, AllowMultiple = true)]
- public sealed class XmlnsCompatibleWithAttribute : Attribute
- {
- public XmlnsCompatibleWithAttribute (string oldNamespace, string newNamespace)
- {
- this.oldNamespace = oldNamespace;
- this.newNamespace = newNamespace;
- }
-
- public string NewNamespace {
- get { return newNamespace; }
- }
-
- public string OldNamespace {
- get { return oldNamespace; }
- }
-
- string newNamespace;
- string oldNamespace;
- }
-}
-#endif
-#if !NET_4_0
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (c) 2008 Novell, Inc. (http://www.novell.com)
-//
-// Authors:
-// Chris Toshok (toshok@ximian.com)
-//
-
-using System;
-
-namespace System.Windows.Markup {
-
- [AttributeUsage (AttributeTargets.Assembly, AllowMultiple = true)]
- public sealed class XmlnsDefinitionAttribute : Attribute
- {
- public XmlnsDefinitionAttribute (string xmlNamespace, string clrNamespace)
- {
- this.xmlNamespace = xmlNamespace;
- this.clrNamespace = clrNamespace;
- }
-
- public string AssemblyName {
- get { return assemblyName; }
- set { assemblyName = value; }
- }
-
- public string ClrNamespace {
- get { return clrNamespace; }
- }
-
- public string XmlNamespace {
- get { return xmlNamespace; }
- }
-
- string xmlNamespace;
- string clrNamespace;
- string assemblyName;
- }
-}
-#endif
-#if !NET_4_0
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// Copyright (c) 2008 Novell, Inc. (http://www.novell.com)
-//
-// Authors:
-// Chris Toshok (toshok@ximian.com)
-//
-
-using System;
-
-namespace System.Windows.Markup {
-
- [AttributeUsage (AttributeTargets.Assembly, AllowMultiple = true)]
- public sealed class XmlnsPrefixAttribute : Attribute
- {
- public XmlnsPrefixAttribute (string xmlNamespace, string prefix)
- {
- this.xmlNamespace = xmlNamespace;
- this.prefix = prefix;
- }
-
- public string Prefix {
- get { return prefix; }
- }
-
- public string XmlNamespace {
- get { return xmlNamespace; }
- }
-
- string prefix;
- string xmlNamespace;
- }
-}
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.IO;
using System.Runtime.InteropServices;
static extern int RegCloseKey (IntPtr keyHandle);
}
}
-#endif
void SetValue (RegistryKey rkey, string name, object value, RegistryValueKind valueKind);
-#if NET_4_0
RegistryKey CreateSubKey (RegistryKey rkey, string keyname, RegistryOptions options);
RegistryKey FromHandle (SafeRegistryHandle handle);
IntPtr GetHandle (RegistryKey key);
-#endif
}
}
public static readonly RegistryKey CurrentUser = new RegistryKey (
RegistryHive.CurrentUser);
-#if NET_4_0
[Obsolete ("Use PerformanceData instead")]
-#endif
public static readonly RegistryKey DynData = new RegistryKey (
RegistryHive.DynData);
public static readonly RegistryKey LocalMachine = new RegistryKey (
// RegistryKey object
//
object handle;
-#if NET_4_0
SafeRegistryHandle safe_handle;
-#endif
object hive; // the RegistryHive if the key represents a base key
readonly string qname; // the fully qualified registry key name
/// Dispose of registry key object. Close the
/// key if it's still open.
/// </summary>
-#if NET_4_0
public void Dispose ()
-#else
- void IDisposable.Dispose ()
-#endif
{
GC.SuppressFinalize (this);
Close ();
RegistryApi.Close (this);
handle = null;
-#if NET_4_0
safe_handle = null;
-#endif
}
}
}
-#if NET_4_0
[ComVisible (false)]
[MonoTODO ("Not implemented in Unix")]
public SafeRegistryHandle Handle {
return RegistryView.Default;
}
}
-#endif
/// <summary>
return CreateSubKey (subkey);
}
-#if NET_4_0
[ComVisible (false)]
[MonoLimitation ("permissionCheck is ignored in Mono")]
public RegistryKey CreateSubKey (string subkey, RegistryKeyPermissionCheck permissionCheck, RegistryOptions options)
{
return CreateSubKey (subkey, permissionCheck, registryOptions);
}
-#endif
/// <summary>
DeleteSubKeyTree (subkey, true);
}
-#if NET_4_0
public
-#endif
void DeleteSubKeyTree (string subkey, bool throwOnMissingSubKey)
{
// Note: this is done by deleting sub-nodes recursively.
return RegistryApi.GetValueNames (this);
}
-#if NET_4_0
[ComVisible (false)]
[SecurityPermission (SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)]
[MonoTODO ("Not implemented on unix")]
{
return FromHandle (handle);
}
-#endif
[MonoTODO ("Not implemented on unix")]
return RegistryApi.OpenRemoteBaseKey (hKey, machineName);
}
-#if NET_4_0
[ComVisible (false)]
[MonoTODO ("Not implemented on unix")]
public static RegistryKey OpenRemoteBaseKey (RegistryHive hKey, string machineName, RegistryView view)
throw new ArgumentException ("hKey");
}
-#endif
[ComVisible (false)]
public RegistryKey OpenSubKey (string name, RegistryKeyPermissionCheck permissionCheck)
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
namespace Microsoft.Win32 {
}
}
-#endif
DWord,
MultiString = 7,
QWord = 11,
-#if NET_4_0
None = -1
-#endif
}
}
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
namespace Microsoft.Win32 {
}
}
-#endif
return CreateSubKey (rkey, keyname, true);
}
-#if NET_4_0
public RegistryKey CreateSubKey (RegistryKey rkey, string keyname, RegistryOptions options)
{
return CreateSubKey (rkey, keyname, true, options == RegistryOptions.Volatile);
}
-#endif
public RegistryKey OpenRemoteBaseKey (RegistryHive hKey, string machineName)
{
return result;
}
-#if NET_4_0
public RegistryKey FromHandle (SafeRegistryHandle handle)
{
throw new NotImplementedException ();
}
-#endif
public void Flush (RegistryKey rkey)
{
return RegistryValueKind.Unknown;
}
-#if NET_4_0
public IntPtr GetHandle (RegistryKey key)
{
throw new NotImplementedException ();
}
-#endif
}
}
{
if (!IsHandleValid (rkey))
return;
-#if NET_4_0
SafeRegistryHandle safe_handle = rkey.Handle;
if (safe_handle != null) {
// closes the unmanaged pointer for us.
safe_handle.Close ();
return;
}
-#endif
IntPtr handle = GetHandle (rkey);
RegCloseKey (handle);
}
-#if NET_4_0
public RegistryKey FromHandle (SafeRegistryHandle handle)
{
// At this point we can't tell whether the key is writable
// .Net seems to do.
return new RegistryKey (handle.DangerousGetHandle (), String.Empty, true);
}
-#endif
public RegistryKey CreateSubKey (RegistryKey rkey, string keyName)
{
true);
}
-#if NET_4_0
public RegistryKey CreateSubKey (RegistryKey rkey, string keyName, RegistryOptions options)
{
IntPtr handle = GetHandle (rkey);
return new RegistryKey (subKeyHandle, CombineName (rkey, keyName),
true);
}
-#endif
public void DeleteKey (RegistryKey rkey, string keyName, bool shouldThrowWhenKeyMissing)
{
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Threading;
}
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Threading;
}
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Threading;
}
}
}
-#endif
//
//
-#if NET_4_0
using System;
using System.Threading;
}
}
}
-#endif
//
//
-#if NET_4_0
using System;
using System.Threading;
}
}
-#endif
//
//
-#if NET_4_0
using System;
using System.Threading;
}
}
}
-#endif
//
//
-#if NET_4_0
using System;
using System.Threading;
}
}
}
-#endif
//
//
-#if NET_4_0
using System;
using System.Collections;
using System.Collections.Generic;
void CopyTo (T[] array, int index);
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Collections.Generic;
}
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Collections.Generic;
}
}
}
-#endif
//
//
-#if NET_4_0 || INSIDE_SYSTEM_WEB
using System;
using System.Threading;
}
}
-#if INSIDE_SYSTEM_WEB && !NET_4_0
- internal struct SpinWait
- {
- // The number of step until SpinOnce yield on multicore machine
- const int step = 10;
- const int maxTime = 200;
- static readonly bool isSingleCpu = (Environment.ProcessorCount == 1);
-
- int ntime;
-
- public void SpinOnce ()
- {
- ntime += 1;
-
- if (isSingleCpu) {
- // On a single-CPU system, spinning does no good
- Thread.Sleep (0);
- } else {
- if (ntime % step == 0)
- Thread.Sleep (0);
- else
- // Multi-CPU system might be hyper-threaded, let other thread run
- Thread.SpinWait (Math.Min (ntime, maxTime) << 1);
- }
- }
- }
-#endif
}
-#endif
namespace System.Collections.Generic
{
-#if NET_4_0
public interface IComparer<in T>
-#else
- public interface IComparer<T>
-#endif
{
int Compare (T x, T y);
}
namespace System.Collections.Generic
{
-#if NET_4_0
public interface IEnumerable<out T> : IEnumerable
-#else
- public interface IEnumerable<T> : IEnumerable
-#endif
{
new IEnumerator<T> GetEnumerator ();
}
namespace System.Collections.Generic
{
-#if NET_4_0
public interface IEnumerator<out T> : IDisposable, IEnumerator
-#else
- public interface IEnumerator<T> : IDisposable, IEnumerator
-#endif
{
new T Current {
get;
namespace System.Collections.Generic
{
-#if NET_4_0
public interface IEqualityComparer<in T>
-#else
- public interface IEqualityComparer<T>
-#endif
{
bool Equals (T x, T y);
int GetHashCode (T obj);
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
}
}
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
}
}
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
namespace System.Collections
{
}
}
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.Text;
}
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.Collections.Generic;
{
public static class Contract
{
-#if NET_4_0
public
-#else
- internal
-#endif
static event EventHandler<ContractFailedEventArgs> ContractFailed;
// Used in test
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
namespace System.Diagnostics.Contracts {
[Conditional ("DEBUG")]
}
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
namespace System.Diagnostics.Contracts {
[Conditional ("CONTRACTS_FULL")]
}
}
}
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
}
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.Runtime.ConstrainedExecution;
}
}
-#endif
namespace System.Diagnostics.Contracts {
-#if NET_4_0
public
-#else
- internal
-#endif
enum ContractFailureKind {
Precondition,
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
namespace System.Diagnostics.Contracts {
[Conditional ("CONTRACTS_FULL")]
}
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
namespace System.Diagnostics.Contracts {
[Conditional ("CONTRACTS_FULL")]
}
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
namespace System.Diagnostics.Contracts {
[AttributeUsage (AttributeTargets.Assembly)]
public ContractReferenceAssemblyAttribute () {}
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
namespace System.Diagnostics.Contracts {
[Conditional ("CONTRACTS_FULL")]
public ContractRuntimeIgnoredAttribute() {}
}
}
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
namespace System.Diagnostics.Contracts {
[Conditional ("CONTRACTS_FULL")]
}
}
}
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
}
}
-#endif
[MethodImplAttribute(MethodImplOptions.InternalCall)]
public static extern void Log(int level, string category, string message);
-#if NET_4_0
public static void NotifyOfCrossThreadDependency ()
{
}
-#endif
-#if NET_4_0
[ObsoleteAttribute("Call the static methods directly on this type", true)]
-#endif
public Debugger()
{
}
internal void CheckNeutral ()
{
-#if !NET_4_0
- if (IsNeutralCulture) {
- throw new NotSupportedException ("Culture \"" + m_name + "\" is " +
- "a neutral culture. It can not be used in formatting " +
- "and parsing and therefore cannot be set as the thread's " +
- "current culture.");
- }
-#endif
}
public virtual NumberFormatInfo NumberFormat {
// Be careful not to cause recursive CultureInfo initialization
//
var msg = string.Format (InvariantCulture, "Culture ID {0} (0x{1}) is not a supported culture.", culture.ToString (InvariantCulture), culture.ToString ("X4", InvariantCulture));
-#if NET_4_0
throw new CultureNotFoundException ("culture", msg);
-#else
- throw new ArgumentException (msg, "culture");
-#endif
}
}
static Exception CreateNotFoundException (string name)
{
-#if NET_4_0
return new CultureNotFoundException ("name", "Culture name " + name + " is not supported.");
-#else
- return new ArgumentException ("Culture name " + name + " is not supported.", "name");
-#endif
}
#if NET_4_5
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.Runtime.InteropServices;
}
}
}
-#endif
AllCultures = 7,
UserCustomCulture = 8,
ReplacementCultures = 16,
-#if NET_4_0
[Obsolete]
-#endif
WindowsOnlyCultures = 32,
-#if NET_4_0
[Obsolete]
-#endif
FrameworkCultures = 64,
} // CultureTypes
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
AssumeNegative
}
}
-#endif
}
[CLSCompliant (false)]
-#if NET_4_0
[Obsolete]
-#endif
public virtual ulong CurrentSize {
get {
throw new InvalidOperationException (
}
[CLSCompliant (false)]
-#if NET_4_0
[Obsolete]
-#endif
public virtual ulong MaximumSize {
get {
throw new InvalidOperationException (
get { return storage_scope; }
}
-#if NET_4_0
[ComVisible (false)]
public virtual long AvailableFreeSpace {
get {
throw new InvalidOperationException ("This property is not defined for this store.");
}
}
-#endif
protected virtual char SeparatorExternal {
get { return System.IO.Path.DirectorySeparatorChar; }
}
public abstract void Remove ();
-#if NET_4_0
[ComVisible (false)]
public virtual bool IncreaseQuotaTo (long newQuotaSize)
{
return false;
}
-#endif
}
}
private static readonly Mutex mutex = new Mutex ();
#endif
-#if NET_4_0
private bool closed;
private bool disposed;
-#endif
public static IEnumerator GetEnumerator (IsolatedStorageScope scope)
{
return storageFile;
}
-#if NET_4_0
[ComVisible (false)]
public static IsolatedStorageFile GetUserStoreForSite ()
{
throw new NotSupportedException ();
}
-#endif
public static void Remove (IsolatedStorageScope scope)
{
}
[CLSCompliant(false)]
-#if NET_4_0
[Obsolete]
-#endif
public override ulong CurrentSize {
get { return GetDirectorySize (directory); }
}
[CLSCompliant(false)]
-#if NET_4_0
[Obsolete]
-#endif
public override ulong MaximumSize {
// return an ulong but default is signed long
get {
get { return directory.FullName; }
}
-#if NET_4_0
[ComVisible (false)]
public override long AvailableFreeSpace {
get {
return disposed;
}
}
-#endif
// methods
public void Close ()
{
-#if NET_4_0
closed = true;
-#endif
}
public void CreateDirectory (string dir)
if (dir.IndexOfAny (Path.PathSeparatorChars) < 0) {
if (directory.GetFiles (dir).Length > 0)
-#if NET_4_0
throw new IsolatedStorageException ("Unable to create directory.");
-#else
- throw new IOException (Locale.GetText ("Directory name already exists as a file."));
-#endif
directory.CreateSubdirectory (dir);
} else {
string[] dirs = dir.Split (Path.PathSeparatorChars, StringSplitOptions.RemoveEmptyEntries);
for (int i = 0; i < dirs.Length; i++) {
if (dinfo.GetFiles (dirs [i]).Length > 0)
-#if NET_4_0
throw new IsolatedStorageException ("Unable to create directory.");
-#else
- throw new IOException (Locale.GetText (
- "Part of the directory name already exists as a file."));
-#endif
dinfo = dinfo.CreateSubdirectory (dirs [i]);
}
}
}
-#if NET_4_0
[ComVisible (false)]
public void CopyFile (string sourceFileName, string destinationFileName)
{
{
return new IsolatedStorageFileStream (path, FileMode.Create, FileAccess.ReadWrite, FileShare.None, this);
}
-#endif
public void DeleteDirectory (string dir)
{
public void Dispose ()
{
-#if NET_4_0
// Dispose may be calling Close, but we are not sure
disposed = true;
-#endif
// nothing to dispose, anyway we want to please the tools
GC.SuppressFinalize (this);
}
-#if NET_4_0
[ComVisible (false)]
public bool DirectoryExists (string path)
{
return Directory.GetLastWriteTime (full_path);
}
-#endif
public string[] GetDirectoryNames (string searchPattern)
{
if (searchPattern == null)
throw new ArgumentNullException ("searchPattern");
-#if NET_4_0
if (searchPattern.Contains (".."))
throw new ArgumentException ("Search pattern cannot contain '..' to move up directories.", "searchPattern");
-#endif
// note: IsolatedStorageFile accept a "dir/file" pattern which is not allowed by DirectoryInfo
// so we need to split them to get the right results
return GetNames (adi);
}
-#if NET_4_0
[ComVisible (false)]
public string [] GetDirectoryNames ()
{
return GetDirectoryNames ("*");
}
-#endif
private string[] GetNames (FileSystemInfo[] afsi)
{
{
if (searchPattern == null)
throw new ArgumentNullException ("searchPattern");
-#if NET_4_0
if (searchPattern.Contains (".."))
throw new ArgumentException ("Search pattern cannot contain '..' to move up directories.", "searchPattern");
-#endif
// note: IsolatedStorageFile accept a "dir/file" pattern which is not allowed by DirectoryInfo
// so we need to split them to get the right results
return GetNames (afi);
}
-#if NET_4_0
[ComVisible (false)]
public string [] GetFileNames ()
{
{
return new IsolatedStorageFileStream (path, mode, access, share, this);
}
-#endif
public override void Remove ()
{
-#if NET_4_0
CheckOpen (false);
-#endif
try {
directory.Delete (true);
} catch {
}
// internal stuff
-#if NET_4_0
void CheckOpen ()
{
CheckOpen (true);
{
return Path.GetFullPath (path).StartsWith (directory.FullName);
}
-#endif
#if !MOBILE
private string GetNameFromIdentity (object identity)
#endif
}
-#if NET_4_0
if (isf.IsDisposed)
throw new ObjectDisposedException ("IsolatedStorageFile");
if (isf.IsClosed)
throw new InvalidOperationException ("Storage needs to be open for this operation.");
-#endif
// ensure that the _root_ isolated storage can be (and is) created.
FileInfo fi = new FileInfo (isf.Root);
base.Flush ();
}
-#if NET_4_0
public override void Flush (bool flushToDisk)
{
base.Flush (flushToDisk);
}
-#endif
public override int Read (byte[] buffer, int offset, int count)
{
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
namespace System.IO.IsolatedStorage
{
public enum IsolatedStorageSecurityOptions
}
}
-#endif
using System.Security;
-#if NET_4_0
namespace System.IO.IsolatedStorage
{
}
}
-#endif
charBuffer = null;
}
-#if NET_4_0
public void Dispose ()
-#else
- void IDisposable.Dispose()
-#endif
{
Dispose (true);
}
Dispose (true);
}
-#if NET_4_0
public void Dispose ()
-#else
- void IDisposable.Dispose()
-#endif
{
Dispose (true);
}
return result;
}
-#if NET_4_0
public static string[] GetFileSystemEntries (string path, string searchPattern, SearchOption searchOption)
{
// Take the simple way home:
return EnumerateKind (path, "*", SearchOption.TopDirectoryOnly, FileAttributes.Normal | FileAttributes.Directory);
}
-#endif
public static DirectorySecurity GetAccessControl (string path, AccessControlSections includeSections)
{
return GetFileSystemInfos (searchPattern, SearchOption.TopDirectoryOnly);
}
-#if NET_4_0
public
-#endif
FileSystemInfo [] GetFileSystemInfos (string searchPattern, SearchOption searchOption)
{
if (searchPattern == null)
Directory.SetAccessControl (FullPath, directorySecurity);
}
-#if NET_4_0
public IEnumerable<DirectoryInfo> EnumerateDirectories ()
{
}
-#endif
}
}
throw new NotSupportedException (Locale.GetText ("File encryption isn't supported on any file system."));
}
-#if NET_4_0
public static IEnumerable<string> ReadLines (string path)
{
return ReadLines (File.OpenText (path));
w.WriteLine (line);
}
}
-#endif
}
}
FlushBuffer ();
}
-#if NET_4_0
public virtual void Flush (bool flushToDisk)
{
FlushBuffer ();
MonoIO.Flush (handle, out error);
}
}
-#endif
public virtual void Lock (long position, long length)
{
return String.Compare (subset, slast, path, slast, subset.Length - slast) == 0;
}
-#if NET_4_0
public
-#else
- internal
-#endif
static string Combine (params string [] paths)
{
if (paths == null)
return ret.ToString ();
}
-#if NET_4_0
public
-#else
- internal
-#endif
static string Combine (string path1, string path2, string path3)
{
if (path1 == null)
return Combine (new string [] { path1, path2, path3 });
}
-#if NET_4_0
public
-#else
- internal
-#endif
static string Combine (string path1, string path2, string path3, string path4)
{
if (path1 == null)
}
}
-#if NET_4_0
public void CopyTo (Stream destination)
{
CopyTo (destination, 16*1024);
protected virtual void ObjectInvariant ()
{
}
-#endif
#if NET_4_5
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.Runtime.InteropServices;
}
}
-#endif
IntPtr initial_pointer;
long initial_position;
long current_position;
-#if NET_4_0
SafeBuffer safebuffer;
-#endif
#if NET_4_5
Task<int> read_task;
#endif
Initialize (pointer, length, capacity, access);
}
-#if NET_4_0
public UnmanagedMemoryStream (SafeBuffer buffer, long offset, long length) :
this (buffer, offset, length, FileAccess.Read)
{
closed = true;
Initialize (buffer, offset, length, access);
}
-#endif
#endregion
#region Properties
[CLSCompliantAttribute (false)]
public unsafe byte* PositionPointer {
get {
-#if NET_4_0
if (safebuffer != null)
throw new NotSupportedException ("Not supported when using SafeBuffer");
-#endif
if (closed)
throw new ObjectDisposedException("The stream is closed");
if (current_position >= length)
return (byte *) initial_pointer + current_position;
}
set {
-#if NET_4_0
if (safebuffer != null)
throw new NotSupportedException ("Not supported when using SafeBuffer");
-#endif
if (closed)
throw new ObjectDisposedException("The stream is closed");
return 0;
int progress = current_position + count < length ? count : (int) (length - current_position);
-#if NET_4_0
if (safebuffer != null) {
unsafe {
byte *ptr = null;
}
}
} else
-#endif
{
Marshal.Copy (new IntPtr (initial_pointer.ToInt64 () + current_position), buffer, offset, progress);
}
if (current_position >= length)
return (-1);
-#if NET_4_0
if (safebuffer != null) {
unsafe {
byte *ptr = null;
}
}
} else
-#endif
{
return (int) Marshal.ReadByte(initial_pointer, (int) current_position++);
}
public override void SetLength (long value)
{
-#if NET_4_0
if (safebuffer != null)
throw new NotSupportedException ("Not supported when using SafeBuffer");
-#endif
if (closed)
throw new ObjectDisposedException("The stream is closed");
if (value < 0)
if (fileaccess == FileAccess.Read)
throw new NotSupportedException ("Stream does not support writing.");
-#if NET_4_0
if (safebuffer != null) {
unsafe {
byte *dest = null;
}
}
} else
-#endif
{
unsafe {
fixed (byte *src = buffer) {
if (fileaccess == FileAccess.Read)
throw new NotSupportedException("Stream does not support writing.");
-#if NET_4_0
if (safebuffer != null) {
unsafe {
byte *dest = null;
}
}
} else
-#endif
{
unsafe {
byte *dest = (byte *) initial_pointer + (int) current_position++;
closed = false;
}
-#if NET_4_0
protected void Initialize (SafeBuffer buffer, long offset, long length, FileAccess access)
{
if (buffer == null)
current_position = offset;
closed = false;
}
-#endif
#endregion
}
}
internal bool IsRun {
get {
return access == (uint)AssemblyBuilderAccess.Run || access == (uint)AssemblyBuilderAccess.RunAndSave
-#if NET_4_0
|| access == (uint)AssemblyBuilderAccess.RunAndCollect
-#endif
;
}
throw new NotImplementedException ();
}
-#if NET_4_0
public override Type GetType (string name, bool throwOnError, bool ignoreCase)
{
if (name == null)
public override string FullName {
get { return base.FullName; }
}
-#endif
}
}
#endif
Save = 2,
RunAndSave = 3,
ReflectionOnly = 6,
-#if NET_4_0
RunAndCollect = 9
-#endif
}
}
#endif
}
}
-#if NET_4_0
[Obsolete]
-#endif
public Type ReturnType {
get {
return null;
throw new NotImplementedException ();
}
-#if NET_4_0
[MonoTODO]
public int GetTokenFor (RuntimeFieldHandle field, RuntimeTypeHandle contextType) {
throw new NotImplementedException ();
}
-#endif
public void SetCode (byte[] code, int maxStackSize) {
if (code == null)
return res;
}
-#if NET_4_0
public override Type GetEnumUnderlyingType ()
{
return _underlyingType;
}
-#endif
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private extern void setup_enum_type (Type t);
protected override TypeAttributes GetAttributeFlagsImpl ()
{
-#if NET_4_0
return TypeAttributes.Public;
-#else
- throw not_supported ();
-#endif
}
protected override ConstructorInfo GetConstructorImpl (BindingFlags bindingAttr,
return ig.code_len;
}
-#if NET_4_0
public
-#else
- internal
-#endif
virtual int ILOffset {
get { return code_len; }
}
throw new NotImplementedException ();
}
-#if NET_4_0
public override ParameterInfo ReturnParameter {
get { return base.ReturnParameter; }
}
-#endif
}
}
#endif
throw new NotImplementedException ();
}
-#if NET_4_0
public override Assembly Assembly {
get { return assemblyb; }
}
return base.MetadataToken;
}
}
-#endif
}
internal class ModuleBuilderTokenGenerator : TokenGenerator {
throw new NotImplementedException ();
}
-#if NET_4_0
[MonoTODO("Not implemented")]
public static SignatureHelper GetPropertySigHelper (Module mod,
CallingConventions callingConvention,
{
throw new NotImplementedException ();
}
-#endif
//
// Grows the given array, and returns the index where the element
return DefineProperty (name, attributes, 0, returnType, null, null, parameterTypes, null, null);
}
-#if NET_4_0
public PropertyBuilder DefineProperty (string name, PropertyAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] parameterTypes)
{
return DefineProperty (name, attributes, callingConvention, returnType , null, null, parameterTypes, null, null);
}
-#endif
public PropertyBuilder DefineProperty (string name, PropertyAttributes attributes, Type returnType, Type[] returnTypeRequiredCustomModifiers, Type[] returnTypeOptionalCustomModifiers, Type[] parameterTypes, Type[][] parameterTypeRequiredCustomModifiers, Type[][] parameterTypeOptionalCustomModifiers)
{
[StructLayout (LayoutKind.Sequential)]
#if MOBILE
public partial class Assembly : ICustomAttributeProvider {
-#elif NET_4_0
- public abstract class Assembly : ICustomAttributeProvider, _Assembly, IEvidenceFactory, ISerializable {
#else
- public partial class Assembly : ICustomAttributeProvider, _Assembly, IEvidenceFactory, ISerializable {
+ public abstract class Assembly : ICustomAttributeProvider, _Assembly, IEvidenceFactory, ISerializable {
#endif
internal class ResolveEventHolder {
public event ModuleResolveEventHandler ModuleResolve;
private bool fromByteArray;
private string assemblyName;
-#if NET_4_0
protected
-#else
- internal
-#endif
Assembly ()
{
resolve_event_holder = new ResolveEventHolder ();
return LoadFrom (assemblyFile, false);
}
-#if NET_4_0
[Obsolete]
-#endif
public static Assembly LoadFrom (String assemblyFile, Evidence securityEvidence)
{
Assembly a = LoadFrom (assemblyFile, false);
return a;
}
-#if NET_4_0
[Obsolete]
-#endif
[MonoTODO("This overload is not currently implemented")]
// FIXME: What are we missing?
public static Assembly LoadFrom (String assemblyFile, Evidence securityEvidence, byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
throw new NotImplementedException ();
}
-#if NET_4_0
[MonoTODO]
public static Assembly LoadFrom (String assemblyFile, byte [] hashValue, AssemblyHashAlgorithm hashAlgorithm)
{
throw new NotImplementedException ();
}
-#endif
-#if NET_4_0
public static Assembly UnsafeLoadFrom (String assemblyFile)
{
return LoadFrom (assemblyFile);
}
-#endif
-#if NET_4_0
[Obsolete]
-#endif
public static Assembly LoadFile (String path, Evidence securityEvidence)
{
if (path == null)
return AppDomain.CurrentDomain.Load (assemblyString);
}
-#if NET_4_0
[Obsolete]
-#endif
public static Assembly Load (String assemblyString, Evidence assemblySecurity)
{
return AppDomain.CurrentDomain.Load (assemblyString, assemblySecurity);
return AppDomain.CurrentDomain.Load (assemblyRef);
}
-#if NET_4_0
[Obsolete]
-#endif
public static Assembly Load (AssemblyName assemblyRef, Evidence assemblySecurity)
{
return AppDomain.CurrentDomain.Load (assemblyRef, assemblySecurity);
return AppDomain.CurrentDomain.Load (rawAssembly, rawSymbolStore);
}
-#if NET_4_0
[Obsolete]
-#endif
public static Assembly Load (Byte[] rawAssembly, Byte[] rawSymbolStore,
Evidence securityEvidence)
{
return AppDomain.CurrentDomain.Load (rawAssembly, rawSymbolStore, securityEvidence);
}
-#if NET_4_0
[MonoLimitation ("Argument securityContextSource is ignored")]
public static Assembly Load (byte [] rawAssembly, byte [] rawSymbolStore, SecurityContextSource securityContextSource)
{
return AppDomain.CurrentDomain.Load (rawAssembly, rawSymbolStore);
}
-#endif
public static Assembly ReflectionOnlyLoad (byte[] rawAssembly)
{
[MonoTODO ("Not implemented")]
public
-#if NET_4_0
virtual
-#endif
Module LoadModule (string moduleName, byte [] rawModule, byte [] rawSymbolStore)
{
throw new NotImplementedException ();
}
public
-#if NET_4_0
virtual
-#endif
Object CreateInstance (String typeName, Boolean ignoreCase,
BindingFlags bindingAttr, Binder binder,
Object[] args, CultureInfo culture,
[MonoTODO ("Currently it always returns zero")]
[ComVisible (false)]
public
-#if NET_4_0
virtual
-#endif
long HostContext {
get { return 0; }
}
}
}
-#if NET_4_0
public virtual PermissionSet PermissionSet {
get { return this.GrantedPermissionSet; }
}
public virtual SecurityRuleSet SecurityRuleSet {
get { throw CreateNIE (); }
}
-#endif
#endif
-#if NET_4_0
static Exception CreateNIE ()
{
return new NotImplementedException ("Derived classes must implement it");
return true;
return !left.Equals (right);
}
-#endif
#if NET_4_5
public virtual IEnumerable<TypeInfo> DefinedTypes {
}
#endif
-#if NET_4_0
public override bool Equals (object obj)
{
return obj == (object) this;
return true;
return !left.Equals (right);
}
-#endif
}
}
[ComVisible (true)]
[Serializable]
-#if NET_4_0
public
-#else
- public sealed
-#endif
class CustomAttributeData {
class LazyCAttrData {
internal Assembly assembly;
LazyCAttrData lazyData;
-#if NET_4_0
protected CustomAttributeData ()
{
}
-#endif
internal CustomAttributeData (ConstructorInfo ctorInfo, Assembly assembly, IntPtr data, uint data_length)
{
[ComVisible (true)]
public
-#if NET_4_0
virtual
-#endif
ConstructorInfo Constructor {
get {
return ctorInfo;
[ComVisible (true)]
public
-#if NET_4_0
virtual
-#endif
IList<CustomAttributeTypedArgument> ConstructorArguments {
get {
ResolveArguments ();
}
public
-#if NET_4_0
virtual
-#endif
IList<CustomAttributeNamedArgument> NamedArguments {
get {
ResolveArguments ();
CustomAttributeTypedArgument typedArgument;
MemberInfo memberInfo;
-#if NET_4_0
public
-#endif
CustomAttributeNamedArgument (MemberInfo memberInfo, object value)
{
this.memberInfo = memberInfo;
this.typedArgument = (CustomAttributeTypedArgument) value;
}
-#if NET_4_0
public CustomAttributeNamedArgument (MemberInfo memberInfo, CustomAttributeTypedArgument typedArgument)
{
this.memberInfo = memberInfo;
this.typedArgument = typedArgument;
}
-#endif
public MemberInfo MemberInfo {
get {
Type argumentType;
object value;
-#if NET_4_0
public
-#endif
CustomAttributeTypedArgument (Type argumentType, object value)
{
if (argumentType == null)
}
}
-#if NET_4_0
public CustomAttributeTypedArgument (object value)
{
if (value == null)
this.argumentType = value.GetType ();
this.value = value;
}
-#endif
public Type ArgumentType {
get {
public abstract EventAttributes Attributes {get;}
public
-#if NET_4_0
virtual
-#endif
Type EventHandlerType {
get {
ParameterInfo[] p;
}
public
-#if NET_4_0
virtual
-#endif
bool IsMulticast {get {return true;}}
public bool IsSpecialName {get {return (Attributes & EventAttributes.SpecialName ) != 0;}}
public override MemberTypes MemberType {
[DebuggerHidden]
[DebuggerStepThrough]
public
-#if NET_4_0
virtual
-#endif
void AddEventHandler (object target, Delegate handler)
{
// this optimization cause problems with full AOT
[DebuggerHidden]
[DebuggerStepThrough]
public
-#if NET_4_0
virtual
-#endif
void RemoveEventHandler (object target, Delegate handler)
{
MethodInfo remove = GetRemoveMethod ();
remove.Invoke (target, new object [] {handler});
}
-#if NET_4_0
public override bool Equals (object obj)
{
return obj == (object) this;
return true;
return !left.Equals (right);
}
-#endif
#if !MOBILE
void _EventInfo.GetIDsOfNames ([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
[ComVisible (true)]
[StructLayout (LayoutKind.Sequential)]
-#if NET_4_0
public
-#else
- public sealed
-#endif
class ExceptionHandlingClause {
#region Sync with reflection.h
internal Type catch_type;
internal int handler_length;
#endregion
-#if NET_4_0
protected
-#else
- internal
-#endif
ExceptionHandlingClause () {
}
public
-#if NET_4_0
virtual
-#endif
Type CatchType {
get {
return catch_type;
}
public
-#if NET_4_0
virtual
-#endif
int FilterOffset {
get {
return filter_offset;
}
public
-#if NET_4_0
virtual
-#endif
ExceptionHandlingClauseOptions Flags {
get {
return flags;
}
public
-#if NET_4_0
virtual
-#endif
int HandlerLength {
get {
return handler_length;
}
public
-#if NET_4_0
virtual
-#endif
int HandlerOffset {
get {
return handler_offset;
}
public
-#if NET_4_0
virtual
-#endif
int TryLength {
get {
return try_length;
}
public
-#if NET_4_0
virtual
-#endif
int TryOffset {
get {
return try_offset;
}
-#if NET_4_0
public override bool Equals (object obj)
{
return obj == (object) this;
throw new NotImplementedException ();
}
}
-#endif
#if !MOBILE
void _FieldInfo.GetIDsOfNames ([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
internal ushort position;
#endregion
-#if NET_4_0
protected
-#else
- internal
-#endif
LocalVariableInfo () {
}
{
}
-#if NET_4_0
public
-#else
- internal
-#endif
ManifestResourceInfo (Assembly containingAssembly, string containingFileName, ResourceLocation resourceLocation)
{
_assembly = containingAssembly;
get;
}
-#if NET_4_0
public override bool Equals (object obj)
{
return obj == (object) this;
public virtual IList<CustomAttributeData> GetCustomAttributesData () {
throw new NotImplementedException ();
}
-#endif
#if NET_4_5
public virtual IEnumerable<CustomAttributeData> CustomAttributes {
throw new NotSupportedException ();
}
-#if NET_4_0
public override bool Equals (object obj)
{
return obj == (object) this;
throw new NotImplementedException ();
}
}
-#endif
#if NET_4_5
public virtual MethodImplAttributes MethodImplementationFlags {
[ComVisible (true)]
[StructLayout (LayoutKind.Sequential)]
public
-#if !NET_4_0
- sealed
-#endif
class MethodBody {
#pragma warning disable 649
#region Sync with reflection.h
#endregion
#pragma warning restore 649
-#if NET_4_0
protected
-#else
- internal
-#endif
MethodBody () {
}
public
-#if NET_4_0
virtual
-#endif
IList<ExceptionHandlingClause> ExceptionHandlingClauses {
get {
return Array.AsReadOnly<ExceptionHandlingClause> (clauses);
}
public
-#if NET_4_0
virtual
-#endif
IList<LocalVariableInfo> LocalVariables {
get {
return Array.AsReadOnly<LocalVariableInfo> (locals);
}
public
-#if NET_4_0
virtual
-#endif
bool InitLocals {
get {
return init_locals;
}
public
-#if NET_4_0
virtual
-#endif
int LocalSignatureMetadataToken {
get {
return sig_token;
public
-#if NET_4_0
virtual
-#endif
int MaxStackSize {
get {
return max_stack;
}
public
-#if NET_4_0
virtual
-#endif
byte[] GetILAsByteArray () {
return il;
}
return Type.EmptyTypes;
}
-#if !NET_4_0
- public override bool IsGenericMethod {
- get {
- return false;
- }
- }
-
- public override bool IsGenericMethodDefinition {
- get {
- return false;
- }
- }
-
- public override bool ContainsGenericParameters {
- get {
- return false;
- }
- }
-#endif
public virtual ParameterInfo ReturnParameter {
get {
}
}
-#if NET_4_0
public override bool Equals (object obj)
{
return obj == (object) this;
return true;
return !left.Equals (right);
}
-#endif
#if NET_4_5
public virtual Delegate CreateDelegate (Type delegateType)
[StructLayout (LayoutKind.Sequential)]
#if MOBILE
public abstract class Module : ISerializable, ICustomAttributeProvider {
-#elif NET_4_0
- public abstract class Module : ISerializable, ICustomAttributeProvider, _Module {
#else
- public partial class Module : ISerializable, ICustomAttributeProvider, _Module {
+ public abstract class Module : ISerializable, ICustomAttributeProvider, _Module {
#endif
public static readonly TypeFilter FilterTypeName = new TypeFilter (filter_by_type_name);
public static readonly TypeFilter FilterTypeNameIgnoreCase = new TypeFilter (filter_by_type_name_ignore_case);
const BindingFlags defaultBindingFlags =
BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance;
-#if NET_4_0
protected
-#else
- internal
-#endif
Module () {
}
}
#endif
-#if NET_4_0
public override bool Equals (object o)
{
return o == (object) this;
return !left.Equals (right);
}
-#endif
-#if NET_4_0
public virtual Assembly Assembly {
get { throw CreateNIE (); }
{
throw CreateNIE ();
}
-#endif
#if NET_4_5
public virtual IEnumerable<CustomAttributeData> CustomAttributes {
namespace System.Reflection {
-#if NET_4_0
[ComVisible (true)]
[ComDefaultInterfaceAttribute (typeof (_Assembly))]
[Serializable]
[ClassInterface(ClassInterfaceType.None)]
class MonoAssembly : Assembly {
-#else
- public partial class Assembly {
-#endif
public
-#if NET_4_0
override
-#endif
Type GetType (string name, bool throwOnError, bool ignoreCase)
{
Type res;
throw new ArgumentException ("name", "Name cannot be empty");
res = InternalGetType (null, name, throwOnError, ignoreCase);
-#if !NET_4_0 && !FULL_AOT_RUNTIME
- if (res is TypeBuilder) {
- if (throwOnError)
- throw new TypeLoadException (string.Format ("Could not load type '{0}' from assembly '{1}'", name, this));
- return null;
- }
-#endif
return res;
}
public
-#if NET_4_0
override
-#endif
Module GetModule (String name)
{
if (name == null)
}
public
-#if NET_4_0
override
-#endif
AssemblyName[] GetReferencedAssemblies () {
return GetReferencedAssemblies (this);
}
public
-#if NET_4_0
override
-#endif
Module[] GetModules (bool getResourceModules) {
Module[] modules = GetModulesInternal ();
[MonoTODO ("Always returns the same as GetModules")]
public
-#if NET_4_0
override
-#endif
Module[] GetLoadedModules (bool getResourceModules)
{
return GetModules (getResourceModules);
}
public
-#if NET_4_0
override
-#endif
Assembly GetSatelliteAssembly (CultureInfo culture)
{
return GetSatelliteAssembly (culture, null, true);
}
public
-#if NET_4_0
override
-#endif
Assembly GetSatelliteAssembly (CultureInfo culture, Version version)
{
return GetSatelliteAssembly (culture, version, true);
//FIXME remove GetManifestModule under v4, it's a v2 artifact
[ComVisible (false)]
public
-#if NET_4_0
override
-#endif
Module ManifestModule {
get {
return GetManifestModule ();
}
public
-#if NET_4_0
override
-#endif
bool GlobalAssemblyCache {
get {
return get_global_assembly_cache ();
ToString(), MemberTypes.Event);
}
-#if NET_4_0
public override IList<CustomAttributeData> GetCustomAttributesData () {
return CustomAttributeData.GetCustomAttributes (this);
}
-#endif
}
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
public override extern object GetRawConstantValue ();
-#if NET_4_0
public override IList<CustomAttributeData> GetCustomAttributesData () {
return CustomAttributeData.GetCustomAttributes (this);
}
-#endif
void CheckGeneric () {
if (DeclaringType.ContainsGenericParameters)
return GetMethodBody (mhandle);
}
-#if NET_4_0
public override IList<CustomAttributeData> GetCustomAttributesData () {
return CustomAttributeData.GetCustomAttributes (this);
}
-#endif
}
[Serializable()]
MemberInfoSerializationHolder.Serialize ( info, Name, ReflectedType, ToString(), MemberTypes.Constructor);
}
-#if NET_4_0
public override IList<CustomAttributeData> GetCustomAttributesData () {
return CustomAttributeData.GetCustomAttributes (this);
}
-#endif
}
}
namespace System.Reflection {
-#if NET_4_0
[ComVisible (true)]
[ComDefaultInterfaceAttribute (typeof (_Module))]
[Serializable]
[ClassInterface(ClassInterfaceType.None)]
class MonoModule : Module {
-#else
- public partial class Module {
-#endif
public
-#if NET_4_0
override
-#endif
Assembly Assembly {
get { return assembly; }
}
public
-#if NET_4_0
override
-#endif
// Note: we do not ask for PathDiscovery because no path is returned here.
// However MS Fx requires it (see FDBK23572 for details).
string Name {
}
public
-#if NET_4_0
override
-#endif
string ScopeName {
get { return scopename; }
}
public
-#if NET_4_0
override
-#endif
int MDStreamVersion {
get {
if (_impl == IntPtr.Zero)
}
public
-#if NET_4_0
override
-#endif
Guid ModuleVersionId {
get {
return GetModuleVersionId ();
}
}
-#if NET_4_0
public override
-#else
- public virtual
-#endif
string FullyQualifiedName {
get {
#if !NET_2_1
}
public
-#if NET_4_0
override
-#endif
bool IsResource()
{
return is_resource;
}
-#if NET_4_0
public override
-#else
- public virtual
-#endif
Type[] FindTypes(TypeFilter filter, object filterCriteria)
{
var filtered = new List<Type> ();
return filtered.ToArray ();
}
-#if NET_4_0
public override
-#else
- public virtual
-#endif
object[] GetCustomAttributes(bool inherit)
{
return MonoCustomAttrs.GetCustomAttributes (this, inherit);
}
-#if NET_4_0
public override
-#else
- public virtual
-#endif
object[] GetCustomAttributes(Type attributeType, bool inherit)
{
return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
}
-#if NET_4_0
public override
-#else
- public virtual
-#endif
FieldInfo GetField (string name, BindingFlags bindingAttr)
{
if (IsResource ())
return (globalType != null) ? globalType.GetField (name, bindingAttr) : null;
}
-#if NET_4_0
public override
-#else
- public virtual
-#endif
FieldInfo[] GetFields (BindingFlags bindingFlags)
{
if (IsResource ())
return (globalType != null) ? globalType.GetFields (bindingFlags) : new FieldInfo [0];
}
-#if NET_4_0
public override
-#else
- public virtual
-#endif
int MetadataToken {
get { return get_MetadataToken (this); }
}
protected
-#if NET_4_0
override
-#else
- virtual
-#endif
MethodInfo GetMethodImpl (string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
{
if (IsResource ())
}
public
-#if NET_4_0
override
-#endif
MethodInfo[] GetMethods (BindingFlags bindingFlags) {
if (IsResource ())
return new MethodInfo [0];
return (globalType != null) ? globalType.GetMethods (bindingFlags) : new MethodInfo [0];
}
-#if NET_4_0
public override
-#else
- public virtual
-#endif
void GetPEKind (out PortableExecutableKinds peKind, out ImageFileMachine machine) {
ModuleHandle.GetPEKind (out peKind, out machine);
}
-#if NET_4_0
public override
-#else
- public virtual
-#endif
Type GetType(string className, bool throwOnError, bool ignoreCase)
{
if (className == null)
return assembly.InternalGetType (this, className, throwOnError, ignoreCase);
}
-#if NET_4_0
public override
-#else
- public virtual
-#endif
bool IsDefined (Type attributeType, bool inherit)
{
return MonoCustomAttrs.IsDefined (this, attributeType, inherit);
}
public
-#if NET_4_0
override
-#endif
FieldInfo ResolveField (int metadataToken, Type [] genericTypeArguments, Type [] genericMethodArguments) {
ResolveTokenError error;
}
public
-#if NET_4_0
override
-#endif
MemberInfo ResolveMember (int metadataToken, Type [] genericTypeArguments, Type [] genericMethodArguments) {
ResolveTokenError error;
}
public
-#if NET_4_0
override
-#endif
MethodBase ResolveMethod (int metadataToken, Type [] genericTypeArguments, Type [] genericMethodArguments) {
ResolveTokenError error;
}
public
-#if NET_4_0
override
-#endif
string ResolveString (int metadataToken) {
ResolveTokenError error;
}
public
-#if NET_4_0
override
-#endif
Type ResolveType (int metadataToken, Type [] genericTypeArguments, Type [] genericMethodArguments) {
ResolveTokenError error;
}
public
-#if NET_4_0
override
-#endif
byte[] ResolveSignature (int metadataToken) {
ResolveTokenError error;
#if !NET_2_1
public
-#if NET_4_0
override
-#endif
X509Certificate GetSignerCertificate ()
{
try {
}
#endif
-#if NET_4_0
public override
-#else
- public virtual
-#endif
Type[] GetTypes()
{
return InternalGetTypes ();
}
-#if NET_4_0
public override IList<CustomAttributeData> GetCustomAttributesData () {
return CustomAttributeData.GetCustomAttributes (this);
}
-#endif
}
}
namespace System.Reflection
{
-#if NET_4_0
[ComVisible (true)]
[ComDefaultInterfaceAttribute (typeof (_ParameterInfo))]
[Serializable]
[ClassInterfaceAttribute (ClassInterfaceType.None)]
[StructLayout (LayoutKind.Sequential)]
class MonoParameterInfo : ParameterInfo {
-#else
- public partial class ParameterInfo {
-#endif
#if !FULL_AOT_RUNTIME
-#if NET_4_0
internal MonoParameterInfo (ParameterBuilder pb, Type type, MemberInfo member, int position) {
-#else
- internal ParameterInfo (ParameterBuilder pb, Type type, MemberInfo member, int position) {
-#endif
this.ClassImpl = type;
this.MemberImpl = member;
if (pb != null) {
#endif
/*FIXME this constructor looks very broken in the position parameter*/
-#if NET_4_0
internal MonoParameterInfo (ParameterInfo pinfo, Type type, MemberInfo member, int position) {
-#else
- internal ParameterInfo (ParameterInfo pinfo, Type type, MemberInfo member, int position) {
-#endif
this.ClassImpl = type;
this.MemberImpl = member;
if (pinfo != null) {
}
}
-#if NET_4_0
internal MonoParameterInfo (ParameterInfo pinfo, MemberInfo member) {
-#else
- internal ParameterInfo (ParameterInfo pinfo, MemberInfo member) {
-#endif
this.ClassImpl = pinfo.ParameterType;
this.MemberImpl = member;
this.NameImpl = pinfo.Name;
}
/* to build a ParameterInfo for the return type of a method */
-#if NET_4_0
internal MonoParameterInfo (Type type, MemberInfo member, MarshalAsAttribute marshalAs) {
-#else
- internal ParameterInfo (Type type, MemberInfo member, MarshalAsAttribute marshalAs) {
-#endif
this.ClassImpl = type;
this.MemberImpl = member;
this.NameImpl = "";
this.marshalAs = marshalAs;
}
-#if NET_4_0
public override
-#else
- public virtual
-#endif
object DefaultValue {
get {
if (ClassImpl == typeof (Decimal)) {
}
}
-#if NET_4_0
public override
-#else
- public
-#endif
object RawDefaultValue {
get {
/*FIXME right now DefaultValue doesn't throw for reflection-only assemblies. Change this once the former is fixed.*/
}
public
-#if NET_4_0
override
-#endif
int MetadataToken {
get {
if (MemberImpl is PropertyInfo) {
public
-#if NET_4_0
override
-#else
- virtual
-#endif
object[] GetCustomAttributes (bool inherit)
{
return MonoCustomAttrs.GetCustomAttributes (this, inherit);
}
public
-#if NET_4_0
override
-#else
- virtual
-#endif
object[] GetCustomAttributes (Type attributeType, bool inherit)
{
return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
public
-#if NET_4_0
override
-#else
- virtual
-#endif
bool IsDefined( Type attributeType, bool inherit) {
return MonoCustomAttrs.IsDefined (this, attributeType, inherit);
}
-#if NET_4_0
public override IList<CustomAttributeData> GetCustomAttributesData () {
return CustomAttributeData.GetCustomAttributes (this);
}
-#endif
public
-#if NET_4_0
override
-#else
- virtual
-#endif
Type[] GetOptionalCustomModifiers () {
Type[] types = GetTypeModifiers (true);
if (types == null)
}
public
-#if NET_4_0
override
-#else
- virtual
-#endif
Type[] GetRequiredCustomModifiers () {
Type[] types = GetTypeModifiers (false);
if (types == null)
ToString(), MemberTypes.Property);
}
-#if NET_4_0
public override IList<CustomAttributeData> GetCustomAttributesData () {
return CustomAttributeData.GetCustomAttributes (this);
}
-#endif
}
}
, _ParameterInfo
#endif
-#if NET_4_0
, IObjectReference
-#endif
{
protected Type ClassImpl;
protected object DefaultValueImpl;
}
#endif
-#if NET_4_0
public virtual object DefaultValue {
get { throw new NotImplementedException (); }
}
public virtual IList<CustomAttributeData> GetCustomAttributesData () {
throw new NotImplementedException ();
}
-#endif
#if !FULL_AOT_RUNTIME
internal static ParameterInfo New (ParameterBuilder pb, Type type, MemberInfo member, int position)
{
-#if NET_4_0
return new MonoParameterInfo (pb, type, member, position);
-#else
- return new ParameterInfo (pb, type, member, position);
-#endif
}
#endif
internal static ParameterInfo New (ParameterInfo pinfo, Type type, MemberInfo member, int position)
{
-#if NET_4_0
return new MonoParameterInfo (pinfo, type, member, position);
-#else
- return new ParameterInfo (pinfo, type, member, position);
-#endif
}
internal static ParameterInfo New (ParameterInfo pinfo, MemberInfo member)
{
-#if NET_4_0
return new MonoParameterInfo (pinfo, member);
-#else
- return new ParameterInfo (pinfo, member);
-#endif
}
internal static ParameterInfo New (Type type, MemberInfo member, MarshalAsAttribute marshalAs)
{
-#if NET_4_0
return new MonoParameterInfo (type, member, marshalAs);
-#else
- return new ParameterInfo (type, member, marshalAs);
-#endif
}
}
}
throw CreateNIE ();
}
-#if NET_4_0
public override bool Equals (object obj)
{
return obj == (object) this;
return true;
return !left.Equals (right);
}
-#endif
#if !MOBILE
void _PropertyInfo.GetIDsOfNames ([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId)
protected string BaseNameField;
protected Assembly MainAssembly;
// Maps cultures to ResourceSet objects
-#if NET_4_0
[Obsolete ("Use InternalGetResourceSet instead.")]
-#endif
protected Hashtable ResourceSets;
private bool ignoreCase;
Dispose(true);
}
-#if NET_4_0
public void Dispose ()
-#else
- void IDisposable.Dispose ()
-#endif
{
Dispose(true);
}
}
}
-#if NET_4_0
class StreamWrapper
{
public readonly bool CloseAfterWrite;
CloseAfterWrite = closeAfterWrite;
}
}
-#endif
SortedList resources = new SortedList (StringComparer.OrdinalIgnoreCase);
Stream stream;
FileAccess.Write);
}
-#if NET_4_0
Func <Type, string> type_name_converter;
public Func<Type, string> TypeNameConverter {
type_name_converter = value;
}
}
-#endif
public void AddResource (string name, byte[] value)
{
throw new InvalidOperationException ("The resource writer has already been closed and cannot be edited");
if (resources[name] != null)
throw new ArgumentException ("Resource already present: " + name);
-#if NET_4_0
if (value is Stream) {
Stream stream = value as Stream;
if (!stream.CanSeek)
if (!(value is MemoryStream)) // We already support MemoryStream
value = new StreamWrapper (stream, false);
}
-#endif
resources.Add(name, value);
}
resources.Add(name, value);
}
-#if NET_4_0
public void AddResource (string name, Stream value)
{
// It seems .Net adds this overload just to make the api complete,
resources.Add (name, new StreamWrapper (value, true));
}
-#endif
public void Close ()
{
BinaryWriter resman = new BinaryWriter (resman_stream,
Encoding.UTF8);
-#if NET_4_0
string type_name = null;
if (type_name_converter != null)
type_name = type_name_converter (typeof (ResourceReader));
type_name = typeof (ResourceReader).AssemblyQualifiedName;
resman.Write (type_name);
-#else
- resman.Write (typeof (ResourceReader).AssemblyQualifiedName);
-#endif
resman.Write (typeof (RuntimeResourceSet).FullName);
/* Only space for 32 bits of header len in the
break;
if (type == typeof (MemoryStream))
break;
-#if NET_4_0
if (type == typeof (StreamWrapper))
break;
-#endif
if (type==typeof(byte[]))
break;
byte [] data = ((MemoryStream) res_enum.Value).ToArray ();
res_data.Write ((uint) data.Length);
res_data.Write (data, 0, data.Length);
-#if NET_4_0
} else if (type == typeof (StreamWrapper)) {
StreamWrapper sw = (StreamWrapper) res_enum.Value;
sw.Stream.Position = 0;
if (sw.CloseAfterWrite)
sw.Stream.Close ();
-#endif
} else {
/* non-intrinsic types are
* serialized
resources = null;
}
-#if NET_4_0
byte [] ReadStream (Stream stream)
{
byte [] buff = new byte [stream.Length];
return buff;
}
-#endif
// looks like it is (similar to) DJB hash
int GetHash (string name)
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.Collections;
}
}
}
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.Runtime.InteropServices;
}
}
-#endif
RunClassConstructor (type.Value);
}
-#if NET_4_0
[MethodImplAttribute (MethodImplOptions.InternalCall)]
static extern bool SufficientExecutionStack ();
return;
throw new InsufficientExecutionStackException ();
}
-#endif
[MonoTODO("Currently a no-op")]
public static void ExecuteCodeWithGuaranteedCleanup (TryCode code, CleanupCode backoutCode, Object userData)
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
namespace System.Runtime.CompilerServices
{
}
}
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
namespace System.Runtime.ExceptionServices
{
}
}
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
namespace System.Runtime.ExceptionServices
{
}
}
-#endif
[Serializable]
[ComVisible (true)]
public sealed class ActivationArguments
-#if NET_4_0
: EvidenceBase
-#endif
{
private ActivationContext _context;
_value = value;
}
-#if NET_4_0
public BStrWrapper (object value)
{
_value = (string)value;
}
-#endif
public string WrappedObject { get { return _value; } }
}
return Path.GetDirectoryName (typeof (int).Assembly.Location);
}
-#if NET_4_0
[SecuritySafeCritical]
-#else
- [SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
-#endif
public static string GetSystemVersion ()
{
return "v" + Environment.Version.Major + "." + Environment.Version.Minor + "." + Environment.Version.Build;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.IO;
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
}
}
-#endif
ImportAsX86 = 256,
ReflectionOnlyLoading = 4096,
SerializableValueClasses = 32,
-#if NET_4_0
NoDefineVersionResource = 8192
-#endif
}
}
#endif
_sponsorshipTimeout = TimeSpan.FromMinutes (2);
}
-#if NET_4_0
[Obsolete("Call the static methods directly on this type instead", true)]
-#endif
public LifetimeServices ()
{
}
namespace System.Runtime.Remoting
{
[System.Runtime.InteropServices.ComVisible (true)]
-#if NET_4_0
static
-#else
- sealed
-#endif
public class RemotingServices
{
// Holds the identities of the objects, using uri as index
FieldSetterMethod = typeof(object).GetMethod ("FieldSetter", BindingFlags.NonPublic|BindingFlags.Instance);
FieldGetterMethod = typeof(object).GetMethod ("FieldGetter", BindingFlags.NonPublic|BindingFlags.Instance);
}
-#if !NET_4_0
- private RemotingServices () {}
-#endif
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal extern static object InternalExecute (MethodBase method, Object obj,
return true;
}
-#if NET_4_0
public void BindToName (string assemblyName, string typeName)
{
if (assemblyName != null)
if (typeName != null)
InstanceTypeName = typeName;
}
-#endif
public abstract bool RequiresTypes { get; }
}
StreamingContext _context;
FormatterAssemblyStyle _assemblyFormat;
FormatterTypeStyle _typeFormat;
-#if NET_4_0
SerializationBinder _binder;
-#endif
byte[] arrayBuffer;
int ArrayBufferLength = 4096;
SerializationObjectManager _manager;
_assemblyFormat = formatter.AssemblyFormat;
_typeFormat = formatter.TypeFormat;
_manager = new SerializationObjectManager (formatter.Context);
-#if NET_4_0
_binder = formatter.Binder;
-#endif
}
public void WriteObjectGraph (BinaryWriter writer, object obj, Header[] headers)
private void GetObjectData (object obj, out TypeMetadata metadata, out object data)
{
Type instanceType = obj.GetType();
-#if NET_4_0
string binderAssemblyName = null;
string binderTypeName = null;
if (_binder != null)
_binder.BindToName (instanceType, out binderAssemblyName, out binderTypeName);
-#endif
// Check if the formatter has a surrogate selector, if it does,
// check if the surrogate selector handles objects of the given type.
SerializationInfo info = new SerializationInfo (instanceType, new FormatterConverter ());
surrogate.GetObjectData (obj, info, _context);
metadata = new SerializableTypeMetadata (instanceType, info);
-#if NET_4_0
if (_binder != null)
metadata.BindToName (binderAssemblyName, binderTypeName);
-#endif
data = info;
return;
SerializationInfo info = new SerializationInfo (instanceType, new FormatterConverter ());
ser.GetObjectData (info, _context);
metadata = new SerializableTypeMetadata (instanceType, info);
-#if NET_4_0
if (_binder != null)
metadata.BindToName (binderAssemblyName, binderTypeName);
-#endif
data = info;
}
// Don't cache metadata info when the Context property is not null sice
// we can't control the number of possible contexts in this case
metadata = new MemberTypeMetadata (instanceType, _context);
-#if NET_4_0
if (_binder != null)
metadata.BindToName (binderAssemblyName, binderTypeName);
-#endif
return;
}
if (metadata == null) {
metadata = CreateMemberTypeMetadata (instanceType);
-#if NET_4_0
if (_binder != null)
metadata.BindToName (binderAssemblyName, binderTypeName);
-#endif
}
typesTable [instanceType] = metadata;
return GetUninitializedObject (type);
}
-#if NET_4_0
// This method was introduced in .Net due to a bug serializing objects with circular references
// which we don't appear to have, so we just return the same object.
// See http://support.microsoft.com/kb/927495/en-us/ in case of doubt.
{
return innerSurrogate;
}
-#endif
}
}
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
namespace System.Runtime.Serialization {
}
}
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
namespace System.Runtime.Serialization {
}
}
-#endif
public abstract Type BindToType (string assemblyName, string typeName);
-#if NET_4_0
public virtual void BindToName (Type serializedType, out string assemblyName, out string typeName)
{
assemblyName = null;
typeName = null;
}
-#endif
}
}
string assemblyName; // the assembly being serialized
string fullTypeName; // the type being serialized.
-#if NET_4_0
Type objectType;
bool isAssemblyNameSetExplicit;
bool isFullTypeNameSetExplicit;
-#endif
IFormatterConverter converter;
assemblyName = type.Assembly.FullName;
fullTypeName = type.FullName;
converter = new FormatterConverter ();
-#if NET_4_0
objectType = type;
-#endif
}
/* used by the runtime */
assemblyName = type.Assembly.FullName;
fullTypeName = type.FullName;
converter = new FormatterConverter ();
-#if NET_4_0
objectType = type;
-#endif
for (int i = 0; i < len; i++) {
serialized.Add (data [i].Name, data [i]);
this.converter = converter;
assemblyName = type.Assembly.FullName;
fullTypeName = type.FullName;
-#if NET_4_0
objectType = type;
-#endif
}
// Properties
if (value == null)
throw new ArgumentNullException ("Argument is null.");
assemblyName = value;
-#if NET_4_0
isAssemblyNameSetExplicit = true;
-#endif
}
}
if ( value == null)
throw new ArgumentNullException ("Argument is null.");
fullTypeName = value;
-#if NET_4_0
isFullTypeNameSetExplicit = true;
-#endif
}
}
get { return serialized.Count; }
}
-#if NET_4_0
public bool IsAssemblyNameSetExplicit {
get {
return isAssemblyNameSetExplicit;
return objectType;
}
}
-#endif
// Methods
public void AddValue (string name, object value, Type type)
fullTypeName = type.FullName;
assemblyName = type.Assembly.FullName;
-#if NET_4_0
objectType = type;
isAssemblyNameSetExplicit = false;
isFullTypeNameSetExplicit = false;
-#endif
}
public SerializationInfoEnumerator GetEnumerator ()
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
namespace System.Runtime.Versioning
{
}
}
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
namespace System.Runtime.Versioning
{
}
}
-#endif
//
using System;
-#if NET_4_0
namespace System.Runtime.Versioning
{
[AttributeUsageAttribute(AttributeTargets.Assembly, AllowMultiple = false, Inherited = false)]
}
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
namespace System.Runtime
}
}
}
-#endif
using System;
using System.Runtime.InteropServices;
-#if NET_4_0
namespace System.Runtime {
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#if NET_4_0
using System;
using System.Security.Principal;
}
}
-#endif
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#if NET_4_0
using System;
using System.Security.Principal;
}
}
-#endif
using System.Security.Principal;
using System.Runtime.InteropServices;
using System.Threading;
-#if NET_4_0
using System.Runtime.ExceptionServices;
-#endif
namespace System.Security.AccessControl
{
}
[MonoTODO]
-#if NET_4_0
[HandleProcessCorruptedStateExceptions]
-#endif
protected virtual void Persist (bool enableOwnershipPrivilege, string name, AccessControlSections includeSections)
{
throw new NotImplementedException ();
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System.Runtime.InteropServices;
using System.Security.Principal;
}
}
-#endif
return sb.ToString ();
}
-#if NET_4_0
protected static string FormatDate (DateTime date)
{
throw new NotImplementedException ();
}
-#endif
}
}
get;
}
-#if NET_4_0
public void Dispose ()
-#else
- void IDisposable.Dispose ()
-#endif
{
Dispose (true);
GC.SuppressFinalize (this); // Finalization is now unnecessary
Dispose (false);
}
-#if NET_4_0
protected virtual void Dispose (bool disposing)
{
}
-#else
- protected abstract void Dispose (bool disposing);
-#endif
public abstract void FromXmlString (string xmlString);
public abstract string ToXmlString (bool includePrivateParameters);
get { return 0; }
}
-#if NET_4_0
public void Dispose ()
-#else
- void IDisposable.Dispose ()
-#endif
{
Dispose (true);
GC.SuppressFinalize (this); // Finalization is now unnecessary
// new (2.0) X509 Chain
private const string nameX509Chain = "X509Chain";
private const string defaultX509Chain = defaultNamespace + "X509Certificates.X509Chain, " + Consts.AssemblySystem;
-#if NET_4_0
// AES
const string system_core_assembly = ", System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
const string nameAES_1 = "AES";
// SHA512 provider
const string nameSHA512Provider = "System.Security.Cryptography.SHA512CryptoServiceProvider";
const string defaultSHA512Provider = "System.Security.Cryptography.SHA512CryptoServiceProvider" + system_core_assembly;
-#endif
static CryptoConfig ()
{
// lock(this) is bad
unresolved_algorithms.Add (oidX509EnhancedKeyUsage, nameX509EnhancedKeyUsage);
// note: the default X.509Chain can also be created this way
unresolved_algorithms.Add (nameX509Chain, defaultX509Chain);
-#if NET_4_0
unresolved_algorithms.Add (nameAES_1, defaultAES_1);
unresolved_algorithms.Add (nameAES_2, defaultAES_1);
unresolved_algorithms.Add (nameAESManaged_1, defaultAESManaged);
unresolved_algorithms.Add (nameSHA384Provider, defaultSHA384Provider);
unresolved_algorithms.Add (nameSHA512Cng, defaultSHA512Cng);
unresolved_algorithms.Add (nameSHA512Provider, defaultSHA512Provider);
-#endif
Dictionary<string,string> oid = new Dictionary<string, string> (StringComparer.OrdinalIgnoreCase);
// comments here are to match with MS implementation (but not with doc)
return result;
}
-#if NET_4_0
[MonoLimitation ("nothing is FIPS certified so it never make sense to restrict to this (empty) subset")]
public static bool AllowOnlyFipsAlgorithms {
get { return false; }
oids [oid] = name;
}
}
-#endif
class CryptoHandler: SmallXmlParser.IContentHandler {
}
}
-#if NET_4_0
public bool HasFlushedFinalBlock {
get { return _flushedFinalBlock; }
}
-#endif
#if NET_4_5
public override Task FlushAsync (CancellationToken cancellationToken)
UseArchivableKey = 16,
UseNonExportableKey = 4,
UseUserProtectedKey = 32,
-#if NET_4_0
CreateEphemeralKey = 128
-#endif
}
}
namespace System.Security.Cryptography {\r
\r
[ComVisible (true)]
-#if NET_4_0
public abstract class DeriveBytes : IDisposable {
-#else
- public abstract class DeriveBytes {
-#endif
protected DeriveBytes ()
{
}\r
\r
public abstract void Reset ();
-#if NET_4_0
private bool m_disposed;
public void Dispose ()
m_disposed = true;
}
}
-#endif
}\r
}\r
Dispose (true);
}
-#if NET_4_0
public void Dispose ()
-#else
- void IDisposable.Dispose ()
-#endif
{
Dispose (true);
GC.SuppressFinalize (this); // Finalization is now unnecessary
get { return 1; }
}
-#if NET_4_0
public void Dispose ()
-#else
- void IDisposable.Dispose ()
-#endif
{
Dispose (true);
GC.SuppressFinalize (this); // Finalization is now unnecessary
}
}
-#if NET_4_0
protected override void Dispose (bool disposing)
{
// zeroize buffer
}
base.Dispose (disposing);
}
-#endif
private void Prepare (string strPassword, byte[] rgbSalt, string strHashName, int iterations)
{
}
}
-#if NET_4_0
protected override void Dispose (bool disposing)
{
base.Dispose (disposing);
}
-#endif
}
}
[ComVisible (true)]
#endif
public abstract class RandomNumberGenerator
-#if NET_4_0
: IDisposable
-#endif
{
protected RandomNumberGenerator ()
#endif
-#if NET_4_0
public void Dispose ()
{
Dispose (true);
protected virtual void Dispose (bool disposing)
{}
-#endif
}
}
_pos = 0;
_f = 0;
}
-#if NET_4_0
protected override void Dispose (bool disposing)
{
Array.Clear (_buffer, 0, _buffer.Length);
_hmac.Clear ();
base.Dispose (disposing);
}
-#endif
}
}
{
}
-#if NET_4_0
public void Dispose ()
-#else
- void IDisposable.Dispose ()
-#endif
{
_st.Clear ();
}
PaddingValue = PaddingMode.PKCS7;
}
-#if NET_4_0
public void Dispose ()
-#else
- void IDisposable.Dispose ()
-#endif
{
Dispose (true);
GC.SuppressFinalize (this); // Finalization is now unnecessary
Dispose (true);
}
-#if NET_4_0
public void Dispose ()
-#else
- void IDisposable.Dispose ()
-#endif
{
Dispose (true);
GC.SuppressFinalize (this); // Finalization is now unnecessary
}
}
-#if NET_4_0
[Obsolete]
-#endif
public bool ReflectionEmit
{
get { return reflectionEmit; }
TypeInformation = 0x00000001,
MemberAccess = 0x00000002,
-#if NET_4_0
[Obsolete]
-#endif
ReflectionEmit = 0x4,
-#if NET_4_0
[Obsolete]
-#endif
AllFlags = TypeInformation | MemberAccess | ReflectionEmit,
[ComVisible (false)]
public enum SecurityAction {
Demand = 2,
Assert = 3,
-#if NET_4_0
[Obsolete ("This requests should not be used")]
-#endif
Deny = 4,
PermitOnly = 5,
LinkDemand = 6,
InheritanceDemand = 7,
-#if NET_4_0
[Obsolete ("This requests should not be used")]
-#endif
RequestMinimum = 8,
-#if NET_4_0
[Obsolete ("This requests should not be used")]
-#endif
RequestOptional = 9,
-#if NET_4_0
[Obsolete ("This requests should not be used")]
-#endif
RequestRefuse = 10,
}
}
[Serializable]
[ComVisible (true)]
public sealed class ApplicationDirectory :
-#if NET_4_0
EvidenceBase,
-#endif
IBuiltInEvidence {
private string directory;
[Serializable]
[ComVisible (true)]
public sealed class ApplicationTrust :
-#if NET_4_0
EvidenceBase,
-#endif
ISecurityEncodable {
private ApplicationIdentity _appid;
_appid = applicationIdentity;
}
-#if NET_4_0
public
-#else
- internal
-#endif
ApplicationTrust (PermissionSet defaultGrantSet, IEnumerable<StrongName> fullTrustAssemblies)
{
if (defaultGrantSet == null)
return se;
}
-#if NET_4_0
public IList<StrongName> FullTrustAssemblies {
get {
return fullTrustAssemblies;
}
}
-#endif
// internal stuff
Merge (evidence);
}
-#if NET_4_0
[Obsolete]
-#endif
public Evidence (object[] hostEvidence, object[] assemblyEvidence)
{
if (null != hostEvidence)
// Public Properties
//
-#if NET_4_0
[Obsolete]
-#endif
public int Count {
get {
int count = 0;
// Public Methods
//
-#if NET_4_0
[Obsolete]
-#endif
public void AddAssembly (object id)
{
AssemblyEvidenceList.Add (id);
}
-#if NET_4_0
[Obsolete]
-#endif
public void AddHost (object id)
{
if (_locked && SecurityManager.SecurityEnabled) {
assemblyEvidenceList.Clear ();
}
-#if NET_4_0
[Obsolete]
-#endif
public void CopyTo (Array array, int index)
{
int hc = 0;
assemblyEvidenceList.CopyTo (array, index + hc);
}
-#if !NET_4_0
- [ComVisible (false)]
- public override bool Equals (object obj)
- {
- if (obj == null)
- return false;
- Evidence e = (obj as Evidence);
- if (e == null)
- return false;
-
- if (HostEvidenceList.Count != e.HostEvidenceList.Count)
- return false;
- if (AssemblyEvidenceList.Count != e.AssemblyEvidenceList.Count)
- return false;
-
- for (int i = 0; i < hostEvidenceList.Count; i++) {
- bool found = false;
- for (int j = 0; j < e.hostEvidenceList.Count; i++) {
- if (hostEvidenceList [i].Equals (e.hostEvidenceList [j])) {
- found = true;
- break;
- }
- }
- if (!found)
- return false;
- }
- for (int i = 0; i < assemblyEvidenceList.Count; i++) {
- bool found = false;
- for (int j = 0; j < e.assemblyEvidenceList.Count; i++) {
- if (assemblyEvidenceList [i].Equals (e.assemblyEvidenceList [j])) {
- found = true;
- break;
- }
- }
- if (!found)
- return false;
- }
-
- return true;
- }
-#endif
-#if NET_4_0
[Obsolete]
-#endif
public IEnumerator GetEnumerator ()
{
IEnumerator he = null;
return AssemblyEvidenceList.GetEnumerator ();
}
-#if !NET_4_0
- [ComVisible (false)]
- public override int GetHashCode ()
- {
- int _hashCode = 0;
- if (hostEvidenceList != null) {
- for (int i = 0; i < hostEvidenceList.Count; i++)
- _hashCode ^= hostEvidenceList [i].GetHashCode ();
- }
- if (assemblyEvidenceList != null) {
- for (int i = 0; i < assemblyEvidenceList.Count; i++)
- _hashCode ^= assemblyEvidenceList [i].GetHashCode ();
- }
-
- return _hashCode;
- }
-#endif
public IEnumerator GetHostEnumerator ()
{
return HostEvidenceList.GetEnumerator ();
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System.Security.Permissions;
}
}
-#endif
[Serializable]
[ComVisible (true)]
public sealed class GacInstalled :
-#if NET_4_0
EvidenceBase,
-#endif
IIdentityPermissionFactory, IBuiltInEvidence {
public GacInstalled ()
[Serializable]
[ComVisible (true)]
public sealed class Hash :
-#if NET_4_0
EvidenceBase,
-#endif
ISerializable, IBuiltInEvidence {
private Assembly assembly;
[Serializable]\r
[ComVisible (true)]
public sealed class PermissionRequestEvidence :\r
-#if NET_4_0\r
EvidenceBase,\r
-#endif\r
IBuiltInEvidence {
\r
private PermissionSet requested, optional, denied;\r
[Serializable]
[ComVisible (true)]
public sealed class Publisher :
-#if NET_4_0
EvidenceBase,
-#endif
IIdentityPermissionFactory, IBuiltInEvidence {
private X509Certificate m_cert;
[Serializable]
[ComVisible (true)]
public sealed class Site:
-#if NET_4_0
EvidenceBase,
-#endif
IIdentityPermissionFactory, IBuiltInEvidence {
internal string origin_site;
[Serializable]
[ComVisible (true)]
public sealed class StrongName :
-#if NET_4_0
EvidenceBase,
-#endif
IIdentityPermissionFactory, IBuiltInEvidence {
private StrongNamePublicKeyBlob publickey;
[Serializable]
[ComVisible (true)]
public sealed class Url :
-#if NET_4_0
EvidenceBase,
-#endif
IIdentityPermissionFactory, IBuiltInEvidence {
private string origin_url;
[Serializable]
[ComVisible (true)]
public sealed class Zone :
-#if NET_4_0
EvidenceBase,
-#endif
IIdentityPermissionFactory, IBuiltInEvidence {
private SecurityZone zone;
using System.Runtime.ConstrainedExecution;
using System.Security.Cryptography;
using System.Security.Permissions;
-#if NET_4_0
using System.Runtime.ExceptionServices;
-#endif
namespace System.Security {
}
}
-#if NET_4_0
[HandleProcessCorruptedStateExceptions]
-#endif
public void AppendChar (char c)
{
if (disposed)
length = 0;
}
-#if NET_4_0
[HandleProcessCorruptedStateExceptions]
-#endif
public void InsertAt (int index, char c)
{
if (disposed)
read_only = true;
}
-#if NET_4_0
[HandleProcessCorruptedStateExceptions]
-#endif
public void RemoveAt (int index)
{
if (disposed)
}
}
-#if NET_4_0
[HandleProcessCorruptedStateExceptions]
-#endif
public void SetAt (int index, char c)
{
if (disposed)
namespace System.Security {
public sealed class SecurityContext
-#if NET_4_0
: IDisposable
-#endif
{
private bool _capture;
private IntPtr _winid;
return capture;
}
-#if NET_4_0
public void Dispose ()
{
}
-#endif
// internal stuff
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
namespace System.Security {
}
}
-#endif
#else
[MonoTODO ("Only supported by the runtime when CoreCLR is enabled")]
-#if NET_4_0
[AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct |
AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method |
AttributeTargets.Field | AttributeTargets.Interface | AttributeTargets.Delegate,
AllowMultiple=false, Inherited=false)]
-#else
- [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct |
- AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Event |
- AttributeTargets.Field | AttributeTargets.Interface | AttributeTargets.Delegate,
- AllowMultiple=false, Inherited=false)]
-#endif
public sealed class SecurityCriticalAttribute : Attribute {
private SecurityCriticalScope _scope;
}
}
-#if NET_4_0
[Obsolete]
-#endif
public SecurityCriticalScope Scope {
get { return _scope; }
}
namespace System.Security {
-#if NET_4_0
[Obsolete]
-#endif
public enum SecurityCriticalScope {
Explicit,
Everything
// properties
-#if NET_4_0
[Obsolete]
-#endif
extern public static bool CheckExecutionRights {
[MethodImplAttribute (MethodImplOptions.InternalCall)]
get;
origin = new ArrayList ();
}
-#if NET_4_0
[Obsolete]
-#endif
public static bool IsGranted (IPermission perm)
{
if (perm == null)
return null;
}
-#if NET_4_0
[Obsolete]
-#endif
[SecurityPermission (SecurityAction.Demand, ControlPolicy = true)]
public static PolicyLevel LoadPolicyLevelFromFile (string path, PolicyLevelType type)
{
return pl;
}
-#if NET_4_0
[Obsolete]
-#endif
[SecurityPermission (SecurityAction.Demand, ControlPolicy = true)]
public static PolicyLevel LoadPolicyLevelFromString (string str, PolicyLevelType type)
{
return pl;
}
-#if NET_4_0
[Obsolete]
-#endif
[SecurityPermission (SecurityAction.Demand, ControlPolicy = true)]
public static IEnumerator PolicyHierarchy ()
{
return Hierarchy;
}
-#if NET_4_0
[Obsolete]
-#endif
public static PermissionSet ResolvePolicy (Evidence evidence)
{
// no evidence, no permission
return ps;
}
-#if NET_4_0
[Obsolete]
-#endif
[MonoTODO ("(2.0) more tests are needed")]
public static PermissionSet ResolvePolicy (Evidence[] evidences)
{
return ps;
}
-#if NET_4_0
[Obsolete]
-#endif
public static PermissionSet ResolveSystemPolicy (Evidence evidence)
{
// no evidence, no permission
static private SecurityPermission _execution = new SecurityPermission (SecurityPermissionFlag.Execution);
-#if NET_4_0
[Obsolete]
-#endif
public static PermissionSet ResolvePolicy (Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, out PermissionSet denied)
{
PermissionSet resolved = ResolvePolicy (evidence);
return resolved;
}
-#if NET_4_0
[Obsolete]
-#endif
public static IEnumerator ResolvePolicyGroups (Evidence evidence)
{
if (evidence == null)
return al.GetEnumerator ();
}
-#if NET_4_0
[Obsolete]
-#endif
[SecurityPermission (SecurityAction.Demand, ControlPolicy = true)]
public static void SavePolicy ()
{
}
}
-#if NET_4_0
[Obsolete]
-#endif
[SecurityPermission (SecurityAction.Demand, ControlPolicy = true)]
public static void SavePolicyLevel (PolicyLevel level)
{
}
#pragma warning restore 169
-#if NET_4_0
public static PermissionSet GetStandardSandbox (Evidence evidence)
{
if (evidence == null)
{
throw new NotImplementedException ();
}
-#endif
}
}
// properties
-#if NET_4_0
[Obsolete]
-#endif
public static bool CheckExecutionRights {
get { return false; }
set { ; }
origin = new ArrayList ();
}
-#if NET_4_0
[Obsolete]
-#endif
public static bool IsGranted (IPermission perm)
{
return true;
}
-#if NET_4_0
[Obsolete]
-#endif
[SecurityPermission (SecurityAction.Demand, ControlPolicy = true)]
public static PolicyLevel LoadPolicyLevelFromFile (string path, PolicyLevelType type)
{
throw new NotSupportedException ();
}
-#if NET_4_0
[Obsolete]
-#endif
[SecurityPermission (SecurityAction.Demand, ControlPolicy = true)]
public static PolicyLevel LoadPolicyLevelFromString (string str, PolicyLevelType type)
{
throw new NotSupportedException ();
}
-#if NET_4_0
[Obsolete]
-#endif
[SecurityPermission (SecurityAction.Demand, ControlPolicy = true)]
public static IEnumerator PolicyHierarchy ()
{
throw new NotSupportedException ();
}
-#if NET_4_0
[Obsolete]
-#endif
public static PermissionSet ResolvePolicy (Evidence evidence)
{
throw new NotSupportedException ();
}
-#if NET_4_0
[Obsolete]
-#endif
public static PermissionSet ResolvePolicy (Evidence[] evidences)
{
throw new NotSupportedException ();
}
-#if NET_4_0
[Obsolete]
-#endif
public static PermissionSet ResolveSystemPolicy (Evidence evidence)
{
throw new NotSupportedException ();
}
-#if NET_4_0
[Obsolete]
-#endif
public static PermissionSet ResolvePolicy (Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, out PermissionSet denied)
{
throw new NotSupportedException ();
}
-#if NET_4_0
[Obsolete]
-#endif
public static IEnumerator ResolvePolicyGroups (Evidence evidence)
{
throw new NotSupportedException ();
}
-#if NET_4_0
[Obsolete]
-#endif
[SecurityPermission (SecurityAction.Demand, ControlPolicy = true)]
public static void SavePolicy ()
{
throw new NotSupportedException ();
}
-#if NET_4_0
[Obsolete]
-#endif
[SecurityPermission (SecurityAction.Demand, ControlPolicy = true)]
public static void SavePolicyLevel (PolicyLevel level)
{
throw new NotSupportedException ();
}
-#if NET_4_0
public static PermissionSet GetStandardSandbox (Evidence evidence)
{
if (evidence == null)
{
throw new NotImplementedException ();
}
-#endif
}
}
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
namespace System.Security {
}
}
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
namespace System.Security {
}
}
-#endif
return this;
}
-#if NET_4_0
public StringBuilder Clear ()
{
Length = 0;
return this;
}
-#endif
[ComVisible (false)]
public StringBuilder AppendLine ()
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Collections.Generic;
}
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Collections.Generic;
}
}
-#endif
//
//
-#if NET_4_0
using System;
using System.Threading;
using System.Collections.Generic;
void PulseAll ();
}
}
-#endif
//
//
-#if NET_4_0
using System;
using System.Collections.Generic;
using System.Collections.Concurrent;
#endregion
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
namespace System.Threading.Tasks
}
}
}
-#endif
//
//
-#if NET_4_0
using System;
using System.Threading;
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Threading;
}
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Collections.Generic;
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Threading;
}
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Threading;
}
}
-#endif
//
//
-#if NET_4_0
using System;
using System.Threading;
#endregion
}
}
-#endif
//
//
-#if NET_4_0
using System.Threading;
public abstract void Invoke (Task owner, object state, Task context);
}
}
-#endif
//
//
-#if NET_4_0
using System;
using System.Runtime.Serialization;
}
}
}
-#endif
//
//
-#if NET_4_0
using System;
using System.Threading;
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Collections.Generic;
}
}
}
-#endif
//
//
-#if NET_4_0
namespace System.Threading.Tasks
{
}
}
-#endif
//
//
-#if NET_4_0
using System.Collections.Generic;
}
}
-#endif
//
//
-#if NET_4_0
using System;
namespace System.Threading.Tasks
ExecuteSynchronously = 0x80000,
}
}
-#endif
//
//
-#if NET_4_0
namespace System.Threading.Tasks
{
#endif
}
}
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.Diagnostics;
}
}
-#endif
//
//
-#if NET_4_0
using System;
using System.Collections.Concurrent;
}
}
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
namespace System.Threading.Tasks
{
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
namespace System.Threading.Tasks
{
}
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
namespace System.Threading.Tasks
{
}
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System.Collections.Generic;
using System.Diagnostics;
}
}
}
-#endif
//
//
-#if NET_4_0
using System;
using System.Runtime.Serialization;
}
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
namespace System.Threading.Tasks
Faulted
}
}
-#endif
//
//
-#if NET_4_0
using System.Runtime.CompilerServices;
#endif
}
}
-#endif
//
//
-#if NET_4_0
using System.Collections.Generic;
}
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
namespace System.Threading.Tasks
}
}
-#endif
//
_t = null;
}
-#if NET_4_0
public void Dispose ()
-#else
- void IDisposable.Dispose ()
-#endif
{
if (_t != null) {
Undo ();
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Threading;
}
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
namespace System.Threading
}
}
}
-#endif
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System.Collections.Generic;
using System.Collections.Concurrent;
}
}
}
-#endif
// NOTE: This method doesn't show in the class library status page because
// it cannot be "found" with the StrongNameIdentityPermission for ECMA key.
// But it's there!
-#if NET_4_0
[SecurityCritical]
-#else
- [SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
- [StrongNameIdentityPermission (SecurityAction.LinkDemand, PublicKey="00000000000000000400000000000000")]
-#endif
static public CompressedStack GetCompressedStack ()
{
// Note: CompressedStack.GetCompressedStack doesn't return null
}
[MonoTODO ("incomplete")]
-#if NET_4_0
[SecurityCritical]
-#else
- [ReflectionPermission (SecurityAction.Demand, MemberAccess = true)]
-#endif
public void GetObjectData (SerializationInfo info, StreamingContext context)
{
if (info == null)
throw new ArgumentNullException ("info");
}
-#if NET_4_0
[SecurityCritical]
-#else
- [SecurityPermission (SecurityAction.LinkDemand, Infrastructure = true)]
-#endif
static public void Run (CompressedStack compressedStack, ContextCallback callback, object state)
{
if (compressedStack == null)
//
//
-#if NET_4_0
namespace System.Threading
{
}
}
}
-#endif
namespace System.Threading {
[Serializable]
public sealed partial class ExecutionContext : ISerializable
-#if NET_4_0
, IDisposable
-#endif
{
internal struct Switcher
{
return new ExecutionContext (this);
}
-#if NET_4_0
public void Dispose ()
{
#if !MOBILE
_sc.Dispose ();
#endif
}
-#endif
[MonoTODO]
[ReflectionPermission (SecurityAction.Demand, MemberAccess = true)]
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
namespace System.Threading
{
}
}
}
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
}
}
-#endif
*/
-#if NET_4_0
using System;
using System.Runtime.Serialization;
}
}
-#endif
//
//
-#if NET_4_0
namespace System.Threading
{
}
}
}
-#endif
}
}
-#if NET_4_0
[MethodImplAttribute(MethodImplOptions.InternalCall)]
extern static void try_enter_with_atomic_var (object obj, int millisecondsTimeout, ref bool lockTaken);
try_enter_with_atomic_var (obj, millisecondsTimeout, ref lockTaken);
}
-#endif
[MethodImplAttribute(MethodImplOptions.InternalCall)]
extern static bool Monitor_test_owner (object obj);
using System.Threading.Tasks;
#endif
-#if NET_4_0
namespace System.Threading
{
[System.Diagnostics.DebuggerDisplayAttribute ("Current Count = {currCount}")]
}
}
-#endif
//
//
-#if NET_4_0
using System;
using System.Collections.Concurrent;
}
}
}
-#endif
//
//
-#if NET_4_0
using System;
namespace System.Threading
}
}
}
-#endif
ResetAbort_internal ();
}
-#if NET_4_0
[HostProtectionAttribute (SecurityAction.LinkDemand, Synchronization = true, ExternalThreading = true)]
[MethodImplAttribute(MethodImplOptions.InternalCall)]
[ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)]
public extern static bool Yield ();
-#endif
[MethodImplAttribute(MethodImplOptions.InternalCall)]
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-#if NET_4_0
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
}
}
-#endif
Dispose(true);
}
-#if NET_4_0
public void Dispose ()
-#else
- void IDisposable.Dispose ()
-#endif
{
Close ();
}
//
//
-#if NET_4_0
using System;
namespace System.Threading
}
}
}
-#endif
namespace System
{
-#if NET_4_0
#if MOBILE
[TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#elif NET_4_0
+#else
[TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
#endif
public delegate void Action ();
#if MOBILE
[TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#elif NET_4_0
+#else
[TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
#endif
public delegate void Action <in T1, in T2> (T1 arg1, T2 arg2);
#if MOBILE
[TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#elif NET_4_0
+#else
[TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
#endif
public delegate void Action <in T1, in T2, in T3> (T1 arg1, T2 arg2, T3 arg3);
#if MOBILE
[TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#elif NET_4_0
+#else
[TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
#endif
public delegate void Action <in T1, in T2, in T3, in T4> (T1 arg1, T2 arg2, T3 arg3, T4 arg4);
public delegate void Action <in T1, in T2, in T3, in T4, in T5, in T6> (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6);
public delegate void Action <in T1, in T2, in T3, in T4, in T5, in T6, in T7> (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7);
public delegate void Action <in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8> (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8);
-#else
- public delegate void Action <T> (T obj);
-
- // Used internally
- delegate void Action <T1, T2, T3> (T1 arg1, T2 arg2, T3 arg3);
-#endif
}
activationAttributes, null);
}
-#if NET_4_0
[Obsolete]
-#endif
public static ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName, bool ignoreCase,
BindingFlags bindingAttr, Binder binder, object [] args,
CultureInfo culture, object [] activationAttributes,
activationAttributes, null);
}
-#if NET_4_0
[Obsolete]
-#endif
public static ObjectHandle CreateInstance (string assemblyName, string typeName, bool ignoreCase,
BindingFlags bindingAttr, Binder binder, object [] args,
CultureInfo culture, object [] activationAttributes, Evidence securityInfo)
}
-#if NET_4_0
[Obsolete]
-#endif
public static ObjectHandle CreateInstanceFrom (AppDomain domain, string assemblyFile, string typeName,
bool ignoreCase, BindingFlags bindingAttr, Binder binder,
object [] args, CultureInfo culture,
return domain.CreateInstance (assemblyName, typeName);
}
-#if NET_4_0
[Obsolete]
-#endif
public static ObjectHandle CreateInstance (AppDomain domain, string assemblyName, string typeName,
bool ignoreCase, BindingFlags bindingAttr, Binder binder,
object [] args, CultureInfo culture,
throw new NotImplementedException ();
}
-#if NET_4_0
public static ObjectHandle CreateInstance (string assemblyName, string typeName, bool ignoreCase,
BindingFlags bindingAttr, Binder binder, object [] args,
CultureInfo culture, object [] activationAttributes)
return domain.CreateInstanceFrom (assemblyFile, typeName, ignoreCase, bindingAttr, binder, args, culture, activationAttributes);
}
-#endif
}
}
//
//
-#if NET_4_0
using System;
using System.Collections.ObjectModel;
using System.Collections.Generic;
}
}
}
-#endif
get { return (PermissionSet)_granted; }
}
-#if NET_4_0
public PermissionSet PermissionSet {
get { return (PermissionSet)_granted ?? (PermissionSet)(_granted = new PermissionSet (PermissionState.Unrestricted)); }
}
-#endif
[MethodImplAttribute (MethodImplOptions.InternalCall)]
private static extern AppDomain getCurDomain ();
return Activator.CreateInstance (assemblyName, typeName, activationAttributes);
}
-#if NET_4_0
[Obsolete ("Use an overload that does not take an Evidence parameter")]
-#endif
public ObjectHandle CreateInstance (string assemblyName, string typeName, bool ignoreCase, BindingFlags bindingAttr,
Binder binder, object[] args, CultureInfo culture, object[] activationAttributes,
Evidence securityAttributes)
return (oh != null) ? oh.Unwrap () : null;
}
-#if NET_4_0
[Obsolete ("Use an overload that does not take an Evidence parameter")]
-#endif
public object CreateInstanceAndUnwrap (string assemblyName, string typeName, bool ignoreCase,
BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture,
object[] activationAttributes, Evidence securityAttributes)
return (oh != null) ? oh.Unwrap () : null;
}
-#if NET_4_0
public ObjectHandle CreateInstance (string assemblyName, string typeName, bool ignoreCase, BindingFlags bindingAttr,
Binder binder, object[] args, CultureInfo culture, object[] activationAttributes)
{
return (oh != null) ? oh.Unwrap () : null;
}
-#endif
public ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName)
{
return Activator.CreateInstanceFrom (assemblyFile, typeName, activationAttributes);
}
-#if NET_4_0
[Obsolete ("Use an overload that does not take an Evidence parameter")]
-#endif
public ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName, bool ignoreCase,
BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture,
object[] activationAttributes, Evidence securityAttributes)
return (oh != null) ? oh.Unwrap () : null;
}
-#if NET_4_0
[Obsolete ("Use an overload that does not take an Evidence parameter")]
-#endif
public object CreateInstanceFromAndUnwrap (string assemblyName, string typeName, bool ignoreCase,
BindingFlags bindingAttr, Binder binder, object[] args,
CultureInfo culture, object[] activationAttributes,
return DefineDynamicAssembly (name, access, null, null, null, null, null, false);
}
-#if NET_4_0
[Obsolete ("Declarative security for assembly level is no longer enforced")]
-#endif
public AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, Evidence evidence)
{
return DefineDynamicAssembly (name, access, null, evidence, null, null, null, false);
return DefineDynamicAssembly (name, access, dir, null, null, null, null, false);
}
-#if NET_4_0
[Obsolete ("Declarative security for assembly level is no longer enforced")]
-#endif
public AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, string dir,
Evidence evidence)
{
return DefineDynamicAssembly (name, access, dir, evidence, null, null, null, false);
}
-#if NET_4_0
[Obsolete ("Declarative security for assembly level is no longer enforced")]
-#endif
public AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access,
PermissionSet requiredPermissions,
PermissionSet optionalPermissions,
refusedPermissions, false);
}
-#if NET_4_0
[Obsolete ("Declarative security for assembly level is no longer enforced")]
-#endif
public AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, Evidence evidence,
PermissionSet requiredPermissions,
PermissionSet optionalPermissions,
refusedPermissions, false);
}
-#if NET_4_0
[Obsolete ("Declarative security for assembly level is no longer enforced")]
-#endif
public AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, string dir,
PermissionSet requiredPermissions,
PermissionSet optionalPermissions,
refusedPermissions, false);
}
-#if NET_4_0
[Obsolete ("Declarative security for assembly level is no longer enforced")]
-#endif
public AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, string dir,
Evidence evidence,
PermissionSet requiredPermissions,
refusedPermissions, false);
}
-#if NET_4_0
[Obsolete ("Declarative security for assembly level is no longer enforced")]
-#endif
public AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, string dir,
Evidence evidence,
PermissionSet requiredPermissions,
}
// NET 3.5 method
-#if NET_4_0
[Obsolete ("Declarative security for assembly level is no longer enforced")]
-#endif
public AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, string dir,
Evidence evidence,
PermissionSet requiredPermissions,
return DefineDynamicAssembly (name, access, null, null, null, null, null, false, assemblyAttributes);
}
-#if NET_4_0
public AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, string dir, bool isSynchronized, IEnumerable<CustomAttributeBuilder> assemblyAttributes)
{
return DefineDynamicAssembly (name, access, dir, null, null, null, null, isSynchronized, assemblyAttributes);
{
return DefineDynamicAssembly (name, access, assemblyAttributes);
}
-#endif
internal AssemblyBuilder DefineInternalDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access)
{
return ExecuteAssembly (assemblyFile, (Evidence)null, null);
}
-#if NET_4_0
[Obsolete ("Use an overload that does not take an Evidence parameter")]
-#endif
public int ExecuteAssembly (string assemblyFile, Evidence assemblySecurity)
{
return ExecuteAssembly (assemblyFile, assemblySecurity, null);
}
-#if NET_4_0
[Obsolete ("Use an overload that does not take an Evidence parameter")]
-#endif
public int ExecuteAssembly (string assemblyFile, Evidence assemblySecurity, string[] args)
{
Assembly a = Assembly.LoadFrom (assemblyFile, assemblySecurity);
return ExecuteAssemblyInternal (a, args);
}
-#if NET_4_0
[Obsolete ("Use an overload that does not take an Evidence parameter")]
-#endif
public int ExecuteAssembly (string assemblyFile, Evidence assemblySecurity, string[] args, byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
{
Assembly a = Assembly.LoadFrom (assemblyFile, assemblySecurity, hashValue, hashAlgorithm);
}
-#if NET_4_0
public int ExecuteAssembly (string assemblyFile, string[] args)
{
Assembly a = Assembly.LoadFrom (assemblyFile, null);
Assembly a = Assembly.LoadFrom (assemblyFile, null, hashValue, hashAlgorithm);
return ExecuteAssemblyInternal (a, args);
}
-#endif
int ExecuteAssemblyInternal (Assembly a, string[] args)
{
return result;
}
-#if NET_4_0
[Obsolete ("Use an overload that does not take an Evidence parameter")]
-#endif
public Assembly Load (AssemblyName assemblyRef, Evidence assemblySecurity)
{
if (assemblyRef == null)
return Load (assemblyString, null, false);
}
-#if NET_4_0
[Obsolete ("Use an overload that does not take an Evidence parameter")]
-#endif
public Assembly Load (string assemblyString, Evidence assemblySecurity)
{
return Load (assemblyString, assemblySecurity, false);
[MethodImplAttribute (MethodImplOptions.InternalCall)]
internal extern Assembly LoadAssemblyRaw (byte[] rawAssembly, byte[] rawSymbolStore, Evidence securityEvidence, bool refonly);
-#if NET_4_0
[Obsolete ("Use an overload that does not take an Evidence parameter")]
-#endif
public Assembly Load (byte[] rawAssembly, byte[] rawSymbolStore, Evidence securityEvidence)
{
return Load (rawAssembly, rawSymbolStore, securityEvidence, false);
assembly.FromByteArray = true;
return assembly;
}
-#if NET_4_0
[Obsolete ("AppDomain policy levels are obsolete")]
-#endif
[SecurityPermission (SecurityAction.Demand, ControlPolicy = true)]
public void SetAppDomainPolicy (PolicyLevel domainPolicy)
{
foreach (Delegate eh in invocation_list) {
ResolveEventHandler handler = (ResolveEventHandler) eh;
-#if NET_4_0
Assembly assembly = handler (this, new ResolveEventArgs (name, requesting));
-#else
- Assembly assembly = handler (this, new ResolveEventArgs (name));
-#endif
if (assembly != null)
return assembly;
}
public event EventHandler<FirstChanceExceptionEventArgs> FirstChanceException;
#endif
-#if NET_4_0
[MonoTODO]
public bool IsHomogenous {
get { return true; }
public bool IsFullyTrusted {
get { return true; }
}
-#endif
#pragma warning disable 649
#if !MOBILE
return ExecuteAssemblyByName (assemblyName, (Evidence)null, null);
}
-#if NET_4_0
[Obsolete ("Use an overload that does not take an Evidence parameter")]
-#endif
public int ExecuteAssemblyByName (string assemblyName, Evidence assemblySecurity)
{
return ExecuteAssemblyByName (assemblyName, assemblySecurity, null);
}
-#if NET_4_0
[Obsolete ("Use an overload that does not take an Evidence parameter")]
-#endif
public int ExecuteAssemblyByName (string assemblyName, Evidence assemblySecurity, params string[] args)
{
Assembly a = Assembly.Load (assemblyName, assemblySecurity);
return ExecuteAssemblyInternal (a, args);
}
-#if NET_4_0
[Obsolete ("Use an overload that does not take an Evidence parameter")]
-#endif
public int ExecuteAssemblyByName (AssemblyName assemblyName, Evidence assemblySecurity, params string[] args)
{
Assembly a = Assembly.Load (assemblyName, assemblySecurity);
return ExecuteAssemblyInternal (a, args);
}
-#if NET_4_0
public int ExecuteAssemblyByName (string assemblyName, params string[] args)
{
Assembly a = Assembly.Load (assemblyName, null);
return ExecuteAssemblyInternal (a, args);
}
-#endif
public bool IsDefaultAppDomain ()
{
}
#endif
-#if NET_4_0
List<string> compatibility_switch;
public bool? IsCompatibilitySwitchSet (string value)
public TimeSpan MonitoringTotalProcessorTime {
get { throw new NotImplementedException (); }
}
-#endif
}
}
[ComVisible (true)]
// FIXME: We are doing way to many double/triple exception checks for the overloaded functions"
public abstract class Array : ICloneable, ICollection, IList, IEnumerable
-#if NET_4_0
, IStructuralComparable, IStructuralEquatable
-#endif
{
// Constructor
private Array ()
return new SimpleEnumerator (this);
}
-#if NET_4_0
int IStructuralComparable.CompareTo (object other, IComparer comparer)
{
if (other == null)
hash = ((hash << 7) + hash) ^ comparer.GetHashCode (GetValueImpl (i));
return hash;
}
-#endif
[ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
public int GetUpperBound (int dimension)
// categories are available, 0xff otherwise.
private readonly static byte category_check_pair;
-#if NET_4_0
private const int CategoryDataVersion = 4;
-#else
- private const int CategoryDataVersion = 2;
-#endif
[MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
private unsafe static extern void GetDataTablePointers (int category_data_version,
}
}
-#if NET_4_0
public void Dispose ()
-#else
- void IDisposable.Dispose ()
-#endif
{
// nop
}
namespace System
{
-#if NET_4_0
public delegate int Comparison <in T> (T x, T y);
-#else
- public delegate int Comparison <T> (T x, T y);
-#endif
}
{
[Serializable]
[ComVisible (true)]
-#if !NET_4_0
- [Obsolete ("this type is obsoleted in 2.0 profile")]
-#endif
public class ContextMarshalException : SystemException
{
const int Result = unchecked ((int)0x80131504);
namespace System
{
-#if NET_4_0
public delegate TOutput Converter <in TInput, out TOutput> (TInput input);
-#else
- public delegate TOutput Converter <TInput, TOutput> (TInput input);
-#endif
}
[Serializable]
[System.Runtime.InteropServices.ComVisible (true)]
public struct Decimal: IFormattable, IConvertible, IComparable, IComparable<Decimal>, IEquatable <Decimal>
-#if NET_4_0
, IDeserializationCallback
-#endif
{
public const decimal MinValue = -79228162514264337593543950335m;
public const decimal MaxValue = 79228162514264337593543950335m;
return ToString ("G", provider);
}
-#if NET_4_0
void IDeserializationCallback.OnDeserialization(object sender)
{
}
-#endif
#if !MSTEST
[MethodImplAttribute(MethodImplOptions.InternalCall)]
return (*((long*)&d)).GetHashCode ();
}
-#if NET_4_0
public static bool operator==(double left, double right)
{
return left == right;
{
return left <= right;
}
-#endif
public static bool IsInfinity (double d)
{
return true;
}
-#if NET_4_0
public static bool TryParse<TEnum> (string value, out TEnum result) where TEnum : struct
{
return TryParse (value, false, out result);
return Parse (tenum_type, value, ignoreCase, out result);
}
-#endif
[MethodImplAttribute (MethodImplOptions.InternalCall)]
private extern int compare_value_to (object other);
"\"x\",\"F\",\"f\",\"D\" or \"d\".");
}
-#if NET_4_0
public bool HasFlag (Enum flag)
{
var val = get_value ();
return ((mvalue & fvalue) == fvalue);
}
-#endif
}
}
ProgramFiles = 0x26,
MyPictures = 0x27,
CommonProgramFiles = 0x2b,
-#if NET_4_0
MyVideos = 0x0e,
-#endif
-#if NET_4_0
NetworkShortcuts = 0x13,
Fonts = 0x14,
CommonStartMenu = 0x16,
LocalizedResources = 0x39,
CommonOemLinks = 0x3a,
CDBurning = 0x3b,
-#endif
}
-#if NET_4_0
public
-#else
- internal
-#endif
enum SpecialFolderOption {
None = 0,
DoNotVerify = 0x4000,
[MethodImplAttribute (MethodImplOptions.InternalCall)]
private extern static string GetWindowsFolderPath (int folder);
-#if NET_4_0
public
-#endif
static string GetFolderPath(SpecialFolder folder, SpecialFolderOption option)
{
SecurityManager.EnsureElevatedPermissions (); // this is a no-op outside moonlight
case SpecialFolder.Templates:
return ReadXdgUserDir (config, home, "XDG_TEMPLATES_DIR", "Templates");
-#if NET_4_0
case SpecialFolder.MyVideos:
return ReadXdgUserDir (config, home, "XDG_VIDEOS_DIR", "Videos");
-#endif
-#if NET_4_0
case SpecialFolder.CommonTemplates:
return "/usr/share/templates";
case SpecialFolder.Fonts:
return Path.Combine (home, "Library", "Fonts");
return Path.Combine (home, ".fonts");
-#endif
// these simply dont exist on Linux
// The spec says if a folder doesnt exist, we
// should return ""
else
return String.Empty;
-#if NET_4_0
// #2873
case SpecialFolder.UserProfile:
return home;
-#endif
case SpecialFolder.Programs:
case SpecialFolder.SendTo:
case SpecialFolder.Recent:
case SpecialFolder.CommonProgramFiles:
case SpecialFolder.System:
-#if NET_4_0
case SpecialFolder.NetworkShortcuts:
case SpecialFolder.CommonStartMenu:
case SpecialFolder.CommonPrograms:
case SpecialFolder.LocalizedResources:
case SpecialFolder.CommonOemLinks:
case SpecialFolder.CDBurning:
-#endif
return String.Empty;
// This is where data common to all users goes
case SpecialFolder.CommonApplicationData:
throw new NotImplementedException ();
}
-#if NET_4_0
[SecurityCritical]
public static void FailFast (string message, Exception exception)
{
throw new NotImplementedException ();
}
-#endif
-#if NET_4_0
public static bool Is64BitOperatingSystem {
get { return IntPtr.Size == 8; } // FIXME: is this good enough?
}
public static int SystemPageSize {
get { return GetPageSize (); }
}
-#endif
-#if NET_4_0
public
-#else
- internal
-#endif
static bool Is64BitProcess {
get { return IntPtr.Size == 8; }
}
}
}
-#if NET_4_0
[MonoTODO]
protected event EventHandler<SafeSerializationEventArgs> SerializeObjectState {
add {
remove {
}
}
-#endif
public virtual string Source {
get {
namespace System
{
-#if NET_4_0
[Obsolete]
-#endif
[Serializable]
[ComVisible (true)]
public sealed class ExecutionEngineException : SystemException
namespace System {
-#if NET_4_0
#if MOBILE
[TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#elif NET_4_0
+#else
[TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
#endif
public delegate TResult Func<out TResult> ();
#if MOBILE
[TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#elif NET_4_0
+#else
[TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
#endif
public delegate TResult Func<in T, out TResult> (T arg);
#if MOBILE
[TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#elif NET_4_0
+#else
[TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
#endif
public delegate TResult Func<in T1, in T2, out TResult> (T1 arg1, T2 arg2);
#if MOBILE
[TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#elif NET_4_0
+#else
[TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
#endif
public delegate TResult Func<in T1, in T2, in T3, out TResult> (T1 arg1, T2 arg2, T3 arg3);
#if MOBILE
[TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#elif NET_4_0
+#else
[TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
#endif
public delegate TResult Func<in T1, in T2, in T3, in T4, out TResult> (T1 arg1, T2 arg2, T3 arg3, T4 arg4);
public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, out TResult> (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6);
public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, in T7, out TResult> (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7);
public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, out TResult> (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8);
-#else
- // Used internally
- delegate TResult Func<T1, T2, T3, TResult> (T1 arg1, T2 arg2, T3 arg3);
-#endif
}
RecordPressure (-bytesAllocated);
}
-#if NET_4_0
[PermissionSetAttribute (SecurityAction.LinkDemand, Name = "FullTrust")]
[MonoTODO]
public static GCNotificationStatus WaitForFullGCApproach () {
public static void CancelFullGCNotification () {
throw new NotImplementedException ();
}
-#endif
-#if NET_4_0
[MethodImplAttribute (MethodImplOptions.InternalCall)]
internal extern static void register_ephemeron_array (Ephemeron[] array);
extern static object get_ephemeron_tombstone ();
internal static readonly object EPHEMERON_TOMBSTONE = get_ephemeron_tombstone ();
-#endif
}
}
return !( a.Equals (b) );
}
-#if NET_4_0
public static Guid Parse (string input)
{
if (input == null)
var parser = new GuidParser (input);
return parser.Parse (ParseFormat (format), out result);
}
-#endif
static Format ParseFormat (string format)
{
case 'P':
case 'p':
return Format.P;
-#if NET_4_0
case 'X':
case 'x':
return Format.X;
-#endif
}
throw new FormatException (
-#if NET_4_0
"Format String can be only one of \"D\", \"d\", \"N\", \"n\", \"P\", \"p\", \"B\", \"b\", \"X\" or \"x\""
-#else
- "Format String can be only one of \"D\", \"d\", \"N\", \"n\", \"P\", \"p\", \"B\" or \"b\""
-#endif
);
}
}
int CompareTo (object obj);
}
-#if NET_4_0
public interface IComparable <in T> {
int CompareTo (T other);
}
-#else
- public interface IComparable <T> {
- int CompareTo (T other);
- }
-#endif
}
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
namespace System
{
}
}
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
namespace System
{
}
}
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
}
}
-#endif
return value.m_value;
}
-#if NET_4_0
[ReliabilityContract (Consistency.MayCorruptInstance, Cer.MayFail)]
public static IntPtr Add (IntPtr pointer, int offset)
{
{
return (IntPtr) (unchecked (((byte *) pointer) - offset));
}
-#else
- /* Needed by Marshal.cs */
- internal static IntPtr Add (IntPtr pointer, int offset)
- {
- return (IntPtr) (unchecked (((byte *) pointer) + offset));
- }
-#endif
}
}
[Serializable]
#if MOBILE
[TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#elif NET_4_0
+#else
[TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
#endif
-#if NET_4_0
public
-#endif
class InvalidTimeZoneException : Exception
{
public InvalidTimeZoneException () : base ()
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.Runtime.Serialization;
}
}
-#endif
return res;
}
-#if NET_4_0
public override IList<CustomAttributeData> GetCustomAttributesData () {
return CustomAttributeData.GetCustomAttributes (this);
}
return Enum.GetValues (this);
}
-#endif
static MethodBase CheckMethodSecurity (MethodBase mb)
{
#endif
}
-#if NET_4_0
//seclevel { transparent = 0, safe-critical = 1, critical = 2}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
public extern int get_core_clr_security_level ();
return GetStructLayoutAttribute ();
}
}
-#endif
internal override bool IsUserType {
get {
public class OperationCanceledException : SystemException
{
const int Result = unchecked ((int)0x8013153b);
-#if NET_4_0
CancellationToken? token;
-#endif
// Constructors
public OperationCanceledException ()
{
}
-#if NET_4_0
public OperationCanceledException (CancellationToken token)
: this ()
{
return token.Value;
}
}
-#endif
}
}
namespace System
{
-#if NET_4_0
public delegate bool Predicate <in T> (T obj);
-#else
- public delegate bool Predicate <T> (T obj);
-#endif
}
public class ResolveEventArgs : EventArgs
{
private string m_Name;
-#if NET_4_0
private Assembly m_Requesting;
-#endif
public ResolveEventArgs (string name)
{
m_Name = name;
}
-#if NET_4_0
public ResolveEventArgs (string name, Assembly requestingAssembly) {
this.m_Name = name;
this.m_Requesting = requestingAssembly;
}
-#endif
public string Name {
get {
}
}
-#if NET_4_0
public Assembly RequestingAssembly {
get {
return m_Requesting;
}
}
-#endif
}
}
return *((int*)&f);
}
-#if NET_4_0
public static bool operator==(float left, float right)
{
return left == right;
{
return left <= right;
}
-#endif
public static bool IsInfinity (float f)
{
}
// .NET 2.0 compatibility only
-#if !NET_4_0 && !MOBILE
- static readonly char[] WhiteChars = {
- (char) 0x9, (char) 0xA, (char) 0xB, (char) 0xC, (char) 0xD,
- (char) 0x85, (char) 0x1680, (char) 0x2028, (char) 0x2029,
- (char) 0x20, (char) 0xA0, (char) 0x2000, (char) 0x2001, (char) 0x2002, (char) 0x2003, (char) 0x2004,
- (char) 0x2005, (char) 0x2006, (char) 0x2007, (char) 0x2008, (char) 0x2009, (char) 0x200A, (char) 0x200B,
- (char) 0x3000, (char) 0xFEFF
- };
-#endif
unsafe string[] SplitByCharacters (char[] sep, int count, bool removeEmpty)
{
-#if !NET_4_0 && !MOBILE
- if (sep == null || sep.Length == 0)
- sep = WhiteChars;
-#endif
int[] split_points = null;
int total_points = 0;
unsafe int FindNotWhiteSpace (int pos, int target, int change)
{
-#if NET_4_0
fixed (char* src = this) {
while (pos != target) {
if (!char.IsWhiteSpace (src[pos]))
pos += change;
}
}
-#else
- while (pos != target) {
- char c = this[pos];
- if (c < 0x85) {
- if (c != 0x20) {
- if (c < 0x9 || c > 0xD)
- return pos;
- }
- }
- else {
- if (c != 0xA0 && c != 0xFEFF && c != 0x3000) {
- if (c != 0x85 && c != 0x1680 && c != 0x2028 && c != 0x2029)
- if (c < 0x2000 || c > 0x200B)
- return pos;
- }
- }
- pos += change;
- }
-#endif
return pos;
}
return InternalIsInterned (str);
}
-#if NET_4_0
public static string Join (string separator, params string [] value)
-#else
- public static string Join (string separator, string [] value)
-#endif
{
if (value == null)
throw new ArgumentNullException ("value");
}
}
-#if NET_4_0
[ComVisible(false)]
public static string Concat (IEnumerable<string> values)
{
}
public static bool IsNullOrWhiteSpace (string value)
-#else
- internal static bool IsNullOrWhiteSpace (string value)
-#endif
{
if ((value == null) || (value.Length == 0))
return true;
[Serializable]
[System.Runtime.InteropServices.ComVisible (true)]
public struct TimeSpan : IComparable, IComparable<TimeSpan>, IEquatable <TimeSpan>
-#if NET_4_0
, IFormattable
-#endif
{
#if MONOTOUCH
static TimeSpan () {
return p.Execute (true, out result);
}
-#if NET_4_0
public static TimeSpan Parse (string input, IFormatProvider formatProvider)
{
if (input == null)
return false;
}
-#endif
public TimeSpan Subtract (TimeSpan ts)
{
return sb.ToString ();
}
-#if NET_4_0
public string ToString (string format)
{
return ToString (format, null);
return sb.ToString ();
}
-#endif
public static TimeSpan operator + (TimeSpan t1, TimeSpan t2)
{
private int _cur = 0;
private int _length;
ParseError parse_error;
-#if NET_4_0
bool parsed_ticks;
NumberFormatInfo number_format;
int parsed_numbers_count;
public bool AllMembersRequired;
public bool CultureSensitive = true;
public bool UseColonAsDaySeparator = true;
-#endif
public Parser (string src)
{
_src = src;
_length = _src.Length;
-#if NET_4_0
number_format = GetNumberFormatInfo (null);
-#endif
}
-#if NET_4_0
// Reset state data, so we can execute another parse over the input.
void Reset ()
{
return format;
}
-#endif
public bool AtEnd {
get {
return res;
}
-#if NET_4_0
// Used for custom formats parsing, where we may need to declare how
// many digits we expect, as well as the maximum allowed.
private int ParseIntExact (int digit_count, int max_digit_count)
return (int)res;
}
-#endif
// Parse simple int value
private int ParseInt (bool optional)
if (!optional && (count == 0))
SetParseError (ParseError.Format);
-#if NET_4_0
if (count > 0)
parsed_numbers_count++;
-#endif
return (int)res;
}
-#if NET_4_0
// This behaves pretty much like ParseOptDot, but we need to have it
// as a separated routine for both days and decimal separators.
private bool ParseOptDaysSeparator ()
return false;
}
-#endif
// Parse optional dot
private bool ParseOptDot ()
{
if (!digitseen)
SetParseError (ParseError.Format);
-#if NET_4_0
else if (!AtEnd && Char.IsDigit (_src, _cur))
SetParseError (ParseError.Overflow);
parsed_ticks = true;
-#endif
return res;
}
-#if NET_4_0
// Used by custom formats parsing
// digits_count = 0 for digits up to max_digits_count (optional), and other value to
// force a precise number of digits.
return res;
}
-#endif
void SetParseError (ParseError error)
{
parse_error = error;
}
-#if NET_4_0
bool CheckParseSuccess (bool tryParse)
-#else
- bool CheckParseSuccess (int hours, int minutes, int seconds, bool tryParse)
-#endif
{
// We always report the first error, but for 2.0 we need to give a higher
// precence to per-element overflow (as opposed to int32 overflow).
-#if NET_4_0
if (parse_error == ParseError.Overflow) {
-#else
- if (parse_error == ParseError.Overflow || hours > 23 || minutes > 59 || seconds > 59) {
-#endif
if (tryParse)
return false;
throw new OverflowException (
return true;
}
-#if NET_4_0
// We are using a different parse approach in 4.0, due to some changes in the behaviour
// of the parse routines.
// The input string is documented as:
result = new TimeSpan (t);
return true;
}
-#else
- public bool Execute (bool tryParse, out TimeSpan result)
- {
- bool sign;
- int days;
- int hours = 0;
- int minutes;
- int seconds;
- long ticks;
-
- result = TimeSpan.Zero;
-
- // documented as...
- // Parse [ws][-][dd.]hh:mm:ss[.ff][ws]
- // ... but not entirely true as an lonely
- // integer will be parsed as a number of days
- ParseWhiteSpace ();
- sign = ParseSign ();
- days = ParseInt (false);
- if (ParseOptDot ()) {
- hours = ParseInt (true);
- }
- else if (!AtEnd) {
- hours = days;
- days = 0;
- }
- ParseColon(false);
- int p = _cur;
- minutes = ParseInt (true);
- seconds = 0;
- if (p < _cur) {
- ParseColon (true);
- seconds = ParseInt (true);
- }
-
- if ( ParseOptDot () ) {
- ticks = ParseTicks ();
- }
- else {
- ticks = 0;
- }
- ParseWhiteSpace ();
-
- if (!AtEnd)
- SetParseError (ParseError.Format);
-
- if (!CheckParseSuccess (hours, minutes, seconds, tryParse))
- return false;
-
- long t;
- if (!TimeSpan.CalculateTicks (days, hours, minutes, seconds, 0, false, out t))
- return false;
-
- try {
- t = checked ((sign) ? (-t - ticks) : (t + ticks));
- } catch (OverflowException) {
- if (tryParse)
- return false;
- throw;
- }
-
- result = new TimeSpan (t);
- return true;
- }
-#endif
-#if NET_4_0
public bool ExecuteWithFormat (string format, TimeSpanStyles style, bool tryParse, out TimeSpan result)
{
int days, hours, minutes, seconds;
result = new TimeSpan (t);
return true;
}
-#endif
}
-#if NET_4_0
enum FormatElementType
{
Days,
return null;
}
}
-#endif
}
}
[Serializable]
#if MOBILE
[TypeForwardedFrom (Consts.AssemblySystem_Core)]
-#elif NET_4_0
+#else
[TypeForwardedFrom (Consts.AssemblySystemCore_3_5)]
#endif
-#if NET_4_0
public
-#endif
class TimeZoneNotFoundException : Exception
{
public TimeZoneNotFoundException () : base ()
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
}
}
-#endif
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System;
using System.Collections;
}
-#endif
#if FALSE
}
public
-#if NET_4_0
virtual
-#endif
bool IsEnum {
get {
return IsSubclassOf (typeof (Enum));
}
public
-#if NET_4_0
virtual
-#endif
bool IsSerializable {
get {
if ((Attributes & TypeAttributes.Serializable) != 0)
public override bool Equals (object o)
{
-#if NET_4_0
return Equals (o as Type);
-#else
- if (o == this)
- return true;
-
- Type me = UnderlyingSystemType;
- if (me == null)
- return false;
- return me.EqualsInternal (o as Type);
-#endif
}
-#if NET_4_0
public virtual bool Equals (Type o)
{
if ((object)o == (object)this)
return true;
return me.EqualsInternal (o);
}
-#else
- public bool Equals (Type o)
- {
-
- if (o == this)
- return true;
- if (o == null)
- return false;
- Type me = UnderlyingSystemType;
- if (me == null)
- return false;
- return me.EqualsInternal (o.UnderlyingSystemType);
- }
-#endif
-#if NET_4_0
[MonoTODO ("Implement it properly once 4.0 impl details are known.")]
public static bool operator == (Type left, Type right)
{
{
get { throw CreateNIE (); }
}
-#endif
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal extern bool EqualsInternal (Type type);
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal extern static TypeCode GetTypeCodeInternal (Type type);
-#if NET_4_0
protected virtual
-#endif
TypeCode GetTypeCodeImpl () {
Type type = this;
if (type is MonoType)
public virtual StructLayoutAttribute StructLayoutAttribute {
get {
-#if NET_4_0
throw new NotSupportedException ();
-#else
- return GetStructLayoutAttribute ();
-#endif
}
}
}
-#if NET_4_0
public virtual bool IsEquivalentTo (Type other)
{
return this == other;
}
-#endif
/*
* Return whenever this object is an instance of a user defined subclass
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_4_0
using System.Runtime.Serialization;
using System.Runtime.InteropServices;
}
}
}
-#endif
using System.IO;
using System.Reflection;
-#if NET_4_0
namespace System {
internal class ArraySpec
{
}
}
}
-#endif
get { return sizeof (void*); }
}
-#if NET_4_0
public static UIntPtr Add (UIntPtr pointer, int offset)
{
return (UIntPtr) (unchecked (((byte *) pointer) + offset));
{
return (UIntPtr) (unchecked (((byte *) pointer) - offset));
}
-#endif
}
}
return v1.CompareTo (v2) <= 0;
}
-#if BOOSTRAP_NET_4_0 || NET_4_0
public static Version Parse (string input)
{
// Exactly the same as calling Version(string) .ctor
return true;
}
-#endif
// a very gentle way to construct a Version object which takes
// the first four numbers in a string as the version
object GetData (string name);
int GetHashCode();
-#if !NET_4_0
- [SecurityPermission (SecurityAction.LinkDemand, Infrastructure = true)]
-#endif
object GetLifetimeService ();
Type GetType ();