mono_arch_unwindinfo_install_tramp_unwind_info can only be called for JIT:ed code.
# building with monolite
mcslib = $(mcs_topdir)/class/lib
monolite = $(mcslib)/monolite
-mono_corlib_version = $(shell sed -n "s/\#define MONO_CORLIB_VERSION //p" $(srcdir)/mono/metadata/appdomain.c)
-monolite_url = http://download.mono-project.com/monolite/monolite-$(mono_corlib_version)-latest.tar.gz
+monolite_url = https://download.mono-project.com/monolite/monolite-$(MONO_CORLIB_VERSION)-latest.tar.gz
.PHONY: get-monolite-latest
get-monolite-latest:
-rm -fr $(mcslib)/monolite-*
-mkdir -p $(mcslib)
test ! -d $(monolite) || test ! -d $(monolite).old || rm -fr $(monolite).old
test ! -d $(monolite) || mv -f $(monolite) $(monolite).old
- cd $(mcslib) && { (wget -O- $(monolite_url) || curl $(monolite_url)) | gzip -d | tar xf - ; }
+ cd $(mcslib) && { (wget -O- $(monolite_url) || curl -L $(monolite_url)) | gzip -d | tar xf - ; }
cd $(mcslib) && mv -f monolite-* monolite
if BITCODE
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+MONO_VERSION_MAJOR=`echo $VERSION | cut -d . -f 1`
+MONO_VERSION_MINOR=`echo $VERSION | cut -d . -f 2`
+MONO_VERSION_BUILD=`echo $VERSION | cut -d . -f 3`
+
+# This is the version number of the corlib-runtime interface. When
+# making changes to this interface (by changing the layout
+# of classes the runtime knows about, changing icall signature or
+# semantics etc), increment this variable.
+#
+# This can be reset to 0 when Mono's version number is bumped
+# since it's part of the corlib version (the prefix '1' in the full
+# version number is to ensure the number isn't treated as octal in C)
+MONO_CORLIB_COUNTER=0
+MONO_CORLIB_VERSION=`printf "1%02d%02d%02d%03d" $MONO_VERSION_MAJOR $MONO_VERSION_MINOR $MONO_VERSION_BUILD $MONO_CORLIB_COUNTER`
+
+AC_DEFINE_UNQUOTED(MONO_CORLIB_VERSION,$MONO_CORLIB_VERSION,[Version of the corlib-runtime interface])
+AC_SUBST(MONO_CORLIB_VERSION)
+
case $host_os in
*cygwin* )
echo "Run configure using ./configure --host=i686-pc-mingw32"
AC_DEFINE(HAVE_DEPRECATED, 1, [Support for the deprecated attribute])
fi
-AC_ARG_WITH(interpreter, [ --with-interpreter=yes|no Interpreter, default=no],[buildinterpreter=$with_interpreter],[buildinterpreter=no])
-if test "x$buildinterpreter" = "xyes"; then
- AC_DEFINE(ENABLE_INTERPRETER, 1, [Enable interpreter in the runtime.])
- AC_MSG_NOTICE([Enable interpreter in the runtime.])
+AC_ARG_ENABLE(interpreter, [ --enable-interpreter Enable Interpreter], enable_interpreter=$enableval, enable_interpreter=no)
+
+if test "x$enable_interpreter" = "xyes"; then
+ AC_DEFINE(ENABLE_INTERPRETER, 1, [Enable Interpreter])
fi
-AM_CONDITIONAL([ENABLE_INTERPRETER], [test x$buildinterpreter != xno])
+AM_CONDITIONAL(ENABLE_INTERPRETER, [test x$enable_interpreter = xyes])
dnl
mono/tests/tests-config
mono/tests/assemblyresolve/Makefile
mono/tests/gc-descriptors/Makefile
+mono/tests/testing_gac/Makefile
mono/unit-tests/Makefile
mono/benchmark/Makefile
mono/mini/Makefile
}')]
echo "MONO_VERSION = $myver" >> $mcs_topdir/build/config.make
+ echo "MONO_CORLIB_VERSION = $MONO_CORLIB_VERSION" >> $mcs_topdir/build/config.make
if test x$host_darwin = xyes; then
echo "PLATFORM = darwin" >> $mcs_topdir/build/config.make
BigArrays: $enable_big_arrays
DTrace: $enable_dtrace
LLVM Back End: $enable_llvm (dynamically loaded: $enable_loadedllvm)
- Interpreter: $buildinterpreter
+ Interpreter: $enable_interpreter
Libraries:
.NET 4.x: $with_profile4_x
-Subproject commit 9b6ee8686be55a983d886938165b6206cda50772
+Subproject commit b5cc6e6ab5f71f6c0be7b730058b426e92528479
-Subproject commit bc85afcc18bfc5e8352350c2ee4c2bea5de1f03f
+Subproject commit 63c51e726292149b4868db71baa883e5ad173766
-Subproject commit e4deabf61c11999f200dcea6f6d6b42474cc2131
+Subproject commit 88b67c42ca8b7d58141c176b46749819bfcef166
common/Consts.cs: common/Consts.cs.in $(wildcard config.make)
test -n '$(MONO_VERSION)'
- sed -e 's,@''MONO_VERSION@,$(MONO_VERSION),' $< > $@
+ test -n '$(MONO_CORLIB_VERSION)'
+ sed -e 's,@''MONO_VERSION@,$(MONO_VERSION),' -e 's,@''MONO_CORLIB_VERSION@,$(MONO_CORLIB_VERSION),' $< > $@
PLATFORMS = darwin linux win32
PROFILES = \
public const string MonoCompany = "Mono development team";
public const string MonoProduct = "Mono Common Language Infrastructure";
public const string MonoCopyright = "(c) Various Mono authors";
+ public const int MonoCorlibVersion = @MONO_CORLIB_VERSION@;
#if MOBILE
// Versions of .NET Framework for Silverlight 4.0
/lib
/compat/
+monolite-*.tar.gz
dist-monolite: $(monolite_files) lib/$(monolite_dir)/mcs.exe
+package-monolite-latest:
+ MONOLITE=monolite-$(MONO_CORLIB_VERSION)-latest; \
+ $(MAKE) dist-monolite monolite_dir=$$MONOLITE; \
+ tar zcvpf $$MONOLITE.tar.gz --directory=lib $$MONOLITE/
+
dist-default: dist-monolite
dist-local: dist-default
yield return kvp.Value;
}
- public void RemoveProperty (BuildProperty propertyToRemove)
+ public void RemoveProperty (BuildProperty property)
{
- if (propertyToRemove == null)
- throw new ArgumentNullException ("propertyToRemove");
+ if (property == null)
+ throw new ArgumentNullException ("property");
if (FromXml) {
- if (!propertyToRemove.FromXml)
+ if (!property.FromXml)
throw new InvalidOperationException ("The specified property does not belong to the current property group.");
- propertyToRemove.XmlElement.ParentNode.RemoveChild (propertyToRemove.XmlElement);
- properties.Remove (propertyToRemove);
+ property.XmlElement.ParentNode.RemoveChild (property.XmlElement);
+ properties.Remove (property);
} else
- propertiesByName.Remove (propertyToRemove.Name);
+ propertiesByName.Remove (property.Name);
}
public void RemoveProperty (string propertyName)
return build_records.GetOrAdd (key, _ => new BuildRecord (this));
}
- public void BuildStartedHandler (object sender, BuildStartedEventArgs args)
+ public void BuildStartedHandler (object sender, BuildStartedEventArgs e)
{
- GetBuildRecord (sender).BuildStartedHandler (sender, args);
+ GetBuildRecord (sender).BuildStartedHandler (sender, e);
}
- public void BuildFinishedHandler (object sender, BuildFinishedEventArgs args)
+ public void BuildFinishedHandler (object sender, BuildFinishedEventArgs e)
{
- GetBuildRecord (sender).BuildFinishedHandler (args);
+ GetBuildRecord (sender).BuildFinishedHandler (e);
((IDictionary) build_records).Remove (sender);
}
{
GetBuildRecord (sender).PopEvent (args);
}
- public void ProjectStartedHandler (object sender, ProjectStartedEventArgs args)
+ public void ProjectStartedHandler (object sender, ProjectStartedEventArgs e)
{
- GetBuildRecord (sender).ProjectStartedHandler (args);
+ GetBuildRecord (sender).ProjectStartedHandler (e);
}
- public void ProjectFinishedHandler (object sender, ProjectFinishedEventArgs args)
+ public void ProjectFinishedHandler (object sender, ProjectFinishedEventArgs e)
{
- GetBuildRecord (sender).ProjectFinishedHandler (args);
+ GetBuildRecord (sender).ProjectFinishedHandler (e);
}
- public void TargetStartedHandler (object sender, TargetStartedEventArgs args)
+ public void TargetStartedHandler (object sender, TargetStartedEventArgs e)
{
- GetBuildRecord (sender).TargetStartedHandler (args);
+ GetBuildRecord (sender).TargetStartedHandler (e);
}
- public void TargetFinishedHandler (object sender, TargetFinishedEventArgs args)
+ public void TargetFinishedHandler (object sender, TargetFinishedEventArgs e)
{
- GetBuildRecord (sender).TargetFinishedHandler (args);
+ GetBuildRecord (sender).TargetFinishedHandler (e);
}
- public void TaskStartedHandler (object sender, TaskStartedEventArgs args)
+ public void TaskStartedHandler (object sender, TaskStartedEventArgs e)
{
- GetBuildRecord (sender).TaskStartedHandler (args);
+ GetBuildRecord (sender).TaskStartedHandler (e);
}
- public void TaskFinishedHandler (object sender, TaskFinishedEventArgs args)
+ public void TaskFinishedHandler (object sender, TaskFinishedEventArgs e)
{
- GetBuildRecord (sender).TaskFinishedHandler (args);
+ GetBuildRecord (sender).TaskFinishedHandler (e);
}
- public void MessageHandler (object sender, BuildMessageEventArgs args)
+ public void MessageHandler (object sender, BuildMessageEventArgs e)
{
- GetBuildRecord (sender).MessageHandler (args);
+ GetBuildRecord (sender).MessageHandler (e);
}
- public void WarningHandler (object sender, BuildWarningEventArgs args)
+ public void WarningHandler (object sender, BuildWarningEventArgs e)
{
- GetBuildRecord (sender).WarningHandler (args);
+ GetBuildRecord (sender).WarningHandler (e);
}
- public void ErrorHandler (object sender, BuildErrorEventArgs args)
+ public void ErrorHandler (object sender, BuildErrorEventArgs e)
{
- GetBuildRecord (sender).ErrorHandler (args);
+ GetBuildRecord (sender).ErrorHandler (e);
}
[MonoTODO]
- public void CustomEventHandler (object sender, CustomBuildEventArgs args)
+ public void CustomEventHandler (object sender, CustomBuildEventArgs e)
{
- build_records [sender].CustomHandler (args);
+ build_records [sender].CustomHandler (e);
}
void SetColor (ConsoleColor color)
}
[MonoTODO ("Not tested")]
- public void AddNewImport (string importLocation,
- string importCondition)
+ public void AddNewImport (string projectFile,
+ string condition)
{
- if (importLocation == null)
- throw new ArgumentNullException ("importLocation");
+ if (projectFile == null)
+ throw new ArgumentNullException ("projectFile");
XmlElement importElement = xmlDocument.CreateElement ("Import", XmlNamespace);
xmlDocument.DocumentElement.AppendChild (importElement);
- importElement.SetAttribute ("Project", importLocation);
- if (!String.IsNullOrEmpty (importCondition))
- importElement.SetAttribute ("Condition", importCondition);
+ importElement.SetAttribute ("Project", projectFile);
+ if (!String.IsNullOrEmpty (condition))
+ importElement.SetAttribute ("Condition", condition);
AddImport (importElement, null, false);
MarkProjectAsDirty ();
Load (projectFileName, ProjectLoadSettings.None);
}
- public void Load (string projectFileName, ProjectLoadSettings settings)
+ public void Load (string projectFileName, ProjectLoadSettings projectLoadSettings)
{
- project_load_settings = settings;
+ project_load_settings = projectLoadSettings;
if (String.IsNullOrEmpty (projectFileName))
throw new ArgumentNullException ("projectFileName");
[MonoTODO]
// NOTE: does not modify imported projects
- public void RemoveItemGroupsWithMatchingCondition (string matchingCondition)
+ public void RemoveItemGroupsWithMatchingCondition (string matchCondition)
{
throw new NotImplementedException ();
}
isDirty = false;
}
- public void Save (TextWriter outTextWriter)
+ public void Save (TextWriter textWriter)
{
- xmlDocument.Save (outTextWriter);
+ xmlDocument.Save (textWriter);
isDirty = false;
}
throw new NotImplementedException ();
}
- public void SetProjectExtensions (string id, string xmlText)
+ public void SetProjectExtensions (string id, string content)
{
if (id == null)
throw new ArgumentNullException ("id");
- if (xmlText == null)
- throw new ArgumentNullException ("xmlText");
+ if (content == null)
+ throw new ArgumentNullException ("content");
XmlNode projectExtensions, node;
xmlDocument.DocumentElement.AppendChild (projectExtensions);
node = xmlDocument.CreateElement (id, XmlNamespace);
- node.InnerXml = xmlText;
+ node.InnerXml = content;
projectExtensions.AppendChild (node);
} else {
node = xmlDocument.SelectSingleNode (String.Format ("/tns:Project/tns:ProjectExtensions/tns:{0}", id), XmlNamespaceManager);
projectExtensions.AppendChild (node);
}
- node.InnerXml = xmlText;
+ node.InnerXml = content;
}
}
// FIXME: shouldn't we remove it from XML?
- public void RemoveTask (BuildTask buildTask)
+ public void RemoveTask (BuildTask taskElement)
{
- if (buildTask == null)
- throw new ArgumentNullException ("buildTask");
- buildTasks.Remove (buildTask);
+ if (taskElement == null)
+ throw new ArgumentNullException ("taskElement");
+ buildTasks.Remove (taskElement);
}
bool Build ()
get { return Line == 0 ? File : String.Format ("{0} ({1}{2})", File, Line, Column != 0 ? "," + Column : String.Empty); }
}
- public override bool Equals (object other)
+ public override bool Equals (object obj)
{
- var o = other as ElementLocation;
+ var o = obj as ElementLocation;
return (object) o != null && o.File == File && o.Line == Line && o.Column == Column;
}
+ "{data.Items.Count} #Targets={data.Targets.Count}")]
public class Project
{
- public Project (XmlReader xml)
- : this (ProjectRootElement.Create (xml))
+ public Project (XmlReader xmlReader)
+ : this (ProjectRootElement.Create (xmlReader))
{
}
- public Project (XmlReader xml, IDictionary<string, string> globalProperties,
+ public Project (XmlReader xmlReader, IDictionary<string, string> globalProperties,
string toolsVersion)
- : this (ProjectRootElement.Create (xml), globalProperties, toolsVersion)
+ : this (ProjectRootElement.Create (xmlReader), globalProperties, toolsVersion)
{
}
- public Project (XmlReader xml, IDictionary<string, string> globalProperties,
+ public Project (XmlReader xmlReader, IDictionary<string, string> globalProperties,
string toolsVersion, ProjectCollection projectCollection)
- : this (ProjectRootElement.Create (xml), globalProperties, toolsVersion, projectCollection)
+ : this (ProjectRootElement.Create (xmlReader), globalProperties, toolsVersion, projectCollection)
{
}
- public Project (XmlReader xml, IDictionary<string, string> globalProperties,
+ public Project (XmlReader xmlReader, IDictionary<string, string> globalProperties,
string toolsVersion, ProjectCollection projectCollection,
ProjectLoadSettings loadSettings)
- : this (ProjectRootElement.Create (xml), globalProperties, toolsVersion, projectCollection, loadSettings)
+ : this (ProjectRootElement.Create (xmlReader), globalProperties, toolsVersion, projectCollection, loadSettings)
{
}
{
public class ProjectCollection : IDisposable
{
- public delegate void ProjectAddedEventHandler (object target, ProjectAddedToProjectCollectionEventArgs args);
+ public delegate void ProjectAddedEventHandler (object sender, ProjectAddedToProjectCollectionEventArgs e);
public class ProjectAddedToProjectCollectionEventArgs : EventArgs
{
- public ProjectAddedToProjectCollectionEventArgs (ProjectRootElement project)
+ public ProjectAddedToProjectCollectionEventArgs (ProjectRootElement element)
{
- if (project == null)
+ if (element == null)
throw new ArgumentNullException ("project");
- ProjectRootElement = project;
+ ProjectRootElement = element;
}
public ProjectRootElement ProjectRootElement { get; private set; }
{
}
- public ProjectCollection (ToolsetDefinitionLocations toolsetDefinitionLocations)
- : this (null, null, toolsetDefinitionLocations)
+ public ProjectCollection (ToolsetDefinitionLocations toolsetLocations)
+ : this (null, null, toolsetLocations)
{
}
namespace Mono.Simd
{
+ [Obsolete ("Use the types in the System.Numerics.Vectors namespace")]
[StructLayout(LayoutKind.Explicit, Pack = 1, Size = 16)]
public struct Vector16b
{
namespace Mono.Simd
{
+ [Obsolete ("Use the types in the System.Numerics.Vectors namespace")]
[StructLayout(LayoutKind.Explicit, Pack = 1, Size = 16)]
[CLSCompliant(false)]
public struct Vector16sb
namespace Mono.Simd
{
-
+ [Obsolete ("Use the types in the System.Numerics.Vectors namespace")]
[StructLayout(LayoutKind.Explicit, Pack = 0, Size = 16)]
public struct Vector2d
{
namespace Mono.Simd
{
+ [Obsolete ("Use the types in the System.Numerics.Vectors namespace")]
[StructLayout(LayoutKind.Explicit, Pack = 0, Size = 16)]
public struct Vector2l
{
namespace Mono.Simd
{
+ [Obsolete ("Use the types in the System.Numerics.Vectors namespace")]
[StructLayout(LayoutKind.Explicit, Pack = 0, Size = 16)]
[CLSCompliant(false)]
public struct Vector2ul
Replace Shuffle with less bug prone methods
*/
+ [Obsolete ("Use the types in the System.Numerics.Vectors namespace")]
[StructLayout(LayoutKind.Explicit, Pack = 0, Size = 16)]
public struct Vector4f
{
namespace Mono.Simd
{
+ [Obsolete ("Use the types in the System.Numerics.Vectors namespace")]
[StructLayout(LayoutKind.Explicit, Pack = 0, Size = 16)]
public struct Vector4i
{
namespace Mono.Simd
{
+ [Obsolete ("Use the types in the System.Numerics.Vectors namespace")]
[StructLayout(LayoutKind.Explicit, Pack = 0, Size = 16)]
[CLSCompliant(false)]
public struct Vector4ui
namespace Mono.Simd
{
+ [Obsolete ("Use the types in the System.Numerics.Vectors namespace")]
[StructLayout(LayoutKind.Explicit, Pack = 0, Size = 16)]
public struct Vector8s
{
namespace Mono.Simd
{
+ [Obsolete ("Use the types in the System.Numerics.Vectors namespace")]
[StructLayout(LayoutKind.Explicit, Pack = 0, Size = 16)]
[CLSCompliant(false)]
public struct Vector8us
Novell.Directory.Ldap/AssemblyInfo.cs
-../../build/common/Consts.cs.in
+../../build/common/Consts.cs
Novell.Directory.Ldap/SupportClass.cs
Novell.Directory.Ldap.Utilclass/Base64.cs
Novell.Directory.Ldap.Utilclass/DN.cs
return host.CreateDeprecatedConfigContext (configPath);
}
- public virtual string DecryptSection (string encryptedXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedSection)
+ public virtual string DecryptSection (string encryptedXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedConfigSection)
{
- return host.DecryptSection (encryptedXml, protectionProvider, protectedSection);
+ return host.DecryptSection (encryptedXml, protectionProvider, protectedConfigSection);
}
public virtual void DeleteStream (string streamName)
host.DeleteStream (streamName);
}
- public virtual string EncryptSection (string encryptedXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedSection)
+ public virtual string EncryptSection (string clearTextXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedConfigSection)
{
- return host.EncryptSection (encryptedXml, protectionProvider, protectedSection);
+ return host.EncryptSection (clearTextXml, protectionProvider, protectedConfigSection);
}
- public virtual string GetConfigPathFromLocationSubPath (string configPath, string locatinSubPath)
+ public virtual string GetConfigPathFromLocationSubPath (string configPath, string locationSubPath)
{
- return host.GetConfigPathFromLocationSubPath (configPath, locatinSubPath);
+ return host.GetConfigPathFromLocationSubPath (configPath, locationSubPath);
}
public virtual Type GetConfigType (string typeName, bool throwOnError)
return host.Impersonate ();
}
- public virtual void Init (IInternalConfigRoot root, params object[] hostInitParams)
+ public virtual void Init (IInternalConfigRoot configRoot, params object[] hostInitParams)
{
- host.Init (root, hostInitParams);
+ host.Init (configRoot, hostInitParams);
}
- public virtual void InitForConfiguration (ref string locationSubPath, out string configPath, out string locationConfigPath, IInternalConfigRoot root, params object[] hostInitConfigurationParams)
+ public virtual void InitForConfiguration (ref string locationSubPath, out string configPath, out string locationConfigPath, IInternalConfigRoot configRoot, params object[] hostInitConfigurationParams)
{
- host.InitForConfiguration (ref locationSubPath, out configPath, out locationConfigPath, root, hostInitConfigurationParams);
+ host.InitForConfiguration (ref locationSubPath, out configPath, out locationConfigPath, configRoot, hostInitConfigurationParams);
}
public virtual bool IsAboveApplication (string configPath)
{
object CreateConfigurationContext (string configPath, string locationSubPath);
object CreateDeprecatedConfigContext (string configPath);
- string DecryptSection (string encryptedXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedSection);
+ string DecryptSection (string encryptedXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedConfigSection);
void DeleteStream (string streamName);
- string EncryptSection (string encryptedXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedSection);
- string GetConfigPathFromLocationSubPath (string configPath, string locatinSubPath);
+ string EncryptSection (string clearTextXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedConfigSection);
+ string GetConfigPathFromLocationSubPath (string configPath, string locationSubPath);
Type GetConfigType (string typeName, bool throwOnError);
string GetConfigTypeName (Type t);
void GetRestrictedPermissions (IInternalConfigRecord configRecord, out PermissionSet permissionSet, out bool isHostReady);
string GetStreamNameForConfigSource (string streamName, string configSource);
object GetStreamVersion (string streamName);
IDisposable Impersonate ();
- void Init (IInternalConfigRoot root, params object[] hostInitParams);
- void InitForConfiguration (ref string locationSubPath, out string configPath, out string locationConfigPath, IInternalConfigRoot root, params object[] hostInitConfigurationParams);
+ void Init (IInternalConfigRoot configRoot, params object[] hostInitParams);
+ void InitForConfiguration (ref string locationSubPath, out string configPath, out string locationConfigPath, IInternalConfigRoot configRoot, params object[] hostInitConfigurationParams);
bool IsAboveApplication (string configPath);
bool IsConfigRecordRequired (string configPath);
bool IsDefinitionAllowed (string configPath, ConfigurationAllowDefinition allowDefinition, ConfigurationAllowExeDefinition allowExeDefinition);
[MonoTODO]
protected internal override string SerializeSection (
- ConfigurationElement parent, string name, ConfigurationSaveMode mode)
+ ConfigurationElement parentElement, string name, ConfigurationSaveMode saveMode)
{
if (File == "") {
- return base.SerializeSection (parent, name, mode);
+ return base.SerializeSection (parentElement, name, saveMode);
}
else {
throw new NotImplementedException ();
get { return RootSectionGroup.Sections; }
}
- public ConfigurationSection GetSection (string path)
+ public ConfigurationSection GetSection (string sectionName)
{
- string[] parts = path.Split ('/');
+ string[] parts = sectionName.Split ('/');
if (parts.Length == 1)
return Sections [parts[0]];
return null;
}
- public ConfigurationSectionGroup GetSectionGroup (string path)
+ public ConfigurationSectionGroup GetSectionGroup (string sectionGroupName)
{
- string[] parts = path.Split ('/');
+ string[] parts = sectionGroupName.Split ('/');
ConfigurationSectionGroup group = SectionGroups [parts[0]];
for (int n=1; group != null && n<parts.Length; n++)
group = group.SectionGroups [parts [n]];
Save (ConfigurationSaveMode.Modified, false);
}
- public void Save (ConfigurationSaveMode mode)
+ public void Save (ConfigurationSaveMode saveMode)
{
- Save (mode, false);
+ Save (saveMode, false);
}
- public void Save (ConfigurationSaveMode mode, bool forceUpdateAll)
+ public void Save (ConfigurationSaveMode saveMode, bool forceSaveAll)
{
- if (!forceUpdateAll && (mode != ConfigurationSaveMode.Full) && !HasValues (mode)) {
+ if (!forceSaveAll && (saveMode != ConfigurationSaveMode.Full) && !HasValues (saveMode)) {
ResetModified ();
return;
}
if (saveStart != null)
saveStart (this, new ConfigurationSaveEventArgs (streamName, true, null, ctx));
- Save (stream, mode, forceUpdateAll);
+ Save (stream, saveMode, forceSaveAll);
system.Host.WriteCompleted (streamName, true, ctx);
} catch (Exception ex) {
saveEx = ex;
SaveAs (filename, ConfigurationSaveMode.Modified, false);
}
- public void SaveAs (string filename, ConfigurationSaveMode mode)
+ public void SaveAs (string filename, ConfigurationSaveMode saveMode)
{
- SaveAs (filename, mode, false);
+ SaveAs (filename, saveMode, false);
}
[MonoInternalNote ("Detect if file has changed")]
- public void SaveAs (string filename, ConfigurationSaveMode mode, bool forceUpdateAll)
+ public void SaveAs (string filename, ConfigurationSaveMode saveMode, bool forceSaveAll)
{
- if (!forceUpdateAll && (mode != ConfigurationSaveMode.Full) && !HasValues (mode)) {
+ if (!forceSaveAll && (saveMode != ConfigurationSaveMode.Full) && !HasValues (saveMode)) {
ResetModified ();
return;
}
string dir = Path.GetDirectoryName (Path.GetFullPath (filename));
if (!Directory.Exists (dir))
Directory.CreateDirectory (dir);
- Save (new FileStream (filename, FileMode.OpenOrCreate, FileAccess.Write), mode, forceUpdateAll);
+ Save (new FileStream (filename, FileMode.OpenOrCreate, FileAccess.Write), saveMode, forceSaveAll);
}
void Save (Stream stream, ConfigurationSaveMode mode, bool forceUpdateAll)
}
[MonoTODO]
- protected virtual void ListErrors (IList list)
+ protected virtual void ListErrors (IList errorList)
{
throw new NotImplementedException ();
}
return defaultCollection;
}
- protected internal object this [ConfigurationProperty property] {
- get { return this [property.Name]; }
- set { this [property.Name] = value; }
+ protected internal object this [ConfigurationProperty prop] {
+ get { return this [prop.Name]; }
+ set { this [prop.Name] = value; }
}
- protected internal object this [string property_name] {
+ protected internal object this [string propertyName] {
get {
- PropertyInformation pi = ElementInformation.Properties [property_name];
+ PropertyInformation pi = ElementInformation.Properties [propertyName];
if (pi == null)
- throw new InvalidOperationException ("Property '" + property_name + "' not found in configuration element");
+ throw new InvalidOperationException ("Property '" + propertyName + "' not found in configuration element");
return pi.Value;
}
set {
- PropertyInformation pi = ElementInformation.Properties [property_name];
+ PropertyInformation pi = ElementInformation.Properties [propertyName];
if (pi == null)
- throw new InvalidOperationException ("Property '" + property_name + "' not found in configuration element");
+ throw new InvalidOperationException ("Property '" + propertyName + "' not found in configuration element");
SetPropertyValue (pi.Property, value, false);
return false;
}
- protected virtual bool OnDeserializeUnrecognizedElement (string element, XmlReader reader)
+ protected virtual bool OnDeserializeUnrecognizedElement (string elementName, XmlReader reader)
{
return false;
}
}
protected internal virtual void Unmerge (
- ConfigurationElement source, ConfigurationElement parent,
- ConfigurationSaveMode updateMode)
+ ConfigurationElement sourceElement, ConfigurationElement parentElement,
+ ConfigurationSaveMode saveMode)
{
- if (parent != null && source.GetType() != parent.GetType())
+ if (parentElement != null && sourceElement.GetType() != parentElement.GetType())
throw new ConfigurationErrorsException ("Can't unmerge two elements of different type");
- bool isMinimalOrModified = updateMode == ConfigurationSaveMode.Minimal ||
- updateMode == ConfigurationSaveMode.Modified;
+ bool isMinimalOrModified = saveMode == ConfigurationSaveMode.Minimal ||
+ saveMode == ConfigurationSaveMode.Modified;
- foreach (PropertyInformation prop in source.ElementInformation.Properties)
+ foreach (PropertyInformation prop in sourceElement.ElementInformation.Properties)
{
if (prop.ValueOrigin == PropertyValueOrigin.Default)
continue;
PropertyInformation unmergedProp = ElementInformation.Properties [prop.Name];
object sourceValue = prop.Value;
- if (parent == null || !parent.HasValue (prop.Name)) {
+ if (parentElement == null || !parentElement.HasValue (prop.Name)) {
unmergedProp.Value = sourceValue;
continue;
}
if (sourceValue == null)
continue;
- object parentValue = parent [prop.Name];
+ object parentValue = parentElement [prop.Name];
if (!prop.IsElement) {
if (!object.Equals (sourceValue, parentValue) ||
- (updateMode == ConfigurationSaveMode.Full) ||
- (updateMode == ConfigurationSaveMode.Modified && prop.ValueOrigin == PropertyValueOrigin.SetHere))
+ (saveMode == ConfigurationSaveMode.Full) ||
+ (saveMode == ConfigurationSaveMode.Modified && prop.ValueOrigin == PropertyValueOrigin.SetHere))
unmergedProp.Value = sourceValue;
continue;
}
- var sourceElement = (ConfigurationElement) sourceValue;
- if (isMinimalOrModified && !sourceElement.IsModified ())
+ var sourceElementValue = (ConfigurationElement) sourceValue;
+ if (isMinimalOrModified && !sourceElementValue.IsModified ())
continue;
if (parentValue == null) {
unmergedProp.Value = sourceValue;
continue;
}
- var parentElement = (ConfigurationElement) parentValue;
+ var parentElementValue = (ConfigurationElement) parentValue;
ConfigurationElement copy = (ConfigurationElement) unmergedProp.Value;
- copy.Unmerge (sourceElement, parentElement, updateMode);
+ copy.Unmerge (sourceElementValue, parentElementValue, saveMode);
}
}
return false;
}
- protected internal override void Unmerge (ConfigurationElement sourceElement, ConfigurationElement parentElement, ConfigurationSaveMode updateMode)
+ protected internal override void Unmerge (ConfigurationElement sourceElement, ConfigurationElement parentElement, ConfigurationSaveMode saveMode)
{
ConfigurationElementCollection source = (ConfigurationElementCollection) sourceElement;
ConfigurationElementCollection parent = (ConfigurationElementCollection) parentElement;
object key = source.GetElementKey (sitem);
ConfigurationElement pitem = parent != null ? parent.BaseGet (key) as ConfigurationElement : null;
ConfigurationElement nitem = CreateNewElementInternal (null);
- if (pitem != null && updateMode != ConfigurationSaveMode.Full) {
- nitem.Unmerge (sitem, pitem, updateMode);
- if (nitem.HasValues (pitem, updateMode))
+ if (pitem != null && saveMode != ConfigurationSaveMode.Full) {
+ nitem.Unmerge (sitem, pitem, saveMode);
+ if (nitem.HasValues (pitem, saveMode))
BaseAdd (nitem);
} else {
nitem.Unmerge (sitem, null, ConfigurationSaveMode.Full);
}
}
- if (updateMode == ConfigurationSaveMode.Full)
+ if (saveMode == ConfigurationSaveMode.Full)
EmitClear = true;
else if (parent != null) {
for (int n=0; n<parent.Count; n++) {
: this (name, type, NoDefaultValue, TypeDescriptor.GetConverter (type), new DefaultValidator(), ConfigurationPropertyOptions.None, null)
{ }
- public ConfigurationProperty (string name, Type type, object default_value)
- : this (name, type, default_value, TypeDescriptor.GetConverter (type), new DefaultValidator(), ConfigurationPropertyOptions.None, null)
+ public ConfigurationProperty (string name, Type type, object defaultValue)
+ : this (name, type, defaultValue, TypeDescriptor.GetConverter (type), new DefaultValidator(), ConfigurationPropertyOptions.None, null)
{ }
public ConfigurationProperty (
- string name, Type type, object default_value,
- ConfigurationPropertyOptions flags)
- :this (name, type, default_value, TypeDescriptor.GetConverter (type), new DefaultValidator(), flags, null)
+ string name, Type type, object defaultValue,
+ ConfigurationPropertyOptions options)
+ :this (name, type, defaultValue, TypeDescriptor.GetConverter (type), new DefaultValidator(), options, null)
{ }
public ConfigurationProperty (
- string name, Type type, object default_value,
- TypeConverter converter,
- ConfigurationValidatorBase validation,
- ConfigurationPropertyOptions flags)
- : this (name, type, default_value, converter, validation, flags, null)
+ string name, Type type, object defaultValue,
+ TypeConverter typeConverter,
+ ConfigurationValidatorBase validator,
+ ConfigurationPropertyOptions options)
+ : this (name, type, defaultValue, typeConverter, validator, options, null)
{ }
public ConfigurationProperty (
- string name, Type type, object default_value,
- TypeConverter converter,
- ConfigurationValidatorBase validation,
- ConfigurationPropertyOptions flags,
+ string name, Type type, object defaultValue,
+ TypeConverter typeConverter,
+ ConfigurationValidatorBase validator,
+ ConfigurationPropertyOptions options,
string description)
{
this.name = name;
- this.converter = converter != null ? converter : TypeDescriptor.GetConverter (type);
- if (default_value != null) {
- if (default_value == NoDefaultValue) {
+ this.converter = typeConverter != null ? typeConverter : TypeDescriptor.GetConverter (type);
+ if (defaultValue != null) {
+ if (defaultValue == NoDefaultValue) {
switch (Type.GetTypeCode (type)) {
case TypeCode.Object:
- default_value = null;
+ defaultValue = null;
break;
case TypeCode.String:
- default_value = String.Empty;
+ defaultValue = String.Empty;
break;
default:
- default_value = Activator.CreateInstance (type);
+ defaultValue = Activator.CreateInstance (type);
break;
}
}
else
- if (!type.IsAssignableFrom (default_value.GetType ())) {
- if (!this.converter.CanConvertFrom (default_value.GetType ()))
+ if (!type.IsAssignableFrom (defaultValue.GetType ())) {
+ if (!this.converter.CanConvertFrom (defaultValue.GetType ()))
throw new ConfigurationErrorsException (String.Format ("The default value for property '{0}' has a different type than the one of the property itself: expected {1} but was {2}",
- name, type, default_value.GetType ()));
+ name, type, defaultValue.GetType ()));
- default_value = this.converter.ConvertFrom (default_value);
+ defaultValue = this.converter.ConvertFrom (defaultValue);
}
}
- this.default_value = default_value;
- this.flags = flags;
+ this.default_value = defaultValue;
+ this.flags = options;
this.type = type;
- this.validation = validation != null ? validation : new DefaultValidator ();
+ this.validation = validator != null ? validator : new DefaultValidator ();
this.description = description;
}
}
[MonoTODO]
- public void ForceDeclaration (bool require)
+ public void ForceDeclaration (bool force)
{
- this.require_declaration = require;
+ this.require_declaration = force;
}
public void ForceDeclaration ()
{
}
- public new ConnectionStringSettings this [string Name]
+ public new ConnectionStringSettings this [string name]
{
get {
foreach (ConfigurationElement c in this) {
if (!(c is ConnectionStringSettings))
continue;
- if (string.Compare(((ConnectionStringSettings) c).Name, Name, true,
+ if (string.Compare(((ConnectionStringSettings) c).Name, name, true,
System.Globalization.CultureInfo.InvariantCulture) == 0)
return c as ConnectionStringSettings;
Protection API, and is unimplemented in Mono. For portability's sake,
it is suggested that you use the RsaProtectedConfigurationProvider.";
[MonoNotSupported (NotSupportedReason)]
- public override XmlNode Decrypt (XmlNode encrypted_node)
+ public override XmlNode Decrypt (XmlNode encryptedNode)
{
throw new NotSupportedException (NotSupportedReason);
}
return false;
}
- protected internal override void DeserializeSection (XmlReader reader)
+ protected internal override void DeserializeSection (XmlReader xmlReader)
{
- xml = reader.ReadOuterXml ();
+ xml = xmlReader.ReadOuterXml ();
}
[MonoTODO]
- protected internal override void Reset (ConfigurationElement parentElement)
+ protected internal override void Reset (ConfigurationElement parentSection)
{
- base.Reset (parentElement);
+ base.Reset (parentSection);
}
[MonoTODO]
base.ResetModified ();
}
- protected internal override string SerializeSection (ConfigurationElement parentElement, string name, ConfigurationSaveMode saveMode)
+ protected internal override string SerializeSection (ConfigurationElement parentSection, string name, ConfigurationSaveMode saveMode)
{
return xml;
}
{
}
- public abstract XmlNode Decrypt (XmlNode encrypted_node);
+ public abstract XmlNode Decrypt (XmlNode encryptedNode);
public abstract XmlNode Encrypt (XmlNode node);
}
[MonoTODO]
protected internal override void Unmerge (
- ConfigurationElement source, ConfigurationElement parent,
- ConfigurationSaveMode updateMode)
+ ConfigurationElement sourceElement, ConfigurationElement parentElement,
+ ConfigurationSaveMode saveMode)
{
- base.Unmerge (source, parent, updateMode);
+ base.Unmerge (sourceElement, parentElement, saveMode);
}
[ConfigurationProperty ("name", Options = ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey)]
return ((ProviderSettings)element).Name;
}
- public void Remove (string key)
+ public void Remove (string name)
{
- BaseRemove (key);
+ BaseRemove (name);
}
- public ProviderSettings this [int n]
+ public ProviderSettings this [int index]
{
- get { return (ProviderSettings) BaseGet (n); }
- set { BaseAdd (n, value); }
+ get { return (ProviderSettings) BaseGet (index); }
+ set { BaseAdd (index, value); }
}
public new ProviderSettings this [string key]
}
[MonoTODO]
- public override XmlNode Decrypt (XmlNode encrypted_node)
+ public override XmlNode Decrypt (XmlNode encryptedNode)
{
XmlDocument doc = new ConfigurationXmlDocument ();
- doc.Load (new StringReader (encrypted_node.OuterXml));
+ doc.Load (new StringReader (encryptedNode.OuterXml));
EncryptedXml ex = new EncryptedXml (doc);
return raw_xml;
}
- public void ProtectSection (string provider)
+ public void ProtectSection (string protectionProvider)
{
- protection_provider = ProtectedConfiguration.GetProvider (provider, true);
+ protection_provider = ProtectedConfiguration.GetProvider (protectionProvider, true);
}
[MonoTODO]
- public void ForceDeclaration (bool require)
+ public void ForceDeclaration (bool force)
{
}
protection_provider = null;
}
- public void SetRawXml (string xml)
+ public void SetRawXml (string rawXml)
{
- raw_xml = xml;
+ raw_xml = rawXml;
}
[MonoTODO]
using System.IO;
namespace System.Configuration {
- public delegate void ValidatorCallback (object o);
+ public delegate void ValidatorCallback (object value);
}
KeyValue = KeyBuilder.Key (KeySizeValue >> 3);
}
- public override ICryptoTransform CreateDecryptor (byte[] rgbKey, byte[] rgbIV)
+ public override ICryptoTransform CreateDecryptor (byte[] key, byte[] iv)
{
if ((Mode == CipherMode.CFB) && (FeedbackSize > 64))
throw new CryptographicException ("CFB with Feedbaack > 64 bits");
- return new AesTransform (this, false, rgbKey, rgbIV);
+ return new AesTransform (this, false, key, iv);
}
- public override ICryptoTransform CreateEncryptor (byte[] rgbKey, byte[] rgbIV)
+ public override ICryptoTransform CreateEncryptor (byte[] key, byte[] iv)
{
if ((Mode == CipherMode.CFB) && (FeedbackSize > 64))
throw new CryptographicException ("CFB with Feedbaack > 64 bits");
- return new AesTransform (this, true, rgbKey, rgbIV);
+ return new AesTransform (this, true, key, iv);
}
// I suppose some attributes differs ?!? because this does not look required
/// </summary>\r
/// <param name="connectionString">specifies file or server connection</param>\r
[DbLinqToDo]\r
- public DataContext(string connectionString)\r
+ public DataContext(string fileOrServerOrConnection)\r
{\r
Profiler.At("START DataContext(string)");\r
- IVendor ivendor = GetVendor(ref connectionString);\r
+ IVendor ivendor = GetVendor(ref fileOrServerOrConnection);\r
\r
- IDbConnection dbConnection = ivendor.CreateDbConnection(connectionString);\r
+ IDbConnection dbConnection = ivendor.CreateDbConnection(fileOrServerOrConnection);\r
Init(new DatabaseContext(dbConnection), null, ivendor);\r
\r
Profiler.At("END DataContext(string)");\r
-//
+//
// System.Data.OracleClient.OracleCommandBuilder.cs
//
// based on the SqlCommandBuilder in mcs/class/System.Data/System.Data.SqlClient
}
[MonoTODO]
- protected override void ApplyParameterInfo (DbParameter dbParameter,
- DataRow row,
+ protected override void ApplyParameterInfo (DbParameter parameter,
+ DataRow datarow,
StatementType statementType,
bool whereClause)
{
}
[MonoTODO]
- protected override string GetParameterName (int position)
+ protected override string GetParameterName (int parameterOrdinal)
{
throw new NotImplementedException ();
}
}
[MonoTODO]
- protected override string GetParameterPlaceholder (int position)
+ protected override string GetParameterPlaceholder (int parameterOrdinal)
{
throw new NotImplementedException ();
}
ConnectionString = connectionString;
}
- public SqlConnection (string connectionString, SqlCredential cred)
+ public SqlConnection (string connectionString, SqlCredential credential)
{
ConnectionString = connectionString;
- Credentials = cred;
+ Credentials = credential;
}
#endregion // Constructors
#region Constructors
- public SqlCredential (string user, SecureString password)
+ public SqlCredential (string userId, SecureString password)
{
- if (user == null)
- throw new ArgumentNullException("UserID");
+ if (userId == null)
+ throw new ArgumentNullException("userId");
if (password == null)
- throw new ArgumentNullException("Password");
- this.uid = user;
+ throw new ArgumentNullException("password");
+ this.uid = userId;
this.pwd = password;
}
Assembly/AssemblyInfo.cs
-../../build/common/Consts.cs.in
+../../build/common/Consts.cs
../../build/common/Locale.cs
../../build/common/SR.cs
../../build/common/MonoTODOAttribute.cs
}
public virtual CodeStatementCollection SerializeMember (IDesignerSerializationManager manager,
- object owningobject, MemberDescriptor member)
+ object owningObject, MemberDescriptor member)
{
if (member == null)
throw new ArgumentNullException ("member");
- if (owningobject == null)
- throw new ArgumentNullException ("owningobject");
+ if (owningObject == null)
+ throw new ArgumentNullException ("owningObject");
if (manager == null)
throw new ArgumentNullException ("manager");
CodeStatementCollection statements = new CodeStatementCollection ();
- CodeExpression expression = base.GetExpression (manager, owningobject);
+ CodeExpression expression = base.GetExpression (manager, owningObject);
if (expression == null) {
- string name = manager.GetName (owningobject);
+ string name = manager.GetName (owningObject);
if (name == null)
- name = base.GetUniqueName (manager, owningobject);
+ name = base.GetUniqueName (manager, owningObject);
expression = new CodeVariableReferenceExpression (name);
- base.SetExpression (manager, owningobject, expression);
+ base.SetExpression (manager, owningObject, expression);
}
if (member is PropertyDescriptor)
- base.SerializeProperty (manager, statements, owningobject, (PropertyDescriptor) member);
+ base.SerializeProperty (manager, statements, owningObject, (PropertyDescriptor) member);
if (member is EventDescriptor)
- base.SerializeEvent (manager, statements, owningobject, (EventDescriptor) member);
+ base.SerializeEvent (manager, statements, owningObject, (EventDescriptor) member);
return statements;
}
public virtual CodeStatementCollection SerializeMemberAbsolute (IDesignerSerializationManager manager,
- object owningobject, MemberDescriptor member)
+ object owningObject, MemberDescriptor member)
{
if (member == null)
throw new ArgumentNullException ("member");
- if (owningobject == null)
- throw new ArgumentNullException ("owningobject");
+ if (owningObject == null)
+ throw new ArgumentNullException ("owningObject");
if (manager == null)
throw new ArgumentNullException ("manager");
SerializeAbsoluteContext context = new SerializeAbsoluteContext (member);
manager.Context.Push (context);
- CodeStatementCollection result = this.SerializeMember (manager, owningobject, member);
+ CodeStatementCollection result = this.SerializeMember (manager, owningObject, member);
manager.Context.Pop ();
return result;
}
{
}
- protected CodeExpression SerializeToExpression (IDesignerSerializationManager manager, object instance)
+ protected CodeExpression SerializeToExpression (IDesignerSerializationManager manager, object value)
{
if (manager == null)
throw new ArgumentNullException ("manager");
CodeExpression expression = null;
- if (instance != null)
- expression = this.GetExpression (manager, instance); // 1 - IDesignerSerializationManager.GetExpression
+ if (value != null)
+ expression = this.GetExpression (manager, value); // 1 - IDesignerSerializationManager.GetExpression
if (expression == null) {
- CodeDomSerializer serializer = this.GetSerializer (manager, instance); // 2 - manager.GetSerializer().Serialize()
+ CodeDomSerializer serializer = this.GetSerializer (manager, value); // 2 - manager.GetSerializer().Serialize()
if (serializer != null) {
- object serialized = serializer.Serialize (manager, instance);
+ object serialized = serializer.Serialize (manager, value);
expression = serialized as CodeExpression; // 3 - CodeStatement or CodeStatementCollection
if (expression == null) {
CodeStatement statement = serialized as CodeStatement;
CodeStatementCollection contextStatements = null;
StatementContext context = manager.Context[typeof (StatementContext)] as StatementContext;
- if (context != null && instance != null)
- contextStatements = context.StatementCollection[instance];
+ if (context != null && value != null)
+ contextStatements = context.StatementCollection[value];
if (contextStatements == null)
contextStatements = manager.Context[typeof (CodeStatementCollection)] as CodeStatementCollection;
}
}
}
- if (expression == null && instance != null)
- expression = this.GetExpression (manager, instance); // 4
+ if (expression == null && value != null)
+ expression = this.GetExpression (manager, value); // 4
} else {
- ReportError (manager, "No serializer found for type '" + instance.GetType ().Name + "'");
+ ReportError (manager, "No serializer found for type '" + value.GetType ().Name + "'");
}
}
return expression;
}
- protected CodeDomSerializer GetSerializer (IDesignerSerializationManager manager, object instance)
+ protected CodeDomSerializer GetSerializer (IDesignerSerializationManager manager, object value)
{
DesignerSerializerAttribute attrInstance, attrType;
attrType = attrInstance = null;
CodeDomSerializer serializer = null;
- if (instance == null)
+ if (value == null)
serializer = this.GetSerializer (manager, null);
else {
- AttributeCollection attributes = TypeDescriptor.GetAttributes (instance);
+ AttributeCollection attributes = TypeDescriptor.GetAttributes (value);
foreach (Attribute a in attributes) {
DesignerSerializerAttribute designerAttr = a as DesignerSerializerAttribute;
if (designerAttr != null && manager.GetType (designerAttr.SerializerBaseTypeName) == typeof (CodeDomSerializer)) {
}
}
- attributes = TypeDescriptor.GetAttributes (instance.GetType ());
+ attributes = TypeDescriptor.GetAttributes (value.GetType ());
foreach (Attribute a in attributes) {
DesignerSerializerAttribute designerAttr = a as DesignerSerializerAttribute;
if (designerAttr != null && manager.GetType (designerAttr.SerializerBaseTypeName) == typeof (CodeDomSerializer)) {
if (attrType != null && attrInstance != null && attrType.SerializerTypeName != attrInstance.SerializerTypeName)
serializer = Activator.CreateInstance (manager.GetType (attrInstance.SerializerTypeName)) as CodeDomSerializer;
else
- serializer = this.GetSerializer (manager, instance.GetType ());
+ serializer = this.GetSerializer (manager, value.GetType ());
}
return serializer;
}
- protected CodeDomSerializer GetSerializer (IDesignerSerializationManager manager, Type instanceType)
+ protected CodeDomSerializer GetSerializer (IDesignerSerializationManager manager, Type valueType)
{
- return manager.GetSerializer (instanceType, typeof (CodeDomSerializer)) as CodeDomSerializer;
+ return manager.GetSerializer (valueType, typeof (CodeDomSerializer)) as CodeDomSerializer;
}
- protected CodeExpression GetExpression (IDesignerSerializationManager manager, object instance)
+ protected CodeExpression GetExpression (IDesignerSerializationManager manager, object value)
{
if (manager == null)
throw new ArgumentNullException ("manager");
- if (instance == null)
- throw new ArgumentNullException ("instance");
+ if (value == null)
+ throw new ArgumentNullException ("value");
CodeExpression expression = null;
ExpressionTable expressions = manager.Context[typeof (ExpressionTable)] as ExpressionTable;
if (expressions != null) // 1st try: ExpressionTable
- expression = expressions [instance] as CodeExpression;
+ expression = expressions [value] as CodeExpression;
if (expression == null) { // 2nd try: RootContext
RootContext context = manager.Context[typeof (RootContext)] as RootContext;
- if (context != null && context.Value == instance)
+ if (context != null && context.Value == value)
expression = context.Expression;
}
if (expression == null) { // 3rd try: IReferenceService (instance.property.property.property
- string name = manager.GetName (instance);
+ string name = manager.GetName (value);
if (name == null || name.IndexOf (".") == -1) {
IReferenceService service = manager.GetService (typeof (IReferenceService)) as IReferenceService;
if (service != null) {
- name = service.GetName (instance);
+ name = service.GetName (value);
if (name != null && name.IndexOf (".") != -1) {
string[] parts = name.Split (new char[] { ',' });
- instance = manager.GetInstance (parts[0]);
- if (instance != null) {
- expression = SerializeToExpression (manager, instance);
+ value = manager.GetInstance (parts[0]);
+ if (value != null) {
+ expression = SerializeToExpression (manager, value);
if (expression != null) {
for (int i=1; i < parts.Length; i++)
expression = new CodePropertyReferenceExpression (expression, parts[i]);
return expression;
}
- protected void SetExpression (IDesignerSerializationManager manager, object instance, CodeExpression expression)
+ protected void SetExpression (IDesignerSerializationManager manager, object value, CodeExpression expression)
{
- SetExpression (manager, instance, expression, false);
+ SetExpression (manager, value, expression, false);
}
// XXX: isPreset - what does this do when set?
//
- protected void SetExpression (IDesignerSerializationManager manager, object instance, CodeExpression expression, bool isPreset)
+ protected void SetExpression (IDesignerSerializationManager manager, object value, CodeExpression expression, bool isPreset)
{
if (manager == null)
throw new ArgumentNullException ("manager");
- if (instance == null)
- throw new ArgumentNullException ("instance");
+ if (value == null)
+ throw new ArgumentNullException ("value");
if (expression == null)
throw new ArgumentNullException ("expression");
manager.Context.Append (expressions);
}
- expressions[instance] = expression;
+ expressions[value] = expression;
}
protected bool IsSerialized (IDesignerSerializationManager manager, object value)
}
// XXX: What should honorPreset do?
- protected bool IsSerialized (IDesignerSerializationManager manager, object instance, bool honorPreset)
+ protected bool IsSerialized (IDesignerSerializationManager manager, object value, bool honorPreset)
{
- if (instance == null)
- throw new ArgumentNullException ("instance");
+ if (value == null)
+ throw new ArgumentNullException ("value");
if (manager == null)
throw new ArgumentNullException ("manager");
- if (this.GetExpression (manager, instance) != null)
+ if (this.GetExpression (manager, value) != null)
return true;
else
return false;
return manager.CreateInstance (type, parameters, name, addToContainer);
}
- protected string GetUniqueName (IDesignerSerializationManager manager, object instance)
+ protected string GetUniqueName (IDesignerSerializationManager manager, object value)
{
- if (instance == null)
- throw new ArgumentNullException ("instance");
+ if (value == null)
+ throw new ArgumentNullException ("value");
if (manager == null)
throw new ArgumentNullException ("manager");
- string name = manager.GetName (instance);
+ string name = manager.GetName (value);
if (name == null) {
INameCreationService service = manager.GetService (typeof (INameCreationService)) as INameCreationService;
- name = service.CreateName (null, instance.GetType ());
+ name = service.CreateName (null, value.GetType ());
if (name == null)
- name = instance.GetType ().Name.ToLower ();
- manager.SetName (instance, name);
+ name = value.GetType ().Name.ToLower ();
+ manager.SetName (value, name);
}
return name;
}
return instance;
}
- public object GetSerializer (Type componentType, Type serializerType)
+ public object GetSerializer (Type objectType, Type serializerType)
{
VerifyInSession ();
object serializer = null;
- if (componentType != null) {
+ if (objectType != null) {
// try 1: from cache
//
- _serializersCache.TryGetValue (componentType, out serializer);
+ _serializersCache.TryGetValue (objectType, out serializer);
// check for provider attribute and add it to the list of providers
//
if (serializer != null && !serializerType.IsAssignableFrom (serializer.GetType ()))
serializer = null;
- AttributeCollection attributes = TypeDescriptor.GetAttributes (componentType);
+ AttributeCollection attributes = TypeDescriptor.GetAttributes (objectType);
DefaultSerializationProviderAttribute providerAttribute = attributes[typeof (DefaultSerializationProviderAttribute)]
as DefaultSerializationProviderAttribute;
if (providerAttribute != null && this.GetType (providerAttribute.ProviderTypeName) == serializerType) {
// try 2: DesignerSerializerAttribute
//
- if (serializer == null && componentType != null) {
- AttributeCollection attributes = TypeDescriptor.GetAttributes (componentType);
+ if (serializer == null && objectType != null) {
+ AttributeCollection attributes = TypeDescriptor.GetAttributes (objectType);
DesignerSerializerAttribute serializerAttribute = attributes[typeof (DesignerSerializerAttribute)] as DesignerSerializerAttribute;
if (serializerAttribute != null &&
this.GetType (serializerAttribute.SerializerBaseTypeName) == serializerType) {
}
if (serializer != null)
- _serializersCache[componentType] = serializer;
+ _serializersCache[objectType] = serializer;
}
// try 3: from provider
//
if (serializer == null && _serializationProviders != null) {
foreach (IDesignerSerializationProvider provider in _serializationProviders) {
- serializer = provider.GetSerializer (this, null, componentType, serializerType);
+ serializer = provider.GetSerializer (this, null, objectType, serializerType);
if (serializer != null)
break;
}
_serializationCompleteHandler (this, EventArgs.Empty);
}
- protected virtual Type GetType (string name)
+ protected virtual Type GetType (string typeName)
{
- if (name == null)
- throw new ArgumentNullException ("name");
+ if (typeName == null)
+ throw new ArgumentNullException ("typeName");
this.VerifyInSession ();
Type result = null;
ITypeResolutionService typeResSvc = this.GetService (typeof (ITypeResolutionService)) as ITypeResolutionService;
if (typeResSvc != null)
- result = typeResSvc.GetType (name);
+ result = typeResSvc.GetType (typeName);
if (result == null)
- result = Type.GetType (name);
+ result = Type.GetType (typeName);
return result;
}
}
#endregion
- object IServiceProvider.GetService (Type service)
+ object IServiceProvider.GetService (Type serviceType)
{
- return this.GetService (service);
+ return this.GetService (serviceType);
}
- protected virtual object GetService (Type service)
+ protected virtual object GetService (Type serviceType)
{
object result = null;
if (_serviceProvider != null)
- result = _serviceProvider.GetService (service);
+ result = _serviceProvider.GetService (serviceType);
return result;
}
return _statements.GetEnumerator ();
}
- public CodeStatementCollection this[object owner]
+ public CodeStatementCollection this[object statementOwner]
{
- get { return _statements[owner] as CodeStatementCollection; }
+ get { return _statements[statementOwner] as CodeStatementCollection; }
}
IEnumerator IEnumerable.GetEnumerator()
CodeExpression _expression;
object _value;
- public RootContext (CodeExpression expresion, object value)
+ public RootContext (CodeExpression expression, object value)
{
- if (expresion == null)
+ if (expression == null)
throw new ArgumentNullException ("expression");
if (value == null)
throw new ArgumentNullException ("value");
- _expression = expresion;
+ _expression = expression;
_value = value;
}
// Helper method - not an ISerivceProvider
//
- protected virtual object GetService (Type service)
+ protected virtual object GetService (Type serviceType)
{
if (_component != null && _component.Site != null)
- return _component.Site.GetService (service);
+ return _component.Site.GetService (serviceType);
return null;
}
{
}
- public DesignSurfaceManager (IServiceProvider serviceProvider)
+ public DesignSurfaceManager (IServiceProvider parentProvider)
{
- _parentProvider = serviceProvider;
+ _parentProvider = parentProvider;
this.ServiceContainer.AddService (typeof (IDesignerEventService), new DesignerEventService ());
}
}
- public object GetService (Type service)
+ public object GetService (Type serviceType)
{
if (_serviceContainer != null)
- return _serviceContainer.GetService (service);
+ return _serviceContainer.GetService (serviceType);
return null;
}
protected abstract bool ShowCode (IComponent component, EventDescriptor e, string methodName);
protected abstract bool ShowCode (int lineNumber);
protected abstract bool ShowCode ();
- protected abstract string CreateUniqueMethodName (IComponent component, EventDescriptor eventDescriptor);
- protected abstract ICollection GetCompatibleMethods (EventDescriptor eventDescriptor);
+ protected abstract string CreateUniqueMethodName (IComponent component, EventDescriptor e);
+ protected abstract ICollection GetCompatibleMethods (EventDescriptor e);
protected virtual void FreeMethod (IComponent component, EventDescriptor e, string methodName)
{
}
- protected object GetService (Type service)
+ protected object GetService (Type serviceType)
{
if (_provider != null)
- return _provider.GetService (service);
+ return _provider.GetService (serviceType);
return null;
}
return false;
}
- public virtual bool GlobalInvoke (CommandID commandID, object arg)
+ public virtual bool GlobalInvoke (CommandID commandId, object arg)
{
- if (commandID == null)
- throw new ArgumentNullException ("commandID");
+ if (commandId == null)
+ throw new ArgumentNullException ("commandId");
- MenuCommand command = this.FindCommand (commandID);
+ MenuCommand command = this.FindCommand (commandId);
if (command != null) {
command.Invoke (arg);
return true;
errorList.Add (info.GetString("KEY_ARRAYVALUES" + i));
}
- public TypedDataSetGeneratorException (String error) : base (error)
+ public TypedDataSetGeneratorException (String message) : base (message)
{
}
- public TypedDataSetGeneratorException (String error, Exception inner)
- : base (error, inner)
+ public TypedDataSetGeneratorException (String message, Exception innerException)
+ : base (message, innerException)
{
}
#endregion //Constructors
#region Methods
- public override void GetObjectData (SerializationInfo si, StreamingContext context)
+ public override void GetObjectData (SerializationInfo info, StreamingContext context)
{
- base.GetObjectData (si, context);
+ base.GetObjectData (info, context);
int count = (errorList != null) ? ErrorList.Count : 0;
- si.AddValue ("KEY_ARRAYCOUNT", count);
+ info.AddValue ("KEY_ARRAYCOUNT", count);
for (int i=0; i < count; i++)
- si.AddValue("KEY_ARRAYVALUES" + i, ErrorList [i]);
+ info.AddValue("KEY_ARRAYVALUES" + i, ErrorList [i]);
}
#endregion // Methods
{
int initial_page;
- public BaseDataListComponentEditor (int initial_page)
+ public BaseDataListComponentEditor (int initialPage)
{
- this.initial_page = initial_page;
+ this.initial_page = initialPage;
}
public override bool EditComponent (
}
protected IEnumerable GetDesignTimeDataSource (
- int minimum_rows,
- out bool dummy_data_source)
+ int minimumRows,
+ out bool dummyDataSource)
{
throw new NotImplementedException ();
}
protected IEnumerable GetDesignTimeDataSource (
- IEnumerable selected_data_source,
- int minimum_rows,
- out bool dummy_data_source)
+ IEnumerable selectedDataSource,
+ int minimumRows,
+ out bool dummyDataSource)
{
throw new NotImplementedException ();
}
throw new NotImplementedException ();
}
- public override IEnumerable GetTemplateContainerDataSource (string template_name)
+ public override IEnumerable GetTemplateContainerDataSource (string templateName)
{
throw new NotImplementedException ();
}
throw new NotImplementedException ();
}
- protected internal void InvokePropertyBuilder (int initial_page)
+ protected internal void InvokePropertyBuilder (int initialPage)
{
throw new NotImplementedException ();
}
{
}
- public DataListComponentEditor (int initial_page)
- : base (initial_page)
+ public DataListComponentEditor (int initialPage)
+ : base (initialPage)
{
}
throw new NotImplementedException ();
}
- public override void DataBindControl (IDesignerHost designer_host, Control control)
+ public override void DataBindControl (IDesignerHost designerHost, Control control)
{
throw new NotImplementedException ();
}
{
}
- protected override void MapPropertyToStyle (string name, object value)
+ protected override void MapPropertyToStyle (string propName, object varPropValue)
{
throw new NotImplementedException ();
}
throw new NotImplementedException ();
}
- protected IEnumerable GetDesignTimeDataSource (int minimum_rows)
+ protected IEnumerable GetDesignTimeDataSource (int minimumRows)
{
throw new NotImplementedException ();
}
protected IEnumerable GetDesignTimeDataSource (
- IEnumerable selected_data_source,
- int minimum_rows)
+ IEnumerable selectedDataSource,
+ int minimumRows)
{
throw new NotImplementedException ();
}
throw new NotImplementedException ();
}
- public override void OnComponentChanged (object sender, ComponentChangedEventArgs e)
+ public override void OnComponentChanged (object source, ComponentChangedEventArgs ce)
{
throw new NotImplementedException ();
}
throw new NotImplementedException ();
}
- protected override object CreateInstance (Type item_type)
+ protected override object CreateInstance (Type itemType)
{
throw new NotImplementedException ();
}
throw new NotImplementedException ();
}
- protected override object CreateInstance (Type item_type)
+ protected override object CreateInstance (Type itemType)
{
throw new NotImplementedException ();
}
return false;
}
- protected override object GetService (Type service)
+ protected override object GetService (Type serviceType)
{
if (_serviceProvider != null) {
- return _serviceProvider.GetService (service);
+ return _serviceProvider.GetService (serviceType);
}
return null;
}
#region Parenting
- protected void HookChildControls (Control firstControl)
+ protected void HookChildControls (Control firstChild)
{
- if (firstControl != null) {
- foreach (Control control in firstControl.Controls) {
+ if (firstChild != null) {
+ foreach (Control control in firstChild.Controls) {
control.WindowTarget = (IWindowTarget) new WndProcRouter (control, (IMessageReceiver) this);
}
}
}
- protected void UnhookChildControls (Control firstControl)
+ protected void UnhookChildControls (Control firstChild)
{
- if (firstControl != null) {
- foreach (Control control in firstControl.Controls) {
+ if (firstChild != null) {
+ foreach (Control control in firstChild.Controls) {
if (control.WindowTarget is WndProcRouter)
((WndProcRouter) control.WindowTarget).Dispose ();
}
e.UseDefaultCursors = false;
}
- protected virtual void OnDragDrop (DragEventArgs e)
+ protected virtual void OnDragDrop (DragEventArgs de)
{
}
- protected virtual void OnDragEnter (DragEventArgs e)
+ protected virtual void OnDragEnter (DragEventArgs de)
{
}
{
}
- protected virtual void OnDragOver (DragEventArgs e)
+ protected virtual void OnDragOver (DragEventArgs de)
{
}
#endregion
// component - The IComponent to ensure has a context menu service.
// XXX: Not sure exactly what this should do...
//
- protected virtual void EnsureMenuEditorService (IComponent component)
+ protected virtual void EnsureMenuEditorService (IComponent c)
{
- if (this.menuEditorService == null && component is ContextMenu)
+ if (this.menuEditorService == null && c is ContextMenu)
menuEditorService = (IMenuEditorService) GetService (typeof (IMenuEditorService));
}
#endregion
return false;
}
- public virtual bool CanParent (ControlDesigner designer)
+ public virtual bool CanParent (ControlDesigner controlDesigner)
{
- return CanParent (designer.Control);
+ return CanParent (controlDesigner.Control);
}
- protected override void OnDragDrop (DragEventArgs e)
+ protected override void OnDragDrop (DragEventArgs de)
{
IUISelectionService selectionServ = this.GetService (typeof (IUISelectionService)) as IUISelectionService;
if (selectionServ != null) {
// once this is fired the parent control (parentcontroldesigner) will start getting dragover events.
//
- Point location = this.SnapPointToGrid (this.Control.PointToClient (new Point (e.X, e.Y)));
+ Point location = this.SnapPointToGrid (this.Control.PointToClient (new Point (de.X, de.Y)));
selectionServ.DragDrop (false, this.Control, location.X, location.Y);
}
}
- protected override void OnDragEnter (DragEventArgs e)
+ protected override void OnDragEnter (DragEventArgs de)
{
this.Control.Refresh ();
}
this.Control.Refresh ();
}
- protected override void OnDragOver (DragEventArgs e)
+ protected override void OnDragOver (DragEventArgs de)
{
IUISelectionService selectionServ = this.GetService (typeof (IUISelectionService)) as IUISelectionService;
if (selectionServ != null) {
// once ControlDesigner.MouseDragBegin is called this will start getting dragover events.
//
- Point location = this.SnapPointToGrid (this.Control.PointToClient (new Point (e.X, e.Y)));
+ Point location = this.SnapPointToGrid (this.Control.PointToClient (new Point (de.X, de.Y)));
selectionServ.DragOver (this.Control, location.X, location.Y);
}
- e.Effect = DragDropEffects.Move;
+ de.Effect = DragDropEffects.Move;
}
#endregion
private const int HTHSCROLL = 6;
private const int HTVSCROLL = 7;
- protected override bool GetHitTest (Point point)
+ protected override bool GetHitTest (Point pt)
{
- if (base.GetHitTest (point)) {
+ if (base.GetHitTest (pt)) {
return true;
}
int hitTestResult = (int) Native.SendMessage (this.Control.Handle,
Native.Msg.WM_NCHITTEST,
IntPtr.Zero,
- (IntPtr) Native.LParam (point.X, point.Y));
+ (IntPtr) Native.LParam (pt.X, pt.Y));
if (hitTestResult == HTHSCROLL || hitTestResult == HTVSCROLL)
return true;
}
Assembly/AssemblyInfo.cs
-../../build/common/Consts.cs.in
+../../build/common/Consts.cs
../../build/common/Locale.cs
System.DirectoryServices/ActiveDirectoryAccessRule.cs
System.DirectoryServices/ActiveDirectoryAuditRule.cs
/// <param name="filter">relative distinguised name of the child
/// </param>
/// <returns>Child entry with the specified name </returns>
- public DirectoryEntry Find(string filter)
+ public DirectoryEntry Find(string name)
{
- DirectoryEntry child=CheckEntry(filter);
+ DirectoryEntry child=CheckEntry(name);
return child;
}
/// <param name="otype"> Type of the child i.e strutcuralObjectClass
/// name of the child </param>
/// <returns>Child entry with the specified name and type</returns>
- public DirectoryEntry Find(string filter, string otype)
+ public DirectoryEntry Find(string name, string schemaClassName)
{
- DirectoryEntry child=CheckEntry(filter);
+ DirectoryEntry child=CheckEntry(name);
if( child != null) {
- if(child.Properties["objectclass"].ContainsCaselessStringValue(otype))
+ if(child.Properties["objectclass"].ContainsCaselessStringValue(schemaClassName))
return child;
else
throw new SystemException("An unknown directory object was requested");
SetUp ();
}
- public DirectoryServicesPermission (DirectoryServicesPermissionEntry[] entries)
+ public DirectoryServicesPermission (DirectoryServicesPermissionEntry[] permissionAccessEntries)
{
SetUp ();
innerCollection = new DirectoryServicesPermissionEntryCollection (this);
- innerCollection.AddRange (entries);
+ innerCollection.AddRange (permissionAccessEntries);
}
public DirectoryServicesPermission (PermissionState state)
SetUp ();
}
- public DirectoryServicesPermission (DirectoryServicesPermissionAccess access, string path)
+ public DirectoryServicesPermission (DirectoryServicesPermissionAccess permissionAccess, string path)
{
SetUp ();
innerCollection = new DirectoryServicesPermissionEntryCollection (this);
- innerCollection.Add (new DirectoryServicesPermissionEntry (access, path));
+ innerCollection.Add (new DirectoryServicesPermissionEntry (permissionAccess, path));
}
public DirectoryServicesPermissionEntryCollection PermissionEntries {
set { List[index] = value; }
}
- public int Add (DirectoryServicesPermissionEntry entry)
+ public int Add (DirectoryServicesPermissionEntry value)
{
- return List.Add (entry);
+ return List.Add (value);
}
- public void AddRange (DirectoryServicesPermissionEntry[] entries)
+ public void AddRange (DirectoryServicesPermissionEntry[] value)
{
- foreach (DirectoryServicesPermissionEntry entry in entries)
+ foreach (DirectoryServicesPermissionEntry entry in value)
Add (entry);
}
- public void AddRange (DirectoryServicesPermissionEntryCollection entries)
+ public void AddRange (DirectoryServicesPermissionEntryCollection value)
{
- foreach (DirectoryServicesPermissionEntry entry in entries)
+ foreach (DirectoryServicesPermissionEntry entry in value)
Add (entry);
}
- public void CopyTo (DirectoryServicesPermissionEntry[] copy_to, int index)
+ public void CopyTo (DirectoryServicesPermissionEntry[] array, int index)
{
foreach (DirectoryServicesPermissionEntry entry in List)
- copy_to[index++] = entry;
+ array[index++] = entry;
}
- public bool Contains (DirectoryServicesPermissionEntry entry)
+ public bool Contains (DirectoryServicesPermissionEntry value)
{
- return List.Contains (entry);
+ return List.Contains (value);
}
- public int IndexOf (DirectoryServicesPermissionEntry entry)
+ public int IndexOf (DirectoryServicesPermissionEntry value)
{
- return List.IndexOf (entry);
+ return List.IndexOf (value);
}
- public void Insert (int pos, DirectoryServicesPermissionEntry entry)
+ public void Insert (int index, DirectoryServicesPermissionEntry value)
{
- List.Insert (pos, entry);
+ List.Insert (index, value);
}
- public void Remove (DirectoryServicesPermissionEntry entry)
+ public void Remove (DirectoryServicesPermissionEntry value)
{
- List.Remove (entry);
+ List.Remove (value);
}
protected override void OnClear ()
}
- public void AddRange(object[] values)
+ public void AddRange(object[] value)
{
- foreach (object value in values)
- Add (value);
+ foreach (object val in value)
+ Add (val);
}
- public void AddRange (PropertyValueCollection coll)
+ public void AddRange (PropertyValueCollection value)
{
- foreach (object value in coll)
- Add (value);
+ foreach (object val in value)
+ Add (val);
}
public int IndexOf( object value )
return false;
}
- public void CopyTo (object[] copy_to, int index)
+ public void CopyTo (object[] array, int index)
{
foreach (object o in List)
- copy_to[index++] = o;
+ array[index++] = o;
}
[MonoTODO]
}
- public ResultPropertyValueCollection this[string key]
+ public ResultPropertyValueCollection this[string name]
{
get {
- return (ResultPropertyValueCollection) this.Dictionary[key.ToLower()];
+ return (ResultPropertyValueCollection) this.Dictionary[name.ToLower()];
}
// set { this.Dictionary[key] = value; }
}
}
//see if collection contains an entry corresponding to key
- public bool Contains(string key)
+ public bool Contains(string propertyName)
{
- return this.Dictionary.Contains(key.ToLower());
+ return this.Dictionary.Contains(propertyName.ToLower());
}
public ICollection PropertyNames
}
}
- public void CopyTo (ResultPropertyValueCollection[] copy_to, int index)
+ public void CopyTo (ResultPropertyValueCollection[] array, int index)
{
foreach (ResultPropertyValueCollection vals in Values)
- copy_to[index++] = vals;
+ array[index++] = vals;
}
}
}
return InnerList.Contains (value);
}
- public void CopyTo (object[] array, int index)
+ public void CopyTo (object[] values, int index)
{
- InnerList.CopyTo (array, index);
+ InnerList.CopyTo (values, index);
}
public int IndexOf (object value)
}
[MonoTODO]
- public void AddRange (SchemaNameCollection coll)
+ public void AddRange (SchemaNameCollection value)
{
throw new NotImplementedException();
}
[MonoTODO]
- public void AddRange (string[] coll)
+ public void AddRange (string[] value)
{
throw new NotImplementedException();
}
[MonoTODO]
- public bool Contains (string s)
+ public bool Contains (string value)
{
throw new NotImplementedException();
}
}
[MonoTODO]
- public void CopyTo (string[] copy_to, int pos)
+ public void CopyTo (string[] stringArray, int index)
{
throw new NotImplementedException();
}
[MonoTODO]
- public int IndexOf (string s)
+ public int IndexOf (string value)
{
throw new NotImplementedException();
}
[MonoTODO]
- public void Insert (int pos, string s)
+ public void Insert (int index, string value)
{
throw new NotImplementedException();
}
[MonoTODO]
- public void Remove (string s)
+ public void Remove (string value)
{
throw new NotImplementedException();
}
//
using System.Collections;
-using System.Security.Permissions;
namespace System.Drawing.Design
{
- [PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
public sealed class CategoryNameCollection : ReadOnlyCollectionBase
{
//
using System.ComponentModel;
-using System.Security.Permissions;
namespace System.Drawing.Design
{
- [PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
- [PermissionSet (SecurityAction.InheritanceDemand, Unrestricted = true)]
public class PaintValueEventArgs : EventArgs
{
private ITypeDescriptorContext context;
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System.Security.Permissions;
-
namespace System.Drawing.Design
{
- [PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
- [PermissionSet (SecurityAction.InheritanceDemand, Unrestricted = true)]
public class PropertyValueUIItem
{
//
using System.ComponentModel;
-using System.Security.Permissions;
namespace System.Drawing.Design
{
- [PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
- [PermissionSet (SecurityAction.InheritanceDemand, Unrestricted = true)]
public class ToolboxComponentsCreatedEventArgs : EventArgs
{
private IComponent[] components;
//
using System.ComponentModel;
-using System.Security.Permissions;
using System.Collections;
namespace System.Drawing.Design
{
- [PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
- [PermissionSet (SecurityAction.InheritanceDemand, Unrestricted = true)]
public class UITypeEditor {
static UITypeEditor ()
//
// AddArc
//
- public void AddArc (Rectangle rect, float start_angle, float sweep_angle)
+ public void AddArc (Rectangle rect, float startAngle, float sweepAngle)
{
- Status status = GDIPlus.GdipAddPathArcI (nativePath, rect.X, rect.Y, rect.Width, rect.Height, start_angle, sweep_angle);
+ Status status = GDIPlus.GdipAddPathArcI (nativePath, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
GDIPlus.CheckStatus (status);
}
- public void AddArc (RectangleF rect, float start_angle, float sweep_angle)
+ public void AddArc (RectangleF rect, float startAngle, float sweepAngle)
{
- Status status = GDIPlus.GdipAddPathArc (nativePath, rect.X, rect.Y, rect.Width, rect.Height, start_angle, sweep_angle);
+ Status status = GDIPlus.GdipAddPathArc (nativePath, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle);
GDIPlus.CheckStatus (status);
}
- public void AddArc (int x, int y, int width, int height, float start_angle, float sweep_angle)
+ public void AddArc (int x, int y, int width, int height, float startAngle, float sweepAngle)
{
- Status status = GDIPlus.GdipAddPathArcI (nativePath, x, y, width, height, start_angle, sweep_angle);
+ Status status = GDIPlus.GdipAddPathArcI (nativePath, x, y, width, height, startAngle, sweepAngle);
GDIPlus.CheckStatus (status);
}
- public void AddArc (float x, float y, float width, float height, float start_angle, float sweep_angle)
+ public void AddArc (float x, float y, float width, float height, float startAngle, float sweepAngle)
{
- Status status = GDIPlus.GdipAddPathArc (nativePath, x, y, width, height, start_angle, sweep_angle);
+ Status status = GDIPlus.GdipAddPathArc (nativePath, x, y, width, height, startAngle, sweepAngle);
GDIPlus.CheckStatus (status);
}
//
// AddBeziers
//
- public void AddBeziers (params Point [] pts)
+ public void AddBeziers (params Point [] points)
{
- if (pts == null)
- throw new ArgumentNullException ("pts");
- Status status = GDIPlus.GdipAddPathBeziersI (nativePath, pts, pts.Length);
+ if (points == null)
+ throw new ArgumentNullException ("points");
+ Status status = GDIPlus.GdipAddPathBeziersI (nativePath, points, points.Length);
GDIPlus.CheckStatus (status);
}
- public void AddBeziers (PointF [] pts)
+ public void AddBeziers (PointF [] points)
{
- if (pts == null)
- throw new ArgumentNullException ("pts");
- Status status = GDIPlus.GdipAddPathBeziers (nativePath, pts, pts.Length);
+ if (points == null)
+ throw new ArgumentNullException ("points");
+ Status status = GDIPlus.GdipAddPathBeziers (nativePath, points, points.Length);
GDIPlus.CheckStatus (status);
}
//
// AddEllipse
//
- public void AddEllipse (RectangleF r)
+ public void AddEllipse (RectangleF rect)
{
- Status status = GDIPlus.GdipAddPathEllipse (nativePath, r.X, r.Y, r.Width, r.Height);
+ Status status = GDIPlus.GdipAddPathEllipse (nativePath, rect.X, rect.Y, rect.Width, rect.Height);
GDIPlus.CheckStatus (status);
}
GDIPlus.CheckStatus (status);
}
- public void AddEllipse (Rectangle r)
+ public void AddEllipse (Rectangle rect)
{
- Status status = GDIPlus.GdipAddPathEllipseI (nativePath, r.X, r.Y, r.Width, r.Height);
+ Status status = GDIPlus.GdipAddPathEllipseI (nativePath, rect.X, rect.Y, rect.Width, rect.Height);
GDIPlus.CheckStatus (status);
}
//
// AddLine
//
- public void AddLine (Point a, Point b)
+ public void AddLine (Point pt1, Point pt2)
{
- Status status = GDIPlus.GdipAddPathLineI (nativePath, a.X, a.Y, b.X, b.Y);
+ Status status = GDIPlus.GdipAddPathLineI (nativePath, pt1.X, pt1.Y, pt2.X, pt2.Y);
GDIPlus.CheckStatus (status);
}
- public void AddLine (PointF a, PointF b)
+ public void AddLine (PointF pt1, PointF pt2)
{
- Status status = GDIPlus.GdipAddPathLine (nativePath, a.X, a.Y, b.X,
- b.Y);
+ Status status = GDIPlus.GdipAddPathLine (nativePath, pt1.X, pt1.Y, pt2.X,
+ pt2.Y);
GDIPlus.CheckStatus (status);
}
{
}
- public HatchBrush (HatchStyle hatchStyle, Color foreColor)
- : this (hatchStyle, foreColor, Color.Black)
+ public HatchBrush (HatchStyle hatchstyle, Color foreColor)
+ : this (hatchstyle, foreColor, Color.Black)
{
}
- public HatchBrush(HatchStyle hatchStyle, Color foreColor, Color backColor)
+ public HatchBrush(HatchStyle hatchstyle, Color foreColor, Color backColor)
{
- Status status = GDIPlus.GdipCreateHatchBrush (hatchStyle, foreColor.ToArgb (), backColor.ToArgb (), out nativeObject);
+ Status status = GDIPlus.GdipCreateHatchBrush (hatchstyle, foreColor.ToArgb (), backColor.ToArgb (), out nativeObject);
GDIPlus.CheckStatus (status);
}
}
[CLSCompliant(false)]
- public ColorMatrix (float[][] matrix)
+ public ColorMatrix (float[][] newColorMatrix)
{
- color00 = matrix [0][0];
- color01 = matrix [0][1];
- color02 = matrix [0][2];
- color03 = matrix [0][3];
- color04 = matrix [0][4];
- color10 = matrix [1][0];
- color11 = matrix [1][1];
- color12 = matrix [1][2];
- color13 = matrix [1][3];
- color14 = matrix [1][4];
- color20 = matrix [2][0];
- color21 = matrix [2][1];
- color22 = matrix [2][2];
- color23 = matrix [2][3];
- color24 = matrix [2][4];
- color30 = matrix [3][0];
- color31 = matrix [3][1];
- color32 = matrix [3][2];
- color33 = matrix [3][3];
- color34 = matrix [3][4];
- color40 = matrix [4][0];
- color41 = matrix [4][1];
- color42 = matrix [4][2];
- color43 = matrix [4][3];
- color44 = matrix [4][4];
+ color00 = newColorMatrix [0][0];
+ color01 = newColorMatrix [0][1];
+ color02 = newColorMatrix [0][2];
+ color03 = newColorMatrix [0][3];
+ color04 = newColorMatrix [0][4];
+ color10 = newColorMatrix [1][0];
+ color11 = newColorMatrix [1][1];
+ color12 = newColorMatrix [1][2];
+ color13 = newColorMatrix [1][3];
+ color14 = newColorMatrix [1][4];
+ color20 = newColorMatrix [2][0];
+ color21 = newColorMatrix [2][1];
+ color22 = newColorMatrix [2][2];
+ color23 = newColorMatrix [2][3];
+ color24 = newColorMatrix [2][4];
+ color30 = newColorMatrix [3][0];
+ color31 = newColorMatrix [3][1];
+ color32 = newColorMatrix [3][2];
+ color33 = newColorMatrix [3][3];
+ color34 = newColorMatrix [3][4];
+ color40 = newColorMatrix [4][0];
+ color41 = newColorMatrix [4][1];
+ color42 = newColorMatrix [4][2];
+ color43 = newColorMatrix [4][3];
+ color44 = newColorMatrix [4][4];
}
// properties
}
}
- public EncoderParameter (Encoder encoder, int numberOfValues, int type, int value)
+ public EncoderParameter (Encoder encoder, int NumberOfValues, int Type, int Value)
{
this.encoder = encoder;
- this.valuePtr = (IntPtr) value;
- this.valuesCount = numberOfValues;
- this.type = (EncoderParameterValueType) type;
+ this.valuePtr = (IntPtr) Value;
+ this.valuesCount = NumberOfValues;
+ this.type = (EncoderParameterValueType) Type;
}
- public EncoderParameter (Encoder encoder, int numerator1, int denominator1, int numerator2, int denominator2)
+ public EncoderParameter (Encoder encoder, int numerator1, int demoninator1, int numerator2, int demoninator2)
{
this.encoder = encoder;
this.valuesCount = 1;
this.type = EncoderParameterValueType.ValueTypeRationalRange;
this.valuePtr = Marshal.AllocHGlobal (4 * 4);
- int [] valuearray = { numerator1, denominator1, numerator2, denominator2 };
+ int [] valuearray = { numerator1, demoninator1, numerator2, demoninator2 };
Marshal.Copy (valuearray, 0, this.valuePtr, 4);
}
SetColorKey (colorLow, colorHigh, ColorAdjustType.Default);
}
- public void SetColorMatrix (ColorMatrix colorMatrix)
+ public void SetColorMatrix (ColorMatrix newColorMatrix)
{
- SetColorMatrix (colorMatrix, ColorMatrixFlag.Default, ColorAdjustType.Default);
+ SetColorMatrix (newColorMatrix, ColorMatrixFlag.Default, ColorAdjustType.Default);
}
- public void SetColorMatrix (ColorMatrix colorMatrix, ColorMatrixFlag colorMatrixFlag)
+ public void SetColorMatrix (ColorMatrix newColorMatrix, ColorMatrixFlag flags)
{
- SetColorMatrix (colorMatrix, colorMatrixFlag, ColorAdjustType.Default);
+ SetColorMatrix (newColorMatrix, flags, ColorAdjustType.Default);
}
- public void SetColorMatrix (ColorMatrix colorMatrix, ColorMatrixFlag colorMatrixFlag, ColorAdjustType colorAdjustType)
+ public void SetColorMatrix (ColorMatrix newColorMatrix, ColorMatrixFlag mode, ColorAdjustType type)
{
- IntPtr cm = ColorMatrix.Alloc (colorMatrix);
+ IntPtr cm = ColorMatrix.Alloc (newColorMatrix);
try {
Status status = GDIPlus.GdipSetImageAttributesColorMatrix (nativeImageAttr,
- colorAdjustType, true, cm, IntPtr.Zero, colorMatrixFlag);
+ type, true, cm, IntPtr.Zero, mode);
GDIPlus.CheckStatus (status);
}
finally {
SetGamma (gamma, ColorAdjustType.Default);
}
- public void SetGamma (float gamma, ColorAdjustType coloradjust)
+ public void SetGamma (float gamma, ColorAdjustType type)
{
- Status status = GDIPlus.GdipSetImageAttributesGamma (nativeImageAttr, coloradjust, true, gamma);
+ Status status = GDIPlus.GdipSetImageAttributesGamma (nativeImageAttr, type, true, gamma);
GDIPlus.CheckStatus (status);
}
}
public Metafile (IntPtr referenceHdc, Rectangle frameRect, MetafileFrameUnit frameUnit, EmfType type,
- string description)
+ string desc)
{
Status status = GDIPlus.GdipRecordMetafileI (referenceHdc, type, ref frameRect, frameUnit,
- description, out nativeObject);
+ desc, out nativeObject);
GDIPlus.CheckStatus (status);
}
}
public Metafile (string fileName, IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit,
- string description) : this (fileName, referenceHdc, frameRect, frameUnit, EmfType.EmfPlusDual,
- description)
+ string desc) : this (fileName, referenceHdc, frameRect, frameUnit, EmfType.EmfPlusDual,
+ desc)
{
}
}
[MonoLimitation ("Metafiles aren't only partially supported by libgdiplus.")]
- public static MetafileHeader GetMetafileHeader (IntPtr henhmetafile, WmfPlaceableFileHeader wmfHeader)
+ public static MetafileHeader GetMetafileHeader (IntPtr hmetafile, WmfPlaceableFileHeader wmfHeader)
{
IntPtr header = Marshal.AllocHGlobal (Marshal.SizeOf (typeof (MetafileHeader)));
try {
- Status status = GDIPlus.GdipGetMetafileHeaderFromEmf (henhmetafile, header);
+ Status status = GDIPlus.GdipGetMetafileHeaderFromEmf (hmetafile, header);
GDIPlus.CheckStatus (status);
return new MetafileHeader (header);
}
//
using System.Runtime.Serialization;
-using System.Security.Permissions;
namespace System.Drawing.Printing {
{
}
- [SecurityPermission (SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData (SerializationInfo info, StreamingContext context)
{
if (info == null)
//
using System.IO;
-using System.Security.Permissions;
using System.Runtime.InteropServices;
namespace System.Drawing.Text {
GDIPlus.CheckStatus (status);
}
- [SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
public void AddMemoryFont (IntPtr memory, int length)
{
// note: MS throw FileNotFoundException if something is bad with the data (except for a null pointer)
using System.Runtime.Serialization;
using System.Runtime.InteropServices;
using System.ComponentModel;
-using System.Security.Permissions;
namespace System.Drawing
{
}
[EditorBrowsable (EditorBrowsableState.Advanced)]
- [SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
public IntPtr GetHbitmap ()
{
return GetHbitmap(Color.Gray);
}
[EditorBrowsable (EditorBrowsableState.Advanced)]
- [SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
public IntPtr GetHbitmap (Color background)
{
IntPtr HandleBmp;
}
[EditorBrowsable (EditorBrowsableState.Advanced)]
- [SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
public IntPtr GetHicon ()
{
IntPtr HandleIcon;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
-using System.Security.Permissions;
namespace System.Drawing
{
}
[MonoTODO ("The targetDC parameter has no equivalent in libgdiplus.")]
- [SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
public void Render (IntPtr targetDC)
{
throw new NotImplementedException ();
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
-using System.Security.Permissions;
namespace System.Drawing
{
}
[MonoTODO ("The targetDC parameter has no equivalent in libgdiplus.")]
- [SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
public BufferedGraphics Allocate (IntPtr targetDC, Rectangle targetRectangle)
{
throw new NotImplementedException ();
using System.Runtime.Serialization;
using System.Runtime.InteropServices;
-using System.Security.Permissions;
using System.ComponentModel;
namespace System.Drawing
}
}
- [SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
public void ToLogFont (object logFont)
{
if (GDIPlus.RunningOnUnix ()) {
}
}
- [SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
public void ToLogFont (object logFont, Graphics graphics)
{
if (graphics == null)
using System.Drawing.Text;
using System.ComponentModel;
using System.Runtime.InteropServices;
-using System.Security.Permissions;
using System.Text;
namespace System.Drawing
IntPtr data,
PlayRecordCallback callbackData);
- public delegate bool DrawImageAbort (IntPtr callbackData);
+ public delegate bool DrawImageAbort (IntPtr callbackdata);
internal Graphics (IntPtr nativeGraphics)
{
}
[EditorBrowsable (EditorBrowsableState.Advanced)]
- [SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
public static Graphics FromHdcInternal (IntPtr hdc)
{
GDIPlus.Display = hdc;
}
[EditorBrowsable (EditorBrowsableState.Advanced)]
- [SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
public static Graphics FromHwndInternal (IntPtr hwnd)
{
return FromHwnd (hwnd);
}
[EditorBrowsable (EditorBrowsableState.Advanced)]
- [SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
public void ReleaseHdc (IntPtr hdc)
{
ReleaseHdcInternal (hdc);
}
- [SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
public void ReleaseHdc ()
{
ReleaseHdcInternal (deviceContextHdc);
[MonoLimitation ("Can only be used when hdc was provided by Graphics.GetHdc() method")]
[EditorBrowsable (EditorBrowsableState.Never)]
- [SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
public void ReleaseHdcInternal (IntPtr hdc)
{
Status status = Status.InvalidParameter;
using System.IO;
using System.Runtime.Serialization;
using System.Runtime.InteropServices;
-using System.Security.Permissions;
namespace System.Drawing
{
}
#if !MONOTOUCH
- [SecurityPermission (SecurityAction.LinkDemand, UnmanagedCode = true)]
public static Icon FromHandle (IntPtr handle)
{
if (handle == IntPtr.Zero)
using System.Drawing.Drawing2D;
using System.Runtime.InteropServices;
-using System.Security.Permissions;
namespace System.Drawing
{
return result;
}
- [SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
public static Region FromHrgn (IntPtr hrgn)
{
if (hrgn == IntPtr.Zero)
}
}
// why is this a instance method ? and not static ?
- [SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
public void ReleaseHrgn (IntPtr regionHandle)
{
if (regionHandle == IntPtr.Zero)
// Sanjay Gupta (gsanjay@novell.com)
// Ravindra (rkumar@novell.com)
// Peter Dennis Bartok (pbartok@novell.com)
-// Sebastien Pouliot <sebastien@ximian.com>
+// Sebastien Pouliot <sebastien@ximian.com>
//
// Copyright (C) 2004 - 2007 Novell, Inc (http://www.novell.com)
//
/// <summary>
/// GDI+ API Functions
/// </summary>
- [SuppressUnmanagedCodeSecurity]
internal static class GDIPlus {
public const int FACESIZE = 32;
public const int LANG_NEUTRAL = 0;
public static bool UseCarbonDrawable = false;
public static bool UseCocoaDrawable = false;
+ private const string GdiPlus = "gdiplus";
+
#region gdiplus.dll functions
// startup / shutdown
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdiplusStartup(ref ulong token, ref GdiplusStartupInput input, ref GdiplusStartupOutput output);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern void GdiplusShutdown(ref ulong token);
-
+
internal static ulong GdiPlusToken = 0;
static void ProcessExit (object sender, EventArgs e)
- {
+ {
// Called all pending objects and claim any pending handle before
// shutting down
- GC.Collect ();
+ GC.Collect ();
GC.WaitForPendingFinalizers ();
-#if false
+#if false
GdiPlusToken = 0;
// This causes crashes in because this call occurs before all
- // managed GDI+ objects are finalized. When they are finalized
+ // managed GDI+ objects are finalized. When they are finalized
// they call into a shutdown GDI+ and we crash.
GdiplusShutdown (ref GdiPlusToken);
{
return UseX11Drawable || UseCarbonDrawable || UseCocoaDrawable;
}
-
+
// Copies a Ptr to an array of Points and releases the memory
static public void FromUnManagedMemoryToPointI (IntPtr prt, Point [] pts)
- {
+ {
int nPointSize = Marshal.SizeOf (pts[0]);
IntPtr pos = prt;
for (int i=0; i<pts.Length; i++, pos = new IntPtr (pos.ToInt64 () + nPointSize))
pts[i] = (Point) Marshal.PtrToStructure (pos, typeof (Point));
-
- Marshal.FreeHGlobal (prt);
+
+ Marshal.FreeHGlobal (prt);
}
-
+
// Copies a Ptr to an array of Points and releases the memory
static public void FromUnManagedMemoryToPoint (IntPtr prt, PointF [] pts)
- {
+ {
int nPointSize = Marshal.SizeOf (pts[0]);
IntPtr pos = prt;
for (int i=0; i<pts.Length; i++, pos = new IntPtr (pos.ToInt64 () + nPointSize))
pts[i] = (PointF) Marshal.PtrToStructure (pos, typeof (PointF));
-
- Marshal.FreeHGlobal (prt);
+
+ Marshal.FreeHGlobal (prt);
}
-
+
// Copies an array of Points to unmanaged memory
static public IntPtr FromPointToUnManagedMemoryI (Point [] pts)
{
- int nPointSize = Marshal.SizeOf (pts[0]);
+ int nPointSize = Marshal.SizeOf (pts[0]);
IntPtr dest = Marshal.AllocHGlobal (nPointSize * pts.Length);
IntPtr pos = dest;
for (int i=0; i<pts.Length; i++, pos = new IntPtr (pos.ToInt64 () + nPointSize))
- Marshal.StructureToPtr (pts[i], pos, false);
-
- return dest;
- }
-
+ Marshal.StructureToPtr (pts[i], pos, false);
+
+ return dest;
+ }
+
// Copies a Ptr to an array of v and releases the memory
static public void FromUnManagedMemoryToRectangles (IntPtr prt, RectangleF [] pts)
- {
+ {
int nPointSize = Marshal.SizeOf (pts[0]);
IntPtr pos = prt;
for (int i = 0; i < pts.Length; i++, pos = new IntPtr (pos.ToInt64 () + nPointSize))
pts[i] = (RectangleF) Marshal.PtrToStructure (pos, typeof (RectangleF));
-
- Marshal.FreeHGlobal (prt);
+
+ Marshal.FreeHGlobal (prt);
}
-
+
// Copies an array of Points to unmanaged memory
static public IntPtr FromPointToUnManagedMemory (PointF [] pts)
{
- int nPointSize = Marshal.SizeOf (pts[0]);
- IntPtr dest = Marshal.AllocHGlobal (nPointSize * pts.Length);
+ int nPointSize = Marshal.SizeOf (pts[0]);
+ IntPtr dest = Marshal.AllocHGlobal (nPointSize * pts.Length);
IntPtr pos = dest;
for (int i=0; i<pts.Length; i++, pos = new IntPtr (pos.ToInt64 () + nPointSize))
- Marshal.StructureToPtr (pts[i], pos, false);
-
- return dest;
+ Marshal.StructureToPtr (pts[i], pos, false);
+
+ return dest;
}
// Converts a status into exception
throw new Exception (msg);
}
}
-
+
// Memory functions
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern IntPtr GdipAlloc (int size);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern void GdipFree (IntPtr ptr);
-
+
// Brush functions
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipCloneBrush (IntPtr brush, out IntPtr clonedBrush);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipDeleteBrush (IntPtr brush);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetBrushType (IntPtr brush, out BrushType type);
- // Region functions
- [DllImport("gdiplus.dll")]
+ // Region functions
+ [DllImport(GdiPlus)]
static internal extern Status GdipCreateRegion (out IntPtr region);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipCreateRegionRgnData (byte[] data, int size, out IntPtr region);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipDeleteRegion (IntPtr region);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipCloneRegion (IntPtr region, out IntPtr cloned);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipCreateRegionRect (ref RectangleF rect, out IntPtr region);
- [DllImport("gdiplus.dll")]
- static internal extern Status GdipCreateRegionRectI (ref Rectangle rect, out IntPtr region);
+ [DllImport(GdiPlus)]
+ static internal extern Status GdipCreateRegionRectI (ref Rectangle rect, out IntPtr region);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipCreateRegionPath (IntPtr path, out IntPtr region);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipTranslateRegion (IntPtr region, float dx, float dy);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipTranslateRegionI (IntPtr region, int dx, int dy);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipIsVisibleRegionPoint (IntPtr region, float x, float y,
- IntPtr graphics, out bool result);
+ IntPtr graphics, out bool result);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipIsVisibleRegionPointI (IntPtr region, int x, int y,
- IntPtr graphics, out bool result);
+ IntPtr graphics, out bool result);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipIsVisibleRegionRect (IntPtr region, float x, float y, float width,
- float height, IntPtr graphics, out bool result);
+ float height, IntPtr graphics, out bool result);
- [DllImport("gdiplus.dll")]
- static internal extern Status GdipIsVisibleRegionRectI (IntPtr region, int x, int y, int width,
- int height, IntPtr graphics, out bool result);
+ [DllImport(GdiPlus)]
+ static internal extern Status GdipIsVisibleRegionRectI (IntPtr region, int x, int y, int width,
+ int height, IntPtr graphics, out bool result);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipCombineRegionRect (IntPtr region, ref RectangleF rect,
- CombineMode combineMode);
+ CombineMode combineMode);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipCombineRegionRectI (IntPtr region, ref Rectangle rect,
- CombineMode combineMode);
+ CombineMode combineMode);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipCombineRegionPath (IntPtr region, IntPtr path, CombineMode combineMode);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetRegionBounds (IntPtr region, IntPtr graphics, ref RectangleF rect);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipSetInfinite (IntPtr region);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipSetEmpty (IntPtr region);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipIsEmptyRegion (IntPtr region, IntPtr graphics, out bool result);
-
- [DllImport("gdiplus.dll")]
+
+ [DllImport(GdiPlus)]
static internal extern Status GdipIsInfiniteRegion (IntPtr region, IntPtr graphics, out bool result);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipCombineRegionRegion (IntPtr region, IntPtr region2,
- CombineMode combineMode);
-
- [DllImport("gdiplus.dll")]
+ CombineMode combineMode);
+
+ [DllImport(GdiPlus)]
static internal extern Status GdipIsEqualRegion (IntPtr region, IntPtr region2,
- IntPtr graphics, out bool result);
-
- [DllImport("gdiplus.dll")]
+ IntPtr graphics, out bool result);
+
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetRegionDataSize (IntPtr region, out int bufferSize);
- [DllImport("gdiplus.dll")]
- static internal extern Status GdipGetRegionData (IntPtr region, byte[] buffer, int bufferSize,
- out int sizeFilled);
-
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
+ static internal extern Status GdipGetRegionData (IntPtr region, byte[] buffer, int bufferSize,
+ out int sizeFilled);
+
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetRegionScansCount (IntPtr region, out int count, IntPtr matrix);
- [DllImport("gdiplus.dll")]
- static internal extern Status GdipGetRegionScans (IntPtr region, IntPtr rects, out int count,
- IntPtr matrix);
-
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
+ static internal extern Status GdipGetRegionScans (IntPtr region, IntPtr rects, out int count,
+ IntPtr matrix);
+
+ [DllImport(GdiPlus)]
static internal extern Status GdipTransformRegion(IntPtr region, IntPtr matrix);
-
- [DllImport("gdiplus.dll")]
+
+ [DllImport(GdiPlus)]
static internal extern Status GdipFillRegion(IntPtr graphics, IntPtr brush, IntPtr region);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetRegionHRgn (IntPtr region, IntPtr graphics, ref IntPtr hRgn);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipCreateRegionHrgn (IntPtr hRgn, out IntPtr region);
// Solid brush functions
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipCreateSolidFill (int color, out IntPtr brush);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetSolidFillColor (IntPtr brush, out int color);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipSetSolidFillColor (IntPtr brush, int color);
-
+
// Hatch Brush functions
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipCreateHatchBrush (HatchStyle hatchstyle, int foreColor, int backColor, out IntPtr brush);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetHatchStyle (IntPtr brush, out HatchStyle hatchstyle);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetHatchForegroundColor (IntPtr brush, out int foreColor);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetHatchBackgroundColor (IntPtr brush, out int backColor);
// Texture brush functions
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetTextureImage (IntPtr texture, out IntPtr image);
- [DllImport("gdiplus.dll")]
- static internal extern Status GdipCreateTexture (IntPtr image, WrapMode wrapMode, out IntPtr texture);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
+ static internal extern Status GdipCreateTexture (IntPtr image, WrapMode wrapMode, out IntPtr texture);
+ [DllImport(GdiPlus)]
static internal extern Status GdipCreateTextureIAI (IntPtr image, IntPtr imageAttributes, int x, int y, int width, int height, out IntPtr texture);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipCreateTextureIA (IntPtr image, IntPtr imageAttributes, float x, float y, float width, float height, out IntPtr texture);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipCreateTexture2I (IntPtr image, WrapMode wrapMode, int x, int y, int width, int height, out IntPtr texture);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipCreateTexture2 (IntPtr image, WrapMode wrapMode, float x, float y, float width, float height, out IntPtr texture);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetTextureTransform (IntPtr texture, IntPtr matrix);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipSetTextureTransform (IntPtr texture, IntPtr matrix);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetTextureWrapMode (IntPtr texture, out WrapMode wrapMode);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipSetTextureWrapMode (IntPtr texture, WrapMode wrapMode);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipMultiplyTextureTransform (IntPtr texture, IntPtr matrix, MatrixOrder order);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipResetTextureTransform (IntPtr texture);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipRotateTextureTransform (IntPtr texture, float angle, MatrixOrder order);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipScaleTextureTransform (IntPtr texture, float sx, float sy, MatrixOrder order);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipTranslateTextureTransform (IntPtr texture, float dx, float dy, MatrixOrder order);
// PathGradientBrush functions
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipCreatePathGradientFromPath (IntPtr path, out IntPtr brush);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipCreatePathGradientI (Point [] points, int count, WrapMode wrapMode, out IntPtr brush);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipCreatePathGradient (PointF [] points, int count, WrapMode wrapMode, out IntPtr brush);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetPathGradientBlendCount (IntPtr brush, out int count);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetPathGradientBlend (IntPtr brush, float [] blend, float [] positions, int count);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipSetPathGradientBlend (IntPtr brush, float [] blend, float [] positions, int count);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetPathGradientCenterColor (IntPtr brush, out int color);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipSetPathGradientCenterColor (IntPtr brush, int color);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetPathGradientCenterPoint (IntPtr brush, out PointF point);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipSetPathGradientCenterPoint (IntPtr brush, ref PointF point);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetPathGradientFocusScales (IntPtr brush, out float xScale, out float yScale);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipSetPathGradientFocusScales (IntPtr brush, float xScale, float yScale);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetPathGradientPresetBlendCount (IntPtr brush, out int count);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetPathGradientPresetBlend (IntPtr brush, int [] blend, float [] positions, int count);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipSetPathGradientPresetBlend (IntPtr brush, int [] blend, float [] positions, int count);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetPathGradientRect (IntPtr brush, out RectangleF rect);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetPathGradientSurroundColorCount (IntPtr brush, out int count);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetPathGradientSurroundColorsWithCount (IntPtr brush, int [] color, ref int count);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipSetPathGradientSurroundColorsWithCount (IntPtr brush, int [] color, ref int count);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetPathGradientTransform (IntPtr brush, IntPtr matrix);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipSetPathGradientTransform (IntPtr brush, IntPtr matrix);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetPathGradientWrapMode (IntPtr brush, out WrapMode wrapMode);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipSetPathGradientWrapMode (IntPtr brush, WrapMode wrapMode);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipSetPathGradientLinearBlend (IntPtr brush, float focus, float scale);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipSetPathGradientSigmaBlend (IntPtr brush, float focus, float scale);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipMultiplyPathGradientTransform (IntPtr texture, IntPtr matrix, MatrixOrder order);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipResetPathGradientTransform (IntPtr brush);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipRotatePathGradientTransform (IntPtr brush, float angle, MatrixOrder order);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipScalePathGradientTransform (IntPtr brush, float sx, float sy, MatrixOrder order);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipTranslatePathGradientTransform (IntPtr brush, float dx, float dy, MatrixOrder order);
// LinearGradientBrush functions
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipCreateLineBrushI (ref Point point1, ref Point point2, int color1, int color2, WrapMode wrapMode, out IntPtr brush);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipCreateLineBrush (ref PointF point1, ref PointF point2, int color1, int color2, WrapMode wrapMode, out IntPtr brush);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipCreateLineBrushFromRectI (ref Rectangle rect, int color1, int color2, LinearGradientMode linearGradientMode, WrapMode wrapMode, out IntPtr brush);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipCreateLineBrushFromRect (ref RectangleF rect, int color1, int color2, LinearGradientMode linearGradientMode, WrapMode wrapMode, out IntPtr brush);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipCreateLineBrushFromRectWithAngleI (ref Rectangle rect, int color1, int color2, float angle, bool isAngleScaleable, WrapMode wrapMode, out IntPtr brush);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipCreateLineBrushFromRectWithAngle (ref RectangleF rect, int color1, int color2, float angle, bool isAngleScaleable, WrapMode wrapMode, out IntPtr brush);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetLineBlendCount (IntPtr brush, out int count);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipSetLineBlend (IntPtr brush, float [] blend, float [] positions, int count);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetLineBlend (IntPtr brush, float [] blend, float [] positions, int count);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipSetLineGammaCorrection (IntPtr brush, bool useGammaCorrection);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetLineGammaCorrection (IntPtr brush, out bool useGammaCorrection);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetLinePresetBlendCount (IntPtr brush, out int count);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipSetLinePresetBlend (IntPtr brush, int [] blend, float [] positions, int count);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetLinePresetBlend (IntPtr brush, int [] blend, float [] positions, int count);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipSetLineColors (IntPtr brush, int color1, int color2);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetLineColors (IntPtr brush, int [] colors);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetLineRectI (IntPtr brush, out Rectangle rect);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetLineRect (IntPtr brush, out RectangleF rect);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipSetLineTransform (IntPtr brush, IntPtr matrix);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetLineTransform (IntPtr brush, IntPtr matrix);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipSetLineWrapMode (IntPtr brush, WrapMode wrapMode);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetLineWrapMode (IntPtr brush, out WrapMode wrapMode);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipSetLineLinearBlend (IntPtr brush, float focus, float scale);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipSetLineSigmaBlend (IntPtr brush, float focus, float scale);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipMultiplyLineTransform (IntPtr brush, IntPtr matrix, MatrixOrder order);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipResetLineTransform (IntPtr brush);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipRotateLineTransform (IntPtr brush, float angle, MatrixOrder order);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipScaleLineTransform (IntPtr brush, float sx, float sy, MatrixOrder order);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipTranslateLineTransform (IntPtr brush, float dx, float dy, MatrixOrder order);
// Graphics functions
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipCreateFromHDC(IntPtr hDC, out IntPtr graphics);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipDeleteGraphics(IntPtr graphics);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipRestoreGraphics(IntPtr graphics, uint graphicsState);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipSaveGraphics(IntPtr graphics, out uint state);
- [DllImport("gdiplus.dll")]
- static internal extern Status GdipMultiplyWorldTransform (IntPtr graphics, IntPtr matrix, MatrixOrder order);
-
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
+ static internal extern Status GdipMultiplyWorldTransform (IntPtr graphics, IntPtr matrix, MatrixOrder order);
+
+ [DllImport(GdiPlus)]
static internal extern Status GdipRotateWorldTransform(IntPtr graphics, float angle, MatrixOrder order);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipTranslateWorldTransform(IntPtr graphics, float dx, float dy, MatrixOrder order);
- [DllImport("gdiplus.dll")]
- static internal extern Status GdipDrawArc (IntPtr graphics, IntPtr pen, float x, float y, float width, float height, float startAngle, float sweepAngle);
- [DllImport("gdiplus.dll")]
- static internal extern Status GdipDrawArcI (IntPtr graphics, IntPtr pen, int x, int y, int width, int height, float startAngle, float sweepAngle);
- [DllImport("gdiplus.dll")]
- static internal extern Status GdipDrawBezier (IntPtr graphics, IntPtr pen, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4);
- [DllImport("gdiplus.dll")]
- static internal extern Status GdipDrawBezierI (IntPtr graphics, IntPtr pen, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4);
- [DllImport("gdiplus.dll")]
- static internal extern Status GdipDrawEllipseI (IntPtr graphics, IntPtr pen, int x, int y, int width, int height);
- [DllImport("gdiplus.dll")]
- static internal extern Status GdipDrawEllipse (IntPtr graphics, IntPtr pen, float x, float y, float width, float height);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
+ static internal extern Status GdipDrawArc (IntPtr graphics, IntPtr pen, float x, float y, float width, float height, float startAngle, float sweepAngle);
+ [DllImport(GdiPlus)]
+ static internal extern Status GdipDrawArcI (IntPtr graphics, IntPtr pen, int x, int y, int width, int height, float startAngle, float sweepAngle);
+ [DllImport(GdiPlus)]
+ static internal extern Status GdipDrawBezier (IntPtr graphics, IntPtr pen, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4);
+ [DllImport(GdiPlus)]
+ static internal extern Status GdipDrawBezierI (IntPtr graphics, IntPtr pen, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4);
+ [DllImport(GdiPlus)]
+ static internal extern Status GdipDrawEllipseI (IntPtr graphics, IntPtr pen, int x, int y, int width, int height);
+ [DllImport(GdiPlus)]
+ static internal extern Status GdipDrawEllipse (IntPtr graphics, IntPtr pen, float x, float y, float width, float height);
+ [DllImport(GdiPlus)]
static internal extern Status GdipDrawLine (IntPtr graphics, IntPtr pen, float x1, float y1, float x2, float y2);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipDrawLineI (IntPtr graphics, IntPtr pen, int x1, int y1, int x2, int y2);
- [DllImport ("gdiplus.dll")]
- static internal extern Status GdipDrawLines (IntPtr graphics, IntPtr pen, PointF [] points, int count);
- [DllImport ("gdiplus.dll")]
- static internal extern Status GdipDrawLinesI (IntPtr graphics, IntPtr pen, Point [] points, int count);
- [DllImport ("gdiplus.dll")]
- static internal extern Status GdipDrawPath (IntPtr graphics, IntPtr pen, IntPtr path);
- [DllImport ("gdiplus.dll")]
- static internal extern Status GdipDrawPie (IntPtr graphics, IntPtr pen, float x, float y, float width, float height, float startAngle, float sweepAngle);
- [DllImport ("gdiplus.dll")]
- static internal extern Status GdipDrawPieI (IntPtr graphics, IntPtr pen, int x, int y, int width, int height, float startAngle, float sweepAngle);
- [DllImport ("gdiplus.dll")]
- static internal extern Status GdipDrawPolygon (IntPtr graphics, IntPtr pen, PointF [] points, int count);
- [DllImport ("gdiplus.dll")]
- static internal extern Status GdipDrawPolygonI (IntPtr graphics, IntPtr pen, Point [] points, int count);
- [DllImport ("gdiplus.dll")]
- static internal extern Status GdipDrawRectangle (IntPtr graphics, IntPtr pen, float x, float y, float width, float height);
- [DllImport ("gdiplus.dll")]
- static internal extern Status GdipDrawRectangleI (IntPtr graphics, IntPtr pen, int x, int y, int width, int height);
- [DllImport ("gdiplus.dll")]
- static internal extern Status GdipDrawRectangles (IntPtr graphics, IntPtr pen, RectangleF [] rects, int count);
- [DllImport ("gdiplus.dll")]
- static internal extern Status GdipDrawRectanglesI (IntPtr graphics, IntPtr pen, Rectangle [] rects, int count);
- [DllImport("gdiplus.dll")]
- static internal extern Status GdipFillEllipseI (IntPtr graphics, IntPtr pen, int x, int y, int width, int height);
- [DllImport("gdiplus.dll")]
- static internal extern Status GdipFillEllipse (IntPtr graphics, IntPtr pen, float x, float y, float width, float height);
- [DllImport ("gdiplus.dll")]
- static internal extern Status GdipFillPolygon (IntPtr graphics, IntPtr brush, PointF [] points, int count, FillMode fillMode);
- [DllImport ("gdiplus.dll")]
- static internal extern Status GdipFillPolygonI (IntPtr graphics, IntPtr brush, Point [] points, int count, FillMode fillMode);
- [DllImport ("gdiplus.dll")]
- static internal extern Status GdipFillPolygon2 (IntPtr graphics, IntPtr brush, PointF [] points, int count);
- [DllImport ("gdiplus.dll")]
- static internal extern Status GdipFillPolygon2I (IntPtr graphics, IntPtr brush, Point [] points, int count);
- [DllImport("gdiplus.dll")]
+ [DllImport (GdiPlus)]
+ static internal extern Status GdipDrawLines (IntPtr graphics, IntPtr pen, PointF [] points, int count);
+ [DllImport (GdiPlus)]
+ static internal extern Status GdipDrawLinesI (IntPtr graphics, IntPtr pen, Point [] points, int count);
+ [DllImport (GdiPlus)]
+ static internal extern Status GdipDrawPath (IntPtr graphics, IntPtr pen, IntPtr path);
+ [DllImport (GdiPlus)]
+ static internal extern Status GdipDrawPie (IntPtr graphics, IntPtr pen, float x, float y, float width, float height, float startAngle, float sweepAngle);
+ [DllImport (GdiPlus)]
+ static internal extern Status GdipDrawPieI (IntPtr graphics, IntPtr pen, int x, int y, int width, int height, float startAngle, float sweepAngle);
+ [DllImport (GdiPlus)]
+ static internal extern Status GdipDrawPolygon (IntPtr graphics, IntPtr pen, PointF [] points, int count);
+ [DllImport (GdiPlus)]
+ static internal extern Status GdipDrawPolygonI (IntPtr graphics, IntPtr pen, Point [] points, int count);
+ [DllImport (GdiPlus)]
+ static internal extern Status GdipDrawRectangle (IntPtr graphics, IntPtr pen, float x, float y, float width, float height);
+ [DllImport (GdiPlus)]
+ static internal extern Status GdipDrawRectangleI (IntPtr graphics, IntPtr pen, int x, int y, int width, int height);
+ [DllImport (GdiPlus)]
+ static internal extern Status GdipDrawRectangles (IntPtr graphics, IntPtr pen, RectangleF [] rects, int count);
+ [DllImport (GdiPlus)]
+ static internal extern Status GdipDrawRectanglesI (IntPtr graphics, IntPtr pen, Rectangle [] rects, int count);
+ [DllImport(GdiPlus)]
+ static internal extern Status GdipFillEllipseI (IntPtr graphics, IntPtr pen, int x, int y, int width, int height);
+ [DllImport(GdiPlus)]
+ static internal extern Status GdipFillEllipse (IntPtr graphics, IntPtr pen, float x, float y, float width, float height);
+ [DllImport (GdiPlus)]
+ static internal extern Status GdipFillPolygon (IntPtr graphics, IntPtr brush, PointF [] points, int count, FillMode fillMode);
+ [DllImport (GdiPlus)]
+ static internal extern Status GdipFillPolygonI (IntPtr graphics, IntPtr brush, Point [] points, int count, FillMode fillMode);
+ [DllImport (GdiPlus)]
+ static internal extern Status GdipFillPolygon2 (IntPtr graphics, IntPtr brush, PointF [] points, int count);
+ [DllImport (GdiPlus)]
+ static internal extern Status GdipFillPolygon2I (IntPtr graphics, IntPtr brush, Point [] points, int count);
+ [DllImport(GdiPlus)]
static internal extern Status GdipFillRectangle (IntPtr graphics, IntPtr brush, float x1, float y1, float x2, float y2);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipFillRectangleI (IntPtr graphics, IntPtr brush, int x1, int y1, int x2, int y2);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipFillRectangles (IntPtr graphics, IntPtr brush, RectangleF [] rects, int count);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipFillRectanglesI (IntPtr graphics, IntPtr brush, Rectangle [] rects, int count);
- [DllImport("gdiplus.dll", CharSet=CharSet.Unicode)]
+ [DllImport(GdiPlus, CharSet=CharSet.Unicode)]
static internal extern Status GdipDrawString (IntPtr graphics, string text, int len, IntPtr font, ref RectangleF rc, IntPtr format, IntPtr brush);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetDC (IntPtr graphics, out IntPtr hdc);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipReleaseDC (IntPtr graphics, IntPtr hdc);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipDrawImageRectI (IntPtr graphics, IntPtr image, int x, int y, int width, int height);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
static internal extern Status GdipGetRenderingOrigin (IntPtr graphics, out int x, out int y);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
static internal extern Status GdipSetRenderingOrigin (IntPtr graphics, int x, int y);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipCloneBitmapArea (float x, float y, float width, float height, PixelFormat format, IntPtr original, out IntPtr bitmap);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipCloneBitmapAreaI (int x, int y, int width, int height, PixelFormat format, IntPtr original, out IntPtr bitmap);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipResetWorldTransform (IntPtr graphics);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipSetWorldTransform (IntPtr graphics, IntPtr matrix);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetWorldTransform (IntPtr graphics, IntPtr matrix);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipScaleWorldTransform (IntPtr graphics, float sx, float sy, MatrixOrder order);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipGraphicsClear(IntPtr graphics, int argb);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipScaleWorldTransform (IntPtr graphics, float sx, float sy, MatrixOrder order);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipGraphicsClear(IntPtr graphics, int argb);
+ [DllImport(GdiPlus)]
internal static extern Status GdipDrawClosedCurve(IntPtr graphics, IntPtr pen, PointF [] points, int count);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipDrawClosedCurveI(IntPtr graphics, IntPtr pen, Point [] points, int count);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipDrawClosedCurveI(IntPtr graphics, IntPtr pen, Point [] points, int count);
+ [DllImport(GdiPlus)]
internal static extern Status GdipDrawClosedCurve2(IntPtr graphics, IntPtr pen, PointF [] points, int count, float tension);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipDrawClosedCurve2I(IntPtr graphics, IntPtr pen, Point [] points, int count, float tension);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipDrawClosedCurve2I(IntPtr graphics, IntPtr pen, Point [] points, int count, float tension);
+ [DllImport(GdiPlus)]
internal static extern Status GdipDrawCurve(IntPtr graphics, IntPtr pen, PointF [] points, int count);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipDrawCurveI(IntPtr graphics, IntPtr pen, Point [] points, int count);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipDrawCurve2(IntPtr graphics, IntPtr pen, PointF [] points, int count, float tension);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipDrawCurve2I(IntPtr graphics, IntPtr pen, Point [] points, int count, float tension);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipDrawCurve3(IntPtr graphics, IntPtr pen, PointF [] points, int count, int offset, int numberOfSegments, float tension);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipDrawCurve3I(IntPtr graphics, IntPtr pen, Point [] points, int count, int offset, int numberOfSegments, float tension);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipDrawCurve3I(IntPtr graphics, IntPtr pen, Point [] points, int count, int offset, int numberOfSegments, float tension);
+ [DllImport(GdiPlus)]
internal static extern Status GdipSetClipRect(IntPtr graphics, float x, float y, float width, float height, CombineMode combineMode);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipSetClipRectI(IntPtr graphics, int x, int y, int width, int height, CombineMode combineMode);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipSetClipPath(IntPtr graphics, IntPtr path, CombineMode combineMode);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipSetClipRegion(IntPtr graphics, IntPtr region, CombineMode combineMode);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipSetClipGraphics(IntPtr graphics, IntPtr srcgraphics, CombineMode combineMode);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipResetClip(IntPtr graphics);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipSetClipGraphics(IntPtr graphics, IntPtr srcgraphics, CombineMode combineMode);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipResetClip(IntPtr graphics);
+ [DllImport(GdiPlus)]
internal static extern Status GdipEndContainer(IntPtr graphics, uint state);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetClip (IntPtr graphics, IntPtr region);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipFillClosedCurve(IntPtr graphics, IntPtr brush, PointF [] points, int count);
-
- [DllImport("gdiplus.dll")]
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipFillClosedCurveI(IntPtr graphics, IntPtr brush, Point [] points, int count);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipFillClosedCurve2(IntPtr graphics, IntPtr brush,
- PointF [] points, int count, float tension, FillMode fillMode);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipFillClosedCurve2(IntPtr graphics, IntPtr brush,
+ PointF [] points, int count, float tension, FillMode fillMode);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipFillClosedCurve2I(IntPtr graphics, IntPtr brush,
- Point [] points, int count, float tension, FillMode fillMode);
-
- [DllImport("gdiplus.dll")]
+ Point [] points, int count, float tension, FillMode fillMode);
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipFillPie(IntPtr graphics, IntPtr brush, float x, float y,
- float width, float height, float startAngle, float sweepAngle);
+ float width, float height, float startAngle, float sweepAngle);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipFillPieI(IntPtr graphics, IntPtr brush, int x, int y,
- int width, int height, float startAngle, float sweepAngle);
-
- [DllImport("gdiplus.dll")]
+ int width, int height, float startAngle, float sweepAngle);
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipFillPath(IntPtr graphics, IntPtr brush, IntPtr path);
-
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipGetNearestColor(IntPtr graphics, out int argb);
-
- [DllImport("gdiplus.dll")]
+
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipGetNearestColor(IntPtr graphics, out int argb);
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipIsVisiblePoint(IntPtr graphics, float x, float y, out bool result);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipIsVisiblePointI(IntPtr graphics, int x, int y, out bool result);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipIsVisibleRect(IntPtr graphics, float x, float y,
- float width, float height, out bool result);
+ float width, float height, out bool result);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipIsVisibleRectI(IntPtr graphics, int x, int y,
- int width, int height, out bool result);
-
- [DllImport("gdiplus.dll")]
+ int width, int height, out bool result);
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipTransformPoints(IntPtr graphics, CoordinateSpace destSpace,
- CoordinateSpace srcSpace, IntPtr points, int count);
+ CoordinateSpace srcSpace, IntPtr points, int count);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipTransformPointsI(IntPtr graphics, CoordinateSpace destSpace,
- CoordinateSpace srcSpace, IntPtr points, int count);
-
- [DllImport("gdiplus.dll")]
+ CoordinateSpace srcSpace, IntPtr points, int count);
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipTranslateClip(IntPtr graphics, float dx, float dy);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipTranslateClipI(IntPtr graphics, int dx, int dy);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipGetClipBounds(IntPtr graphics, out RectangleF rect);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipTranslateClipI(IntPtr graphics, int dx, int dy);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipGetClipBounds(IntPtr graphics, out RectangleF rect);
+ [DllImport(GdiPlus)]
internal static extern Status GdipSetCompositingMode(IntPtr graphics, CompositingMode compositingMode);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipGetCompositingMode(IntPtr graphics, out CompositingMode compositingMode);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipGetCompositingMode(IntPtr graphics, out CompositingMode compositingMode);
+ [DllImport(GdiPlus)]
internal static extern Status GdipSetCompositingQuality(IntPtr graphics, CompositingQuality compositingQuality);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetCompositingQuality(IntPtr graphics, out CompositingQuality compositingQuality);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipSetInterpolationMode(IntPtr graphics, InterpolationMode interpolationMode);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipGetInterpolationMode(IntPtr graphics, out InterpolationMode interpolationMode);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipGetInterpolationMode(IntPtr graphics, out InterpolationMode interpolationMode);
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetDpiX(IntPtr graphics, out float dpi);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetDpiY(IntPtr graphics, out float dpi);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipIsClipEmpty(IntPtr graphics, out bool result);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipIsVisibleClipEmpty(IntPtr graphics, out bool result);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipGetPageUnit(IntPtr graphics, out GraphicsUnit unit);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipGetPageScale(IntPtr graphics, out float scale);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipIsVisibleClipEmpty(IntPtr graphics, out bool result);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipGetPageUnit(IntPtr graphics, out GraphicsUnit unit);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipGetPageScale(IntPtr graphics, out float scale);
+ [DllImport(GdiPlus)]
internal static extern Status GdipSetPageUnit(IntPtr graphics, GraphicsUnit unit);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipSetPageScale(IntPtr graphics, float scale);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipSetPixelOffsetMode(IntPtr graphics, PixelOffsetMode pixelOffsetMode);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetPixelOffsetMode(IntPtr graphics, out PixelOffsetMode pixelOffsetMode);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipSetSmoothingMode(IntPtr graphics, SmoothingMode smoothingMode);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetSmoothingMode(IntPtr graphics, out SmoothingMode smoothingMode);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipSetTextContrast(IntPtr graphics, int contrast);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetTextContrast(IntPtr graphics, out int contrast);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipSetTextRenderingHint(IntPtr graphics, TextRenderingHint mode);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetTextRenderingHint(IntPtr graphics, out TextRenderingHint mode);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetVisibleClipBounds(IntPtr graphics, out RectangleF rect);
-
- [DllImport("gdiplus.dll")]
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipFlush(IntPtr graphics, FlushIntention intention);
- [DllImport("gdiplus.dll", CharSet=CharSet.Unicode)]
+ [DllImport(GdiPlus, CharSet=CharSet.Unicode)]
internal static extern Status GdipAddPathString (IntPtr path, string s, int lenght, IntPtr family, int style, float emSize, ref RectangleF layoutRect, IntPtr format);
- [DllImport("gdiplus.dll", CharSet=CharSet.Unicode)]
+ [DllImport(GdiPlus, CharSet=CharSet.Unicode)]
internal static extern Status GdipAddPathStringI (IntPtr path, string s, int lenght, IntPtr family, int style, float emSize, ref Rectangle layoutRect, IntPtr format);
-
+
// Pen functions
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipCreatePen1 (int argb, float width, GraphicsUnit unit, out IntPtr pen);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipCreatePen2 (IntPtr brush, float width, GraphicsUnit unit, out IntPtr pen);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipClonePen (IntPtr pen, out IntPtr clonepen);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipClonePen (IntPtr pen, out IntPtr clonepen);
+ [DllImport(GdiPlus)]
internal static extern Status GdipDeletePen(IntPtr pen);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipSetPenBrushFill (IntPtr pen, IntPtr brush);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipGetPenBrushFill (IntPtr pen, out IntPtr brush);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipGetPenFillType (IntPtr pen, out PenType type);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipSetPenColor (IntPtr pen, int color);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipGetPenColor (IntPtr pen, out int color);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipSetPenCompoundArray (IntPtr pen, float[] dash, int count);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipGetPenCompoundArray (IntPtr pen, float[] dash, int count);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipGetPenCompoundCount (IntPtr pen, out int count);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipSetPenDashCap197819 (IntPtr pen, DashCap dashCap);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipGetPenDashCap197819 (IntPtr pen, out DashCap dashCap);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipSetPenDashStyle (IntPtr pen, DashStyle dashStyle);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipGetPenDashStyle (IntPtr pen, out DashStyle dashStyle);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipSetPenDashOffset (IntPtr pen, float offset);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipGetPenDashOffset (IntPtr pen, out float offset);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipGetPenDashCount (IntPtr pen, out int count);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipSetPenDashArray (IntPtr pen, float[] dash, int count);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipGetPenDashArray (IntPtr pen, float[] dash, int count);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipSetPenMiterLimit (IntPtr pen, float miterLimit);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipGetPenMiterLimit (IntPtr pen, out float miterLimit);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipSetPenLineJoin (IntPtr pen, LineJoin lineJoin);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipGetPenLineJoin (IntPtr pen, out LineJoin lineJoin);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipSetPenBrushFill (IntPtr pen, IntPtr brush);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipGetPenBrushFill (IntPtr pen, out IntPtr brush);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipGetPenFillType (IntPtr pen, out PenType type);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipSetPenColor (IntPtr pen, int color);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipGetPenColor (IntPtr pen, out int color);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipSetPenCompoundArray (IntPtr pen, float[] dash, int count);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipGetPenCompoundArray (IntPtr pen, float[] dash, int count);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipGetPenCompoundCount (IntPtr pen, out int count);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipSetPenDashCap197819 (IntPtr pen, DashCap dashCap);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipGetPenDashCap197819 (IntPtr pen, out DashCap dashCap);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipSetPenDashStyle (IntPtr pen, DashStyle dashStyle);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipGetPenDashStyle (IntPtr pen, out DashStyle dashStyle);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipSetPenDashOffset (IntPtr pen, float offset);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipGetPenDashOffset (IntPtr pen, out float offset);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipGetPenDashCount (IntPtr pen, out int count);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipSetPenDashArray (IntPtr pen, float[] dash, int count);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipGetPenDashArray (IntPtr pen, float[] dash, int count);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipSetPenMiterLimit (IntPtr pen, float miterLimit);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipGetPenMiterLimit (IntPtr pen, out float miterLimit);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipSetPenLineJoin (IntPtr pen, LineJoin lineJoin);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipGetPenLineJoin (IntPtr pen, out LineJoin lineJoin);
+ [DllImport(GdiPlus)]
internal static extern Status GdipSetPenLineCap197819 (IntPtr pen, LineCap startCap, LineCap endCap, DashCap dashCap);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipSetPenMode (IntPtr pen, PenAlignment alignment);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipGetPenMode (IntPtr pen, out PenAlignment alignment);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipSetPenMode (IntPtr pen, PenAlignment alignment);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipGetPenMode (IntPtr pen, out PenAlignment alignment);
+ [DllImport(GdiPlus)]
internal static extern Status GdipSetPenStartCap (IntPtr pen, LineCap startCap);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetPenStartCap (IntPtr pen, out LineCap startCap);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipSetPenEndCap (IntPtr pen, LineCap endCap);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetPenEndCap (IntPtr pen, out LineCap endCap);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipSetPenCustomStartCap (IntPtr pen, IntPtr customCap);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipGetPenCustomStartCap (IntPtr pen, out IntPtr customCap);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipSetPenCustomEndCap (IntPtr pen, IntPtr customCap);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipGetPenCustomEndCap (IntPtr pen, out IntPtr customCap);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipSetPenTransform (IntPtr pen, IntPtr matrix);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipGetPenTransform (IntPtr pen, IntPtr matrix);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipSetPenWidth (IntPtr pen, float width);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipGetPenWidth (IntPtr pen, out float width);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipResetPenTransform (IntPtr pen);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipMultiplyPenTransform (IntPtr pen, IntPtr matrix, MatrixOrder order);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipRotatePenTransform (IntPtr pen, float angle, MatrixOrder order);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipScalePenTransform (IntPtr pen, float sx, float sy, MatrixOrder order);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipTranslatePenTransform (IntPtr pen, float dx, float dy, MatrixOrder order);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipSetPenCustomStartCap (IntPtr pen, IntPtr customCap);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipGetPenCustomStartCap (IntPtr pen, out IntPtr customCap);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipSetPenCustomEndCap (IntPtr pen, IntPtr customCap);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipGetPenCustomEndCap (IntPtr pen, out IntPtr customCap);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipSetPenTransform (IntPtr pen, IntPtr matrix);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipGetPenTransform (IntPtr pen, IntPtr matrix);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipSetPenWidth (IntPtr pen, float width);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipGetPenWidth (IntPtr pen, out float width);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipResetPenTransform (IntPtr pen);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipMultiplyPenTransform (IntPtr pen, IntPtr matrix, MatrixOrder order);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipRotatePenTransform (IntPtr pen, float angle, MatrixOrder order);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipScalePenTransform (IntPtr pen, float sx, float sy, MatrixOrder order);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipTranslatePenTransform (IntPtr pen, float dx, float dy, MatrixOrder order);
// CustomLineCap functions
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipCreateCustomLineCap (IntPtr fillPath, IntPtr strokePath, LineCap baseCap, float baseInset, out IntPtr customCap);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipDeleteCustomLineCap (IntPtr customCap);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipCloneCustomLineCap (IntPtr customCap, out IntPtr clonedCap);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipSetCustomLineCapStrokeCaps (IntPtr customCap, LineCap startCap, LineCap endCap);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetCustomLineCapStrokeCaps (IntPtr customCap, out LineCap startCap, out LineCap endCap);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipSetCustomLineCapStrokeJoin (IntPtr customCap, LineJoin lineJoin);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetCustomLineCapStrokeJoin (IntPtr customCap, out LineJoin lineJoin);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipSetCustomLineCapBaseCap (IntPtr customCap, LineCap baseCap);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetCustomLineCapBaseCap (IntPtr customCap, out LineCap baseCap);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipSetCustomLineCapBaseInset (IntPtr customCap, float inset);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetCustomLineCapBaseInset (IntPtr customCap, out float inset);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipSetCustomLineCapWidthScale (IntPtr customCap, float widthScale);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetCustomLineCapWidthScale (IntPtr customCap, out float widthScale);
// AdjustableArrowCap functions
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipCreateAdjustableArrowCap (float height, float width, bool isFilled, out IntPtr arrowCap);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipSetAdjustableArrowCapHeight (IntPtr arrowCap, float height);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetAdjustableArrowCapHeight (IntPtr arrowCap, out float height);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipSetAdjustableArrowCapWidth (IntPtr arrowCap, float width);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetAdjustableArrowCapWidth (IntPtr arrowCap, out float width);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipSetAdjustableArrowCapMiddleInset (IntPtr arrowCap, float middleInset);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetAdjustableArrowCapMiddleInset (IntPtr arrowCap, out float middleInset);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipSetAdjustableArrowCapFillState (IntPtr arrowCap, bool isFilled);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetAdjustableArrowCapFillState (IntPtr arrowCap, out bool isFilled);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipCreateFromHWND (IntPtr hwnd, out IntPtr graphics);
- [DllImport("gdiplus.dll", CharSet=CharSet.Unicode)]
+ [DllImport(GdiPlus, CharSet=CharSet.Unicode)]
internal unsafe static extern Status GdipMeasureString(IntPtr graphics, string str, int length,
IntPtr font, ref RectangleF layoutRect, IntPtr stringFormat, out RectangleF boundingBox,
int *codepointsFitted, int *linesFilled);
-
- [DllImport("gdiplus.dll", CharSet=CharSet.Unicode)]
+
+ [DllImport(GdiPlus, CharSet=CharSet.Unicode)]
internal static extern Status GdipMeasureCharacterRanges (IntPtr graphics, string str, int length, IntPtr font,
- ref RectangleF layoutRect, IntPtr stringFormat, int regcount, out IntPtr regions);
+ ref RectangleF layoutRect, IntPtr stringFormat, int regcount, out IntPtr regions);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipSetStringFormatMeasurableCharacterRanges (IntPtr native,
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipSetStringFormatMeasurableCharacterRanges (IntPtr native,
int cnt, CharacterRange [] range);
-
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipGetStringFormatMeasurableCharacterRangeCount (IntPtr native,
- out int cnt);
-
+
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipGetStringFormatMeasurableCharacterRangeCount (IntPtr native,
+ out int cnt);
+
// Bitmap functions
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipCreateBitmapFromScan0 (int width, int height, int stride, PixelFormat format, IntPtr scan0, out IntPtr bmp);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipCreateBitmapFromGraphics (int width, int height, IntPtr target, out IntPtr bitmap);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipBitmapLockBits (IntPtr bmp, ref Rectangle rc, ImageLockMode flags, PixelFormat format, [In, Out] BitmapData bmpData);
-
- [DllImport("gdiplus.dll")]
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipBitmapSetResolution(IntPtr bmp, float xdpi, float ydpi);
-
- [DllImport("gdiplus.dll")]
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipBitmapUnlockBits (IntPtr bmp, [In,Out] BitmapData bmpData);
-
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipBitmapGetPixel (IntPtr bmp, int x, int y, out int argb);
-
- [DllImport("gdiplus.dll")]
+
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipBitmapGetPixel (IntPtr bmp, int x, int y, out int argb);
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipBitmapSetPixel (IntPtr bmp, int x, int y, int argb);
// Image functions
- [DllImport("gdiplus.dll", CharSet=CharSet.Auto)]
+ [DllImport(GdiPlus, CharSet=CharSet.Auto)]
internal static extern Status GdipLoadImageFromFile ( [MarshalAs(UnmanagedType.LPWStr)] string filename, out IntPtr image );
#if !TEST
// Stream functions for Win32 (original Win32 ones)
- [DllImport("gdiplus.dll", ExactSpelling=true, CharSet=CharSet.Unicode)]
+ [DllImport(GdiPlus, ExactSpelling=true, CharSet=CharSet.Unicode)]
internal static extern Status GdipLoadImageFromStream([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(ComIStreamMarshaler))] IStream stream, out IntPtr image);
-
- [DllImport("gdiplus.dll", ExactSpelling=true, CharSet=CharSet.Unicode)]
+
+ [DllImport(GdiPlus, ExactSpelling=true, CharSet=CharSet.Unicode)]
internal static extern Status GdipSaveImageToStream(HandleRef image, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(ComIStreamMarshaler))] IStream stream, [In()] ref Guid clsidEncoder, HandleRef encoderParams);
-#endif
-
- [DllImport("gdiplus.dll")]
+#endif
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipCloneImage(IntPtr image, out IntPtr imageclone);
-
- [DllImport("gdiplus.dll", CharSet=CharSet.Auto)]
+
+ [DllImport(GdiPlus, CharSet=CharSet.Auto)]
internal static extern Status GdipLoadImageFromFileICM ( [MarshalAs(UnmanagedType.LPWStr)] string filename, out IntPtr image );
-
- [DllImport("gdiplus.dll")]
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipCreateBitmapFromHBITMAP ( IntPtr hBitMap, IntPtr gdiPalette, out IntPtr image );
-
- [DllImport("gdiplus.dll")]
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipDisposeImage ( IntPtr image );
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetImageFlags(IntPtr image, out int flag);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipGetImageType (IntPtr image, out ImageType type);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipImageGetFrameDimensionsCount ( IntPtr image, out uint count );
-
- [DllImport("gdiplus.dll")]
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipImageGetFrameDimensionsList ( IntPtr image, [Out] Guid [] dimensionIDs, uint count );
-
- [DllImport("gdiplus.dll")]
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetImageHeight (IntPtr image, out uint height);
-
- [DllImport("gdiplus.dll")]
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetImageHorizontalResolution ( IntPtr image, out float resolution );
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetImagePaletteSize ( IntPtr image, out int size );
-
- [DllImport("gdiplus.dll")]
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetImagePalette (IntPtr image, IntPtr palette, int size);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipSetImagePalette (IntPtr image, IntPtr palette);
-
- [DllImport("gdiplus.dll")]
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetImageDimension ( IntPtr image, out float width, out float height );
-
- [DllImport("gdiplus.dll")]
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetImagePixelFormat ( IntPtr image, out PixelFormat format );
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetPropertyCount (IntPtr image, out uint propNumbers);
-
- [DllImport("gdiplus.dll")]
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetPropertyIdList (IntPtr image, uint propNumbers, [Out] int [] list);
-
- [DllImport("gdiplus.dll")]
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetPropertySize (IntPtr image, out int bufferSize, out int propNumbers);
-
- [DllImport("gdiplus.dll")]
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetAllPropertyItems (IntPtr image, int bufferSize, int propNumbers, IntPtr items);
-
- [DllImport("gdiplus.dll")]
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetImageRawFormat ( IntPtr image, out Guid format );
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetImageVerticalResolution ( IntPtr image, out float resolution );
-
- [DllImport("gdiplus.dll")]
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetImageWidth (IntPtr image, out uint width);
-
- [DllImport("gdiplus.dll")]
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetImageBounds ( IntPtr image, out RectangleF source, ref GraphicsUnit unit );
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetEncoderParameterListSize ( IntPtr image, ref Guid encoder, out uint size );
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetEncoderParameterList ( IntPtr image, ref Guid encoder, uint size, IntPtr buffer );
-
- [DllImport("gdiplus.dll")]
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipImageGetFrameCount (IntPtr image, ref Guid guidDimension, out uint count );
-
- [DllImport("gdiplus.dll")]
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipImageSelectActiveFrame (IntPtr image, ref Guid guidDimension, int frameIndex);
-
- [DllImport("gdiplus.dll")]
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetPropertyItemSize (IntPtr image, int propertyID, out int propertySize);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetPropertyItem (IntPtr image, int propertyID, int propertySize, IntPtr buffer);
-
- [DllImport("gdiplus.dll")]
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipRemovePropertyItem (IntPtr image, int propertyId);
-
- [DllImport("gdiplus.dll")]
+
+ [DllImport(GdiPlus)]
internal unsafe static extern Status GdipSetPropertyItem (IntPtr image, GdipPropertyItem *propertyItem);
-
- [DllImport("gdiplus.dll")]
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipGetImageThumbnail ( IntPtr image, uint width, uint height, out IntPtr thumbImage, IntPtr callback, IntPtr callBackData );
-
- [DllImport("gdiplus.dll")]
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipImageRotateFlip ( IntPtr image, RotateFlipType rotateFlipType );
-
- [DllImport("gdiplus.dll", CharSet=CharSet.Unicode)]
- internal static extern Status GdipSaveImageToFile (IntPtr image, string filename, ref Guid encoderClsID, IntPtr encoderParameters);
-
- [DllImport("gdiplus.dll")]
+
+ [DllImport(GdiPlus, CharSet=CharSet.Unicode)]
+ internal static extern Status GdipSaveImageToFile (IntPtr image, string filename, ref Guid encoderClsID, IntPtr encoderParameters);
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipSaveAdd ( IntPtr image, IntPtr encoderParameters );
-
- [DllImport("gdiplus.dll")]
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipSaveAddImage (IntPtr image, IntPtr imagenew, IntPtr encoderParameters);
-
- [DllImport("gdiplus.dll")]
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipDrawImageI (IntPtr graphics, IntPtr image, int x, int y);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipGetImageGraphicsContext (IntPtr image, out IntPtr graphics);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipGetImageGraphicsContext (IntPtr image, out IntPtr graphics);
+ [DllImport(GdiPlus)]
internal static extern Status GdipDrawImage (IntPtr graphics, IntPtr image, float x, float y);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipBeginContainer (IntPtr graphics, ref RectangleF dstrect, ref RectangleF srcrect, GraphicsUnit unit, out uint state);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipBeginContainerI (IntPtr graphics, ref Rectangle dstrect, ref Rectangle srcrect, GraphicsUnit unit, out uint state);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipBeginContainer2 (IntPtr graphics, out uint state);
-
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipBeginContainer2 (IntPtr graphics, out uint state);
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipDrawImagePoints (IntPtr graphics, IntPtr image, PointF [] destPoints, int count);
-
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipDrawImagePointsI (IntPtr graphics, IntPtr image, Point [] destPoints, int count);
-
- [DllImport("gdiplus.dll")]
+
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipDrawImagePointsI (IntPtr graphics, IntPtr image, Point [] destPoints, int count);
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipDrawImageRectRectI (IntPtr graphics, IntPtr image,
- int dstx, int dsty, int dstwidth, int dstheight,
- int srcx, int srcy, int srcwidth, int srcheight,
- GraphicsUnit srcUnit, IntPtr imageattr, Graphics.DrawImageAbort callback, IntPtr callbackData);
+ int dstx, int dsty, int dstwidth, int dstheight,
+ int srcx, int srcy, int srcwidth, int srcheight,
+ GraphicsUnit srcUnit, IntPtr imageattr, Graphics.DrawImageAbort callback, IntPtr callbackData);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipDrawImageRectRect (IntPtr graphics, IntPtr image,
- float dstx, float dsty, float dstwidth, float dstheight,
- float srcx, float srcy, float srcwidth, float srcheight,
- GraphicsUnit srcUnit, IntPtr imageattr, Graphics.DrawImageAbort callback, IntPtr callbackData);
-
- [DllImport("gdiplus.dll")]
+ float dstx, float dsty, float dstwidth, float dstheight,
+ float srcx, float srcy, float srcwidth, float srcheight,
+ GraphicsUnit srcUnit, IntPtr imageattr, Graphics.DrawImageAbort callback, IntPtr callbackData);
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipDrawImagePointsRectI (IntPtr graphics, IntPtr image,
- Point [] destPoints, int count, int srcx, int srcy, int srcwidth, int srcheight,
- GraphicsUnit srcUnit, IntPtr imageattr, Graphics.DrawImageAbort callback, IntPtr callbackData);
-
- [DllImport("gdiplus.dll")]
+ Point [] destPoints, int count, int srcx, int srcy, int srcwidth, int srcheight,
+ GraphicsUnit srcUnit, IntPtr imageattr, Graphics.DrawImageAbort callback, IntPtr callbackData);
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipDrawImagePointsRect (IntPtr graphics, IntPtr image,
- PointF [] destPoints, int count, float srcx, float srcy, float srcwidth, float srcheight,
- GraphicsUnit srcUnit, IntPtr imageattr, Graphics.DrawImageAbort callback, IntPtr callbackData);
-
- [DllImport("gdiplus.dll")]
+ PointF [] destPoints, int count, float srcx, float srcy, float srcwidth, float srcheight,
+ GraphicsUnit srcUnit, IntPtr imageattr, Graphics.DrawImageAbort callback, IntPtr callbackData);
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipDrawImageRect(IntPtr graphics, IntPtr image, float x, float y, float width, float height);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipDrawImagePointRect(IntPtr graphics, IntPtr image, float x,
- float y, float srcx, float srcy, float srcwidth, float srcheight, GraphicsUnit srcUnit);
-
- [DllImport("gdiplus.dll")]
+ float y, float srcx, float srcy, float srcwidth, float srcheight, GraphicsUnit srcUnit);
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipDrawImagePointRectI(IntPtr graphics, IntPtr image, int x,
- int y, int srcx, int srcy, int srcwidth,
- int srcheight, GraphicsUnit srcUnit);
-
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipCreateStringFormat(StringFormatFlags formatAttributes, int language, out IntPtr native);
-
- [DllImport("gdiplus.dll")]
+ int y, int srcx, int srcy, int srcwidth,
+ int srcheight, GraphicsUnit srcUnit);
+
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipCreateStringFormat(StringFormatFlags formatAttributes, int language, out IntPtr native);
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipCreateHBITMAPFromBitmap (IntPtr bmp, out IntPtr HandleBmp, int clrbackground);
- [DllImport("gdiplus.dll", CharSet=CharSet.Auto)]
+ [DllImport(GdiPlus, CharSet=CharSet.Auto)]
internal static extern Status GdipCreateBitmapFromFile ([MarshalAs (UnmanagedType.LPWStr)] string filename, out IntPtr bitmap);
- [DllImport("gdiplus.dll", CharSet=CharSet.Auto)]
+ [DllImport(GdiPlus, CharSet=CharSet.Auto)]
internal static extern Status GdipCreateBitmapFromFileICM ([MarshalAs (UnmanagedType.LPWStr)] string filename, out IntPtr bitmap);
-
- [DllImport("gdiplus.dll")]
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipCreateHICONFromBitmap (IntPtr bmp, out IntPtr HandleIcon);
-
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipCreateBitmapFromHICON (IntPtr hicon, out IntPtr bitmap);
-
- [DllImport("gdiplus.dll")]
+
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipCreateBitmapFromHICON (IntPtr hicon, out IntPtr bitmap);
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipCreateBitmapFromResource (IntPtr hInstance,
- string lpBitmapName, out IntPtr bitmap);
-
- // Matrix functions
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipCreateMatrix (out IntPtr matrix);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipCreateMatrix2 (float m11, float m12, float m21, float m22, float dx, float dy, out IntPtr matrix);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipCreateMatrix3 (ref RectangleF rect, PointF [] dstplg, out IntPtr matrix);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipCreateMatrix3I (ref Rectangle rect, Point [] dstplg, out IntPtr matrix);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipDeleteMatrix (IntPtr matrix);
-
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipCloneMatrix (IntPtr matrix, out IntPtr cloneMatrix);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipSetMatrixElements (IntPtr matrix, float m11, float m12, float m21, float m22, float dx, float dy);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipGetMatrixElements (IntPtr matrix, IntPtr matrixOut);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipMultiplyMatrix (IntPtr matrix, IntPtr matrix2, MatrixOrder order);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipTranslateMatrix (IntPtr matrix, float offsetX, float offsetY, MatrixOrder order);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipScaleMatrix (IntPtr matrix, float scaleX, float scaleY, MatrixOrder order);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipRotateMatrix (IntPtr matrix, float angle, MatrixOrder order);
-
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipShearMatrix (IntPtr matrix, float shearX, float shearY, MatrixOrder order);
-
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipInvertMatrix (IntPtr matrix);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipTransformMatrixPoints (IntPtr matrix, PointF [] pts, int count);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipTransformMatrixPointsI (IntPtr matrix, Point [] pts, int count);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipVectorTransformMatrixPoints (IntPtr matrix, PointF [] pts, int count);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipVectorTransformMatrixPointsI (IntPtr matrix, Point [] pts, int count);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipIsMatrixInvertible (IntPtr matrix, out bool result);
-
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipIsMatrixIdentity (IntPtr matrix, out bool result);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipIsMatrixEqual (IntPtr matrix, IntPtr matrix2, out bool result);
-
- // GraphicsPath functions
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipCreatePath (FillMode brushMode, out IntPtr path);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipCreatePath2 (PointF [] points, byte [] types, int count, FillMode brushMode, out IntPtr path);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipCreatePath2I (Point [] points, byte [] types, int count, FillMode brushMode, out IntPtr path);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipClonePath (IntPtr path, out IntPtr clonePath);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipDeletePath (IntPtr path);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipResetPath (IntPtr path);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipGetPointCount (IntPtr path, out int count);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipGetPathTypes (IntPtr path, [Out] byte [] types, int count);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipGetPathPoints (IntPtr path, [Out] PointF [] points, int count);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipGetPathPointsI (IntPtr path, [Out] Point [] points, int count);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipGetPathFillMode (IntPtr path, out FillMode fillMode);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipSetPathFillMode (IntPtr path, FillMode fillMode);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipStartPathFigure (IntPtr path);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipClosePathFigure (IntPtr path);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipClosePathFigures (IntPtr path);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipSetPathMarker (IntPtr path);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipClearPathMarkers (IntPtr path);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipReversePath (IntPtr path);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipGetPathLastPoint (IntPtr path, out PointF lastPoint);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipAddPathLine (IntPtr path, float x1, float y1, float x2, float y2);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipAddPathLine2 (IntPtr path, PointF[] points, int count);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipAddPathLine2I (IntPtr path, Point[] points, int count);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipAddPathArc (IntPtr path, float x, float y, float width, float height, float startAngle, float sweepAngle);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipAddPathBezier (IntPtr path, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipAddPathBeziers (IntPtr path, PointF [] points, int count);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipAddPathCurve (IntPtr path, PointF [] points, int count);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipAddPathCurveI (IntPtr path, Point [] points, int count);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipAddPathCurve2 (IntPtr path, PointF [] points, int count, float tension);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipAddPathCurve2I (IntPtr path, Point [] points, int count, float tension);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipAddPathCurve3 (IntPtr path, PointF [] points, int count, int offset, int numberOfSegments, float tension);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipAddPathCurve3I (IntPtr path, Point [] points, int count, int offset, int numberOfSegments, float tension);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipAddPathClosedCurve (IntPtr path, PointF [] points, int count);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipAddPathClosedCurveI (IntPtr path, Point [] points, int count);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipAddPathClosedCurve2 (IntPtr path, PointF [] points, int count, float tension);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipAddPathClosedCurve2I (IntPtr path, Point [] points, int count, float tension);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipAddPathRectangle (IntPtr path, float x, float y, float width, float height);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipAddPathRectangles (IntPtr path, RectangleF [] rects, int count);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipAddPathEllipse (IntPtr path, float x, float y, float width, float height);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipAddPathEllipseI (IntPtr path, int x, int y, int width, int height);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipAddPathPie (IntPtr path, float x, float y, float width, float height, float startAngle, float sweepAngle);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipAddPathPieI (IntPtr path, int x, int y, int width, int height, float startAngle, float sweepAngle);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipAddPathPolygon (IntPtr path, PointF [] points, int count);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipAddPathPath (IntPtr path, IntPtr addingPath, bool connect);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipAddPathLineI (IntPtr path, int x1, int y1, int x2, int y2);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipAddPathArcI (IntPtr path, int x, int y, int width, int height, float startAngle, float sweepAngle);
-
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipAddPathBezierI (IntPtr path, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipAddPathBeziersI (IntPtr path, Point [] points, int count);
-
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipAddPathPolygonI (IntPtr path, Point [] points, int count);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipAddPathRectangleI (IntPtr path, int x, int y, int width, int height);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipAddPathRectanglesI (IntPtr path, Rectangle [] rects, int count);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipFlattenPath (IntPtr path, IntPtr matrix, float floatness);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipTransformPath (IntPtr path, IntPtr matrix);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipWarpPath (IntPtr path, IntPtr matrix,
- PointF [] points, int count,
- float srcx, float srcy, float srcwidth, float srcheight,
- WarpMode mode, float flatness);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipWidenPath (IntPtr path, IntPtr pen, IntPtr matrix, float flatness);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipGetPathWorldBounds (IntPtr path, out RectangleF bounds, IntPtr matrix, IntPtr pen);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipGetPathWorldBoundsI (IntPtr path, out Rectangle bounds, IntPtr matrix, IntPtr pen);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipIsVisiblePathPoint (IntPtr path, float x, float y, IntPtr graphics, out bool result);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipIsVisiblePathPointI (IntPtr path, int x, int y, IntPtr graphics, out bool result);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipIsOutlineVisiblePathPoint (IntPtr path, float x, float y, IntPtr pen, IntPtr graphics, out bool result);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipIsOutlineVisiblePathPointI (IntPtr path, int x, int y, IntPtr pen, IntPtr graphics, out bool result);
+ string lpBitmapName, out IntPtr bitmap);
+
+ // Matrix functions
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipCreateMatrix (out IntPtr matrix);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipCreateMatrix2 (float m11, float m12, float m21, float m22, float dx, float dy, out IntPtr matrix);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipCreateMatrix3 (ref RectangleF rect, PointF [] dstplg, out IntPtr matrix);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipCreateMatrix3I (ref Rectangle rect, Point [] dstplg, out IntPtr matrix);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipDeleteMatrix (IntPtr matrix);
+
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipCloneMatrix (IntPtr matrix, out IntPtr cloneMatrix);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipSetMatrixElements (IntPtr matrix, float m11, float m12, float m21, float m22, float dx, float dy);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipGetMatrixElements (IntPtr matrix, IntPtr matrixOut);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipMultiplyMatrix (IntPtr matrix, IntPtr matrix2, MatrixOrder order);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipTranslateMatrix (IntPtr matrix, float offsetX, float offsetY, MatrixOrder order);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipScaleMatrix (IntPtr matrix, float scaleX, float scaleY, MatrixOrder order);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipRotateMatrix (IntPtr matrix, float angle, MatrixOrder order);
+
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipShearMatrix (IntPtr matrix, float shearX, float shearY, MatrixOrder order);
+
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipInvertMatrix (IntPtr matrix);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipTransformMatrixPoints (IntPtr matrix, [In, Out] PointF [] pts, int count);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipTransformMatrixPointsI (IntPtr matrix, [In, Out] Point [] pts, int count);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipVectorTransformMatrixPoints (IntPtr matrix, [In, Out] PointF [] pts, int count);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipVectorTransformMatrixPointsI (IntPtr matrix, [In, Out] Point [] pts, int count);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipIsMatrixInvertible (IntPtr matrix, out bool result);
+
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipIsMatrixIdentity (IntPtr matrix, out bool result);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipIsMatrixEqual (IntPtr matrix, IntPtr matrix2, out bool result);
+
+ // GraphicsPath functions
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipCreatePath (FillMode brushMode, out IntPtr path);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipCreatePath2 (PointF [] points, byte [] types, int count, FillMode brushMode, out IntPtr path);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipCreatePath2I (Point [] points, byte [] types, int count, FillMode brushMode, out IntPtr path);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipClonePath (IntPtr path, out IntPtr clonePath);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipDeletePath (IntPtr path);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipResetPath (IntPtr path);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipGetPointCount (IntPtr path, out int count);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipGetPathTypes (IntPtr path, [Out] byte [] types, int count);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipGetPathPoints (IntPtr path, [Out] PointF [] points, int count);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipGetPathPointsI (IntPtr path, [Out] Point [] points, int count);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipGetPathFillMode (IntPtr path, out FillMode fillMode);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipSetPathFillMode (IntPtr path, FillMode fillMode);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipStartPathFigure (IntPtr path);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipClosePathFigure (IntPtr path);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipClosePathFigures (IntPtr path);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipSetPathMarker (IntPtr path);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipClearPathMarkers (IntPtr path);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipReversePath (IntPtr path);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipGetPathLastPoint (IntPtr path, out PointF lastPoint);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipAddPathLine (IntPtr path, float x1, float y1, float x2, float y2);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipAddPathLine2 (IntPtr path, PointF[] points, int count);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipAddPathLine2I (IntPtr path, Point[] points, int count);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipAddPathArc (IntPtr path, float x, float y, float width, float height, float startAngle, float sweepAngle);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipAddPathBezier (IntPtr path, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipAddPathBeziers (IntPtr path, PointF [] points, int count);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipAddPathCurve (IntPtr path, PointF [] points, int count);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipAddPathCurveI (IntPtr path, Point [] points, int count);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipAddPathCurve2 (IntPtr path, PointF [] points, int count, float tension);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipAddPathCurve2I (IntPtr path, Point [] points, int count, float tension);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipAddPathCurve3 (IntPtr path, PointF [] points, int count, int offset, int numberOfSegments, float tension);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipAddPathCurve3I (IntPtr path, Point [] points, int count, int offset, int numberOfSegments, float tension);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipAddPathClosedCurve (IntPtr path, PointF [] points, int count);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipAddPathClosedCurveI (IntPtr path, Point [] points, int count);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipAddPathClosedCurve2 (IntPtr path, PointF [] points, int count, float tension);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipAddPathClosedCurve2I (IntPtr path, Point [] points, int count, float tension);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipAddPathRectangle (IntPtr path, float x, float y, float width, float height);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipAddPathRectangles (IntPtr path, RectangleF [] rects, int count);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipAddPathEllipse (IntPtr path, float x, float y, float width, float height);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipAddPathEllipseI (IntPtr path, int x, int y, int width, int height);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipAddPathPie (IntPtr path, float x, float y, float width, float height, float startAngle, float sweepAngle);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipAddPathPieI (IntPtr path, int x, int y, int width, int height, float startAngle, float sweepAngle);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipAddPathPolygon (IntPtr path, PointF [] points, int count);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipAddPathPath (IntPtr path, IntPtr addingPath, bool connect);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipAddPathLineI (IntPtr path, int x1, int y1, int x2, int y2);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipAddPathArcI (IntPtr path, int x, int y, int width, int height, float startAngle, float sweepAngle);
+
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipAddPathBezierI (IntPtr path, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipAddPathBeziersI (IntPtr path, Point [] points, int count);
+
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipAddPathPolygonI (IntPtr path, Point [] points, int count);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipAddPathRectangleI (IntPtr path, int x, int y, int width, int height);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipAddPathRectanglesI (IntPtr path, Rectangle [] rects, int count);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipFlattenPath (IntPtr path, IntPtr matrix, float floatness);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipTransformPath (IntPtr path, IntPtr matrix);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipWarpPath (IntPtr path, IntPtr matrix,
+ PointF [] points, int count,
+ float srcx, float srcy, float srcwidth, float srcheight,
+ WarpMode mode, float flatness);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipWidenPath (IntPtr path, IntPtr pen, IntPtr matrix, float flatness);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipGetPathWorldBounds (IntPtr path, out RectangleF bounds, IntPtr matrix, IntPtr pen);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipGetPathWorldBoundsI (IntPtr path, out Rectangle bounds, IntPtr matrix, IntPtr pen);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipIsVisiblePathPoint (IntPtr path, float x, float y, IntPtr graphics, out bool result);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipIsVisiblePathPointI (IntPtr path, int x, int y, IntPtr graphics, out bool result);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipIsOutlineVisiblePathPoint (IntPtr path, float x, float y, IntPtr pen, IntPtr graphics, out bool result);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipIsOutlineVisiblePathPointI (IntPtr path, int x, int y, IntPtr pen, IntPtr graphics, out bool result);
// GraphicsPathIterator
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipCreatePathIter (out IntPtr iterator, IntPtr path);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipPathIterGetCount (IntPtr iterator, out int count);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipPathIterGetSubpathCount (IntPtr iterator, out int count);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipDeletePathIter (IntPtr iterator);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipPathIterCopyData (IntPtr iterator, out int resultCount, PointF [] points, byte [] types, int startIndex, int endIndex);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipPathIterEnumerate (IntPtr iterator, out int resultCount, PointF [] points, byte [] types, int count);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipPathIterHasCurve (IntPtr iterator, out bool curve);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipPathIterNextMarkerPath (IntPtr iterator, out int resultCount, IntPtr path);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipPathIterNextMarker (IntPtr iterator, out int resultCount, out int startIndex, out int endIndex);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipPathIterNextPathType (IntPtr iterator, out int resultCount, out byte pathType, out int startIndex, out int endIndex);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipPathIterNextSubpathPath (IntPtr iterator, out int resultCount, IntPtr path, out bool isClosed);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipPathIterNextSubpath (IntPtr iterator, out int resultCount, out int startIndex, out int endIndex, out bool isClosed);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipPathIterRewind (IntPtr iterator);
// ImageAttributes
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipCreateImageAttributes (out IntPtr imageattr);
-
- [DllImport ("gdiplus.dll")]
+
+ [DllImport (GdiPlus)]
internal static extern Status GdipSetImageAttributesColorKeys (IntPtr imageattr,
- ColorAdjustType type, bool enableFlag, int colorLow, int colorHigh);
-
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipDisposeImageAttributes (IntPtr imageattr);
-
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipSetImageAttributesColorMatrix (IntPtr imageattr,
- ColorAdjustType type, bool enableFlag, IntPtr colorMatrix,
- IntPtr grayMatrix, ColorMatrixFlag flags);
-
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipSetImageAttributesGamma (IntPtr imageattr,
- ColorAdjustType type, bool enableFlag,
+ ColorAdjustType type, bool enableFlag, int colorLow, int colorHigh);
+
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipDisposeImageAttributes (IntPtr imageattr);
+
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipSetImageAttributesColorMatrix (IntPtr imageattr,
+ ColorAdjustType type, bool enableFlag, IntPtr colorMatrix,
+ IntPtr grayMatrix, ColorMatrixFlag flags);
+
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipSetImageAttributesGamma (IntPtr imageattr,
+ ColorAdjustType type, bool enableFlag,
float gamma);
-
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipSetImageAttributesNoOp (IntPtr imageattr,
+
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipSetImageAttributesNoOp (IntPtr imageattr,
ColorAdjustType type, bool enableFlag);
-
- [DllImport ("gdiplus.dll")]
+
+ [DllImport (GdiPlus)]
internal static extern Status GdipSetImageAttributesOutputChannel (IntPtr imageattr,
ColorAdjustType type, bool enableFlag, ColorChannelFlag channelFlags);
-
- [DllImport ("gdiplus.dll", CharSet=CharSet.Auto)]
+
+ [DllImport (GdiPlus, CharSet=CharSet.Auto)]
internal static extern Status GdipSetImageAttributesOutputChannelColorProfile (IntPtr imageattr,
ColorAdjustType type, bool enableFlag, [MarshalAs (UnmanagedType.LPWStr)] string profileName);
-
- [DllImport ("gdiplus.dll")]
+
+ [DllImport (GdiPlus)]
internal static extern Status GdipSetImageAttributesRemapTable (IntPtr imageattr,
ColorAdjustType type, bool enableFlag, uint mapSize, IntPtr colorMap);
-
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipSetImageAttributesThreshold (IntPtr imageattr,
+
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipSetImageAttributesThreshold (IntPtr imageattr,
ColorAdjustType type, bool enableFlag, float thresHold);
-
- [DllImport ("gdiplus.dll")]
+
+ [DllImport (GdiPlus)]
internal static extern Status GdipCloneImageAttributes(IntPtr imageattr, out IntPtr cloneImageattr);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipGetImageAttributesAdjustedPalette (IntPtr imageattr, IntPtr colorPalette,
ColorAdjustType colorAdjustType);
-
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipSetImageAttributesWrapMode(IntPtr imageattr, WrapMode wrap,
- int argb, bool clamp);
-
-
- // Font
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipCreateFont (IntPtr fontFamily, float emSize, FontStyle style, GraphicsUnit unit, out IntPtr font);
- [DllImport("gdiplus.dll")]
- internal static extern Status GdipDeleteFont (IntPtr font);
- [DllImport("gdiplus.dll", CharSet=CharSet.Auto)]
+
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipSetImageAttributesWrapMode(IntPtr imageattr, WrapMode wrap,
+ int argb, bool clamp);
+
+
+ // Font
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipCreateFont (IntPtr fontFamily, float emSize, FontStyle style, GraphicsUnit unit, out IntPtr font);
+ [DllImport(GdiPlus)]
+ internal static extern Status GdipDeleteFont (IntPtr font);
+ [DllImport(GdiPlus, CharSet=CharSet.Auto)]
internal static extern Status GdipGetLogFont(IntPtr font, IntPtr graphics, [MarshalAs(UnmanagedType.AsAny), Out] object logfontA);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipCreateFontFromDC(IntPtr hdc, out IntPtr font);
- [DllImport("gdiplus.dll", SetLastError=true, CharSet=CharSet.Auto)]
+ [DllImport(GdiPlus, SetLastError=true, CharSet=CharSet.Auto)]
internal static extern Status GdipCreateFontFromLogfont(IntPtr hdc, ref LOGFONT lf, out IntPtr ptr);
// These are our private functions, they exists in our own libgdiplus library, this way we
// avoid relying on wine in System.Drawing
- [DllImport("gdiplus.dll", CharSet=CharSet.Ansi)]
+ [DllImport(GdiPlus, CharSet=CharSet.Ansi)]
internal static extern Status GdipCreateFontFromHfont(IntPtr hdc, out IntPtr font, ref LOGFONT lf);
// This is win32/gdi, not gdiplus, but it's easier to keep in here, also see above comment
[DllImport("gdi32.dll", CallingConvention=CallingConvention.StdCall, CharSet = CharSet.Auto)]
- internal static extern IntPtr CreateFontIndirect (ref LOGFONT logfont);
+ internal static extern IntPtr CreateFontIndirect (ref LOGFONT logfont);
[DllImport("user32.dll", EntryPoint="GetDC", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi)]
- internal static extern IntPtr GetDC(IntPtr hwnd);
+ internal static extern IntPtr GetDC(IntPtr hwnd);
[DllImport("user32.dll", EntryPoint="ReleaseDC", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi)]
internal static extern int ReleaseDC (IntPtr hWnd, IntPtr hDC);
[DllImport("gdi32.dll", EntryPoint="SelectObject", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi)]
- internal static extern IntPtr SelectObject(IntPtr hdc, IntPtr obj);
+ internal static extern IntPtr SelectObject(IntPtr hdc, IntPtr obj);
[DllImport("user32.dll", SetLastError=true)]
internal static extern bool GetIconInfo (IntPtr hIcon, out IconInfo iconinfo);
[DllImport("user32.dll", CallingConvention = CallingConvention.StdCall, SetLastError=true)]
internal static extern IntPtr GetDesktopWindow ();
[DllImport("gdi32.dll", SetLastError=true)]
- public static extern int BitBlt(IntPtr hdcDest, int nXDest, int nYDest,
+ public static extern int BitBlt(IntPtr hdcDest, int nXDest, int nYDest,
int nWidth, int nHeight, IntPtr hdcSrc, int nXSrc, int nYSrc, int dwRop);
[DllImport ("user32.dll", EntryPoint = "GetSysColor", CallingConvention = CallingConvention.StdCall)]
// Some special X11 stuff
[DllImport("libX11", EntryPoint="XOpenDisplay")]
- internal extern static IntPtr XOpenDisplay(IntPtr display);
+ internal extern static IntPtr XOpenDisplay(IntPtr display);
[DllImport("libX11", EntryPoint="XCloseDisplay")]
- internal extern static int XCloseDisplay(IntPtr display);
+ internal extern static int XCloseDisplay(IntPtr display);
[DllImport ("libX11", EntryPoint="XRootWindow")]
internal extern static IntPtr XRootWindow(IntPtr display, int screen);
-
+
[DllImport ("libX11", EntryPoint="XDefaultScreen")]
internal extern static int XDefaultScreen(IntPtr display);
internal extern static IntPtr XVisualIDFromVisual (IntPtr visual);
[DllImport ("libX11", EntryPoint="XFree")]
- internal extern static void XFree (IntPtr data);
-
+ internal extern static void XFree (IntPtr data);
+
// FontCollection
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipGetFontCollectionFamilyCount (IntPtr collection, out int found);
-
- [DllImport ("gdiplus.dll")]
+
+ [DllImport (GdiPlus)]
internal static extern Status GdipGetFontCollectionFamilyList (IntPtr collection, int getCount, IntPtr[] dest, out int retCount);
//internal static extern Status GdipGetFontCollectionFamilyList( IntPtr collection, int getCount, [Out] FontFamily [] familyList, out int retCount );
-
- [DllImport ("gdiplus.dll")]
+
+ [DllImport (GdiPlus)]
internal static extern Status GdipNewInstalledFontCollection (out IntPtr collection);
-
- [DllImport ("gdiplus.dll")]
+
+ [DllImport (GdiPlus)]
internal static extern Status GdipNewPrivateFontCollection (out IntPtr collection);
-
- [DllImport ("gdiplus.dll")]
+
+ [DllImport (GdiPlus)]
internal static extern Status GdipDeletePrivateFontCollection (ref IntPtr collection);
-
- [DllImport ("gdiplus.dll", CharSet=CharSet.Auto)]
+
+ [DllImport (GdiPlus, CharSet=CharSet.Auto)]
internal static extern Status GdipPrivateAddFontFile (IntPtr collection,
- [MarshalAs (UnmanagedType.LPWStr)] string fileName );
-
- [DllImport ("gdiplus.dll")]
+ [MarshalAs (UnmanagedType.LPWStr)] string fileName );
+
+ [DllImport (GdiPlus)]
internal static extern Status GdipPrivateAddMemoryFont (IntPtr collection, IntPtr mem, int length);
//FontFamily
- [DllImport ("gdiplus.dll", CharSet=CharSet.Auto)]
+ [DllImport (GdiPlus, CharSet=CharSet.Auto)]
internal static extern Status GdipCreateFontFamilyFromName (
- [MarshalAs(UnmanagedType.LPWStr)] string fName, IntPtr collection, out IntPtr fontFamily);
+ [MarshalAs(UnmanagedType.LPWStr)] string fName, IntPtr collection, out IntPtr fontFamily);
- [DllImport ("gdiplus.dll", CharSet=CharSet.Unicode)]
+ [DllImport (GdiPlus, CharSet=CharSet.Unicode)]
internal static extern Status GdipGetFamilyName(IntPtr family, StringBuilder name, int language);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipGetGenericFontFamilySansSerif (out IntPtr fontFamily);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipGetGenericFontFamilySerif (out IntPtr fontFamily);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipGetGenericFontFamilyMonospace (out IntPtr fontFamily);
-
- [DllImport ("gdiplus.dll")]
+
+ [DllImport (GdiPlus)]
internal static extern Status GdipGetCellAscent (IntPtr fontFamily, int style, out short ascent);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipGetCellDescent (IntPtr fontFamily, int style, out short descent);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipGetLineSpacing (IntPtr fontFamily, int style, out short spacing);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipGetEmHeight (IntPtr fontFamily, int style, out short emHeight);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipIsStyleAvailable (IntPtr fontFamily, int style, out bool styleAvailable);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipDeleteFontFamily (IntPtr fontFamily);
-
- [DllImport ("gdiplus.dll")]
+
+ [DllImport (GdiPlus)]
internal static extern Status GdipGetFontSize (IntPtr font, out float size);
-
- [DllImport ("gdiplus.dll")]
+
+ [DllImport (GdiPlus)]
internal static extern Status GdipGetFontHeight (IntPtr font, IntPtr graphics, out float height);
-
- [DllImport ("gdiplus.dll")]
+
+ [DllImport (GdiPlus)]
internal static extern Status GdipGetFontHeightGivenDPI (IntPtr font, float dpi, out float height);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipCloneFontFamily (IntPtr fontFamily, out IntPtr clone);
-
-
+
+
// String Format
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipCreateStringFormat(int formatAttributes, int language, out IntPtr format);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipCreateStringFormat(int formatAttributes, int language, out IntPtr format);
+ [DllImport (GdiPlus)]
internal static extern Status GdipStringFormatGetGenericDefault(out IntPtr format);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipStringFormatGetGenericTypographic(out IntPtr format);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipDeleteStringFormat(IntPtr format);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipCloneStringFormat(IntPtr srcformat, out IntPtr format);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipSetStringFormatFlags(IntPtr format, StringFormatFlags flags);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipGetStringFormatFlags(IntPtr format, out StringFormatFlags flags);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipSetStringFormatAlign(IntPtr format, StringAlignment align);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipGetStringFormatAlign(IntPtr format, out StringAlignment align);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipSetStringFormatLineAlign(IntPtr format, StringAlignment align);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipGetStringFormatLineAlign(IntPtr format, out StringAlignment align);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipSetStringFormatTrimming(IntPtr format, StringTrimming trimming);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipGetStringFormatTrimming(IntPtr format, out StringTrimming trimming);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipSetStringFormatHotkeyPrefix(IntPtr format, HotkeyPrefix hotkeyPrefix);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipGetStringFormatHotkeyPrefix(IntPtr format, out HotkeyPrefix hotkeyPrefix);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipSetStringFormatTabStops(IntPtr format, float firstTabOffset, int count, float [] tabStops);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipGetStringFormatDigitSubstitution(IntPtr format, int language, out StringDigitSubstitute substitute);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipSetStringFormatDigitSubstitution(IntPtr format, int language, StringDigitSubstitute substitute);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipGetStringFormatTabStopCount(IntPtr format, out int count);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipGetStringFormatTabStops(IntPtr format, int count, out float firstTabOffset, [In, Out] float [] tabStops);
-
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipSetStringFormatTabStops(IntPtr format, float firstTabOffset, int count, float [] tabStops);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipGetStringFormatDigitSubstitution(IntPtr format, int language, out StringDigitSubstitute substitute);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipSetStringFormatDigitSubstitution(IntPtr format, int language, StringDigitSubstitute substitute);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipGetStringFormatTabStopCount(IntPtr format, out int count);
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipGetStringFormatTabStops(IntPtr format, int count, out float firstTabOffset, [In, Out] float [] tabStops);
+
// metafile
- [DllImport ("gdiplus.dll", CharSet = CharSet.Auto)]
+ [DllImport (GdiPlus, CharSet = CharSet.Auto)]
internal static extern Status GdipCreateMetafileFromFile ([MarshalAs (UnmanagedType.LPWStr)] string filename, out IntPtr metafile);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipCreateMetafileFromEmf (IntPtr hEmf, bool deleteEmf, out IntPtr metafile);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipCreateMetafileFromWmf (IntPtr hWmf, bool deleteWmf, WmfPlaceableFileHeader wmfPlaceableFileHeader, out IntPtr metafile);
- [DllImport ("gdiplus.dll", CharSet = CharSet.Auto)]
+ [DllImport (GdiPlus, CharSet = CharSet.Auto)]
internal static extern Status GdipGetMetafileHeaderFromFile ([MarshalAs (UnmanagedType.LPWStr)] string filename, IntPtr header);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipGetMetafileHeaderFromMetafile (IntPtr metafile, IntPtr header);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipGetMetafileHeaderFromEmf (IntPtr hEmf, IntPtr header);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipGetMetafileHeaderFromWmf (IntPtr hWmf, IntPtr wmfPlaceableFileHeader, IntPtr header);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipGetHemfFromMetafile (IntPtr metafile, out IntPtr hEmf);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipGetMetafileDownLevelRasterizationLimit (IntPtr metafile, ref uint metafileRasterizationLimitDpi);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipSetMetafileDownLevelRasterizationLimit (IntPtr metafile, uint metafileRasterizationLimitDpi);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipPlayMetafileRecord (IntPtr metafile, EmfPlusRecordType recordType, int flags, int dataSize, byte[] data);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipRecordMetafile (IntPtr hdc, EmfType type, ref RectangleF frameRect,
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipRecordMetafile (IntPtr hdc, EmfType type, ref RectangleF frameRect,
MetafileFrameUnit frameUnit, [MarshalAs (UnmanagedType.LPWStr)] string description, out IntPtr metafile);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipRecordMetafileI (IntPtr hdc, EmfType type, ref Rectangle frameRect,
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipRecordMetafileI (IntPtr hdc, EmfType type, ref Rectangle frameRect,
MetafileFrameUnit frameUnit, [MarshalAs (UnmanagedType.LPWStr)] string description, out IntPtr metafile);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipRecordMetafileFileName ([MarshalAs (UnmanagedType.LPWStr)] string filename, IntPtr hdc, EmfType type,
ref RectangleF frameRect, MetafileFrameUnit frameUnit, [MarshalAs (UnmanagedType.LPWStr)] string description, out IntPtr metafile);
- [DllImport ("gdiplus.dll")]
+ [DllImport (GdiPlus)]
internal static extern Status GdipRecordMetafileFileNameI ([MarshalAs (UnmanagedType.LPWStr)] string filename, IntPtr hdc, EmfType type,
ref Rectangle frameRect, MetafileFrameUnit frameUnit, [MarshalAs (UnmanagedType.LPWStr)] string description, out IntPtr metafile);
#if !TEST
- [DllImport("gdiplus.dll", ExactSpelling=true, CharSet=CharSet.Unicode)]
+ [DllImport(GdiPlus, ExactSpelling=true, CharSet=CharSet.Unicode)]
internal static extern Status GdipCreateMetafileFromStream([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(ComIStreamMarshaler))] IStream stream, out IntPtr metafile);
- [DllImport("gdiplus.dll", ExactSpelling=true, CharSet=CharSet.Unicode)]
+ [DllImport(GdiPlus, ExactSpelling=true, CharSet=CharSet.Unicode)]
internal static extern Status GdipGetMetafileHeaderFromStream([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(ComIStreamMarshaler))] IStream stream, IntPtr header);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipRecordMetafileStream ([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(ComIStreamMarshaler))] IStream stream, IntPtr hdc,
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipRecordMetafileStream ([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(ComIStreamMarshaler))] IStream stream, IntPtr hdc,
EmfType type, ref RectangleF frameRect, MetafileFrameUnit frameUnit, [MarshalAs (UnmanagedType.LPWStr)] string description, out IntPtr metafile);
- [DllImport ("gdiplus.dll")]
- internal static extern Status GdipRecordMetafileStreamI ([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(ComIStreamMarshaler))] IStream stream, IntPtr hdc,
+ [DllImport (GdiPlus)]
+ internal static extern Status GdipRecordMetafileStreamI ([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(ComIStreamMarshaler))] IStream stream, IntPtr hdc,
EmfType type, ref Rectangle frameRect, MetafileFrameUnit frameUnit, [MarshalAs (UnmanagedType.LPWStr)] string description, out IntPtr metafile);
#endif
//ImageCodecInfo functions
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetImageDecodersSize (out int decoderNums, out int arraySize);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetImageDecoders (int decoderNums, int arraySize, IntPtr decoders);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetImageEncodersSize (out int encoderNums, out int arraySize);
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
static internal extern Status GdipGetImageEncoders (int encoderNums, int arraySize, IntPtr encoders);
//
internal sealed class GdiPlusStreamHelper {
public Stream stream;
-
+
private StreamGetHeaderDelegate sghd = null;
private StreamGetBytesDelegate sgbd = null;
private StreamSeekDelegate skd = null;
private byte[] start_buf;
private int start_buf_pos;
private int start_buf_len;
- private byte[] managedBuf;
+ private byte[] managedBuf;
private const int default_bufsize = 4096;
-
- public GdiPlusStreamHelper (Stream s, bool seekToOrigin)
- {
+
+ public GdiPlusStreamHelper (Stream s, bool seekToOrigin)
+ {
managedBuf = new byte [default_bufsize];
-
+
stream = s;
if (stream != null && stream.CanSeek && seekToOrigin) {
stream.Seek (0, SeekOrigin.Begin);
}
}
- public int StreamGetHeaderImpl (IntPtr buf, int bufsz) {
+ public int StreamGetHeaderImpl (IntPtr buf, int bufsz) {
int bytesRead;
start_buf = new byte[bufsz];
}
}
- public int StreamGetBytesImpl (IntPtr buf, int bufsz, bool peek)
+ public int StreamGetBytesImpl (IntPtr buf, int bufsz, bool peek)
{
if (buf == IntPtr.Zero && peek) {
return -1;
return -1;
}
}
-
+
if (bytesRead > 0 && buf != IntPtr.Zero) {
Marshal.Copy (managedBuf, 0, (IntPtr) (buf.ToInt64()), bytesRead);
}
if (!stream.CanSeek && (bufsz == 10) && peek) {
// Special 'hack' to support peeking of the type for gdi+ on non-seekable streams
}
-
+
if (peek) {
if (stream.CanSeek) {
// If we are peeking bytes, then go back to original position before peeking
}
}
}
-
+
return bytesRead;
}
}
}
- public long StreamSeekImpl (int offset, int whence)
+ public long StreamSeekImpl (int offset, int whence)
{
// Make sure we have a valid 'whence'.
if ((whence < 0) || (whence > 2))
}
}
- public int StreamPutBytesImpl (IntPtr buf, int bufsz)
+ public int StreamPutBytesImpl (IntPtr buf, int bufsz)
{
if (bufsz > managedBuf.Length)
managedBuf = new byte[bufsz];
return null;
}
}
-
+
public void StreamCloseImpl ()
{
stream.Close ();
return null;
}
}
-
+
public long StreamSizeImpl ()
{
try {
}
}
-
+
/* Mac only function calls */
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipCreateFromContext_macosx (IntPtr cgref, int width, int height, out IntPtr graphics);
/* Linux only function calls*/
- [DllImport("gdiplus.dll")]
+ [DllImport(GdiPlus)]
internal static extern Status GdipSetVisibleClip_linux (IntPtr graphics, ref Rectangle rect);
-
- [DllImport("gdiplus.dll")]
+
+ [DllImport(GdiPlus)]
internal static extern Status GdipCreateFromXDrawable_linux (IntPtr drawable, IntPtr display, out IntPtr graphics);
-
+
// Stream functions for non-Win32 (libgdiplus specific)
- [DllImport("gdiplus.dll")]
- static internal extern Status GdipLoadImageFromDelegate_linux (StreamGetHeaderDelegate getHeader,
- StreamGetBytesDelegate getBytes, StreamPutBytesDelegate putBytes, StreamSeekDelegate doSeek,
+ [DllImport(GdiPlus)]
+ static internal extern Status GdipLoadImageFromDelegate_linux (StreamGetHeaderDelegate getHeader,
+ StreamGetBytesDelegate getBytes, StreamPutBytesDelegate putBytes, StreamSeekDelegate doSeek,
StreamCloseDelegate close, StreamSizeDelegate size, out IntPtr image);
- [DllImport("gdiplus.dll")]
- static internal extern Status GdipSaveImageToDelegate_linux (IntPtr image, StreamGetBytesDelegate getBytes,
- StreamPutBytesDelegate putBytes, StreamSeekDelegate doSeek, StreamCloseDelegate close,
- StreamSizeDelegate size, ref Guid encoderClsID, IntPtr encoderParameters);
+ [DllImport(GdiPlus)]
+ static internal extern Status GdipSaveImageToDelegate_linux (IntPtr image, StreamGetBytesDelegate getBytes,
+ StreamPutBytesDelegate putBytes, StreamSeekDelegate doSeek, StreamCloseDelegate close,
+ StreamSizeDelegate size, ref Guid encoderClsID, IntPtr encoderParameters);
- [DllImport("gdiplus.dll")]
- static internal extern Status GdipCreateMetafileFromDelegate_linux (StreamGetHeaderDelegate getHeader,
- StreamGetBytesDelegate getBytes, StreamPutBytesDelegate putBytes, StreamSeekDelegate doSeek,
+ [DllImport(GdiPlus)]
+ static internal extern Status GdipCreateMetafileFromDelegate_linux (StreamGetHeaderDelegate getHeader,
+ StreamGetBytesDelegate getBytes, StreamPutBytesDelegate putBytes, StreamSeekDelegate doSeek,
StreamCloseDelegate close, StreamSizeDelegate size, out IntPtr metafile);
- [DllImport("gdiplus.dll")]
- static internal extern Status GdipGetMetafileHeaderFromDelegate_linux (StreamGetHeaderDelegate getHeader,
- StreamGetBytesDelegate getBytes, StreamPutBytesDelegate putBytes, StreamSeekDelegate doSeek,
+ [DllImport(GdiPlus)]
+ static internal extern Status GdipGetMetafileHeaderFromDelegate_linux (StreamGetHeaderDelegate getHeader,
+ StreamGetBytesDelegate getBytes, StreamPutBytesDelegate putBytes, StreamSeekDelegate doSeek,
StreamCloseDelegate close, StreamSizeDelegate size, IntPtr header);
- [DllImport("gdiplus.dll")]
- static internal extern Status GdipRecordMetafileFromDelegate_linux (StreamGetHeaderDelegate getHeader,
- StreamGetBytesDelegate getBytes, StreamPutBytesDelegate putBytes, StreamSeekDelegate doSeek,
- StreamCloseDelegate close, StreamSizeDelegate size, IntPtr hdc, EmfType type, ref RectangleF frameRect,
+ [DllImport(GdiPlus)]
+ static internal extern Status GdipRecordMetafileFromDelegate_linux (StreamGetHeaderDelegate getHeader,
+ StreamGetBytesDelegate getBytes, StreamPutBytesDelegate putBytes, StreamSeekDelegate doSeek,
+ StreamCloseDelegate close, StreamSizeDelegate size, IntPtr hdc, EmfType type, ref RectangleF frameRect,
MetafileFrameUnit frameUnit, [MarshalAs (UnmanagedType.LPWStr)] string description, out IntPtr metafile);
- [DllImport("gdiplus.dll")]
- static internal extern Status GdipRecordMetafileFromDelegateI_linux (StreamGetHeaderDelegate getHeader,
- StreamGetBytesDelegate getBytes, StreamPutBytesDelegate putBytes, StreamSeekDelegate doSeek,
- StreamCloseDelegate close, StreamSizeDelegate size, IntPtr hdc, EmfType type, ref Rectangle frameRect,
+ [DllImport(GdiPlus)]
+ static internal extern Status GdipRecordMetafileFromDelegateI_linux (StreamGetHeaderDelegate getHeader,
+ StreamGetBytesDelegate getBytes, StreamPutBytesDelegate putBytes, StreamSeekDelegate doSeek,
+ StreamCloseDelegate close, StreamSizeDelegate size, IntPtr hdc, EmfType type, ref Rectangle frameRect,
MetafileFrameUnit frameUnit, [MarshalAs (UnmanagedType.LPWStr)] string description, out IntPtr metafile);
[DllImport ("libc")]
namespace System.Drawing {
- [SuppressUnmanagedCodeSecurity]
internal static class MacSupport {
internal static Hashtable contextReference = new Hashtable ();
internal static object lockobj = new object ();
}
}
- hash = new MD5CryptoServiceProvider().ComputeHash (pixels);
+ hash = MD5.Create ().ComputeHash (pixels);
return ByteArrayToString (hash);
}
public string RotateIndexedBmp (Bitmap src, RotateFlipType type)
if (pixel_data == null)
return "--ERROR--";
- byte[] hash = new MD5CryptoServiceProvider().ComputeHash (pixel_data);
+ byte[] hash = MD5.Create ().ComputeHash (pixel_data);
return ByteArrayToString (hash);
}
}\r
\r
[MonoTODO]\r
- public static void SetNamedProperty (string name, object property)\r
+ public static void SetNamedProperty (string name, object value)\r
{\r
throw new NotImplementedException ();\r
}\r
{\r
}\r
\r
- public RegistrationException (string msg, Exception innerException)\r
- : base (msg, innerException)\r
+ public RegistrationException (string msg, Exception inner)\r
+ : base (msg, inner)\r
{\r
}\r
\r
public CardSpacePolicyElement (
XmlElement target, XmlElement issuer,
Collection<XmlElement> parameters,
- Uri policyNoticeLink,
- int policyNoticeVersion,
+ Uri privacyNoticeLink,
+ int privacyNoticeVersion,
bool isManagedIssuer)
{
this.target = target;
this.issuer = issuer;
this.parameters = parameters ?? new Collection<XmlElement> ();
- this.policy_link = policyNoticeLink;
- policy_ver = policyNoticeVersion;
+ this.policy_link = privacyNoticeLink;
+ policy_ver = privacyNoticeVersion;
is_managed = isManagedIssuer;
}
[MonoTODO]
public static GenericXmlSecurityToken GetToken (
CardSpacePolicyElement [] policyChain,
- SecurityTokenSerializer serializer)
+ SecurityTokenSerializer tokenSerializer)
{
- return (GenericXmlSecurityToken) get_token.Invoke (impl, new object [] {policyChain, serializer});
+ return (GenericXmlSecurityToken) get_token.Invoke (impl, new object [] {policyChain, tokenSerializer});
}
public static GenericXmlSecurityToken GetToken (
XmlElement endpoint,
IEnumerable<XmlElement> policy,
XmlElement requiredRemoteTokenIssuer,
- SecurityTokenSerializer serializer)
+ SecurityTokenSerializer tokenSerializer)
{
CardSpacePolicyElement pe = new CardSpacePolicyElement (endpoint, requiredRemoteTokenIssuer, new Collection<XmlElement> (new List<XmlElement> (policy)), null, 0, requiredRemoteTokenIssuer != null);
- return GetToken (new CardSpacePolicyElement [] {pe}, serializer);
+ return GetToken (new CardSpacePolicyElement [] {pe}, tokenSerializer);
}
[MonoTODO]
}
[MonoTODO]
- public static Claim CreateDenyOnlyWindowsSidClaim (SecurityIdentifier identifier)
+ public static Claim CreateDenyOnlyWindowsSidClaim (SecurityIdentifier sid)
{
throw new NotImplementedException ();
}
}
public abstract IEnumerable<Claim> FindClaims (
- string resourceType, string right);
+ string claimType, string right);
public abstract IEnumerator<Claim> GetEnumerator ();
// Constructors
[MonoTODO]
- public WindowsClaimSet (WindowsIdentity identity)
+ public WindowsClaimSet (WindowsIdentity windowsIdentity)
{
throw new NotImplementedException ();
}
[MonoTODO]
- public WindowsClaimSet (WindowsIdentity identity, bool includeWindowsGroups)
+ public WindowsClaimSet (WindowsIdentity windowsIdentity, bool includeWindowsGroups)
{
throw new NotImplementedException ();
}
[MonoTODO]
- public WindowsClaimSet (WindowsIdentity identity, DateTime expirationTime)
+ public WindowsClaimSet (WindowsIdentity windowsIdentity, DateTime expirationTime)
{
throw new NotImplementedException ();
}
[MonoTODO]
- public WindowsClaimSet (WindowsIdentity identity, bool includeWindowsGroups, DateTime expirationTime)
+ public WindowsClaimSet (WindowsIdentity windowsIdentity, bool includeWindowsGroups, DateTime expirationTime)
{
throw new NotImplementedException ();
}
{
[MonoTODO]
public static AuthorizationContext
- CreateDefaultAuthorizationContext (IList<IAuthorizationPolicy> policies)
+ CreateDefaultAuthorizationContext (IList<IAuthorizationPolicy> authorizationPolicies)
{
- if (policies == null)
- throw new ArgumentNullException ("policies");
+ if (authorizationPolicies == null)
+ throw new ArgumentNullException ("authorizationPolicies");
string id = new UniqueId ().ToString ();
DefaultEvaluationContext ctx =
new DefaultEvaluationContext ();
- foreach (IAuthorizationPolicy a in policies) {
+ foreach (IAuthorizationPolicy a in authorizationPolicies) {
object o = null;
a.Evaluate (ctx, ref o);
}
public abstract ReadOnlyCollection<ClaimSet> ClaimSets { get; }
public abstract void AddClaimSet (
- IAuthorizationPolicy authorizationPolicy,
+ IAuthorizationPolicy policy,
ClaimSet claimSet);
- public abstract void RecordExpirationTime (DateTime time);
+ public abstract void RecordExpirationTime (DateTime expirationTime);
}
// default implementation
}
[MonoTODO]
- public KerberosSecurityTokenProvider (string servicePrincipalName, TokenImpersonationLevel tokenImpersonationLevel, NetworkCredential credential)
+ public KerberosSecurityTokenProvider (string servicePrincipalName, TokenImpersonationLevel tokenImpersonationLevel, NetworkCredential networkCredential)
{
name = servicePrincipalName;
impersonation_level = tokenImpersonationLevel;
- this.credential = credential;
+ this.credential = networkCredential;
}
string name;
public abstract SecurityTokenAuthenticator
CreateSecurityTokenAuthenticator (
- SecurityTokenRequirement requirement,
- out SecurityTokenResolver resolver);
+ SecurityTokenRequirement tokenRequirement,
+ out SecurityTokenResolver outOfBandTokenResolver);
public abstract SecurityTokenProvider
- CreateSecurityTokenProvider(SecurityTokenRequirement requirement);
+ CreateSecurityTokenProvider(SecurityTokenRequirement tokenRequirement);
public abstract SecurityTokenSerializer
CreateSecurityTokenSerializer (SecurityTokenVersion version);
EndCancelTokenCore (result);
}
- public SecurityToken RenewToken (TimeSpan timeout, SecurityToken token)
+ public SecurityToken RenewToken (TimeSpan timeout, SecurityToken tokenToBeRenewed)
{
- return RenewTokenCore (timeout, token);
+ return RenewTokenCore (timeout, tokenToBeRenewed);
}
public IAsyncResult BeginRenewToken (
- TimeSpan timeout, SecurityToken token,
+ TimeSpan timeout, SecurityToken tokenToBeRenewed,
AsyncCallback callback, object state)
{
- return BeginRenewTokenCore (timeout, token, callback, state);
+ return BeginRenewTokenCore (timeout, tokenToBeRenewed, callback, state);
}
public SecurityToken EndRenewToken (IAsyncResult result)
throw new NotSupportedException (String.Format ("Token cancellation on this security token provider '{0}' is not supported.", this));
}
- protected virtual SecurityToken RenewTokenCore (TimeSpan timeout, SecurityToken token)
+ protected virtual SecurityToken RenewTokenCore (TimeSpan timeout, SecurityToken tokenToBeRenewed)
{
throw new NotSupportedException (String.Format ("Token renewal on this security token provider '{0}' is not supported.", this));
}
protected virtual IAsyncResult BeginRenewTokenCore (
TimeSpan timeout,
- SecurityToken token,
+ SecurityToken tokenToBeRenewed,
AsyncCallback callback, object state)
{
throw new NotSupportedException (String.Format ("Token renewal on this security token provider '{0}' is not supported.", this));
}
}
- public TValue GetProperty<TValue> (string property)
+ public TValue GetProperty<TValue> (string propertyName)
{
TValue ret;
- if (TryGetProperty<TValue> (property, out ret))
+ if (TryGetProperty<TValue> (propertyName, out ret))
return ret;
- throw new ArgumentException (String.Format ("Property '{0}' was not found.", property));
+ throw new ArgumentException (String.Format ("Property '{0}' was not found.", propertyName));
}
- public bool TryGetProperty<TValue> (string property, out TValue value)
+ public bool TryGetProperty<TValue> (string propertyName, out TValue result)
{
object tmp;
- value = default (TValue);
+ result = default (TValue);
- if (!Properties.TryGetValue (property, out tmp))
+ if (!Properties.TryGetValue (propertyName, out tmp))
return false;
if (tmp == null && !typeof (TValue).IsValueType)
- value = default (TValue);
+ result = default (TValue);
else if (tmp is TValue)
- value = (TValue) tmp;
+ result = (TValue) tmp;
else
- throw new ArgumentException (String.Format ("The value of property '{0}' is of type '{1}', while '{2}' is expected.", property, tmp.GetType (), typeof (TValue)));
- return value != null;
+ throw new ArgumentException (String.Format ("The value of property '{0}' is of type '{1}', while '{2}' is expected.", propertyName, tmp.GetType (), typeof (TValue)));
+ return result != null;
}
}
}
return (byte []) GetRawBuffer ().Clone ();
}
- public override bool Matches (SecurityKeyIdentifierClause clause)
+ public override bool Matches (SecurityKeyIdentifierClause keyIdentifierClause)
{
BinaryKeyIdentifierClause other =
- clause as BinaryKeyIdentifierClause;
+ keyIdentifierClause as BinaryKeyIdentifierClause;
if (other == null)
return false;
return Matches (other.GetRawBuffer ());
-//
+//
// BootstrapContext.cs
//
// Author:
}
/// <summary>Initializes a new instance of the <see cref="BootstrapContext"/> class by using the specified security token and token handler.</summary>
- public BootstrapContext (SecurityToken token, SecurityTokenHandler handler)
+ public BootstrapContext (SecurityToken token, SecurityTokenHandler tokenHandler)
{
if (token == null)
throw new ArgumentNullException ("token");
- if (handler == null)
- throw new ArgumentNullException ("handler");
+ if (tokenHandler == null)
+ throw new ArgumentNullException ("tokenHandler");
SecurityToken = token;
- SecurityTokenHandler = handler;
+ SecurityTokenHandler = tokenHandler;
}
/// <summary>Initializes a new instance of the <see cref="BootstrapContext"/> class from a stream.</summary>
public EncryptedKeyIdentifierClause (
byte [] encryptedKey, string encryptionMethod,
- SecurityKeyIdentifier identifier)
- : this (encryptedKey, encryptionMethod, identifier, null)
+ SecurityKeyIdentifier encryptingKeyIdentifier)
+ : this (encryptedKey, encryptionMethod, encryptingKeyIdentifier, null)
{
}
public EncryptedKeyIdentifierClause (
byte [] encryptedKey, string encryptionMethod,
- SecurityKeyIdentifier identifier, string carriedKeyName)
- : this (encryptedKey, encryptionMethod, identifier, carriedKeyName, null, 0)
+ SecurityKeyIdentifier encryptingKeyIdentifier, string carriedKeyName)
+ : this (encryptedKey, encryptionMethod, encryptingKeyIdentifier, carriedKeyName, null, 0)
{
}
public EncryptedKeyIdentifierClause (
byte [] encryptedKey, string encryptionMethod,
- SecurityKeyIdentifier identifier, string carriedKeyName,
+ SecurityKeyIdentifier encryptingKeyIdentifier, string carriedKeyName,
byte [] derivationNonce, int derivationLength)
: base (encryptionMethod, encryptedKey, true, derivationNonce, derivationLength)
{
this.carried_key_name = carriedKeyName;
- this.identifier = identifier;
+ this.identifier = encryptingKeyIdentifier;
this.enc_method = encryptionMethod;
}
return true;
}
- public override bool Matches (SecurityKeyIdentifierClause clause)
+ public override bool Matches (SecurityKeyIdentifierClause keyIdentifierClause)
{
EncryptedKeyIdentifierClause e =
- clause as EncryptedKeyIdentifierClause;
+ keyIdentifierClause as EncryptedKeyIdentifierClause;
return e != null && Matches (e.GetRawBuffer (), e.EncryptionMethod, e.CarriedKeyName);
}
[MonoTODO]
public override bool MatchesKeyIdentifierClause (
- SecurityKeyIdentifierClause skiClause)
+ SecurityKeyIdentifierClause keyIdentifierClause)
{
throw new NotImplementedException ();
}
{
byte [] key;
- public InMemorySymmetricSecurityKey (byte [] key)
- : this (key, true)
+ public InMemorySymmetricSecurityKey (byte [] symmetricKey)
+ : this (symmetricKey, true)
{
}
- public InMemorySymmetricSecurityKey (byte [] key, bool clone)
+ public InMemorySymmetricSecurityKey (byte [] symmetricKey, bool cloneBuffer)
{
- if (key == null)
- throw new ArgumentNullException ("key");
- this.key = clone ? (byte []) key.Clone() : key;
+ if (symmetricKey == null)
+ throw new ArgumentNullException ("symmetricKey");
+ this.key = cloneBuffer ? (byte []) symmetricKey.Clone() : symmetricKey;
}
// SymmetricSecurityKey implementation
[MonoTODO]
public override bool MatchesKeyIdentifierClause (
- SecurityKeyIdentifierClause skiClause)
+ SecurityKeyIdentifierClause keyIdentifierClause)
{
throw new NotImplementedException ();
}
[MonoTODO]
public override bool MatchesKeyIdentifierClause (
- SecurityKeyIdentifierClause skiClause)
+ SecurityKeyIdentifierClause keyIdentifierClause)
{
throw new NotImplementedException ();
}
get { return owner_type; }
}
- public override bool Matches (SecurityKeyIdentifierClause clause)
+ public override bool Matches (SecurityKeyIdentifierClause keyIdentifierClause)
{
- if (clause == null)
- throw new ArgumentNullException ("clause");
+ if (keyIdentifierClause == null)
+ throw new ArgumentNullException ("keyIdentifierClause");
LocalIdKeyIdentifierClause c =
- clause as LocalIdKeyIdentifierClause;
+ keyIdentifierClause as LocalIdKeyIdentifierClause;
return c != null && Matches (c.LocalId, c.OwnerType);
}
throw new NotImplementedException ();
}
- public override bool Matches (SecurityKeyIdentifierClause clause)
+ public override bool Matches (SecurityKeyIdentifierClause keyIdentifierClause)
{
- if (clause == null)
- throw new ArgumentNullException ("clause");
+ if (keyIdentifierClause == null)
+ throw new ArgumentNullException ("keyIdentifierClause");
RsaKeyIdentifierClause rkic =
- clause as RsaKeyIdentifierClause;
+ keyIdentifierClause as RsaKeyIdentifierClause;
return rkic != null && Matches (rkic.Rsa);
}
[MonoTODO]
public override AsymmetricAlgorithm GetAsymmetricAlgorithm (
- string algorithm, bool privateKey)
+ string algorithm, bool requiresPrivateKey)
{
throw new NotImplementedException ();
}
[MonoTODO]
public override bool MatchesKeyIdentifierClause (
- SecurityKeyIdentifierClause skiClause)
+ SecurityKeyIdentifierClause keyIdentifierClause)
{
throw new NotImplementedException ();
}
public virtual void ReadXml (XmlDictionaryReader reader,
SamlSerializer samlSerializer,
- SecurityTokenSerializer keyInfoTokenSerializer,
+ SecurityTokenSerializer keyInfoSerializer,
SecurityTokenResolver outOfBandTokenResolver)
{
if (reader == null)
public virtual void WriteXml (XmlDictionaryWriter writer,
SamlSerializer samlSerializer,
- SecurityTokenSerializer keyInfoTokenSerializer)
+ SecurityTokenSerializer keyInfoSerializer)
{
if (writer == null)
throw new ArgumentNullException ("writer");
public virtual void ReadXml (XmlDictionaryReader reader,
SamlSerializer samlSerializer,
- SecurityTokenSerializer keyInfoTokenSerializer,
+ SecurityTokenSerializer keyInfoSerializer,
SecurityTokenResolver outOfBandTokenResolver)
{
if (reader == null)
switch (reader.LocalName) {
case "Assertion":
SamlAssertion a = new SamlAssertion ();
- a.ReadXml (reader, samlSerializer, keyInfoTokenSerializer, outOfBandTokenResolver);
+ a.ReadXml (reader, samlSerializer, keyInfoSerializer, outOfBandTokenResolver);
assertions.Add (a);
break;
case "AssertionIDReference":
public virtual void WriteXml (XmlDictionaryWriter writer,
SamlSerializer samlSerializer,
- SecurityTokenSerializer keyInfoTokenSerializer)
+ SecurityTokenSerializer keyInfoSerializer)
{
if (writer == null)
throw new ArgumentNullException ("writer");
foreach (string idref in AssertionIdReferences)
writer.WriteElementString ("saml", "AssertionIDReference", SamlConstants.Namespace, idref);
foreach (SamlAssertion assertion in Assertions)
- assertion.WriteXml (writer, samlSerializer, keyInfoTokenSerializer);
+ assertion.WriteXml (writer, samlSerializer, keyInfoSerializer);
writer.WriteEndElement ();
}
}
}
public SamlAssertion (string assertionId, string issuer,
- DateTime issueInstant, SamlConditions conditions,
- SamlAdvice advice, IEnumerable<SamlStatement> statements)
+ DateTime issueInstant, SamlConditions samlConditions,
+ SamlAdvice samlAdvice, IEnumerable<SamlStatement> samlStatements)
{
if (IsInvalidAssertionId (assertionId))
throw new ArgumentException (String.Format ("The assertionId '{0}' must be a valid XML NCName.", assertionId));
if (issuer == null || issuer.Length == 0)
throw new ArgumentException ("issuer");
- if (statements == null)
- throw new ArgumentNullException ("statements");
+ if (samlStatements == null)
+ throw new ArgumentNullException ("samlStatements");
major = 1;
minor = 1;
assertion_id = assertionId;
this.issuer = issuer;
issue_instant = issueInstant;
- this.conditions = conditions;
- this.advice = advice;
- foreach (SamlStatement s in statements) {
+ this.conditions = samlConditions;
+ this.advice = samlAdvice;
+ foreach (SamlStatement s in samlStatements) {
if (s == null)
throw new ArgumentException ("statements contain null item.");
this.statements.Add (s);
[MonoTODO]
public virtual void ReadXml (XmlDictionaryReader reader,
SamlSerializer samlSerializer,
- SecurityTokenSerializer keyInfoTokenSerializer,
+ SecurityTokenSerializer keyInfoSerializer,
SecurityTokenResolver outOfBandTokenResolver)
{
throw new NotImplementedException ();
public virtual void WriteXml (XmlDictionaryWriter writer,
SamlSerializer samlSerializer,
- SecurityTokenSerializer keyInfoTokenSerializer)
+ SecurityTokenSerializer keyInfoSerializer)
{
if (writer == null)
throw new ArgumentNullException ("writer");
try {
if (Conditions != null)
- Conditions.WriteXml (writer, samlSerializer, keyInfoTokenSerializer);
+ Conditions.WriteXml (writer, samlSerializer, keyInfoSerializer);
if (Advice != null)
- Advice.WriteXml (writer, samlSerializer, keyInfoTokenSerializer);
+ Advice.WriteXml (writer, samlSerializer, keyInfoSerializer);
foreach (SamlStatement statement in Statements)
- statement.WriteXml (writer, samlSerializer, keyInfoTokenSerializer);
+ statement.WriteXml (writer, samlSerializer, keyInfoSerializer);
} catch (NotImplementedException) {
throw;
} catch (Exception ex) { // bad catch, eh?
[MonoTODO]
protected void ReadSignature (XmlDictionaryReader reader,
- SecurityTokenSerializer keyInfoTokenSerializer,
+ SecurityTokenSerializer keyInfoSerializer,
SecurityTokenResolver outOfBandTokenResolver,
SamlSerializer samlSerializer)
{
}
[MonoTODO]
- public override bool Matches (SecurityKeyIdentifierClause clause)
+ public override bool Matches (SecurityKeyIdentifierClause keyIdentifierClause)
{
throw new NotImplementedException ();
}
[MonoTODO]
public virtual void ReadXml (XmlDictionaryReader reader,
SamlSerializer samlSerializer,
- SecurityTokenSerializer keyInfoTokenSerializer,
+ SecurityTokenSerializer keyInfoSerializer,
SecurityTokenResolver outOfBandTokenResolver)
{
throw new NotImplementedException ();
public virtual void WriteXml (XmlDictionaryWriter writer,
SamlSerializer samlSerializer,
- SecurityTokenSerializer keyInfoTokenSerializer)
+ SecurityTokenSerializer keyInfoSerializer)
{
writer.WriteStartElement ("saml", "Attribute", SamlConstants.Namespace);
writer.WriteAttributeString ("AttributeName", Name);
[MonoTODO]
public override void ReadXml (XmlDictionaryReader reader,
SamlSerializer samlSerializer,
- SecurityTokenSerializer keyInfoTokenSerializer,
+ SecurityTokenSerializer keyInfoSerializer,
SecurityTokenResolver outOfBandTokenResolver)
{
throw new NotImplementedException ();
public override void WriteXml (XmlDictionaryWriter writer,
SamlSerializer samlSerializer,
- SecurityTokenSerializer keyInfoTokenSerializer)
+ SecurityTokenSerializer keyInfoSerializer)
{
if (SamlSubject == null)
throw new SecurityTokenException ("Subject is null in the AttributeStatement");
writer.WriteStartElement ("saml", "AttributeStatement", SamlConstants.Namespace);
- SamlSubject.WriteXml (writer, samlSerializer, keyInfoTokenSerializer);
+ SamlSubject.WriteXml (writer, samlSerializer, keyInfoSerializer);
foreach (SamlAttribute a in Attributes)
- a.WriteXml (writer, samlSerializer, keyInfoTokenSerializer);
+ a.WriteXml (writer, samlSerializer, keyInfoSerializer);
writer.WriteEndElement ();
}
[MonoTODO]
public override void ReadXml (XmlDictionaryReader reader,
SamlSerializer samlSerializer,
- SecurityTokenSerializer keyInfoTokenSerializer,
+ SecurityTokenSerializer keyInfoSerializer,
SecurityTokenResolver outOfBandTokenResolver)
{
throw new NotImplementedException ();
public override void WriteXml (XmlDictionaryWriter writer,
SamlSerializer samlSerializer,
- SecurityTokenSerializer keyInfoTokenSerializer)
+ SecurityTokenSerializer keyInfoSerializer)
{
if (writer == null)
throw new ArgumentNullException ("writer");
writer.WriteAttributeString ("AuthenticationMethod", AuthenticationMethod);
writer.WriteAttributeString ("AuthenticationInstant",
AuthenticationInstant.ToString (SamlConstants.DateFormat, CultureInfo.InvariantCulture));
- SamlSubject.WriteXml (writer, samlSerializer, keyInfoTokenSerializer);
+ SamlSubject.WriteXml (writer, samlSerializer, keyInfoSerializer);
if (DnsAddress != null || IPAddress != null) {
writer.WriteStartElement ("saml", "SubjectLocality", SamlConstants.Namespace);
if (IPAddress != null)
{
}
- public SamlAuthorityBinding (XmlQualifiedName kind, string binding, string location)
+ public SamlAuthorityBinding (XmlQualifiedName authorityKind, string binding, string location)
{
- if (kind == null)
- throw new ArgumentNullException ("kind");
- AuthorityKind = kind;
+ if (authorityKind == null)
+ throw new ArgumentNullException ("authorityKind");
+ AuthorityKind = authorityKind;
Binding = binding;
Location = location;
}
public class SamlAuthorizationDecisionClaimResource
{
public SamlAuthorizationDecisionClaimResource (
- string resource, SamlAccessDecision decision, string actionName, string actionNamespace)
+ string resource, SamlAccessDecision accessDecision, string actionNamespace, string actionName)
{
this.resource = resource;
- this.decision = decision;
+ this.decision = accessDecision;
this.name = actionName;
this.ns = actionNamespace;
}
public override void ReadXml (XmlDictionaryReader reader,
SamlSerializer samlSerializer,
SecurityTokenSerializer keyInfoSerializer,
- SecurityTokenResolver resolver)
+ SecurityTokenResolver outOfBandTokenResolver)
{
if (reader == null)
throw new ArgumentNullException ("reader");
reader.MoveToContent ();
SamlSubject = new SamlSubject ();
- SamlSubject.ReadXml (reader, samlSerializer, keyInfoSerializer, resolver);
+ SamlSubject.ReadXml (reader, samlSerializer, keyInfoSerializer, outOfBandTokenResolver);
SamlActions.Clear ();
for (reader.MoveToContent ();
reader.LocalName == "Action" &&
reader.NamespaceURI == SamlConstants.Namespace;
reader.MoveToContent ()) {
SamlAction action = new SamlAction ();
- action.ReadXml (reader, samlSerializer, keyInfoSerializer, resolver);
+ action.ReadXml (reader, samlSerializer, keyInfoSerializer, outOfBandTokenResolver);
SamlActions.Add (action);
}
if (reader.LocalName == "Evidence" &&
reader.NamespaceURI == SamlConstants.Namespace) {
Evidence = new SamlEvidence ();
- Evidence.ReadXml (reader, samlSerializer, keyInfoSerializer, resolver);
+ Evidence.ReadXml (reader, samlSerializer, keyInfoSerializer, outOfBandTokenResolver);
reader.MoveToContent ();
}
reader.ReadEndElement ();
[MonoTODO]
public virtual void ReadXml (XmlDictionaryReader reader,
SamlSerializer samlSerializer,
- SecurityTokenSerializer keyInfoTokenSerializer,
+ SecurityTokenSerializer keyInfoSerializer,
SecurityTokenResolver outOfBandTokenResolver)
{
throw new NotImplementedException ();
public virtual void WriteXml (XmlDictionaryWriter writer,
SamlSerializer samlSerializer,
- SecurityTokenSerializer keyInfoTokenSerializer)
+ SecurityTokenSerializer keyInfoSerializer)
{
if (writer == null)
throw new ArgumentNullException ("writer");
if (has_not_on_after)
writer.WriteAttributeString ("NotOnOrAfter", NotOnOrAfter.ToString (SamlConstants.DateFormat, invariant));
foreach (SamlCondition cond in Conditions)
- cond.WriteXml (writer, samlSerializer, keyInfoTokenSerializer);
+ cond.WriteXml (writer, samlSerializer, keyInfoSerializer);
writer.WriteEndElement ();
}
}
public virtual void ReadXml (XmlDictionaryReader reader,
SamlSerializer samlSerializer,
SecurityTokenSerializer keyInfoSerializer,
- SecurityTokenResolver resolver)
+ SecurityTokenResolver outOfBandTokenResolver)
{
if (reader == null)
throw new ArgumentNullException ("reader");
switch (reader.LocalName) {
case "Assertion":
SamlAssertion a = new SamlAssertion ();
- a.ReadXml (reader, samlSerializer, keyInfoSerializer, resolver);
+ a.ReadXml (reader, samlSerializer, keyInfoSerializer, outOfBandTokenResolver);
assertions.Add (a);
break;
case "AssertionIDReference":
[MonoTODO]
public override bool MatchesKeyIdentifierClause (
- SecurityKeyIdentifierClause skiClause)
+ SecurityKeyIdentifierClause keyIdentifierClause)
{
throw new NotImplementedException ();
}
[MonoTODO]
public virtual SamlAdvice LoadAdvice (XmlDictionaryReader reader,
- SecurityTokenSerializer tokenSerializer,
- SecurityTokenResolver tokenResolver)
+ SecurityTokenSerializer keyInfoSerializer,
+ SecurityTokenResolver outOfBandTokenResolver)
{
throw new NotImplementedException ();
}
[MonoTODO]
public virtual SamlAssertion LoadAssertion (XmlDictionaryReader reader,
- SecurityTokenSerializer tokenSerializer,
- SecurityTokenResolver tokenResolver)
+ SecurityTokenSerializer keyInfoSerializer,
+ SecurityTokenResolver outOfBandTokenResolver)
{
throw new NotImplementedException ();
}
[MonoTODO]
public virtual SamlAttribute LoadAttribute (XmlDictionaryReader reader,
- SecurityTokenSerializer tokenSerializer,
- SecurityTokenResolver tokenResolver)
+ SecurityTokenSerializer keyInfoSerializer,
+ SecurityTokenResolver outOfBandTokenResolver)
{
throw new NotImplementedException ();
}
[MonoTODO]
public virtual SamlCondition LoadCondition (XmlDictionaryReader reader,
- SecurityTokenSerializer tokenSerializer,
- SecurityTokenResolver tokenResolver)
+ SecurityTokenSerializer keyInfoSerializer,
+ SecurityTokenResolver outOfBandTokenResolver)
{
throw new NotImplementedException ();
}
[MonoTODO]
public virtual SamlConditions LoadConditions (XmlDictionaryReader reader,
- SecurityTokenSerializer tokenSerializer,
- SecurityTokenResolver tokenResolver)
+ SecurityTokenSerializer keyInfoSerializer,
+ SecurityTokenResolver outOfBandTokenResolver)
{
throw new NotImplementedException ();
}
[MonoTODO]
public virtual SamlStatement LoadStatement (XmlDictionaryReader reader,
- SecurityTokenSerializer tokenSerializer,
- SecurityTokenResolver tokenResolver)
+ SecurityTokenSerializer keyInfoSerializer,
+ SecurityTokenResolver outOfBandTokenResolver)
{
throw new NotImplementedException ();
}
[MonoTODO]
public virtual SamlSecurityToken ReadToken (XmlReader reader,
- SecurityTokenSerializer tokenSerializer,
- SecurityTokenResolver tokenResolver)
+ SecurityTokenSerializer keyInfoSerializer,
+ SecurityTokenResolver outOfBandTokenResolver)
{
throw new NotImplementedException ();
}
public abstract void ReadXml (XmlDictionaryReader reader,
SamlSerializer samlSerializer,
- SecurityTokenSerializer keyInfoTokenSerializer,
+ SecurityTokenSerializer keyInfoSerializer,
SecurityTokenResolver outOfBandTokenResolver);
public abstract void WriteXml (XmlDictionaryWriter writer,
SamlSerializer samlSerializer,
- SecurityTokenSerializer keyInfoTokenSerializer);
+ SecurityTokenSerializer keyInfoSerializer);
}
}
public virtual void ReadXml (XmlDictionaryReader reader,
SamlSerializer samlSerializer,
- SecurityTokenSerializer keyInfoTokenSerializer,
+ SecurityTokenSerializer keyInfoSerializer,
SecurityTokenResolver outOfBandTokenResolver)
{
if (reader == null)
public virtual void WriteXml (XmlDictionaryWriter writer,
SamlSerializer samlSerializer,
- SecurityTokenSerializer keyInfoTokenSerializer)
+ SecurityTokenSerializer keyInfoSerializer)
{
if (writer == null)
throw new ArgumentNullException ("writer");
this.list = new List<SecurityKeyIdentifierClause> ();
}
- public SecurityKeyIdentifier (params SecurityKeyIdentifierClause [] identifiers)
+ public SecurityKeyIdentifier (params SecurityKeyIdentifierClause [] clauses)
{
- this.list = new List<SecurityKeyIdentifierClause> (identifiers);
+ this.list = new List<SecurityKeyIdentifierClause> (clauses);
}
List<SecurityKeyIdentifierClause> list;
get { return is_readonly; }
}
- public SecurityKeyIdentifierClause this [int i] {
- get { return list [i]; }
+ public SecurityKeyIdentifierClause this [int index] {
+ get { return list [index]; }
}
- public void Add (SecurityKeyIdentifierClause item)
+ public void Add (SecurityKeyIdentifierClause clause)
{
if (is_readonly)
throw new InvalidOperationException ("This SecurityKeyIdentifier is read-only.");
- list.Add (item);
+ list.Add (clause);
}
public SecurityKey CreateKey ()
return sb.ToString ();
}
- public bool TryFind<TClause> (out TClause result)
+ public bool TryFind<TClause> (out TClause clause)
where TClause : SecurityKeyIdentifierClause
{
- result = default (TClause);
+ clause = default (TClause);
foreach (SecurityKeyIdentifierClause kic in this)
if (typeof (TClause).IsAssignableFrom (kic.GetType ())) {
- result = (TClause) kic;
+ clause = (TClause) kic;
return true;
}
return false;
this.clause_type = clauseType;
}
- protected SecurityKeyIdentifierClause (string clauseType, byte [] derivationNonce, int derivationLength)
+ protected SecurityKeyIdentifierClause (string clauseType, byte [] nonce, int length)
{
this.clause_type = clauseType;
- if (derivationNonce != null)
- this.nonce = (byte []) derivationNonce.Clone ();
- this.deriv_length = derivationLength;
+ if (nonce != null)
+ this.nonce = (byte []) nonce.Clone ();
+ this.deriv_length = length;
}
string clause_type;
}
[MonoTODO]
- public virtual bool Matches (SecurityKeyIdentifierClause clause)
+ public virtual bool Matches (SecurityKeyIdentifierClause keyIdentifierClause)
{
throw new NotImplementedException ();
}
}
public virtual bool MatchesKeyIdentifierClause (
- SecurityKeyIdentifierClause skiClause)
+ SecurityKeyIdentifierClause keyIdentifierClause)
{
return false;
}
[MonoTODO]
public virtual SecurityKey ResolveKeyIdentifierClause (
- SecurityKeyIdentifierClause skiClause)
+ SecurityKeyIdentifierClause keyIdentifierClause)
{
- if (skiClause == null)
- throw new ArgumentNullException ("skiClause");
- if (!MatchesKeyIdentifierClause (skiClause))
- throw new InvalidOperationException (String.Format ("This '{0}' security token does not support resolving '{1}' key identifier clause.", GetType (), skiClause));
- if (skiClause.CanCreateKey)
- return skiClause.CreateKey ();
+ if (keyIdentifierClause == null)
+ throw new ArgumentNullException ("keyIdentifierClause");
+ if (!MatchesKeyIdentifierClause (keyIdentifierClause))
+ throw new InvalidOperationException (String.Format ("This '{0}' security token does not support resolving '{1}' key identifier clause.", GetType (), keyIdentifierClause));
+ if (keyIdentifierClause.CanCreateKey)
+ return keyIdentifierClause.CreateKey ();
// FIXME: examine it.
if (SecurityKeys.Count == 0)
- throw new InvalidOperationException (String.Format ("This '{0}' security token does not have any keys that can be resolved.", GetType (), skiClause));
+ throw new InvalidOperationException (String.Format ("This '{0}' security token does not have any keys that can be resolved.", GetType (), keyIdentifierClause));
return SecurityKeys [0];
}
}
public class SecurityTokenException : SystemException
{
public SecurityTokenException () : base () {}
- public SecurityTokenException (string msg) : base (msg) {}
- public SecurityTokenException (string msg, Exception inner) : base (msg, inner) {}
+ public SecurityTokenException (string message) : base (message) {}
+ public SecurityTokenException (string message, Exception innerException) : base (message, innerException) {}
protected SecurityTokenException (SerializationInfo info, StreamingContext context) :
base (info, context) {}
}
-//
+//
// SecurityTokenExpiredException.cs
//
// Author:
: base(message)
{ }
- public SecurityTokenExpiredException(string message, Exception innerException)
- : base(message, innerException)
+ public SecurityTokenExpiredException(string message, Exception inner)
+ : base(message, inner)
{ }
public SecurityTokenExpiredException(SerializationInfo info, StreamingContext context)
-//
+//
// SecurityTokenNotYetValidException.cs
//
// Author:
: base(message)
{ }
- public SecurityTokenNotYetValidException(string message, Exception innerException)
- : base(message, innerException)
+ public SecurityTokenNotYetValidException(string message, Exception inner)
+ : base(message, inner)
{ }
public SecurityTokenNotYetValidException(SerializationInfo info, StreamingContext context)
-//
+//
// SecurityTokenReplayDetectedException.cs
//
// Author:
: base(message)
{ }
- public SecurityTokenReplayDetectedException(string message, Exception innerException)
- : base(message, innerException)
+ public SecurityTokenReplayDetectedException(string message, Exception inner)
+ : base(message, inner)
{ }
public SecurityTokenReplayDetectedException(SerializationInfo info, StreamingContext context)
public class SecurityTokenValidationException : SecurityTokenException
{
public SecurityTokenValidationException () : base () {}
- public SecurityTokenValidationException (string msg) : base (msg) {}
- public SecurityTokenValidationException (string msg, Exception inner) : base (msg, inner) {}
+ public SecurityTokenValidationException (string message) : base (message) {}
+ public SecurityTokenValidationException (string message, Exception innerException) : base (message, innerException) {}
protected SecurityTokenValidationException (SerializationInfo info, StreamingContext context) :
base (info, context) {}
}
}
[MonoTODO]
- public WindowsSecurityToken (WindowsIdentity identity)
+ public WindowsSecurityToken (WindowsIdentity windowsIdentity)
{
throw new NotImplementedException ();
}
- public WindowsSecurityToken (WindowsIdentity identity, string id)
+ public WindowsSecurityToken (WindowsIdentity windowsIdentity, string id)
{
- this.identity = identity;
+ this.identity = windowsIdentity;
this.id = id;
}
get { return serial; }
}
- public override bool Matches (SecurityKeyIdentifierClause clause)
+ public override bool Matches (SecurityKeyIdentifierClause keyIdentifierClause)
{
X509IssuerSerialKeyIdentifierClause other =
- clause as X509IssuerSerialKeyIdentifierClause;
+ keyIdentifierClause as X509IssuerSerialKeyIdentifierClause;
return other != null && Matches (other.name, other.serial);
}
[MonoTODO]
public override bool MatchesKeyIdentifierClause (
- SecurityKeyIdentifierClause skiClause)
+ SecurityKeyIdentifierClause keyIdentifierClause)
{
LocalIdKeyIdentifierClause l =
- skiClause as LocalIdKeyIdentifierClause;
+ keyIdentifierClause as LocalIdKeyIdentifierClause;
if (l != null)
return l.LocalId == Id;
X509ThumbprintKeyIdentifierClause t =
- skiClause as X509ThumbprintKeyIdentifierClause;
+ keyIdentifierClause as X509ThumbprintKeyIdentifierClause;
if (t != null)
return t.Matches (cert);
X509IssuerSerialKeyIdentifierClause i =
- skiClause as X509IssuerSerialKeyIdentifierClause;
+ keyIdentifierClause as X509IssuerSerialKeyIdentifierClause;
if (i != null)
return i.Matches (cert);
X509SubjectKeyIdentifierClause s =
- skiClause as X509SubjectKeyIdentifierClause;
+ keyIdentifierClause as X509SubjectKeyIdentifierClause;
if (s != null)
return s.Matches (cert);
X509RawDataKeyIdentifierClause r =
- skiClause as X509RawDataKeyIdentifierClause;
+ keyIdentifierClause as X509RawDataKeyIdentifierClause;
if (r != null)
return r.Matches (cert);
public class X509SubjectKeyIdentifierClause : BinaryKeyIdentifierClause
{
[MonoTODO]
- public X509SubjectKeyIdentifierClause (byte [] certificateSubject)
- : base (null, certificateSubject, true)
+ public X509SubjectKeyIdentifierClause (byte [] ski)
+ : base (null, ski, true)
{
throw new NotImplementedException ();
}
}
[MonoTODO]
- public static bool TryCreateFrom (X509Certificate2 certificate, out X509SubjectKeyIdentifierClause clause)
+ public static bool TryCreateFrom (X509Certificate2 certificate, out X509SubjectKeyIdentifierClause keyIdentifierClause)
{
throw new NotImplementedException ();
}
{
public class X509ThumbprintKeyIdentifierClause : BinaryKeyIdentifierClause
{
- public X509ThumbprintKeyIdentifierClause (byte [] certificateThumbprint)
- : base (null, certificateThumbprint, true)
+ public X509ThumbprintKeyIdentifierClause (byte [] thumbprint)
+ : base (null, thumbprint, true)
{
}
public class X509WindowsSecurityToken : X509SecurityToken
{
[MonoTODO]
- public X509WindowsSecurityToken (X509Certificate2 cert, WindowsIdentity identity)
- : base (cert)
+ public X509WindowsSecurityToken (X509Certificate2 certificate, WindowsIdentity windowsIdentity)
+ : base (certificate)
{
throw new NotImplementedException ();
}
- public X509WindowsSecurityToken (X509Certificate2 cert, WindowsIdentity identity, string id)
- : base (cert, id)
+ public X509WindowsSecurityToken (X509Certificate2 certificate, WindowsIdentity windowsIdentity, string id)
+ : base (certificate, id)
{
- this.identity = identity;
+ this.identity = windowsIdentity;
}
WindowsIdentity identity;
-//
+//
// SignatureVerificationFailedException.cs
//
// Author:
: base(message)
{ }
- public SignatureVerificationFailedException(string message, Exception innerException)
- : base(message, innerException)
+ public SignatureVerificationFailedException(string message, Exception inner)
+ : base(message, inner)
{ }
public SignatureVerificationFailedException(SerializationInfo info, StreamingContext context)
throw new NotImplementedException ();
}
- public virtual void Add (string methodName, ManagementBaseObject inParams, ManagementBaseObject outParams)
+ public virtual void Add (string methodName, ManagementBaseObject inParameters, ManagementBaseObject outParameters)
{
throw new NotImplementedException ();
}
_info = new SignerInfoCollection ();
}
- public SignedCms (ContentInfo content)
- : this (content, false)
+ public SignedCms (ContentInfo contentInfo)
+ : this (contentInfo, false)
{
}
- public SignedCms (ContentInfo content, bool detached)
+ public SignedCms (ContentInfo contentInfo, bool detached)
: this ()
{
- if (content == null)
- throw new ArgumentNullException ("content");
+ if (contentInfo == null)
+ throw new ArgumentNullException ("contentInfo");
- _content = content;
+ _content = contentInfo;
_detached = detached;
}
_type = signerIdentifierType;
}
- public SignedCms (SubjectIdentifierType signerIdentifierType, ContentInfo content)
- : this (content, false)
+ public SignedCms (SubjectIdentifierType signerIdentifierType, ContentInfo contentInfo)
+ : this (contentInfo, false)
{
_type = signerIdentifierType;
}
- public SignedCms (SubjectIdentifierType signerIdentifierType, ContentInfo content, bool detached)
- : this (content, detached)
+ public SignedCms (SubjectIdentifierType signerIdentifierType, ContentInfo contentInfo, bool detached)
+ : this (contentInfo, detached)
{
_type = signerIdentifierType;
}
{
}
- public CipherReference (string uri, TransformChain tc)
- : base (uri, tc)
+ public CipherReference (string uri, TransformChain transformChain)
+ : base (uri, transformChain)
{
}
ReferenceType = XmlEncryption.ElementNames.DataReference;
}
- public DataReference (string uri, TransformChain tc)
- : base (uri, tc)
+ public DataReference (string uri, TransformChain transformChain)
+ : base (uri, transformChain)
{
ReferenceType = XmlEncryption.ElementNames.DataReference;
}
TransformChain = new TransformChain ();
}
- protected EncryptedReference (string uri, TransformChain tc)
+ protected EncryptedReference (string uri, TransformChain transformChain)
: this ()
{
Uri = uri;
- TransformChain = tc;
+ TransformChain = transformChain;
}
#endregion // Constructors
keyNameMapping.Clear ();
}
- public byte[] DecryptData (EncryptedData encryptedData, SymmetricAlgorithm symAlg)
+ public byte[] DecryptData (EncryptedData encryptedData, SymmetricAlgorithm symmetricAlgorithm)
{
if (encryptedData == null)
throw new ArgumentNullException ("encryptedData");
- if (symAlg == null)
- throw new ArgumentNullException ("symAlg");
+ if (symmetricAlgorithm == null)
+ throw new ArgumentNullException ("symmetricAlgorithm");
- PaddingMode bak = symAlg.Padding;
+ PaddingMode bak = symmetricAlgorithm.Padding;
try {
- symAlg.Padding = Padding;
- return Transform (encryptedData.CipherData.CipherValue, symAlg.CreateDecryptor (), symAlg.BlockSize / 8, true);
+ symmetricAlgorithm.Padding = Padding;
+ return Transform (encryptedData.CipherData.CipherValue, symmetricAlgorithm.CreateDecryptor (), symmetricAlgorithm.BlockSize / 8, true);
} finally {
- symAlg.Padding = bak;
+ symmetricAlgorithm.Padding = bak;
}
}
return DecryptKey (encryptedKey.CipherData.CipherValue, (SymmetricAlgorithm) keyAlg);
}
- public static byte[] DecryptKey (byte[] keyData, SymmetricAlgorithm symAlg)
+ public static byte[] DecryptKey (byte[] keyData, SymmetricAlgorithm symmetricAlgorithm)
{
if (keyData == null)
throw new ArgumentNullException ("keyData");
- if (symAlg == null)
- throw new ArgumentNullException ("symAlg");
+ if (symmetricAlgorithm == null)
+ throw new ArgumentNullException ("symmetricAlgorithm");
- if (symAlg is TripleDES)
- return SymmetricKeyWrap.TripleDESKeyWrapDecrypt (symAlg.Key, keyData);
- if (symAlg is Rijndael)
- return SymmetricKeyWrap.AESKeyWrapDecrypt (symAlg.Key, keyData);
+ if (symmetricAlgorithm is TripleDES)
+ return SymmetricKeyWrap.TripleDESKeyWrapDecrypt (symmetricAlgorithm.Key, keyData);
+ if (symmetricAlgorithm is Rijndael)
+ return SymmetricKeyWrap.AESKeyWrapDecrypt (symmetricAlgorithm.Key, keyData);
throw new CryptographicException ("The specified cryptographic transform is not supported.");
}
[MonoTODO ("Test this.")]
- public static byte[] DecryptKey (byte[] keyData, RSA rsa, bool fOAEP)
+ public static byte[] DecryptKey (byte[] keyData, RSA rsa, bool useOAEP)
{
AsymmetricKeyExchangeDeformatter deformatter = null;
- if (fOAEP)
+ if (useOAEP)
deformatter = new RSAOAEPKeyExchangeDeformatter (rsa);
else
deformatter = new RSAPKCS1KeyExchangeDeformatter (rsa);
throw new NotImplementedException ();
}
- public byte[] EncryptData (byte[] plainText, SymmetricAlgorithm symAlg)
+ public byte[] EncryptData (byte[] plaintext, SymmetricAlgorithm symmetricAlgorithm)
{
- if (plainText == null)
- throw new ArgumentNullException ("plainText");
- if (symAlg == null)
- throw new ArgumentNullException ("symAlg");
+ if (plaintext == null)
+ throw new ArgumentNullException ("plaintext");
+ if (symmetricAlgorithm == null)
+ throw new ArgumentNullException ("symmetricAlgorithm");
- PaddingMode bak = symAlg.Padding;
+ PaddingMode bak = symmetricAlgorithm.Padding;
try {
- symAlg.Padding = Padding;
- return EncryptDataCore (plainText, symAlg);
+ symmetricAlgorithm.Padding = Padding;
+ return EncryptDataCore (plaintext, symmetricAlgorithm);
} finally {
- symAlg.Padding = bak;
+ symmetricAlgorithm.Padding = bak;
}
}
return output;
}
- public byte[] EncryptData (XmlElement inputElement, SymmetricAlgorithm symAlg, bool content)
+ public byte[] EncryptData (XmlElement inputElement, SymmetricAlgorithm symmetricAlgorithm, bool content)
{
if (inputElement == null)
throw new ArgumentNullException ("inputElement");
if (content)
- return EncryptData (Encoding.GetBytes (inputElement.InnerXml), symAlg);
+ return EncryptData (Encoding.GetBytes (inputElement.InnerXml), symmetricAlgorithm);
else
- return EncryptData (Encoding.GetBytes (inputElement.OuterXml), symAlg);
+ return EncryptData (Encoding.GetBytes (inputElement.OuterXml), symmetricAlgorithm);
}
- public static byte[] EncryptKey (byte[] keyData, SymmetricAlgorithm symAlg)
+ public static byte[] EncryptKey (byte[] keyData, SymmetricAlgorithm symmetricAlgorithm)
{
if (keyData == null)
throw new ArgumentNullException ("keyData");
- if (symAlg == null)
- throw new ArgumentNullException ("symAlg");
+ if (symmetricAlgorithm == null)
+ throw new ArgumentNullException ("symmetricAlgorithm");
- if (symAlg is TripleDES)
- return SymmetricKeyWrap.TripleDESKeyWrapEncrypt (symAlg.Key, keyData);
- if (symAlg is Rijndael)
- return SymmetricKeyWrap.AESKeyWrapEncrypt (symAlg.Key, keyData);
+ if (symmetricAlgorithm is TripleDES)
+ return SymmetricKeyWrap.TripleDESKeyWrapEncrypt (symmetricAlgorithm.Key, keyData);
+ if (symmetricAlgorithm is Rijndael)
+ return SymmetricKeyWrap.AESKeyWrapEncrypt (symmetricAlgorithm.Key, keyData);
throw new CryptographicException ("The specified cryptographic transform is not supported.");
}
[MonoTODO ("Test this.")]
- public static byte[] EncryptKey (byte[] keyData, RSA rsa, bool fOAEP)
+ public static byte[] EncryptKey (byte[] keyData, RSA rsa, bool useOAEP)
{
AsymmetricKeyExchangeFormatter formatter = null;
- if (fOAEP)
+ if (useOAEP)
formatter = new RSAOAEPKeyExchangeFormatter (rsa);
else
formatter = new RSAPKCS1KeyExchangeFormatter (rsa);
throw new ArgumentException ("keyAlg");
}
- public virtual byte[] GetDecryptionIV (EncryptedData encryptedData, string symAlgUri)
+ public virtual byte[] GetDecryptionIV (EncryptedData encryptedData, string symmetricAlgorithmUri)
{
if (encryptedData == null)
throw new ArgumentNullException ("encryptedData");
- SymmetricAlgorithm symAlg = GetAlgorithm (symAlgUri);
+ SymmetricAlgorithm symAlg = GetAlgorithm (symmetricAlgorithmUri);
byte[] iv = new Byte [symAlg.BlockSize / 8];
Buffer.BlockCopy (encryptedData.CipherData.CipherValue, 0, iv, 0, iv.Length);
return iv;
}
- public virtual SymmetricAlgorithm GetDecryptionKey (EncryptedData encryptedData, string symAlgUri)
+ public virtual SymmetricAlgorithm GetDecryptionKey (EncryptedData encryptedData, string symmetricAlgorithmUri)
{
if (encryptedData == null)
throw new ArgumentNullException ("encryptedData");
- if (symAlgUri == null)
+ if (symmetricAlgorithmUri == null)
return null;
- SymmetricAlgorithm symAlg = GetAlgorithm (symAlgUri);
+ SymmetricAlgorithm symAlg = GetAlgorithm (symmetricAlgorithmUri);
symAlg.IV = GetDecryptionIV (encryptedData, encryptedData.EncryptionMethod.KeyAlgorithm);
KeyInfo keyInfo = encryptedData.KeyInfo;
foreach (KeyInfoClause clause in keyInfo) {
KeyAlgorithm = null;
}
- public EncryptionMethod (string strAlgorithm)
+ public EncryptionMethod (string algorithm)
{
- KeyAlgorithm = strAlgorithm;
+ KeyAlgorithm = algorithm;
}
#endregion // Constructors
{
}
- public EncryptionProperty (XmlElement elemProp)
+ public EncryptionProperty (XmlElement elementProperty)
{
- LoadXml (elemProp);
+ LoadXml (elementProperty);
}
#endregion // Constructors
{
}
- public KeyInfoEncryptedKey (EncryptedKey ek)
+ public KeyInfoEncryptedKey (EncryptedKey encryptedKey)
{
- EncryptedKey = ek;
+ EncryptedKey = encryptedKey;
}
#endregion // Constructors
URI = strUri;
}
- public KeyInfoRetrievalMethod (string strUri, string strType)
+ public KeyInfoRetrievalMethod (string strUri, string typeName)
: this (strUri)
{
- Type = strType;
+ Type = typeName;
}
[ComVisible (false)]
ReferenceType = XmlEncryption.ElementNames.KeyReference;
}
- public KeyReference (string uri, TransformChain tc)
- : base (uri, tc)
+ public KeyReference (string uri, TransformChain transformChain)
+ : base (uri, transformChain)
{
ReferenceType = XmlEncryption.ElementNames.KeyReference;
}
_flags = DataProtectionPermissionFlags.AllFlags;
}
- public DataProtectionPermission (DataProtectionPermissionFlags flags)
+ public DataProtectionPermission (DataProtectionPermissionFlags flag)
{
// reuse validation by the Flags property
- Flags = flags;
+ Flags = flag;
}
return ((_flags & ~dp._flags) == 0);
}
- public override void FromXml (SecurityElement e)
+ public override void FromXml (SecurityElement securityElement)
{
// General validation in CodeAccessPermission
- PermissionHelper.CheckSecurityElement (e, "e", version, version);
+ PermissionHelper.CheckSecurityElement (securityElement, "securityElement", version, version);
// Note: we do not (yet) care about the return value
// as we only accept version 1 (min/max values)
_flags = (DataProtectionPermissionFlags) Enum.Parse (
- typeof (DataProtectionPermissionFlags), e.Attribute ("Flags"));
+ typeof (DataProtectionPermissionFlags), securityElement.Attribute ("Flags"));
}
public override SecurityElement ToXml ()
// It seems to do nothing.
}
- protected override void OnInitializeAndValidate (ServiceEndpointElement channelEndpointElement)
+ protected override void OnInitializeAndValidate (ServiceEndpointElement serviceEndpointElement)
{
// It seems to do nothing.
}
base.OnInitializeAndValidate (channelEndpointElement);
}
- protected override void OnInitializeAndValidate (ServiceEndpointElement channelEndpointElement)
+ protected override void OnInitializeAndValidate (ServiceEndpointElement serviceEndpointElement)
{
// It seems to do nothing.
- base.OnInitializeAndValidate (channelEndpointElement);
+ base.OnInitializeAndValidate (serviceEndpointElement);
}
}
}
base.OnInitializeAndValidate (channelEndpointElement);
}
- protected override void OnInitializeAndValidate (ServiceEndpointElement channelEndpointElement)
+ protected override void OnInitializeAndValidate (ServiceEndpointElement serviceEndpointElement)
{
// It seems to do nothing.
- base.OnInitializeAndValidate (channelEndpointElement);
+ base.OnInitializeAndValidate (serviceEndpointElement);
}
}
}
{
}
- public Atom10ItemFormatter (SyndicationItem feedToWrite)
- : base (feedToWrite)
+ public Atom10ItemFormatter (SyndicationItem itemToWrite)
+ : base (itemToWrite)
{
}
return new XmlSyndicationContent (null, xmlSerializerObject, serializer);
}
- public static XmlSyndicationContent CreateXmlContent (XmlReader reader)
+ public static XmlSyndicationContent CreateXmlContent (XmlReader xmlReader)
{
- return new XmlSyndicationContent (reader);
+ return new XmlSyndicationContent (xmlReader);
}
#endregion
{
}
- public SyndicationItem (string title, string content, Uri feedAlternateLink)
- : this (title, content, feedAlternateLink, null, default (DateTimeOffset))
+ public SyndicationItem (string title, string content, Uri itemAlternateLink)
+ : this (title, content, itemAlternateLink, null, default (DateTimeOffset))
{
}
- public SyndicationItem (string title, string content, Uri feedAlternateLink, string id,
+ public SyndicationItem (string title, string content, Uri itemAlternateLink, string id,
DateTimeOffset lastUpdatedTime)
- : this (title, content != null ? SyndicationContent.CreatePlaintextContent (content) : null, feedAlternateLink, id, lastUpdatedTime)
+ : this (title, content != null ? SyndicationContent.CreatePlaintextContent (content) : null, itemAlternateLink, id, lastUpdatedTime)
{
}
- public SyndicationItem (string title, SyndicationContent content, Uri feedAlternateLink, string id,
+ public SyndicationItem (string title, SyndicationContent content, Uri itemAlternateLink, string id,
DateTimeOffset lastUpdatedTime)
{
Title = title != null ? new TextSyndicationContent (title) : null;
Content = content;
- if (feedAlternateLink != null)
- AddPermalink (feedAlternateLink);
+ if (itemAlternateLink != null)
+ AddPermalink (itemAlternateLink);
Id = id;
LastUpdatedTime = lastUpdatedTime;
}
set { title = value; }
}
- public void AddPermalink (Uri link)
+ public void AddPermalink (Uri permalink)
{
- if (link == null)
- throw new ArgumentNullException ("link");
- Links.Add (SyndicationLink.CreateAlternateLink (link));
+ if (permalink == null)
+ throw new ArgumentNullException ("permalink");
+ Links.Add (SyndicationLink.CreateAlternateLink (permalink));
}
public virtual SyndicationItem Clone ()
return extension.GetObject<TContent> ();
}
- public TContent ReadContent<TContent> (XmlObjectSerializer serializer)
+ public TContent ReadContent<TContent> (XmlObjectSerializer dataContractSerializer)
{
- return extension.GetObject<TContent> (serializer);
+ return extension.GetObject<TContent> (dataContractSerializer);
}
public TContent ReadContent<TContent> (XmlSerializer serializer)
}
#endif
- public WebChannelFactory(Type serviceType)
- : base (serviceType)
+ public WebChannelFactory(Type channelType)
+ : base (channelType)
{
}
- public WebChannelFactory (string configurationName)
- : base (configurationName)
+ public WebChannelFactory (string endpointConfigurationName)
+ : base (endpointConfigurationName)
{
}
OutgoingWebRequestContext outgoing_request;
OutgoingWebResponseContext outgoing_response;
- public WebOperationContext (OperationContext operation)
+ public WebOperationContext (OperationContext operationContext)
{
- if (operation == null)
- throw new ArgumentNullException ("operation");
+ if (operationContext == null)
+ throw new ArgumentNullException ("operationContext");
outgoing_request = new OutgoingWebRequestContext ();
- incoming_response = new IncomingWebResponseContext (operation);
+ incoming_response = new IncomingWebResponseContext (operationContext);
#if !MOBILE
- incoming_request = new IncomingWebRequestContext (operation);
+ incoming_request = new IncomingWebRequestContext (operationContext);
outgoing_response = new OutgoingWebResponseContext ();
#endif
}
}
#endif
- public void Attach (OperationContext context)
+ public void Attach (OperationContext owner)
{
// do nothing
}
- public void Detach (OperationContext context)
+ public void Detach (OperationContext owner)
{
// do nothing
}
{
}
- public WebHttpBinding (WebHttpSecurityMode mode)
+ public WebHttpBinding (WebHttpSecurityMode securityMode)
{
- Initialize (mode);
+ Initialize (securityMode);
}
public WebHttpBinding (string configurationName)
public class UriTemplateMatchException : SystemException
{
public UriTemplateMatchException () : base () {}
- public UriTemplateMatchException (string msg) : base (msg) {}
- public UriTemplateMatchException (string msg, Exception inner) : base (msg, inner) {}
+ public UriTemplateMatchException (string message) : base (message) {}
+ public UriTemplateMatchException (string message, Exception innerException) : base (message, innerException) {}
protected UriTemplateMatchException (SerializationInfo info, StreamingContext context) :
base (info, context) {}
}
return list;
}
- protected override void InsertItem (int index, TItem kind)
+ protected override void InsertItem (int index, TItem item)
{
- base.InsertItem (index, kind);
+ base.InsertItem (index, item);
}
- protected override void SetItem (int index, TItem kind)
+ protected override void SetItem (int index, TItem item)
{
- base.SetItem (index, kind);
+ base.SetItem (index, item);
}
public T Remove<T> ()
}
protected SynchronizedKeyedCollection (object syncRoot,
- IEqualityComparer<K> comparer, int capacity)
+ IEqualityComparer<K> comparer, int dictionaryCreationThreshold)
: base (syncRoot)
{
- dict = new Dictionary<K, T> (capacity, comparer);
+ dict = new Dictionary<K, T> (dictionaryCreationThreshold, comparer);
}
// see bug #76417
{
}
- public SynchronizedReadOnlyCollection (object sync_root)
- : this (sync_root, new List<T> ())
+ public SynchronizedReadOnlyCollection (object syncRoot)
+ : this (syncRoot, new List<T> ())
{
}
- public SynchronizedReadOnlyCollection (object sync_root, IEnumerable<T> list)
+ public SynchronizedReadOnlyCollection (object syncRoot, IEnumerable<T> list)
{
- if (sync_root == null)
- throw new ArgumentNullException ("sync_root");
+ if (syncRoot == null)
+ throw new ArgumentNullException ("syncRoot");
if (list == null)
throw new ArgumentNullException ("list");
- this.sync_root = sync_root;
+ this.sync_root = syncRoot;
this.l = new List<T> (list);
}
- public SynchronizedReadOnlyCollection (object sync_root, params T [] list)
- : this (sync_root, (IEnumerable<T>) list)
+ public SynchronizedReadOnlyCollection (object syncRoot, params T [] list)
+ : this (syncRoot, (IEnumerable<T>) list)
{
}
public virtual IChannelListener<TChannel>
BuildChannelListener<TChannel> (
- Uri listenUri,
+ Uri listenUriBaseAddress,
params object [] parameters)
where TChannel : class, IChannel
{
new BindingParameterCollection ();
foreach (object o in parameters)
pl.Add (o);
- return BuildChannelListener<TChannel> (listenUri, pl);
+ return BuildChannelListener<TChannel> (listenUriBaseAddress, pl);
}
public virtual IChannelListener<TChannel>
BuildChannelListener<TChannel> (
- Uri listenUri,
+ Uri listenUriBaseAddress,
BindingParameterCollection parameters)
where TChannel : class, IChannel
{
- return BuildChannelListener<TChannel> (listenUri,
+ return BuildChannelListener<TChannel> (listenUriBaseAddress,
String.Empty, parameters);
}
}
public IAsyncResult BeginAcceptChannel (
- AsyncCallback callback, object asyncState)
+ AsyncCallback callback, object state)
{
return BeginAcceptChannel (
- timeouts.ReceiveTimeout, callback, asyncState);
+ timeouts.ReceiveTimeout, callback, state);
}
public IAsyncResult BeginAcceptChannel (TimeSpan timeout,
- AsyncCallback callback, object asyncState)
+ AsyncCallback callback, object state)
{
- return OnBeginAcceptChannel (timeout, callback, asyncState);
+ return OnBeginAcceptChannel (timeout, callback, state);
}
public TChannel EndAcceptChannel (IAsyncResult result)
protected abstract TChannel OnAcceptChannel (TimeSpan timeout);
protected abstract IAsyncResult OnBeginAcceptChannel (TimeSpan timeout,
- AsyncCallback callback, object asyncState);
+ AsyncCallback callback, object state);
protected abstract TChannel OnEndAcceptChannel (IAsyncResult result);
}
ISecurityCapabilities security;
string scheme = "";
- public CustomBinding (string name)
- : this (name, default_ns)
+ public CustomBinding (string configurationName)
+ : this (configurationName, default_ns)
{
}
// 1)
public static Message CreateMessage (MessageVersion version,
- FaultCode code, string reason, string action)
+ FaultCode faultCode, string reason, string action)
{
- MessageFault fault = MessageFault.CreateFault (code, reason);
+ MessageFault fault = MessageFault.CreateFault (faultCode, reason);
return CreateMessage (version, fault, action);
}
// 2)
public static Message CreateMessage (MessageVersion version,
- FaultCode code, string reason, object detail,
+ FaultCode faultCode, string reason, object detail,
string action)
{
MessageFault fault = MessageFault.CreateFault (
- code, new FaultReason (reason), detail);
+ faultCode, new FaultReason (reason), detail);
return CreateMessage (version, fault, action);
}
return CreateNavigator (XmlSpace.Default);
}
- public XPathNavigator CreateNavigator (int node_quota)
+ public XPathNavigator CreateNavigator (int nodeQuota)
{
- return CreateNavigator (node_quota, XmlSpace.Default);
+ return CreateNavigator (nodeQuota, XmlSpace.Default);
}
[MonoTODO ("supply proper quota")]
}
[MonoTODO ("Handle node_quota and xmlspace")]
- public XPathNavigator CreateNavigator (int node_quota, XmlSpace space)
+ public XPathNavigator CreateNavigator (int nodeQuota, XmlSpace space)
{
if (nav_cache == null) {
- DTMXPathDocumentWriter2 pw = new DTMXPathDocumentWriter2 (new NameTable (), node_quota);
+ DTMXPathDocumentWriter2 pw = new DTMXPathDocumentWriter2 (new NameTable (), nodeQuota);
XmlDictionaryWriter w = XmlDictionaryWriter.CreateDictionaryWriter (pw);
CreateMessage ().WriteMessage (w);
nav_cache = pw.CreateDocument ().CreateNavigator ();
public static MessageFault CreateFault (FaultCode code,
FaultReason reason, object detail,
- XmlObjectSerializer formatter)
+ XmlObjectSerializer serializer)
{
return new SimpleMessageFault (code, reason, true,
- detail, formatter, String.Empty, String.Empty);
+ detail, serializer, String.Empty, String.Empty);
}
public static MessageFault CreateFault (FaultCode code,
FaultReason reason, object detail,
- XmlObjectSerializer formatter, string actor)
+ XmlObjectSerializer serializer, string actor)
{
return new SimpleMessageFault (code, reason,
- true, detail, formatter, actor, String.Empty);
+ true, detail, serializer, actor, String.Empty);
}
public static MessageFault CreateFault (FaultCode code,
FaultReason reason, object detail,
- XmlObjectSerializer formatter, string actor, string node)
+ XmlObjectSerializer serializer, string actor, string node)
{
return new SimpleMessageFault (code, reason,
- true, detail, formatter, actor, node);
+ true, detail, serializer, actor, node);
}
// pretty simple implementation class
new Dictionary<Type, XmlObjectSerializer> ();
MessageVersion version;
- public MessageHeaders (MessageHeaders headers)
- : this (headers.MessageVersion)
+ public MessageHeaders (MessageHeaders collection)
+ : this (collection.MessageVersion)
{
- CopyHeadersFrom (headers);
+ CopyHeadersFrom (collection);
}
public MessageHeaders (MessageVersion version)
{
}
- public MessageHeaders (MessageVersion version, int capacity)
+ public MessageHeaders (MessageVersion version, int initialSize)
{
this.version = version;
- l = new List<MessageHeaderInfo> (capacity);
+ l = new List<MessageHeaderInfo> (initialSize);
}
public void Add (MessageHeader header)
}
public MtomMessageEncodingBindingElement (
- MessageVersion version, Encoding encoding)
+ MessageVersion messageVersion, Encoding writeEncoding)
{
- this.version = version;
- this.encoding = encoding;
+ this.version = messageVersion;
+ this.encoding = writeEncoding;
}
public int MaxBufferSize {
}
protected NamedPipeTransportBindingElement (
- NamedPipeTransportBindingElement other)
- : base (other)
+ NamedPipeTransportBindingElement elementToBeCloned)
+ : base (elementToBeCloned)
{
- pool.CopyPropertiesFrom (other.pool);
+ pool.CopyPropertiesFrom (elementToBeCloned.pool);
}
NamedPipeConnectionPoolSettings pool = new NamedPipeConnectionPoolSettings ();
{
}
- protected StreamUpgradeBindingElement (StreamUpgradeBindingElement other)
+ protected StreamUpgradeBindingElement (StreamUpgradeBindingElement elementToBeCloned)
{
}
{
}
- public TransactionFlowBindingElement (TransactionProtocol protocol)
+ public TransactionFlowBindingElement (TransactionProtocol transactionProtocol)
{
- this.protocol = protocol;
+ this.protocol = transactionProtocol;
}
public TransactionProtocol TransactionProtocol {
{
headers = new List<MessageHeaderInfo> ();
}
- public void Add (MessageHeaderInfo header)
+ public void Add (MessageHeaderInfo headerInfo)
{
- headers.Add (header);
+ headers.Add (headerInfo);
}
- public bool Contains (MessageHeaderInfo header)
+ public bool Contains (MessageHeaderInfo headerInfo)
{
- return headers.Contains (header);
+ return headers.Contains (headerInfo);
}
public IEnumerator<MessageHeaderInfo> GetEnumerator ()
return headers.GetEnumerator ();
}
- public void Remove (MessageHeaderInfo header)
+ public void Remove (MessageHeaderInfo headerInfo)
{
- headers.Remove (header);
+ headers.Remove (headerInfo);
}
IEnumerator IEnumerable.GetEnumerator ()
return new BinaryMessageEncodingBindingElement ();
}
- public override void ApplyConfiguration (BindingElement element)
+ public override void ApplyConfiguration (BindingElement bindingElement)
{
- var b = (BinaryMessageEncodingBindingElement) element;
+ var b = (BinaryMessageEncodingBindingElement) bindingElement;
b.MaxReadPoolSize = MaxReadPoolSize;
b.MaxSessionSize = MaxSessionSize;
b.MaxWritePoolSize = MaxWritePoolSize;
ReaderQuotas.ApplyConfiguration (b.ReaderQuotas);
}
- public override void CopyFrom (ServiceModelExtensionElement element)
+ public override void CopyFrom (ServiceModelExtensionElement from)
{
- var b = (BinaryMessageEncodingElement) element;
+ var b = (BinaryMessageEncodingElement) from;
MaxReadPoolSize = b.MaxReadPoolSize;
MaxSessionSize = b.MaxSessionSize;
MaxWritePoolSize = b.MaxWritePoolSize;
ReaderQuotas.CopyFrom (b.ReaderQuotas);
}
- protected internal override void InitializeFrom (BindingElement element)
+ protected internal override void InitializeFrom (BindingElement bindingElement)
{
- var b = (BinaryMessageEncodingBindingElement) element;
+ var b = (BinaryMessageEncodingBindingElement) bindingElement;
MaxReadPoolSize = b.MaxReadPoolSize;
MaxSessionSize = b.MaxSessionSize;
MaxWritePoolSize = b.MaxWritePoolSize;
return sm.Bindings;
}
- public new BindingCollectionElement this [string name] {
+ public new BindingCollectionElement this [string binding] {
get {
- object element = base [name];
+ object element = base [binding];
if (element is BindingCollectionElement)
return (BindingCollectionElement) element;
- throw new NotImplementedException (String.Format ("Could not find {0}", name));
+ throw new NotImplementedException (String.Format ("Could not find {0}", binding));
}
}
return cb;
}
- protected internal void ApplyConfiguration (ClientCredentials cb)
+ protected internal void ApplyConfiguration (ClientCredentials behavior)
{
- cb.SupportInteractive = SupportInteractive;
+ behavior.SupportInteractive = SupportInteractive;
// how is "Type" used?
// ClientCertificate
if (!String.IsNullOrEmpty (ClientCertificate.FindValue))
- cb.ClientCertificate.SetCertificate (ClientCertificate.StoreLocation, ClientCertificate.StoreName, ClientCertificate.X509FindType, ClientCertificate.FindValue);
+ behavior.ClientCertificate.SetCertificate (ClientCertificate.StoreLocation, ClientCertificate.StoreName, ClientCertificate.X509FindType, ClientCertificate.FindValue);
// HttpDigest
if (HttpDigest.ImpersonationLevel != TokenImpersonationLevel.None)
throw new NotImplementedException ();
// IssuedToken
- var bi = cb.IssuedToken;
+ var bi = behavior.IssuedToken;
var ci = IssuedToken;
bi.CacheIssuedTokens = ci.CacheIssuedTokens;
bi.DefaultKeyEntropyMode = ci.DefaultKeyEntropyMode;
// Peer
if (!String.IsNullOrEmpty (Peer.Certificate.FindValue))
- cb.Peer.SetCertificate (Peer.Certificate.StoreLocation, Peer.Certificate.StoreName, Peer.Certificate.X509FindType, Peer.Certificate.FindValue);
+ behavior.Peer.SetCertificate (Peer.Certificate.StoreLocation, Peer.Certificate.StoreName, Peer.Certificate.X509FindType, Peer.Certificate.FindValue);
// cb.Peer.MeshPassword = /* cannot fill it here */
- cb.Peer.MessageSenderAuthentication.CustomCertificateValidator = (X509CertificateValidator) CreateInstance (Peer.MessageSenderAuthentication.CustomCertificateValidatorType);
- cb.Peer.MessageSenderAuthentication.CertificateValidationMode = Peer.MessageSenderAuthentication.CertificateValidationMode;
- cb.Peer.MessageSenderAuthentication.RevocationMode = Peer.MessageSenderAuthentication.RevocationMode;
- cb.Peer.MessageSenderAuthentication.TrustedStoreLocation = Peer.MessageSenderAuthentication.TrustedStoreLocation;
- cb.Peer.PeerAuthentication.CustomCertificateValidator = (X509CertificateValidator) CreateInstance (Peer.PeerAuthentication.CustomCertificateValidatorType);
- cb.Peer.PeerAuthentication.CertificateValidationMode = Peer.PeerAuthentication.CertificateValidationMode;
- cb.Peer.PeerAuthentication.RevocationMode = Peer.PeerAuthentication.RevocationMode;
- cb.Peer.PeerAuthentication.TrustedStoreLocation = Peer.PeerAuthentication.TrustedStoreLocation;
+ behavior.Peer.MessageSenderAuthentication.CustomCertificateValidator = (X509CertificateValidator) CreateInstance (Peer.MessageSenderAuthentication.CustomCertificateValidatorType);
+ behavior.Peer.MessageSenderAuthentication.CertificateValidationMode = Peer.MessageSenderAuthentication.CertificateValidationMode;
+ behavior.Peer.MessageSenderAuthentication.RevocationMode = Peer.MessageSenderAuthentication.RevocationMode;
+ behavior.Peer.MessageSenderAuthentication.TrustedStoreLocation = Peer.MessageSenderAuthentication.TrustedStoreLocation;
+ behavior.Peer.PeerAuthentication.CustomCertificateValidator = (X509CertificateValidator) CreateInstance (Peer.PeerAuthentication.CustomCertificateValidatorType);
+ behavior.Peer.PeerAuthentication.CertificateValidationMode = Peer.PeerAuthentication.CertificateValidationMode;
+ behavior.Peer.PeerAuthentication.RevocationMode = Peer.PeerAuthentication.RevocationMode;
+ behavior.Peer.PeerAuthentication.TrustedStoreLocation = Peer.PeerAuthentication.TrustedStoreLocation;
// ServiceCertificate
- var bsc = cb.ServiceCertificate;
+ var bsc = behavior.ServiceCertificate;
var csc = ServiceCertificate;
var bsca = bsc.Authentication;
var csca = csc.Authentication;
// cb.UserNamePassword : not configurable ...
// Windows
- cb.Windows.AllowedImpersonationLevel = Windows.AllowedImpersonationLevel;
- cb.Windows.AllowNtlm = Windows.AllowNtlm;
+ behavior.Windows.AllowedImpersonationLevel = Windows.AllowedImpersonationLevel;
+ behavior.Windows.AllowNtlm = Windows.AllowNtlm;
}
object CreateInstance (string typeName)
return new ReliableSessionBindingElement ();
}
- public override void ApplyConfiguration (BindingElement element)
+ public override void ApplyConfiguration (BindingElement bindingElement)
{
- var b = (ReliableSessionBindingElement) element;
+ var b = (ReliableSessionBindingElement) bindingElement;
b.AcknowledgementInterval = AcknowledgementInterval;
b.FlowControlEnabled = FlowControlEnabled;
b.InactivityTimeout = InactivityTimeout;
b.ReliableMessagingVersion = ReliableMessagingVersion;
}
- public override void CopyFrom (ServiceModelExtensionElement element)
+ public override void CopyFrom (ServiceModelExtensionElement from)
{
- var b = (ReliableSessionElement) element;
+ var b = (ReliableSessionElement) from;
AcknowledgementInterval = b.AcknowledgementInterval;
FlowControlEnabled = b.FlowControlEnabled;
InactivityTimeout = b.InactivityTimeout;
ReliableMessagingVersion = b.ReliableMessagingVersion;
}
- protected internal override void InitializeFrom (BindingElement element)
+ protected internal override void InitializeFrom (BindingElement bindingElement)
{
- var b = (ReliableSessionBindingElement) element;
+ var b = (ReliableSessionBindingElement) bindingElement;
AcknowledgementInterval = b.AcknowledgementInterval;
FlowControlEnabled = b.FlowControlEnabled;
InactivityTimeout = b.InactivityTimeout;
return sb;
}
- protected internal void ApplyConfiguration (ServiceCredentials sb)
+ protected internal void ApplyConfiguration (ServiceCredentials behavior)
{
// IssuedToken
foreach (AllowedAudienceUriElement ae in IssuedTokenAuthentication.AllowedAudienceUris)
- sb.IssuedTokenAuthentication.AllowedAudienceUris.Add (ae.AllowedAudienceUri);
- sb.IssuedTokenAuthentication.AllowUntrustedRsaIssuers = IssuedTokenAuthentication.AllowUntrustedRsaIssuers;
- sb.IssuedTokenAuthentication.AudienceUriMode = IssuedTokenAuthentication.AudienceUriMode;
+ behavior.IssuedTokenAuthentication.AllowedAudienceUris.Add (ae.AllowedAudienceUri);
+ behavior.IssuedTokenAuthentication.AllowUntrustedRsaIssuers = IssuedTokenAuthentication.AllowUntrustedRsaIssuers;
+ behavior.IssuedTokenAuthentication.AudienceUriMode = IssuedTokenAuthentication.AudienceUriMode;
if (!String.IsNullOrEmpty (IssuedTokenAuthentication.CustomCertificateValidatorType))
- sb.IssuedTokenAuthentication.CustomCertificateValidator = (X509CertificateValidator) CreateInstance (IssuedTokenAuthentication.CustomCertificateValidatorType);
- sb.IssuedTokenAuthentication.CertificateValidationMode = IssuedTokenAuthentication.CertificateValidationMode;
- sb.IssuedTokenAuthentication.RevocationMode = IssuedTokenAuthentication.RevocationMode;
- sb.IssuedTokenAuthentication.TrustedStoreLocation = IssuedTokenAuthentication.TrustedStoreLocation;
+ behavior.IssuedTokenAuthentication.CustomCertificateValidator = (X509CertificateValidator) CreateInstance (IssuedTokenAuthentication.CustomCertificateValidatorType);
+ behavior.IssuedTokenAuthentication.CertificateValidationMode = IssuedTokenAuthentication.CertificateValidationMode;
+ behavior.IssuedTokenAuthentication.RevocationMode = IssuedTokenAuthentication.RevocationMode;
+ behavior.IssuedTokenAuthentication.TrustedStoreLocation = IssuedTokenAuthentication.TrustedStoreLocation;
foreach (X509CertificateTrustedIssuerElement ce in IssuedTokenAuthentication.KnownCertificates)
- sb.IssuedTokenAuthentication.KnownCertificates.Add (GetCertificate (ce.StoreLocation, ce.StoreName, ce.X509FindType, ce.FindValue));
+ behavior.IssuedTokenAuthentication.KnownCertificates.Add (GetCertificate (ce.StoreLocation, ce.StoreName, ce.X509FindType, ce.FindValue));
- sb.IssuedTokenAuthentication.SamlSerializer = (SamlSerializer) CreateInstance (IssuedTokenAuthentication.SamlSerializerType);
+ behavior.IssuedTokenAuthentication.SamlSerializer = (SamlSerializer) CreateInstance (IssuedTokenAuthentication.SamlSerializerType);
// Peer
if (!String.IsNullOrEmpty (Peer.Certificate.FindValue))
- sb.Peer.SetCertificate (Peer.Certificate.StoreLocation, Peer.Certificate.StoreName, Peer.Certificate.X509FindType, Peer.Certificate.FindValue);
+ behavior.Peer.SetCertificate (Peer.Certificate.StoreLocation, Peer.Certificate.StoreName, Peer.Certificate.X509FindType, Peer.Certificate.FindValue);
// sb.Peer.MeshPassword = /* cannot fill it here */
- sb.Peer.MessageSenderAuthentication.CustomCertificateValidator = (X509CertificateValidator) CreateInstance (Peer.MessageSenderAuthentication.CustomCertificateValidatorType);
- sb.Peer.MessageSenderAuthentication.CertificateValidationMode = Peer.MessageSenderAuthentication.CertificateValidationMode;
- sb.Peer.MessageSenderAuthentication.RevocationMode = Peer.MessageSenderAuthentication.RevocationMode;
- sb.Peer.MessageSenderAuthentication.TrustedStoreLocation = Peer.MessageSenderAuthentication.TrustedStoreLocation;
- sb.Peer.PeerAuthentication.CustomCertificateValidator = (X509CertificateValidator) CreateInstance (Peer.PeerAuthentication.CustomCertificateValidatorType);
- sb.Peer.PeerAuthentication.CertificateValidationMode = Peer.PeerAuthentication.CertificateValidationMode;
- sb.Peer.PeerAuthentication.RevocationMode = Peer.PeerAuthentication.RevocationMode;
- sb.Peer.PeerAuthentication.TrustedStoreLocation = Peer.PeerAuthentication.TrustedStoreLocation;
+ behavior.Peer.MessageSenderAuthentication.CustomCertificateValidator = (X509CertificateValidator) CreateInstance (Peer.MessageSenderAuthentication.CustomCertificateValidatorType);
+ behavior.Peer.MessageSenderAuthentication.CertificateValidationMode = Peer.MessageSenderAuthentication.CertificateValidationMode;
+ behavior.Peer.MessageSenderAuthentication.RevocationMode = Peer.MessageSenderAuthentication.RevocationMode;
+ behavior.Peer.MessageSenderAuthentication.TrustedStoreLocation = Peer.MessageSenderAuthentication.TrustedStoreLocation;
+ behavior.Peer.PeerAuthentication.CustomCertificateValidator = (X509CertificateValidator) CreateInstance (Peer.PeerAuthentication.CustomCertificateValidatorType);
+ behavior.Peer.PeerAuthentication.CertificateValidationMode = Peer.PeerAuthentication.CertificateValidationMode;
+ behavior.Peer.PeerAuthentication.RevocationMode = Peer.PeerAuthentication.RevocationMode;
+ behavior.Peer.PeerAuthentication.TrustedStoreLocation = Peer.PeerAuthentication.TrustedStoreLocation;
// WSSC
- sb.SecureConversationAuthentication.SecurityStateEncoder = (SecurityStateEncoder) CreateInstance (SecureConversationAuthentication.SecurityStateEncoderType);
+ behavior.SecureConversationAuthentication.SecurityStateEncoder = (SecurityStateEncoder) CreateInstance (SecureConversationAuthentication.SecurityStateEncoderType);
// X509
if (!String.IsNullOrEmpty (ServiceCertificate.FindValue))
- sb.ServiceCertificate.SetCertificate (ServiceCertificate.StoreLocation, ServiceCertificate.StoreName, ServiceCertificate.X509FindType, ServiceCertificate.FindValue);
+ behavior.ServiceCertificate.SetCertificate (ServiceCertificate.StoreLocation, ServiceCertificate.StoreName, ServiceCertificate.X509FindType, ServiceCertificate.FindValue);
// UserNamePassword
- sb.UserNameAuthentication.CachedLogonTokenLifetime = UserNameAuthentication.CachedLogonTokenLifetime;
- sb.UserNameAuthentication.CacheLogonTokens = UserNameAuthentication.CacheLogonTokens;
- sb.UserNameAuthentication.CustomUserNamePasswordValidator = (UserNamePasswordValidator) CreateInstance (UserNameAuthentication.CustomUserNamePasswordValidatorType);
- sb.UserNameAuthentication.IncludeWindowsGroups = UserNameAuthentication.IncludeWindowsGroups;
- sb.UserNameAuthentication.MaxCachedLogonTokens = UserNameAuthentication.MaxCachedLogonTokens;
- sb.UserNameAuthentication.MembershipProvider = (MembershipProvider) CreateInstance (UserNameAuthentication.MembershipProviderName);
- sb.UserNameAuthentication.UserNamePasswordValidationMode = UserNameAuthentication.UserNamePasswordValidationMode;
+ behavior.UserNameAuthentication.CachedLogonTokenLifetime = UserNameAuthentication.CachedLogonTokenLifetime;
+ behavior.UserNameAuthentication.CacheLogonTokens = UserNameAuthentication.CacheLogonTokens;
+ behavior.UserNameAuthentication.CustomUserNamePasswordValidator = (UserNamePasswordValidator) CreateInstance (UserNameAuthentication.CustomUserNamePasswordValidatorType);
+ behavior.UserNameAuthentication.IncludeWindowsGroups = UserNameAuthentication.IncludeWindowsGroups;
+ behavior.UserNameAuthentication.MaxCachedLogonTokens = UserNameAuthentication.MaxCachedLogonTokens;
+ behavior.UserNameAuthentication.MembershipProvider = (MembershipProvider) CreateInstance (UserNameAuthentication.MembershipProviderName);
+ behavior.UserNameAuthentication.UserNamePasswordValidationMode = UserNameAuthentication.UserNamePasswordValidationMode;
// Windows
- sb.WindowsAuthentication.AllowAnonymousLogons = WindowsAuthentication.AllowAnonymousLogons;
- sb.WindowsAuthentication.IncludeWindowsGroups = WindowsAuthentication.IncludeWindowsGroups;
+ behavior.WindowsAuthentication.AllowAnonymousLogons = WindowsAuthentication.AllowAnonymousLogons;
+ behavior.WindowsAuthentication.IncludeWindowsGroups = WindowsAuthentication.IncludeWindowsGroups;
}
X509Certificate2 GetCertificate (StoreLocation storeLocation, StoreName storeName, X509FindType findType, object findValue)
return (ConfigurationElement) Activator.CreateInstance (typeof (ConfigurationElementType), new object [0]);
}
- public void CopyTo (ConfigurationElementType [] array, int index)
+ public void CopyTo (ConfigurationElementType [] array, int start)
{
- base.CopyTo (array, index);
+ base.CopyTo (array, start);
}
- public int IndexOf (ConfigurationElementType item)
+ public int IndexOf (ConfigurationElementType element)
{
- return BaseIndexOf (item);
+ return BaseIndexOf (element);
}
- public void Remove (ConfigurationElementType item)
+ public void Remove (ConfigurationElementType element)
{
- BaseRemove (GetElementKey (item));
+ BaseRemove (GetElementKey (element));
}
public void RemoveAt (int index)
BaseRemoveAt (index);
}
- public void RemoveAt (object index)
+ public void RemoveAt (object key)
{
- BaseRemove (index);
+ BaseRemove (key);
}
}
}
// Methods
- public void ApplyConfiguration (OptionalReliableSession s)
+ public void ApplyConfiguration (OptionalReliableSession optionalReliableSession)
{
- base.ApplyConfiguration (s);
- s.Enabled = this.Enabled;
+ base.ApplyConfiguration (optionalReliableSession);
+ optionalReliableSession.Enabled = this.Enabled;
}
}
// Methods
- public void ApplyConfiguration (ReliableSession s)
+ public void ApplyConfiguration (ReliableSession reliableSession)
{
- s.InactivityTimeout = InactivityTimeout;
- s.Ordered = Ordered;
+ reliableSession.InactivityTimeout = InactivityTimeout;
+ reliableSession.Ordered = Ordered;
}
}
protected abstract void OnApplyConfiguration (ServiceEndpoint endpoint, ChannelEndpointElement channelEndpointElement);
- protected abstract void OnApplyConfiguration (ServiceEndpoint endpoint, ServiceEndpointElement channelEndpointElement);
+ protected abstract void OnApplyConfiguration (ServiceEndpoint endpoint, ServiceEndpointElement serviceEndpointElement);
protected abstract void OnInitializeAndValidate (ChannelEndpointElement channelEndpointElement);
- protected abstract void OnInitializeAndValidate (ServiceEndpointElement channelEndpointElement);
+ protected abstract void OnInitializeAndValidate (ServiceEndpointElement serviceEndpointElement);
protected override void Reset (ConfigurationElement parentElement)
{
return sm.StandardEndpoints;
}
- public new EndpointCollectionElement this [string name] {
+ public new EndpointCollectionElement this [string endpoint] {
get {
- object element = base [name];
+ object element = base [endpoint];
if (element is EndpointCollectionElement)
return (EndpointCollectionElement) element;
- throw new ArgumentException (String.Format ("Could not find {0}", name));
+ throw new ArgumentException (String.Format ("Could not find {0}", endpoint));
}
}
}
- public override void ApplyConfiguration (BindingElement element)
+ public override void ApplyConfiguration (BindingElement bindingElement)
{
- var b = (TextMessageEncodingBindingElement) element;
+ var b = (TextMessageEncodingBindingElement) bindingElement;
b.MaxReadPoolSize = MaxReadPoolSize;
b.MaxWritePoolSize = MaxWritePoolSize;
b.MessageVersion = MessageVersion;
ReaderQuotas.ApplyConfiguration (b.ReaderQuotas);
}
- public override void CopyFrom (ServiceModelExtensionElement element)
+ public override void CopyFrom (ServiceModelExtensionElement from)
{
- var b = (TextMessageEncodingElement) element;
+ var b = (TextMessageEncodingElement) from;
MaxReadPoolSize = b.MaxReadPoolSize;
MaxWritePoolSize = b.MaxWritePoolSize;
MessageVersion = b.MessageVersion;
ReaderQuotas.CopyFrom (b.ReaderQuotas);
}
- protected internal override void InitializeFrom (BindingElement element)
+ protected internal override void InitializeFrom (BindingElement bindingElement)
{
- var b = (TextMessageEncodingBindingElement) element;
+ var b = (TextMessageEncodingBindingElement) bindingElement;
MaxReadPoolSize = b.MaxReadPoolSize;
MaxWritePoolSize = b.MaxWritePoolSize;
MessageVersion = b.MessageVersion;
{
}
- public FaultDescription Find (string name)
+ public FaultDescription Find (string action)
{
foreach (FaultDescription d in this)
- if (d.Name == name)
+ if (d.Name == action)
return d;
return null;
}
- public Collection<FaultDescription> FindAll (string name)
+ public Collection<FaultDescription> FindAll (string action)
{
Collection<FaultDescription> ret =
new Collection<FaultDescription> ();
foreach (FaultDescription d in this)
- if (d.Name == name)
+ if (d.Name == action)
ret.Add (d);
return ret;
}
public interface IServiceBehavior
{
void AddBindingParameters (
- ServiceDescription description,
+ ServiceDescription serviceDescription,
ServiceHostBase serviceHostBase,
Collection<ServiceEndpoint> endpoints,
- BindingParameterCollection parameters);
+ BindingParameterCollection bindingParameters);
void ApplyDispatchBehavior (
- ServiceDescription description,
+ ServiceDescription serviceDescription,
ServiceHostBase serviceHostBase);
void Validate (
- ServiceDescription description,
+ ServiceDescription serviceDescription,
ServiceHostBase serviceHostBase);
}
}
XmlSchemaSet xmlSchemas, ICollection<XmlElement> policy);
void ImportContract (WsdlImporter importer,
- WsdlContractConversionContext contractContext);
+ WsdlContractConversionContext context);
void ImportEndpoint (WsdlImporter importer,
- WsdlEndpointConversionContext endpointContext);
+ WsdlEndpointConversionContext context);
}
}
get { return msg; }
}
- public override bool Equals (object other)
+ public override bool Equals (object obj)
{
- MetadataConversionError e = other as MetadataConversionError;
+ MetadataConversionError e = obj as MetadataConversionError;
return e != null &&
e.warning == warning &&
e.msg == msg;
ServiceContractGenerationContext contract,
OperationDescription operation,
CodeTypeDeclaration declaringType,
- CodeMemberMethod method,
+ CodeMemberMethod syncMethod,
CodeMemberMethod beginMethod,
CodeMemberMethod endMethod)
{
this.contract = contract;
this.operation = operation;
declaring_type = declaringType;
- this.method = method;
+ this.method = syncMethod;
this.begin_method = beginMethod;
this.end_method = endMethod;
}
{
}
- public PolicyAssertionCollection (IEnumerable<XmlElement> list)
- : base (new List<XmlElement> (list))
+ public PolicyAssertionCollection (IEnumerable<XmlElement> elements)
+ : base (new List<XmlElement> (elements))
{
}
[MonoTODO]
- public bool Contains (string name, string ns)
+ public bool Contains (string localName, string namespaceUri)
{
foreach (XmlElement el in this)
- if (el.LocalName == name && el.NamespaceURI == ns)
+ if (el.LocalName == localName && el.NamespaceURI == namespaceUri)
return true;
return false;
}
[MonoTODO]
- public XmlElement Find (string name, string ns)
+ public XmlElement Find (string localName, string namespaceUri)
{
foreach (XmlElement el in this)
- if (el.LocalName == name && el.NamespaceURI == ns)
+ if (el.LocalName == localName && el.NamespaceURI == namespaceUri)
return el;
return null;
}
[MonoTODO]
- public Collection<XmlElement> FindAll (string name, string ns)
+ public Collection<XmlElement> FindAll (string localName, string namespaceUri)
{
Collection<XmlElement> ret =
new Collection<XmlElement> ();
foreach (XmlElement el in this)
- if (el.LocalName == name && el.NamespaceURI == ns)
+ if (el.LocalName == localName && el.NamespaceURI == namespaceUri)
ret.Add (el);
return ret;
}
[MonoTODO]
- public XmlElement Remove (string name, string ns)
+ public XmlElement Remove (string localName, string namespaceUri)
{
foreach (XmlElement el in this)
- if (el.LocalName == name && el.NamespaceURI == ns) {
+ if (el.LocalName == localName && el.NamespaceURI == namespaceUri) {
Remove (el);
return el;
}
}
[MonoTODO]
- public Collection<XmlElement> RemoveAll (string name, string ns)
+ public Collection<XmlElement> RemoveAll (string localName, string namespaceUri)
{
- Collection<XmlElement> list = FindAll (name, ns);
+ Collection<XmlElement> list = FindAll (localName, namespaceUri);
foreach (XmlElement el in list)
Remove (el);
return list;
{
}
- public ServiceContractGenerator (CodeCompileUnit ccu)
- : this (ccu, null)
+ public ServiceContractGenerator (CodeCompileUnit targetCompileUnit)
+ : this (targetCompileUnit, null)
{
}
- public ServiceContractGenerator (ConfigurationType config)
- : this (null, config)
+ public ServiceContractGenerator (ConfigurationType targetConfig)
+ : this (null, targetConfig)
{
}
- public ServiceContractGenerator (CodeCompileUnit ccu, ConfigurationType config)
+ public ServiceContractGenerator (CodeCompileUnit targetCompileUnit, ConfigurationType targetConfig)
{
- if (ccu == null)
+ if (targetCompileUnit == null)
this.ccu = new CodeCompileUnit ();
else
- this.ccu = ccu;
- this.config = config;
+ this.ccu = targetCompileUnit;
+ this.config = targetConfig;
Options |= ServiceContractGenerationOptions.ChannelInterface |
ServiceContractGenerationOptions.ClientClass;
}
set { service_type = value; }
}
- public static ServiceDescription GetService (Type type)
+ public static ServiceDescription GetService (Type serviceType)
{
// null Type is not rejected
ServiceDescription sd = new ServiceDescription ();
- sd.ServiceType = type;
- if (type != null) {
- var att = type.GetCustomAttribute<ServiceBehaviorAttribute> (true);
+ sd.ServiceType = serviceType;
+ if (serviceType != null) {
+ var att = serviceType.GetCustomAttribute<ServiceBehaviorAttribute> (true);
if (att != null) {
sd.Name = att.Name;
sd.Namespace = att.Namespace;
}
if (sd.Name == null)
- sd.Name = type.Name;
+ sd.Name = serviceType.Name;
if (sd.Namespace == null)
sd.Namespace = "http://tempuri.org/";
}
return sd;
}
- public static ServiceDescription GetService (object wellKnown)
+ public static ServiceDescription GetService (object serviceImplementation)
{
// null instance is not rejected
ServiceDescription sd = new ServiceDescription ();
- sd.ServiceType = wellKnown != null ? wellKnown.GetType () : null;
+ sd.ServiceType = serviceImplementation != null ? serviceImplementation.GetType () : null;
return sd;
}
}
{
}
- public ServiceEndpoint Find (Type type)
+ public ServiceEndpoint Find (Type contractType)
{
foreach (ServiceEndpoint e in this)
- if (e.Contract.ContractType == type)
+ if (e.Contract.ContractType == contractType)
return e;
return null;
}
- public ServiceEndpoint Find (Uri uri)
+ public ServiceEndpoint Find (Uri address)
{
foreach (ServiceEndpoint e in this)
- if (e.Address.Uri == uri)
+ if (e.Address.Uri == address)
return e;
return null;
}
- public ServiceEndpoint Find (XmlQualifiedName name)
+ public ServiceEndpoint Find (XmlQualifiedName contractName)
{
foreach (ServiceEndpoint e in this)
- if (e.Contract.Name == name.Name &&
- e.Contract.Namespace == name.Namespace)
+ if (e.Contract.Name == contractName.Name &&
+ e.Contract.Namespace == contractName.Namespace)
return e;
return null;
}
return list;
}
- public Collection<ServiceEndpoint> FindAll (XmlQualifiedName name)
+ public Collection<ServiceEndpoint> FindAll (XmlQualifiedName contractName)
{
Collection<ServiceEndpoint> list =
new Collection<ServiceEndpoint> ();
foreach (ServiceEndpoint e in this)
- if (e.Contract.Name == name.Name &&
- e.Contract.Namespace == name.Namespace)
+ if (e.Contract.Name == contractName.Name &&
+ e.Contract.Namespace == contractName.Namespace)
list.Add (e);
return list;
}
}
public static TypedMessageConverter Create (
- Type type, string action)
+ Type messageContract, string action)
{
- return Create (type, action, TempUri);
+ return Create (messageContract, action, TempUri);
}
public static TypedMessageConverter Create (
- Type type, string action,
+ Type messageContract, string action,
string defaultNamespace)
{
- return Create (type, action, defaultNamespace, (DataContractFormatAttribute)null);
+ return Create (messageContract, action, defaultNamespace, (DataContractFormatAttribute)null);
}
public static TypedMessageConverter Create (
- Type type, string action,
+ Type messageContract, string action,
DataContractFormatAttribute formatterAttribute)
{
- return Create (type, action, TempUri, formatterAttribute);
+ return Create (messageContract, action, TempUri, formatterAttribute);
}
public static TypedMessageConverter Create (
- Type type,
+ Type messageContract,
string action, string defaultNamespace,
DataContractFormatAttribute formatterAttribute)
{
return new DefaultTypedMessageConverter (
new DataContractMessagesFormatter (
- MessageContractToMessagesDescription (type, defaultNamespace, action),
+ MessageContractToMessagesDescription (messageContract, defaultNamespace, action),
formatterAttribute));
}
public static TypedMessageConverter Create (
- Type type, string action,
+ Type messageContract, string action,
XmlSerializerFormatAttribute formatterAttribute)
{
- return Create (type, action, TempUri, formatterAttribute);
+ return Create (messageContract, action, TempUri, formatterAttribute);
}
public static TypedMessageConverter Create (
- Type type, string action, string defaultNamespace,
+ Type messageContract, string action, string defaultNamespace,
XmlSerializerFormatAttribute formatterAttribute)
{
return new DefaultTypedMessageConverter (
new XmlMessagesFormatter (
- MessageContractToMessagesDescription (type, defaultNamespace, action),
+ MessageContractToMessagesDescription (messageContract, defaultNamespace, action),
formatterAttribute));
}
}
public MessageDescription GetMessageDescription (
- MessageBinding message)
+ MessageBinding messageBinding)
{
throw new NotImplementedException ();
}
}
public OperationDescription GetOperationDescription (
- OperationBinding operation)
+ OperationBinding operationBinding)
{
throw new NotImplementedException ();
}
public void ExportEndpoints (
IEnumerable<ServiceEndpoint> endpoints,
- XmlQualifiedName name)
+ XmlQualifiedName wsdlServiceQName)
{
if (endpoints == null)
throw new ArgumentNullException ("endpoints");
- if (name == null)
- throw new ArgumentNullException ("name");
+ if (wsdlServiceQName == null)
+ throw new ArgumentNullException ("wsdlServiceQName");
foreach (ServiceEndpoint ep in endpoints) {
if (ep.Contract.Name == ServiceMetadataBehavior.MexContractName)
beforeImportCalled = true;
}
- public SMBinding ImportBinding (WSBinding binding)
+ public SMBinding ImportBinding (WSBinding wsdlBinding)
{
- return ImportBinding (binding, true).Binding;
+ return ImportBinding (wsdlBinding, true).Binding;
}
ServiceEndpoint ImportBinding (WSBinding binding, bool throwOnError)
}
}
- public ServiceEndpointCollection ImportEndpoints (WSBinding binding)
+ public ServiceEndpointCollection ImportEndpoints (WSBinding wsdlBinding)
{
var coll = new ServiceEndpointCollection ();
- ImportEndpoints (coll, binding);
+ ImportEndpoints (coll, wsdlBinding);
return coll;
}
- public ServiceEndpointCollection ImportEndpoints (PortType portType)
+ public ServiceEndpointCollection ImportEndpoints (PortType wsdlPortType)
{
var coll = new ServiceEndpointCollection ();
foreach (WSServiceDescription wsd in wsdl_documents) {
foreach (WS.Binding binding in wsd.Bindings) {
- if (!binding.Type.Name.Equals (portType.Name))
+ if (!binding.Type.Name.Equals (wsdlPortType.Name))
continue;
ImportEndpoints (coll, binding);
return coll;
}
- public ServiceEndpointCollection ImportEndpoints (Service service)
+ public ServiceEndpointCollection ImportEndpoints (Service wsdlService)
{
var coll = new ServiceEndpointCollection ();
- foreach (Port port in service.Ports) {
+ foreach (Port port in wsdlService.Ports) {
var sep = ImportEndpoint (port, false);
if (sep != null)
coll.Add (sep);
public XmlSerializerOperationBehavior (
OperationDescription operation,
- XmlSerializerFormatAttribute format)
+ XmlSerializerFormatAttribute attribute)
{
if (operation == null)
throw new ArgumentNullException ("operation");
- if (format == null)
- format = new XmlSerializerFormatAttribute ();
- this.format = format;
+ if (attribute == null)
+ attribute = new XmlSerializerFormatAttribute ();
+ this.format = attribute;
this.operation = operation;
}
return false;
}
- public override bool Match (MessageBuffer buffer)
+ public override bool Match (MessageBuffer messageBuffer)
{
bool retval;
- Message m = buffer.CreateMessage ();
+ Message m = messageBuffer.CreateMessage ();
retval = Match (m);
m.Close ();
set { transport_handler = value; }
}
- public abstract bool HandleException (Exception e);
+ public abstract bool HandleException (Exception exception);
}
}
\ No newline at end of file
Collection<MessageFilter> filters;
public FilterInvalidBodyAccessException () : base ("Not allowed to navigate to body.") {}
- public FilterInvalidBodyAccessException (string msg) : base (msg) {}
- public FilterInvalidBodyAccessException (string msg, Exception inner) : base (msg, inner) {}
+ public FilterInvalidBodyAccessException (string message) : base (message) {}
+ public FilterInvalidBodyAccessException (string message, Exception innerException) : base (message, innerException) {}
protected FilterInvalidBodyAccessException (SerializationInfo info, StreamingContext context)
: base (info, context) {}
- public FilterInvalidBodyAccessException (string msg, Collection<MessageFilter> filters)
- : base (msg)
+ public FilterInvalidBodyAccessException (string message, Collection<MessageFilter> filters)
+ : base (message)
{
this.filters = filters;
}
- public FilterInvalidBodyAccessException (string msg, Exception inner, Collection<MessageFilter> filters)
- : base (msg, inner)
+ public FilterInvalidBodyAccessException (string message, Exception innerException, Collection<MessageFilter> filters)
+ : base (message, innerException)
{
this.filters = filters;
}
public interface IDispatchMessageFormatter
{
void DeserializeRequest (Message message, object [] parameters);
- Message SerializeReply (MessageVersion version, object [] parameters, object result);
+ Message SerializeReply (MessageVersion messageVersion, object [] parameters, object result);
}
}
{
public interface IDispatchMessageInspector
{
- object AfterReceiveRequest (ref Message message,
- IClientChannel channel, InstanceContext context);
- void BeforeSendReply (ref Message message, object instance);
+ object AfterReceiveRequest (ref Message request,
+ IClientChannel channel, InstanceContext instanceContext);
+ void BeforeSendReply (ref Message reply, object correlationState);
}
}
{
public interface IDispatchOperationSelector
{
- string SelectOperation (ref Message msg);
+ string SelectOperation (ref Message message);
}
}
{
public interface IErrorHandler
{
- bool HandleError (Exception exception);
- void ProvideFault (Exception exception, MessageVersion version,
+ bool HandleError (Exception error);
+ void ProvideFault (Exception error, MessageVersion version,
ref Message fault);
}
}
{
public interface IInstanceContextInitializer
{
- void Initialize (InstanceContext context, Message message);
+ void Initialize (InstanceContext instanceContext, Message message);
}
}
{
public interface IInstanceProvider
{
- object GetInstance (InstanceContext context);
- object GetInstance (InstanceContext context, Message message);
- void ReleaseInstance (InstanceContext context, object instance);
+ object GetInstance (InstanceContext instanceContext);
+ object GetInstance (InstanceContext instanceContext, Message message);
+ void ReleaseInstance (InstanceContext instanceContext, object instance);
}
}
IEnumerable<KeyValuePair<MessageFilter,TFilterData>>,
IEnumerable
{
- bool GetMatchingFilter (Message message, out MessageFilter result);
- bool GetMatchingFilter (MessageBuffer buffer, out MessageFilter result);
+ bool GetMatchingFilter (Message message, out MessageFilter filter);
+ bool GetMatchingFilter (MessageBuffer messageBuffer, out MessageFilter filter);
bool GetMatchingFilters (Message message, ICollection<MessageFilter> results);
- bool GetMatchingFilters (MessageBuffer buffer, ICollection<MessageFilter> results);
+ bool GetMatchingFilters (MessageBuffer messageBuffer, ICollection<MessageFilter> results);
- bool GetMatchingValue (Message message, out TFilterData data);
- bool GetMatchingValue (MessageBuffer buffer, out TFilterData data);
+ bool GetMatchingValue (Message message, out TFilterData value);
+ bool GetMatchingValue (MessageBuffer messageBuffer, out TFilterData value);
bool GetMatchingValues (Message message, ICollection<TFilterData> results);
- bool GetMatchingValues (MessageBuffer buffer, ICollection<TFilterData> results);
+ bool GetMatchingValues (MessageBuffer messageBuffer, ICollection<TFilterData> results);
}
}
-//
+//
// InstanceContextIdleCallback.cs
//
// Author: Atsushi Enomoto (atsushi@ximian.com)
namespace System.ServiceModel.Dispatcher
{
- public delegate void InstanceContextIdleCallback (InstanceContext context);
+ public delegate void InstanceContextIdleCallback (InstanceContext instanceContext);
}
[Serializable]
public abstract class InvalidBodyAccessException : SystemException
{
- protected InvalidBodyAccessException (string msg) : base (msg) {}
- protected InvalidBodyAccessException (string msg, Exception inner) : base (msg, inner) {}
+ protected InvalidBodyAccessException (string message) : base (message) {}
+ protected InvalidBodyAccessException (string message, Exception innerException) : base (message, innerException) {}
protected InvalidBodyAccessException (SerializationInfo info, StreamingContext context)
: base (info, context) {}
}
return true;
}
- public override bool Match (MessageBuffer buffer)
+ public override bool Match (MessageBuffer messageBuffer)
{
// as documented
return true;
return false;
}
- public override bool Match (MessageBuffer buffer)
+ public override bool Match (MessageBuffer messageBuffer)
{
// as documented
return false;
Collection<MessageFilter> filters;
public MessageFilterException () : this ("MessageFilter node quota exceeded.") {}
- public MessageFilterException (string msg) : base (msg) {}
- public MessageFilterException (string msg, Exception inner) : base (msg, inner) {}
+ public MessageFilterException (string message) : base (message) {}
+ public MessageFilterException (string message, Exception innerException) : base (message, innerException) {}
protected MessageFilterException (SerializationInfo info, StreamingContext context)
: base (info, context) {}
- public MessageFilterException (string msg, Collection<MessageFilter> filters)
- : base (msg)
+ public MessageFilterException (string message, Collection<MessageFilter> filters)
+ : base (message)
{
this.filters = filters;
}
- public MessageFilterException (string msg, Exception inner, Collection<MessageFilter> filters)
- : base (msg, inner)
+ public MessageFilterException (string message, Exception innerException, Collection<MessageFilter> filters)
+ : base (message, innerException)
{
this.filters = filters;
}
public MessageFilterTable ()
: this (0) {} // 0 is the default
- public MessageFilterTable (int default_priority)
+ public MessageFilterTable (int defaultPriority)
{
- this.default_priority = default_priority;
+ this.default_priority = defaultPriority;
table = new Dictionary<MessageFilter, TFilterData> ();
priority_list = new Dictionary<MessageFilter, int> ();
}
return table.ContainsKey (filter);
}
- public void CopyTo (KeyValuePair<MessageFilter, TFilterData> [] array, int index)
+ public void CopyTo (KeyValuePair<MessageFilter, TFilterData> [] array, int arrayIndex)
{
- ((ICollection) table).CopyTo (array, index);
+ ((ICollection) table).CopyTo (array, arrayIndex);
}
protected virtual IMessageFilterTable<TFilterData> CreateFilterTable (MessageFilter filter)
return priority_list [filter];
}
- public bool GetMatchingFilter (Message message, out MessageFilter result)
+ public bool GetMatchingFilter (Message message, out MessageFilter filter)
{
if (message == null)
throw new ArgumentNullException ("message is null");
- result = null;
+ filter = null;
int count = 0;
foreach (MessageFilter f in table.Keys) {
"More than one filter matches.");
count++;
- result = f;
+ filter = f;
}
return count == 1;
}
- public bool GetMatchingFilter (MessageBuffer buffer, out MessageFilter result)
+ public bool GetMatchingFilter (MessageBuffer buffer, out MessageFilter filter)
{
- return GetMatchingFilter (buffer.CreateMessage (), out result);
+ return GetMatchingFilter (buffer.CreateMessage (), out filter);
}
[MonoTODO ("Consider priority")]
Collection<MessageFilter> filters;
public MultipleFilterMatchesException () : base () {}
- public MultipleFilterMatchesException (string msg) : base (msg) {}
- public MultipleFilterMatchesException (string msg, Exception inner) : base (msg, inner) {}
+ public MultipleFilterMatchesException (string message) : base (message) {}
+ public MultipleFilterMatchesException (string message, Exception innerException) : base (message, innerException) {}
protected MultipleFilterMatchesException (SerializationInfo info, StreamingContext context)
: base (info, context) {}
- public MultipleFilterMatchesException (string msg, Collection<MessageFilter> filters)
- : base (msg)
+ public MultipleFilterMatchesException (string message, Collection<MessageFilter> filters)
+ : base (message)
{
this.filters = filters;
}
- public MultipleFilterMatchesException (string msg, Exception inner, Collection<MessageFilter> filters)
- : base (msg, inner)
+ public MultipleFilterMatchesException (string message, Exception innerException, Collection<MessageFilter> filters)
+ : base (message, innerException)
{
this.filters = filters;
}
public class NavigatorInvalidBodyAccessException : InvalidBodyAccessException
{
public NavigatorInvalidBodyAccessException () : base ("Not allowed to navigate to body.") {}
- public NavigatorInvalidBodyAccessException (string msg) : base (msg) {}
- public NavigatorInvalidBodyAccessException (string msg, Exception inner) : base (msg, inner) {}
+ public NavigatorInvalidBodyAccessException (string message) : base (message) {}
+ public NavigatorInvalidBodyAccessException (string message, Exception innerException) : base (message, innerException) {}
protected NavigatorInvalidBodyAccessException (SerializationInfo info, StreamingContext context)
: base (info, context) {}
}
{
protected SeekableXPathNavigator () {}
- public abstract XmlNodeOrder ComparePosition (long first, long second);
- public abstract string GetLocalName (long node_position);
- public abstract string GetName (long node_position);
- public abstract string GetNamespace (long node_position);
- public abstract XPathNodeType GetNodeType (long node_position);
- public abstract string GetValue (long node_position);
+ public abstract XmlNodeOrder ComparePosition (long firstPosition, long secondPosition);
+ public abstract string GetLocalName (long nodePosition);
+ public abstract string GetName (long nodePosition);
+ public abstract string GetNamespace (long nodePosition);
+ public abstract XPathNodeType GetNodeType (long nodePosition);
+ public abstract string GetValue (long nodePosition);
public abstract long CurrentPosition { get; set; }
}
{
}
- public XPathMessageContext (NameTable nameTable)
- : base (nameTable)
+ public XPathMessageContext (NameTable table)
+ : base (table)
{
AddNamespace ("s11", Constants.Soap11);
AddNamespace ("s12", Constants.Soap12);
get { return false; } // as documented.
}
- public override int CompareDocument (string uri1, string uri2)
+ public override int CompareDocument (string baseUri, string nextBaseUri)
{
- return String.CompareOrdinal (uri1, uri2);
+ return String.CompareOrdinal (baseUri, nextBaseUri);
}
public override bool PreserveWhitespace (XPathNavigator node)
Initialize (xpath, namespaces);
}
- public XPathMessageFilter (string xpath, XsltContext namespaces)
+ public XPathMessageFilter (string xpath, XsltContext context)
{
- Initialize (xpath, namespaces);
+ Initialize (xpath, context);
}
[MonoTODO]
}
[MonoTODO]
- public XPathMessageFilter (XmlReader reader, XsltContext namespaces)
+ public XPathMessageFilter (XmlReader reader, XsltContext context)
{
- Initialize (reader.ReadString (), namespaces);
+ Initialize (reader.ReadString (), context);
}
private void Initialize (string xpath, XmlNamespaceManager nsmgr)
{
}
- public XPathMessageFilterTable (int quota)
+ public XPathMessageFilterTable (int capacity)
{
- this.quota = quota;
+ this.quota = capacity;
}
[DataMember]
set { quota = value; }
}
- public TFilterData this [MessageFilter key] {
- get { return dict [key]; }
- set { dict [key] = value; }
+ public TFilterData this [MessageFilter filter] {
+ get { return dict [filter]; }
+ set { dict [filter] = value; }
}
public int Count {
dict [item.Key].Equals (item.Value);
}
- public bool ContainsKey (MessageFilter key)
+ public bool ContainsKey (MessageFilter filter)
{
- return dict.ContainsKey (key);
+ return dict.ContainsKey (filter);
}
- public void CopyTo (KeyValuePair<MessageFilter,TFilterData> [] array, int index)
+ public void CopyTo (KeyValuePair<MessageFilter,TFilterData> [] array, int arrayIndex)
{
- if (index < 0 || dict.Count >= array.Length - index)
- throw new ArgumentOutOfRangeException ("index");
+ if (arrayIndex < 0 || dict.Count >= array.Length - arrayIndex)
+ throw new ArgumentOutOfRangeException ("arrayIndex");
foreach (KeyValuePair<MessageFilter,TFilterData> item in dict)
- array [index++] = item;
+ array [arrayIndex++] = item;
}
public IEnumerator<KeyValuePair<MessageFilter,TFilterData>> GetEnumerator ()
return GetEnumerator ();
}
- public bool GetMatchingFilter (Message message, out MessageFilter result)
+ public bool GetMatchingFilter (Message message, out MessageFilter filter)
{
throw new NotImplementedException ();
}
- public bool GetMatchingFilter (MessageBuffer buffer, out MessageFilter result)
+ public bool GetMatchingFilter (MessageBuffer messageBuffer, out MessageFilter filter)
{
throw new NotImplementedException ();
}
throw new NotImplementedException ();
}
- public bool GetMatchingFilters (MessageBuffer buffer, ICollection<MessageFilter> results)
+ public bool GetMatchingFilters (MessageBuffer messageBuffer, ICollection<MessageFilter> results)
{
throw new NotImplementedException ();
}
throw new NotImplementedException ();
}
- public bool GetMatchingValue (MessageBuffer buffer, out TFilterData data)
+ public bool GetMatchingValue (MessageBuffer messageBuffer, out TFilterData data)
{
throw new NotImplementedException ();
}
throw new NotImplementedException ();
}
- public bool GetMatchingValues (MessageBuffer buffer, ICollection<TFilterData> results)
+ public bool GetMatchingValues (MessageBuffer messageBuffer, ICollection<TFilterData> results)
{
throw new NotImplementedException ();
}
public class XPathNavigatorException : XPathException
{
public XPathNavigatorException () : this ("Navigator node quota exceeded") {}
- public XPathNavigatorException (string msg) : base (msg) {}
- public XPathNavigatorException (string msg, Exception inner)
- : base (msg, inner) {}
+ public XPathNavigatorException (string message) : base (message) {}
+ public XPathNavigatorException (string message, Exception innerException)
+ : base (message, innerException) {}
protected XPathNavigatorException (SerializationInfo info,
StreamingContext context)
: base (info, context) {}
{
}
- public UnregisterInfo (string meshId, Guid registration_id)
+ public UnregisterInfo (string meshId, Guid registrationId)
{
Body.MeshId = meshId;
- Body.RegistrationId = registration_id;
+ Body.RegistrationId = registrationId;
}
public string MeshId {
binding = issuerBinding;
}
- protected IssuedSecurityTokenParameters (IssuedSecurityTokenParameters source)
- : base (source)
+ protected IssuedSecurityTokenParameters (IssuedSecurityTokenParameters other)
+ : base (other)
{
- binding = source.binding;
- issuer_address = source.issuer_address;
- issuer_meta_address = source.issuer_meta_address;
- key_size = source.key_size;
- key_type = source.key_type;
- token_type = source.token_type;
- reqs = new Collection<ClaimTypeRequirement> (source.reqs);
- additional_reqs = new Collection<XmlElement> (source.additional_reqs);
+ binding = other.binding;
+ issuer_address = other.issuer_address;
+ issuer_meta_address = other.issuer_meta_address;
+ key_size = other.key_size;
+ key_type = other.key_type;
+ token_type = other.token_type;
+ reqs = new Collection<ClaimTypeRequirement> (other.reqs);
+ additional_reqs = new Collection<XmlElement> (other.additional_reqs);
}
Binding binding;
{
}
- protected KerberosSecurityTokenParameters (KerberosSecurityTokenParameters source)
- : base (source)
+ protected KerberosSecurityTokenParameters (KerberosSecurityTokenParameters other)
+ : base (other)
{
}
RequireDerivedKeys = true;
}
- protected RsaSecurityTokenParameters (RsaSecurityTokenParameters source)
- : base (source)
+ protected RsaSecurityTokenParameters (RsaSecurityTokenParameters other)
+ : base (other)
{
}
}
#endif
- protected SecureConversationSecurityTokenParameters (SecureConversationSecurityTokenParameters source)
- : base (source)
+ protected SecureConversationSecurityTokenParameters (SecureConversationSecurityTokenParameters other)
+ : base (other)
{
- this.element = (SecurityBindingElement) source.element.Clone ();
- this.cancellable = source.cancellable;
+ this.element = (SecurityBindingElement) other.element.Clone ();
+ this.cancellable = other.cancellable;
#if !MOBILE && !XAMMAC_4_5
this.requirements = new ChannelProtectionRequirements (default_channel_protection_requirements);
#endif
throw new NotSupportedException (String.Format ("X509SecurityToken does not support creation of {0}.", t));
}
- public override bool MatchesKeyIdentifierClause (SecurityKeyIdentifierClause clause)
+ public override bool MatchesKeyIdentifierClause (SecurityKeyIdentifierClause keyIdentifierClause)
{
SecurityContextKeyIdentifierClause sctic =
- clause as SecurityContextKeyIdentifierClause;
+ keyIdentifierClause as SecurityContextKeyIdentifierClause;
return sctic != null && sctic.ContextId == ContextId &&
sctic.Generation == KeyGeneration;
}
this.cancel = requireCancellation;
}
- protected SslSecurityTokenParameters (SslSecurityTokenParameters source)
- : base (source)
+ protected SslSecurityTokenParameters (SslSecurityTokenParameters other)
+ : base (other)
{
- cert = source.cert;
- cancel = source.cancel;
+ cert = other.cert;
+ cancel = other.cancel;
}
bool cert, cancel;
bool extract_groups, allow_unauth;
[MonoTODO]
- public SspiSecurityToken (NetworkCredential cred,
+ public SspiSecurityToken (NetworkCredential networkCredential,
bool extractGroupsForWindowsAccounts,
bool allowUnauthenticatedCallers)
{
[MonoTODO]
public SspiSecurityToken (
TokenImpersonationLevel impersonationLevel,
- bool allowNtlm, NetworkCredential cred)
+ bool allowNtlm, NetworkCredential networkCredential)
{
throw new NotImplementedException ();
}
this.cancel = requireCancellation;
}
- protected SspiSecurityTokenParameters (SspiSecurityTokenParameters source)
- : base (source)
+ protected SspiSecurityTokenParameters (SspiSecurityTokenParameters other)
+ : base (other)
{
- this.cancel = source.cancel;
+ this.cancel = other.cancel;
}
public bool RequireCancellation {
RequireDerivedKeys = false;
}
- protected UserNameSecurityTokenParameters (UserNameSecurityTokenParameters source)
- : base (source)
+ protected UserNameSecurityTokenParameters (UserNameSecurityTokenParameters other)
+ : base (other)
{
}
InclusionMode = inclusionMode;
}
- protected X509SecurityTokenParameters (X509SecurityTokenParameters source)
- : base (source)
+ protected X509SecurityTokenParameters (X509SecurityTokenParameters other)
+ : base (other)
{
- reference_style = source.reference_style;
+ reference_style = other.reference_style;
}
public X509KeyIdentifierClauseType X509ReferenceStyle {
header_types = new ReadOnlyCollection<XmlQualifiedName> (header_types);
}
- public void Union (MessagePartSpecification other)
+ public void Union (MessagePartSpecification specification)
{
- if (other == null)
- throw new ArgumentNullException ("other");
+ if (specification == null)
+ throw new ArgumentNullException ("specification");
if (header_types.IsReadOnly)
throw new InvalidOperationException ("This MessagePartSpecification is read-only.");
- body |= other.body;
- foreach (XmlQualifiedName q in other.header_types)
+ body |= specification.body;
+ foreach (XmlQualifiedName q in specification.header_types)
// Sigh. It could be much better here.
//if (!header_types.Contains (q))
header_types.Add (q);
-//
+//
// ServiceCredentialsSecurityTokenManager.cs
//
// Author:
ServiceCredentials credentials;
public ServiceCredentialsSecurityTokenManager (
- ServiceCredentials credentials)
+ ServiceCredentials parent)
{
- this.credentials = credentials;
+ this.credentials = parent;
}
public ServiceCredentials ServiceCredentials {
[MonoTODO]
public virtual EndpointIdentity GetIdentityOfSelf (
- SecurityTokenRequirement requirement)
+ SecurityTokenRequirement tokenRequirement)
{
throw new NotImplementedException ();
}
[MonoTODO]
public override SecurityTokenAuthenticator CreateSecurityTokenAuthenticator (
- SecurityTokenRequirement requirement,
+ SecurityTokenRequirement tokenRequirement,
out SecurityTokenResolver outOfBandTokenResolver)
{
outOfBandTokenResolver = null;
- if (requirement.TokenType == SecurityTokenTypes.UserName)
- return CreateUserNameAuthenticator (requirement);
- if (requirement.TokenType == SecurityTokenTypes.X509Certificate)
- return CreateX509Authenticator (requirement);
- if (requirement.TokenType == SecurityTokenTypes.Rsa)
+ if (tokenRequirement.TokenType == SecurityTokenTypes.UserName)
+ return CreateUserNameAuthenticator (tokenRequirement);
+ if (tokenRequirement.TokenType == SecurityTokenTypes.X509Certificate)
+ return CreateX509Authenticator (tokenRequirement);
+ if (tokenRequirement.TokenType == SecurityTokenTypes.Rsa)
return new RsaSecurityTokenAuthenticator ();
- if (requirement.TokenType == ServiceModelSecurityTokenTypes.SecureConversation) {
+ if (tokenRequirement.TokenType == ServiceModelSecurityTokenTypes.SecureConversation) {
SecurityBindingElement binding;
- if (!requirement.TryGetProperty<SecurityBindingElement> (ReqType.SecurityBindingElementProperty, out binding))
+ if (!tokenRequirement.TryGetProperty<SecurityBindingElement> (ReqType.SecurityBindingElementProperty, out binding))
throw new ArgumentException ("SecurityBindingElement is required in the security token requirement");
SecureConversationSecurityTokenParameters issuedParams;
- if (!requirement.TryGetProperty<SecureConversationSecurityTokenParameters> (ReqType.IssuedSecurityTokenParametersProperty, out issuedParams))
+ if (!tokenRequirement.TryGetProperty<SecureConversationSecurityTokenParameters> (ReqType.IssuedSecurityTokenParametersProperty, out issuedParams))
throw new ArgumentException ("IssuedSecurityTokenParameters are required in the security token requirement");
BindingContext issuerBC;
- if (!requirement.TryGetProperty<BindingContext> (ReqType.IssuerBindingContextProperty, out issuerBC))
+ if (!tokenRequirement.TryGetProperty<BindingContext> (ReqType.IssuerBindingContextProperty, out issuerBC))
throw new ArgumentException ("IssuerBindingContext is required in the security token requirement");
SecurityTokenVersion secVer;
- if (!requirement.TryGetProperty<SecurityTokenVersion> (ReqType.MessageSecurityVersionProperty, out secVer))
+ if (!tokenRequirement.TryGetProperty<SecurityTokenVersion> (ReqType.MessageSecurityVersionProperty, out secVer))
throw new ArgumentException ("MessageSecurityVersion property (of type SecurityTokenVersion) is required in the security token requirement");
// FIXME: get parameters from somewhere
outOfBandTokenResolver = resolver;
SecurityContextSecurityTokenAuthenticator sc =
new SecurityContextSecurityTokenAuthenticator ();
- return new SecureConversationSecurityTokenAuthenticator (requirement, sc, resolver);
+ return new SecureConversationSecurityTokenAuthenticator (tokenRequirement, sc, resolver);
}
- if (requirement.TokenType == ServiceModelSecurityTokenTypes.AnonymousSslnego)
- return CreateSslTokenAuthenticator (requirement);
- if (requirement.TokenType == ServiceModelSecurityTokenTypes.MutualSslnego)
- return CreateSslTokenAuthenticator (requirement);
- if (requirement.TokenType == ServiceModelSecurityTokenTypes.Spnego)
- return CreateSpnegoTokenAuthenticator (requirement);
+ if (tokenRequirement.TokenType == ServiceModelSecurityTokenTypes.AnonymousSslnego)
+ return CreateSslTokenAuthenticator (tokenRequirement);
+ if (tokenRequirement.TokenType == ServiceModelSecurityTokenTypes.MutualSslnego)
+ return CreateSslTokenAuthenticator (tokenRequirement);
+ if (tokenRequirement.TokenType == ServiceModelSecurityTokenTypes.Spnego)
+ return CreateSpnegoTokenAuthenticator (tokenRequirement);
else
- throw new NotImplementedException ("Not implemented token type: " + requirement.TokenType);
+ throw new NotImplementedException ("Not implemented token type: " + tokenRequirement.TokenType);
}
SpnegoSecurityTokenAuthenticator CreateSpnegoTokenAuthenticator (SecurityTokenRequirement requirement)
[MonoTODO]
public virtual SecurityKeyIdentifierClause CreateKeyIdentifierClauseFromTokenXml (
- XmlElement tokenXml, SecurityTokenReferenceStyle referenceStyle)
+ XmlElement element, SecurityTokenReferenceStyle tokenReferenceStyle)
{
throw new NotImplementedException ();
}
public class AddressAccessDeniedException : CommunicationException
{
public AddressAccessDeniedException () : base () {}
- public AddressAccessDeniedException (string msg) : base (msg) {}
- public AddressAccessDeniedException (string msg, Exception inner) : base (msg, inner) {}
+ public AddressAccessDeniedException (string message) : base (message) {}
+ public AddressAccessDeniedException (string message, Exception innerException) : base (message, innerException) {}
protected AddressAccessDeniedException (SerializationInfo info, StreamingContext context) :
base (info, context) {}
public class AddressAlreadyInUseException : CommunicationException
{
public AddressAlreadyInUseException () : base () {}
- public AddressAlreadyInUseException (string msg) : base (msg) {}
- public AddressAlreadyInUseException (string msg, Exception inner) : base (msg, inner) {}
+ public AddressAlreadyInUseException (string message) : base (message) {}
+ public AddressAlreadyInUseException (string message, Exception innerException) : base (message, innerException) {}
protected AddressAlreadyInUseException (SerializationInfo info, StreamingContext context) :
base (info, context) {}
protected void InitializeEndpoint (
string configurationName,
- EndpointAddress remoteAddress)
+ EndpointAddress address)
{
InitializeEndpoint (CreateDescription ());
- if (remoteAddress != null)
- service_endpoint.Address = remoteAddress;
+ if (address != null)
+ service_endpoint.Address = address;
ApplyConfiguration (configurationName);
}
return ch;
}
- public static TChannel CreateChannel (Binding binding, EndpointAddress address)
+ public static TChannel CreateChannel (Binding binding, EndpointAddress endpointAddress)
{
- return CreateChannelCore (new ChannelFactory<TChannel> (binding, address), f => f.CreateChannel ());
+ return CreateChannelCore (new ChannelFactory<TChannel> (binding, endpointAddress), f => f.CreateChannel ());
}
- public static TChannel CreateChannel (Binding binding, EndpointAddress address, Uri via)
+ public static TChannel CreateChannel (Binding binding, EndpointAddress endpointAddress, Uri via)
{
- return CreateChannelCore (new ChannelFactory<TChannel> (binding), f => f.CreateChannel (address, via));
+ return CreateChannelCore (new ChannelFactory<TChannel> (binding), f => f.CreateChannel (endpointAddress, via));
}
public virtual TChannel CreateChannel (EndpointAddress address, Uri via)
public class ChannelTerminatedException : CommunicationException
{
public ChannelTerminatedException () : base () {}
- public ChannelTerminatedException (string msg) : base (msg) {}
- public ChannelTerminatedException (string msg, Exception inner) : base (msg, inner) {}
+ public ChannelTerminatedException (string message) : base (message) {}
+ public ChannelTerminatedException (string message, Exception innerException) : base (message, innerException) {}
protected ChannelTerminatedException (SerializationInfo info, StreamingContext context) :
base (info, context) {}
}
{
}
- protected ClientBase (InstanceContext instance)
- : this (instance, "*")
+ protected ClientBase (InstanceContext callbackInstance)
+ : this (callbackInstance, "*")
{
}
- protected ClientBase (InstanceContext instance, string endpointConfigurationName)
+ protected ClientBase (InstanceContext callbackInstance, string endpointConfigurationName)
{
- if (instance == null)
+ if (callbackInstance == null)
throw new ArgumentNullException ("instanceContext");
if (endpointConfigurationName == null)
throw new ArgumentNullException ("endpointConfigurationName");
- Initialize (instance, endpointConfigurationName, null);
+ Initialize (callbackInstance, endpointConfigurationName, null);
}
- protected ClientBase (InstanceContext instance,
+ protected ClientBase (InstanceContext callbackInstance,
string endpointConfigurationName, EndpointAddress remoteAddress)
{
- if (instance == null)
+ if (callbackInstance == null)
throw new ArgumentNullException ("instanceContext");
if (endpointConfigurationName == null)
throw new ArgumentNullException ("endpointConfigurationName");
if (remoteAddress == null)
throw new ArgumentNullException ("remoteAddress");
- Initialize (instance, endpointConfigurationName, remoteAddress);
+ Initialize (callbackInstance, endpointConfigurationName, remoteAddress);
}
- protected ClientBase (InstanceContext instance,
+ protected ClientBase (InstanceContext callbackInstance,
string endpointConfigurationName, string remoteAddress)
{
- if (instance == null)
+ if (callbackInstance == null)
throw new ArgumentNullException ("instanceContext");
if (remoteAddress == null)
throw new ArgumentNullException ("endpointAddress");
if (endpointConfigurationName == null)
throw new ArgumentNullException ("endpointConfigurationName");
- Initialize (instance, endpointConfigurationName, new EndpointAddress (remoteAddress));
+ Initialize (callbackInstance, endpointConfigurationName, new EndpointAddress (remoteAddress));
}
- protected ClientBase (InstanceContext instance,
+ protected ClientBase (InstanceContext callbackInstance,
Binding binding, EndpointAddress remoteAddress)
{
- if (instance == null)
+ if (callbackInstance == null)
throw new ArgumentNullException ("instanceContext");
if (binding == null)
throw new ArgumentNullException ("binding");
if (remoteAddress == null)
throw new ArgumentNullException ("remoteAddress");
- Initialize (instance, binding, remoteAddress);
+ Initialize (callbackInstance, binding, remoteAddress);
}
protected ClientBase (ServiceEndpoint endpoint)
{
}
- protected ClientBase (InstanceContext instance, ServiceEndpoint endpoint)
- : this (instance, new ChannelFactory<TChannel> (endpoint))
+ protected ClientBase (InstanceContext callbackInstance, ServiceEndpoint endpoint)
+ : this (callbackInstance, new ChannelFactory<TChannel> (endpoint))
{
}
-//
+//
// ClientCredentialsSecurityTokenManager.cs
//
// Author:
{
ClientCredentials credentials;
- public ClientCredentialsSecurityTokenManager (ClientCredentials credentials)
+ public ClientCredentialsSecurityTokenManager (ClientCredentials clientCredentials)
{
- if (credentials == null)
- throw new ArgumentNullException ("credentials");
- this.credentials = credentials;
+ if (clientCredentials == null)
+ throw new ArgumentNullException ("clientCredentials");
+ this.credentials = clientCredentials;
}
public ClientCredentials ClientCredentials {
[MonoTODO]
public override SecurityTokenAuthenticator CreateSecurityTokenAuthenticator (
- SecurityTokenRequirement requirement,
+ SecurityTokenRequirement tokenRequirement,
out SecurityTokenResolver outOfBandTokenResolver)
{
outOfBandTokenResolver = null;
- if (requirement == null)
- throw new ArgumentNullException ("requirement");
- if (requirement.TokenType == SecurityTokenTypes.UserName) {
+ if (tokenRequirement == null)
+ throw new ArgumentNullException ("tokenRequirement");
+ if (tokenRequirement.TokenType == SecurityTokenTypes.UserName) {
// unsupported
}
- else if (requirement.TokenType == SecurityTokenTypes.Rsa)
+ else if (tokenRequirement.TokenType == SecurityTokenTypes.Rsa)
return new RsaSecurityTokenAuthenticator ();
- else if (requirement.TokenType == SecurityTokenTypes.X509Certificate)
- return CreateX509Authenticator (requirement);
- else if (requirement.TokenType == ServiceModelSecurityTokenTypes.Spnego)
- return new SspiClientSecurityTokenAuthenticator (this, requirement);
+ else if (tokenRequirement.TokenType == SecurityTokenTypes.X509Certificate)
+ return CreateX509Authenticator (tokenRequirement);
+ else if (tokenRequirement.TokenType == ServiceModelSecurityTokenTypes.Spnego)
+ return new SspiClientSecurityTokenAuthenticator (this, tokenRequirement);
else
- throw new NotImplementedException ("Security token type " + requirement.TokenType);
+ throw new NotImplementedException ("Security token type " + tokenRequirement.TokenType);
- throw new NotSupportedException (String.Format ("Security token requirement '{0}' is not supported to create SecurityTokenAuthenticator.", requirement));
+ throw new NotSupportedException (String.Format ("Security token requirement '{0}' is not supported to create SecurityTokenAuthenticator.", tokenRequirement));
}
#region CreateSecurityTokenProvider()
[MonoTODO]
- public override SecurityTokenProvider CreateSecurityTokenProvider (SecurityTokenRequirement requirement)
+ public override SecurityTokenProvider CreateSecurityTokenProvider (SecurityTokenRequirement tokenRequirement)
{
- if (IsIssuedSecurityTokenRequirement (requirement))
- return CreateIssuedTokenProvider (requirement);
+ if (IsIssuedSecurityTokenRequirement (tokenRequirement))
+ return CreateIssuedTokenProvider (tokenRequirement);
bool isInitiator;
// huh, they are not constants but properties.
- if (requirement.TokenType == SecurityTokenTypes.X509Certificate)
- return CreateX509SecurityTokenProvider (requirement);
- else if (requirement.TokenType == ServiceModelSecurityTokenTypes.SecureConversation)
- return CreateSecureConversationProvider (requirement);
- else if (requirement.TokenType == ServiceModelSecurityTokenTypes.AnonymousSslnego) {
- if (requirement.TryGetProperty<bool> (ReqType.IsInitiatorProperty, out isInitiator) && isInitiator)
- return CreateSslnegoProvider (requirement);
- } else if (requirement.TokenType == ServiceModelSecurityTokenTypes.MutualSslnego) {
- if (requirement.TryGetProperty<bool> (ReqType.IsInitiatorProperty, out isInitiator) && isInitiator)
- return CreateSslnegoProvider (requirement);
- } else if (requirement.TokenType == ServiceModelSecurityTokenTypes.SecurityContext) {
+ if (tokenRequirement.TokenType == SecurityTokenTypes.X509Certificate)
+ return CreateX509SecurityTokenProvider (tokenRequirement);
+ else if (tokenRequirement.TokenType == ServiceModelSecurityTokenTypes.SecureConversation)
+ return CreateSecureConversationProvider (tokenRequirement);
+ else if (tokenRequirement.TokenType == ServiceModelSecurityTokenTypes.AnonymousSslnego) {
+ if (tokenRequirement.TryGetProperty<bool> (ReqType.IsInitiatorProperty, out isInitiator) && isInitiator)
+ return CreateSslnegoProvider (tokenRequirement);
+ } else if (tokenRequirement.TokenType == ServiceModelSecurityTokenTypes.MutualSslnego) {
+ if (tokenRequirement.TryGetProperty<bool> (ReqType.IsInitiatorProperty, out isInitiator) && isInitiator)
+ return CreateSslnegoProvider (tokenRequirement);
+ } else if (tokenRequirement.TokenType == ServiceModelSecurityTokenTypes.SecurityContext) {
// FIXME: implement
- } else if (requirement.TokenType == ServiceModelSecurityTokenTypes.Spnego) {
- return CreateSpnegoProvider (requirement);
- } else if (requirement.TokenType == ServiceModelSecurityTokenTypes.SspiCredential) {
+ } else if (tokenRequirement.TokenType == ServiceModelSecurityTokenTypes.Spnego) {
+ return CreateSpnegoProvider (tokenRequirement);
+ } else if (tokenRequirement.TokenType == ServiceModelSecurityTokenTypes.SspiCredential) {
// FIXME: implement
- } else if (requirement.TokenType == SecurityTokenTypes.Rsa) {
+ } else if (tokenRequirement.TokenType == SecurityTokenTypes.Rsa) {
// FIXME: implement
- } else if (requirement.TokenType == SecurityTokenTypes.Saml) {
+ } else if (tokenRequirement.TokenType == SecurityTokenTypes.Saml) {
// FIXME: implement
- } else if (requirement.TokenType == SecurityTokenTypes.UserName)
- return CreateUserNameProvider (requirement);
- else if (requirement.TokenType == SecurityTokenTypes.Kerberos) {
- return CreateKerberosProvider (requirement);
+ } else if (tokenRequirement.TokenType == SecurityTokenTypes.UserName)
+ return CreateUserNameProvider (tokenRequirement);
+ else if (tokenRequirement.TokenType == SecurityTokenTypes.Kerberos) {
+ return CreateKerberosProvider (tokenRequirement);
}
- throw new NotSupportedException (String.Format ("Token type '{0}' is not supported", requirement.TokenType));
+ throw new NotSupportedException (String.Format ("Token type '{0}' is not supported", tokenRequirement.TokenType));
}
UserNameSecurityTokenProvider CreateUserNameProvider (
callback_instance_type = callbackInstanceType;
}
- public DuplexChannelFactory (object callbackInstance)
- : this (new InstanceContext (callbackInstance))
+ public DuplexChannelFactory (object callbackObject)
+ : this (new InstanceContext (callbackObject))
{
}
- public DuplexChannelFactory (object callbackInstance,
+ public DuplexChannelFactory (object callbackObject,
string endpointConfigurationName)
- : this (new InstanceContext (callbackInstance), endpointConfigurationName)
+ : this (new InstanceContext (callbackObject), endpointConfigurationName)
{
}
- public DuplexChannelFactory (object callbackInstance,
+ public DuplexChannelFactory (object callbackObject,
string endpointConfigurationName,
EndpointAddress remoteAddress)
- : this (new InstanceContext (callbackInstance), endpointConfigurationName, remoteAddress)
+ : this (new InstanceContext (callbackObject), endpointConfigurationName, remoteAddress)
{
}
- public DuplexChannelFactory (object callbackInstance,
+ public DuplexChannelFactory (object callbackObject,
ServiceEndpoint endpoint)
- : this (new InstanceContext (callbackInstance), endpoint)
+ : this (new InstanceContext (callbackObject), endpoint)
{
}
- public DuplexChannelFactory (object callbackInstance,
+ public DuplexChannelFactory (object callbackObject,
Binding binding)
- : this (new InstanceContext (callbackInstance), binding)
+ : this (new InstanceContext (callbackObject), binding)
{
}
- public DuplexChannelFactory (object callbackInstance,
+ public DuplexChannelFactory (object callbackObject,
Binding binding,
string remoteAddress)
- : this (callbackInstance, binding, new EndpointAddress (remoteAddress))
+ : this (callbackObject, binding, new EndpointAddress (remoteAddress))
{
}
- public DuplexChannelFactory (object callbackInstance,
+ public DuplexChannelFactory (object callbackObject,
Binding binding,
EndpointAddress remoteAddress)
- : this (new InstanceContext (callbackInstance), binding, remoteAddress)
+ : this (new InstanceContext (callbackObject), binding, remoteAddress)
{
}
}
protected DuplexClientBase (object callbackInstance,
- string bindingConfigurationName, EndpointAddress remoteAddress)
- : this (new InstanceContext (callbackInstance), bindingConfigurationName, remoteAddress)
+ string endpointConfigurationName, EndpointAddress remoteAddress)
+ : this (new InstanceContext (callbackInstance), endpointConfigurationName, remoteAddress)
{
}
}
protected DuplexClientBase (InstanceContext callbackInstance,
- string endpointConfigurationName, EndpointAddress address)
- : base (callbackInstance, endpointConfigurationName, address)
+ string endpointConfigurationName, EndpointAddress remoteAddress)
+ : base (callbackInstance, endpointConfigurationName, remoteAddress)
{
}
public void WriteTo (
AddressingVersion addressingVersion,
XmlDictionaryWriter writer,
- XmlDictionaryString localname,
+ XmlDictionaryString localName,
XmlDictionaryString ns)
{
- writer.WriteStartElement (localname, ns);
+ writer.WriteStartElement (localName, ns);
WriteContentsTo (addressingVersion, writer);
writer.WriteEndElement ();
}
public void WriteTo (
AddressingVersion addressingVersion,
- XmlWriter writer, string localname, string ns)
+ XmlWriter writer, string localName, string ns)
{
- writer.WriteStartElement (localname, ns);
+ writer.WriteStartElement (localName, ns);
WriteContentsTo (addressingVersion, writer);
writer.WriteEndElement ();
}
return new X509CertificateEndpointIdentity (primaryCertificate, supportingCertificates);
}
- public override bool Equals (object other)
+ public override bool Equals (object obj)
{
- EndpointIdentity e = other as EndpointIdentity;
+ EndpointIdentity e = obj as EndpointIdentity;
return e != null && comparer.Equals (claim, e.claim);
}
return String.Concat ("identity(", claim, ")");
}
- protected void Initialize (Claim claim)
+ protected void Initialize (Claim identityClaim)
{
- Initialize (claim, Claim.DefaultComparer);
+ Initialize (identityClaim, Claim.DefaultComparer);
}
- protected void Initialize (Claim claim, IEqualityComparer<Claim> comparer)
+ protected void Initialize (Claim identityClaim, IEqualityComparer<Claim> claimComparer)
{
- if (claim == null)
- throw new ArgumentNullException ("claim");
- if (comparer == null)
- throw new ArgumentNullException ("comparer");
- this.claim = claim;
- this.comparer = comparer;
+ if (identityClaim == null)
+ throw new ArgumentNullException ("identityClaim");
+ if (claimComparer == null)
+ throw new ArgumentNullException ("claimComparer");
+ this.claim = identityClaim;
+ this.comparer = claimComparer;
}
}
}
{
}
- public FaultException (string msg)
- : this (new FaultReason (msg))
+ public FaultException (string reason)
+ : this (new FaultReason (reason))
{
}
- public FaultException (string msg, FaultCode code)
- : this (new FaultReason (msg), code)
+ public FaultException (string reason, FaultCode code)
+ : this (new FaultReason (reason), code)
{
}
public class MsmqException : ExternalException
{
public MsmqException () : base () {}
- public MsmqException (string msg) : base (msg) {}
- public MsmqException (string msg, int win32ErrorCode) : base (msg, win32ErrorCode) {}
- public MsmqException (string msg, Exception inner) : base (msg, inner) {}
+ public MsmqException (string message) : base (message) {}
+ public MsmqException (string message, int error) : base (message, error) {}
+ public MsmqException (string message, Exception inner) : base (message, inner) {}
protected MsmqException (SerializationInfo info, StreamingContext context) :
base (info, context) {}
}
public class MsmqPoisonMessageException : PoisonMessageException
{
public MsmqPoisonMessageException () : base () {}
- public MsmqPoisonMessageException (string msg) : base (msg) {}
- public MsmqPoisonMessageException (string msg, Exception inner) : base (msg, inner) {}
+ public MsmqPoisonMessageException (string message) : base (message) {}
+ public MsmqPoisonMessageException (string message, Exception innerException) : base (message, innerException) {}
protected MsmqPoisonMessageException (SerializationInfo info, StreamingContext context) :
base (info, context) {}
}
-//
+//
// OptionalReliableSession.cs
//
// Author:
{
}
- public OptionalReliableSession (ReliableSessionBindingElement binding)
- : base (binding)
+ public OptionalReliableSession (ReliableSessionBindingElement reliableSessionBindingElement)
+ : base (reliableSessionBindingElement)
{
- if (binding == null)
- throw new ArgumentNullException ("binding");
+ if (reliableSessionBindingElement == null)
+ throw new ArgumentNullException ("reliableSessionBindingElement");
}
public bool Enabled {
public class PoisonMessageException : SystemException
{
public PoisonMessageException () : base () {}
- public PoisonMessageException (string msg) : base (msg) {}
- public PoisonMessageException (string msg, Exception inner) : base (msg, inner) {}
+ public PoisonMessageException (string message) : base (message) {}
+ public PoisonMessageException (string message, Exception innerException) : base (message, innerException) {}
protected PoisonMessageException (SerializationInfo info, StreamingContext context) :
base (info, context) {}
}
-//
+//
// ReliableSession.cs
//
// Author:
{
}
- public ReliableSession (ReliableSessionBindingElement binding)
+ public ReliableSession (ReliableSessionBindingElement reliableSessionBindingElement)
{
- if (binding == null)
- throw new ArgumentNullException ("binding");
- InactivityTimeout = binding.InactivityTimeout;
- Ordered = binding.Ordered;
+ if (reliableSessionBindingElement == null)
+ throw new ArgumentNullException ("reliableSessionBindingElement");
+ InactivityTimeout = reliableSessionBindingElement.InactivityTimeout;
+ Ordered = reliableSessionBindingElement.Ordered;
}
public TimeSpan InactivityTimeout { get; set; }
throw new NotImplementedException ();
}
- public RsaEndpointIdentity (X509Certificate2 cert)
+ public RsaEndpointIdentity (X509Certificate2 certificate)
{
- if (cert == null)
- throw new ArgumentNullException ("cert");
- rsa = (RSA) cert.PublicKey.Key;
+ if (certificate == null)
+ throw new ArgumentNullException ("certificate");
+ rsa = (RSA) certificate.PublicKey.Key;
}
}
}
{
public class ServiceAuthorizationManager
{
- public virtual bool CheckAccess (OperationContext context)
+ public virtual bool CheckAccess (OperationContext operationContext)
{
- return CheckAccessCore (context);
+ return CheckAccessCore (operationContext);
}
- public virtual bool CheckAccess (OperationContext context, ref Message message)
+ public virtual bool CheckAccess (OperationContext operationContext, ref Message message)
{
- return CheckAccessCore (context);
+ return CheckAccessCore (operationContext);
}
[MonoTODO]
- protected virtual bool CheckAccessCore (OperationContext context)
+ protected virtual bool CheckAccessCore (OperationContext operationContext)
{
return false;
}
[MonoTODO]
- protected virtual ReadOnlyCollection<IAuthorizationPolicy> GetAuthorizationPolicies (OperationContext context)
+ protected virtual ReadOnlyCollection<IAuthorizationPolicy> GetAuthorizationPolicies (OperationContext operationContext)
{
throw new NotImplementedException ();
}
{
}
- public ServiceHost (object serviceInstance,
+ public ServiceHost (object singletonInstance,
params Uri [] baseAddresses)
{
- if (serviceInstance == null)
- throw new ArgumentNullException ("serviceInstance");
- InitializeDescription (serviceInstance,
+ if (singletonInstance == null)
+ throw new ArgumentNullException ("singletonInstance");
+ InitializeDescription (singletonInstance,
new UriSchemeKeyedCollection (baseAddresses));
}
InitializeDescription (baseAddresses);
}
- protected void InitializeDescription (object serviceInstance, UriSchemeKeyedCollection baseAddresses)
+ protected void InitializeDescription (object singletonInstance, UriSchemeKeyedCollection baseAddresses)
{
- instance = serviceInstance;
- InitializeDescription (serviceInstance.GetType (), baseAddresses);
+ instance = singletonInstance;
+ InitializeDescription (singletonInstance.GetType (), baseAddresses);
}
}
}
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.");
}
- protected void LoadConfigurationSection (ServiceElement element)
+ protected void LoadConfigurationSection (ServiceElement serviceSection)
{
- ApplyServiceElement (element);
+ ApplyServiceElement (serviceSection);
}
protected override sealed void OnAbort ()
public class UriSchemeKeyedCollection
: SynchronizedKeyedCollection<string, Uri>
{
- public UriSchemeKeyedCollection (params Uri [] uris)
+ public UriSchemeKeyedCollection (params Uri [] addresses)
: base (new object ())
{
- if (uris == null)
+ if (addresses == null)
/* FIXME: masterinfo says, param name should be
baseAddresses */
- throw new ArgumentNullException ("uris");
+ throw new ArgumentNullException ("addresses");
- for (int i = 0; i < uris.Length; i ++) {
- if (!uris [i].IsAbsoluteUri)
+ for (int i = 0; i < addresses.Length; i ++) {
+ if (!addresses [i].IsAbsoluteUri)
throw new ArgumentException ("Only an absolute URI can be used as a base address");
- if (Contains (uris [i].Scheme))
- throw new ArgumentException ("Collection already contains an address with scheme "+ uris [i].Scheme);
- if (uris [i].Query != String.Empty)
+ if (Contains (addresses [i].Scheme))
+ throw new ArgumentException ("Collection already contains an address with scheme "+ addresses [i].Scheme);
+ if (addresses [i].Query != String.Empty)
throw new ArgumentException ("A base address cannot contain a query string.");
- InsertItem (i, uris [i]);
+ InsertItem (i, addresses [i]);
}
}
-//
+//
// WS2007FederationHttpBinding.cs
//
// Author:
}
[MonoTODO]
- public WS2007FederationHttpBinding (string configurationName)
- : base (configurationName)
+ public WS2007FederationHttpBinding (string configName)
+ : base (configName)
{
throw new NotImplementedException ();
}
-//
+//
// WS2007HttpBinding.cs
//
// Author:
{
}
- public WS2007HttpBinding (SecurityMode mode)
- : base (mode)
+ public WS2007HttpBinding (SecurityMode securityMode)
+ : base (securityMode)
{
}
- public WS2007HttpBinding (SecurityMode mode, bool reliableSessionEnabled)
- : base (mode, reliableSessionEnabled)
+ public WS2007HttpBinding (SecurityMode securityMode, bool reliableSessionEnabled)
+ : base (securityMode, reliableSessionEnabled)
{
}
[MonoTODO]
- public WS2007HttpBinding (string configurationName)
- : base (configurationName)
+ public WS2007HttpBinding (string configName)
+ : base (configName)
{
}
}
}
[MonoTODO]
- public WSFederationHttpBinding (string configurationName)
+ public WSFederationHttpBinding (string configName)
{
throw new NotImplementedException ();
}
-//
+//
// WSHttpBinding.cs
//
// Author:
{
}
- public WSHttpBinding (SecurityMode mode)
- : this (mode, false)
+ public WSHttpBinding (SecurityMode securityMode)
+ : this (securityMode, false)
{
}
- public WSHttpBinding (SecurityMode mode,
+ public WSHttpBinding (SecurityMode securityMode,
bool reliableSessionEnabled)
: base (reliableSessionEnabled)
{
- security = new WSHttpSecurity (mode);
+ security = new WSHttpSecurity (securityMode);
}
[MonoTODO]
- public WSHttpBinding (string configurationName)
+ public WSHttpBinding (string configName)
{
throw new NotImplementedException ();
}
X509Certificate2 primary;
X509Certificate2Collection supporting, all;
- public X509CertificateEndpointIdentity (X509Certificate2 cert)
+ public X509CertificateEndpointIdentity (X509Certificate2 certificate)
{
- if (cert == null)
- throw new ArgumentNullException ("cert");
- primary = cert;
- Initialize (Claim.CreateThumbprintClaim (cert.GetCertHash ()));
+ if (certificate == null)
+ throw new ArgumentNullException ("certificate");
+ primary = certificate;
+ Initialize (Claim.CreateThumbprintClaim (certificate.GetCertHash ()));
}
public X509CertificateEndpointIdentity (
this.options = options;
}
- public IAsyncResult BeginCommit (AsyncCallback callback,
- object user_defined_state)
+ public IAsyncResult BeginCommit (AsyncCallback asyncCallback,
+ object asyncState)
{
- this.callback = callback;
- this.user_defined_state = user_defined_state;
+ this.callback = asyncCallback;
+ this.user_defined_state = asyncState;
AsyncCallback cb = null;
- if (callback != null)
+ if (asyncCallback != null)
cb = new AsyncCallback (CommitCallback);
asyncResult = BeginCommitInternal (cb);
return this;
}
- public void EndCommit (IAsyncResult ar)
+ public void EndCommit (IAsyncResult asyncResult)
{
- if (ar != this)
+ if (asyncResult != this)
throw new ArgumentException ("The IAsyncResult parameter must be the same parameter as returned by BeginCommit.", "asyncResult");
- EndCommitInternal (asyncResult);
+ EndCommitInternal (this.asyncResult);
}
private void CommitCallback (IAsyncResult ar)
[InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
public interface IDtcTransaction
{
- void Abort (IntPtr manager, int whatever, int whatever2);
+ void Abort (IntPtr reason, int retaining, int async);
- void Commit (int whatever, int whatever2, int whatever3);
+ void Commit (int retaining, int commitType, int reserved);
- void GetTransactionInfo (IntPtr whatever);
+ void GetTransactionInfo (IntPtr transactionInformation);
}
}
{
void Initialize ();
- void Rollback (SinglePhaseEnlistment enlistment);
+ void Rollback (SinglePhaseEnlistment singlePhaseEnlistment);
- void SinglePhaseCommit (SinglePhaseEnlistment enlistment);
+ void SinglePhaseCommit (SinglePhaseEnlistment singlePhaseEnlistment);
}
}
public interface ISinglePhaseNotification
: IEnlistmentNotification
{
- void SinglePhaseCommit (SinglePhaseEnlistment enlistment);
+ void SinglePhaseCommit (SinglePhaseEnlistment singlePhaseEnlistment);
}
}
}
[MonoTODO]
- public void ForceRollback (Exception ex)
+ public void ForceRollback (Exception e)
{
- tx.Rollback (ex, enlisted);
+ tx.Rollback (e, enlisted);
/* See test RMFail2 */
((ManualResetEvent) waitHandle).Set ();
}
[Serializable]
public sealed class SubordinateTransaction : Transaction
{
- public SubordinateTransaction (IsolationLevel level,
+ public SubordinateTransaction (IsolationLevel isoLevel,
ISimpleTransactionSuperior superior)
{
throw new NotImplementedException ();
[MonoTODO]
public DependentTransaction DependentClone (
- DependentCloneOption option)
+ DependentCloneOption cloneOption)
{
DependentTransaction d =
- new DependentTransaction (this, option);
+ new DependentTransaction (this, cloneOption);
dependents.Add (d);
return d;
}
[MonoTODO ("Only SinglePhase commit supported for durable resource managers.")]
[PermissionSetAttribute (SecurityAction.LinkDemand)]
- public Enlistment EnlistDurable (Guid manager,
- IEnlistmentNotification notification,
- EnlistmentOptions options)
+ public Enlistment EnlistDurable (Guid resourceManagerIdentifier,
+ IEnlistmentNotification enlistmentNotification,
+ EnlistmentOptions enlistmentOptions)
{
throw new NotImplementedException ("DTC unsupported, only SinglePhase commit supported for durable resource managers.");
}
[MonoTODO ("Only Local Transaction Manager supported. Cannot have more than 1 durable resource per transaction. Only EnlistmentOptions.None supported yet.")]
[PermissionSetAttribute (SecurityAction.LinkDemand)]
- public Enlistment EnlistDurable (Guid manager,
- ISinglePhaseNotification notification,
- EnlistmentOptions options)
+ public Enlistment EnlistDurable (Guid resourceManagerIdentifier,
+ ISinglePhaseNotification singlePhaseNotification,
+ EnlistmentOptions enlistmentOptions)
{
EnsureIncompleteCurrentScope ();
if (pspe != null || Durables.Count > 0)
throw new NotImplementedException ("DTC unsupported, multiple durable resource managers aren't supported.");
- if (options != EnlistmentOptions.None)
+ if (enlistmentOptions != EnlistmentOptions.None)
throw new NotImplementedException ("EnlistmentOptions other than None aren't supported");
- Durables.Add (notification);
+ Durables.Add (singlePhaseNotification);
/* FIXME: Enlistment ?? */
return new Enlistment ();
}
public bool EnlistPromotableSinglePhase (
- IPromotableSinglePhaseNotification notification)
+ IPromotableSinglePhaseNotification promotableSinglePhaseNotification)
{
EnsureIncompleteCurrentScope ();
if (pspe != null || Durables.Count > 0)
return false;
- pspe = notification;
+ pspe = promotableSinglePhaseNotification;
pspe.Initialize();
return true;
[MonoTODO ("EnlistmentOptions being ignored")]
public Enlistment EnlistVolatile (
- IEnlistmentNotification notification,
- EnlistmentOptions options)
+ IEnlistmentNotification enlistmentNotification,
+ EnlistmentOptions enlistmentOptions)
{
- return EnlistVolatileInternal (notification, options);
+ return EnlistVolatileInternal (enlistmentNotification, enlistmentOptions);
}
[MonoTODO ("EnlistmentOptions being ignored")]
public Enlistment EnlistVolatile (
- ISinglePhaseNotification notification,
- EnlistmentOptions options)
+ ISinglePhaseNotification singlePhaseNotification,
+ EnlistmentOptions enlistmentOptions)
{
/* FIXME: Anything extra reqd for this? */
- return EnlistVolatileInternal (notification, options);
+ return EnlistVolatileInternal (singlePhaseNotification, enlistmentOptions);
}
private Enlistment EnlistVolatileInternal (
Rollback (null);
}
- public void Rollback (Exception ex)
+ public void Rollback (Exception e)
{
EnsureIncompleteCurrentScope ();
- Rollback (ex, null);
+ Rollback (e, null);
}
internal void Rollback (Exception ex, object abortingEnlisted)
[MonoTODO]
public static byte [] GetExportCookie (Transaction transaction,
- byte [] exportCookie)
+ byte [] whereabouts)
{
throw new NotImplementedException ();
}
[MonoTODO]
public static Transaction GetTransactionFromDtcTransaction (
- IDtcTransaction dtc)
+ IDtcTransaction transactionNative)
{
throw new NotImplementedException ();
}
[MonoTODO]
public static Transaction GetTransactionFromExportCookie (
- byte [] exportCookie)
+ byte [] cookie)
{
throw new NotImplementedException ();
}
[MonoTODO]
- public static Transaction GetTransactionFromTransmitterPropagationToken (byte [] token)
+ public static Transaction GetTransactionFromTransmitterPropagationToken (byte [] propagationToken)
{
throw new NotImplementedException ();
}
}
[MonoTODO ("Not implemented")]
- public static void RecoveryComplete (Guid manager)
+ public static void RecoveryComplete (Guid resourceManagerIdentifier)
{
throw new NotImplementedException ();
}
[MonoTODO ("Not implemented")]
- public static Enlistment Reenlist (Guid manager,
- byte[] recoveryInfo,
- IEnlistmentNotification notification)
+ public static Enlistment Reenlist (Guid resourceManagerIdentifier,
+ byte[] recoveryInformation,
+ IEnlistmentNotification enlistmentNotification)
{
throw new NotImplementedException ();
}
set { timeout = value; }
}
- public static bool operator == (TransactionOptions o1,
- TransactionOptions o2)
+ public static bool operator == (TransactionOptions x,
+ TransactionOptions y)
{
- return o1.level == o2.level &&
- o1.timeout == o2.timeout;
+ return x.level == y.level &&
+ x.timeout == y.timeout;
}
- public static bool operator != (TransactionOptions o1,
- TransactionOptions o2)
+ public static bool operator != (TransactionOptions x,
+ TransactionOptions y)
{
- return o1.level != o2.level ||
- o1.timeout != o2.timeout;
+ return x.level != y.level ||
+ x.timeout != y.timeout;
}
public override bool Equals (object obj)
{
}
- public TransactionScope(TransactionScopeAsyncFlowOption asyncFlow)
+ public TransactionScope(TransactionScopeAsyncFlowOption asyncFlowOption)
: this(TransactionScopeOption.Required,
- TransactionManager.DefaultTimeout, asyncFlow)
+ TransactionManager.DefaultTimeout, asyncFlowOption)
{
}
- public TransactionScope (Transaction transaction)
- : this (transaction, TransactionManager.DefaultTimeout)
+ public TransactionScope (Transaction transactionToUse)
+ : this (transactionToUse, TransactionManager.DefaultTimeout)
{
}
- public TransactionScope (Transaction transaction,
- TimeSpan timeout)
- : this (transaction, timeout, DTCOption.None)
+ public TransactionScope (Transaction transactionToUse,
+ TimeSpan scopeTimeout)
+ : this (transactionToUse, scopeTimeout, DTCOption.None)
{
}
[MonoTODO ("EnterpriseServicesInteropOption not supported.")]
- public TransactionScope (Transaction transaction,
- TimeSpan timeout, DTCOption opt)
+ public TransactionScope (Transaction transactionToUse,
+ TimeSpan scopeTimeout, DTCOption interopOption)
{
Initialize (TransactionScopeOption.Required,
- transaction, defaultOptions, opt, timeout, TransactionScopeAsyncFlowOption.Suppress);
+ transactionToUse, defaultOptions, interopOption, scopeTimeout, TransactionScopeAsyncFlowOption.Suppress);
}
- public TransactionScope (TransactionScopeOption option)
- : this (option, TransactionManager.DefaultTimeout)
+ public TransactionScope (TransactionScopeOption scopeOption)
+ : this (scopeOption, TransactionManager.DefaultTimeout)
{
}
- public TransactionScope (TransactionScopeOption option,
- TimeSpan timeout)
- : this (option, timeout, TransactionScopeAsyncFlowOption.Suppress)
+ public TransactionScope (TransactionScopeOption scopeOption,
+ TimeSpan scopeTimeout)
+ : this (scopeOption, scopeTimeout, TransactionScopeAsyncFlowOption.Suppress)
{
}
{
}
- public TransactionScope (TransactionScopeOption option,
- TimeSpan timeout, TransactionScopeAsyncFlowOption asyncFlow)
+ public TransactionScope (TransactionScopeOption scopeOption,
+ TimeSpan scopeTimeout, TransactionScopeAsyncFlowOption asyncFlow)
{
- Initialize (option, null, defaultOptions,
- DTCOption.None, timeout, asyncFlow);
+ Initialize (scopeOption, null, defaultOptions,
+ DTCOption.None, scopeTimeout, asyncFlow);
}
public TransactionScope (TransactionScopeOption scopeOption,
- TransactionOptions options)
- : this (scopeOption, options, DTCOption.None)
+ TransactionOptions transactionOptions)
+ : this (scopeOption, transactionOptions, DTCOption.None)
{
}
[MonoTODO ("EnterpriseServicesInteropOption not supported")]
public TransactionScope (TransactionScopeOption scopeOption,
- TransactionOptions options,
- DTCOption opt)
+ TransactionOptions transactionOptions,
+ DTCOption interopOption)
{
- Initialize (scopeOption, null, options, opt,
+ Initialize (scopeOption, null, transactionOptions, interopOption,
TransactionManager.DefaultTimeout, TransactionScopeAsyncFlowOption.Suppress);
}
void Initialize (TransactionScopeOption scopeOption,
Transaction tx, TransactionOptions options,
- DTCOption interop, TimeSpan timeout, TransactionScopeAsyncFlowOption asyncFlow)
+ DTCOption interop, TimeSpan scopeTimeout, TransactionScopeAsyncFlowOption asyncFlow)
{
completed = false;
isRoot = false;
nested = 0;
asyncFlowEnabled = asyncFlow == TransactionScopeAsyncFlowOption.Enabled;
- if (timeout < TimeSpan.Zero)
- throw new ArgumentOutOfRangeException ("timeout");
+ if (scopeTimeout < TimeSpan.Zero)
+ throw new ArgumentOutOfRangeException ("scopeTimeout");
- this.timeout = timeout;
+ this.timeout = scopeTimeout;
oldTransaction = Transaction.CurrentInternal;
TransactionScope scope = new TransactionScope (TransactionScopeOption.Required, TimeSpan.FromSeconds (-1));
Assert.Fail ("Expected exception when passing TransactionScopeOption and an invalid TimeSpan.");
} catch (ArgumentOutOfRangeException ex) {
- Assert.AreEqual (ex.ParamName, "timeout");
+ Assert.AreEqual ("scopeTimeout", ex.ParamName);
}
try {
TransactionScope scope = new TransactionScope (null, TimeSpan.FromSeconds (-1));
Assert.Fail ("Expected exception when passing TransactionScopeOption and an invalid TimeSpan.");
} catch (ArgumentOutOfRangeException ex) {
- Assert.AreEqual (ex.ParamName, "timeout");
+ Assert.AreEqual ("scopeTimeout", ex.ParamName);
}
}
{
}
- public abstract bool ChangePassword (string name, string oldPwd, string newPwd);
- public abstract bool ChangePasswordQuestionAndAnswer (string name, string password, string newPwdQuestion, string newPwdAnswer);
- public abstract MembershipUser CreateUser (string username, string password, string email, string pwdQuestion, string pwdAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status);
- public abstract bool DeleteUser (string name, bool deleteAllRelatedData);
+ public abstract bool ChangePassword (string username, string oldPassword, string newPassword);
+ public abstract bool ChangePasswordQuestionAndAnswer (string username, string password, string newPasswordQuestion, string newPasswordAnswer);
+ public abstract MembershipUser CreateUser (string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status);
+ public abstract bool DeleteUser (string username, bool deleteAllRelatedData);
public abstract MembershipUserCollection FindUsersByEmail (string emailToMatch, int pageIndex, int pageSize, out int totalRecords);
- public abstract MembershipUserCollection FindUsersByName (string nameToMatch, int pageIndex, int pageSize, out int totalRecords);
+ public abstract MembershipUserCollection FindUsersByName (string usernameToMatch, int pageIndex, int pageSize, out int totalRecords);
public abstract MembershipUserCollection GetAllUsers (int pageIndex, int pageSize, out int totalRecords);
public abstract int GetNumberOfUsersOnline ();
- public abstract string GetPassword (string name, string answer);
- public abstract MembershipUser GetUser (string name, bool userIsOnline);
+ public abstract string GetPassword (string username, string answer);
+ public abstract MembershipUser GetUser (string username, bool userIsOnline);
public abstract MembershipUser GetUser (object providerUserKey, bool userIsOnline);
public abstract string GetUserNameByEmail (string email);
- public abstract string ResetPassword (string name, string answer);
+ public abstract string ResetPassword (string username, string answer);
public abstract void UpdateUser (MembershipUser user);
- public abstract bool ValidateUser (string name, string password);
+ public abstract bool ValidateUser (string username, string password);
public abstract bool UnlockUser (string userName);
public abstract string ApplicationName { get; set; }
public abstract string PasswordStrengthRegularExpression { get; }
public abstract bool RequiresUniqueEmail { get; }
- protected virtual void OnValidatingPassword (ValidatePasswordEventArgs args)
+ protected virtual void OnValidatingPassword (ValidatePasswordEventArgs e)
{
MembershipValidatePasswordEventHandler eh = events [validatingPasswordEvent] as MembershipValidatePasswordEventHandler;
if (eh != null)
- eh (this, args);
+ eh (this, e);
}
protected virtual byte [] DecryptPassword (byte [] encodedPassword)
return GetPassword (null);
}
- public virtual string GetPassword (string answer)
+ public virtual string GetPassword (string passwordAnswer)
{
- return Provider.GetPassword (UserName, answer);
+ return Provider.GetPassword (UserName, passwordAnswer);
}
public virtual string ResetPassword ()
return ResetPassword (null);
}
- public virtual string ResetPassword (string answer)
+ public virtual string ResetPassword (string passwordAnswer)
{
- string newPass = Provider.ResetPassword (UserName, answer);
+ string newPass = Provider.ResetPassword (UserName, passwordAnswer);
UpdateUser ();
{
}
- public abstract void AddUsersToRoles (string [] usernames, string [] rolenames);
- public abstract void CreateRole (string rolename);
- public abstract bool DeleteRole (string rolename, bool throwOnPopulatedRole);
+ public abstract void AddUsersToRoles (string [] usernames, string [] roleNames);
+ public abstract void CreateRole (string roleName);
+ public abstract bool DeleteRole (string roleName, bool throwOnPopulatedRole);
public abstract string [] FindUsersInRole (string roleName, string usernameToMatch);
public abstract string [] GetAllRoles ();
public abstract string [] GetRolesForUser (string username);
- public abstract string [] GetUsersInRole (string rolename);
- public abstract bool IsUserInRole (string username, string rolename);
- public abstract void RemoveUsersFromRoles (string [] usernames, string [] rolenames);
- public abstract bool RoleExists (string rolename);
+ public abstract string [] GetUsersInRole (string roleName);
+ public abstract bool IsUserInRole (string username, string roleName);
+ public abstract void RemoveUsersFromRoles (string [] usernames, string [] roleNames);
+ public abstract bool RoleExists (string roleName);
public abstract string ApplicationName { get; set; }
}
}
-//\r
+//\r
// ScriptModule.cs\r
//\r
// Author:\r
{\r
public class ScriptModule : IHttpModule\r
{\r
- protected virtual void Init (HttpApplication context) {\r
- context.PreSendRequestHeaders += new EventHandler (PreSendRequestHeaders);\r
- context.PostAcquireRequestState += new EventHandler (PostAcquireRequestState);\r
- context.AuthenticateRequest += new EventHandler (AuthenticateRequest);\r
+ protected virtual void Init (HttpApplication app) {\r
+ app.PreSendRequestHeaders += new EventHandler (PreSendRequestHeaders);\r
+ app.PostAcquireRequestState += new EventHandler (PostAcquireRequestState);\r
+ app.AuthenticateRequest += new EventHandler (AuthenticateRequest);\r
}\r
\r
void AuthenticateRequest (object sender, EventArgs e) {\r
-//
+//
// ScriptResourceAttribute.cs
//
// Author:
string _scriptResourceName;
string _typeName;
- public ScriptResourceAttribute (string scriptName, string scriptResourceName, string typeName) {
+ public ScriptResourceAttribute (string scriptName, string stringResourceName, string stringResourceClientTypeName) {
_scriptName = scriptName;
- _scriptResourceName = scriptResourceName;
- _typeName = typeName;
+ _scriptResourceName = stringResourceName;
+ _typeName = stringResourceClientTypeName;
}
public string ScriptName {
properties = new ConfigurationPropertyCollection();
}
- public void Add (AssemblyInfo info)
+ public void Add (AssemblyInfo assemblyInformation)
{
- BaseAdd (info, false);
+ BaseAdd (assemblyInformation, false);
}
public void Clear ()
set { if (BaseGet(index) != null) BaseRemoveAt(index); BaseAdd(index, value); }
}
- public new BufferModeSettings this [string name] {
- get { return (BufferModeSettings) BaseGet (name); }
+ public new BufferModeSettings this [string key] {
+ get { return (BufferModeSettings) BaseGet (key); }
}
protected internal override ConfigurationPropertyCollection Properties {
set { if (BaseGet (index) != null) BaseRemoveAt (index); BaseAdd (index, value); }
}
- public new EventMappingSettings this [string name] {
- get { return (EventMappingSettings) BaseGet (name); }
+ public new EventMappingSettings this [string key] {
+ get { return (EventMappingSettings) BaseGet (key); }
}
protected internal override ConfigurationPropertyCollection Properties {
{
}
- public void Add (HttpModuleAction httpModuleAction)
+ public void Add (HttpModuleAction httpModule)
{
- BaseAdd (httpModuleAction);
+ BaseAdd (httpModule);
}
public void Clear ()
BaseRemoveAt (index);
}
- public new ProfileSettings this [string name] {
- get { return (ProfileSettings)BaseGet (name); }
+ public new ProfileSettings this [string key] {
+ get { return (ProfileSettings)BaseGet (key); }
}
public ProfileSettings this [int index] {
groupSettings = new ProfileGroupSettingsCollection ();
}
- public override bool Equals (object obj)
+ public override bool Equals (object rootProfilePropertySettingsCollection)
{
- RootProfilePropertySettingsCollection col = obj as RootProfilePropertySettingsCollection;
+ RootProfilePropertySettingsCollection col = rootProfilePropertySettingsCollection as RootProfilePropertySettingsCollection;
if (col == null)
return false;
BaseRemoveAt (index);
}
- public new RuleSettings this [string name] {
- get { return (RuleSettings) BaseGet (name); }
+ public new RuleSettings this [string key] {
+ get { return (RuleSettings) BaseGet (key); }
}
public RuleSettings this [int index] {
this.MappedTagType = mappedTagTypeName;
}
- public override bool Equals (object map)
+ public override bool Equals (object o)
{
- TagMapInfo info = map as TagMapInfo;
+ TagMapInfo info = o as TagMapInfo;
if (info == null)
return false;
get { return "trustLevel"; }
}
- public new TrustLevel this [string name] {
- get { return (TrustLevel) BaseGet (name); }
+ public new TrustLevel this [string key] {
+ get { return (TrustLevel) BaseGet (key); }
}
public TrustLevel this [int index] {
public interface IAppManagerAppDomainFactory
{
[return: MarshalAs (UnmanagedType.Interface)]
- object Create ([In, MarshalAs(UnmanagedType.BStr)] string s,
- [In, MarshalAs(UnmanagedType.BStr)] string app_id);
+ object Create ([In, MarshalAs(UnmanagedType.BStr)] string appId,
+ [In, MarshalAs(UnmanagedType.BStr)] string appPath);
void Stop ();
}
}
{
public interface IWebEventCustomEvaluator
{
- bool CanFire (WebBaseEvent raised_event, RuleFiringRecord record);
+ bool CanFire (WebBaseEvent raisedEvent, RuleFiringRecord record);
}
}
object event_source;
int event_code, event_detail_code;
- protected WebBaseEvent (string message, object event_source, int event_code)
+ protected WebBaseEvent (string message, object eventSource, int eventCode)
{
this.message = message;
- this.event_source = event_source;
- this.event_code = event_code;
+ this.event_source = eventSource;
+ this.event_code = eventCode;
}
- protected WebBaseEvent (string message, object event_source, int event_code, int event_detail_code)
+ protected WebBaseEvent (string message, object eventSource, int eventCode, int eventDetailCode)
{
this.message = message;
- this.event_source = event_source;
- this.event_code = event_code;
- this.event_detail_code = event_detail_code;
+ this.event_source = eventSource;
+ this.event_code = eventCode;
+ this.event_detail_code = eventDetailCode;
}
public static WebApplicationInformation ApplicationInformation {
throw new NotImplementedException ();
}
- public static void Raise (WebBaseEvent event_raised)
+ public static void Raise (WebBaseEvent eventRaised)
{
throw new NotImplementedException ();
}
throw new NotImplementedException ();
}
- public virtual string ToString (bool include_app_info, bool include_custom_event_details)
+ public virtual string ToString (bool includeAppInfo, bool includeCustomEventDetails)
{
throw new NotImplementedException ();
}
public class ActiveDirectoryMembershipProvider : MembershipProvider {
[MonoTODO ("Not implemented")]
- public override bool ChangePassword (string username, string oldPwd, string newPwd)
+ public override bool ChangePassword (string username, string oldPassword, string newPassword)
{
throw new NotImplementedException ();
}
[MonoTODO ("Not implemented")]
- public override bool ChangePasswordQuestionAndAnswer (string username, string password, string newPwdQuestion, string newPwdAnswer)
+ public override bool ChangePasswordQuestionAndAnswer (string username, string password, string newPasswordQuestion, string newPasswordAnswer)
{
throw new NotImplementedException ();
}
[MonoTODO ("Not implemented")]
- public override MembershipUser CreateUser (string username, string password, string email, string pwdQuestion, string pwdAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status)
+ public override MembershipUser CreateUser (string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status)
{
throw new NotImplementedException ();
}
}
[MonoTODO ("Not implemented")]
- public override MembershipUserCollection FindUsersByName (string nameToMatch, int pageIndex, int pageSize, out int totalRecords)
+ public override MembershipUserCollection FindUsersByName (string usernameToMatch, int pageIndex, int pageSize, out int totalRecords)
{
throw new NotImplementedException ();
}
}
[MonoTODO("Not implemented")]
- public override string GetPassword (string username, string answer)
+ public override string GetPassword (string username, string passwordAnswer)
{
throw new NotImplementedException ();
}
}
[MonoTODO("Not implemented")]
- public override string ResetPassword (string username, string answer)
+ public override string ResetPassword (string username, string passwordAnswer)
{
throw new NotImplementedException ();
}
}
[MonoTODO("Not implemented")]
- public override bool UnlockUser (string userName)
+ public override bool UnlockUser (string username)
{
throw new NotImplementedException ();
}
return usr;
}
- public static MembershipUser CreateUser (string username, string password, string email, string pwdQuestion, string pwdAnswer, bool isApproved, out MembershipCreateStatus status)
+ public static MembershipUser CreateUser (string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, out MembershipCreateStatus status)
{
- return CreateUser (username, password, email, pwdQuestion, pwdAnswer, isApproved, null, out status);
+ return CreateUser (username, password, email, passwordQuestion, passwordAnswer, isApproved, null, out status);
}
- public static MembershipUser CreateUser (string username, string password, string email, string pwdQuestion, string pwdAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status)
+ public static MembershipUser CreateUser (string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status)
{
if (String.IsNullOrEmpty (username)) {
status = MembershipCreateStatus.InvalidUserName;
return null;
}
- return Provider.CreateUser (username, password, email, pwdQuestion, pwdAnswer, isApproved, providerUserKey, out status);
+ return Provider.CreateUser (username, password, email, passwordQuestion, passwordAnswer, isApproved, providerUserKey, out status);
}
public static bool DeleteUser (string username)
return Provider.GetUser (providerUserKey, userIsOnline);
}
- public static string GetUserNameByEmail (string email)
+ public static string GetUserNameByEmail (string emailToMatch)
{
- return Provider.GetUserNameByEmail (email);
+ return Provider.GetUserNameByEmail (emailToMatch);
}
public static void UpdateUser (MembershipUser user)
return Provider.FindUsersByEmail (emailToMatch, pageIndex, pageSize, out totalRecords);
}
- public static MembershipUserCollection FindUsersByName (string nameToMatch)
+ public static MembershipUserCollection FindUsersByName (string usernameToMatch)
{
int totalRecords;
- return Provider.FindUsersByName (nameToMatch, 0, int.MaxValue, out totalRecords);
+ return Provider.FindUsersByName (usernameToMatch, 0, int.MaxValue, out totalRecords);
}
- public static MembershipUserCollection FindUsersByName (string nameToMatch, int pageIndex, int pageSize, out int totalRecords)
+ public static MembershipUserCollection FindUsersByName (string usernameToMatch, int pageIndex, int pageSize, out int totalRecords)
{
- return Provider.FindUsersByName (nameToMatch, pageIndex, pageSize, out totalRecords);
+ return Provider.FindUsersByName (usernameToMatch, pageIndex, pageSize, out totalRecords);
}
public static string ApplicationName {
}
- public static void AddUsersToRole (string [] usernames, string rolename)
+ public static void AddUsersToRole (string [] usernames, string roleName)
{
- Provider.AddUsersToRoles (usernames, new string[] {rolename});
+ Provider.AddUsersToRoles (usernames, new string[] {roleName});
}
- public static void AddUsersToRoles (string [] usernames, string [] rolenames)
+ public static void AddUsersToRoles (string [] usernames, string [] roleNames)
{
- Provider.AddUsersToRoles (usernames, rolenames);
+ Provider.AddUsersToRoles (usernames, roleNames);
}
- public static void AddUserToRole (string username, string rolename)
+ public static void AddUserToRole (string username, string roleName)
{
- Provider.AddUsersToRoles (new string[] {username}, new string[] {rolename});
+ Provider.AddUsersToRoles (new string[] {username}, new string[] {roleName});
}
- public static void AddUserToRoles (string username, string [] rolenames)
+ public static void AddUserToRoles (string username, string [] roleNames)
{
- Provider.AddUsersToRoles (new string[] {username}, rolenames);
+ Provider.AddUsersToRoles (new string[] {username}, roleNames);
}
- public static void CreateRole (string rolename)
+ public static void CreateRole (string roleName)
{
- Provider.CreateRole (rolename);
+ Provider.CreateRole (roleName);
}
public static void DeleteCookie ()
}
}
- public static bool DeleteRole (string rolename)
+ public static bool DeleteRole (string roleName)
{
- return Provider.DeleteRole (rolename, true);
+ return Provider.DeleteRole (roleName, true);
}
- public static bool DeleteRole (string rolename, bool throwOnPopulatedRole)
+ public static bool DeleteRole (string roleName, bool throwOnPopulatedRole)
{
- return Provider.DeleteRole (rolename, throwOnPopulatedRole);
+ return Provider.DeleteRole (roleName, throwOnPopulatedRole);
}
public static string [] GetAllRoles ()
return Provider.GetRolesForUser (username);
}
- public static string [] GetUsersInRole (string rolename)
+ public static string [] GetUsersInRole (string roleName)
{
- return Provider.GetUsersInRole (rolename);
+ return Provider.GetUsersInRole (roleName);
}
- public static bool IsUserInRole (string rolename)
+ public static bool IsUserInRole (string roleName)
{
- return IsUserInRole (CurrentUser, rolename);
+ return IsUserInRole (CurrentUser, roleName);
}
- public static bool IsUserInRole (string username, string rolename)
+ public static bool IsUserInRole (string username, string roleName)
{
if (String.IsNullOrEmpty (username))
return false;
- return Provider.IsUserInRole (username, rolename);
+ return Provider.IsUserInRole (username, roleName);
}
- public static void RemoveUserFromRole (string username, string rolename)
+ public static void RemoveUserFromRole (string username, string roleName)
{
- Provider.RemoveUsersFromRoles (new string[] {username}, new string[] {rolename});
+ Provider.RemoveUsersFromRoles (new string[] {username}, new string[] {roleName});
}
- public static void RemoveUserFromRoles (string username, string [] rolenames)
+ public static void RemoveUserFromRoles (string username, string [] roleNames)
{
- Provider.RemoveUsersFromRoles (new string[] {username}, rolenames);
+ Provider.RemoveUsersFromRoles (new string[] {username}, roleNames);
}
- public static void RemoveUsersFromRole (string [] usernames, string rolename)
+ public static void RemoveUsersFromRole (string [] usernames, string roleName)
{
- Provider.RemoveUsersFromRoles (usernames, new string[] {rolename});
+ Provider.RemoveUsersFromRoles (usernames, new string[] {roleName});
}
- public static void RemoveUsersFromRoles (string [] usernames, string [] rolenames)
+ public static void RemoveUsersFromRoles (string [] usernames, string [] roleNames)
{
- Provider.RemoveUsersFromRoles (usernames, rolenames);
+ Provider.RemoveUsersFromRoles (usernames, roleNames);
}
- public static bool RoleExists (string rolename)
+ public static bool RoleExists (string roleName)
{
- return Provider.RoleExists (rolename);
+ return Provider.RoleExists (roleName);
}
- public static string[] FindUsersInRole (string rolename, string usernameToMatch)
+ public static string[] FindUsersInRole (string roleName, string usernameToMatch)
{
- return Provider.FindUsersInRole (rolename, usernameToMatch);
+ return Provider.FindUsersInRole (roleName, usernameToMatch);
}
public static string ApplicationName {
throw new ArgumentException (String.Format ("invalid format for {0}", pName));
}
- public override bool ChangePassword (string username, string oldPwd, string newPwd)
+ public override bool ChangePassword (string username, string oldPassword, string newPassword)
{
if (username != null) username = username.Trim ();
- if (oldPwd != null) oldPwd = oldPwd.Trim ();
- if (newPwd != null) newPwd = newPwd.Trim ();
+ if (oldPassword != null) oldPassword = oldPassword.Trim ();
+ if (newPassword != null) newPassword = newPassword.Trim ();
CheckParam ("username", username, 256);
- CheckParam ("oldPwd", oldPwd, 128);
- CheckParam ("newPwd", newPwd, 128);
+ CheckParam ("oldPassword", oldPassword, 128);
+ CheckParam ("newPassword", newPassword, 128);
- if (!CheckPassword (newPwd))
+ if (!CheckPassword (newPassword))
throw new ArgumentException (string.Format (
"New Password invalid. New Password length minimum: {0}. Non-alphanumeric characters required: {1}.",
MinRequiredPasswordLength,
MinRequiredNonAlphanumericCharacters));
using (DbConnection connection = CreateConnection ()) {
- PasswordInfo pi = ValidateUsingPassword (username, oldPwd);
+ PasswordInfo pi = ValidateUsingPassword (username, oldPassword);
if (pi != null) {
- EmitValidatingPassword (username, newPwd, false);
- string db_password = EncodePassword (newPwd, pi.PasswordFormat, pi.PasswordSalt);
+ EmitValidatingPassword (username, newPassword, false);
+ string db_password = EncodePassword (newPassword, pi.PasswordFormat, pi.PasswordSalt);
DbCommand command = factory.CreateCommand ();
command.Connection = connection;
}
}
- public override bool ChangePasswordQuestionAndAnswer (string username, string password, string newPwdQuestion, string newPwdAnswer)
+ public override bool ChangePasswordQuestionAndAnswer (string username, string password, string newPasswordQuestion, string newPasswordAnswer)
{
if (username != null) username = username.Trim ();
- if (newPwdQuestion != null) newPwdQuestion = newPwdQuestion.Trim ();
- if (newPwdAnswer != null) newPwdAnswer = newPwdAnswer.Trim ();
+ if (newPasswordQuestion != null) newPasswordQuestion = newPasswordQuestion.Trim ();
+ if (newPasswordAnswer != null) newPasswordAnswer = newPasswordAnswer.Trim ();
CheckParam ("username", username, 256);
if (RequiresQuestionAndAnswer)
- CheckParam ("newPwdQuestion", newPwdQuestion, 128);
+ CheckParam ("newPasswordQuestion", newPasswordQuestion, 128);
if (RequiresQuestionAndAnswer)
- CheckParam ("newPwdAnswer", newPwdAnswer, 128);
+ CheckParam ("newPasswordAnswer", newPasswordAnswer, 128);
using (DbConnection connection = CreateConnection ()) {
PasswordInfo pi = ValidateUsingPassword (username, password);
if (pi != null) {
- string db_passwordAnswer = EncodePassword (newPwdAnswer, pi.PasswordFormat, pi.PasswordSalt);
+ string db_passwordAnswer = EncodePassword (newPasswordAnswer, pi.PasswordFormat, pi.PasswordSalt);
DbCommand command = factory.CreateCommand ();
command.Connection = connection;
AddParameter (command, "@ApplicationName", ApplicationName);
AddParameter (command, "@UserName", username);
- AddParameter (command, "@NewPasswordQuestion", newPwdQuestion);
+ AddParameter (command, "@NewPasswordQuestion", newPasswordQuestion);
AddParameter (command, "@NewPasswordAnswer", db_passwordAnswer);
DbParameter returnValue = AddParameter (command, "@ReturnVal", ParameterDirection.ReturnValue, DbType.Int32, null);
public override MembershipUser CreateUser (string username,
string password,
string email,
- string pwdQuestion,
- string pwdAnswer,
+ string passwordQuestion,
+ string passwordAnswer,
bool isApproved,
object providerUserKey,
out MembershipCreateStatus status)
if (username != null) username = username.Trim ();
if (password != null) password = password.Trim ();
if (email != null) email = email.Trim ();
- if (pwdQuestion != null) pwdQuestion = pwdQuestion.Trim ();
- if (pwdAnswer != null) pwdAnswer = pwdAnswer.Trim ();
+ if (passwordQuestion != null) passwordQuestion = passwordQuestion.Trim ();
+ if (passwordAnswer != null) passwordAnswer = passwordAnswer.Trim ();
/* some initial validation */
if (username == null || username.Length == 0 || username.Length > 256 || username.IndexOf (',') != -1) {
return null;
}
if (RequiresQuestionAndAnswer &&
- (pwdQuestion == null ||
- pwdQuestion.Length == 0 || pwdQuestion.Length > 256)) {
+ (passwordQuestion == null ||
+ passwordQuestion.Length == 0 || passwordQuestion.Length > 256)) {
status = MembershipCreateStatus.InvalidQuestion;
return null;
}
if (RequiresQuestionAndAnswer &&
- (pwdAnswer == null ||
- pwdAnswer.Length == 0 || pwdAnswer.Length > 128)) {
+ (passwordAnswer == null ||
+ passwordAnswer.Length == 0 || passwordAnswer.Length > 128)) {
status = MembershipCreateStatus.InvalidAnswer;
return null;
}
password = EncodePassword (password, PasswordFormat, passwordSalt);
if (RequiresQuestionAndAnswer)
- pwdAnswer = EncodePassword (pwdAnswer, PasswordFormat, passwordSalt);
+ passwordAnswer = EncodePassword (passwordAnswer, PasswordFormat, passwordSalt);
/* make sure the hashed/encrypted password and
* answer are still under 128 characters. */
}
if (RequiresQuestionAndAnswer) {
- if (pwdAnswer.Length > 128) {
+ if (passwordAnswer.Length > 128) {
status = MembershipCreateStatus.InvalidAnswer;
return null;
}
AddParameter (command, "@Password", password);
AddParameter (command, "@PasswordSalt", passwordSalt);
AddParameter (command, "@Email", email);
- AddParameter (command, "@PasswordQuestion", pwdQuestion);
- AddParameter (command, "@PasswordAnswer", pwdAnswer);
+ AddParameter (command, "@PasswordQuestion", passwordQuestion);
+ AddParameter (command, "@PasswordAnswer", passwordAnswer);
AddParameter (command, "@IsApproved", isApproved);
AddParameter (command, "@CurrentTimeUtc", Now);
AddParameter (command, "@CreateDate", Now);
}
}
- public override MembershipUserCollection FindUsersByName (string nameToMatch, int pageIndex, int pageSize, out int totalRecords)
+ public override MembershipUserCollection FindUsersByName (string usernameToMatch, int pageIndex, int pageSize, out int totalRecords)
{
- CheckParam ("nameToMatch", nameToMatch, 256);
+ CheckParam ("usernameToMatch", usernameToMatch, 256);
if (pageIndex < 0)
throw new ArgumentException ("pageIndex must be >= 0");
AddParameter (command, "@PageIndex", pageIndex);
AddParameter (command, "@PageSize", pageSize);
- AddParameter (command, "@UserNameToMatch", nameToMatch);
+ AddParameter (command, "@UserNameToMatch", usernameToMatch);
AddParameter (command, "@ApplicationName", ApplicationName);
// return value
AddParameter (command, "@ReturnValue", ParameterDirection.ReturnValue, null);
}
}
- public override string GetPassword (string username, string answer)
+ public override string GetPassword (string username, string passwordAnswer)
{
if (!EnablePasswordRetrieval)
throw new NotSupportedException ("this provider has not been configured to allow the retrieval of passwords");
CheckParam ("username", username, 256);
if (RequiresQuestionAndAnswer)
- CheckParam ("answer", answer, 128);
+ CheckParam ("passwordAnswer", passwordAnswer, 128);
PasswordInfo pi = GetPasswordInfo (username);
if (pi == null)
throw new ProviderException ("An error occurred while retrieving the password from the database");
- string user_answer = EncodePassword (answer, pi.PasswordFormat, pi.PasswordSalt);
+ string user_answer = EncodePassword (passwordAnswer, pi.PasswordFormat, pi.PasswordSalt);
string password = null;
using (DbConnection connection = CreateConnection ()) {
ProvidersHelper.GetDbProviderFactory (connectionString.ProviderName);
}
- public override string ResetPassword (string username, string answer)
+ public override string ResetPassword (string username, string passwordAnswer)
{
if (!EnablePasswordReset)
throw new NotSupportedException ("this provider has not been configured to allow the resetting of passwords");
CheckParam ("username", username, 256);
if (RequiresQuestionAndAnswer)
- CheckParam ("answer", answer, 128);
+ CheckParam ("passwordAnswer", passwordAnswer, 128);
using (DbConnection connection = CreateConnection ()) {
EmitValidatingPassword (username, newPassword, false);
string db_password = EncodePassword (newPassword, pi.PasswordFormat, pi.PasswordSalt);
- string db_answer = EncodePassword (answer, pi.PasswordFormat, pi.PasswordSalt);
+ string db_answer = EncodePassword (passwordAnswer, pi.PasswordFormat, pi.PasswordSalt);
DbCommand command = factory.CreateCommand ();
command.Connection = connection;
return dbp;
}
- public override void AddUsersToRoles (string [] usernames, string [] rolenames)
+ public override void AddUsersToRoles (string [] usernames, string [] roleNames)
{
Hashtable h = new Hashtable ();
}
h = new Hashtable ();
- foreach (string r in rolenames) {
+ foreach (string r in roleNames) {
if (r == null)
throw new ArgumentNullException ("null element in rolenames array");
if (h.ContainsKey (r))
command.Connection = connection;
command.CommandType = CommandType.StoredProcedure;
- AddParameter (command, "@RoleNames", String.Join (",", rolenames));
+ AddParameter (command, "@RoleNames", String.Join (",", roleNames));
AddParameter (command, "@UserNames", String.Join (",", usernames));
AddParameter (command, "@ApplicationName", ApplicationName);
AddParameter (command, "@CurrentTimeUtc", DateTime.UtcNow);
}
}
- public override void CreateRole (string rolename)
+ public override void CreateRole (string roleName)
{
- if (rolename == null)
- throw new ArgumentNullException ("rolename");
+ if (roleName == null)
+ throw new ArgumentNullException ("roleName");
- if (rolename.Length == 0 || rolename.Length > 256 || rolename.IndexOf (',') != -1)
+ if (roleName.Length == 0 || roleName.Length > 256 || roleName.IndexOf (',') != -1)
throw new ArgumentException ("rolename is in invalid format");
using (DbConnection connection = CreateConnection ()) {
command.CommandType = CommandType.StoredProcedure;
AddParameter (command, "@ApplicationName", ApplicationName);
- AddParameter (command, "@RoleName", rolename);
+ AddParameter (command, "@RoleName", roleName);
DbParameter dbpr = AddParameter (command, "@ReturnVal", ParameterDirection.ReturnValue, DbType.Int32, null);
command.ExecuteNonQuery ();
int returnValue = (int) dbpr.Value;
if (returnValue == 1)
- throw new ProviderException (rolename + " already exists in the database");
+ throw new ProviderException (roleName + " already exists in the database");
else
return;
}
}
- public override bool DeleteRole (string rolename, bool throwOnPopulatedRole)
+ public override bool DeleteRole (string roleName, bool throwOnPopulatedRole)
{
- if (rolename == null)
- throw new ArgumentNullException ("rolename");
+ if (roleName == null)
+ throw new ArgumentNullException ("roleName");
- if (rolename.Length == 0 || rolename.Length > 256 || rolename.IndexOf (',') != -1)
+ if (roleName.Length == 0 || roleName.Length > 256 || roleName.IndexOf (',') != -1)
throw new ArgumentException ("rolename is in invalid format");
using (DbConnection connection = CreateConnection ()) {
command.Connection = connection;
command.CommandType = CommandType.StoredProcedure;
AddParameter (command, "@ApplicationName", ApplicationName);
- AddParameter (command, "@RoleName", rolename);
+ AddParameter (command, "@RoleName", roleName);
AddParameter (command, "@DeleteOnlyIfRoleIsEmpty", throwOnPopulatedRole);
DbParameter dbpr = AddParameter (command, "@ReturnVal", ParameterDirection.ReturnValue, DbType.Int32, null);
if (returnValue == 1)
return false; //role does not exist
else if (returnValue == 2 && throwOnPopulatedRole)
- throw new ProviderException (rolename + " is not empty");
+ throw new ProviderException (roleName + " is not empty");
else
return false;
}
}
}
- public override string [] GetUsersInRole (string rolename)
+ public override string [] GetUsersInRole (string roleName)
{
using (DbConnection connection = CreateConnection ()) {
DbCommand command = factory.CreateCommand ();
command.Connection = connection;
command.CommandType = CommandType.StoredProcedure;
- AddParameter (command, "@RoleName", rolename);
+ AddParameter (command, "@RoleName", roleName);
AddParameter (command, "@ApplicationName", ApplicationName);
DbDataReader reader = command.ExecuteReader ();
ProvidersHelper.GetDbProviderFactory (connectionString.ProviderName);
}
- public override bool IsUserInRole (string username, string rolename)
+ public override bool IsUserInRole (string username, string roleName)
{
using (DbConnection connection = CreateConnection ()) {
DbCommand command = factory.CreateCommand ();
command.Connection = connection;
command.CommandType = CommandType.StoredProcedure;
- AddParameter (command, "@RoleName", rolename);
+ AddParameter (command, "@RoleName", roleName);
AddParameter (command, "@UserName", username);
AddParameter (command, "@ApplicationName", ApplicationName);
DbParameter dbpr = AddParameter (command, "@ReturnVal", ParameterDirection.ReturnValue, DbType.Int32, null);
}
}
- public override void RemoveUsersFromRoles (string [] usernames, string [] rolenames)
+ public override void RemoveUsersFromRoles (string [] usernames, string [] roleNames)
{
Hashtable h = new Hashtable ();
}
h = new Hashtable ();
- foreach (string r in rolenames) {
+ foreach (string r in roleNames) {
if (r == null)
throw new ArgumentNullException ("null element in rolenames array");
if (h.ContainsKey (r))
command.CommandType = CommandType.StoredProcedure;
AddParameter (command, "@UserNames", String.Join (",", usernames));
- AddParameter (command, "@RoleNames", String.Join (",", rolenames));
+ AddParameter (command, "@RoleNames", String.Join (",", roleNames));
AddParameter (command, "@ApplicationName", ApplicationName);
DbParameter dbpr = AddParameter (command, "@ReturnVal", ParameterDirection.ReturnValue, DbType.Int32, null);
}
}
- public override bool RoleExists (string rolename)
+ public override bool RoleExists (string roleName)
{
using (DbConnection connection = CreateConnection ()) {
command.CommandType = CommandType.StoredProcedure;
AddParameter (command, "@ApplicationName", ApplicationName);
- AddParameter (command, "@RoleName", rolename);
+ AddParameter (command, "@RoleName", roleName);
DbParameter dbpr = AddParameter (command, "@ReturnVal", ParameterDirection.ReturnValue, DbType.Int32, null);
command.ExecuteNonQuery ();
get { return container.IsSynchronized; }
}
- public object this [string key] {
- get { return container [key]; }
- set { container [key] = value; }
+ public object this [string name] {
+ get { return container [name]; }
+ set { container [name] = value; }
}
public object this [int index] {
{
///methods
void Abandon ();
- void Add (string itemName, object itemValue);
+ void Add (string name, object value);
void Clear ();
- void CopyTo (Array sessionValues, int index);
+ void CopyTo (Array array, int index);
IEnumerator GetEnumerator ();
- void Remove (string itemName);
+ void Remove (string name);
void RemoveAll ();
void RemoveAt (int index);
void Initialize ();
bool InitializeRequest (HttpContext context, bool suppressAutoDetectRedirect, out bool supportSessionIDReissue);
void RemoveSessionID (HttpContext context);
- void SaveSessionID (HttpContext context, string sessionID, out bool isRedirected, out bool isCookieAdded);
+ void SaveSessionID (HttpContext context, string id, out bool redirected, out bool cookieAdded);
bool Validate (string id);
}
}
{
///methods
void Clear ();
- void Remove (string itemName);
+ void Remove (string name);
void RemoveAt (int index);
///properties
HttpStaticObjectsCollection staticObjects;
int timeout;
- public SessionStateStoreData (ISessionStateItemCollection items,
- HttpStaticObjectsCollection objects,
+ public SessionStateStoreData (ISessionStateItemCollection sessionItems,
+ HttpStaticObjectsCollection staticObjects,
int timeout)
{
- sessionItems = items;
- staticObjects = objects;
+ this.sessionItems = sessionItems;
+ this.staticObjects = staticObjects;
this.timeout = timeout;
}
}
}
- protected internal virtual void BeginRender (HtmlTextWriter w)
+ protected internal virtual void BeginRender (HtmlTextWriter writer)
{
- w.BeginRender();
+ writer.BeginRender();
}
protected internal virtual void CreateChildControls ()
control.CreateChildControls ();
}
- protected internal virtual void EndRender (HtmlTextWriter w)
+ protected internal virtual void EndRender (HtmlTextWriter writer)
{
- w.EndRender ();
+ writer.EndRender ();
}
protected internal virtual void LoadAdapterControlState (object state)
control.OnUnload(e);
}
- protected internal virtual void Render (HtmlTextWriter w)
+ protected internal virtual void Render (HtmlTextWriter writer)
{
Control control = Control;
if (control != null)
- control.Render (w);
+ control.Render (writer);
}
- protected internal virtual void RenderChildren (HtmlTextWriter w)
+ protected internal virtual void RenderChildren (HtmlTextWriter writer)
{
Control control = Control;
if (control != null)
- control.RenderChildren (w);
+ control.RenderChildren (writer);
}
protected internal virtual object SaveAdapterControlState ()
radioButtons.Add(radioButton);
}
- public virtual void RenderBeginHyperlink (HtmlTextWriter w,
+ public virtual void RenderBeginHyperlink (HtmlTextWriter writer,
string targetUrl,
bool encodeUrl,
- string softKeyLabel)
+ string softkeyLabel)
{
- InternalRenderBeginHyperlink (w, targetUrl, encodeUrl, softKeyLabel, null);
+ InternalRenderBeginHyperlink (writer, targetUrl, encodeUrl, softkeyLabel, null);
}
- public virtual void RenderBeginHyperlink (HtmlTextWriter w,
+ public virtual void RenderBeginHyperlink (HtmlTextWriter writer,
string targetUrl,
bool encodeUrl,
- string softKeyLabel,
+ string softkeyLabel,
string accessKey)
{
if (accessKey != null && accessKey.Length > 1)
throw new ArgumentOutOfRangeException("accessKey");
- InternalRenderBeginHyperlink (w, targetUrl, encodeUrl, softKeyLabel, accessKey);
+ InternalRenderBeginHyperlink (writer, targetUrl, encodeUrl, softkeyLabel, accessKey);
}
void InternalRenderBeginHyperlink (HtmlTextWriter w,
}
- public virtual void RenderEndHyperlink (HtmlTextWriter w)
+ public virtual void RenderEndHyperlink (HtmlTextWriter writer)
{
- w.RenderEndTag();
+ writer.RenderEndTag();
}
- public virtual void RenderPostBackEvent (HtmlTextWriter w,
+ public virtual void RenderPostBackEvent (HtmlTextWriter writer,
string target,
string argument,
- string softKeyLabel,
+ string softkeyLabel,
string text)
{
- RenderPostBackEvent (w, target, argument, softKeyLabel, text, Page.Request.FilePath, null, true);
+ RenderPostBackEvent (writer, target, argument, softkeyLabel, text, Page.Request.FilePath, null, true);
}
- public virtual void RenderPostBackEvent (HtmlTextWriter w,
+ public virtual void RenderPostBackEvent (HtmlTextWriter writer,
string target,
string argument,
- string softKeyLabel,
+ string softkeyLabel,
string text,
string postUrl,
string accessKey)
{
- RenderPostBackEvent (w, target, argument, softKeyLabel, text, postUrl, accessKey, true);
+ RenderPostBackEvent (writer, target, argument, softkeyLabel, text, postUrl, accessKey, true);
}
- protected void RenderPostBackEvent (HtmlTextWriter w,
+ protected void RenderPostBackEvent (HtmlTextWriter writer,
string target,
string argument,
- string softKeyLabel,
+ string softkeyLabel,
string text,
string postUrl,
string accessKey,
{
string url = String.Format ("{0}?__VIEWSTATE={1}&__EVENTTARGET={2}&__EVENTARGUMENT={3}&__PREVIOUSPAGE={4}",
postUrl, HttpUtility.UrlEncode (Page.GetSavedViewState ()), target, argument, Page.Request.FilePath);
- RenderBeginHyperlink (w, url, encode, softKeyLabel, accessKey);
- w.Write(text);
- RenderEndHyperlink(w);
+ RenderBeginHyperlink (writer, url, encode, softkeyLabel, accessKey);
+ writer.Write(text);
+ RenderEndHyperlink(writer);
}
public virtual string TransformText (string text)
return text;
}
- protected internal virtual string GetPostBackFormReference (string formID)
+ protected internal virtual string GetPostBackFormReference (string formId)
{
- return String.Format("document.forms['{0}']", formID);
+ return String.Format("document.forms['{0}']", formId);
}
ListDictionary radio_button_group;
base.OnPreRender(e);
}
- protected override void RenderAttributes (HtmlTextWriter w)
+ protected override void RenderAttributes (HtmlTextWriter writer)
{
/* Need to always render: method, action and id
*/
if (RenderingCompatibilityLessThan40)
// LAMESPEC: MSDN says the 'name' attribute is rendered only in
// Legacy mode, this is not true.
- w.WriteAttribute ("name", Name);
+ writer.WriteAttribute ("name", Name);
}
- w.WriteAttribute ("method", Method);
+ writer.WriteAttribute ("method", Method);
if (String.IsNullOrEmpty (customAction))
- w.WriteAttribute ("action", action, true);
+ writer.WriteAttribute ("action", action, true);
/*
* This is a hack that guarantees the ID is set properly for HtmlControl to
string submit = page != null ? page.GetSubmitStatements () : null;
if (!String.IsNullOrEmpty (submit)) {
Attributes.Remove ("onsubmit");
- w.WriteAttribute ("onsubmit", submit);
+ writer.WriteAttribute ("onsubmit", submit);
}
/* enctype and target should not be written if
*/
string enctype = Enctype;
if (!String.IsNullOrEmpty (enctype))
- w.WriteAttribute ("enctype", enctype);
+ writer.WriteAttribute ("enctype", enctype);
string target = Target;
if (!String.IsNullOrEmpty (target))
- w.WriteAttribute ("target", target);
+ writer.WriteAttribute ("target", target);
string defaultbutton = DefaultButton;
if (!String.IsNullOrEmpty (defaultbutton)) {
ID));
if (page != null && DetermineRenderUplevel ()) {
- w.WriteAttribute (
+ writer.WriteAttribute (
"onkeypress",
"javascript:return " + page.WebFormScriptReference + ".WebForm_FireDefaultButton(event, '" + c.ClientID + "')");
}
Attributes.Remove ("enctype");
Attributes.Remove ("target");
- base.RenderAttributes (w);
+ base.RenderAttributes (writer);
}
- protected internal override void RenderChildren (HtmlTextWriter w)
+ protected internal override void RenderChildren (HtmlTextWriter writer)
{
Page page = Page;
page.RegisterForm (this);
}
if (page != null)
- page.OnFormRender (w, ClientID);
- base.RenderChildren (w);
+ page.OnFormRender (writer, ClientID);
+ base.RenderChildren (writer);
if (page != null)
- page.OnFormPostRender (w, ClientID);
+ page.OnFormPostRender (writer, ClientID);
}
/* According to corcompare */
[MonoTODO ("why override?")]
- public override void RenderControl (HtmlTextWriter w)
+ public override void RenderControl (HtmlTextWriter writer)
{
- base.RenderControl (w);
+ base.RenderControl (writer);
}
- protected internal override void Render (HtmlTextWriter w)
+ protected internal override void Render (HtmlTextWriter output)
{
- base.Render (w);
+ base.Render (output);
}
}
}
}
}
- protected override void RenderAttributes (HtmlTextWriter w)
+ protected override void RenderAttributes (HtmlTextWriter writer)
{
- PreProcessRelativeReference (w, "src");
+ PreProcessRelativeReference (writer, "src");
/* MS does not seem to render the src attribute if it
* is empty. Firefox, at least, will fetch the current
if (src == null || src.Length == 0)
Attributes.Remove ("src");
- base.RenderAttributes (w);
+ base.RenderAttributes (writer);
/* MS closes the HTML element at the end of
* the attributes too, according to the nunit
* tests
*/
- w.Write (" /");
+ writer.Write (" /");
}
}
}
}
}
- protected override void RenderAttributes (HtmlTextWriter w)
+ protected override void RenderAttributes (HtmlTextWriter writer)
{
Page page = Page;
if (page != null)
/* If there is no "name" attribute,
* LoadPostData doesn't work...
*/
- w.WriteAttribute ("name", Name);
+ writer.WriteAttribute ("name", Name);
Attributes.Remove ("name");
/* Don't render the databinding attributes */
Attributes.Remove ("datatextfield");
Attributes.Remove ("datavaluefield");
- base.RenderAttributes (w);
+ base.RenderAttributes (writer);
}
- protected internal override void RenderChildren (HtmlTextWriter w)
+ protected internal override void RenderChildren (HtmlTextWriter writer)
{
- base.RenderChildren (w);
+ base.RenderChildren (writer);
if (items == null)
return;
- w.WriteLine ();
+ writer.WriteLine ();
bool done_sel = false;
int count = items.Count;
for (int i = 0; i < count; i++) {
ListItem item = items[i];
- w.Indent++;
+ writer.Indent++;
/* Write the <option> elements this
* way so that the output HTML matches
* element, cos that breaks other
* stuff.)
*/
- w.WriteBeginTag ("option");
+ writer.WriteBeginTag ("option");
if (item.Selected && !done_sel) {
- w.WriteAttribute ("selected", "selected");
+ writer.WriteAttribute ("selected", "selected");
if (!Multiple) {
done_sel = true;
}
}
- w.WriteAttribute ("value", item.Value, true);
+ writer.WriteAttribute ("value", item.Value, true);
if (item.HasAttributes) {
AttributeCollection attrs = item.Attributes;
foreach (string key in attrs.Keys)
- w.WriteAttribute (key, HttpUtility.HtmlAttributeEncode (attrs [key]));
+ writer.WriteAttribute (key, HttpUtility.HtmlAttributeEncode (attrs [key]));
}
- w.Write (HtmlTextWriter.TagRightChar);
+ writer.Write (HtmlTextWriter.TagRightChar);
- w.Write (HttpUtility.HtmlEncode(item.Text));
- w.WriteEndTag ("option");
- w.WriteLine ();
+ writer.Write (HttpUtility.HtmlEncode(item.Text));
+ writer.WriteEndTag ("option");
+ writer.WriteLine ();
- w.Indent--;
+ writer.Indent--;
}
}
InnerList.AddRange (connectionInterfaces);
}
- public bool Contains (Type t)
+ public bool Contains (Type value)
{
- return InnerList.Contains (t);
+ return InnerList.Contains (value);
}
public void CopyTo (Type[] array,
InnerList.CopyTo (array, index);
}
- public int IndexOf (Type t)
+ public int IndexOf (Type value)
{
- return InnerList.IndexOf (t);
+ return InnerList.IndexOf (value);
}
public Type this [ int index ] {
{
public class ConsumerConnectionPoint : ConnectionPoint
{
- public ConsumerConnectionPoint (MethodInfo callBack, Type interFace,
- Type control, string name, string id,
- bool allowsMultiConnections) : base (callBack, interFace,
- control, name, id, allowsMultiConnections)
+ public ConsumerConnectionPoint (MethodInfo callbackMethod, Type interfaceType,
+ Type controlType, string displayName, string id,
+ bool allowsMultipleConnections) : base (callbackMethod, interfaceType,
+ controlType, displayName, id, allowsMultipleConnections)
{
}
{
public class ProviderConnectionPoint : ConnectionPoint
{
- public ProviderConnectionPoint (MethodInfo callBack, Type interFace,
- Type control, string name, string id,
- bool allowsMultiConnections) : base (callBack, interFace,
- control, name, id, allowsMultiConnections)
+ public ProviderConnectionPoint (MethodInfo callbackMethod, Type interfaceType,
+ Type controlType, string displayName, string id,
+ bool allowsMultipleConnections) : base (callbackMethod, interfaceType,
+ controlType, displayName, id, allowsMultipleConnections)
{
}
get { return id;}
}
- public WebPartVerb (string id, string clientHandler) {
+ public WebPartVerb (string id, string clientClickHandler) {
this.id = id;
- this.clientClickHandler = clientHandler;
+ this.clientClickHandler = clientClickHandler;
stateBag = new StateBag ();
- stateBag.Add ("clientClickHandler", clientHandler);
+ stateBag.Add ("clientClickHandler", clientClickHandler);
}
base.OnInit(e);
}
- protected internal override void OnPreRender (EventArgs eee)
+ protected internal override void OnPreRender (EventArgs e)
{
Hashtable ht = null;
ht = ChooseAd ();
}
- AdCreatedEventArgs e = new AdCreatedEventArgs (ht);
- OnAdCreated (e);
- createdargs = e;
+ AdCreatedEventArgs ev = new AdCreatedEventArgs (ht);
+ OnAdCreated (ev);
+ createdargs = ev;
}
throw new NotImplementedException ();
}
- protected internal override void Render (HtmlTextWriter w)
+ protected internal override void Render (HtmlTextWriter writer)
{
AdCreatedEventArgs e = createdargs;
- base.AddAttributesToRender (w);
+ base.AddAttributesToRender (writer);
if (e.NavigateUrl != null && e.NavigateUrl.Length > 0)
- w.AddAttribute (HtmlTextWriterAttribute.Href, ResolveAdUrl (e.NavigateUrl));
+ writer.AddAttribute (HtmlTextWriterAttribute.Href, ResolveAdUrl (e.NavigateUrl));
if (Target != null && Target.Length > 0)
- w.AddAttribute (HtmlTextWriterAttribute.Target, Target);
+ writer.AddAttribute (HtmlTextWriterAttribute.Target, Target);
- w.RenderBeginTag (HtmlTextWriterTag.A);
+ writer.RenderBeginTag (HtmlTextWriterTag.A);
if (e.ImageUrl != null && e.ImageUrl.Length > 0)
- w.AddAttribute (HtmlTextWriterAttribute.Src, ResolveAdUrl (e.ImageUrl));
+ writer.AddAttribute (HtmlTextWriterAttribute.Src, ResolveAdUrl (e.ImageUrl));
- w.AddAttribute (HtmlTextWriterAttribute.Alt, e.AlternateText == null ? String.Empty : e.AlternateText);
- w.AddAttribute (HtmlTextWriterAttribute.Border, "0", false);
- w.RenderBeginTag (HtmlTextWriterTag.Img);
- w.RenderEndTag (); // img
- w.RenderEndTag (); // a
+ writer.AddAttribute (HtmlTextWriterAttribute.Alt, e.AlternateText == null ? String.Empty : e.AlternateText);
+ writer.AddAttribute (HtmlTextWriterAttribute.Border, "0", false);
+ writer.RenderBeginTag (HtmlTextWriterTag.Img);
+ writer.RenderEndTag (); // img
+ writer.RenderEndTag (); // a
}
string ResolveAdUrl (string url)
{
}
- protected override void AddAttributesToRender (HtmlTextWriter w)
+ protected override void AddAttributesToRender (HtmlTextWriter writer)
{
if (RenderUplevel) {
if (Page != null) {
}
}
- base.AddAttributesToRender (w);
+ base.AddAttributesToRender (writer);
}
public static bool CanConvert (string text,
return BaseCompareValidator.Convert(text, type, false, out value);
}
- protected static bool Compare (string left, string right, ValidationCompareOperator op, ValidationDataType type)
+ protected static bool Compare (string leftText, string rightText, ValidationCompareOperator op, ValidationDataType type)
{
- return BaseCompareValidator.Compare(left, false, right, false, op, type);
+ return BaseCompareValidator.Compare(leftText, false, rightText, false, op, type);
}
protected override bool DetermineRenderUplevel ()
return order.ToString ();
}
- protected static int GetFullYear (int two_digit_year)
+ protected static int GetFullYear (int shortYear)
{
/* This is an implementation that matches the
* docs on msdn, but MS doesn't seem to go by
int cutoff = CutoffYear;
int twodigitcutoff = cutoff % 100;
- if (two_digit_year <= twodigitcutoff)
- return cutoff - twodigitcutoff + two_digit_year;
+ if (shortYear <= twodigitcutoff)
+ return cutoff - twodigitcutoff + shortYear;
else
- return cutoff - twodigitcutoff - 100 + two_digit_year;
+ return cutoff - twodigitcutoff - 100 + shortYear;
}
[DefaultValue (false)]
return Convert(text, type, cultureInvariant, out value);
}
- protected static bool Compare (string left,
+ protected static bool Compare (string leftText,
bool cultureInvariantLeftText,
- string right,
+ string rightText,
bool cultureInvariantRightText,
ValidationCompareOperator op,
ValidationDataType type)
{
object lo, ro;
- if (!Convert(left, type, cultureInvariantLeftText, out lo))
+ if (!Convert(leftText, type, cultureInvariantLeftText, out lo))
return false;
/* DataTypeCheck is a unary operator that only
/* pretty crackladen, but if we're unable to
* convert the rhs to @type, the comparison
* succeeds */
- if (!Convert(right, type, cultureInvariantRightText, out ro))
+ if (!Convert(rightText, type, cultureInvariantRightText, out ro))
return true;
int comp = ((IComparable)lo).CompareTo((IComparable)ro);
return o.ToString ();
}
- public static PropertyDescriptor GetValidationProperty (object o)
+ public static PropertyDescriptor GetValidationProperty (object component)
{
PropertyDescriptorCollection props;
System.ComponentModel.AttributeCollection col;
- props = TypeDescriptor.GetProperties (o);
- col = TypeDescriptor.GetAttributes (o);
+ props = TypeDescriptor.GetProperties (component);
+ col = TypeDescriptor.GetAttributes (component);
foreach (Attribute at in col) {
ValidationPropertyAttribute vpa = at as ValidationPropertyAttribute;
get { return true; }
}
- protected virtual string FormatDataValue (object value, bool encode)
+ protected virtual string FormatDataValue (object dataValue, bool encode)
{
string res;
bool htmlEncodeFormatString = HtmlEncodeFormatString;
- string stringValue = (value != null) ? value.ToString () : String.Empty;
- if (value == null || (stringValue.Length == 0 && ConvertEmptyStringToNull)) {
+ string stringValue = (dataValue != null) ? dataValue.ToString () : String.Empty;
+ if (dataValue == null || (stringValue.Length == 0 && ConvertEmptyStringToNull)) {
if (NullDisplayText.Length == 0) {
encode = false;
res = " ";
string format = DataFormatString;
if (!String.IsNullOrEmpty (format)) {
if (!encode || htmlEncodeFormatString)
- res = String.Format (format, value);
+ res = String.Format (format, dataValue);
else
res = String.Format (format, encode ? HttpUtility.HtmlEncode (stringValue) : stringValue);
} else
return base.Initialize (sortingEnabled, control);
}
- protected virtual string FormatDataTextValue (object value)
+ protected virtual string FormatDataTextValue (object dataTextValue)
{
if (DataTextFormatString.Length > 0)
- return String.Format (DataTextFormatString, value);
- else if (value == null)
+ return String.Format (DataTextFormatString, dataTextValue);
+ else if (dataTextValue == null)
return String.Empty;
else
- return value.ToString ();
+ return dataTextValue.ToString ();
}
public override void InitializeCell (DataControlFieldCell cell, DataControlCellType cellType, DataControlRowState rowState, int rowIndex)
RaisePostBackEvent (eventArgument);
}
- protected virtual void RaisePostBackEvent (string arg)
+ protected virtual void RaisePostBackEvent (string eventArgument)
{
- ValidateEvent (UniqueID, arg);
- if (arg.Length < 1)
+ ValidateEvent (UniqueID, eventArgument);
+ if (eventArgument.Length < 1)
return;
- if (arg[0] == 'V') { // Goes to Next or Previous month
+ if (eventArgument[0] == 'V') { // Goes to Next or Previous month
DateTime prev = VisibleDate;
- int days = Int32.Parse (arg.Substring (1));
+ int days = Int32.Parse (eventArgument.Substring (1));
DateTime dt = GetGlobalCalendar().AddDays (dateZenith, days);
VisibleDate = dt;
OnVisibleMonthChanged (VisibleDate, prev);
return;
}
- if (arg[0] == 'R') { // Selects a range of dates
+ if (eventArgument[0] == 'R') { // Selects a range of dates
string num, date, days;
- num = arg.Substring (1);
+ num = eventArgument.Substring (1);
days = num.Substring (num.Length - 2, 2);
date = num.Substring (0, num.Length - 2);
DateTime d = GetGlobalCalendar().AddDays (dateZenith, Int32.Parse (date));
}
// Selects a single day
- int daysFromZenith = Int32.Parse (arg);
+ int daysFromZenith = Int32.Parse (eventArgument);
DateTime day = GetGlobalCalendar().AddDays (dateZenith, daysFromZenith);
SelectedDates.SelectRange (day, day);
OnSelectionChanged ();
return false;
}
- protected internal override void Render (HtmlTextWriter w)
+ protected internal override void Render (HtmlTextWriter writer)
{
Page page = Page;
if (page != null) {
if (!RenderingCompatibilityLessThan40)
ControlStyle.PrependCssClass (DisabledCssClass);
else
- w.AddAttribute (HtmlTextWriterAttribute.Disabled, "disabled", false);
+ writer.AddAttribute (HtmlTextWriterAttribute.Disabled, "disabled", false);
need_span = true;
}
if (need_span) {
- AddDisplayStyleAttribute (w);
- ControlStyle.AddAttributesToRender (w, this);
+ AddDisplayStyleAttribute (writer);
+ ControlStyle.AddAttributesToRender (writer, this);
}
string tt = ToolTip;
if (tt != null && tt.Length > 0){
- w.AddAttribute ("title", tt);
+ writer.AddAttribute ("title", tt);
need_span = true;
}
- if (HasAttributes && AddAttributesForSpan (w))
+ if (HasAttributes && AddAttributesForSpan (writer))
need_span = true;
if (need_span)
- w.RenderBeginTag (HtmlTextWriterTag.Span);
+ writer.RenderBeginTag (HtmlTextWriterTag.Span);
TextAlign align = TextAlign;
if (align == TextAlign.Right) {
- RenderInput (w, enabled);
- RenderLabel (w);
+ RenderInput (writer, enabled);
+ RenderLabel (writer);
} else {
- RenderLabel (w);
- RenderInput (w, enabled);
+ RenderLabel (writer);
+ RenderInput (writer, enabled);
}
if (need_span)
- w.RenderEndTag ();
+ writer.RenderEndTag ();
}
void RenderInput (HtmlTextWriter w, bool enabled)
{
}
- protected override void AddAttributesToRender (HtmlTextWriter w)
+ protected override void AddAttributesToRender (HtmlTextWriter writer)
{
if (RenderUplevel) {
RegisterExpandoAttribute (ClientID, "evaluationfunction", "CompareValidatorEvaluateIsValid");
RegisterExpandoAttribute (ClientID, "operator", Operator.ToString ());
}
- base.AddAttributesToRender (w);
+ base.AddAttributesToRender (writer);
}
protected override bool ControlPropertiesValid ()
base.DataBind();
}
- protected internal override void Render (HtmlTextWriter w)
+ protected internal override void Render (HtmlTextWriter writer)
{
/* make sure all the child controls have been created */
EnsureChildControls ();
/* and then... */
- base.Render (w);
+ base.Render (writer);
}
void ICompositeControlDesignerAccessor.RecreateChildControls ()
return new ControlParameter (this);
}
protected internal
- override object Evaluate (HttpContext ctx, Control control)
+ override object Evaluate (HttpContext context, Control control)
{
if (control == null)
return null;
return new CookieParameter (this);
}
protected internal
- override object Evaluate (HttpContext ctx, Control control)
+ override object Evaluate (HttpContext context, Control control)
{
- if (ctx == null || ctx.Request == null)
+ if (context == null || context.Request == null)
return null;
- HttpCookie c = ctx.Request.Cookies [CookieName];
+ HttpCookie c = context.Request.Cookies [CookieName];
if (c == null)
return null;
{
DataControlField containerField;
- public DataControlFieldCell (DataControlField containerField) : this (HtmlTextWriterTag.Td, containerField)
+ public DataControlFieldCell (DataControlField containingField) : this (HtmlTextWriterTag.Td, containingField)
{
}
- protected DataControlFieldCell (HtmlTextWriterTag tagKey, DataControlField containerField) : base (tagKey)
+ protected DataControlFieldCell (HtmlTextWriterTag tagKey, DataControlField containingField) : base (tagKey)
{
- this.containerField = containerField;
+ this.containerField = containingField;
}
public DataControlField ContainingField {
}
[Browsable (false)]
- public DataControlField this [int i] {
- get { return (DataControlField) ((IList)this) [i]; }
+ public DataControlField this [int index] {
+ get { return (DataControlField) ((IList)this) [index]; }
}
protected override void OnInsertComplete (int index, object value)
{
TableHeaderScope scope;
- public DataControlFieldHeaderCell (DataControlField containerField): base (HtmlTextWriterTag.Th, containerField)
+ public DataControlFieldHeaderCell (DataControlField containingField): base (HtmlTextWriterTag.Th, containingField)
{
}
#endregion // IDataItemContainer Properties
#region Public Instance Methods
- protected override bool OnBubbleEvent(object source, EventArgs args)
+ protected override bool OnBubbleEvent(object source, EventArgs e)
{
// Nikhil Kothari, pg 312-313:
- if (args is CommandEventArgs) {
- RaiseBubbleEvent(this, new DataGridCommandEventArgs(this, source, (CommandEventArgs)args));
+ if (e is CommandEventArgs) {
+ RaiseBubbleEvent(this, new DataGridCommandEventArgs(this, source, (CommandEventArgs)e));
return true;
}
- return base.OnBubbleEvent (source, args);
+ return base.OnBubbleEvent (source, e);
}
protected internal virtual void SetItemType(ListItemType itemType)
return true;
}
- protected virtual void LoadViewState (object savedState)
+ protected virtual void LoadViewState (object state)
{
- if (savedState is Pair) {
- Pair p = (Pair) savedState;
+ if (state is Pair) {
+ Pair p = (Pair) state;
object[] akeys = (object[]) p.First;
object[] avals = (object[]) p.Second;
for (int n=0; n<akeys.Length; n++) {
keyTable [akeys[n]] = avals [n];
}
- } else if (savedState is object[]) {
- object[] avals = (object[]) savedState;
+ } else if (state is object[]) {
+ object[] avals = (object[]) state;
for (int n=0; n<avals.Length; n++)
keyTable [keyNames[n]] = avals [n];
}
return style;
}
- protected override int CreateChildControls (IEnumerable data, bool dataBinding)
+ protected override int CreateChildControls (IEnumerable dataSource, bool dataBinding)
{
- PagedDataSource dataSource = new PagedDataSource ();
- dataSource.DataSource = CurrentMode != DetailsViewMode.Insert ? data : null;
- dataSource.AllowPaging = AllowPaging;
- dataSource.PageSize = 1;
- dataSource.CurrentPageIndex = PageIndex;
+ PagedDataSource pagedDataSource = new PagedDataSource ();
+ pagedDataSource.DataSource = CurrentMode != DetailsViewMode.Insert ? dataSource : null;
+ pagedDataSource.AllowPaging = AllowPaging;
+ pagedDataSource.PageSize = 1;
+ pagedDataSource.CurrentPageIndex = PageIndex;
if (dataBinding && CurrentMode != DetailsViewMode.Insert) {
DataSourceView view = GetData ();
if (view != null && view.CanPage) {
- dataSource.AllowServerPaging = true;
+ pagedDataSource.AllowServerPaging = true;
if (SelectArguments.RetrieveTotalRowCount)
- dataSource.VirtualCount = SelectArguments.TotalRowCount;
+ pagedDataSource.VirtualCount = SelectArguments.TotalRowCount;
}
}
- bool showPager = AllowPaging && (dataSource.PageCount > 1);
+ bool showPager = AllowPaging && (pagedDataSource.PageCount > 1);
Controls.Clear ();
table = CreateTable ();
// Gets the current data item
if (AllowPaging) {
- PageCount = dataSource.DataSourceCount;
+ PageCount = pagedDataSource.DataSourceCount;
if (PageIndex >= PageCount && PageCount > 0)
- pageIndex = dataSource.CurrentPageIndex = PageCount - 1;
- if (dataSource.DataSource != null) {
- IEnumerator e = dataSource.GetEnumerator ();
+ pageIndex = pagedDataSource.CurrentPageIndex = PageCount - 1;
+ if (pagedDataSource.DataSource != null) {
+ IEnumerator e = pagedDataSource.GetEnumerator ();
if (e.MoveNext ())
dataItem = e.Current;
}
} else {
int page = 0;
object lastItem = null;
- if (dataSource.DataSource != null) {
- IEnumerator e = dataSource.GetEnumerator ();
+ if (pagedDataSource.DataSource != null) {
+ IEnumerator e = pagedDataSource.GetEnumerator ();
for (; e.MoveNext (); page++) {
lastItem = e.Current;
if (page == PageIndex)
if (showPager && PagerSettings.Position == PagerPosition.Top ||
PagerSettings.Position == PagerPosition.TopAndBottom) {
topPagerRow = CreateRow (-1, DataControlRowType.Pager, DataControlRowState.Normal);
- InitializePager (topPagerRow, dataSource);
+ InitializePager (topPagerRow, pagedDataSource);
table.Rows.Add (topPagerRow);
}
if (showPager && PagerSettings.Position == PagerPosition.Bottom ||
PagerSettings.Position == PagerPosition.TopAndBottom) {
bottomPagerRow = CreateRow (-1, DataControlRowType.Pager, DataControlRowState.Normal);
- InitializePager (bottomPagerRow, dataSource);
+ InitializePager (bottomPagerRow, pagedDataSource);
table.Rows.Add (bottomPagerRow);
}
}
return rstate;
}
- protected virtual void InitializePager (DetailsViewRow row, PagedDataSource dataSource)
+ protected virtual void InitializePager (DetailsViewRow row, PagedDataSource pagedDataSource)
{
TableCell cell = new TableCell ();
cell.ColumnSpan = 2;
if (pagerTemplate != null)
pagerTemplate.InstantiateIn (cell);
else
- cell.Controls.Add (PagerSettings.CreatePagerControl (dataSource.CurrentPageIndex, dataSource.PageCount));
+ cell.Controls.Add (PagerSettings.CreatePagerControl (pagedDataSource.CurrentPageIndex, pagedDataSource.PageCount));
row.Cells.Add (cell);
}
return dic;
}
- protected virtual void ExtractRowValues (IOrderedDictionary fieldValues, bool includeReadOnlyFields, bool includePrimaryKey)
+ protected virtual void ExtractRowValues (IOrderedDictionary fieldValues, bool includeReadOnlyFields, bool includeKeys)
{
foreach (DetailsViewRow row in Rows) {
if (row.Cells.Count < 1)
if (c != null)
c.ContainingField.ExtractValuesFromCell (fieldValues, c, row.RowState, includeReadOnlyFields);
}
- if (!includePrimaryKey && DataKeyNames != null)
+ if (!includeKeys && DataKeyNames != null)
foreach (string key in DataKeyNames)
fieldValues.Remove (key);
}
}
}
public
- void SetPageIndex (int newIndex)
+ void SetPageIndex (int index)
{
- DetailsViewPageEventArgs args = new DetailsViewPageEventArgs (newIndex);
+ DetailsViewPageEventArgs args = new DetailsViewPageEventArgs (index);
OnPageIndexChanging (args);
if (args.Cancel || !IsBoundUsingDataSourceID)
RequireBinding ();
}
- protected internal override void LoadControlState (object ob)
+ protected internal override void LoadControlState (object savedState)
{
- if (ob == null)
+ if (savedState == null)
return;
- object[] state = (object[]) ob;
+ object[] state = (object[]) savedState;
base.LoadControlState (state[0]);
pageIndex = (int) state[1];
pageCount = (int) state[2];
ControlStyle.LoadViewState (states [12]);
}
- void ICallbackEventHandler.RaiseCallbackEvent (string eventArgs)
+ void ICallbackEventHandler.RaiseCallbackEvent (string eventArgument)
{
- RaiseCallbackEvent (eventArgs);
+ RaiseCallbackEvent (eventArgument);
}
- protected virtual void RaiseCallbackEvent (string eventArgs)
+ protected virtual void RaiseCallbackEvent (string eventArgument)
{
- string[] clientData = eventArgs.Split ('|');
+ string[] clientData = eventArgument.Split ('|');
PageIndex = int.Parse (clientData[0]);
RaisePostBackEvent (clientData[1]);
IOrderedDictionary keys;
IOrderedDictionary values;
- public DetailsViewDeleteEventArgs (int index)
+ public DetailsViewDeleteEventArgs (int rowIndex)
{
- this.rowIndex = index;
+ this.rowIndex = rowIndex;
}
internal DetailsViewDeleteEventArgs (int index, IOrderedDictionary keys, IOrderedDictionary values)
object argument;
IOrderedDictionary values;
- public DetailsViewInsertEventArgs (object argument)
+ public DetailsViewInsertEventArgs (object commandArgument)
{
- this.argument = argument;
+ this.argument = commandArgument;
}
internal DetailsViewInsertEventArgs (object argument, IOrderedDictionary values)
this.rows = rows;
}
- public DetailsViewRow this [int i] {
- get { return (DetailsViewRow) rows [i]; }
+ public DetailsViewRow this [int index] {
+ get { return (DetailsViewRow) rows [index]; }
}
public void CopyTo (DetailsViewRow[] array, int index)
IOrderedDictionary newValues;
IOrderedDictionary oldValues;
- public DetailsViewUpdateEventArgs (object argument)
+ public DetailsViewUpdateEventArgs (object commandArgument)
{
- this.argument = argument;
+ this.argument = commandArgument;
}
internal DetailsViewUpdateEventArgs (object argument, IOrderedDictionary keys, IOrderedDictionary oldValues, IOrderedDictionary newValues)
return new FontUnit (n);
}
- public string ToString (IFormatProvider fmt)
+ public string ToString (IFormatProvider formatProvider)
{
if (type == FontSize.NotSet)
return String.Empty;
else if (type == FontSize.AsUnit)
- return unit.ToString (fmt);
+ return unit.ToString (formatProvider);
else
return font_size_names [(int) type];
}
return new FormParameter (this);
}
protected internal
- override object Evaluate (HttpContext ctx, Control control)
+ override object Evaluate (HttpContext context, Control control)
{
- HttpRequest req = ctx != null ? ctx.Request : null;
+ HttpRequest req = context != null ? context.Request : null;
if (req == null)
return null;
return arg;
}
- protected virtual FormViewRow CreateRow (int rowIndex, DataControlRowType rowType, DataControlRowState rowState)
+ protected virtual FormViewRow CreateRow (int itemIndex, DataControlRowType rowType, DataControlRowState rowState)
{
if (rowType == DataControlRowType.Pager)
- return new FormViewPagerRow (rowIndex, rowType, rowState);
+ return new FormViewPagerRow (itemIndex, rowType, rowState);
else
- return new FormViewRow (rowIndex, rowType, rowState);
+ return new FormViewRow (itemIndex, rowType, rowState);
}
void RequireBinding ()
return style;
}
- protected override int CreateChildControls (IEnumerable data, bool dataBinding)
+ protected override int CreateChildControls (IEnumerable dataSource, bool dataBinding)
{
- PagedDataSource dataSource = new PagedDataSource ();
- dataSource.DataSource = CurrentMode != FormViewMode.Insert ? data : null;
- dataSource.AllowPaging = AllowPaging;
- dataSource.PageSize = 1;
- dataSource.CurrentPageIndex = PageIndex;
+ PagedDataSource pagedDataSource = new PagedDataSource ();
+ pagedDataSource.DataSource = CurrentMode != FormViewMode.Insert ? dataSource : null;
+ pagedDataSource.AllowPaging = AllowPaging;
+ pagedDataSource.PageSize = 1;
+ pagedDataSource.CurrentPageIndex = PageIndex;
if (dataBinding && CurrentMode != FormViewMode.Insert) {
DataSourceView view = GetData ();
if (view != null && view.CanPage) {
- dataSource.AllowServerPaging = true;
+ pagedDataSource.AllowServerPaging = true;
if (SelectArguments.RetrieveTotalRowCount)
- dataSource.VirtualCount = SelectArguments.TotalRowCount;
+ pagedDataSource.VirtualCount = SelectArguments.TotalRowCount;
}
}
PagerSettings pagerSettings = PagerSettings;
- bool showPager = AllowPaging && pagerSettings.Visible && (dataSource.PageCount > 1);
+ bool showPager = AllowPaging && pagerSettings.Visible && (pagedDataSource.PageCount > 1);
Controls.Clear ();
table = CreateTable ();
// Gets the current data item
if (AllowPaging) {
- PageCount = dataSource.DataSourceCount;
+ PageCount = pagedDataSource.DataSourceCount;
if (PageIndex >= PageCount && PageCount > 0)
- pageIndex = dataSource.CurrentPageIndex = PageCount - 1;
+ pageIndex = pagedDataSource.CurrentPageIndex = PageCount - 1;
- if (dataSource.DataSource != null) {
- IEnumerator e = dataSource.GetEnumerator ();
+ if (pagedDataSource.DataSource != null) {
+ IEnumerator e = pagedDataSource.GetEnumerator ();
if (e.MoveNext ())
dataItem = e.Current;
}
} else {
int page = 0;
object lastItem = null;
- if (dataSource.DataSource != null) {
- IEnumerator e = dataSource.GetEnumerator ();
+ if (pagedDataSource.DataSource != null) {
+ IEnumerator e = pagedDataSource.GetEnumerator ();
for (; e.MoveNext (); page++) {
lastItem = e.Current;
if (page == PageIndex)
if (showPager && pagerSettings.Position == PagerPosition.Top || pagerSettings.Position == PagerPosition.TopAndBottom) {
topPagerRow = CreateRow (-1, DataControlRowType.Pager, DataControlRowState.Normal);
- InitializePager (topPagerRow, dataSource);
+ InitializePager (topPagerRow, pagedDataSource);
table.Rows.Add (topPagerRow);
}
if (showPager && pagerSettings.Position == PagerPosition.Bottom || pagerSettings.Position == PagerPosition.TopAndBottom) {
bottomPagerRow = CreateRow (0, DataControlRowType.Pager, DataControlRowState.Normal);
- InitializePager (bottomPagerRow, dataSource);
+ InitializePager (bottomPagerRow, pagedDataSource);
table.Rows.Add (bottomPagerRow);
}
return rstate;
}
- protected virtual void InitializePager (FormViewRow row, PagedDataSource dataSource)
+ protected virtual void InitializePager (FormViewRow row, PagedDataSource pagedDataSource)
{
TableCell cell = new TableCell ();
cell.ColumnSpan = 2;
if (pagerTemplate != null)
pagerTemplate.InstantiateIn (cell);
else
- cell.Controls.Add (PagerSettings.CreatePagerControl (dataSource.CurrentPageIndex, dataSource.PageCount));
+ cell.Controls.Add (PagerSettings.CreatePagerControl (pagedDataSource.CurrentPageIndex, pagedDataSource.PageCount));
row.Cells.Add (cell);
}
RequireBinding ();
}
- protected internal override void LoadControlState (object ob)
+ protected internal override void LoadControlState (object savedState)
{
- if (ob == null) return;
- object[] state = (object[]) ob;
+ if (savedState == null) return;
+ object[] state = (object[]) savedState;
base.LoadControlState (state[0]);
pageIndex = (int) state[1];
pageCount = (int) state[2];
{
object source;
- public FormViewCommandEventArgs (object source, CommandEventArgs arguments) : base (arguments)
+ public FormViewCommandEventArgs (object commandSource, CommandEventArgs originalArgs) : base (originalArgs)
{
- this.source = source;
+ this.source = commandSource;
}
public object CommandSource {
IOrderedDictionary keys;
IOrderedDictionary values;
- public FormViewDeleteEventArgs (int index)
+ public FormViewDeleteEventArgs (int rowIndex)
{
- this.rowIndex = index;
+ this.rowIndex = rowIndex;
}
internal FormViewDeleteEventArgs (int index, IOrderedDictionary keys, IOrderedDictionary values)
object argument;
IOrderedDictionary values;
- public FormViewInsertEventArgs (object argument)
+ public FormViewInsertEventArgs (object commandArgument)
{
- this.argument = argument;
+ this.argument = commandArgument;
}
internal FormViewInsertEventArgs (object argument, IOrderedDictionary values)
get;
set;
}
- public FormViewRow (int rowIndex, DataControlRowType rowType, DataControlRowState rowState)
+ public FormViewRow (int itemIndex, DataControlRowType rowType, DataControlRowState rowState)
{
- this.rowIndex = rowIndex;
+ this.rowIndex = itemIndex;
this.rowType = rowType;
this.rowState = rowState;
}
IOrderedDictionary oldValues;
IOrderedDictionary newValues;
- public FormViewUpdateEventArgs (object argument)
+ public FormViewUpdateEventArgs (object commandArgument)
{
- this.argument = argument;
+ this.argument = commandArgument;
}
internal FormViewUpdateEventArgs (object argument, IOrderedDictionary keys, IOrderedDictionary oldValues, IOrderedDictionary newValues)
}
}
- protected override int CreateChildControls (IEnumerable data, bool dataBinding)
+ protected override int CreateChildControls (IEnumerable dataSource, bool dataBinding)
{
// clear GridView
Controls.Clear ();
table = null;
rows = null;
- if (data == null)
+ if (dataSource == null)
return 0;
- PagedDataSource dataSource;
+ PagedDataSource pagedDataSource;
if (dataBinding) {
DataSourceView view = GetData ();
- dataSource = new PagedDataSource ();
- dataSource.DataSource = data;
+ pagedDataSource = new PagedDataSource ();
+ pagedDataSource.DataSource = dataSource;
if (AllowPaging) {
- dataSource.AllowPaging = true;
- dataSource.PageSize = PageSize;
+ pagedDataSource.AllowPaging = true;
+ pagedDataSource.PageSize = PageSize;
if (view.CanPage) {
- dataSource.AllowServerPaging = true;
+ pagedDataSource.AllowServerPaging = true;
if (SelectArguments.RetrieveTotalRowCount)
- dataSource.VirtualCount = SelectArguments.TotalRowCount;
+ pagedDataSource.VirtualCount = SelectArguments.TotalRowCount;
}
- if (PageIndex >= dataSource.PageCount)
- pageIndex = dataSource.PageCount - 1;
- dataSource.CurrentPageIndex = PageIndex;
+ if (PageIndex >= pagedDataSource.PageCount)
+ pageIndex = pagedDataSource.PageCount - 1;
+ pagedDataSource.CurrentPageIndex = PageIndex;
}
- PageCount = dataSource.PageCount;
+ PageCount = pagedDataSource.PageCount;
} else {
- dataSource = new PagedDataSource ();
- dataSource.DataSource = data;
+ pagedDataSource = new PagedDataSource ();
+ pagedDataSource.DataSource = dataSource;
if (AllowPaging) {
- dataSource.AllowPaging = true;
- dataSource.PageSize = PageSize;
- dataSource.CurrentPageIndex = PageIndex;
+ pagedDataSource.AllowPaging = true;
+ pagedDataSource.PageSize = PageSize;
+ pagedDataSource.CurrentPageIndex = PageIndex;
}
}
// Creates the set of fields to show
_dataEnumerator = null;
- ICollection fieldCollection = CreateColumns (dataSource, dataBinding);
+ ICollection fieldCollection = CreateColumns (pagedDataSource, dataBinding);
int fieldCount = fieldCollection.Count;
DataControlField dcf;
DataControlField[] fields = new DataControlField [fieldCount];
enumerator = _dataEnumerator;
skip_first = true;
} else
- enumerator = dataSource.GetEnumerator ();
+ enumerator = pagedDataSource.GetEnumerator ();
// Main table creation
Table mainTable = ContainedTable;
if (list.Count == 0) {
if (createPager && (PagerSettings.Position == PagerPosition.Top || PagerSettings.Position == PagerPosition.TopAndBottom)) {
- topPagerRow = CreatePagerRow (fieldCount, dataSource);
+ topPagerRow = CreatePagerRow (fieldCount, pagedDataSource);
OnRowCreated (new GridViewRowEventArgs (topPagerRow));
mainTable.Rows.Add (topPagerRow);
if (dataBinding) {
}
if (createPager && (PagerSettings.Position == PagerPosition.Bottom || PagerSettings.Position == PagerPosition.TopAndBottom)) {
- bottomPagerRow = CreatePagerRow (fieldCount, dataSource);
+ bottomPagerRow = CreatePagerRow (fieldCount, pagedDataSource);
OnRowCreated (new GridViewRowEventArgs (bottomPagerRow));
mainTable.Rows.Add (bottomPagerRow);
if (dataBinding) {
return -1;
if (AllowPaging)
- return dataSource.DataSourceCount;
+ return pagedDataSource.DataSourceCount;
else
return list.Count;
}
return row;
}
- protected virtual void InitializePager (GridViewRow row, int columnSpan, PagedDataSource dataSource)
+ protected virtual void InitializePager (GridViewRow row, int columnSpan, PagedDataSource pagedDataSource)
{
TableCell cell = new TableCell ();
if (columnSpan > 1)
if (pagerTemplate != null)
pagerTemplate.InstantiateIn (cell);
else
- cell.Controls.Add (PagerSettings.CreatePagerControl (dataSource.CurrentPageIndex, dataSource.PageCount));
+ cell.Controls.Add (PagerSettings.CreatePagerControl (pagedDataSource.CurrentPageIndex, pagedDataSource.PageCount));
row.Cells.Add (cell);
}
Sort (newSortExpression, newDirection);
}
- public virtual void Sort (string newSortExpression, SortDirection newSortDirection)
+ public virtual void Sort (string sortExpression, SortDirection sortDirection)
{
- GridViewSortEventArgs args = new GridViewSortEventArgs (newSortExpression, newSortDirection);
+ GridViewSortEventArgs args = new GridViewSortEventArgs (sortExpression, sortDirection);
OnSorting (args);
if (args.Cancel)
return;
OnSorted (EventArgs.Empty);
}
public
- void SelectRow (int index)
+ void SelectRow (int rowIndex)
{
- GridViewSelectEventArgs args = new GridViewSelectEventArgs (index);
+ GridViewSelectEventArgs args = new GridViewSelectEventArgs (rowIndex);
OnSelectedIndexChanging (args);
if (!args.Cancel) {
RequireBinding ();
}
}
public
- void SetPageIndex (int newIndex)
+ void SetPageIndex (int rowIndex)
{
- GridViewPageEventArgs args = new GridViewPageEventArgs (newIndex);
+ GridViewPageEventArgs args = new GridViewPageEventArgs (rowIndex);
OnPageIndexChanging (args);
if (args.Cancel || !IsBoundUsingDataSourceID)
OnPageIndexChanged (EventArgs.Empty);
}
public
- void SetEditRow (int index)
+ void SetEditRow (int rowIndex)
{
- GridViewEditEventArgs args = new GridViewEditEventArgs (index);
+ GridViewEditEventArgs args = new GridViewEditEventArgs (rowIndex);
OnRowEditing (args);
if (args.Cancel || !IsBoundUsingDataSourceID)
currentEditNewValues = null;
}
- protected internal override void LoadControlState (object ob)
+ protected internal override void LoadControlState (object savedState)
{
- if (ob == null)
+ if (savedState == null)
return;
- object[] state = (object[]) ob;
+ object[] state = (object[]) savedState;
base.LoadControlState (state[0]);
pageIndex = (int) state[1];
selectedIndex = (int) state[2];
((IStateManager)sortedDescendingHeaderStyle).LoadViewState (states [15]);
}
- void ICallbackEventHandler.RaiseCallbackEvent (string eventArgs)
+ void ICallbackEventHandler.RaiseCallbackEvent (string eventArgument)
{
- RaiseCallbackEvent (eventArgs);
+ RaiseCallbackEvent (eventArgument);
}
- protected virtual void RaiseCallbackEvent (string eventArgs)
+ protected virtual void RaiseCallbackEvent (string eventArgument)
{
- string[] clientData = eventArgs.Split ('|');
+ string[] clientData = eventArgument.Split ('|');
PageIndex = int.Parse (clientData[0]);
SortExpression = HttpUtility.UrlDecode (clientData [1]);
SortDirection = (SortDirection) int.Parse (clientData [2]);
return sw.ToString ();
}
- string ICallbackContainer.GetCallbackScript (IButtonControl control, string argument)
+ string ICallbackContainer.GetCallbackScript (IButtonControl buttonControl, string argument)
{
- return GetCallbackScript (control, argument);
+ return GetCallbackScript (buttonControl, argument);
}
- protected virtual string GetCallbackScript (IButtonControl control, string argument)
+ protected virtual string GetCallbackScript (IButtonControl buttonControl, string argument)
{
if (EnableSortingAndPagingCallbacks) {
Page page = Page;
if (page != null)
page.ClientScript.RegisterForEventValidation (UniqueID, argument);
- return "javascript:GridView_ClientEvent (\"" + ClientID + "\",\"" + control.CommandName + "$" + control.CommandArgument + "\"); return false;";
+ return "javascript:GridView_ClientEvent (\"" + ClientID + "\",\"" + buttonControl.CommandName + "$" + buttonControl.CommandArgument + "\"); return false;";
} else
return null;
}
IOrderedDictionary keys;
IOrderedDictionary values;
- public GridViewDeleteEventArgs (int index)
+ public GridViewDeleteEventArgs (int rowIndex)
{
- this.rowIndex = index;
+ this.rowIndex = rowIndex;
}
internal GridViewDeleteEventArgs (int index, IOrderedDictionary keys, IOrderedDictionary values)
this.rows = rows;
}
- public GridViewRow this [int i] {
- get { return (GridViewRow) rows [i]; }
+ public GridViewRow this [int index] {
+ get { return (GridViewRow) rows [index]; }
}
public void CopyTo (GridViewRow[] array, int index)
typeof (RectangleHotSpot)
};
- public HotSpot this [int idx] {
- get { return (HotSpot) ((IList)this)[idx]; }
+ public HotSpot this [int index] {
+ get { return (HotSpot) ((IList)this)[index]; }
}
public int Add (HotSpot spot)
return ((IList)this).Add (spot);
}
- protected override object CreateKnownType (int idx)
+ protected override object CreateKnownType (int index)
{
- switch (idx) {
+ switch (index) {
case 0:
return new CircleHotSpot ();
case 1:
return _knownTypes;
}
- public void Insert (int idx, HotSpot spot)
+ public void Insert (int index, HotSpot spot)
{
- ((IList)this).Insert (idx, spot);
+ ((IList)this).Insert (index, spot);
}
protected override void OnValidate (object o)
((IList)this).Remove (spot);
}
- public void RemoveAt (int idx)
+ public void RemoveAt (int index)
{
- ((IList)this).RemoveAt (idx);
+ ((IList)this).RemoveAt (index);
}
protected override void SetDirtyObject (object o)
{
}
- protected override void AddAttributesToRender (HtmlTextWriter w)
+ protected override void AddAttributesToRender (HtmlTextWriter writer)
{
- base.AddAttributesToRender (w);
- AddDisplayStyleAttribute (w);
+ base.AddAttributesToRender (writer);
+ AddDisplayStyleAttribute (writer);
if (!IsEnabled)
return;
// add attributes - only if they're not empty
string t = Target;
string s = NavigateUrl;
if (s.Length > 0)
- w.AddAttribute (HtmlTextWriterAttribute.Href, ResolveClientUrl (s));
+ writer.AddAttribute (HtmlTextWriterAttribute.Href, ResolveClientUrl (s));
if (t.Length > 0)
- w.AddAttribute (HtmlTextWriterAttribute.Target, t);
+ writer.AddAttribute (HtmlTextWriterAttribute.Target, t);
}
protected override void AddParsedSubObject (object obj)
base.LoadViewState (savedState);
}
- protected internal override void RenderContents (HtmlTextWriter w)
+ protected internal override void RenderContents (HtmlTextWriter writer)
{
if (HasControls () || HasRenderMethodDelegate ()) {
- base.RenderContents (w);
+ base.RenderContents (writer);
return;
}
string image_url = ImageUrl;
if (!String.IsNullOrEmpty (image_url)) {
string str = ToolTip;
if (!String.IsNullOrEmpty (str))
- w.AddAttribute (HtmlTextWriterAttribute.Title, str);
+ writer.AddAttribute (HtmlTextWriterAttribute.Title, str);
- w.AddAttribute (HtmlTextWriterAttribute.Src, ResolveClientUrl (image_url));
+ writer.AddAttribute (HtmlTextWriterAttribute.Src, ResolveClientUrl (image_url));
str = Text;
- w.AddAttribute (HtmlTextWriterAttribute.Alt, str);
- w.RenderBeginTag (HtmlTextWriterTag.Img);
- w.RenderEndTag ();
+ writer.AddAttribute (HtmlTextWriterAttribute.Alt, str);
+ writer.RenderBeginTag (HtmlTextWriterTag.Img);
+ writer.RenderEndTag ();
} else
- w.Write (Text);
+ writer.Write (Text);
}
[Bindable(true)]
set { ViewState ["Text"] = value; }
}
- protected virtual string FormatDataNavigateUrlValue (object value)
+ protected virtual string FormatDataNavigateUrlValue (object dataUrlValue)
{
string format = DataNavigateUrlFormatString;
if (format == "")
format = null;
- return DataBinder.FormatResult (value, format);
+ return DataBinder.FormatResult (dataUrlValue, format);
}
- protected virtual string FormatDataTextValue (object value)
+ protected virtual string FormatDataTextValue (object dataTextValue)
{
string format = DataTextFormatString;
if (format == "")
format = null;
- return DataBinder.FormatResult (value, format);
+ return DataBinder.FormatResult (dataTextValue, format);
}
public override void Initialize ()
ctrl.Target = Target;
}
- public override void InitializeCell (TableCell cell, int column_index, ListItemType item_type)
+ public override void InitializeCell (TableCell cell, int columnIndex, ListItemType itemType)
{
- base.InitializeCell (cell, column_index, item_type);
+ base.InitializeCell (cell, columnIndex, itemType);
- switch (item_type)
+ switch (itemType)
{
case ListItemType.Separator:
case ListItemType.Pager:
PropertyDescriptor[] urlProperties;
static string[] emptyFields;
- public override bool Initialize (bool sortingEnabled, Control control)
+ public override bool Initialize (bool enableSorting, Control control)
{
- return base.Initialize (sortingEnabled, control);
+ return base.Initialize (enableSorting, control);
}
[EditorAttribute ("System.Web.UI.Design.WebControls.DataFieldEditor, " + Consts.AssemblySystem_Design, "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
PropertyDescriptor imageProperty;
PropertyDescriptor textProperty;
- public override bool Initialize (bool sortingEnabled, Control control)
+ public override bool Initialize (bool enableSorting, Control control)
{
- return base.Initialize (sortingEnabled, control);
+ return base.Initialize (enableSorting, control);
}
[DefaultValueAttribute ("")]
}
}
- protected virtual string FormatImageUrlValue (object value)
+ protected virtual string FormatImageUrlValue (object dataValue)
{
- if (value == null)
+ if (dataValue == null)
return null;
else if (DataImageUrlFormatString.Length > 0)
- return string.Format (DataImageUrlFormatString, value);
+ return string.Format (DataImageUrlFormatString, dataValue);
else
- return value.ToString ();
+ return dataValue.ToString ();
}
protected virtual string GetFormattedAlternateText (Control controlContainer)
{
}
- protected override void AddAttributesToRender (HtmlTextWriter w)
+ protected override void AddAttributesToRender (HtmlTextWriter writer)
{
Page page = Page;
if (page != null)
page.VerifyRenderingInServerForm (this);
- base.AddAttributesToRender (w);
+ base.AddAttributesToRender (writer);
bool enabled = IsEnabled;
string onclick = OnClientClick;
onclick = ClientScriptManager.EnsureEndsWithSemicolon (onclick);
}
if (onclick.Length > 0)
- w.AddAttribute (HtmlTextWriterAttribute.Onclick, onclick);
+ writer.AddAttribute (HtmlTextWriterAttribute.Onclick, onclick);
if (enabled && page != null) {
PostBackOptions options = GetPostBackOptions ();
string href = page.ClientScript.GetPostBackEventReference (options, true);
- w.AddAttribute (HtmlTextWriterAttribute.Href, href);
+ writer.AddAttribute (HtmlTextWriterAttribute.Href, href);
}
- AddDisplayStyleAttribute (w);
+ AddDisplayStyleAttribute (writer);
}
protected virtual void RaisePostBackEvent (string eventArgument)
}
}
- protected override void AddAttributesToRender (HtmlTextWriter w)
+ protected override void AddAttributesToRender (HtmlTextWriter writer)
{
- base.AddAttributesToRender (w);
+ base.AddAttributesToRender (writer);
}
public virtual void ClearSelection ()
{
}
- public static ListItem FromString (string text)
+ public static ListItem FromString (string s)
{
- return new ListItem (text);
+ return new ListItem (s);
}
public override bool Equals (object o)
}
protected internal
- override void Render (HtmlTextWriter output)
+ override void Render (HtmlTextWriter writer)
{
if (Mode == LiteralMode.Encode)
- output.Write (HttpUtility.HtmlEncode (Text));
+ writer.Write (HttpUtility.HtmlEncode (Text));
else
- output.Write (Text);
+ writer.Write (Text);
}
}
}
return null;
}
- protected override void LoadViewState (object savedState)
+ protected override void LoadViewState (object state)
{
- if (savedState == null)
+ if (state == null)
return;
- object [] states = (object []) savedState;
+ object [] states = (object []) state;
base.LoadViewState (states[0]);
if (states[1] != null)
base.OnInit (e);
}
- protected internal override void LoadControlState (object ob)
+ protected internal override void LoadControlState (object savedState)
{
- if (ob == null) return;
- object[] state = (object[]) ob;
+ if (savedState == null) return;
+ object[] state = (object[]) savedState;
base.LoadControlState (state[0]);
selectedItemPath = state[1] as string;
}
base.DataBind ();
}
- protected override bool OnBubbleEvent (object source, EventArgs args)
+ protected override bool OnBubbleEvent (object source, EventArgs e)
{
- if (!(args is CommandEventArgs))
+ if (!(e is CommandEventArgs))
return false;
- MenuEventArgs menuArgs = args as MenuEventArgs;
+ MenuEventArgs menuArgs = e as MenuEventArgs;
if (menuArgs != null && string.Equals (menuArgs.CommandName, MenuItemClickCommandName))
OnMenuItemClick (menuArgs);
return true;
return types;
}
- public int IndexOf (MenuItemBinding binding)
+ public int IndexOf (MenuItemBinding value)
{
- return ((IList)this).IndexOf (binding);
+ return ((IList)this).IndexOf (value);
}
public void Insert (int index, MenuItemBinding binding)
item.Menu = menu;
}
- public MenuItem this [int i] {
- get { return (MenuItem) items [i]; }
+ public MenuItem this [int index] {
+ get { return (MenuItem) items [index]; }
}
public void Add (MenuItem child)
}
}
- public bool Contains (MenuItem child)
+ public bool Contains (MenuItem c)
{
- return items.Contains (child);
+ return items.Contains (c);
}
- public void CopyTo (Array itemArray, int index)
+ public void CopyTo (Array array, int index)
{
- items.CopyTo (itemArray, index);
+ items.CopyTo (array, index);
}
- public void CopyTo (MenuItem[] itemArray, int index)
+ public void CopyTo (MenuItem[] array, int index)
{
- items.CopyTo (itemArray, index);
+ items.CopyTo (array, index);
}
public IEnumerator GetEnumerator ()
return items.GetEnumerator ();
}
- public int IndexOf (MenuItem item)
+ public int IndexOf (MenuItem value)
{
- return items.IndexOf (item);
+ return items.IndexOf (value);
}
- public void Remove (MenuItem item)
+ public void Remove (MenuItem value)
{
- int i = IndexOf (item);
+ int i = IndexOf (value);
if (i == -1) return;
items.RemoveAt (i);
if (menu != null)
- item.Menu = null;
+ value.Menu = null;
if (marked) {
SetDirty ();
}
return ((IList)this).Contains (style);
}
- public void CopyTo (MenuItemStyle[] array, int index)
+ public void CopyTo (MenuItemStyle[] styleArray, int index)
{
- ((IList)this).CopyTo (array, index);
+ ((IList)this).CopyTo (styleArray, index);
}
protected override object CreateKnownType (int index)
object dataItem;
int index;
- public MenuItemTemplateContainer (int itemIndex, MenuItem menuItem)
+ public MenuItemTemplateContainer (int itemIndex, MenuItem dataItem)
{
- index = itemIndex;
- dataItem = menuItem;
+ this.index = itemIndex;
+ this.dataItem = dataItem;
}
- protected override bool OnBubbleEvent (object source, EventArgs args)
+ protected override bool OnBubbleEvent (object source, EventArgs e)
{
- CommandEventArgs command = args as CommandEventArgs;
+ CommandEventArgs command = e as CommandEventArgs;
if (command == null)
return false;
remove { Events.RemoveHandler (ActiveViewChangedEvent, value); }
}
- protected override void AddParsedSubObject (object ob)
+ protected override void AddParsedSubObject (object obj)
{
- if (ob is View)
- Controls.Add (ob as View);
+ if (obj is View)
+ Controls.Add (obj as View);
// LAMESPEC: msdn talks that only View contorls are allowed, for others controls HttpException should be thrown
// but actually, aspx praser adds LiteralControl controls.
//else
return source.GetEnumerator ();
}
- public PropertyDescriptorCollection GetItemProperties (PropertyDescriptor [] list_accessors)
+ public PropertyDescriptorCollection GetItemProperties (PropertyDescriptor [] listAccessors)
{
ITypedList typed = source as ITypedList;
if (typed == null)
return null;
- return typed.GetItemProperties (list_accessors);
+ return typed.GetItemProperties (listAccessors);
}
- public string GetListName (PropertyDescriptor [] list_accessors)
+ public string GetListName (PropertyDescriptor [] listAccessors)
{
return String.Empty; // as documented
}
{
}
- protected override void AddAttributesToRender (HtmlTextWriter w)
+ protected override void AddAttributesToRender (HtmlTextWriter writer)
{
- base.AddAttributesToRender (w);
+ base.AddAttributesToRender (writer);
string image = BackImageUrl;
if (image != "") {
image = ResolveClientUrl (image);
- w.AddStyleAttribute (HtmlTextWriterStyle.BackgroundImage, image);
+ writer.AddStyleAttribute (HtmlTextWriterStyle.BackgroundImage, image);
}
if (!String.IsNullOrEmpty (DefaultButton) && Page != null) {
Page.ClientScript.RegisterWebFormClientScript ();
- w.AddAttribute ("onkeypress",
+ writer.AddAttribute ("onkeypress",
"javascript:return " + Page.WebFormScriptReference + ".WebForm_FireDefaultButton(event, '" + button.ClientID + "')");
}
if (Direction != ContentDirection.NotSet) {
- w.AddAttribute (HtmlTextWriterAttribute.Dir, Direction == ContentDirection.RightToLeft ? "rtl" : "ltr", false);
+ writer.AddAttribute (HtmlTextWriterAttribute.Dir, Direction == ContentDirection.RightToLeft ? "rtl" : "ltr", false);
}
switch (ScrollBars) {
case ScrollBars.Auto:
- w.AddStyleAttribute (HtmlTextWriterStyle.Overflow, "auto");
+ writer.AddStyleAttribute (HtmlTextWriterStyle.Overflow, "auto");
break;
case ScrollBars.Both:
- w.AddStyleAttribute (HtmlTextWriterStyle.Overflow, "scroll");
+ writer.AddStyleAttribute (HtmlTextWriterStyle.Overflow, "scroll");
break;
case ScrollBars.Horizontal:
- w.AddStyleAttribute (HtmlTextWriterStyle.OverflowX, "scroll");
+ writer.AddStyleAttribute (HtmlTextWriterStyle.OverflowX, "scroll");
break;
case ScrollBars.Vertical:
- w.AddStyleAttribute (HtmlTextWriterStyle.OverflowY, "scroll");
+ writer.AddStyleAttribute (HtmlTextWriterStyle.OverflowY, "scroll");
break;
}
if (!Wrap) {
- w.AddStyleAttribute (HtmlTextWriterStyle.WhiteSpace, "nowrap");
+ writer.AddStyleAttribute (HtmlTextWriterStyle.WhiteSpace, "nowrap");
}
string align = "";
}
if (align != "")
- w.AddStyleAttribute (HtmlTextWriterStyle.TextAlign, align);
+ writer.AddStyleAttribute (HtmlTextWriterStyle.TextAlign, align);
}
PanelStyle PanelStyle {
get { return (ControlStyle as PanelStyle); }
EventHandler _parametersChanged;
- public int Add (Parameter param)
+ public int Add (Parameter parameter)
{
- return ((IList)this).Add (param);
+ return ((IList)this).Add (parameter);
}
public int Add (string name, string value)
return ((IList)this).Add (new Parameter (name, dbType, value));
}
- protected override object CreateKnownType (int idx)
+ protected override object CreateKnownType (int index)
{
- switch (idx) {
+ switch (index) {
case 0:
return new ControlParameter ();
case 1:
param.UpdateValue (context, control);
}
- public void Insert (int idx, Parameter param)
+ public void Insert (int index, Parameter parameter)
{
- ((IList)this).Insert (idx, param);
+ ((IList)this).Insert (index, parameter);
}
protected override void OnClearComplete ()
OnParametersChanged (EventArgs.Empty);
}
- protected override void OnInsert (int idx, object value)
+ protected override void OnInsert (int index, object value)
{
- base.OnInsert (idx, value);
+ base.OnInsert (index, value);
((Parameter)value).SetOwnerCollection (this);
}
- protected override void OnInsertComplete (int idx, object value)
+ protected override void OnInsertComplete (int index, object value)
{
- base.OnInsertComplete (idx, value);
+ base.OnInsertComplete (index, value);
OnParametersChanged (EventArgs.Empty);
}
throw new ArgumentException ("o is not a Parameter");
}
- public void Remove (Parameter param)
+ public void Remove (Parameter parameter)
{
- ((IList)this).Remove (param);
+ ((IList)this).Remove (parameter);
}
- public void RemoveAt (int idx)
+ public void RemoveAt (int index)
{
- ((IList)this).RemoveAt (idx);
+ ((IList)this).RemoveAt (index);
}
protected override void SetDirtyObject (object o)
return -1;
}
- public Parameter this[int idx] {
+ public Parameter this[int index] {
get {
- return (Parameter) ((IList)this)[idx];
+ return (Parameter) ((IList)this)[index];
}
set {
- ((IList)this)[idx] = value;
+ ((IList)this)[index] = value;
}
}
remove { _parametersChanged -= value; }
}
- public bool Contains (Parameter param)
+ public bool Contains (Parameter parameter)
{
- return ((IList)this).Contains (param);
+ return ((IList)this).Contains (parameter);
}
- public void CopyTo (Parameter[] paramArray, int index)
+ public void CopyTo (Parameter[] parameterArray, int index)
{
- ((IList)this).CopyTo (paramArray, index);
+ ((IList)this).CopyTo (parameterArray, index);
}
- public int IndexOf (Parameter param)
+ public int IndexOf (Parameter parameter)
{
- return ((IList)this).IndexOf (param);
+ return ((IList)this).IndexOf (parameter);
}
protected override void OnRemoveComplete (int index, object value)
return new QueryStringParameter (this);
}
protected internal
- override object Evaluate (HttpContext ctx, Control control)
+ override object Evaluate (HttpContext context, Control control)
{
- if (ctx == null || ctx.Request == null)
+ if (context == null || context.Request == null)
return null;
- return ctx.Request.QueryString [QueryStringField];
+ return context.Request.QueryString [QueryStringField];
}
[DefaultValueAttribute ("")]
{
}
- protected override void AddAttributesToRender (HtmlTextWriter w)
+ protected override void AddAttributesToRender (HtmlTextWriter writer)
{
if (RenderUplevel) {
RegisterExpandoAttribute (ClientID, "evaluationfunction", "RegularExpressionValidatorEvaluateIsValid");
RegisterExpandoAttribute (ClientID, "validationexpression", ValidationExpression, true);
}
- base.AddAttributesToRender (w);
+ base.AddAttributesToRender (writer);
}
protected override bool EvaluateIsValid ()
public sealed class RepeatInfo {
// What is baseControl for ?
- public void RenderRepeater (HtmlTextWriter w, IRepeatInfoUser user, Style controlStyle, WebControl baseControl)
+ public void RenderRepeater (HtmlTextWriter writer, IRepeatInfoUser user, Style controlStyle, WebControl baseControl)
{
PrintValues (user);
RepeatLayout layout = RepeatLayout;
}
if (RepeatDirection == RepeatDirection.Vertical) {
if (listLayout)
- RenderList (w, user, controlStyle, baseControl);
+ RenderList (writer, user, controlStyle, baseControl);
else
- RenderVert (w, user, controlStyle, baseControl);
+ RenderVert (writer, user, controlStyle, baseControl);
} else {
if (listLayout)
throw new InvalidOperationException ("The UnorderedList and OrderedList layouts only support vertical layout.");
- RenderHoriz (w, user, controlStyle, baseControl);
+ RenderHoriz (writer, user, controlStyle, baseControl);
}
}
// attributes
[ToolboxData ("<{0}:RequiredFieldValidator runat=\"server\" ErrorMessage=\"RequiredFieldValidator\"></{0}:RequiredFieldValidator>")]
public class RequiredFieldValidator : BaseValidator {
- protected override void AddAttributesToRender (HtmlTextWriter w)
+ protected override void AddAttributesToRender (HtmlTextWriter writer)
{
if (RenderUplevel) {
RegisterExpandoAttribute (ClientID, "evaluationfunction", "RequiredFieldValidatorEvaluateIsValid");
RegisterExpandoAttribute (ClientID, "initialvalue", InitialValue, true);
}
- base.AddAttributesToRender (w);
+ base.AddAttributesToRender (writer);
}
protected override bool EvaluateIsValid ()
string value;
bool is_valid;
- public ServerValidateEventArgs (string value, bool is_valid)
+ public ServerValidateEventArgs (string value, bool isValid)
{
this.value = value;
- this.is_valid = is_valid;
+ this.is_valid = isValid;
}
public string Value {
return new SessionParameter (this);
}
protected internal
- override object Evaluate (HttpContext ctx, Control control)
+ override object Evaluate (HttpContext context, Control control)
{
- if (ctx == null || ctx.Session == null)
+ if (context == null || context.Session == null)
return null;
- return ctx.Session [SessionField];
+ return context.Session [SessionField];
}
[DefaultValueAttribute ("")]
{
SiteMapNodeCollection collection;
- public SiteMapDataSourceView (SiteMapDataSource owner, string viewName, SiteMapNode node)
- : this (owner, viewName, new SiteMapNodeCollection (node))
+ public SiteMapDataSourceView (SiteMapDataSource owner, string name, SiteMapNode node)
+ : this (owner, name, new SiteMapNodeCollection (node))
{
}
- public SiteMapDataSourceView (SiteMapDataSource owner, string viewName, SiteMapNodeCollection collection)
- : base (owner, viewName)
+ public SiteMapDataSourceView (SiteMapDataSource owner, string name, SiteMapNodeCollection collection)
+ : base (owner, name)
{
this.collection = collection;
}
}
[MonoTODO ("why override?")]
- protected internal override void Render (HtmlTextWriter w)
+ protected internal override void Render (HtmlTextWriter writer)
{
- base.Render (w);
+ base.Render (writer);
}
- protected internal override void RenderContents (HtmlTextWriter w)
+ protected internal override void RenderContents (HtmlTextWriter writer)
{
string skip_id = ClientID + "_SkipLink";
string altText = SkipLinkText;
if (needAnchor) {
// Anchor start
- w.AddAttribute (HtmlTextWriterAttribute.Href, "#" + skip_id);
- w.RenderBeginTag (HtmlTextWriterTag.A);
+ writer.AddAttribute (HtmlTextWriterAttribute.Href, "#" + skip_id);
+ writer.RenderBeginTag (HtmlTextWriterTag.A);
// Image
- w.AddAttribute (HtmlTextWriterAttribute.Alt, altText);
- w.AddAttribute (HtmlTextWriterAttribute.Height, "0");
- w.AddAttribute (HtmlTextWriterAttribute.Width, "0");
- w.AddAttribute (HtmlTextWriterAttribute.Src, Page.ClientScript.GetWebResourceUrl (typeof (SiteMapPath), "transparent.gif"));
- w.AddStyleAttribute (HtmlTextWriterStyle.BorderWidth, "0px");
- w.RenderBeginTag (HtmlTextWriterTag.Img);
- w.RenderEndTag ();
+ writer.AddAttribute (HtmlTextWriterAttribute.Alt, altText);
+ writer.AddAttribute (HtmlTextWriterAttribute.Height, "0");
+ writer.AddAttribute (HtmlTextWriterAttribute.Width, "0");
+ writer.AddAttribute (HtmlTextWriterAttribute.Src, Page.ClientScript.GetWebResourceUrl (typeof (SiteMapPath), "transparent.gif"));
+ writer.AddStyleAttribute (HtmlTextWriterStyle.BorderWidth, "0px");
+ writer.RenderBeginTag (HtmlTextWriterTag.Img);
+ writer.RenderEndTag ();
- w.RenderEndTag ();
+ writer.RenderEndTag ();
}
- base.RenderContents (w);
+ base.RenderContents (writer);
if (needAnchor) {
- w.AddAttribute(HtmlTextWriterAttribute.Id, skip_id);
- w.RenderBeginTag(HtmlTextWriterTag.A);
- w.RenderEndTag();
+ writer.AddAttribute(HtmlTextWriterAttribute.Id, skip_id);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.RenderEndTag();
}
}
return View.Delete (null, null);
}
- public IEnumerable Select (DataSourceSelectArguments args)
+ public IEnumerable Select (DataSourceSelectArguments arguments)
{
- return View.Select (args);
+ return View.Select (arguments);
}
public int Update ()
registered_class = name;
}
- public CssStyleCollection GetStyleAttributes (IUrlResolutionService resolver)
+ public CssStyleCollection GetStyleAttributes (IUrlResolutionService urlResolver)
{
CssStyleCollection col = new CssStyleCollection ();
- FillStyleAttributes (col, resolver);
+ FillStyleAttributes (col, urlResolver);
return col;
}
return ((IList)this).Contains (style);
}
- public void CopyTo (SubMenuStyle[] array, int index)
+ public void CopyTo (SubMenuStyle[] styleArray, int index)
{
- ((IList)this).CopyTo (array, index);
+ ((IList)this).CopyTo (styleArray, index);
}
protected override object CreateKnownType (int index)
"search"
};
- protected override void AddAttributesToRender (HtmlTextWriter w)
+ protected override void AddAttributesToRender (HtmlTextWriter writer)
{
Page page = Page;
if (page != null)
switch (TextMode) {
case TextBoxMode.MultiLine:
if (Columns != 0)
- w.AddAttribute (HtmlTextWriterAttribute.Cols, Columns.ToString (), false);
+ writer.AddAttribute (HtmlTextWriterAttribute.Cols, Columns.ToString (), false);
else
- w.AddAttribute (HtmlTextWriterAttribute.Cols, "20", false);
+ writer.AddAttribute (HtmlTextWriterAttribute.Cols, "20", false);
if (Rows != 0)
- w.AddAttribute (HtmlTextWriterAttribute.Rows, Rows.ToString (), false);
+ writer.AddAttribute (HtmlTextWriterAttribute.Rows, Rows.ToString (), false);
else
- w.AddAttribute (HtmlTextWriterAttribute.Rows, "2", false);
+ writer.AddAttribute (HtmlTextWriterAttribute.Rows, "2", false);
if (!Wrap)
- w.AddAttribute (HtmlTextWriterAttribute.Wrap, "off", false);
+ writer.AddAttribute (HtmlTextWriterAttribute.Wrap, "off", false);
break;
case TextBoxMode.Password:
if (TextMode == TextBoxMode.Password)
- w.AddAttribute (HtmlTextWriterAttribute.Type, "password", false);
+ writer.AddAttribute (HtmlTextWriterAttribute.Type, "password", false);
else {
- w.AddAttribute (HtmlTextWriterAttribute.Type, "text", false);
+ writer.AddAttribute (HtmlTextWriterAttribute.Type, "text", false);
if (Text.Length > 0)
- w.AddAttribute (HtmlTextWriterAttribute.Value, Text);
+ writer.AddAttribute (HtmlTextWriterAttribute.Value, Text);
}
if (Columns != 0)
- w.AddAttribute (HtmlTextWriterAttribute.Size, Columns.ToString (), false);
+ writer.AddAttribute (HtmlTextWriterAttribute.Size, Columns.ToString (), false);
if (MaxLength != 0)
- w.AddAttribute (HtmlTextWriterAttribute.Maxlength, MaxLength.ToString (), false);
+ writer.AddAttribute (HtmlTextWriterAttribute.Maxlength, MaxLength.ToString (), false);
if (AutoCompleteType != AutoCompleteType.None && TextMode == TextBoxMode.SingleLine)
if (AutoCompleteType != AutoCompleteType.Disabled)
- w.AddAttribute (HtmlTextWriterAttribute.VCardName, VCardValues [(int) AutoCompleteType]);
+ writer.AddAttribute (HtmlTextWriterAttribute.VCardName, VCardValues [(int) AutoCompleteType]);
else
- w.AddAttribute (HtmlTextWriterAttribute.AutoComplete, "off", false);
+ writer.AddAttribute (HtmlTextWriterAttribute.AutoComplete, "off", false);
break;
}
if (AutoPostBack) {
- w.AddAttribute ("onkeypress", "if (WebForm_TextBoxKeyHandler(event) == false) return false;", false);
+ writer.AddAttribute ("onkeypress", "if (WebForm_TextBoxKeyHandler(event) == false) return false;", false);
if (page != null) {
string onchange = page.ClientScript.GetPostBackEventReference (GetPostBackOptions (), true);
onchange = String.Concat ("setTimeout('", onchange.Replace ("\\", "\\\\").Replace ("'", "\\'"), "', 0)");
- w.AddAttribute (HtmlTextWriterAttribute.Onchange, BuildScriptAttribute ("onchange", onchange));
+ writer.AddAttribute (HtmlTextWriterAttribute.Onchange, BuildScriptAttribute ("onchange", onchange));
}
} else if (page != null)
page.ClientScript.RegisterForEventValidation (UniqueID, String.Empty);
if (ReadOnly)
- w.AddAttribute (HtmlTextWriterAttribute.ReadOnly, "ReadOnly", false);
+ writer.AddAttribute (HtmlTextWriterAttribute.ReadOnly, "ReadOnly", false);
- w.AddAttribute (HtmlTextWriterAttribute.Name, UniqueID);
+ writer.AddAttribute (HtmlTextWriterAttribute.Name, UniqueID);
- base.AddAttributesToRender (w);
+ base.AddAttributesToRender (writer);
}
protected override void AddParsedSubObject (object obj)
}
protected internal
- override void Render (HtmlTextWriter w)
+ override void Render (HtmlTextWriter writer)
{
// Why didn't msft just override RenderContents!?
- RenderBeginTag (w);
+ RenderBeginTag (writer);
if (TextMode == TextBoxMode.MultiLine) {
- w.WriteLine ();
- HttpUtility.HtmlEncode (Text, w);
+ writer.WriteLine ();
+ HttpUtility.HtmlEncode (Text, writer);
}
- RenderEndTag (w);
+ RenderEndTag (writer);
}
protected virtual
Expanded = !Expanded.GetValueOrDefault(false);
}
- void IStateManager.LoadViewState (object savedState)
+ void IStateManager.LoadViewState (object state)
{
- LoadViewState (savedState);
+ LoadViewState (state);
}
- protected virtual void LoadViewState (object savedState)
+ protected virtual void LoadViewState (object state)
{
- if (savedState == null)
+ if (state == null)
return;
- object[] states = (object[]) savedState;
+ object[] states = (object[]) state;
ViewState.LoadViewState (states [0]);
if (tree != null && SelectedFlag)
return ((IList)this).Contains (binding);
}
- public void CopyTo (TreeNodeBinding[] array, int index)
+ public void CopyTo (TreeNodeBinding[] bindingArray, int index)
{
- ((IList)this).CopyTo (array, index);
+ ((IList)this).CopyTo (bindingArray, index);
}
protected override object CreateKnownType (int index)
node.Tree = tree;
}
- public TreeNode this [int i] {
- get { return (TreeNode) items [i]; }
+ public TreeNode this [int index] {
+ get { return (TreeNode) items [index]; }
}
public void Add (TreeNode child)
}
}
- public bool Contains (TreeNode child)
+ public bool Contains (TreeNode c)
{
- return items.Contains (child);
+ return items.Contains (c);
}
public void CopyTo (TreeNode[] nodeArray, int index)
return items.GetEnumerator ();
}
- public int IndexOf (TreeNode node)
+ public int IndexOf (TreeNode value)
{
- return items.IndexOf (node);
+ return items.IndexOf (value);
}
- public void Remove (TreeNode node)
+ public void Remove (TreeNode value)
{
- int i = IndexOf (node);
+ int i = IndexOf (value);
if (i == -1) return;
items.RemoveAt (i);
if (tree != null)
- node.Tree = null;
+ value.Tree = null;
if (marked) {
SetDirty ();
}
return ((IList)this).Contains (style);
}
- public void CopyTo (TreeNodeStyle[] array, int index)
+ public void CopyTo (TreeNodeStyle[] styleArray, int index)
{
- ((IList)this).CopyTo (array, index);
+ ((IList)this).CopyTo (styleArray, index);
}
protected override object CreateKnownType (int index)
return null;
}
- protected override void LoadViewState (object savedState)
+ protected override void LoadViewState (object state)
{
- if (savedState == null)
+ if (state == null)
return;
- object [] states = (object []) savedState;
+ object [] states = (object []) state;
base.LoadViewState (states[0]);
if (states[1] != null)
}
string callbackResult;
- protected virtual void RaiseCallbackEvent (string eventArgs)
+ protected virtual void RaiseCallbackEvent (string eventArgument)
{
- string[] args = eventArgs.Split ('|');
+ string[] args = eventArgument.Split ('|');
RequiresDataBinding = true;
EnsureDataBound ();
return ToString (Helpers.InvariantCulture);
}
- public string ToString (IFormatProvider provider)
+ public string ToString (IFormatProvider formatProvider)
{
if (type == 0)
return String.Empty;
string ex = GetExtension (type);
- return value.ToString (provider) + ex;
+ return value.ToString (formatProvider) + ex;
}
}
throw new NotImplementedException ();
}
- protected internal override void LoadControlState (object ob)
+ protected internal override void LoadControlState (object state)
{
- if (ob == null) return;
- object[] state = (object[]) ob;
- base.LoadControlState (state[0]);
- activeStepIndex = (int) state[1];
- history = (ArrayList) state[2];
+ if (state == null) return;
+ object[] controlState = (object[]) state;
+ base.LoadControlState (controlState[0]);
+ activeStepIndex = (int) controlState[1];
+ history = (ArrayList) controlState[2];
}
protected internal override object SaveControlState ()
int nxtStepIndex;
bool cancel;
- public WizardNavigationEventArgs (int currentIndex, int nextIndex)
+ public WizardNavigationEventArgs (int currentStepIndex, int nextStepIndex)
{
- this.curStepIndex = currentIndex;
- this.nxtStepIndex = nextIndex;
+ this.curStepIndex = currentStepIndex;
+ this.nxtStepIndex = nextStepIndex;
cancel = false;
}
//
namespace System.Web.UI.WebControls {
- public delegate void WizardNavigationEventHandler (object source, WizardNavigationEventArgs e);
+ public delegate void WizardNavigationEventHandler (object sender, WizardNavigationEventArgs e);
}
this.bag = bag;
}
- public override bool Equals (object obj)
+ public override bool Equals (object o)
{
- AttributeCollection other = obj as AttributeCollection;
+ AttributeCollection other = o as AttributeCollection;
if (other == null) {
return false;
}
return (bool) attr_render [null];
}
- protected override bool OnStyleAttributeRender (string styleAttrName, string value, HtmlTextWriterStyle key)
+ protected override bool OnStyleAttributeRender (string name, string value, HtmlTextWriterStyle key)
{
return key == HtmlTextWriterStyle.Display;
}
- protected override bool OnTagRender (string name, HtmlTextWriterTag tag)
+ protected override bool OnTagRender (string name, HtmlTextWriterTag key)
{
- return tag != HtmlTextWriterTag.Span;
+ return key != HtmlTextWriterTag.Span;
}
}
}
{
BuildTemplateMethod templateMethod;
- public CompiledTemplateBuilder (BuildTemplateMethod templateMethod)
+ public CompiledTemplateBuilder (BuildTemplateMethod buildTemplateMethod)
{
- this.templateMethod = templateMethod;
+ this.templateMethod = buildTemplateMethod;
}
- public void InstantiateIn (Control ctrl)
+ public void InstantiateIn (Control container)
{
- templateMethod (ctrl);
+ templateMethod (container);
}
}
}
Page.SetFocus (this);
}
- protected internal virtual void LoadControlState (object state)
+ protected internal virtual void LoadControlState (object savedState)
{
}
return new SimpleEnumerator (this);
}
- public virtual int IndexOf (Control c)
+ public virtual int IndexOf (Control value)
{
- if (controls == null || c == null)
+ if (controls == null || value == null)
return -1;
- return Array.IndexOf (controls, c);
+ return Array.IndexOf (controls, value);
}
public virtual void Remove (Control value)
object propertyValue;
Type propertyType;
- public ControlValuePropertyAttribute (string propName)
+ public ControlValuePropertyAttribute (string name)
{
- this.propertyName = propName;
+ this.propertyName = name;
}
- public ControlValuePropertyAttribute (string propName, object propValue)
+ public ControlValuePropertyAttribute (string name, object defaultValue)
{
- this.propertyName = propName;
- this.propertyValue = propValue;
+ this.propertyName = name;
+ this.propertyValue = defaultValue;
}
- public ControlValuePropertyAttribute (string propName, Type type, string propValue)
+ public ControlValuePropertyAttribute (string name, Type type, string defaultValue)
{
- this.propertyName = propName;
- this.propertyValue = propValue;
+ this.propertyName = name;
+ this.propertyValue = defaultValue;
this.propertyType = type;
}
return prop.GetValue (container, args);
}
- public static string GetIndexedPropertyValue (object container, string expr, string format)
+ public static string GetIndexedPropertyValue (object container, string propName, string format)
{
- object result = GetIndexedPropertyValue (container, expr);
+ object result = GetIndexedPropertyValue (container, propName);
return FormatResult (result, format);
}
}
[EditorBrowsable (EditorBrowsableState.Never)]
- public override void RenderControl (HtmlTextWriter tw)
+ public override void RenderControl (HtmlTextWriter writer)
{
- base.RenderControl (tw);
+ base.RenderControl (writer);
}
[EditorBrowsable (EditorBrowsableState.Never)]
this.sortExpression = sortExpression;
}
- public DataSourceSelectArguments (int startingRowIndex, int maxRows)
+ public DataSourceSelectArguments (int startRowIndex, int maximumRows)
{
- this.startingRowIndex = startingRowIndex;
- this.maxRows = maxRows;
+ this.startingRowIndex = startRowIndex;
+ this.maxRows = maximumRows;
}
- public DataSourceSelectArguments (string sortExpression, int startingRowIndex, int maxRows)
+ public DataSourceSelectArguments (string sortExpression, int startRowIndex, int maximumRows)
{
this.sortExpression = sortExpression;
- this.startingRowIndex = startingRowIndex;
- this.maxRows = maxRows;
+ this.startingRowIndex = startRowIndex;
+ this.maxRows = maximumRows;
}
- public void AddSupportedCapabilities (DataSourceCapabilities srcCapabilities)
+ public void AddSupportedCapabilities (DataSourceCapabilities capabilities)
{
- this.dsc = this.dsc | srcCapabilities;
+ this.dsc = this.dsc | capabilities;
}
// MSDN: The DataSourceSelectArguments class overrides the Object.Equals method to test
OnDataSourceViewChanged (EventArgs.Empty);
}
- public virtual void Delete (IDictionary keys, IDictionary values,
- DataSourceViewOperationCallback callBack)
+ public virtual void Delete (IDictionary keys, IDictionary oldValues,
+ DataSourceViewOperationCallback callback)
{
- if (callBack == null)
+ if (callback == null)
throw new ArgumentNullException ("callBack");
int rowAffected;
try {
- rowAffected = ExecuteDelete (keys, values);
+ rowAffected = ExecuteDelete (keys, oldValues);
}
catch (Exception e) {
- if (!callBack (0, e))
+ if (!callback (0, e))
throw;
return;
}
- callBack (rowAffected, null);
+ callback (rowAffected, null);
}
- protected virtual int ExecuteDelete(IDictionary keys, IDictionary values)
+ protected virtual int ExecuteDelete(IDictionary keys, IDictionary oldValues)
{
throw new NotSupportedException ();
}
- protected virtual int ExecuteInsert (IDictionary keys)
+ protected virtual int ExecuteInsert (IDictionary values)
{
throw new NotSupportedException();
}
}
public virtual void Insert (IDictionary values,
- DataSourceViewOperationCallback callBack)
+ DataSourceViewOperationCallback callback)
{
- if (callBack == null)
- throw new ArgumentNullException("callBack");
+ if (callback == null)
+ throw new ArgumentNullException("callback");
int rowAffected;
try {
rowAffected = ExecuteInsert (values);
} catch (Exception e) {
- if (!callBack (0, e))
+ if (!callback (0, e))
throw;
return;
}
- callBack (rowAffected, null);
+ callback (rowAffected, null);
}
- protected virtual void OnDataSourceViewChanged (EventArgs eventArgs)
+ protected virtual void OnDataSourceViewChanged (EventArgs e)
{
if (eventsList != null) {
EventHandler evtHandler = eventsList [EventDataSourceViewChanged] as EventHandler;
if (evtHandler != null)
- evtHandler(this, eventArgs);
+ evtHandler(this, e);
}
}
return;
}
- public virtual void Select (DataSourceSelectArguments selectArgs,
- DataSourceViewSelectCallback callBack)
+ public virtual void Select (DataSourceSelectArguments arguments,
+ DataSourceViewSelectCallback callback)
{
- if (callBack == null)
+ if (callback == null)
throw new ArgumentNullException("callBack");
- selectArgs.RaiseUnsupportedCapabilitiesError (this);
+ arguments.RaiseUnsupportedCapabilitiesError (this);
- IEnumerable selectList = ExecuteSelect (selectArgs);
- callBack (selectList);
+ IEnumerable selectList = ExecuteSelect (arguments);
+ callback (selectList);
}
public virtual void Update(IDictionary keys, IDictionary values,
- IDictionary oldValues, DataSourceViewOperationCallback callBack)
+ IDictionary oldValues, DataSourceViewOperationCallback callback)
{
- if (callBack == null)
- throw new ArgumentNullException ("callBack");
+ if (callback == null)
+ throw new ArgumentNullException ("callback");
int rowAffected;
try {
rowAffected = ExecuteUpdate (keys, values, oldValues);
} catch (Exception e) {
- if (!callBack (0, e))
+ if (!callback (0, e))
throw;
return;
}
- callBack (rowAffected, null);
+ callback (rowAffected, null);
}
public virtual bool CanDelete { get { return false; } }
namespace System.Web.UI
{
- public delegate bool DataSourceViewOperationCallback (int recordsAffected, Exception exception);
+ public delegate bool DataSourceViewOperationCallback (int affectedRecords, Exception ex);
}
OnChanged (new EventArgs ());
}
- public bool Contains (string propertyName)
+ public bool Contains (string propName)
{
- return list.Contains (propertyName);
+ return list.Contains (propName);
}
public void CopyTo (Array array, int index)
list.CopyTo (array, index);
}
- public void CopyTo (ExpressionBinding [] bindings, int index)
+ public void CopyTo (ExpressionBinding [] array, int index)
{
if (index < 0)
throw new ArgumentNullException ("Index cannot be negative");
- if (index >= bindings.Length)
+ if (index >= array.Length)
throw new ArgumentException ("Index cannot be greater than or equal to length of array passed");
- if (list.Count > (bindings.Length - index + 1))
+ if (list.Count > (array.Length - index + 1))
throw new ArgumentException ("Number of elements in source is greater than available space from index to end of destination");
foreach (string key in list.Keys)
- bindings [index++] = (ExpressionBinding) list [key];
+ array [index++] = (ExpressionBinding) list [key];
}
public IEnumerator GetEnumerator ()
}
- public virtual void AddAttribute (string name, string value, bool fEncode)
+ public virtual void AddAttribute (string name, string value, bool fEndode)
{
- if (fEncode)
+ if (fEndode)
value = HttpUtility.HtmlAttributeEncode (value);
AddAttribute (name, value, GetAttributeKey (name));
b.Write (format, arg0, arg1);
}
- public override void Write (string format, params object [] args)
+ public override void Write (string format, params object [] arg)
{
OutputTabs ();
- b.Write (format, args);
+ b.Write (format, arg);
}
public override void Write (string s)
newline = true;
}
- public override void WriteLine (string format, params object [] args)
+ public override void WriteLine (string format, params object [] arg)
{
OutputTabs ();
- b.WriteLine (format, args);
+ b.WriteLine (format, arg);
newline = true;
}
}
}
- protected internal override void Render (HtmlTextWriter writer)
+ protected internal override void Render (HtmlTextWriter output)
{
- writer.Write (_text);
+ output.Write (_text);
}
protected override ControlCollection CreateControlCollection ()
}
[EditorBrowsable (EditorBrowsableState.Advanced)]
- protected virtual void SavePageStateToPersistenceMedium (object viewState)
+ protected virtual void SavePageStateToPersistenceMedium (object state)
{
PageStatePersister persister = this.PageStatePersister;
if (persister == null)
return;
- Pair pair = viewState as Pair;
+ Pair pair = state as Pair;
if (pair != null) {
persister.ViewState = pair.First;
persister.ControlState = pair.Second;
} else
- persister.ViewState = viewState;
+ persister.ViewState = state;
persister.Save ();
}
[MonoDocumentationNote ("Not implemented. Only used by .net aspx parser")]
[EditorBrowsable (EditorBrowsableState.Never)]
- protected object GetWrappedFileDependencies (string [] list)
+ protected object GetWrappedFileDependencies (string [] virtualFileDependencies)
{
- return list;
+ return virtualFileDependencies;
}
[MonoDocumentationNote ("Does nothing. Used by .net aspx parser")]
{
}
- public virtual IHttpHandler GetHandler (HttpContext context, string requestType, string url, string path)
+ public virtual IHttpHandler GetHandler (HttpContext context, string requestType, string virtualPath, string path)
{
- return PageParser.GetCompiledPageInstance (url, path, context);
+ return PageParser.GetCompiledPageInstance (virtualPath, path, context);
}
public virtual void ReleaseHandler (IHttpHandler handler)
[Serializable]
public sealed class Pair
{
- public Pair (object first, object second)
+ public Pair (object x, object y)
{
- First = first;
- Second = second;
+ First = x;
+ Second = y;
}
public Pair ()
Type containerType;
BindingDirection direction;
- public TemplateContainerAttribute (Type containerType, BindingDirection direction)
+ public TemplateContainerAttribute (Type containerType, BindingDirection bindingDirection)
{
this.containerType = containerType;
- this.direction = direction;
+ this.direction = bindingDirection;
}
public BindingDirection BindingDirection {
return LoadControl (type, null);
}
- public Control LoadControl (Type type, object[] parameters)
+ public Control LoadControl (Type t, object[] parameters)
{
object [] attrs = null;
- if (type != null)
- type.GetCustomAttributes (typeof (PartialCachingAttribute), true);
+ if (t != null)
+ t.GetCustomAttributes (typeof (PartialCachingAttribute), true);
if (attrs != null && attrs.Length == 1) {
PartialCachingAttribute attr = (PartialCachingAttribute) attrs [0];
- PartialCachingControl ctrl = new PartialCachingControl (type, parameters);
+ PartialCachingControl ctrl = new PartialCachingControl (t, parameters);
ctrl.VaryByParams = attr.VaryByParams;
ctrl.VaryByControls = attr.VaryByControls;
ctrl.VaryByCustom = attr.VaryByCustom;
return ctrl;
}
- object control = Activator.CreateInstance (type, parameters);
+ object control = Activator.CreateInstance (t, parameters);
if (control is UserControl)
((UserControl) control).InitializeAsUserControl (Page);
return DataBinder.Eval (Page.GetDataItem(), expression, format);
}
- protected internal object XPath (string xpathexpression)
+ protected internal object XPath (string xPathExpression)
{
- return XPathBinder.Eval (Page.GetDataItem(), xpathexpression);
+ return XPathBinder.Eval (Page.GetDataItem(), xPathExpression);
}
- protected internal object XPath (string xpathexpression, IXmlNamespaceResolver resolver)
+ protected internal object XPath (string xPathExpression, IXmlNamespaceResolver resolver)
{
- return XPathBinder.Eval (Page.GetDataItem (), xpathexpression, null, resolver);
+ return XPathBinder.Eval (Page.GetDataItem (), xPathExpression, null, resolver);
}
- protected internal string XPath (string xpathexpression, string format)
+ protected internal string XPath (string xPathExpression, string format)
{
- return XPathBinder.Eval (Page.GetDataItem(), xpathexpression, format);
+ return XPathBinder.Eval (Page.GetDataItem(), xPathExpression, format);
}
- protected internal string XPath (string xpathexpression, string format, IXmlNamespaceResolver resolver)
+ protected internal string XPath (string xPathExpression, string format, IXmlNamespaceResolver resolver)
{
- return XPathBinder.Eval (Page.GetDataItem (), xpathexpression, format, resolver);
+ return XPathBinder.Eval (Page.GetDataItem (), xPathExpression, format, resolver);
}
- protected internal IEnumerable XPathSelect (string xpathexpression)
+ protected internal IEnumerable XPathSelect (string xPathExpression)
{
- return XPathBinder.Select (Page.GetDataItem(), xpathexpression);
+ return XPathBinder.Select (Page.GetDataItem(), xPathExpression);
}
- protected internal IEnumerable XPathSelect (string xpathexpression, IXmlNamespaceResolver resolver)
+ protected internal IEnumerable XPathSelect (string xPathExpression, IXmlNamespaceResolver resolver)
{
- return XPathBinder.Select (Page.GetDataItem (), xpathexpression, resolver);
+ return XPathBinder.Select (Page.GetDataItem (), xPathExpression, resolver);
}
// IFilterResolutionService
{
}
- public static object Eval (object container, string xpath)
+ public static object Eval (object container, string xPath)
{
- return Eval (container, xpath, (IXmlNamespaceResolver)null);
+ return Eval (container, xPath, (IXmlNamespaceResolver)null);
}
- public static object Eval (object container, string xpath, IXmlNamespaceResolver resolver)
+ public static object Eval (object container, string xPath, IXmlNamespaceResolver resolver)
{
- if (xpath == null || xpath.Length == 0)
- throw new ArgumentNullException ("xpath");
+ if (xPath == null || xPath.Length == 0)
+ throw new ArgumentNullException ("xPath");
IXPathNavigable factory = container as IXPathNavigable;
if (factory == null)
throw new ArgumentException ("container");
- object result = factory.CreateNavigator ().Evaluate (xpath, resolver);
+ object result = factory.CreateNavigator ().Evaluate (xPath, resolver);
XPathNodeIterator itr = result as XPathNodeIterator;
if (itr != null) {
return result;
}
- public static string Eval (object container, string xpath, string format)
+ public static string Eval (object container, string xPath, string format)
{
- return Eval (container, xpath, format, null);
+ return Eval (container, xPath, format, null);
}
- public static string Eval (object container, string xpath, string format, IXmlNamespaceResolver resolver)
+ public static string Eval (object container, string xPath, string format, IXmlNamespaceResolver resolver)
{
- object result = Eval (container, xpath, resolver);
+ object result = Eval (container, xPath, resolver);
if (result == null)
return String.Empty;
return String.Format (format, result);
}
- public static IEnumerable Select (object container, string xpath)
+ public static IEnumerable Select (object container, string xPath)
{
- return Select (container, xpath, null);
+ return Select (container, xPath, null);
}
- public static IEnumerable Select (object container, string xpath, IXmlNamespaceResolver resolver)
+ public static IEnumerable Select (object container, string xPath, IXmlNamespaceResolver resolver)
{
- if (xpath == null || xpath.Length == 0)
- throw new ArgumentNullException ("xpath");
+ if (xPath == null || xPath.Length == 0)
+ throw new ArgumentNullException ("xPath");
IXPathNavigable factory = container as IXPathNavigable;
if (factory == null)
throw new ArgumentException ("container");
- XPathNodeIterator itr = factory.CreateNavigator ().Select (xpath, resolver);
+ XPathNodeIterator itr = factory.CreateNavigator ().Select (xPath, resolver);
ArrayList ret = new ArrayList ();
while (itr.MoveNext ()) {
last_modified_from_file_dependencies = true;
}
- public void SetMaxAge (TimeSpan date)
+ public void SetMaxAge (TimeSpan delta)
{
- if (date < TimeSpan.Zero)
- throw new ArgumentOutOfRangeException ("date");
+ if (delta < TimeSpan.Zero)
+ throw new ArgumentOutOfRangeException ("delta");
- if (HaveMaxAge && MaxAge < date)
+ if (HaveMaxAge && MaxAge < delta)
return;
- MaxAge = date;
+ MaxAge = delta;
HaveMaxAge = true;
}
}
}
- public bool this [ string param ] {
+ public bool this [ string header ] {
get {
- if (param == null)
+ if (header == null)
throw new ArgumentNullException ();
- return parms.Contains (param);
+ return parms.Contains (header);
}
set {
- if (param == null)
+ if (header == null)
throw new ArgumentNullException ();
ignore_parms = false;
if (value)
- if (!parms.Contains (param))
- parms.Add (param, true);
+ if (!parms.Contains (header))
+ parms.Add (header, true);
else
- parms.Remove (param);
+ parms.Remove (header);
}
}
}
return GetLocalObjectFromFactory (virtualPath, resourceKey, culture);
}
- public object GetSection (string name)
+ public object GetSection (string sectionName)
{
- return WebConfigurationManager.GetSection (name);
+ return WebConfigurationManager.GetSection (sectionName);
}
object IServiceProvider.GetService (Type service)
return HttpContext.GetGlobalResourceObject (classKey, resourceKey, culture);
}
- public override object GetLocalResourceObject (string overridePath, string resourceKey)
+ public override object GetLocalResourceObject (string virtualPath, string resourceKey)
{
- return HttpContext.GetLocalResourceObject (overridePath, resourceKey);
+ return HttpContext.GetLocalResourceObject (virtualPath, resourceKey);
}
- public override object GetLocalResourceObject (string overridePath, string resourceKey, CultureInfo culture)
+ public override object GetLocalResourceObject (string virtualPath, string resourceKey, CultureInfo culture)
{
- return HttpContext.GetLocalResourceObject (overridePath, resourceKey, culture);
+ return HttpContext.GetLocalResourceObject (virtualPath, resourceKey, culture);
}
public override object GetSection (string sectionName)
BaseClear ();
}
- public void CopyTo (Array array, int index)
+ public void CopyTo (Array dest, int index)
{
/* XXX this is kind of gross and inefficient
* since it makes a copy of the superclass's
* list */
object[] values = BaseGetAllValues();
- values.CopyTo (array, index);
+ values.CopyTo (dest, index);
}
public string GetKey (int index)
return (HttpPostedFile)BaseGet (index);
}
- public HttpPostedFile Get (string key)
+ public HttpPostedFile Get (string name)
{
- return (HttpPostedFile)BaseGet (key);
+ return (HttpPostedFile)BaseGet (name);
}
- public HttpPostedFile this [string key] {
+ public HttpPostedFile this [string name] {
get {
- return Get (key);
+ return Get (name);
}
}
return (IHttpModule)BaseGet (index);
}
- public IHttpModule Get (string key)
+ public IHttpModule Get (string name)
{
- return (IHttpModule)BaseGet (key);
+ return (IHttpModule)BaseGet (name);
}
- public IHttpModule this [string key] {
+ public IHttpModule this [string name] {
get {
- return Get (key);
+ return Get (name);
}
}
}
[SecurityPermission (SecurityAction.Demand, SerializationFormatter = true)]
- public override void GetObjectData (SerializationInfo info, StreamingContext ctx)
+ public override void GetObjectData (SerializationInfo info, StreamingContext context)
{
- base.GetObjectData (info, ctx);
+ base.GetObjectData (info, context);
info.AddValue ("_virtualPath", virtualPath);
info.AddValue ("_parserErrors", errors);
info.AddValue ("_line", line);
w.AppendToLog (param);
}
- public override string ApplyAppPathModifier (string overridePath)
+ public override string ApplyAppPathModifier (string virtualPath)
{
- return w.ApplyAppPathModifier (overridePath);
+ return w.ApplyAppPathModifier (virtualPath);
}
public override void BinaryWrite (byte [] buffer)
buf.Add ((byte)ch);
}
- public static string UrlDecode (string s, Encoding e)
+ public static string UrlDecode (string str, Encoding e)
{
- if (null == s)
+ if (null == str)
return null;
- if (s.IndexOf ('%') == -1 && s.IndexOf ('+') == -1)
- return s;
+ if (str.IndexOf ('%') == -1 && str.IndexOf ('+') == -1)
+ return str;
if (e == null)
e = Encoding.UTF8;
- long len = s.Length;
+ long len = str.Length;
var bytes = new List <byte> ();
int xchar;
char ch;
for (int i = 0; i < len; i++) {
- ch = s [i];
- if (ch == '%' && i + 2 < len && s [i + 1] != '%') {
- if (s [i + 1] == 'u' && i + 5 < len) {
+ ch = str [i];
+ if (ch == '%' && i + 2 < len && str [i + 1] != '%') {
+ if (str [i + 1] == 'u' && i + 5 < len) {
// unicode hex sequence
- xchar = GetChar (s, i + 2, 4);
+ xchar = GetChar (str, i + 2, 4);
if (xchar != -1) {
WriteCharBytes (bytes, (char)xchar, e);
i += 5;
} else
WriteCharBytes (bytes, '%', e);
- } else if ((xchar = GetChar (s, i + 1, 2)) != -1) {
+ } else if ((xchar = GetChar (str, i + 1, 2)) != -1) {
WriteCharBytes (bytes, (char)xchar, e);
i += 2;
} else {
return UrlEncode(str, Encoding.UTF8);
}
- public static string UrlEncode (string s, Encoding Enc)
+ public static string UrlEncode (string str, Encoding e)
{
- if (s == null)
+ if (str == null)
return null;
- if (s == String.Empty)
+ if (str == String.Empty)
return String.Empty;
bool needEncode = false;
- int len = s.Length;
+ int len = str.Length;
for (int i = 0; i < len; i++) {
- char c = s [i];
+ char c = str [i];
if ((c < '0') || (c < 'A' && c > '9') || (c > 'Z' && c < 'a') || (c > 'z')) {
if (HttpEncoder.NotEncoded (c))
continue;
}
if (!needEncode)
- return s;
+ return str;
// avoided GetByteCount call
- byte [] bytes = new byte[Enc.GetMaxByteCount(s.Length)];
- int realLen = Enc.GetBytes (s, 0, s.Length, bytes, 0);
+ byte [] bytes = new byte[e.GetMaxByteCount(str.Length)];
+ int realLen = e.GetBytes (str, 0, str.Length, bytes, 0);
return Encoding.ASCII.GetString (UrlEncodeToBytes (bytes, 0, realLen));
}
return sb.ToString ();
}
- public static string UrlPathEncode (string s)
+ public static string UrlPathEncode (string str)
{
- return HttpEncoder.Current.UrlPathEncode (s);
+ return HttpEncoder.Current.UrlPathEncode (str);
}
public static NameValueCollection ParseQueryString (string query)
{
}
- public ParserErrorCollection (ParserError[] errors)
+ public ParserErrorCollection (ParserError[] value)
{
- InnerList.AddRange (errors);
+ InnerList.AddRange (value);
}
public ParserError this [int index]
set { InnerList[index] = value; }
}
- public int Add (ParserError error)
+ public int Add (ParserError value)
{
- return List.Add (error);
+ return List.Add (value);
}
- public void AddRange (ParserErrorCollection collection)
+ public void AddRange (ParserErrorCollection value)
{
- InnerList.AddRange (collection);
+ InnerList.AddRange (value);
}
- public void AddRange (ParserError[] errors)
+ public void AddRange (ParserError[] value)
{
- InnerList.AddRange (errors);
+ InnerList.AddRange (value);
}
- public bool Contains (ParserError error)
+ public bool Contains (ParserError value)
{
- return InnerList.Contains (error);
+ return InnerList.Contains (value);
}
- public void CopyTo (ParserError[] errors, int index)
+ public void CopyTo (ParserError[] array, int index)
{
- List.CopyTo (errors, index);
+ List.CopyTo (array, index);
}
- public int IndexOf (ParserError error)
+ public int IndexOf (ParserError value)
{
- return InnerList.IndexOf (error);
+ return InnerList.IndexOf (value);
}
- public void Insert (int index, ParserError error)
+ public void Insert (int index, ParserError value)
{
- InnerList.Insert (index, error);
+ InnerList.Insert (index, value);
}
- public void Remove (ParserError error)
+ public void Remove (ParserError value)
{
- InnerList.Remove (error);
+ InnerList.Remove (value);
}
}
}
return new SiteMapHierarchicalDataSourceView (this);
}
- public virtual bool IsAccessibleToUser (System.Web.HttpContext ctx)
+ public virtual bool IsAccessibleToUser (System.Web.HttpContext context)
{
- return provider.IsAccessibleToUser (ctx, this);
+ return provider.IsAccessibleToUser (context, this);
}
public override string ToString()
return node;
}
- public override bool Equals (object ob)
+ public override bool Equals (object obj)
{
- SiteMapNode node = ob as SiteMapNode;
+ SiteMapNode node = obj as SiteMapNode;
if (node == null) return false;
if (node.key != key ||
Add (value);
}
- public SiteMapNodeCollection (SiteMapNode[] values)
+ public SiteMapNodeCollection (SiteMapNode[] value)
{
- AddRangeInternal (values);
+ AddRangeInternal (value);
}
- public SiteMapNodeCollection (SiteMapNodeCollection values)
+ public SiteMapNodeCollection (SiteMapNodeCollection value)
{
- AddRangeInternal (values);
+ AddRangeInternal (value);
}
internal static SiteMapNodeCollection EmptyCollection {
remove { events.AddHandler (traceFinishedEvent, value); }
}
- public TraceContext (HttpContext Context)
+ public TraceContext (HttpContext context)
{
- _Context = Context;
+ _Context = context;
}
internal bool HaveTrace {
}
}
- public void Warn(string msg)
+ public void Warn(string message)
{
- Write (String.Empty, msg, null, true);
+ Write (String.Empty, message, null, true);
}
- public void Warn(string category, string msg)
+ public void Warn(string category, string message)
{
- Write (category, msg, null, true);
+ Write (category, message, null, true);
}
- public void Warn (string category, string msg, Exception error)
+ public void Warn (string category, string message, Exception errorInfo)
{
- Write (category, msg, error, true);
+ Write (category, message, errorInfo, true);
}
- public void Write (string msg)
+ public void Write (string message)
{
- Write (String.Empty, msg, null, false);
+ Write (String.Empty, message, null, false);
}
- public void Write (string category, string msg)
+ public void Write (string category, string message)
{
- Write (category, msg, null, false);
+ Write (category, message, null, false);
}
- public void Write (string category, string msg, Exception error)
+ public void Write (string category, string message, Exception errorInfo)
{
- Write (category, msg, error, false);
+ Write (category, message, errorInfo, false);
}
void Write (string category, string msg, Exception error, bool Warning)
-//
+//
// Authors:
// Jonathan Pobst (monkey@jpobst.com)
// Francis Fisher (frankie@terrorise.me.uk)
}
}
[MonoTODO]
- public string this[string propName] {
+ public string this[string name] {
get {
throw new NotImplementedException ();
}
if (parts.Length == 1)
throw new ArgumentException ("value");
+ string filename = parts [0];
+ if (Path.DirectorySeparatorChar == '/')
+ filename = filename.Replace ("\\", "/");
+
Type type = Type.GetType (parts [1]);
if (type == typeof(string)) {
Encoding encoding;
encoding = Encoding.Default;
}
- using (TextReader reader = new StreamReader(parts [0], encoding)) {
+ using (TextReader reader = new StreamReader(filename, encoding)) {
return reader.ReadToEnd();
}
}
- string filename = parts [0];
- if (Path.DirectorySeparatorChar == '/')
- filename = filename.Replace ("\\", "/");
-
using (FileStream file = new FileStream (filename, FileMode.Open, FileAccess.Read, FileShare.Read)) {
buffer = new byte [file.Length];
file.Read(buffer, 0, (int) file.Length);
}
#endif
- public override bool Equals (object other)
+ public override bool Equals (object obj)
{
- var cwa = other as ContentWrapperAttribute;
+ var cwa = obj as ContentWrapperAttribute;
if (cwa == null)
return false;
return ContentWrapper != null ? ContentWrapper == cwa.ContentWrapper : cwa.ContentWrapper == null;
static readonly char [] comma_or_parens = new char [] {',', '(', ')'};
- public static bool TryParseList (string typeNameList, IXamlNamespaceResolver namespaceResolver, out IList<XamlTypeName> list)
+ public static bool TryParseList (string typeNameList, IXamlNamespaceResolver namespaceResolver, out IList<XamlTypeName> result)
{
if (typeNameList == null)
throw new ArgumentNullException ("typeNameList");
if (namespaceResolver == null)
throw new ArgumentNullException ("namespaceResolver");
- list = null;
+ result = null;
int idx = 0;
int parens = 0;
XamlTypeName tn;
ret.Add (tn);
}
- list = ret;
+ result = ret;
return true;
}
public XamlType TargetType { get; private set; }
- public static bool operator == (XamlValueConverter<TConverterBase> left, XamlValueConverter<TConverterBase> right)
+ public static bool operator == (XamlValueConverter<TConverterBase> converter1, XamlValueConverter<TConverterBase> converter2)
{
- return IsNull (left) ? IsNull (right) : left.Equals (right);
+ return IsNull (converter1) ? IsNull (converter2) : converter1.Equals (converter2);
}
static bool IsNull (XamlValueConverter<TConverterBase> a)
return Object.ReferenceEquals (a, null);
}
- public static bool operator != (XamlValueConverter<TConverterBase> left, XamlValueConverter<TConverterBase> right)
+ public static bool operator != (XamlValueConverter<TConverterBase> converter1, XamlValueConverter<TConverterBase> converter2)
{
- return IsNull (left) ? !IsNull (right) : IsNull (right) || left.ConverterType != right.ConverterType || left.TargetType != right.TargetType || left.Name != right.Name;
+ return IsNull (converter1) ? !IsNull (converter2) : IsNull (converter2) || converter1.ConverterType != converter2.ConverterType || converter1.TargetType != converter2.TargetType || converter1.Name != converter2.Name;
}
public bool Equals (XamlValueConverter<TConverterBase> other)
get { return LookupValueSerializer (); }
}
- public static bool operator == (XamlMember left, XamlMember right)
+ public static bool operator == (XamlMember xamlMember1, XamlMember xamlMember2)
{
- return IsNull (left) ? IsNull (right) : left.Equals (right);
+ return IsNull (xamlMember1) ? IsNull (xamlMember2) : xamlMember1.Equals (xamlMember2);
}
static bool IsNull (XamlMember a)
return Object.ReferenceEquals (a, null);
}
- public static bool operator != (XamlMember left, XamlMember right)
+ public static bool operator != (XamlMember xamlMember1, XamlMember xamlMember2)
{
- return !(left == right);
+ return !(xamlMember1 == xamlMember2);
}
- public override bool Equals (object other)
+ public override bool Equals (object obj)
{
- var x = other as XamlMember;
+ var x = obj as XamlMember;
return Equals (x);
}
Save (xw, instance);
}
- public static void Save (TextWriter textWriter, object instance)
+ public static void Save (TextWriter writer, object instance)
{
- using (var xw = XmlWriter.Create (textWriter, new XmlWriterSettings () { OmitXmlDeclaration = true, Indent = true }))
+ using (var xw = XmlWriter.Create (writer, new XmlWriterSettings () { OmitXmlDeclaration = true, Indent = true }))
Save (xw, instance);
}
- public static void Save (XmlWriter xmlWriter, object instance)
+ public static void Save (XmlWriter writer, object instance)
{
- Save (new XamlXmlWriter (xmlWriter, new XamlSchemaContext ()), instance);
+ Save (new XamlXmlWriter (writer, new XamlSchemaContext ()), instance);
}
- public static void Save (XamlWriter xamlWriter, object instance)
+ public static void Save (XamlWriter writer, object instance)
{
- if (xamlWriter == null)
- throw new ArgumentNullException ("xamlWriter");
- var r = new XamlObjectReader (instance, xamlWriter.SchemaContext);
- Transform (r, xamlWriter);
+ if (writer == null)
+ throw new ArgumentNullException ("writer");
+ var r = new XamlObjectReader (instance, writer.SchemaContext);
+ Transform (r, writer);
}
public static void Transform (XamlReader xamlReader, XamlWriter xamlWriter)
return stn != null ? stn.Name : Name;
}
- public static bool operator == (XamlType left, XamlType right)
+ public static bool operator == (XamlType xamlType1, XamlType xamlType2)
{
- return IsNull (left) ? IsNull (right) : left.Equals (right);
+ return IsNull (xamlType1) ? IsNull (xamlType2) : xamlType1.Equals (xamlType2);
}
static bool IsNull (XamlType a)
return Object.ReferenceEquals (a, null);
}
- public static bool operator != (XamlType left, XamlType right)
+ public static bool operator != (XamlType xamlType1, XamlType xamlType2)
{
- return !(left == right);
+ return !(xamlType1 == xamlType2);
}
public bool Equals (XamlType other)
intl.WriteNamespace (namespaceDeclaration);
}
- public override void WriteStartObject (XamlType xamlType)
+ public override void WriteStartObject (XamlType type)
{
- intl.WriteStartObject (xamlType);
+ intl.WriteStartObject (type);
}
public override void WriteValue (object value)
return new ConfigXmlCDataSection (this, data);
}
- public override XmlComment CreateComment (string comment)
+ public override XmlComment CreateComment (string data)
{
- return new ConfigXmlComment (this, comment);
+ return new ConfigXmlComment (this, data);
}
public override XmlElement CreateElement (string prefix, string localName, string namespaceUri)
get { return properties; }
}
- public override bool Equals (object o)
+ public override bool Equals (object settings)
{
- SettingElement e = o as SettingElement;
+ SettingElement e = settings as SettingElement;
if (e == null)
return false;
{
SpecialSetting setting;
- public SpecialSettingAttribute (SpecialSetting setting)
+ public SpecialSettingAttribute (SpecialSetting specialSetting)
{
- this.setting = setting;
+ this.setting = specialSetting;
}
public SpecialSetting SpecialSetting {
return CounterSampleCalculator.ComputeCounterValue (counterSample, nextCounterSample);
}
- public override bool Equals (object obj)
+ public override bool Equals (object o)
{
- if (!(obj is CounterSample))
+ if (!(o is CounterSample))
return false;
- return Equals ((CounterSample) obj);
+ return Equals ((CounterSample) o);
}
- public bool Equals (CounterSample other)
+ public bool Equals (CounterSample sample)
{
return
- rawValue == other.rawValue &&
- baseValue == other.counterFrequency &&
- counterFrequency == other.counterFrequency &&
- systemFrequency == other.systemFrequency &&
- timeStamp == other.timeStamp &&
- timeStamp100nSec == other.timeStamp100nSec &&
- counterTimeStamp == other.counterTimeStamp &&
- counterType == other.counterType;
+ rawValue == sample.rawValue &&
+ baseValue == sample.counterFrequency &&
+ counterFrequency == sample.counterFrequency &&
+ systemFrequency == sample.systemFrequency &&
+ timeStamp == sample.timeStamp &&
+ timeStamp100nSec == sample.timeStamp100nSec &&
+ counterTimeStamp == sample.counterTimeStamp &&
+ counterType == sample.counterType;
}
- public static bool operator == (CounterSample obj1, CounterSample obj2)
+ public static bool operator == (CounterSample a, CounterSample b)
{
- return obj1.Equals (obj2);
+ return a.Equals (b);
}
- public static bool operator != (CounterSample obj1, CounterSample obj2)
+ public static bool operator != (CounterSample a, CounterSample b)
{
- return !obj1.Equals (obj2);
+ return !a.Equals (b);
}
public override int GetHashCode ()
get { return this; }
}
- public void CopyTo (EventLogEntry[] eventLogEntries, int index)
+ public void CopyTo (EventLogEntry[] entries, int index)
{
- EventLogEntry[] entries = _impl.GetEntries ();
- Array.Copy (entries, 0, eventLogEntries, index, entries.Length);
+ EventLogEntry[] evLogEntries = _impl.GetEntries ();
+ Array.Copy (evLogEntries, 0, entries, index, evLogEntries.Length);
}
public IEnumerator GetEnumerator ()
[ComVisible (false)]
public override void TraceData (TraceEventCache eventCache,
- string source, TraceEventType eventType,
+ string source, TraceEventType severity,
int id, object data)
{
EventLogEntryType type;
- switch (eventType) {
+ switch (severity) {
case TraceEventType.Critical:
case TraceEventType.Error:
type = EventLogEntryType.Error;
[ComVisible (false)]
public override void TraceData (TraceEventCache eventCache,
- string source, TraceEventType eventType,
+ string source, TraceEventType severity,
int id, params object [] data)
{
string s = String.Empty;
arr [i] = data [i] != null ? data [i].ToString () : String.Empty;
s = String.Join (", ", arr);
}
- TraceData (eventCache, source, eventType, id, s);
+ TraceData (eventCache, source, severity, id, s);
}
[ComVisible (false)]
public override void TraceEvent (TraceEventCache eventCache,
- string source, TraceEventType eventType,
+ string source, TraceEventType severity,
int id, string message)
{
- TraceData (eventCache, source, eventType, id, message);
+ TraceData (eventCache, source, severity, id, message);
}
[ComVisible (false)]
public override void TraceEvent (TraceEventCache eventCache,
- string source, TraceEventType eventType,
+ string source, TraceEventType severity,
int id, string format, params object [] args)
{
- TraceEvent (eventCache, source, eventType, id, format != null ? String.Format (format, args) : null);
+ TraceEvent (eventCache, source, severity, id, format != null ? String.Format (format, args) : null);
}
}
}
}
[Obsolete ("Process.Start is not supported on the current platform.", true)]
- public static Process Start(string fileName, string username, SecureString password, string domain)
+ public static Process Start(string fileName, string userName, SecureString password, string domain)
{
throw new PlatformNotSupportedException ("Process.Start is not supported on the current platform.");
}
[Obsolete ("Process.Start is not supported on the current platform.", true)]
- public static Process Start(string fileName, string arguments, string username, SecureString password, string domain)
+ public static Process Start(string fileName, string arguments, string userName, SecureString password, string domain)
{
throw new PlatformNotSupportedException ("Process.Start is not supported on the current platform.");
}
}
}
- public override IAsyncResult BeginRead (byte [] buffer, int offset, int count,
- AsyncCallback cback, object state)
+ public override IAsyncResult BeginRead (byte [] array, int offset, int count,
+ AsyncCallback asyncCallback, object asyncState)
{
if (disposed)
throw new ObjectDisposedException (GetType ().FullName);
if (!CanRead)
throw new NotSupportedException ("This stream does not support reading");
- if (buffer == null)
- throw new ArgumentNullException ("buffer");
+ if (array == null)
+ throw new ArgumentNullException ("array");
if (count < 0)
throw new ArgumentOutOfRangeException ("count", "Must be >= 0");
if (offset < 0)
throw new ArgumentOutOfRangeException ("offset", "Must be >= 0");
- if (count + offset > buffer.Length)
+ if (count + offset > array.Length)
throw new ArgumentException ("Buffer too small. count/offset wrong.");
ReadMethod r = new ReadMethod (ReadInternal);
- return r.BeginInvoke (buffer, offset, count, cback, state);
+ return r.BeginInvoke (array, offset, count, asyncCallback, asyncState);
}
- public override IAsyncResult BeginWrite (byte [] buffer, int offset, int count,
- AsyncCallback cback, object state)
+ public override IAsyncResult BeginWrite (byte [] array, int offset, int count,
+ AsyncCallback asyncCallback, object asyncState)
{
if (disposed)
throw new ObjectDisposedException (GetType ().FullName);
if (!CanWrite)
throw new InvalidOperationException ("This stream does not support writing");
- if (buffer == null)
- throw new ArgumentNullException ("buffer");
+ if (array == null)
+ throw new ArgumentNullException ("array");
if (count < 0)
throw new ArgumentOutOfRangeException ("count", "Must be >= 0");
if (offset < 0)
throw new ArgumentOutOfRangeException ("offset", "Must be >= 0");
- if (count + offset > buffer.Length)
+ if (count + offset > array.Length)
throw new ArgumentException ("Buffer too small. count/offset wrong.");
WriteMethod w = new WriteMethod (WriteInternal);
- return w.BeginInvoke (buffer, offset, count, cback, state);
+ return w.BeginInvoke (array, offset, count, asyncCallback, asyncState);
}
- public override int EndRead(IAsyncResult async_result)
+ public override int EndRead(IAsyncResult asyncResult)
{
- if (async_result == null)
- throw new ArgumentNullException ("async_result");
+ if (asyncResult == null)
+ throw new ArgumentNullException ("asyncResult");
- AsyncResult ares = async_result as AsyncResult;
+ AsyncResult ares = asyncResult as AsyncResult;
if (ares == null)
- throw new ArgumentException ("Invalid IAsyncResult", "async_result");
+ throw new ArgumentException ("Invalid IAsyncResult", "asyncResult");
ReadMethod r = ares.AsyncDelegate as ReadMethod;
if (r == null)
- throw new ArgumentException ("Invalid IAsyncResult", "async_result");
+ throw new ArgumentException ("Invalid IAsyncResult", "asyncResult");
- return r.EndInvoke (async_result);
+ return r.EndInvoke (asyncResult);
}
- public override void EndWrite (IAsyncResult async_result)
+ public override void EndWrite (IAsyncResult asyncResult)
{
- if (async_result == null)
- throw new ArgumentNullException ("async_result");
+ if (asyncResult == null)
+ throw new ArgumentNullException ("asyncResult");
- AsyncResult ares = async_result as AsyncResult;
+ AsyncResult ares = asyncResult as AsyncResult;
if (ares == null)
- throw new ArgumentException ("Invalid IAsyncResult", "async_result");
+ throw new ArgumentException ("Invalid IAsyncResult", "asyncResult");
WriteMethod w = ares.AsyncDelegate as WriteMethod;
if (w == null)
- throw new ArgumentException ("Invalid IAsyncResult", "async_result");
+ throw new ArgumentException ("Invalid IAsyncResult", "asyncResult");
- w.EndInvoke (async_result);
+ w.EndInvoke (asyncResult);
return;
}
return encoding.GetString (seen.ToArray ());
}
- public void Write (string str)
+ public void Write (string text)
{
CheckOpen ();
- if (str == null)
- throw new ArgumentNullException ("str");
+ if (text == null)
+ throw new ArgumentNullException ("text");
- byte [] buffer = encoding.GetBytes (str);
+ byte [] buffer = encoding.GetBytes (text);
Write (buffer, 0, buffer.Length);
}
stream.Write (bytes, 0, bytes.Length);
}
- public void WriteLine (string str)
+ public void WriteLine (string text)
{
- Write (str + new_line);
+ Write (text + new_line);
}
void CheckOpen ()
return av;
}
- public static AlternateView CreateAlternateViewFromString (string content, Encoding encoding, string mediaType)
+ public static AlternateView CreateAlternateViewFromString (string content, Encoding contentEncoding, string mediaType)
{
if (content == null)
throw new ArgumentNullException ("content");
- if (encoding == null)
- encoding = Encoding.UTF8;
- MemoryStream ms = new MemoryStream (encoding.GetBytes (content));
+ if (contentEncoding == null)
+ contentEncoding = Encoding.UTF8;
+ MemoryStream ms = new MemoryStream (contentEncoding.GetBytes (content));
ContentType ct = new ContentType ();
ct.MediaType = mediaType;
- ct.CharSet = encoding.HeaderName;
+ ct.CharSet = contentEncoding.HeaderName;
AlternateView av = new AlternateView (ms, ct);
av.TransferEncoding = TransferEncoding.QuotedPrintable;
return av;
#region Methods
- public override bool Equals (object obj)
+ public override bool Equals (object value)
{
- if (obj == null)
+ if (value == null)
return false;
- return (0 == String.Compare (ToString (), obj.ToString (), StringComparison.OrdinalIgnoreCase));
+ return (0 == String.Compare (ToString (), value.ToString (), StringComparison.OrdinalIgnoreCase));
}
public override int GetHashCode ()
}
}
- public void Send (string from, string to, string subject, string body)
+ public void Send (string from, string recipients, string subject, string body)
{
- Send (new MailMessage (from, to, subject, body));
+ Send (new MailMessage (from, recipients, subject, body));
}
public Task SendMailAsync (MailMessage message)
worker.RunWorkerAsync (userToken);
}
- public void SendAsync (string from, string to, string subject, string body, object userToken)
+ public void SendAsync (string from, string recipients, string subject, string body, object userToken)
{
- SendAsync (new MailMessage (from, to, subject, body), userToken);
+ SendAsync (new MailMessage (from, recipients, subject, body), userToken);
}
public void SendAsyncCancel ()
{
}
- protected SmtpException (SerializationInfo info, StreamingContext context)
- : base (info, context)
+ protected SmtpException (SerializationInfo serializationInfo, StreamingContext streamingContext)
+ : base (serializationInfo, streamingContext)
{
try {
- statusCode = (SmtpStatusCode) info.GetValue ("Status", typeof (int));
+ statusCode = (SmtpStatusCode) serializationInfo.GetValue ("Status", typeof (int));
} catch (SerializationException) {
//For compliance with previously serialized version:
- statusCode = (SmtpStatusCode) info.GetValue ("statusCode", typeof (SmtpStatusCode));
+ statusCode = (SmtpStatusCode) serializationInfo.GetValue ("statusCode", typeof (SmtpStatusCode));
}
}
#endregion // Properties
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
+ public override void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)
{
- if (info == null)
- throw new ArgumentNullException ("info");
- base.GetObjectData (info, context);
- info.AddValue ("Status", statusCode, typeof (int));
+ if (serializationInfo == null)
+ throw new ArgumentNullException ("serializationInfo");
+ base.GetObjectData (serializationInfo, streamingContext);
+ serializationInfo.AddValue ("Status", statusCode, typeof (int));
}
void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)
{
{
}
- protected SmtpFailedRecipientException (SerializationInfo serializationInfo, StreamingContext streamingContext)
- : base (serializationInfo, streamingContext)
+ protected SmtpFailedRecipientException (SerializationInfo info, StreamingContext context)
+ : base (info, context)
{
- if (serializationInfo == null)
- throw new ArgumentNullException ("serializationInfo");
- failedRecipient = serializationInfo.GetString ("failedRecipient");
+ if (info == null)
+ throw new ArgumentNullException ("info");
+ failedRecipient = info.GetString ("failedRecipient");
}
public SmtpFailedRecipientException (SmtpStatusCode statusCode, string failedRecipient) : base (statusCode)
#region Methods
- public override void GetObjectData (SerializationInfo info, StreamingContext context)
+ public override void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)
{
- if (info == null)
- throw new ArgumentNullException ("info");
- base.GetObjectData (info, context);
- info.AddValue ("innerExceptions", innerExceptions);
+ if (serializationInfo == null)
+ throw new ArgumentNullException ("serializationInfo");
+ base.GetObjectData (serializationInfo, streamingContext);
+ serializationInfo.AddValue ("innerExceptions", innerExceptions);
}
void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)
sockares.Complete (acc_socket, total);
});
- public Socket EndAccept (IAsyncResult result)
+ public Socket EndAccept (IAsyncResult asyncResult)
{
int bytes;
byte[] buffer;
- return EndAccept (out buffer, out bytes, result);
+ return EndAccept (out buffer, out bytes, asyncResult);
}
public Socket EndAccept (out byte[] buffer, out int bytesTransferred, IAsyncResult asyncResult)
}
});
- public IAsyncResult BeginConnect (string host, int port, AsyncCallback callback, object state)
+ public IAsyncResult BeginConnect (string host, int port, AsyncCallback requestCallback, object state)
{
ThrowIfDisposedAndClosed ();
if (is_listening)
throw new InvalidOperationException ();
- return BeginConnect (Dns.GetHostAddresses (host), port, callback, state);
+ return BeginConnect (Dns.GetHostAddresses (host), port, requestCallback, state);
}
- public IAsyncResult BeginConnect (EndPoint end_point, AsyncCallback callback, object state)
+ public IAsyncResult BeginConnect (EndPoint remoteEP, AsyncCallback callback, object state)
{
ThrowIfDisposedAndClosed ();
- if (end_point == null)
- throw new ArgumentNullException ("end_point");
+ if (remoteEP == null)
+ throw new ArgumentNullException ("remoteEP");
if (is_listening)
throw new InvalidOperationException ();
SocketAsyncResult sockares = new SocketAsyncResult (this, callback, state, SocketOperation.Connect) {
- EndPoint = end_point,
+ EndPoint = remoteEP,
};
// Bug #75154: Connect() should not succeed for .Any addresses.
- if (end_point is IPEndPoint) {
- IPEndPoint ep = (IPEndPoint) end_point;
+ if (remoteEP is IPEndPoint) {
+ IPEndPoint ep = (IPEndPoint) remoteEP;
if (ep.Address.Equals (IPAddress.Any) || ep.Address.Equals (IPAddress.IPv6Any)) {
sockares.Complete (new SocketException ((int) SocketError.AddressNotAvailable), true);
return sockares;
}
- end_point = RemapIPEndPoint (ep);
+ remoteEP = RemapIPEndPoint (ep);
}
int error = 0;
bool blk = is_blocking;
if (blk)
Blocking = false;
- Connect_internal (m_Handle, end_point.Serialize (), out error, false);
+ Connect_internal (m_Handle, remoteEP.Serialize (), out error, false);
if (blk)
Blocking = true;
return sockares;
}
- public IAsyncResult BeginConnect (IPAddress[] addresses, int port, AsyncCallback callback, object state)
+ public IAsyncResult BeginConnect (IPAddress[] addresses, int port, AsyncCallback requestCallback, object state)
{
ThrowIfDisposedAndClosed ();
if (is_listening)
throw new InvalidOperationException ();
- SocketAsyncResult sockares = new SocketAsyncResult (this, callback, state, SocketOperation.Connect) {
+ SocketAsyncResult sockares = new SocketAsyncResult (this, requestCallback, state, SocketOperation.Connect) {
Addresses = addresses,
Port = port,
};
}
});
- public void EndConnect (IAsyncResult result)
+ public void EndConnect (IAsyncResult asyncResult)
{
ThrowIfDisposedAndClosed ();
- SocketAsyncResult sockares = ValidateEndIAsyncResult (result, "EndConnect", "result");
+ SocketAsyncResult sockares = ValidateEndIAsyncResult (asyncResult, "EndConnect", "asyncResult");
if (!sockares.IsCompleted)
sockares.AsyncWaitHandle.WaitOne();
}
});
- public IAsyncResult BeginReceiveFrom (byte[] buffer, int offset, int size, SocketFlags socket_flags, ref EndPoint remote_end, AsyncCallback callback, object state)
+ public IAsyncResult BeginReceiveFrom (byte[] buffer, int offset, int size, SocketFlags socketFlags, ref EndPoint remoteEP, AsyncCallback callback, object state)
{
ThrowIfDisposedAndClosed ();
ThrowIfBufferNull (buffer);
ThrowIfBufferOutOfRange (buffer, offset, size);
- if (remote_end == null)
- throw new ArgumentNullException ("remote_end");
+ if (remoteEP == null)
+ throw new ArgumentNullException ("remoteEP");
SocketAsyncResult sockares = new SocketAsyncResult (this, callback, state, SocketOperation.ReceiveFrom) {
Buffer = buffer,
Offset = offset,
Size = size,
- SockFlags = socket_flags,
- EndPoint = remote_end,
+ SockFlags = socketFlags,
+ EndPoint = remoteEP,
};
QueueIOSelectorJob (ReadSem, sockares.Handle, new IOSelectorJob (IOOperation.Read, BeginReceiveFromCallback, sockares));
sockares.Complete (total);
});
- public int EndReceiveFrom(IAsyncResult result, ref EndPoint end_point)
+ public int EndReceiveFrom(IAsyncResult asyncResult, ref EndPoint endPoint)
{
ThrowIfDisposedAndClosed ();
- if (end_point == null)
- throw new ArgumentNullException ("remote_end");
+ if (endPoint == null)
+ throw new ArgumentNullException ("endPoint");
- SocketAsyncResult sockares = ValidateEndIAsyncResult (result, "EndReceiveFrom", "result");
+ SocketAsyncResult sockares = ValidateEndIAsyncResult (asyncResult, "EndReceiveFrom", "asyncResult");
if (!sockares.IsCompleted)
sockares.AsyncWaitHandle.WaitOne();
sockares.CheckIfThrowDelayedException();
- end_point = sockares.EndPoint;
+ endPoint = sockares.EndPoint;
return sockares.Total;
}
}
});
- public IAsyncResult BeginSendTo(byte[] buffer, int offset, int size, SocketFlags socket_flags, EndPoint remote_end, AsyncCallback callback, object state)
+ public IAsyncResult BeginSendTo(byte[] buffer, int offset, int size, SocketFlags socketFlags, EndPoint remoteEP, AsyncCallback callback, object state)
{
ThrowIfDisposedAndClosed ();
ThrowIfBufferNull (buffer);
Buffer = buffer,
Offset = offset,
Size = size,
- SockFlags = socket_flags,
- EndPoint = remote_end,
+ SockFlags = socketFlags,
+ EndPoint = remoteEP,
};
QueueIOSelectorJob (WriteSem, sockares.Handle, new IOSelectorJob (IOOperation.Write, s => BeginSendToCallback ((SocketAsyncResult) s, 0), sockares));
sockares.Complete ();
}
- public int EndSendTo (IAsyncResult result)
+ public int EndSendTo (IAsyncResult asyncResult)
{
ThrowIfDisposedAndClosed ();
- SocketAsyncResult sockares = ValidateEndIAsyncResult (result, "EndSendTo", "result");
+ SocketAsyncResult sockares = ValidateEndIAsyncResult (asyncResult, "EndSendTo", "result");
if (!sockares.IsCompleted)
sockares.AsyncWaitHandle.WaitOne();
return result.Response;
}
- public Stream EndGetRequestStream (IAsyncResult asyncResult, out TransportContext transportContext)
+ public Stream EndGetRequestStream (IAsyncResult asyncResult, out TransportContext context)
{
- transportContext = null;
+ context = null;
return EndGetRequestStream (asyncResult);
}
_flags = StorePermissionFlags.NoFlags;
}
- public StorePermission (StorePermissionFlags flags)
+ public StorePermission (StorePermissionFlags flag)
{
// reuse validation by the Flags property
- Flags = flags;
+ Flags = flag;
}
return ((_flags & ~dp._flags) == 0);
}
- public override void FromXml (SecurityElement e)
+ public override void FromXml (SecurityElement securityElement)
{
// General validation in CodeAccessPermission
- PermissionHelper.CheckSecurityElement (e, "e", version, version);
+ PermissionHelper.CheckSecurityElement (securityElement, "securityElement", version, version);
// Note: we do not (yet) care about the return value
// as we only accept version 1 (min/max values)
- string s = e.Attribute ("Flags");
+ string s = securityElement.Attribute ("Flags");
if (s == null)
_flags = StorePermissionFlags.NoFlags;
else
Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2");
Assert.IsNull (ex.InnerException, "#3");
Assert.IsNotNull (ex.Message, "#4");
- Assert.AreEqual ("info", ex.ParamName, "#5");
+ Assert.AreEqual ("serializationInfo", ex.ParamName, "#5");
}
}
}
class MySmtpException : SmtpException {
- public MySmtpException (SerializationInfo info, StreamingContext context)
- : base (info, context)
+ public MySmtpException (SerializationInfo serializationInfo, StreamingContext streamingContext)
+ : base (serializationInfo, streamingContext)
{
}
}
namespace System.ComponentModel {
- public delegate void CurrentChangingEventHandler (object sender, CurrentChangingEventArgs args);
+ public delegate void CurrentChangingEventHandler (object sender, CurrentChangingEventArgs e);
}
public static partial class Environment {
/*
- * This is the version number of the corlib-runtime interface. When
- * making changes to this interface (by changing the layout
- * of classes the runtime knows about, changing icall signature or
- * semantics etc), increment this variable. Also increment the
- * pair of this variable in the runtime in metadata/appdomain.c.
- * Changes which are already detected at runtime, like the addition
- * of icalls, do not require an increment.
+ * This is the version number of the corlib-runtime interface.
+ * It is defined in configure.ac.
*/
#pragma warning disable 169
- private const int mono_corlib_version = 164;
+ private const int mono_corlib_version = Consts.MonoCorlibVersion;
#pragma warning restore 169
[ComVisible (true)]
return;
}
}
- if (index == 2) {
- if (zero) {
- offset = lens [0] + lens [1] + 2;
- length = format.Length - offset;
- return;
- }
- if (positive) {
- offset = 0;
- length = lens [0];
- return;
- }
- if (lens [1] > 0) {
- positive = true;
- offset = lens [0] + 1;
- length = lens [1];
+ if (zero) {
+ if (index == 2) {
+ if (format.Length - lastPos == 0) {
+ offset = 0;
+ length = lens [0];
+ } else {
+ offset = lens [0] + lens [1] + 2;
+ length = format.Length - offset;
+ }
return;
}
- else {
+
+ if (lens [2] == 0) {
offset = 0;
length = lens [0];
- return;
- }
- }
- if (index == 3) {
- if (zero) {
+ } else {
offset = lens [0] + lens [1] + 2;
length = lens [2];
- return;
- }
- if (positive) {
- offset = 0;
- length = lens [0];
- return;
- }
- if (lens [1] > 0) {
- positive = true;
- offset = lens [0] + 1;
- length = lens [1];
- return;
- }
- else {
- offset = 0;
- length = lens [0];
- return;
}
- }
- throw new ArgumentException ();
+ return;
+
+ }
+ if (positive) {
+ offset = 0;
+ length = lens [0];
+ return;
+ }
+ if (lens [1] > 0) {
+ positive = true;
+ offset = lens [0] + 1;
+ length = lens [1];
+ return;
+ }
+ offset = 0;
+ length = lens [0];
}
public static CustomInfo Parse (string format, int offset, int length, NumberFormatInfo nfi)
Array.CreateInstance (typeof (Int32), (long[])null);
}
+ [Test]
+ public void CreateInstanceVoid ()
+ {
+ Assert.Throws<NotSupportedException> (delegate () {
+ Array.CreateInstance (typeof (void), 1);
+ });
+ }
+
[Test]
public void TestGetEnumerator() {
String[] s1 = {"this", "is", "a", "test"};
int hundred = 100;
int neghund = -100;
- Assert.IsTrue ( hundred.ToString ("#;#") == "100", "#TS1");
- Assert.IsTrue ( hundred.ToString ("-#;#") == "-100", "#TS2");
- Assert.IsTrue ( neghund.ToString ("#;#") == "100", "#TS3");
- Assert.IsTrue ( neghund.ToString ("#;-#") == "-100", "#TS3");
+ Assert.AreEqual ("100", hundred.ToString ("#;#"), "#TS1");
+ Assert.AreEqual ("-100", hundred.ToString ("-#;#"), "#TS2");
+ Assert.AreEqual ("100", neghund.ToString ("#;#"), "#TS3");
+ Assert.AreEqual ("-100", neghund.ToString ("#;-#"), "#TS4");
+ Assert.AreEqual ("3", 0.ToString ("3;;"), "#TS5");
+ Assert.AreEqual ("3", 0.ToString ("3;2;"), "#TS6");
+ Assert.AreEqual ("3", 0.ToString ("3;"), "#TS7");
+ Assert.AreEqual ("3", 0.ToString ("3;;;;;;;"), "#TS8");
}
[Test]
object o = Array.CreateInstance (typeof (global::System.TypedReference), 1);
}
+ [Test]
+ public void MakeArrayTypeLargeRank ()
+ {
+ Assert.Throws<TypeLoadException> (delegate () {
+ typeof (int).MakeArrayType (33);
+ });
+ }
+
[ComVisible (true)]
public class ComFoo<T> {
}
using System.Diagnostics;
using System.Globalization;
- using System.Security.Permissions;
-
+
/// <devdoc>
/// <para>Specifies the editor to use to change a property. This class cannot be inherited.</para>
/// </devdoc>
using System.Collections;
using System.ComponentModel.Design;
using System.Diagnostics;
+#if MONO_FEATURE_CAS
using System.Security.Permissions;
+#endif
/// <devdoc>
/// <para>Provides
/// a type converter to convert expandable objects to and from various
/// other representations.</para>
/// </devdoc>
+#if MONO_FEATURE_CAS
[HostProtection(SharedState = true)]
+#endif
public class ExpandableObjectConverter : TypeConverter {
/// <devdoc>
using System.Diagnostics;
using System.Globalization;
using System.Runtime.Serialization;
+#if MONO_FEATURE_CAS
using System.Security.Permissions;
+#endif
/// <devdoc>
/// <para>The exception that is thrown when using invalid arguments that are enumerators.</para>
/// </devdoc>
+#if MONO_FEATURE_CAS
[HostProtection(SharedState = true)]
+#endif
[Serializable]
public class InvalidEnumArgumentException : ArgumentException {
using System.Collections;
using System.Diagnostics;
using System.Reflection;
+#if MONO_FEATURE_CAS
using System.Security.Permissions;
+#endif
/// <devdoc>
/// EventArgs for the ResolveNameEventHandler. This event is used
/// by the serialization process to match a name to an object
/// instance.
/// </devdoc>
- [HostProtection(SharedState = true)]
+#if MONO_FEATURE_CAS
+ [HostProtection(SharedState = true)]
[System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Name = "FullTrust")]
+#endif
public sealed class InstanceDescriptor {
private MemberInfo member;
private ICollection arguments;
if (ca.Count != 1)
break;
+ if (mapping == null)
+ mapping = new Dictionary<string, object> (StringComparer.Ordinal);
+
if (constructor.Parameters[0].ParameterType == constructor.Module.TypeSystem.Boolean) {
- if (mapping == null)
- mapping = new Dictionary<string, object> (StringComparer.Ordinal);
mapping.Add ("Bindable", ca[0].Value);
+ } else if (constructor.Parameters[0].ParameterType.FullName == "System.ComponentModel.BindableSupport") {
+ if ((int)ca[0].Value == 0)
+ mapping.Add ("Bindable", false);
+ else if ((int)ca[0].Value == 1)
+ mapping.Add ("Bindable", true);
+ else
+ throw new NotImplementedException ();
} else {
throw new NotImplementedException ();
}
LOCAL_MCS_FLAGS =
LIB_REFS = Mono.Cecil Mono.Cecil.Mdb
+NO_INSTALL = yes
+
include ../../build/executable.make
install-local: install-extras
endif
-PORTABLE_TARGETS_SRC=../../../external/buildtools/src/Portable/Targets
-PCL5_FX_SRC=../../../external/buildtools/src/Portable/Frameworks/v5.0
+PORTABLE_TARGETS_SRC:=data/Portable/Targets
+PCL5_FX_SRC:=data/Portable/Frameworks/v5.0
NETFRAMEWORK_DIR=$(mono_libdir)/mono/xbuild-frameworks/.NETFramework
PCL5_FX_DIR=$(mono_libdir)/mono/xbuild-frameworks/.NETPortable/v5.0
data/Microsoft.VisualBasic.targets \
data/MSBuild/Microsoft.Build.CommonTypes.xsd \
data/MSBuild/Microsoft.Build.Core.xsd \
+ data/Portable/Targets/Microsoft.Portable.Core.props \
+ data/Portable/Targets/Microsoft.Portable.Core.targets \
+ data/Portable/Targets/v4.0/Microsoft.Portable.Common.targets \
+ data/Portable/Targets/v4.0/Microsoft.Portable.CSharp.targets \
+ data/Portable/Targets/v4.0/Microsoft.Portable.VisualBasic.targets \
+ data/Portable/Targets/v4.5/Microsoft.Portable.Common.targets \
+ data/Portable/Targets/v4.5/Microsoft.Portable.CSharp.targets \
+ data/Portable/Targets/v4.5/Microsoft.Portable.VisualBasic.targets \
+ data/Portable/Targets/v4.6/Microsoft.Portable.Common.targets \
+ data/Portable/Targets/v4.6/Microsoft.Portable.CSharp.targets \
+ data/Portable/Targets/v4.6/Microsoft.Portable.VisualBasic.targets \
+ data/Portable/Targets/v5.0/Microsoft.Portable.Common.targets \
+ data/Portable/Targets/v5.0/Microsoft.Portable.CSharp.targets \
+ data/Portable/Targets/v5.0/Microsoft.Portable.VisualBasic.targets \
+ "data/Portable/Frameworks/v5.0/.NET Framework 4.6.xml" \
+ "data/Portable/Frameworks/v5.0/ASP.NET Core 1.0.xml" \
+ "data/Portable/Frameworks/v5.0/FrameworkList.xml" \
+ "data/Portable/Frameworks/v5.0/Windows Universal 10.0.xml" \
frameworks/net_2.0.xml \
frameworks/net_3.0.xml \
frameworks/net_3.5.xml \
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<Framework
+ Identifier=".NETFramework"
+ Profile="*"
+ MinimumVersion="4.6"
+ Family=".NETFramework"
+ MinimumVisualStudioVersion="14.0"
+ DisplayName=".NET Framework"
+ MinimumVersionDisplayName="4.6"
+ PlatformArchitectures="AnyCPU;x86;x64"
+ IsBuiltIn="true"
+ IsHidden="false">
+ <RetargetData
+ ProjectLanguage="CSharp">
+ <NuGet
+ Identifier="net46.app"
+ PortableTargetMoniker="net452">
+ <Package
+ Identifier="Microsoft.NETCore"
+ Version="5.0.0" />
+ <Package
+ Identifier="Microsoft.NETCore.Portable.Compatibility"
+ Version="1.0.0" />
+ </NuGet>
+ </RetargetData>
+ <RetargetData
+ ProjectLanguage="VisualBasic">
+ <NuGet
+ Identifier="net46.app"
+ PortableTargetMoniker="net452">
+ <Package
+ Identifier="Microsoft.NETCore"
+ Version="5.0.0" />
+ <Package
+ Identifier="Microsoft.NETCore.Portable.Compatibility"
+ Version="1.0.0" />
+ </NuGet>
+ </RetargetData>
+</Framework>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<Framework
+ Identifier="DNXCore"
+ Profile="*"
+ MinimumVersion="5.0"
+ Family="DNXCore"
+ MinimumVisualStudioVersion="14.0"
+ DisplayName="ASP.NET Core"
+ MinimumVersionDisplayName="1.0"
+ PlatformArchitectures="AnyCPU;x86;x64"
+ IsBuiltIn="true"
+ IsHidden="true">
+ <RetargetData
+ ProjectLanguage="CSharp">
+ <NuGet
+ Identifier="dnxcore50.app">
+ <Package
+ Identifier="Microsoft.NETCore"
+ Version="5.0.0" />
+ <Package
+ Identifier="Microsoft.NETCore.Portable.Compatibility"
+ Version="1.0.0" />
+ </NuGet>
+ </RetargetData>
+ <RetargetData
+ ProjectLanguage="VisualBasic">
+ <NuGet
+ Identifier="dnxcore50.app">
+ <Package
+ Identifier="Microsoft.NETCore"
+ Version="5.0.0" />
+ <Package
+ Identifier="Microsoft.NETCore.Portable.Compatibility"
+ Version="1.0.0" />
+ </NuGet>
+ </RetargetData>
+</Framework>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<FileList Redist="Microsoft-Windows-CLRCoreComp.PortableLibrary.5.0" Name=".NET Portable Subset (Visual Studio 2015)" RuntimeVersion="5.0">
+</FileList>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<Framework
+ Identifier=".NETCore"
+ Profile="*"
+ MinimumVersion="5.0"
+ Family="Windows"
+ MinimumVisualStudioVersion="14.0"
+ DisplayName="Windows Universal"
+ MinimumVersionDisplayName="10.0"
+ PlatformArchitectures="AnyCPU;x86;x64;ARM"
+ IsBuiltIn="true"
+ IsHidden="false">
+ <RetargetData
+ ProjectLanguage="CSharp">
+ <NuGet
+ Identifier="uwp.10.0.app"
+ PortableTargetMoniker="win81">
+ <Package
+ Identifier="Microsoft.NETCore"
+ Version="5.0.0" />
+ <Package
+ Identifier="Microsoft.NETCore.Portable.Compatibility"
+ Version="1.0.0" />
+ </NuGet>
+ </RetargetData>
+ <RetargetData
+ ProjectLanguage="VisualBasic">
+ <NuGet
+ Identifier="uwp.10.0.app"
+ PortableTargetMoniker="win81">
+ <Package
+ Identifier="Microsoft.NETCore"
+ Version="5.0.0" />
+ <Package
+ Identifier="Microsoft.NETCore.Portable.Compatibility"
+ Version="1.0.0" />
+ </NuGet>
+ </RetargetData>
+</Framework>
\ No newline at end of file
--- /dev/null
+<!--
+***********************************************************************************************
+Microsoft.Portable.Core.props
+
+Contains common properties that are shared by all portable library projects regardless of version.
+
+WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
+ created a backup copy. Incorrect changes to this file will make it
+ impossible to load or build your projects from the command-line or the IDE.
+
+***********************************************************************************************
+-->
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+ <Import Project="VisualStudio\v$(VisualStudioVersion)\Microsoft.Portable.CurrentVersion.props" Condition="Exists('VisualStudio\v$(VisualStudioVersion)\Microsoft.Portable.CurrentVersion.props')"/>
+
+ <PropertyGroup>
+ <TargetPlatformIdentifier>Portable</TargetPlatformIdentifier>
+ <TargetFrameworkIdentifier>.NETPortable</TargetFrameworkIdentifier>
+ <TargetFrameworkMonikerDisplayName>.NET Portable Subset</TargetFrameworkMonikerDisplayName>
+
+ <!-- Automatically reference all assemblies in the target framework -->
+ <ImplicitlyExpandTargetFramework Condition="'$(ImplicitlyExpandTargetFramework)' == '' AND '$(PortableNuGetMode)' != 'true'">true</ImplicitlyExpandTargetFramework>
+
+ </PropertyGroup>
+
+ <!-- Redefine AssemblySearchPaths to exclude {AssemblyFolders} and {GAC}, these represent .NET-specific locations -->
+ <PropertyGroup>
+ <AssemblySearchPaths Condition="'$(AssemblySearchPaths)' == ''">
+ {CandidateAssemblyFiles};
+ $(ReferencePath);
+ {HintPathFromItem};
+ {TargetFrameworkDirectory};
+ {Registry:$(FrameworkRegistryBase),$(TargetFrameworkVersion),$(AssemblyFoldersSuffix)$(AssemblyFoldersExConditions)};
+ {RawFileName};
+ $(OutDir)
+ </AssemblySearchPaths>
+ </PropertyGroup>
+
+</Project>
--- /dev/null
+<!--
+***********************************************************************************************
+Microsoft.Portable.Core.targets
+
+Contains common targets that are shared by all portable library projects regardless of version.
+
+WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
+ created a backup copy. Incorrect changes to this file will make it
+ impossible to load or build your projects from the command-line or the IDE.
+
+***********************************************************************************************
+-->
+
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+ <Import Project="VisualStudio\v$(VisualStudioVersion)\Microsoft.Portable.CurrentVersion.targets" Condition="Exists('VisualStudio\v$(VisualStudioVersion)\Microsoft.Portable.CurrentVersion.targets')"/>
+
+ <Target Name="_CheckForInvalidTargetFrameworkProfile"
+ AfterTargets="_CheckForInvalidConfigurationAndPlatform">
+
+ <Error Condition="'$(TargetFrameworkProfile)' == '' AND '$(PortableNuGetMode)' != 'true'" Text="The TargetFrameworkProfile property is not set for project '$(MSBuildProjectFile)'. Portable projects must specify a profile."/>
+
+ </Target>
+
+ <!--
+ To prevent framework assembly references from being unified to the ones in the full
+ framework (for example, System.Net.Primitives, v3.9.0.0 -> System.Net.Primitives, v4.0.0.0),
+ we set the full framework folder to the profile folder so that RAR thinks that the
+ profile itself is the full framework. Given that we don't actually use our full framework,
+ we do not need any of the warnings from RAR that are turned off because of this.
+ -->
+ <Target Name="_SetFullFrameworkFolderToProfile"
+ AfterTargets="GetReferenceAssemblyPaths">
+
+ <PropertyGroup>
+ <_FullFrameworkReferenceAssemblyPaths>$(TargetFrameworkDirectory)</_FullFrameworkReferenceAssemblyPaths>
+ </PropertyGroup>
+ </Target>
+
+ <PropertyGroup>
+ <ResolveReferencesDependsOn>
+ $(ResolveReferencesDependsOn);
+ ImplicitlyExpandTargetFramework;
+ </ResolveReferencesDependsOn>
+
+ <ImplicitlyExpandTargetFrameworkDependsOn>
+ $(ImplicitlyExpandTargetFrameworkDependsOn);
+ GetReferenceAssemblyPaths
+ </ImplicitlyExpandTargetFrameworkDependsOn>
+
+ </PropertyGroup>
+
+ <!--
+ The ImplicitlyExpandTargetFramework target will expand all
+ of the dll reference assemblies in the TargetFrameworkDirectory
+ for the project and place the items into the ReferencePath itemgroup
+ which contains resolved items.
+ -->
+
+ <Target Name="ImplicitlyExpandTargetFramework"
+ Condition="'$(ImplicitlyExpandTargetFramework)' == 'true'"
+ DependsOnTargets="$(ImplicitlyExpandTargetFrameworkDependsOn)"
+ >
+ <ItemGroup>
+ <ReferenceAssemblyPaths Include="$(_TargetFrameworkDirectories)"/>
+ <ReferencePath Include="%(ReferenceAssemblyPaths.Identity)*.dll">
+ <WinMDFile>false</WinMDFile>
+ <CopyLocal>false</CopyLocal>
+ <ReferenceGroupingDisplayName>.NET</ReferenceGroupingDisplayName>
+ <ReferenceGrouping>$(TargetFrameworkIdentifier),$(TargetFrameworkVersion)</ReferenceGrouping>
+ <ResolvedFrom>ImplicitlyExpandTargetFramework</ResolvedFrom>
+ <IsSystemReference>True</IsSystemReference>
+ </ReferencePath>
+ </ItemGroup>
+
+ <Message Importance="Low" Text="TargetMonikerDisplayName: $(TargetFrameworkMonikerDisplayName) ReferenceAssemblyPaths: @(ReferenceAssemblyPaths)"/>
+
+ <Message Importance="Low" Text="Including @(ReferencePath)"
+ Condition="'%(ReferencePath.ResolvedFrom)' == 'ImplicitlyExpandTargetFramework'"/>
+
+ <ItemGroup>
+ <_ResolveAssemblyReferenceResolvedFiles Include="@(ReferencePath)"
+ Condition="'%(ReferencePath.ResolvedFrom)' == 'ImplicitlyExpandTargetFramework'"/>
+ </ItemGroup>
+ </Target>
+
+</Project>
--- /dev/null
+<!--
+***********************************************************************************************
+Microsoft.Portable.CSharp.targets
+
+Contains common properties and targets that are shared by all v4.0 Portable Library C# projects.
+
+WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
+ created a backup copy. Incorrect changes to this file will make it
+ impossible to load or build your projects from the command-line or the IDE.
+
+***********************************************************************************************
+-->
+
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+ <Import Project="Microsoft.Portable.Common.targets" />
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <Import Project="..\Microsoft.Portable.Core.targets" />
+
+</Project>
--- /dev/null
+<!--
+***********************************************************************************************
+Microsoft.Portable.Common.targets
+
+Contains common properties that are shared by all v4.0 Portable Library projects.
+
+WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
+ created a backup copy. Incorrect changes to this file will make it
+ impossible to load or build your projects from the command-line or the IDE.
+
+***********************************************************************************************
+-->
+
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+ <Import Project="..\Microsoft.Portable.Core.props" />
+
+</Project>
--- /dev/null
+<!--
+***********************************************************************************************
+Microsoft.Portable.VisualBasic.targets
+
+Contains common properties and targets that are shared by all v4.0 Portable Library VB projects.
+
+WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
+ created a backup copy. Incorrect changes to this file will make it
+ impossible to load or build your projects from the command-line or the IDE.
+
+***********************************************************************************************
+-->
+
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+ <PropertyGroup>
+ <!-- Embed the runtime because it is not supported on every downlevel platform -->
+ <VBRuntime>Embed</VBRuntime>
+ <NoConfig>true</NoConfig>
+ <MyType>Empty</MyType>
+ </PropertyGroup>
+
+ <Import Project="Microsoft.Portable.Common.targets" />
+ <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
+ <Import Project="..\Microsoft.Portable.Core.targets" />
+
+</Project>
--- /dev/null
+<!--
+***********************************************************************************************
+Microsoft.Portable.CSharp.targets
+
+Contains common properties and targets that are shared by all v4.5 Portable Library C# projects.
+
+WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
+ created a backup copy. Incorrect changes to this file will make it
+ impossible to load or build your projects from the command-line or the IDE.
+
+***********************************************************************************************
+-->
+
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+ <Import Project="Microsoft.Portable.Common.targets" />
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <Import Project="..\Microsoft.Portable.Core.targets" />
+
+</Project>
--- /dev/null
+<!--
+***********************************************************************************************
+Microsoft.Portable.Common.targets
+
+Contains common properties that are shared by all v4.5 Portable Library projects.
+
+WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
+ created a backup copy. Incorrect changes to this file will make it
+ impossible to load or build your projects from the command-line or the IDE.
+
+***********************************************************************************************
+-->
+
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+ <Import Project="..\Microsoft.Portable.Core.props" />
+
+</Project>
--- /dev/null
+<!--
+***********************************************************************************************
+Microsoft.Portable.VisualBasic.targets
+
+Contains common properties and targets that are shared by all v4.5 Portable Library VB projects.
+
+WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
+ created a backup copy. Incorrect changes to this file will make it
+ impossible to load or build your projects from the command-line or the IDE.
+
+***********************************************************************************************
+-->
+
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+ <PropertyGroup>
+ <NoConfig>true</NoConfig>
+ <MyType>Empty</MyType>
+ </PropertyGroup>
+
+ <!-- Turns on VB runtime embedding if not already set and Microsoft.VisualBasic.dll does not exist in the target framework -->
+ <Target
+ Name="GetVBRuntime"
+ BeforeTargets="CoreCompile"
+ Condition="'$(VBRuntime)' == ''">
+
+ <ItemGroup>
+ <!-- Turn TargetFrameworkDirectory (which is a property with one or more directories) into an item -->
+ <_VBRuntimeSearchDirectories Include="$(TargetFrameworkDirectory)" />
+ </ItemGroup>
+
+ <PropertyGroup>
+ <_VBRuntimeFound Condition="Exists('%(_VBRuntimeSearchDirectories.Identity)Microsoft.VisualBasic.dll')">true</_VBRuntimeFound>
+ </PropertyGroup>
+
+ <PropertyGroup Condition="$(_VBRuntimeFound) != 'true'">
+ <VBRuntime>Embed</VBRuntime>
+ </PropertyGroup>
+ </Target>
+
+ <Import Project="Microsoft.Portable.Common.targets" />
+ <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
+ <Import Project="..\Microsoft.Portable.Core.targets" />
+
+</Project>
--- /dev/null
+<!--
+***********************************************************************************************
+Microsoft.Portable.CSharp.targets
+
+Contains common properties and targets that are shared by all v4.5 Portable Library C# projects.
+
+WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
+ created a backup copy. Incorrect changes to this file will make it
+ impossible to load or build your projects from the command-line or the IDE.
+
+***********************************************************************************************
+-->
+
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <PortableEnableXamlTargets>true</PortableEnableXamlTargets>
+ </PropertyGroup>
+
+ <Import Project="Microsoft.Portable.Common.targets" />
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <Import Project="..\Microsoft.Portable.Core.targets" />
+
+</Project>
--- /dev/null
+<!--
+***********************************************************************************************
+Microsoft.Portable.Common.targets
+
+Contains common properties that are shared by all v4.5 Portable Library projects.
+
+WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
+ created a backup copy. Incorrect changes to this file will make it
+ impossible to load or build your projects from the command-line or the IDE.
+
+***********************************************************************************************
+-->
+
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+ <Import Project="..\Microsoft.Portable.Core.props" />
+
+</Project>
--- /dev/null
+<!--
+***********************************************************************************************
+Microsoft.Portable.VisualBasic.targets
+
+Contains common properties and targets that are shared by all v4.5 Portable Library VB projects.
+
+WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
+ created a backup copy. Incorrect changes to this file will make it
+ impossible to load or build your projects from the command-line or the IDE.
+
+***********************************************************************************************
+-->
+
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+ <PropertyGroup>
+ <NoConfig>true</NoConfig>
+ <MyType>Empty</MyType>
+ </PropertyGroup>
+
+ <!-- Turns on VB runtime embedding if not already set and Microsoft.VisualBasic.dll does not exist in the target framework -->
+ <Target
+ Name="GetVBRuntime"
+ BeforeTargets="CoreCompile"
+ Condition="'$(VBRuntime)' == ''">
+
+ <ItemGroup>
+ <!-- Turn TargetFrameworkDirectory (which is a property with one or more directories) into an item -->
+ <_VBRuntimeSearchDirectories Include="$(TargetFrameworkDirectory)" />
+ </ItemGroup>
+
+ <PropertyGroup>
+ <_VBRuntimeFound Condition="Exists('%(_VBRuntimeSearchDirectories.Identity)Microsoft.VisualBasic.dll')">true</_VBRuntimeFound>
+ </PropertyGroup>
+
+ <PropertyGroup Condition="$(_VBRuntimeFound) != 'true'">
+ <VBRuntime>Embed</VBRuntime>
+ </PropertyGroup>
+ </Target>
+
+ <PropertyGroup>
+ <PortableEnableXamlTargets>true</PortableEnableXamlTargets>
+ </PropertyGroup>
+
+ <Import Project="Microsoft.Portable.Common.targets" />
+ <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
+ <Import Project="..\Microsoft.Portable.Core.targets" />
+
+</Project>
--- /dev/null
+<!--
+***********************************************************************************************
+Microsoft.Portable.CSharp.targets
+
+Contains common properties and targets that are shared by all v5.0 Portable Library C# projects.
+
+WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
+ created a backup copy. Incorrect changes to this file will make it
+ impossible to load or build your projects from the command-line or the IDE.
+
+***********************************************************************************************
+-->
+
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <PortableEnableXamlTargets>true</PortableEnableXamlTargets>
+ </PropertyGroup>
+
+ <Import Project="Microsoft.Portable.Common.targets" />
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <Import Project="..\Microsoft.Portable.Core.targets" />
+
+</Project>
--- /dev/null
+<!--
+***********************************************************************************************
+Microsoft.Portable.Common.targets
+
+Contains common properties that are shared by all v5.0 Portable Library projects.
+
+WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
+ created a backup copy. Incorrect changes to this file will make it
+ impossible to load or build your projects from the command-line or the IDE.
+
+***********************************************************************************************
+-->
+
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <PortableNuGetMode>true</PortableNuGetMode>
+ <NoStdLib>true</NoStdLib>
+ <!--The build requires this list of TFMs to determine what part of the lockfile to use.
+ When it's updated in the future to no longer require it, this list can be removed. -->
+ <NuGetTargetMoniker>.NETPlatform,Version=v5.0;.NETStandard,Version=v1.0;.NETStandard,Version=v1.1;.NETStandard,Version=v1.2;.NETStandard,Version=v1.3;.NETStandard,Version=v1.4;.NETStandard,Version=v1.5;.NETStandard,Version=v1.6</NuGetTargetMoniker>
+ </PropertyGroup>
+ <Import Project="..\Microsoft.Portable.Core.props" />
+
+</Project>
--- /dev/null
+<!--
+***********************************************************************************************
+Microsoft.Portable.VisualBasic.targets
+
+Contains common properties and targets that are shared by all v5.0 Portable Library VB projects.
+
+WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
+ created a backup copy. Incorrect changes to this file will make it
+ impossible to load or build your projects from the command-line or the IDE.
+
+***********************************************************************************************
+-->
+
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+ <PropertyGroup>
+ <NoConfig>true</NoConfig>
+ <MyType>Empty</MyType>
+ </PropertyGroup>
+
+ <!-- NuGet should add the VB Runtime -->
+
+ <PropertyGroup>
+ <PortableEnableXamlTargets>true</PortableEnableXamlTargets>
+ </PropertyGroup>
+
+ <Import Project="Microsoft.Portable.Common.targets" />
+ <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
+ <Import Project="..\Microsoft.Portable.Core.targets" />
+
+</Project>
#include <mono/metadata/class-internals.h>
#include <mono/metadata/object-internals.h>
#include <mono/metadata/loader.h>
-#include <mono/metadata/assembly.h>
+#include <mono/metadata/assembly-internals.h>
#include <mono/metadata/appdomain.h>
#include <mono/metadata/w32handle.h>
#include <mono/utils/bsearch.h>
static gboolean
-try_load_from (MonoAssembly **assembly, const gchar *path1, const gchar *path2,
- const gchar *path3, const gchar *path4, gboolean refonly)
+try_load_from (MonoAssembly **assembly,
+ const gchar *path1, const gchar *path2,
+ const gchar *path3, const gchar *path4, gboolean refonly,
+ MonoAssemblyCandidatePredicate predicate, gpointer user_data)
{
gchar *fullpath;
*assembly = NULL;
fullpath = g_build_filename (path1, path2, path3, path4, NULL);
if (g_file_test (fullpath, G_FILE_TEST_IS_REGULAR))
- *assembly = mono_assembly_open_full (fullpath, NULL, refonly);
+ *assembly = mono_assembly_open_predicate (fullpath, refonly, FALSE, predicate, user_data, NULL);
g_free (fullpath);
return (*assembly != NULL);
}
static MonoAssembly *
-real_load (gchar **search_path, const gchar *culture, const gchar *name, gboolean refonly)
+real_load (gchar **search_path, const gchar *culture, const gchar *name, gboolean refonly,
+ MonoAssemblyCandidatePredicate predicate, gpointer user_data)
{
MonoAssembly *result = NULL;
gchar **path;
/* See test cases in bug #58992 and bug #57710 */
/* 1st try: [culture]/[name].dll (culture may be empty) */
strcpy (filename + len - 4, ".dll");
- if (try_load_from (&result, *path, local_culture, "", filename, refonly))
+ if (try_load_from (&result, *path, local_culture, "", filename, refonly, predicate, user_data))
break;
/* 2nd try: [culture]/[name].exe (culture may be empty) */
strcpy (filename + len - 4, ".exe");
- if (try_load_from (&result, *path, local_culture, "", filename, refonly))
+ if (try_load_from (&result, *path, local_culture, "", filename, refonly, predicate, user_data))
break;
/* 3rd try: [culture]/[name]/[name].dll (culture may be empty) */
strcpy (filename + len - 4, ".dll");
- if (try_load_from (&result, *path, local_culture, name, filename, refonly))
+ if (try_load_from (&result, *path, local_culture, name, filename, refonly, predicate, user_data))
break;
/* 4th try: [culture]/[name]/[name].exe (culture may be empty) */
strcpy (filename + len - 4, ".exe");
- if (try_load_from (&result, *path, local_culture, name, filename, refonly))
+ if (try_load_from (&result, *path, local_culture, name, filename, refonly, predicate, user_data))
break;
}
gboolean refonly = GPOINTER_TO_UINT (user_data);
if (assemblies_path && assemblies_path [0] != NULL) {
- result = real_load (assemblies_path, aname->culture, aname->name, refonly);
+ result = real_load (assemblies_path, aname->culture, aname->name, refonly, NULL, NULL);
}
return result;
#include <mono/metadata/appdomain-icalls.h>
#include <mono/metadata/domain-internals.h>
#include "mono/metadata/metadata-internals.h"
-#include <mono/metadata/assembly.h>
#include <mono/metadata/assembly-internals.h>
#include <mono/metadata/exception.h>
#include <mono/metadata/exception-internals.h>
#include <direct.h>
#endif
-/*
- * This is the version number of the corlib-runtime interface. When
- * making changes to this interface (by changing the layout
- * of classes the runtime knows about, changing icall signature or
- * semantics etc), increment this variable. Also increment the
- * pair of this variable in mscorlib in:
- * mcs/class/corlib/System/Environment.cs
- *
- * Changes which are already detected at runtime, like the addition
- * of icalls, do not require an increment.
- */
-#define MONO_CORLIB_VERSION 164
-
typedef struct
{
int runtime_count;
if (!ht) {
ht = g_hash_table_new (mono_aligned_addr_hash, NULL);
destroy_ht = TRUE;
+ for (tmp = domain->domain_assemblies; tmp; tmp = tmp->next) {
+ g_hash_table_insert (ht, tmp->data, tmp->data);
+ }
}
/* FIXME: handle lazy loaded assemblies */
- for (tmp = domain->domain_assemblies; tmp; tmp = tmp->next) {
- g_hash_table_insert (ht, tmp->data, tmp->data);
- }
+
if (!g_hash_table_lookup (ht, ass)) {
mono_assembly_addref (ass);
g_hash_table_insert (ht, ass, ass);
}
if (ass->image->references) {
- for (i = 0; ass->image->references [i] != NULL; i++) {
- if (ass->image->references [i] != REFERENCE_MISSING)
+ for (i = 0; i < ass->image->nreferences; i++) {
+ if (ass->image->references[i] && ass->image->references [i] != REFERENCE_MISSING) {
if (!g_hash_table_lookup (ht, ass->image->references [i])) {
add_assemblies_to_domain (domain, ass->image->references [i], ht);
}
+ }
}
}
if (destroy_ht)
static gboolean
-try_load_from (MonoAssembly **assembly, const gchar *path1, const gchar *path2,
- const gchar *path3, const gchar *path4,
- gboolean refonly, gboolean is_private)
+try_load_from (MonoAssembly **assembly,
+ const gchar *path1, const gchar *path2,
+ const gchar *path3, const gchar *path4,
+ gboolean refonly, gboolean is_private,
+ MonoAssemblyCandidatePredicate predicate, gpointer user_data)
{
gchar *fullpath;
gboolean found = FALSE;
found = g_file_test (fullpath, G_FILE_TEST_IS_REGULAR);
if (found)
- *assembly = mono_assembly_open_full (fullpath, NULL, refonly);
+ *assembly = mono_assembly_open_predicate (fullpath, refonly, FALSE, predicate, user_data, NULL);
g_free (fullpath);
return (*assembly != NULL);
}
static MonoAssembly *
-real_load (gchar **search_path, const gchar *culture, const gchar *name, gboolean refonly)
+real_load (gchar **search_path, const gchar *culture, const gchar *name, gboolean refonly, MonoAssemblyCandidatePredicate predicate, gpointer user_data)
{
MonoAssembly *result = NULL;
gchar **path;
/* See test cases in bug #58992 and bug #57710 */
/* 1st try: [culture]/[name].dll (culture may be empty) */
strcpy (filename + len - 4, ".dll");
- if (try_load_from (&result, *path, local_culture, "", filename, refonly, is_private))
+ if (try_load_from (&result, *path, local_culture, "", filename, refonly, is_private, predicate, user_data))
break;
/* 2nd try: [culture]/[name].exe (culture may be empty) */
strcpy (filename + len - 4, ".exe");
- if (try_load_from (&result, *path, local_culture, "", filename, refonly, is_private))
+ if (try_load_from (&result, *path, local_culture, "", filename, refonly, is_private, predicate, user_data))
break;
/* 3rd try: [culture]/[name]/[name].dll (culture may be empty) */
strcpy (filename + len - 4, ".dll");
- if (try_load_from (&result, *path, local_culture, name, filename, refonly, is_private))
+ if (try_load_from (&result, *path, local_culture, name, filename, refonly, is_private, predicate, user_data))
break;
/* 4th try: [culture]/[name]/[name].exe (culture may be empty) */
strcpy (filename + len - 4, ".exe");
- if (try_load_from (&result, *path, local_culture, name, filename, refonly, is_private))
+ if (try_load_from (&result, *path, local_culture, name, filename, refonly, is_private, predicate, user_data))
break;
}
set_domain_search_path (domain);
if (domain->search_path && domain->search_path [0] != NULL) {
- result = real_load (domain->search_path, aname->culture, aname->name, refonly);
+ if (mono_trace_is_traced (G_LOG_LEVEL_DEBUG, MONO_TRACE_ASSEMBLY)) {
+ mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_ASSEMBLY, "Domain %s search path is:", domain->friendly_name);
+ for (int i = 0; domain->search_path [i]; i++) {
+ const char *p = domain->search_path[i];
+ mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_ASSEMBLY, "\tpath[%d] = '%s'", i, p);
+ }
+ mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_ASSEMBLY, "End of domain %s search path.", domain->friendly_name);
+ }
+ result = real_load (domain->search_path, aname->culture, aname->name, refonly, &mono_assembly_candidate_predicate_sn_same_name, aname);
}
if (result == NULL && assemblies_path && assemblies_path [0] != NULL) {
- result = real_load (assemblies_path, aname->culture, aname->name, refonly);
+ result = real_load (assemblies_path, aname->culture, aname->name, refonly, &mono_assembly_candidate_predicate_sn_same_name, aname);
}
return result;
if (!is_ok (error))
goto leave;
- MonoAssembly *ass = mono_assembly_open_a_lot (filename, &status, refOnly, TRUE);
+ MonoAssembly *ass = mono_assembly_open_predicate (filename, refOnly, TRUE, NULL, NULL, &status);
if (!ass) {
if (status == MONO_IMAGE_IMAGE_INVALID)
#ifndef __MONO_METADATA_ASSEMBLY_INTERNALS_H__
#define __MONO_METADATA_ASSEMBLY_INTERNALS_H__
+#include <glib.h>
+
#include <mono/metadata/assembly.h>
MONO_API MonoImage* mono_assembly_load_module_checked (MonoAssembly *assembly, uint32_t idx, MonoError *error);
MonoAssembly * mono_assembly_open_a_lot (const char *filename, MonoImageOpenStatus *status, gboolean refonly, gboolean load_from_context);
+/* If predicate returns true assembly should be loaded, if false ignore it. */
+typedef gboolean (*MonoAssemblyCandidatePredicate)(MonoAssembly *, gpointer);
+
+MonoAssembly* mono_assembly_open_predicate (const char *filename,
+ gboolean refonly,
+ gboolean load_from_context,
+ MonoAssemblyCandidatePredicate pred,
+ gpointer user_data,
+ MonoImageOpenStatus *status);
+
+MonoAssembly* mono_assembly_load_from_predicate (MonoImage *image, const char *fname,
+ gboolean refonly,
+ MonoAssemblyCandidatePredicate pred,
+ gpointer user_data,
+ MonoImageOpenStatus *status);
+
+/* MonoAssemblyCandidatePredicate that compares the assembly name (name, version,
+ * culture, public key token) of the candidate with the wanted name, if the
+ * wanted name has a public key token (if not present, always return true).
+ * Pass the wanted MonoAssemblyName* as the user_data.
+ */
+gboolean
+mono_assembly_candidate_predicate_sn_same_name (MonoAssembly *candidate, gpointer wanted_name);
+
#endif /* __MONO_METADATA_ASSEMBLY_INTERNALS_H__ */
}
static MonoAssembly *
-load_in_path (const char *basename, const char** search_path, MonoImageOpenStatus *status, MonoBoolean refonly)
+load_in_path (const char *basename, const char** search_path, MonoImageOpenStatus *status, MonoBoolean refonly, MonoAssemblyCandidatePredicate predicate, gpointer user_data)
{
int i;
char *fullpath;
for (i = 0; search_path [i]; ++i) {
fullpath = g_build_filename (search_path [i], basename, NULL);
- result = mono_assembly_open_full (fullpath, status, refonly);
+ result = mono_assembly_open_predicate (fullpath, refonly, FALSE, predicate, user_data, status);
g_free (fullpath);
if (result)
return result;
dest_aname->minor = vset->minor;
dest_aname->build = vset->build;
dest_aname->revision = vset->revision;
+ if (current_runtime->public_key_token != NULL &&
+ dest_aname->public_key_token [0] != 0 &&
+ !mono_public_tokens_are_equal (dest_aname->public_key_token, (const mono_byte *)current_runtime->public_key_token)) {
+ mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_ASSEMBLY,
+ "The request for assembly name '%s' with PublicKeyToken=%s was remapped to PublicKeyToken=%s",
+ dest_aname->name,
+ dest_aname->public_key_token,
+ current_runtime->public_key_token);
+ memcpy (dest_aname->public_key_token, current_runtime->public_key_token, MONO_PUBLIC_KEY_TOKEN_LENGTH);
+ }
if (vmap->new_assembly_name != NULL) {
dest_aname->name = vmap->new_assembly_name;
mono_trace (G_LOG_LEVEL_WARNING, MONO_TRACE_ASSEMBLY,
MonoAssembly *
mono_assembly_open_a_lot (const char *filename, MonoImageOpenStatus *status, gboolean refonly, gboolean load_from_context)
{
+ return mono_assembly_open_predicate (filename, refonly, load_from_context, NULL, NULL, status);
+}
+MonoAssembly *
+mono_assembly_open_predicate (const char *filename, gboolean refonly,
+ gboolean load_from_context,
+ MonoAssemblyCandidatePredicate predicate,
+ gpointer user_data,
+ MonoImageOpenStatus *status)
+{
MonoImage *image;
MonoAssembly *ass;
MonoImageOpenStatus def_status;
return image->assembly;
}
- ass = mono_assembly_load_from_full (image, fname, status, refonly);
+ ass = mono_assembly_load_from_predicate (image, fname, refonly, predicate, user_data, status);
if (ass) {
if (!loaded_from_bundle)
MonoAssembly *
mono_assembly_open (const char *filename, MonoImageOpenStatus *status)
{
- return mono_assembly_open_full (filename, status, FALSE);
+ return mono_assembly_open_predicate (filename, FALSE, FALSE, NULL, NULL, status);
}
/**
MonoAssembly *
mono_assembly_load_from_full (MonoImage *image, const char*fname,
MonoImageOpenStatus *status, gboolean refonly)
+{
+ return mono_assembly_load_from_predicate (image, fname, refonly, NULL, NULL, status);
+}
+
+MonoAssembly *
+mono_assembly_load_from_predicate (MonoImage *image, const char *fname,
+ gboolean refonly,
+ MonoAssemblyCandidatePredicate predicate,
+ gpointer user_data,
+ MonoImageOpenStatus *status)
{
MonoAssembly *ass, *ass2;
char *base_dir;
mono_error_cleanup (&refasm_error);
}
+ if (predicate && !predicate (ass, user_data)) {
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_ASSEMBLY, "Predicate returned FALSE, skipping '%s' (%s)\n", ass->aname.name, image->name);
+ g_free (ass);
+ g_free (base_dir);
+ mono_image_close (image);
+ *status = MONO_IMAGE_IMAGE_INVALID;
+ return NULL;
+ }
+
mono_assemblies_lock ();
if (image->assembly) {
if (fullpath == NULL)
return NULL;
else {
- MonoAssembly *res = mono_assembly_open (fullpath, status);
+ MonoAssembly *res = mono_assembly_open_predicate (fullpath, FALSE, FALSE, NULL, NULL, status);
g_free (fullpath);
return res;
}
if (!domain)
return;
+ if (info->has_new_version && mono_assembly_is_problematic_version (info->name, info->new_version.major, info->new_version.minor, info->new_version.build, info->new_version.revision)) {
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_ASSEMBLY, "Discarding assembly binding to problematic version %s v%d.%d.%d.%d",
+ info->name, info->new_version.major, info->new_version.minor, info->new_version.build, info->new_version.revision);
+ return;
+ }
+
for (tmp = domain->assembly_bindings; tmp; tmp = tmp->next) {
info_tmp = (MonoAssemblyBindingInfo *)tmp->data;
if (strcmp (info->name, info_tmp->name) == 0 && info_versions_equal (info, info_tmp))
paths = extra_gac_paths;
while (!result && *paths) {
fullpath = g_build_path (G_DIR_SEPARATOR_S, *paths, "lib", "mono", "gac", subpath, NULL);
- result = mono_assembly_open_full (fullpath, status, refonly);
+ result = mono_assembly_open_predicate (fullpath, refonly, FALSE, NULL, NULL, status);
g_free (fullpath);
paths++;
}
fullpath = g_build_path (G_DIR_SEPARATOR_S, mono_assembly_getrootdir (),
"mono", "gac", subpath, NULL);
- result = mono_assembly_open_full (fullpath, status, refonly);
+ result = mono_assembly_open_predicate (fullpath, refonly, FALSE, NULL, NULL, status);
g_free (fullpath);
if (result)
// This unusual directory layout can occur if mono is being built and run out of its own source repo
if (assemblies_path) { // Custom assemblies path set via MONO_PATH or mono_set_assemblies_path
- corlib = load_in_path ("mscorlib.dll", (const char**)assemblies_path, status, FALSE);
+ corlib = load_in_path ("mscorlib.dll", (const char**)assemblies_path, status, FALSE, NULL, NULL);
if (corlib)
goto return_corlib_and_facades;
}
/* Normal case: Load corlib from mono/<version> */
corlib_file = g_build_filename ("mono", runtime->framework_version, "mscorlib.dll", NULL);
if (assemblies_path) { // Custom assemblies path
- corlib = load_in_path (corlib_file, (const char**)assemblies_path, status, FALSE);
+ corlib = load_in_path (corlib_file, (const char**)assemblies_path, status, FALSE, NULL, NULL);
if (corlib) {
g_free (corlib_file);
goto return_corlib_and_facades;
}
}
- corlib = load_in_path (corlib_file, default_path, status, FALSE);
+ corlib = load_in_path (corlib_file, default_path, status, FALSE, NULL, NULL);
g_free (corlib_file);
return_corlib_and_facades:
return candidate;
}
+gboolean
+mono_assembly_candidate_predicate_sn_same_name (MonoAssembly *candidate, gpointer ud)
+{
+ MonoAssemblyName *wanted_name = (MonoAssemblyName*)ud;
+ MonoAssemblyName *candidate_name = &candidate->aname;
+
+ g_assert (wanted_name != NULL);
+ g_assert (candidate_name != NULL);
+
+ if (mono_trace_is_traced (G_LOG_LEVEL_INFO, MONO_TRACE_ASSEMBLY)) {
+ char * s = mono_stringify_assembly_name (wanted_name);
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_ASSEMBLY, "Predicate: wanted = %s\n", s);
+ g_free (s);
+ s = mono_stringify_assembly_name (candidate_name);
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_ASSEMBLY, "Predicate: candidate = %s\n", s);
+ g_free (s);
+ }
+
+ /* No wanted token, bail. */
+ if (0 == wanted_name->public_key_token [0]) {
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_ASSEMBLY, "Predicate: wanted has no token, returning TRUE\n");
+ return TRUE;
+ }
+
+ if (0 == candidate_name->public_key_token [0]) {
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_ASSEMBLY, "Predicate: candidate has no token, returning FALSE\n");
+ return FALSE;
+ }
+
+
+ gboolean result = mono_assembly_names_equal (wanted_name, candidate_name);
+
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_ASSEMBLY, "Predicate: candidate and wanted names %s\n",
+ result ? "match, returning TRUE" : "don't match, returning FALSE");
+ return result;
+
+}
+
MonoAssembly*
mono_assembly_load_full_nosearch (MonoAssemblyName *aname,
int len;
aname = mono_assembly_remap_version (aname, &maped_aname);
-
+
/* Reflection only assemblies don't get assembly binding */
if (!refonly)
aname = mono_assembly_apply_binding (aname, &maped_name_pp);
if (basedir) {
fullpath = g_build_filename (basedir, filename, NULL);
- result = mono_assembly_open_full (fullpath, status, refonly);
+ result = mono_assembly_open_predicate (fullpath, refonly, FALSE, NULL, NULL, status);
g_free (fullpath);
if (result) {
result->in_gac = FALSE;
}
}
- result = load_in_path (filename, default_path, status, refonly);
+ result = load_in_path (filename, default_path, status, refonly, NULL, NULL);
if (result)
result->in_gac = FALSE;
g_free (filename);
MONO_API void mono_assemblies_init (void);
MONO_API void mono_assemblies_cleanup (void);
+MONO_RT_EXTERNAL_ONLY
MONO_API MonoAssembly *mono_assembly_open (const char *filename,
MonoImageOpenStatus *status);
+MONO_RT_EXTERNAL_ONLY
MONO_API MonoAssembly *mono_assembly_open_full (const char *filename,
MonoImageOpenStatus *status,
mono_bool refonly);
#include <netdb.h>
#include <unistd.h>
-#include <mono/metadata/assembly.h>
+#include <mono/metadata/assembly-internals.h>
#include <mono/metadata/metadata.h>
#include <mono/metadata/class-internals.h>
#include <mono/metadata/object-internals.h>
gpointer pa [1];
MonoImageOpenStatus open_status;
- agent_assembly = mono_assembly_open (agent, &open_status);
+ agent_assembly = mono_assembly_open_predicate (agent, FALSE, FALSE, NULL, NULL, &open_status);
if (!agent_assembly) {
fprintf (stderr, "Cannot open agent assembly '%s': %s.\n", agent, mono_image_strerror (open_status));
g_free (agent);
klass->parent = parent;
klass->instance_size = mono_class_instance_size (klass->parent);
- if (eclass->byval_arg.type == MONO_TYPE_TYPEDBYREF || eclass->byval_arg.type == MONO_TYPE_VOID) {
+ if (eclass->byval_arg.type == MONO_TYPE_TYPEDBYREF) {
/*Arrays of those two types are invalid.*/
MonoError prepared_error;
error_init (&prepared_error);
- mono_error_set_invalid_program (&prepared_error, "Arrays of void or System.TypedReference types are invalid.");
+ mono_error_set_invalid_program (&prepared_error, "Arrays of System.TypedReference types are invalid.");
mono_class_set_failure (klass, mono_error_box (&prepared_error, klass->image));
mono_error_cleanup (&prepared_error);
} else if (eclass->enumtype && !mono_class_enum_basetype (eclass)) {
klass->this_arg = klass->byval_arg;
klass->this_arg.byref = 1;
+ if (rank > 32) {
+ MonoError prepared_error;
+ error_init (&prepared_error);
+ name = mono_type_get_full_name (klass);
+ mono_error_set_type_load_class (&prepared_error, klass, "%s has too many dimensions.", name);
+ mono_class_set_failure (klass, mono_error_box (&prepared_error, klass->image));
+ mono_error_cleanup (&prepared_error);
+ g_free (name);
+ }
+
mono_loader_lock ();
/* Check cache again */
#include "cil-coff.h"
#include "metadata-internals.h"
#include "image.h"
-#include "assembly.h"
+#include "assembly-internals.h"
#include "domain-internals.h"
#include "appdomain.h"
#include "object.h"
* probably be delayed until the first call to an exported function.
*/
if (image->tables [MONO_TABLE_ASSEMBLY].rows && ((MonoCLIImageInfo*) image->image_info)->cli_cli_header.ch_vtable_fixups.rva)
- assembly = mono_assembly_open (file_name, NULL);
+ assembly = mono_assembly_open_predicate (file_name, FALSE, FALSE, NULL, NULL, NULL);
g_free (file_name);
break;
ExitProcess (1);
}
- assembly = mono_assembly_open (file_name, NULL);
+ assembly = mono_assembly_open_predicate (file_name, FALSE, FALSE, NULL, NULL, NULL);
mono_close_exe_image ();
if (!assembly) {
g_free (file_name);
{1264, 1328, 1264, 1328, 1792, 1337, 1339, 1343, 1347, 1311, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 11, 1264, 11, 1359, 1337, 1339, 1343, 1795, 1811, 1824, 1357, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 1328, 1264, 1328, 1359, 1337, 1339, 1343, 1347, 1311, 55, 1357, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
- {1264, 1328, 1264, 1328, 1359, 1337, 1828, 1343, 1831, 1843, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {1264, 1328, 1264, 1328, 1359, 1337, 1828, 1343, 1831, 1843, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {2, -1}, {3, -1}},
{1264, 1328, 1264, 1328, 1359, 1337, 1339, 1343, 1854, 1865, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
- {1264, 1328, 1264, 1328, 0, 1337, 0, 1343, 1347, 1311, 55, 1357, 8, 3, 1, 1, 1, 2, 2, {3, 0}, {3, 0}},
+ {1264, 1328, 1264, 1328, 0, 1337, 0, 1343, 1347, 1311, 55, 1357, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{1, 1264, 1, 1264, 1875, 1494, 0, 1296, 1347, 1311, 55, 1357, 3, 0, 0, 0, 3, 2, 2, {3, -1}, {3, -1}},
{1264, 11, 1264, 11, 1884, 1337, 1339, 1343, 1347, 1311, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 1888, 1337, 1891, 1343, 1347, 1311, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 1971, 1337, 1339, 1343, 1347, 1311, 55, 1357, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
{11, 1264, 11, 1264, 1971, 1337, 1339, 1343, 1347, 1311, 55, 1357, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
{11, 1264, 11, 1264, 1971, 1337, 1339, 1343, 1347, 1311, 55, 1357, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
- {11, 1264, 11, 1264, 1971, 1337, 1339, 1343, 1347, 1311, 55, 1357, 12, 2, 2, 2, 1, 2, 2, {3, 2}, {3, 2}},
+ {11, 1264, 11, 1264, 1971, 1337, 1339, 1343, 1347, 1311, 55, 1357, 12, 2, 2, 2, 1, 2, 2, {3, -1}, {3, 2}},
{11, 1264, 11, 1264, 1971, 1337, 0, 1343, 1347, 1311, 55, 1357, 12, 2, 1, 1, 1, 2, 2, {3, 2}, {3, 2}},
{2067, 1264, 11, 1264, 1971, 1337, 1339, 1343, 1347, 1311, 55, 1357, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
{11, 1264, 11, 1264, 0, 1337, 1339, 1343, 1347, 1311, 55, 1357, 9, 2, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
- {11, 1264, 11, 1264, 1380, 1337, 1339, 1343, 1347, 1311, 55, 1357, 2, 0, 1, 1, 1, 2, 2, {3, 0}, {3, 0}},
+ {11, 1264, 11, 1264, 1380, 1337, 1339, 1343, 1347, 1311, 55, 1357, 2, 0, 1, 1, 1, 2, 2, {3, 0}, {3, -1}},
{11, 1264, 11, 1264, 2069, 1337, 0, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
- {11, 1264, 11, 1264, 2072, 1337, 1339, 1343, 1347, 1311, 55, 1357, 5, 1, 1, 1, 2, 2, 2, {3, -1}, {3, 0}},
- {1264, 11, 1264, 11, 2076, 1337, 2080, 1343, 1347, 1311, 55, 1357, 2, 0, 1, 1, 1, 0, 2, {3, 0}, {3, 0}},
+ {11, 1264, 11, 1264, 2072, 1337, 1339, 1343, 1347, 1311, 55, 1357, 5, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}},
+ {1264, 11, 1264, 11, 2076, 1337, 2080, 1343, 1347, 1311, 55, 1357, 2, 0, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 2126, 1337, 2128, 1343, 1347, 1311, 55, 1357, 9, 2, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
{1264, 11, 1264, 11, 1359, 1337, 1339, 1343, 1466, 1476, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 1971, 1337, 0, 1343, 1347, 1311, 55, 1357, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
- {11, 1264, 11, 1264, 2168, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, 2}},
+ {11, 1264, 11, 1264, 2168, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 0, 1337, 1339, 1343, 1347, 1311, 55, 1357, 0, 0, 1, 0, 1, 2, 2, {3, -1}, {3, -1}},
- {11, 1264, 11, 1264, 2176, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 1, {3, 0}, {3, 0}},
+ {11, 1264, 11, 1264, 2176, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 1, {3, -1}, {3, -1}},
{1264, 1328, 1264, 1328, 0, 1337, 0, 1343, 1497, 1505, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 2183, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, 2}},
{1264, 11, 1264, 11, 1359, 1337, 1339, 1343, 1347, 1311, 55, 1357, 11, 2, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 2197, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1328, 11, 1328, 1924, 1337, 0, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 1328, 1264, 1328, 1359, 1337, 1339, 1343, 1347, 1311, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
- {1264, 11, 1264, 11, 1411, 1337, 1729, 1343, 1347, 1311, 55, 1357, 12, 2, 0, 0, 1, 2, 2, {3, 0}, {3, 0}},
+ {1264, 11, 1264, 11, 1411, 1337, 1729, 1343, 1347, 1311, 55, 1357, 12, 2, 0, 0, 1, 2, 2, {3, 0}, {3, -1}},
{11, 1264, 11, 1264, 2197, 1337, 1339, 1296, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 1792, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 2201, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 1464, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 2205, 1337, 0, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
- {11, 1264, 11, 1264, 1380, 1337, 0, 1343, 1347, 1311, 55, 1357, 2, 0, 1, 1, 1, 2, 2, {3, -1}, {3, 0}},
+ {11, 1264, 11, 1264, 1380, 1337, 0, 1343, 1347, 1311, 55, 1357, 2, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 1328, 1264, 1328, 1359, 1337, 0, 1343, 1347, 1311, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 1539, 1337, 1339, 1343, 1347, 1311, 55, 1357, 2, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 1328, 1264, 1328, 1359, 1337, 1339, 1343, 1347, 1311, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 1328, 1264, 1328, 1792, 1337, 1339, 1343, 1347, 1311, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 11, 1264, 11, 1359, 1337, 1339, 1343, 1795, 1811, 1824, 1357, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 1328, 1264, 1328, 1359, 1337, 1339, 1343, 1347, 1311, 55, 1357, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
- {1264, 1328, 1264, 1328, 1359, 1337, 1828, 1343, 1831, 1843, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {1264, 1328, 1264, 1328, 1359, 1337, 1828, 1343, 1831, 1843, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {2, -1}, {3, -1}},
{1264, 1328, 1264, 1328, 1359, 1337, 1339, 1343, 1854, 1865, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
- {1264, 1328, 1264, 1328, 1999, 1337, 0, 1343, 1347, 1311, 55, 1357, 8, 3, 1, 1, 1, 2, 2, {3, 0}, {3, 0}},
+ {1264, 1328, 1264, 1328, 1999, 1337, 0, 1343, 1347, 1311, 55, 1357, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{1, 1264, 1, 1264, 1875, 1494, 0, 1296, 1347, 1311, 55, 1357, 3, 0, 0, 0, 3, 0, 2, {3, -1}, {3, -1}},
{1264, 11, 1264, 11, 1884, 1337, 1339, 1343, 1347, 1311, 55, 1357, 8, 3, 0, 0, 1, 0, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 1888, 1337, 1891, 1343, 1347, 1311, 55, 1357, 8, 3, 0, 0, 1, 0, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 1971, 1337, 1339, 1343, 1347, 1311, 55, 1357, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
{11, 1264, 11, 1264, 1971, 1337, 1339, 1343, 1347, 1311, 55, 1357, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
{11, 1264, 11, 1264, 1971, 1337, 1339, 1343, 1347, 1311, 55, 1357, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
- {11, 1264, 11, 1264, 1971, 1337, 1339, 1343, 1347, 1311, 55, 1357, 12, 2, 2, 2, 1, 2, 2, {3, 2}, {3, 2}},
+ {11, 1264, 11, 1264, 1971, 1337, 1339, 1343, 1347, 1311, 55, 1357, 12, 2, 2, 2, 1, 2, 2, {3, -1}, {3, 2}},
{11, 1264, 11, 1264, 1971, 1337, 0, 1343, 1347, 1311, 55, 1357, 12, 2, 1, 1, 1, 2, 2, {3, 2}, {3, 2}},
{2067, 1264, 11, 1264, 1971, 1337, 1339, 1343, 1347, 1311, 55, 1357, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
{11, 1264, 11, 1264, 2263, 1337, 1339, 1343, 1347, 1311, 55, 1357, 9, 2, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
- {11, 1264, 11, 1264, 1380, 1337, 1339, 1343, 1347, 1311, 55, 1357, 2, 0, 1, 1, 1, 2, 2, {3, 0}, {3, 0}},
+ {11, 1264, 11, 1264, 1380, 1337, 1339, 1343, 1347, 1311, 55, 1357, 2, 0, 1, 1, 1, 2, 2, {3, 0}, {3, -1}},
{11, 1264, 11, 1264, 2069, 1337, 0, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
- {11, 1264, 11, 1264, 2072, 1337, 1339, 1343, 1347, 1311, 55, 1357, 5, 1, 1, 1, 2, 2, 2, {3, -1}, {3, 0}},
- {1264, 11, 1264, 11, 2076, 1337, 2080, 1343, 1347, 1311, 55, 1357, 2, 0, 1, 1, 1, 0, 2, {3, 0}, {3, 0}},
+ {11, 1264, 11, 1264, 2072, 1337, 1339, 1343, 1347, 1311, 55, 1357, 5, 1, 1, 1, 2, 2, 2, {3, -1}, {3, -1}},
+ {1264, 11, 1264, 11, 2076, 1337, 2080, 1343, 1347, 1311, 55, 1357, 2, 0, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 2126, 1337, 2128, 1343, 1347, 1311, 55, 1357, 9, 2, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
{1264, 11, 1264, 11, 1359, 1337, 1339, 1343, 1466, 1476, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 1971, 1337, 0, 1343, 1347, 1311, 55, 1357, 12, 2, 0, 0, 1, 2, 2, {3, 2}, {3, 2}},
- {11, 1264, 11, 1264, 2168, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, 2}},
- {11, 1264, 11, 1264, 2176, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 1, {3, 0}, {3, 0}},
+ {11, 1264, 11, 1264, 2168, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {11, 1264, 11, 1264, 2176, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 1, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 2267, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, 2}},
{1264, 11, 1264, 11, 1359, 1337, 1339, 1343, 1347, 1311, 55, 1357, 11, 2, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 11, 1264, 11, 2190, 1494, 1339, 1296, 1753, 1311, 1769, 1777, 8, 3, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 2197, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1328, 11, 1328, 1924, 1337, 0, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 1328, 1264, 1328, 1359, 1337, 1339, 1343, 1347, 1311, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
- {1264, 11, 1264, 11, 1411, 1337, 1729, 1343, 1347, 1311, 55, 1357, 12, 2, 0, 0, 1, 2, 2, {3, 0}, {3, 0}},
+ {1264, 11, 1264, 11, 1411, 1337, 1729, 1343, 1347, 1311, 55, 1357, 12, 2, 0, 0, 1, 2, 2, {3, 0}, {3, -1}},
{11, 1264, 11, 1264, 2197, 1337, 1339, 1296, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 1792, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 1792, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 1464, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 2205, 1337, 0, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
- {11, 1264, 11, 1264, 1380, 1337, 0, 1343, 1347, 1311, 55, 1357, 2, 0, 1, 1, 1, 2, 2, {3, -1}, {3, 0}},
+ {11, 1264, 11, 1264, 1380, 1337, 0, 1343, 1347, 1311, 55, 1357, 2, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 1328, 1264, 1328, 1359, 1337, 0, 1343, 1347, 1311, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 1539, 1337, 1339, 1343, 1347, 1311, 55, 1357, 2, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 1328, 1264, 1328, 1359, 1337, 1339, 1343, 1347, 1311, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 11, 1264, 11, 2292, 1337, 1339, 1343, 1347, 1311, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 1328, 1264, 1328, 2292, 1337, 1645, 1343, 1662, 1690, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 1328, 1264, 1328, 1359, 1337, 1729, 1736, 1347, 1311, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
- {11, 1264, 11, 1264, 1971, 1337, 1339, 1343, 1753, 1311, 1769, 1777, 1, 0, 1, 2, 1, 2, 2, {3, -1}, {3, -1}},
+ {11, 1264, 11, 1264, 1971, 1337, 1339, 1343, 1753, 1311, 1769, 1777, 1, 0, 1, 2, 1, 2, 2, {3, 2}, {3, -1}},
{1264, 1328, 1264, 1328, 2253, 1337, 1339, 1343, 1347, 1311, 55, 1357, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 11, 1264, 11, 1359, 1337, 1339, 1343, 1347, 1311, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1328, 11, 1328, 2294, 1337, 0, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 1328, 1264, 1328, 2296, 1494, 2303, 1296, 1347, 1311, 55, 1357, 9, 2, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 2336, 1337, 1339, 1343, 1347, 1311, 55, 1357, 12, 2, 1, 0, 1, 2, 2, {3, 2}, {3, 2}},
{11, 1264, 11, 1264, 2340, 1494, 1339, 1296, 1347, 1311, 55, 1517, 9, 2, 9, 3, 2, 0, 2, {3, -1}, {3, -1}},
- {11, 1264, 11, 1264, 2343, 1337, 1339, 1343, 1347, 1311, 55, 1357, 9, 2, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
+ {11, 1264, 11, 1264, 2343, 1337, 1339, 1343, 1347, 1311, 55, 1357, 9, 2, 1, 1, 1, 2, 2, {3, 2}, {3, 2}},
{11, 1264, 11, 1264, 1971, 1337, 1339, 1343, 1347, 1311, 55, 1357, 9, 2, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 2201, 1337, 1339, 1343, 1347, 1311, 55, 1357, 1, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 2347, 1276, 1281, 1296, 1299, 1311, 1320, 1324, 3, 2, 0, 0, 3, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 2292, 1337, 1339, 1343, 1466, 1476, 55, 1357, 1, 0, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 2562, 1337, 1339, 1343, 1466, 1476, 55, 1357, 1, 0, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 1464, 1337, 1339, 1343, 1466, 1476, 55, 1357, 1, 0, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
- {11, 1264, 11, 1264, 1464, 1337, 1339, 1343, 1466, 1476, 55, 1357, 0, 0, 1, 1, 1, 2, 2, {3, -1}, {3, 0}},
+ {11, 1264, 11, 1264, 1464, 1337, 1339, 1343, 1466, 1476, 55, 1357, 0, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 1464, 1337, 1339, 1343, 1466, 1476, 55, 1357, 1, 0, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 11, 1264, 11, 2423, 1337, 1339, 1343, 1347, 1311, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 11, 1264, 11, 2373, 1337, 1339, 1343, 1347, 1311, 55, 1357, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 2357, 1337, 2239, 1343, 1347, 1311, 55, 1357, 0, 0, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 1328, 1264, 1328, 1726, 1276, 1339, 1296, 1347, 1311, 55, 1324, 9, 2, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 11, 1264, 11, 2573, 1337, 1339, 1343, 1347, 1311, 55, 1357, 8, 3, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
- {1264, 1328, 1264, 1328, 1999, 1337, 0, 1343, 1347, 1311, 55, 1357, 8, 3, 1, 1, 1, 2, 2, {3, 0}, {3, 0}},
+ {1264, 1328, 1264, 1328, 1999, 1337, 0, 1343, 1347, 1311, 55, 1357, 8, 3, 1, 1, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 11, 1264, 11, 1359, 1337, 1339, 1343, 1347, 1311, 55, 1357, 8, 3, 0, 0, 1, 2, 2, {3, -1}, {3, -1}},
{1264, 1328, 1264, 1328, 2257, 1494, 2041, 1296, 1347, 1311, 55, 1357, 9, 2, 1, 1, 1, 0, 2, {3, -1}, {3, -1}},
{11, 1264, 11, 1264, 2340, 1494, 1339, 1296, 1347, 1311, 55, 1517, 9, 2, 9, 3, 2, 2, 2, {3, -1}, {3, -1}},
char wrapper [64];
char *klass_desc;
char *inst_desc = NULL;
+ MonoError error;
if (format == MONO_TYPE_NAME_FORMAT_IL)
klass_desc = mono_type_full_name (&method->klass->byval_arg);
strcpy (wrapper, "");
if (signature) {
- char *tmpsig = mono_signature_get_desc (mono_method_signature (method), TRUE);
+ MonoMethodSignature *sig = mono_method_signature_checked (method, &error);
+ char *tmpsig;
+
+ if (!is_ok (&error)) {
+ tmpsig = g_strdup_printf ("<unable to load signature>");
+ mono_error_cleanup (&error);
+ } else {
+ tmpsig = mono_signature_get_desc (sig, TRUE);
+ }
if (method->wrapper_type != MONO_WRAPPER_NONE)
sprintf (wrapper, "(wrapper %s) ", wrapper_type_to_str (method->wrapper_type));
else
strcpy (wrapper, "");
- if (ret) {
- char *ret_str = mono_type_full_name (mono_method_signature (method)->ret);
+ if (ret && sig) {
+ char *ret_str = mono_type_full_name (sig->ret);
res = g_strdup_printf ("%s%s %s:%s%s (%s)", wrapper, ret_str, klass_desc,
method->name, inst_desc ? inst_desc : "", tmpsig);
g_free (ret_str);
typedef struct {
const char runtime_version [12];
const char framework_version [4];
+ const char *public_key_token;
const AssemblyVersionSet version_sets [5];
} MonoRuntimeInfo;
#include <mono/metadata/domain-internals.h>
#include <mono/metadata/class-internals.h>
#include <mono/metadata/debug-internals.h>
-#include <mono/metadata/assembly.h>
+#include <mono/metadata/assembly-internals.h>
#include <mono/metadata/exception.h>
#include <mono/metadata/metadata-internals.h>
#include <mono/metadata/appdomain.h>
/* This is the list of runtime versions supported by this JIT.
*/
static const MonoRuntimeInfo supported_runtimes[] = {
- {"v4.0.30319","4.5", { {4,0,0,0}, {10,0,0,0}, {4,0,0,0}, {4,0,0,0}, {4,0,0,0} } },
- {"mobile", "2.1", { {2,0,5,0}, {10,0,0,0}, {2,0,5,0}, {2,0,5,0}, {4,0,0,0} } },
- {"moonlight", "2.1", { {2,0,5,0}, { 9,0,0,0}, {3,5,0,0}, {3,0,0,0}, NOT_AVAIL } },
+ {"v4.0.30319","4.5", NULL, { {4,0,0,0}, {10,0,0,0}, {4,0,0,0}, {4,0,0,0}, {4,0,0,0} } },
+ {"mobile", "2.1", "7cec85d7bea7798e", { {2,0,5,0}, {10,0,0,0}, {2,0,5,0}, {2,0,5,0}, {4,0,0,0} } },
+ {"moonlight", "2.1", NULL, { {2,0,5,0}, { 9,0,0,0}, {3,5,0,0}, {3,0,0,0}, NOT_AVAIL } },
};
#undef NOT_AVAIL
current = mono_domain_get ();
mono_domain_set (domain, FALSE);
- ass = mono_assembly_open (name, NULL);
+ ass = mono_assembly_open_predicate (name, FALSE, FALSE, NULL, NULL, NULL);
mono_domain_set (current, FALSE);
} else {
- ass = mono_assembly_open (name, NULL);
+ ass = mono_assembly_open_predicate (name, FALSE, FALSE, NULL, NULL, NULL);
}
return ass;
if (mono_error_set_pending_exception (&error))
return NULL;
+ if (klass->element_class->byval_arg.type == MONO_TYPE_VOID) {
+ mono_set_pending_exception (mono_get_exception_not_supported ("Arrays of System.Void are not supported."));
+ return NULL;
+ }
+
if (bounds && (mono_array_length (bounds) == 1) && (mono_array_get (bounds, gint32, 0) != 0))
/* vectors are not the same as one dimensional arrays with no-zero bounds */
bounded = TRUE;
name = mono_type_get_full_name (klass);
mono_error_set_type_load_name (error, name, g_strdup (""), "");
}
+
ICALL_EXPORT MonoReflectionTypeHandle
ves_icall_RuntimeType_make_array_type (MonoReflectionTypeHandle ref_type, int rank, MonoError *error)
{
else
aklass = mono_bounded_array_class_get (klass, rank, TRUE);
+ if (mono_class_has_failure (aklass)) {
+ mono_error_set_for_class_failure (error, aklass);
+ return MONO_HANDLE_CAST (MonoReflectionType, NULL_HANDLE);
+ }
+
MonoDomain *domain = MONO_HANDLE_DOMAIN (ref_type);
return mono_type_get_object_handle (domain, &aklass->byval_arg, error);
}
The ignored_assemblies list is generated using tools/nuget-hash-extractor and feeding the problematic nugets to it.
-Right now the list of nugets are the ones that provide the assemblies in $ignored_assemblies_names.
+Right now the list of nugets are the ones that provide the assemblies in $ignored_assemblies_file_names.
This is to be removed once a proper fix is shipped through nuget.
const char guid [40];
} IgnoredAssembly;
-const char *ignored_assemblies_names[] = {
+typedef struct {
+ int assembly_name;
+ guint16 major, minor, build, revision;
+} IgnoredAssemblyVersion;
+
+const char *ignored_assemblies_file_names[] = {
"System.Runtime.InteropServices.RuntimeInformation.dll",
"System.Globalization.Extensions.dll",
"System.IO.Compression.dll",
IGNORED_ASSEMBLY (0x75B4B041, SYS_VALUE_TUPLE, "F81A4140-A898-4E2B-B6E9-55CE78C273EC", "4.3.0 netstandard1.0"),
};
+
+const char *ignored_assemblies_names[] = {
+ "System.Runtime.InteropServices.RuntimeInformation",
+ "System.Globalization.Extensions",
+ "System.IO.Compression",
+ "System.Net.Http",
+ "System.Text.Encoding.CodePages",
+ "System.Reflection.DispatchProxy",
+ "System.ValueTuple"
+};
+
+#define IGNORED_ASM_VER(NAME, MAJOR, MINOR, BUILD, REVISION) { .assembly_name = NAME, .major = MAJOR, .minor = MINOR, .build = BUILD, .revision = REVISION }
+
+static const IgnoredAssemblyVersion ignored_assembly_versions [] = {
+ IGNORED_ASM_VER (SYS_GLOBALIZATION_EXT, 4, 0, 0, 0),
+ IGNORED_ASM_VER (SYS_GLOBALIZATION_EXT, 4, 0, 1, 0),
+ IGNORED_ASM_VER (SYS_GLOBALIZATION_EXT, 4, 0, 2, 0),
+ IGNORED_ASM_VER (SYS_IO_COMPRESSION, 4, 1, 0, 0),
+ IGNORED_ASM_VER (SYS_IO_COMPRESSION, 4, 1, 2, 0),
+ IGNORED_ASM_VER (SYS_NET_HTTP, 4, 1, 0, 0),
+ IGNORED_ASM_VER (SYS_NET_HTTP, 4, 1, 0, 1),
+ IGNORED_ASM_VER (SYS_NET_HTTP, 4, 1, 1, 0),
+ IGNORED_ASM_VER (SYS_REF_DISP_PROXY, 4, 0, 0, 0),
+ IGNORED_ASM_VER (SYS_REF_DISP_PROXY, 4, 0, 1, 0),
+ IGNORED_ASM_VER (SYS_REF_DISP_PROXY, 4, 0, 2, 0),
+ IGNORED_ASM_VER (SYS_RT_INTEROP_RUNTIME_INFO, 4, 0, 0, 0),
+ IGNORED_ASM_VER (SYS_RT_INTEROP_RUNTIME_INFO, 4, 0, 1, 0),
+ IGNORED_ASM_VER (SYS_TEXT_ENC_CODEPAGES, 4, 0, 1, 0),
+ IGNORED_ASM_VER (SYS_TEXT_ENC_CODEPAGES, 4, 0, 2, 0),
+ IGNORED_ASM_VER (SYS_VALUE_TUPLE, 4, 0, 1, 0),
+};
+
+gboolean
+mono_assembly_is_problematic_version (const char *name, guint16 major, guint16 minor, guint16 build, guint16 revision)
+{
+ return FALSE;
+ for (int i = 0; i < G_N_ELEMENTS (ignored_assembly_versions); ++i) {
+ if (ignored_assembly_versions [i].major != major ||
+ ignored_assembly_versions [i].minor != minor ||
+ ignored_assembly_versions [i].build != build ||
+ ignored_assembly_versions [i].revision != revision)
+ continue;
+ if (!strcmp (ignored_assemblies_names [ignored_assembly_versions [i].assembly_name], name))
+ return TRUE;
+ }
+ return FALSE;
+}
+
/*
Equivalent C# code:
static void Main () {
// Either sort by hash and bseach or use SoA and make the linear search more cache efficient.
for (int i = 0; i < G_N_ELEMENTS (ignored_assemblies); ++i) {
if (ignored_assemblies [i].hash == h && !strcmp (image->guid, ignored_assemblies [i].guid)) {
- const char *needle = ignored_assemblies_names [ignored_assemblies [i].assembly_name];
+ const char *needle = ignored_assemblies_file_names [ignored_assemblies [i].assembly_name];
size_t needle_len = strlen (needle);
size_t asm_len = strlen (image->name);
if (asm_len > needle_len && !g_ascii_strcasecmp (image->name + (asm_len - needle_len), needle))
void
mono_loader_register_module (const char *name, MonoDl *module);
+gboolean
+mono_assembly_is_problematic_version (const char *name, guint16 major, guint16 minor, guint16 build, guint16 revision);
+
#endif /* __MONO_METADATA_INTERNALS_H__ */
#include <config.h>
#endif
-#include <mono/metadata/assembly.h>
+#include <mono/metadata/assembly-internals.h>
#include <mono/metadata/appdomain.h>
#include <mono/metadata/image.h>
#include <mono/metadata/exception.h>
if (system_security_assembly == NULL) {
system_security_assembly = mono_image_loaded ("System.Security");
if (!system_security_assembly) {
- MonoAssembly *sa = mono_assembly_open ("System.Security.dll", NULL);
+ MonoAssembly *sa = mono_assembly_open_predicate ("System.Security.dll", FALSE, FALSE, NULL, NULL, NULL);
if (!sa)
g_assert_not_reached ();
system_security_assembly = mono_assembly_get_image (sa);
#include <mono/metadata/object.h>
#include <mono/metadata/exception.h>
-#include <mono/metadata/assembly.h>
+#include <mono/metadata/assembly-internals.h>
#include <mono/metadata/appdomain.h>
#include <mono/metadata/w32file.h>
#include <mono/metadata/threads.h>
socket_assembly = mono_image_loaded ("System");
if (!socket_assembly) {
- MonoAssembly *sa = mono_assembly_open ("System.dll", NULL);
+ MonoAssembly *sa = mono_assembly_open_predicate ("System.dll", FALSE, FALSE, NULL, NULL, NULL);
if (!sa) {
g_assert_not_reached ();
if (mono_posix_image == NULL) {
mono_posix_image = mono_image_loaded ("Mono.Posix");
if (!mono_posix_image) {
- MonoAssembly *sa = mono_assembly_open ("Mono.Posix.dll", NULL);
+ MonoAssembly *sa = mono_assembly_open_predicate ("Mono.Posix.dll", FALSE, FALSE, NULL, NULL, NULL);
if (!sa) {
*werror = WSAENOPROTOOPT;
return;
libmonoinclude_HEADERS = jit.h
-CSFLAGS = -unsafe -nowarn:0219,0169,0414,0649
+CSFLAGS = -unsafe -nowarn:0219,0169,0414,0649,0618
basic-simd.exe: basic-simd.cs TestDriver.dll
$(MCS) -out:$@ $(CSFLAGS) $< -r:TestDriver.dll -r:$(CLASS)/Mono.Simd.dll
return;
}
if (cfg->exception_type != MONO_EXCEPTION_NONE) {
- if (acfg->aot_opts.print_skipped_methods)
+ if (acfg->aot_opts.print_skipped_methods) {
printf ("Skip (JIT failure): %s\n", mono_method_get_full_name (method));
+ if (cfg->exception_message)
+ printf ("Caused by: %s\n", cfg->exception_message);
+ }
/* Let the exception happen at runtime */
return;
}
if (a.Y != 2)
return 2;
- a.X = 500000000000055l;
- a.Y = -12345678900l;
+ a.X = 500000000000055L;
+ a.Y = -12345678900L;
- if (a.X != 500000000000055l)
+ if (a.X != 500000000000055L)
return 3;
- if (a.Y != -12345678900l)
+ if (a.Y != -12345678900L)
return 4;
return 0;
}
#include <unistd.h>
#endif
-#include <mono/metadata/assembly.h>
+#include <mono/metadata/assembly-internals.h>
#include <mono/metadata/loader.h>
#include <mono/metadata/tabledefs.h>
#include <mono/metadata/class.h>
total_run = total = 0;
for (i = 0; i < count; ++i) {
- ass = mono_assembly_open (images [i], NULL);
+ ass = mono_assembly_open_predicate (images [i], FALSE, FALSE, NULL, NULL, NULL);
if (!ass) {
g_warning ("failed to load assembly: %s", images [i]);
continue;
args = NULL;
}
- agent_assembly = mono_assembly_open (agent, &open_status);
+ agent_assembly = mono_assembly_open_predicate (agent, FALSE, FALSE, NULL, NULL, &open_status);
if (!agent_assembly) {
fprintf (stderr, "Cannot open agent assembly '%s': %s.\n", agent, mono_image_strerror (open_status));
g_free (agent);
jit_info_table_test (domain);
#endif
- assembly = mono_assembly_open (aname, &open_status);
+ assembly = mono_assembly_open_predicate (aname, FALSE, FALSE, NULL, NULL, &open_status);
if (!assembly) {
fprintf (stderr, "Cannot open assembly '%s': %s.\n", aname, mono_image_strerror (open_status));
mini_cleanup (domain);
/* trim excessive headers */
#include <mono/metadata/image.h>
-#include <mono/metadata/assembly.h>
+#include <mono/metadata/assembly-internals.h>
#include <mono/metadata/cil-coff.h>
#include <mono/metadata/mono-endian.h>
#include <mono/metadata/tabledefs.h>
THROW_EX (mono_get_exception_execution_engine (NULL), ip); \
} while (0);
-static mono_mutex_t runtime_method_lookup_section;
-
RuntimeMethod*
mono_interp_get_runtime_method (MonoDomain *domain, MonoMethod *method, MonoError *error)
{
RuntimeMethod *rtm;
error_init (error);
- mono_os_mutex_lock (&runtime_method_lookup_section);
+ mono_domain_jit_code_hash_lock (domain);
if ((rtm = mono_internal_hash_table_lookup (&domain->jit_code_hash, method))) {
- mono_os_mutex_unlock (&runtime_method_lookup_section);
+ mono_domain_jit_code_hash_unlock (domain);
return rtm;
}
- rtm = mono_mempool_alloc (domain->mp, sizeof (RuntimeMethod));
- memset (rtm, 0, sizeof (*rtm));
+ rtm = mono_domain_alloc0 (domain, sizeof (RuntimeMethod));
rtm->method = method;
rtm->param_count = mono_method_signature (method)->param_count;
rtm->hasthis = mono_method_signature (method)->hasthis;
mono_internal_hash_table_insert (&domain->jit_code_hash, method, rtm);
- mono_os_mutex_unlock (&runtime_method_lookup_section);
+ mono_domain_jit_code_hash_unlock (domain);
return rtm;
}
virtual_method = mono_class_inflate_generic_method_checked (virtual_method, &context, &error);
mono_error_cleanup (&error); /* FIXME: don't swallow the error */
}
+
+ if (virtual_method->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED) {
+ virtual_method = mono_marshal_get_synchronized_wrapper (virtual_method);
+ }
+
RuntimeMethod *virtual_runtime_method = mono_interp_get_runtime_method (domain, virtual_method, &error);
mono_error_cleanup (&error); /* FIXME: don't swallow the error */
return virtual_runtime_method;
jmp_buf env;
error_init (error);
+ if (exc)
+ *exc = NULL;
frame.ex = NULL;
case MONO_TYPE_ARRAY:
case MONO_TYPE_SZARRAY:
case MONO_TYPE_OBJECT:
+ case MONO_TYPE_GENERICINST:
args [a_index].data.p = params [i];
break;
default:
static GHashTable *method_pointer_hash = NULL;
-static MonoMethod *method_pointers [2] = {0};
+#define TRAMPS_USED 8
-static MonoObject *
-mp_tramp_0 (MonoObject *this_obj, void **params, MonoObject **exc, void *compiled_method) {
- MonoError error;
- void *params_real[] = {this_obj, ¶ms, &exc, &compiled_method};
- MonoObject *ret = mono_interp_runtime_invoke (method_pointers [0], NULL, params_real, NULL, &error);
- mono_error_cleanup (&error); /* FIXME: don't swallow the error */
- return ret;
-}
+static MonoMethod *method_pointers [TRAMPS_USED] = {0};
-static MonoObject *
-mp_tramp_1 (MonoObject *this_obj, void **params, MonoObject **exc, void *compiled_method) {
- MonoError error;
- void *params_real[] = {this_obj, ¶ms, &exc, &compiled_method};
- MonoObject *ret = mono_interp_runtime_invoke (method_pointers [1], NULL, params_real, NULL, &error);
- mono_error_cleanup (&error); /* FIXME: don't swallow the error */
- return ret;
-}
+#define GEN_METHOD_PTR_TRAMP(num) \
+ static MonoObject * mp_tramp_ ## num (MonoObject *this_obj, void **params, MonoObject **exc, void *compiled_method) { \
+ MonoError error; \
+ void *params_real[] = {this_obj, ¶ms, &exc, &compiled_method}; \
+ MonoObject *ret = mono_interp_runtime_invoke (method_pointers [num], NULL, params_real, NULL, &error); \
+ mono_error_cleanup (&error); \
+ return ret; \
+ }
+
+
+GEN_METHOD_PTR_TRAMP (0);
+GEN_METHOD_PTR_TRAMP (1);
+GEN_METHOD_PTR_TRAMP (2);
+GEN_METHOD_PTR_TRAMP (3);
+GEN_METHOD_PTR_TRAMP (4);
+GEN_METHOD_PTR_TRAMP (5);
+GEN_METHOD_PTR_TRAMP (6);
+GEN_METHOD_PTR_TRAMP (7);
-gpointer *mp_tramps[] = {(gpointer) mp_tramp_0, (gpointer) mp_tramp_1};
+#undef GEN_METHOD_PTR_TRAMP
+
+gpointer *mp_tramps[TRAMPS_USED] = {
+ (gpointer) mp_tramp_0, (gpointer) mp_tramp_1, (gpointer) mp_tramp_2, (gpointer) mp_tramp_3,
+ (gpointer) mp_tramp_4, (gpointer) mp_tramp_5, (gpointer) mp_tramp_6, (gpointer) mp_tramp_7
+};
static int tramps_used = 0;
}
else {
g_assert (method->wrapper_type == MONO_WRAPPER_RUNTIME_INVOKE);
- g_assert (tramps_used < 2);
+ g_assert (tramps_used < TRAMPS_USED);
/* FIXME: needs locking */
method_pointers [tramps_used] = method;
MINT_IN_BREAK;
}
- MINT_IN_CASE(MINT_LDTHISA)
- g_error ("should not happen");
- // sp->data.p = &frame->obj;
- ++ip;
- ++sp;
- MINT_IN_BREAK;
-
#define LDARG(datamem, argtype) \
sp->data.datamem = * (argtype *)(frame->args + * (guint16 *)(ip + 1)); \
ip += 2; \
{
mono_native_tls_alloc (&thread_context_id, NULL);
mono_native_tls_set_value (thread_context_id, NULL);
- mono_os_mutex_init_recursive (&runtime_method_lookup_section);
mono_os_mutex_init_recursive (&create_method_pointer_mutex);
mono_interp_transform_init ();
cfailed = failed = run = 0;
transform_time = elapsed = 0.0;
-#if 0
- /* fixme: ugly hack - delete all previously compiled methods */
- if (domain_jit_info (domain)) {
- g_hash_table_destroy (domain_jit_info (domain)->jit_trampoline_hash);
- domain_jit_info (domain)->jit_trampoline_hash = g_hash_table_new (mono_aligned_addr_hash, NULL);
- mono_internal_hash_table_destroy (&(domain->jit_code_hash));
- mono_jit_code_hash_init (&(domain->jit_code_hash));
- }
-#endif
-
g_timer_start (timer);
for (i = 0; i < mono_image_get_table_rows (image, MONO_TABLE_METHOD); ++i) {
MonoObject *exc = NULL;
total_run = total = 0;
for (i = 0; i < count; ++i) {
- MonoAssembly *ass = mono_assembly_open (images [i], NULL);
+ MonoAssembly *ass = mono_assembly_open_predicate (images [i], FALSE, FALSE, NULL, NULL, NULL);
if (!ass) {
g_warning ("failed to load assembly: %s", images [i]);
continue;
OPDEF(MINT_STINARG_VT, "stinarg.vt", 4, MintOpShortAndInt)
OPDEF(MINT_LDARGA, "ldarga", 2, MintOpUShortInt)
-OPDEF(MINT_LDTHISA, "ldthisa", 1, MintOpNoArgs)
OPDEF(MINT_LDFLD_I1, "ldfld.i1", 2, MintOpUShortInt)
OPDEF(MINT_LDFLD_U1, "ldfld.u1", 2, MintOpUShortInt)
break;
case CEE_LDARGA_S: {
/* NOTE: n includes this */
- int n = ((guint8 *)td.ip)[1];
- if (n == 0 && signature->hasthis) {
- g_error ("LDTHISA: NOPE");
- ADD_CODE(&td, MINT_LDTHISA);
- }
- else {
- ADD_CODE(&td, MINT_LDARGA);
- ADD_CODE(&td, td.rtm->arg_offsets [n]);
- }
+ int n = ((guint8 *) td.ip) [1];
+ ADD_CODE (&td, MINT_LDARGA);
+ ADD_CODE (&td, td.rtm->arg_offsets [n]);
PUSH_SIMPLE_TYPE(&td, STACK_TYPE_MP);
td.ip += 2;
break;
klass = (MonoClass *) mono_method_get_wrapper_data (method, token + 1);
if (klass == mono_defaults.typehandle_class)
handle = &((MonoClass *) handle)->byval_arg;
+
+ if (generic_context) {
+ handle = mono_class_inflate_generic_type_checked (handle, generic_context, &error);
+ mono_error_cleanup (&error); /* FIXME: don't swallow the error */
+ }
} else {
handle = mono_ldtoken (image, token, &klass, generic_context);
}
+ mono_class_init (klass);
mt = mint_type (&klass->byval_arg);
g_assert (mt == MINT_TYPE_VT);
size = mono_class_value_size (klass, NULL);
break;
case CEE_LDARGA: {
int n = read16 (td.ip + 1);
- if (n == 0 && signature->hasthis) {
- g_error ("LDTHISA: NOPE");
- ADD_CODE(&td, MINT_LDTHISA);
- }
- else {
- ADD_CODE(&td, MINT_LDARGA);
- ADD_CODE(&td, td.rtm->arg_offsets [n]); /* FIX for large offsets */
- }
+ ADD_CODE (&td, MINT_LDARGA);
+ ADD_CODE (&td, td.rtm->arg_offsets [n]); /* FIX for large offsets */
PUSH_SIMPLE_TYPE(&td, STACK_TYPE_MP);
td.ip += 3;
break;
}
g_assert (td.max_stack_height <= (header->max_stack + 1));
- rtm->clauses = mono_mempool_alloc (domain->mp, header->num_clauses * sizeof(MonoExceptionClause));
+ rtm->clauses = mono_domain_alloc0 (domain, header->num_clauses * sizeof (MonoExceptionClause));
memcpy (rtm->clauses, header->clauses, header->num_clauses * sizeof(MonoExceptionClause));
- rtm->code = mono_mempool_alloc (domain->mp, (td.new_ip - td.new_code) * sizeof(gushort));
+ rtm->code = mono_domain_alloc0 (domain, (td.new_ip - td.new_code) * sizeof (gushort));
memcpy (rtm->code, td.new_code, (td.new_ip - td.new_code) * sizeof(gushort));
g_free (td.new_code);
rtm->new_body_start = rtm->code + body_start_offset;
}
rtm->vt_stack_size = td.max_vt_sp;
rtm->alloca_size = rtm->locals_size + rtm->args_size + rtm->vt_stack_size + rtm->stack_size;
- rtm->data_items = mono_mempool_alloc (domain->mp, td.n_data_items * sizeof (td.data_items [0]));
+ rtm->data_items = mono_domain_alloc0 (domain, td.n_data_items * sizeof (td.data_items [0]));
memcpy (rtm->data_items, td.data_items, td.n_data_items * sizeof (td.data_items [0]));
g_free (td.in_offsets);
g_free (td.forward_refs);
if (!cfg->lmf_ir)
return;
- if (cfg->lmf_ir_mono_lmf) {
- MonoInst *lmf_vara_ins, *lmf_ins;
- /* Load current lmf */
- lmf_ins = mono_create_tls_get (cfg, TLS_KEY_LMF);
- g_assert (lmf_ins);
- EMIT_NEW_VARLOADA (cfg, lmf_vara_ins, cfg->lmf_var, NULL);
- /* Save previous_lmf */
- EMIT_NEW_STORE_MEMBASE (cfg, ins, OP_STORE_MEMBASE_REG, lmf_vara_ins->dreg, MONO_STRUCT_OFFSET (MonoLMF, previous_lmf), lmf_ins->dreg);
- /* Set new LMF */
- mono_create_tls_set (cfg, lmf_vara_ins, TLS_KEY_LMF);
- } else {
- int lmf_reg, prev_lmf_reg;
- /*
- * Store lmf_addr in a variable, so it can be allocated to a global register.
- */
- if (!cfg->lmf_addr_var)
- cfg->lmf_addr_var = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_LOCAL);
+ int lmf_reg, prev_lmf_reg;
+ /*
+ * Store lmf_addr in a variable, so it can be allocated to a global register.
+ */
+ if (!cfg->lmf_addr_var)
+ cfg->lmf_addr_var = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_LOCAL);
#ifdef HOST_WIN32
- ins = mono_create_tls_get (cfg, TLS_KEY_JIT_TLS);
- g_assert (ins);
- int jit_tls_dreg = ins->dreg;
+ ins = mono_create_tls_get (cfg, TLS_KEY_JIT_TLS);
+ g_assert (ins);
+ int jit_tls_dreg = ins->dreg;
- lmf_reg = alloc_preg (cfg);
- EMIT_NEW_BIALU_IMM (cfg, lmf_ins, OP_PADD_IMM, lmf_reg, jit_tls_dreg, MONO_STRUCT_OFFSET (MonoJitTlsData, lmf));
+ lmf_reg = alloc_preg (cfg);
+ EMIT_NEW_BIALU_IMM (cfg, lmf_ins, OP_PADD_IMM, lmf_reg, jit_tls_dreg, MONO_STRUCT_OFFSET (MonoJitTlsData, lmf));
#else
- lmf_ins = mono_create_tls_get (cfg, TLS_KEY_LMF_ADDR);
- g_assert (lmf_ins);
+ lmf_ins = mono_create_tls_get (cfg, TLS_KEY_LMF_ADDR);
+ g_assert (lmf_ins);
#endif
- lmf_ins->dreg = cfg->lmf_addr_var->dreg;
+ lmf_ins->dreg = cfg->lmf_addr_var->dreg;
- EMIT_NEW_VARLOADA (cfg, ins, cfg->lmf_var, NULL);
- lmf_reg = ins->dreg;
+ EMIT_NEW_VARLOADA (cfg, ins, cfg->lmf_var, NULL);
+ lmf_reg = ins->dreg;
- prev_lmf_reg = alloc_preg (cfg);
- /* Save previous_lmf */
- EMIT_NEW_LOAD_MEMBASE (cfg, ins, OP_LOAD_MEMBASE, prev_lmf_reg, cfg->lmf_addr_var->dreg, 0);
- EMIT_NEW_STORE_MEMBASE (cfg, ins, OP_STORE_MEMBASE_REG, lmf_reg, MONO_STRUCT_OFFSET (MonoLMF, previous_lmf), prev_lmf_reg);
- /* Set new lmf */
- EMIT_NEW_STORE_MEMBASE (cfg, ins, OP_STORE_MEMBASE_REG, cfg->lmf_addr_var->dreg, 0, lmf_reg);
- }
+ prev_lmf_reg = alloc_preg (cfg);
+ /* Save previous_lmf */
+ EMIT_NEW_LOAD_MEMBASE (cfg, ins, OP_LOAD_MEMBASE, prev_lmf_reg, cfg->lmf_addr_var->dreg, 0);
+ EMIT_NEW_STORE_MEMBASE (cfg, ins, OP_STORE_MEMBASE_REG, lmf_reg, MONO_STRUCT_OFFSET (MonoLMF, previous_lmf), prev_lmf_reg);
+ /* Set new lmf */
+ EMIT_NEW_STORE_MEMBASE (cfg, ins, OP_STORE_MEMBASE_REG, cfg->lmf_addr_var->dreg, 0, lmf_reg);
}
/*
EMIT_NEW_VARLOADA (cfg, ins, cfg->lmf_var, NULL);
lmf_reg = ins->dreg;
- if (cfg->lmf_ir_mono_lmf) {
- /* Load previous_lmf */
- EMIT_NEW_LOAD_MEMBASE (cfg, ins, OP_LOAD_MEMBASE, alloc_preg (cfg), lmf_reg, MONO_STRUCT_OFFSET (MonoLMF, previous_lmf));
- /* Set new LMF */
- mono_create_tls_set (cfg, ins, TLS_KEY_LMF);
- } else {
- int prev_lmf_reg;
- /*
- * Emit IR to pop the LMF:
- * *(lmf->lmf_addr) = lmf->prev_lmf
- */
- /* This could be called before emit_push_lmf () */
- if (!cfg->lmf_addr_var)
- cfg->lmf_addr_var = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_LOCAL);
- lmf_addr_reg = cfg->lmf_addr_var->dreg;
+ int prev_lmf_reg;
+ /*
+ * Emit IR to pop the LMF:
+ * *(lmf->lmf_addr) = lmf->prev_lmf
+ */
+ /* This could be called before emit_push_lmf () */
+ if (!cfg->lmf_addr_var)
+ cfg->lmf_addr_var = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_LOCAL);
+ lmf_addr_reg = cfg->lmf_addr_var->dreg;
- prev_lmf_reg = alloc_preg (cfg);
- EMIT_NEW_LOAD_MEMBASE (cfg, ins, OP_LOAD_MEMBASE, prev_lmf_reg, lmf_reg, MONO_STRUCT_OFFSET (MonoLMF, previous_lmf));
- EMIT_NEW_STORE_MEMBASE (cfg, ins, OP_STORE_MEMBASE_REG, lmf_addr_reg, 0, prev_lmf_reg);
- }
+ prev_lmf_reg = alloc_preg (cfg);
+ EMIT_NEW_LOAD_MEMBASE (cfg, ins, OP_LOAD_MEMBASE, prev_lmf_reg, lmf_reg, MONO_STRUCT_OFFSET (MonoLMF, previous_lmf));
+ EMIT_NEW_STORE_MEMBASE (cfg, ins, OP_STORE_MEMBASE_REG, lmf_addr_reg, 0, prev_lmf_reg);
}
static void
static gboolean
direct_icalls_enabled (MonoCompile *cfg)
{
+ return FALSE;
+
/* LLVM on amd64 can't handle calls to non-32 bit addresses */
#ifdef TARGET_AMD64
if (cfg->compile_llvm && !cfg->llvm_only)
if (cfg->method->save_lmf) {
cfg->lmf_ir = TRUE;
-#if !defined(TARGET_WIN32)
- if (!optimize_for_xen)
- cfg->lmf_ir_mono_lmf = TRUE;
-#endif
}
}
// instead of RtlInstallFunctionTableCallback. This gives us the benefit to
// include all needed unwind upon registration.
typedef DWORD (NTAPI* RtlAddGrowableFunctionTablePtr)(
- _Out_ PVOID * DynamicTable,
- _In_reads_(MaximumEntryCount) PRUNTIME_FUNCTION FunctionTable,
- _In_ DWORD EntryCount,
- _In_ DWORD MaximumEntryCount,
- _In_ ULONG_PTR RangeBase,
- _In_ ULONG_PTR RangeEnd);
+ PVOID * DynamicTable,
+ PRUNTIME_FUNCTION FunctionTable,
+ DWORD EntryCount,
+ DWORD MaximumEntryCount,
+ ULONG_PTR RangeBase,
+ ULONG_PTR RangeEnd);
typedef VOID (NTAPI* RtlGrowFunctionTablePtr)(
- _Inout_ PVOID DynamicTable,
- _In_ DWORD NewEntryCount);
+ PVOID DynamicTable,
+ DWORD NewEntryCount);
typedef VOID (NTAPI* RtlDeleteGrowableFunctionTablePtr)(
- _In_ PVOID DynamicTable);
+ PVOID DynamicTable);
#endif /* HOST_WIN32 */
#define MONO_ARCH_EMULATE_CONV_R8_UN 1
#define MONO_ARCH_EMULATE_FREM 1
#define MONO_ARCH_HAVE_IS_INT_OVERFLOW 1
-
-#ifndef HOST_WIN32
-#define MONO_ARCH_ENABLE_MONO_LMF_VAR 1
-#endif
#define MONO_ARCH_HAVE_INVALIDATE_METHOD 1
#define MONO_ARCH_HAVE_FULL_AOT_TRAMPOLINES 1
#define MONO_ARCH_IMT_REG AMD64_R10
if (cfg->method->save_lmf) {
cfg->create_lmf_var = TRUE;
cfg->lmf_ir = TRUE;
-#ifdef HAVE_GET_TLS_ADDR
- cfg->lmf_ir_mono_lmf = TRUE;
-#endif
}
}
#define MONO_ARCH_HAVE_SETUP_RESUME_FROM_SIGNAL_HANDLER_CTX 1
#define MONO_ARCH_HAVE_SETUP_ASYNC_CALLBACK 1
#define MONO_ARCH_HAVE_GENERAL_RGCTX_LAZY_FETCH_TRAMPOLINE 1
-#ifndef MONO_CROSS_COMPILE
-#define MONO_ARCH_ENABLE_MONO_LMF_VAR 1
-#endif
#define MONO_ARCH_HAVE_OP_GET_EX_OBJ 1
#define MONO_ARCH_HAVE_OBJC_GET_SELECTOR 1
#define MONO_ARCH_HAVE_SDB_TRAMPOLINES 1
MINI_OP(OP_PMULW, "pmulw", XREG, XREG, XREG)
MINI_OP(OP_PMULD, "pmuld", XREG, XREG, XREG)
+/* Multiplies two 32 bit numbers into a 64 bit one */
MINI_OP(OP_PMULQ, "pmulq", XREG, XREG, XREG)
MINI_OP(OP_PMULW_HIGH_UN, "pmul_high_un", XREG, XREG, XREG)
MonoLMF *
mono_get_lmf (void)
{
-#if defined(MONO_ARCH_ENABLE_MONO_LMF_VAR) && defined(HAVE_GET_TLS_ADDR)
- return (MonoLMF *)mono_tls_get_lmf ();
-#else
MonoJitTlsData *jit_tls;
if ((jit_tls = mono_tls_get_jit_tls ()))
* (the thread object allocation can trigger a collection).
*/
return NULL;
-#endif
}
MonoLMF **
void
mono_set_lmf (MonoLMF *lmf)
{
-#if defined(MONO_ARCH_ENABLE_MONO_LMF_VAR) && defined(HAVE_GET_TLS_ADDR)
- mono_tls_set_lmf (lmf);
-#else
(*mono_get_lmf_addr ()) = lmf;
-#endif
}
MonoJitTlsData*
jit_tls->first_lmf = lmf;
- /*
- * We can have 2 configurations for accessing lmf.
- * We can use only the tls_lmf_addr variable, which will store the address of
- * jit_tls->lmf, or, if we have MONO_ARCH_ENABLE_MONO_LMF_VAR enabled, we can
- * use both tls_lmf_addr and tls_lmf variables (in this case we need to have
- * means of getting the address of a tls variable; this can be done always
- * when using __thread or, on osx, even when using pthread)
- */
-#if defined(MONO_ARCH_ENABLE_MONO_LMF_VAR) && defined(HAVE_GET_TLS_ADDR)
- /* jit_tls->lmf is unused */
- mono_tls_set_lmf (lmf);
- mono_set_lmf_addr (mono_tls_get_tls_addr (TLS_KEY_LMF));
-#else
mono_set_lmf_addr (&jit_tls->lmf);
jit_tls->lmf = lmf;
-#endif
#ifdef MONO_ARCH_HAVE_TLS_INIT
mono_arch_tls_init ();
register_icall (mono_threads_state_poll, "mono_threads_state_poll", "void", FALSE);
#ifndef MONO_ARCH_NO_EMULATE_LONG_MUL_OPTS
- register_opcode_emulation (OP_LMUL, "__emul_lmul", "long long long", mono_llmult, "mono_llmult", TRUE);
+ register_opcode_emulation (OP_LMUL, "__emul_lmul", "long long long", mono_llmult, "mono_llmult", FALSE);
register_opcode_emulation (OP_LDIV, "__emul_ldiv", "long long long", mono_lldiv, "mono_lldiv", FALSE);
register_opcode_emulation (OP_LDIV_UN, "__emul_ldiv_un", "long long long", mono_lldiv_un, "mono_lldiv_un", FALSE);
register_opcode_emulation (OP_LREM, "__emul_lrem", "long long long", mono_llrem, "mono_llrem", FALSE);
register_icall_no_wrapper (mono_tls_get_thread, "mono_tls_get_thread", "ptr");
register_icall_no_wrapper (mono_tls_get_jit_tls, "mono_tls_get_jit_tls", "ptr");
register_icall_no_wrapper (mono_tls_get_domain, "mono_tls_get_domain", "ptr");
- register_icall_no_wrapper (mono_tls_get_lmf, "mono_tls_get_lmf", "ptr");
register_icall_no_wrapper (mono_tls_get_sgen_thread_info, "mono_tls_get_sgen_thread_info", "ptr");
register_icall_no_wrapper (mono_tls_get_lmf_addr, "mono_tls_get_lmf_addr", "ptr");
register_icall_no_wrapper (mono_tls_set_thread, "mono_tls_set_thread", "void ptr");
register_icall_no_wrapper (mono_tls_set_jit_tls, "mono_tls_set_jit_tls", "void ptr");
register_icall_no_wrapper (mono_tls_set_domain, "mono_tls_set_domain", "void ptr");
- register_icall_no_wrapper (mono_tls_set_lmf, "mono_tls_set_lmf", "void ptr");
register_icall_no_wrapper (mono_tls_set_sgen_thread_info, "mono_tls_set_sgen_thread_info", "void ptr");
register_icall_no_wrapper (mono_tls_set_lmf_addr, "mono_tls_set_lmf_addr", "void ptr");
}
#define MONO_ARCH_NEED_DIV_CHECK 1
#define MONO_ARCH_SIGNAL_STACK_SIZE 256*1024
#define MONO_ARCH_HAVE_DECOMPOSE_OPTS 1
-#define MONO_ARCH_ENABLE_MONO_LMF_VAR 1
#define MONO_ARCH_IMT_REG s390_r9
#define MONO_ARCH_VTABLE_REG S390_FIRST_ARG_REG
#define MONO_ARCH_RGCTX_REG MONO_ARCH_IMT_REG
if (cfg->method->save_lmf) {
cfg->create_lmf_var = TRUE;
cfg->lmf_ir = TRUE;
-#ifndef HOST_WIN32
- cfg->lmf_ir_mono_lmf = TRUE;
-#endif
}
cfg->arch_eh_jit_info = 1;
/* check if we need to restore protection of the stack after a stack overflow */
if (!cfg->compile_aot && mono_arch_have_fast_tls () && mono_tls_get_tls_offset (TLS_KEY_JIT_TLS) != -1) {
code = mono_x86_emit_tls_get (code, X86_ECX, mono_tls_get_tls_offset (TLS_KEY_JIT_TLS));
- } else {
- gpointer func = mono_tls_get_tls_getter (TLS_KEY_JIT_TLS, TRUE);
- /* FIXME use tls only from IR level */
- x86_xchg_reg_reg (code, X86_EAX, X86_ECX, 4);
- code = emit_call (cfg, code, MONO_PATCH_INFO_INTERNAL_METHOD, func);
- x86_xchg_reg_reg (code, X86_EAX, X86_ECX, 4);
- }
- /* we load the value in a separate instruction: this mechanism may be
- * used later as a safer way to do thread interruption
- */
- x86_mov_reg_membase (code, X86_ECX, X86_ECX, MONO_STRUCT_OFFSET (MonoJitTlsData, restore_stack_prot), 4);
- x86_alu_reg_imm (code, X86_CMP, X86_ECX, 0);
- patch = code;
- x86_branch8 (code, X86_CC_Z, 0, FALSE);
- /* note that the call trampoline will preserve eax/edx */
- x86_call_reg (code, X86_ECX);
- x86_patch (patch, code);
+ /* we load the value in a separate instruction: this mechanism may be
+ * used later as a safer way to do thread interruption
+ */
+ x86_mov_reg_membase (code, X86_ECX, X86_ECX, MONO_STRUCT_OFFSET (MonoJitTlsData, restore_stack_prot), 4);
+ x86_alu_reg_imm (code, X86_CMP, X86_ECX, 0);
+ patch = code;
+ x86_branch8 (code, X86_CC_Z, 0, FALSE);
+ /* note that the call trampoline will preserve eax/edx */
+ x86_call_reg (code, X86_ECX);
+ x86_patch (patch, code);
+ }
/* restore caller saved regs */
if (cfg->used_int_regs & (1 << X86_EBX)) {
#define MONO_ARCH_HAVE_IS_INT_OVERFLOW 1
#define MONO_ARCH_HAVE_INVALIDATE_METHOD 1
#define MONO_ARCH_NEED_GOT_VAR 1
-#ifndef HOST_WIN32
-/* X86 uses jit_tls->lmf (See emit_push_lmf ()) */
-#define MONO_ARCH_ENABLE_MONO_LMF_VAR 1
-#endif
#define MONO_ARCH_IMT_REG X86_EDX
#define MONO_ARCH_VTABLE_REG X86_EDX
#define MONO_ARCH_RGCTX_REG MONO_ARCH_IMT_REG
typedef struct {
gpointer end_of_stack;
guint32 stack_size;
- /* !defined(HAVE_KW_THREAD) || !defined(MONO_ARCH_ENABLE_MONO_LMF_VAR) */
MonoLMF *lmf;
MonoLMF *first_lmf;
gpointer restore_stack_prot;
* Whenever to use the mono_lmf TLS variable instead of indirection through the
* mono_lmf_addr TLS variable.
*/
- guint lmf_ir_mono_lmf : 1;
guint gen_write_barriers : 1;
guint init_ref_vars : 1;
guint extend_live_ranges : 1;
case MONO_TYPE_U4:
case MONO_TYPE_I4:
return OP_PMULD;
- case MONO_TYPE_U8:
- case MONO_TYPE_I8:
- return OP_PMULQ;
case MONO_TYPE_R4:
return OP_MULPS;
case MONO_TYPE_R8:
return OP_MULPD;
+ case MONO_TYPE_U8:
+ /* PMULQ multiplies two 32 bit numbers into a 64 bit one */
+ return -1;
+ case MONO_TYPE_I8:
+ return -1;
default:
break;
}
{
const SimdIntrinsic *intrins;
MonoMethodSignature *sig = mono_method_signature (cmethod);
+ MonoType *type = &cmethod->klass->byval_arg;
/*
* Vector2/3/4 are handled the same way, since the underlying SIMD type is the same (4 * r4).
}
switch (intrins->name) {
- case SN_ctor:
+ case SN_ctor: {
+ gboolean match = TRUE;
+ for (int i = 0; i < fsig->param_count; ++i)
+ if (fsig->params [i]->type != MONO_TYPE_R4)
+ match = FALSE;
+ if (!match)
+ break;
return simd_intrinsic_emit_ctor (intrins, cfg, cmethod, args);
- break;
+ }
case SN_Equals:
+ if (!(fsig->param_count == 1 && fsig->ret->type == MONO_TYPE_BOOLEAN && fsig->params [0] == type))
+ break;
return simd_intrinsic_emit_equality (intrins, cfg, cmethod, args);
- break;
case SN_SquareRoot:
+ if (!(fsig->param_count == 1 && fsig->ret == type && fsig->params [0] == type))
+ break;
return simd_intrinsic_emit_unary (intrins, cfg, cmethod, args);
- break;
case SN_Dot:
+ if (!(fsig->param_count == 2 && fsig->ret->type == MONO_TYPE_R4 && fsig->params [0] == type && fsig->params [1] == type))
+ break;
if (COMPILE_LLVM (cfg)) {
MonoInst *ins;
MonoInst *sub;
MonoInst *zero;
+ if (!(fsig->param_count == 1 && fsig->ret == type && fsig->params [0] == type))
+ break;
+
MONO_INST_NEW (cfg, zero, OP_XZERO);
zero->dreg = alloc_xreg (cfg);
zero->klass = cmethod->klass;
case SN_op_Division:
case SN_op_Multiply:
case SN_op_Subtraction:
+ if (!(fsig->param_count == 2 && fsig->ret == type && (fsig->params [0] == type || fsig->params [0]->type == MONO_TYPE_R4) && (fsig->params [1] == type || fsig->params [1]->type == MONO_TYPE_R4)))
+ break;
return simd_intrinsic_emit_binary (intrins, cfg, cmethod, args);
default:
break;
}
+ if (cfg->verbose_level > 1) {
+ char *name = mono_method_full_name (cmethod, TRUE);
+ printf (" SIMD method %s not handled.\n", name);
+ g_free (name);
+ }
return NULL;
}
emit_vector_t_intrinsics (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoInst **args)
{
const SimdIntrinsic *intrins;
- MonoType *etype;
+ MonoType *type, *etype;
MonoInst *ins;
int size, len, index;
return NULL;
}
+ type = &cmethod->klass->byval_arg;
etype = mono_class_get_context (cmethod->klass)->class_inst->type_argv [0];
size = mono_class_value_size (mono_class_from_mono_type (etype), NULL);
g_assert (size);
switch (intrins->name) {
case SN_get_Count:
+ if (!(fsig->param_count == 0 && fsig->ret->type == MONO_TYPE_I4))
+ break;
EMIT_NEW_ICONST (cfg, ins, len);
return ins;
case SN_get_AllOnes:
case SN_get_Zero:
+ if (!(fsig->param_count == 0 && mono_metadata_type_equal (fsig->ret, type)))
+ break;
return simd_intrinsic_emit_const (intrins, cfg, cmethod, args);
case SN_get_Item:
g_assert (fsig->param_count == 1);
case SN_op_Explicit:
return simd_intrinsic_emit_cast (intrins, cfg, cmethod, args);
case SN_Equals:
- if (fsig->param_count == 1)
+ if (fsig->param_count == 1 && fsig->ret->type == MONO_TYPE_BOOLEAN && mono_metadata_type_equal (fsig->params [0], type))
return simd_intrinsic_emit_equality_op (cfg, cmethod, args, type_to_comp_op (etype), SIMD_COMP_EQ);
- if (fsig->param_count == 2)
+ if (fsig->param_count == 2 && fsig->ret->type == MONO_TYPE_BOOLEAN && mono_metadata_type_equal (fsig->params [0], type) && mono_metadata_type_equal (fsig->params [1], type))
return simd_intrinsic_emit_binary_op (cfg, type_to_comp_op (etype), 0, cmethod->klass, fsig->params [0], fsig->params [1], args [0], args [1]);
break;
switch (intrins->name) {
case SN_GreaterThan:
return simd_intrinsic_emit_binary_op (cfg, gt_op, 0, cmethod->klass, fsig->params [0], fsig->params [1], args [0], args [1]);
- case SN_LessThanOrEqual:
+ case SN_LessThan:
return simd_intrinsic_emit_binary_op (cfg, gt_op, 0, cmethod->klass, fsig->params [0], fsig->params [1], args [1], args [0]);
+ case SN_LessThanOrEqual:
+ cmp1 = simd_intrinsic_emit_binary_op (cfg, eq_op, 0, cmethod->klass, fsig->params [0], fsig->params [1], args [1], args [0]);
+ cmp2 = simd_intrinsic_emit_binary_op (cfg, gt_op, 0, cmethod->klass, fsig->params [0], fsig->params [1], args [1], args [0]);
+ return simd_intrinsic_emit_binary_op (cfg, OP_POR, 0, cmethod->klass, fsig->params [0], fsig->params [1], cmp1, cmp2);
case SN_GreaterThanOrEqual:
cmp1 = simd_intrinsic_emit_binary_op (cfg, eq_op, 0, cmethod->klass, fsig->params [0], fsig->params [1], args [0], args [1]);
cmp2 = simd_intrinsic_emit_binary_op (cfg, gt_op, 0, cmethod->klass, fsig->params [0], fsig->params [1], args [0], args [1]);
return simd_intrinsic_emit_binary_op (cfg, OP_POR, 0, cmethod->klass, fsig->params [0], fsig->params [1], cmp1, cmp2);
- case SN_LessThan:
- cmp1 = simd_intrinsic_emit_binary_op (cfg, eq_op, 0, cmethod->klass, fsig->params [0], fsig->params [1], args [1], args [0]);
- cmp2 = simd_intrinsic_emit_binary_op (cfg, gt_op, 0, cmethod->klass, fsig->params [0], fsig->params [1], args [1], args [0]);
- return simd_intrinsic_emit_binary_op (cfg, OP_POR, 0, cmethod->klass, fsig->params [0], fsig->params [1], cmp1, cmp2);
default:
g_assert_not_reached ();
break;
break;
}
break;
- case SN_op_Addition: {
- int op = type_to_padd_op (etype);
- if (op != -1)
- return simd_intrinsic_emit_binary_op (cfg, op, 0, cmethod->klass, fsig->params [0], fsig->params [0], args [0], args [1]);
- break;
- }
- case SN_op_Subtraction: {
- int op = type_to_psub_op (etype);
- if (op != -1)
- return simd_intrinsic_emit_binary_op (cfg, op, 0, cmethod->klass, fsig->params [0], fsig->params [0], args [0], args [1]);
- break;
- }
- case SN_op_Multiply: {
- int op = type_to_pmul_op (etype);
- if (op != -1)
- return simd_intrinsic_emit_binary_op (cfg, op, 0, cmethod->klass, fsig->params [0], fsig->params [0], args [0], args [1]);
- break;
- }
- case SN_op_Division: {
- int op = type_to_pdiv_op (etype);
+ case SN_op_Addition:
+ case SN_op_Subtraction:
+ case SN_op_Multiply:
+ case SN_op_Division: {
+ if (!(fsig->param_count == 2 && mono_metadata_type_equal (fsig->ret, fsig->params [0]) && mono_metadata_type_equal (fsig->params [0], fsig->params [1])))
+ break;
+ int op = 0;
+ switch (intrins->name) {
+ case SN_op_Addition:
+ op = type_to_padd_op (etype);
+ break;
+ case SN_op_Subtraction:
+ op = type_to_psub_op (etype);
+ break;
+ case SN_op_Multiply:
+ op = type_to_pmul_op (etype);
+ break;
+ case SN_op_Division:
+ op = type_to_pdiv_op (etype);
+ break;
+ default:
+ g_assert_not_reached ();
+ }
if (op != -1)
return simd_intrinsic_emit_binary_op (cfg, op, 0, cmethod->klass, fsig->params [0], fsig->params [0], args [0], args [1]);
break;
break;
}
+ if (cfg->verbose_level > 1) {
+ char *name = mono_method_full_name (cmethod, TRUE);
+ printf (" SIMD method %s not handled.\n", name);
+ g_free (name);
+ }
+
return NULL;
}
-SUBDIRS = assemblyresolve gc-descriptors
+SUBDIRS = assemblyresolve gc-descriptors . testing_gac
if FULL_AOT_TESTS
FEATUREFUL_RUNTIME_TEST =
endif
check-local: assemblyresolve/test/asm.dll testjit test-generic-sharing test-type-load test-multi-netmodule test-cattr-type-load test-reflection-load-with-context test_platform \
- test-console-output test-messages test-env-options test-unhandled-exception-2 $(FEATUREFUL_RUNTIME_TEST) test-process-stress test-pedump rm-empty-logs
+ test-console-output test-env-options test-unhandled-exception-2 $(FEATUREFUL_RUNTIME_TEST) test-process-stress test-pedump rm-empty-logs runtest-gac-loading
check-full: test-sgen check-local
check-parallel: compile-tests check-full
aotcheck: testaot gshared-aot
-TEST_PROG = ../interpreter/mint
-
JITTEST_PROG = $(if $(VALGRIND), valgrind $(VALGRIND_ARGS),) $(if $(SGEN),$(top_builddir)/mono/mini/mono-sgen,$(top_builddir)/mono/mini/mono)
-TEST_PROG_RUN = MONO_CFG_DIR=$(mono_build_root)/runtime/etc $(LIBTOOL) --mode=execute $(TEST_PROG)
JITTEST_PROG_RUN = MONO_CFG_DIR=$(mono_build_root)/runtime/etc $(LIBTOOL) --mode=execute $(JITTEST_PROG)
+
RUNTIME_ARGS=--config tests-config --optimize=all --debug
if HOST_WIN32
thread6.cs \
appdomain-threadpool-unload.cs \
process-unref-race.cs \
- bug-46661.cs
+ bug-46661.cs \
+ w32message.cs
TEST_CS_SRC_DIST= \
$(BASE_TEST_CS_SRC) \
if AMD64
# #651684
PLATFORM_DISABLED_TESTS = finally_guard.exe
+
+if HOST_WIN32
+PLATFORM_DISABLED_TESTS += w32message.exe
+endif
+
endif
if IA64
if HOST_WIN32
PLATFORM_DISABLED_TESTS=async-exc-compilation.exe finally_guard.exe finally_block_ending_in_dead_bb.exe \
- bug-18026.exe monitor.exe threadpool-exceptions5.exe process-unref-race.exe
+ bug-18026.exe monitor.exe threadpool-exceptions5.exe process-unref-race.exe w32message.exe
endif
endif
threadpool-exceptions5.exe \
threadpool-exceptions6.exe
+PLATFORM_DISABLED_TESTS+= w32message.exe
+
# Tests that rely on AppDomain.Unload
PLATFORM_DISABLED_TESTS+= appdomain-async-invoke.exe \
appdomain-exit.exe \
# bug-Xamarin-5278.exe got broken by 5d26590e79da139a284459299aee95c25f4cd835
# bug-45841-fpstack-exceptions.exe: https://bugzilla.xamarin.com/show_bug.cgi?id=47053
# appdomain-thread-abort.exe: https://bugzilla.xamarin.com/show_bug.cgi?id=47054
-DISABLED_TESTS= \
+KNOWN_FAILING_TESTS = \
delegate-async-exception.exe \
bug-348522.2.exe \
bug-459094.exe \
delegate-invoke.exe \
bug-Xamarin-5278.exe \
bug-45841-fpstack-exceptions.exe \
- appdomain-thread-abort.exe \
+ appdomain-thread-abort.exe
+
+DISABLED_TESTS = \
+ $(KNOWN_FAILING_TESTS) \
$(PLATFORM_DISABLED_TESTS) \
$(EXTRA_DISABLED_TESTS) \
$(COOP_DISABLED_TESTS) \
$(if $(CI_PR),$CI_PR_DISABLED_TESTS) \
$(if $(LLVM),$(LLVM_DISABLED_TESTS))
+INTERP_DISABLED_TESTS = \
+ $(CI_PR_DISABLED_TESTS) \
+ $(CI_DISABLED_TESTS) \
+ $(KNOWN_FAILING_TESTS) \
+ abort-cctor.exe \
+ appdomain-async-invoke.exe \
+ appdomain-exit.exe \
+ appdomain-unload-callback.exe \
+ appdomain-unload-doesnot-raise-pending-events.exe \
+ appdomain-unload.exe \
+ appdomain.exe \
+ appdomain1.exe \
+ appdomain2.exe \
+ array_load_exception.exe \
+ assembly_append_ordering.exe \
+ assemblyresolve_event4.exe \
+ async-exc-compilation.exe \
+ async-with-cb-throws.exe \
+ async_read.exe \
+ bug-10127.exe \
+ bug-18026.exe \
+ bug-27147.exe \
+ bug-2907.exe \
+ bug-323114.exe \
+ bug-327438.2.exe \
+ bug-335131.2.exe \
+ bug-349190.2.exe \
+ bug-415577.exe \
+ bug-461867.exe \
+ bug-461941.exe \
+ bug-46661.exe \
+ bug-47295.exe \
+ bug-48015.exe \
+ bug-508538.exe \
+ bug-544446.exe \
+ bug-685908.exe \
+ bug-70561.exe \
+ bug-78549.exe \
+ bug-80307.exe \
+ bug-80392.2.exe \
+ bug-81673.exe \
+ bug-81691.exe \
+ bug-82022.exe \
+ bug445361.exe \
+ bug469742.2.exe \
+ call_missing_class.exe \
+ call_missing_method.exe \
+ calliGenericTest.exe \
+ cattr-field.exe \
+ classinit3.exe \
+ cominterop.exe \
+ constant-division.exe \
+ context-static.exe \
+ cross-domain.exe \
+ delegate-async-exit.exe \
+ delegate-delegate-exit.exe \
+ delegate-exit.exe \
+ delegate-with-null-target.exe \
+ delegate.exe \
+ delegate1.exe \
+ delegate3.exe \
+ delegate5.exe \
+ delegate7.exe \
+ delegate8.exe \
+ delegate9.exe \
+ dynamic-method-access.2.exe \
+ dynamic-method-finalize.2.exe \
+ dynamic-method-resurrection.exe \
+ dynamic-method-stack-traces.exe \
+ enum.exe \
+ even-odd.exe \
+ exception18.exe \
+ field-access.exe \
+ finally_block_ending_in_dead_bb.exe \
+ gc-altstack.exe \
+ gchandles.exe \
+ generic-marshalbyref.2.exe \
+ generic-mkrefany.2.exe \
+ generic-refanyval.2.exe \
+ generic-stack-traces2.2.exe \
+ generic-type-load-exception.2.exe \
+ generic-unloading.2.exe \
+ generics-invoke-byref.2.exe \
+ generics-sharing.2.exe \
+ handleref.exe \
+ invalid-token.exe \
+ invalid_generic_instantiation.exe \
+ invoke-string-ctors.exe \
+ invoke.exe \
+ ldfld_missing_class.exe \
+ ldfld_missing_field.exe \
+ ldftn-access.exe \
+ loader.exe \
+ marshal-valuetypes.exe \
+ marshal.exe \
+ marshal2.exe \
+ marshal8.exe \
+ marshal9.exe \
+ marshalbool.exe \
+ main-returns-background-change.exe \
+ method-access.exe \
+ modules.exe \
+ monitor-abort.exe \
+ monitor-wait-abort.exe \
+ monitor.exe \
+ namedmutex-destroy-race.exe \
+ nullable_boxing.2.exe \
+ pinvoke-2.2.exe \
+ pinvoke-utf8.exe \
+ pinvoke.exe \
+ pinvoke11.exe \
+ pinvoke17.exe \
+ pinvoke2.exe \
+ pinvoke3.exe \
+ pinvoke_ppcc.exe \
+ pinvoke_ppcd.exe \
+ pinvoke_ppcf.exe \
+ pinvoke_ppci.exe \
+ pinvoke_ppcs.exe \
+ priority.exe \
+ process-unref-race.exe \
+ reference-loader.exe \
+ reload-at-bb-end.exe \
+ remoting1.exe \
+ remoting2.exe \
+ remoting3.exe \
+ remoting4.exe \
+ remoting5.exe \
+ runtime-invoke.exe \
+ runtime-invoke.gen.exe \
+ safehandle.2.exe \
+ shared-generic-synchronized.2.exe \
+ sleep.exe \
+ stackframes-async.2.exe \
+ static-constructor.exe \
+ test-inline-call-stack.exe \
+ test-tls.exe \
+ test-type-ctor.exe \
+ thread-exit.exe \
+ thread6.exe \
+ threadpool-exceptions1.exe \
+ threadpool-exceptions2.exe \
+ threadpool-exceptions3.exe \
+ threadpool-exceptions4.exe \
+ threadpool-exceptions5.exe \
+ threadpool-exceptions6.exe \
+ threadpool-exceptions7.exe \
+ threadpool.exe \
+ threadpool1.exe \
+ thunks.exe \
+ transparentproxy.exe \
+ typeload-unaligned.exe \
+ unload-appdomain-on-shutdown.exe \
+ vararg.exe \
+ vararg.exe \
+ vararg2.exe \
+ vt-sync-method.exe \
+ winx64structs.exe \
+ xdomain-threads.exe
+
# pre-requisite test sources: files that are not test themselves
# but that need to be compiled
PREREQ_IL_SRC=event-il.il module-cctor.il
@if which nm > /dev/null; then if nm $(top_builddir)/mono/mini/mono | grep -v $(OK_G_SYMBOLS) | grep 't g_'; then exit 1; else exit 0; fi; fi
endif
-#
-# Tests that the internals in mono/io-layer/messages.c are ok by triggering the
-# code that checks that the table is properly sorted
-#
-if NACL_CODEGEN
-test-messages:
-else
-if HOST_WIN32
-test-messages:
-else
-test-messages: w32message.exe
- > test_messages.zero
- $(with_mono_path) $(JITTEST_PROG_RUN) w32message.exe > w32message.allout 2>&1 && cmp test_messages.zero w32message.allout
-endif
-endif
-
test-env-options:
MONO_ENV_OPTIONS="--version" $(RUNTIME) array-init.exe | grep -q Architecture:
# Precompile the test assemblies in parallel
compile-tests:
- $(MAKE) -j4 $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS)
+ $(MAKE) -j4 $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS) compile-gac-loading
if FULL_AOT_TESTS
$(MAKE) $(PREREQSI_IL_AOT) $(PREREQSI_CS_AOT) $(AOT_EXTRA_LIBS)
endif
TestDriver.dll:
$(MCS) -target:library -out:$@ $(srcdir)/../mini/TestDriver.cs $(srcdir)/../mini/TestHelpers.cs
-test_cs: $(TEST_PROG) $(TESTSI_CS) libtest.la
- @failed=0; \
- passed=0; \
- if [ "x$$V" = "x1" ]; then dump_action="dump-output"; else dump_action="no-dump"; fi; \
- for i in $(TESTSI_CS); do \
- if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" "$${dump_action}" $(RUNTIME_ARGS); \
- then \
- passed=`expr $${passed} + 1`; \
- else \
- if [ $$? = 2 ]; then break; fi; \
- failed=`expr $${failed} + 1`; \
- fi \
- done; \
- echo; echo ".cs: $${passed} test(s) passed. $${failed} test(s) did not pass."; echo
-
-test_il: $(TEST_PROG) $(TESTSI_IL) libtest.la
- @failed=0; \
- passed=0; \
- if [ "x$$V" = "x1" ]; then dump_action="dump-output"; else dump_action="no-dump"; fi; \
- for i in $(TESTSI_IL); do \
- if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" "$${dump_action}" $(RUNTIME_ARGS); \
- then \
- passed=`expr $${passed} + 1`; \
- else \
- if [ $$? = 2 ]; then break; fi; \
- failed=`expr $${failed} + 1`; \
- fi \
- done; \
- echo; echo ".il: $${passed} test(s) passed. $${failed} test(s) did not pass."; echo
-
-testb: $(TEST_PROG) $(TESTBS)
- if [ "x$$V" = "x1" ]; then dump_action="dump-output"; else dump_action="no-dump"; fi; \
- for i in $(TESTBS); do \
- $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" "$${dump_action}" $(RUNTIME_ARGS); \
- done
-
runtest: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS)
@failed=0; \
passed=0; \
testtrace:
@$(MAKE) RUNTIME_ARGS="$${RUNTIME_ARGS} --trace" runtest
-testinterp:
- @$(MAKE) JITTEST_PROG_RUN="$(TEST_PROG_RUN)" runtest
+testinterp: test-runner.exe $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la $(PREREQSI_IL) $(PREREQSI_CS)
+ $(TOOLS_RUNTIME) --debug $(TEST_RUNNER) $(TEST_RUNNER_ARGS) -j a --runtime-args "--interpreter" --testsuite-name "runtime-interp" --timeout 300 --disabled "$(INTERP_DISABLED_TESTS)" $(TESTSI_CS) $(TESTBS) $(TESTSI_IL)
testjitspeed: $(JITTEST_PROG) $(TESTBS)
for i in $(TESTBS); do \
bug-17537-helper.exe: bug-17537-helper.cs
$(MCS) -out:$@ $(srcdir)/bug-17537-helper.cs
chmod -x $@
+if FULL_AOT_TESTS
+ $(RUNTIME) $(AOT_BUILD_FLAGS) $@
+endif
+if HYBRID_AOT_TESTS
+ $(RUNTIME) $(AOT_BUILD_FLAGS) $@
+endif
bug-17537.exe: bug-17537.cs bug-17537-helper.exe
- $(MCS) -r:System.dll -out:$@ $(srcdir)/bug-17537.cs
+ $(MCS) -r:$(CLASS)/System.dll -out:$@ $(srcdir)/bug-17537.cs
EXTRA_DIST += coreclr-security.cs
$(MCS) -r:generic-delegate2-lib.2.dll -out:$@ $(srcdir)/generic-delegate2.2.cs
bug-3903.exe: bug-3903.cs
- $(MCS_NO_LIB) $(srcdir)/bug-3903.cs -r:$(srcdir)/../../external/binary-reference-assemblies/v2.0/System.Core.dll -out:$@
+ $(MCS_NO_LIB) $(srcdir)/bug-3903.cs -nostdlib -r:$(srcdir)/../../external/binary-reference-assemblies/v2.0/mscorlib.dll -r:$(srcdir)/../../external/binary-reference-assemblies/v2.0/System.Core.dll -out:$@
gshared: test-generic-sharing
test-pedump: test-runner.exe
$(with_mono_path) $(mono_build_root)/tools/pedump/pedump --verify error test-runner.exe
+.PHONY: test-gac-loading
+
+runtest-gac-loading: test-runner.exe
+ $(MAKE) -C testing_gac runtest
+
+compile-gac-loading:
+ $(MAKE) -C testing_gac compile-tests
+
PROCESS_STRESS_TESTS= \
process-stress-1.exe \
process-stress-2.exe \
static void ProbeCorlib ()
{
- Type good = System.Type.GetType("System.Nullable`1[[System.Int32, mscorlib]]");
- Type bad = System.Type.GetType("System.Nullable`1[[System.IO.MemoryMappedFiles.MemoryMappedFile, System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]");
+ Type good = System.Type.GetType("System.Nullable`1[[System.Int32, mscorlib]]");
+#if MOBILE
+ string pubKeyToken = "7cec85d7bea7798e";
+#else
+ string pubKeyToken = "b77a5c561934e089";
+#endif
+ string t = String.Format ("System.Nullable`1[[System.IO.MemoryMappedFiles.MemoryMappedFile, System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken={0}]]", pubKeyToken);
+ Type bad = System.Type.GetType(t);
if (good.Assembly.FullName.Split (',') [0] != "mscorlib")
throw new Exception ("Wrong assembly name");
const string TEST_TIME_FORMAT = "mm\\:ss\\.fff";
const string ENV_TIMEOUT = "TEST_DRIVER_TIMEOUT_SEC";
const string MONO_PATH = "MONO_PATH";
+ const string MONO_GAC_PREFIX = "MONO_GAC_PREFIX";
class ProcessData {
public string test;
string runtime = "mono";
string config = null;
string mono_path = null;
+ string runtime_args = null;
+ string mono_gac_prefix = null;
var opt_sets = new List<string> ();
string aot_run_flags = null;
}
runtime = args [i + 1];
i += 2;
+ } else if (args [i] == "--runtime-args") {
+ if (i + 1 >= args.Length) {
+ Console.WriteLine ("Missing argument to --runtime-args command line option.");
+ return 1;
+ }
+ runtime_args = args [i + 1];
+ i += 2;
} else if (args [i] == "--config") {
if (i + 1 >= args.Length) {
Console.WriteLine ("Missing argument to --config command line option.");
}
inputFile = args [i + 1];
i += 2;
- } else if (args [i] == "--runtime") {
- if (i + 1 >= args.Length) {
- Console.WriteLine ("Missing argument to --runtime command line option.");
- return 1;
- }
- runtime = args [i + 1];
- i += 2;
} else if (args [i] == "--mono-path") {
if (i + 1 >= args.Length) {
Console.WriteLine ("Missing argument to --mono-path command line option.");
}
mono_path = args [i + 1].Substring(0, args [i + 1].Length);
+ i += 2;
+ } else if (args [i] == "--mono-gac-prefix") {
+ if (i + 1 >= args.Length) {
+ Console.WriteLine ("Missing argument to --mono-gac-prefix command line option.");
+ return 1;
+ }
+ mono_gac_prefix = args[i + 1];
i += 2;
} else if (args [i] == "--aot-run-flags") {
if (i + 1 >= args.Length) {
ProcessStartInfo job = new ProcessStartInfo (runtime, aot_args);
job.UseShellExecute = false;
job.EnvironmentVariables[ENV_TIMEOUT] = timeout.ToString();
- job.EnvironmentVariables[MONO_PATH] = mono_path;
+ if (mono_path != null)
+ job.EnvironmentVariables[MONO_PATH] = mono_path;
+ if (mono_gac_prefix != null)
+ job.EnvironmentVariables[MONO_GAC_PREFIX] = mono_gac_prefix;
Process compiler = new Process ();
compiler.StartInfo = job;
test_invoke = test;
/* Spawn a new process */
- string process_args;
- if (opt_set == null)
- process_args = test_invoke;
- else
- process_args = "-O=" + opt_set + " " + test_invoke;
+ string process_args = test_invoke;
+ if (opt_set != null)
+ process_args = "-O=" + opt_set + " " + process_args;
+ if (runtime_args != null)
+ process_args = runtime_args + " " + process_args;
ProcessStartInfo info = new ProcessStartInfo (runtime, process_args);
info.UseShellExecute = false;
info.EnvironmentVariables["MONO_CONFIG"] = config;
if (mono_path != null)
info.EnvironmentVariables[MONO_PATH] = mono_path;
+ if (mono_gac_prefix != null)
+ info.EnvironmentVariables[MONO_GAC_PREFIX] = mono_gac_prefix;
Process p = new Process ();
p.StartInfo = info;
--- /dev/null
+testkey.snk binary
\ No newline at end of file
--- /dev/null
+/Makefile
+/Makefile.in
+/lib/mono/
--- /dev/null
+
+### buildtree stuff
+
+CLASS=$(mcs_topdir)/class/lib/$(DEFAULT_PROFILE)
+
+if FULL_AOT_TESTS
+PROFILE_MCS_FLAGS = -d:MOBILE,MOBILE_LEGACY,FULL_AOT_DESKTOP
+endif
+
+if HYBRID_AOT_TESTS
+PROFILE_MCS_FLAGS = -d:MOBILE,MOBILE_LEGACY
+endif
+
+### test runner stuff
+
+if HOST_WIN32
+PLATFORM_PATH_SEPARATOR=;
+else
+PLATFORM_PATH_SEPARATOR=:
+endif
+
+RUNTIME= $(top_builddir)/runtime/mono-wrapper
+TEST_RUNTIME = MONO_PATH=$(CLASS) $(RUNTIME)
+TOOLS_RUNTIME= MONO_PATH=$(mcs_topdir)/class/lib/build $(RUNTIME)
+
+TEST_RUNNER = ../test-runner.exe --runtime $(RUNTIME)
+
+if HOST_WIN32
+TEST_RUNNER_ARGS=--runtime $(if $(MONO_EXECUTABLE),$(shell cygpath -w -a $(MONO_EXECUTABLE) | sed 's/\\/\\\\/g'),mono)
+else
+TEST_RUNNER_ARGS=--runtime $(if $(MONO_EXECUTABLE),$(MONO_EXECUTABLE),mono)
+endif
+
+TEST_RUNNER_ARGS += $(if $(V), --verbose,)
+
+CLASS=$(mcs_topdir)/class/lib/$(DEFAULT_PROFILE)
+
+if FULL_AOT_TESTS
+TEST_RUNNER += --aot-run-flags "$(AOT_RUN_FLAGS)" --aot-build-flags "$(AOT_BUILD_FLAGS)"
+endif
+
+if HYBRID_AOT_TESTS
+TEST_RUNNER += --aot-run-flags "$(AOT_RUN_FLAGS)" --aot-build-flags "$(AOT_BUILD_FLAGS)"
+endif
+
+### tools
+
+GACUTIL= $(mcs_topdir)/class/lib/build/gacutil.exe
+SN= $(mcs_topdir)/class/lib/build/sn.exe
+
+MCS= $(TOOLS_RUNTIME) $(CSC) -noconfig -nologo -debug:portable -target:library $(PROFILE_MCS_FLAGS)
+
+### testcase stuff
+
+BASE_MONO_PATH=$(CLASS)
+
+V1_SRC= v1/gactestlib.cs
+V2_SRC= v2/gactestlib.cs
+APP_V1_SRC = v1/app.cs v1/app-refl-load.cs
+
+APP_SIGNED_V1_EXE = app-v1.exe app-refl-load-v1.exe
+
+UNSIGNED_V1_DLL= unsigned_v1/gactestlib.dll
+UNSIGNED_V2_DLL= unsigned_v2/gactestlib.dll
+
+SIGNED_V1_DLL= signed_v1/gactestlib.dll
+SIGNED_V2_DLL= signed_v2/gactestlib.dll
+
+GACTESTLIB_SRCS= $(V1_SRC) $(V2_SRC)
+GACTESTLIB_DLLS= $(SIGNED_V1_DLL) $(SIGNED_V2_DLL) $(UNSIGNED_V1_DLL) $(UNSIGNED_V2_DLL)
+
+if FULL_AOT_TESTS
+GACTESTLIB_DLLS_AOT=$(GACTESTLIB_DLLS:.dll=.dll$(PLATFORM_AOT_SUFFIX))
+APP_SIGNED_V1_AOT=$(APP_SIGNED_V1_EXE:.exe=.exe$(PLATFORM_AOT_SUFFIX))
+endif
+
+if HYBRID_AOT_TESTS
+GACTESTLIB_DLLS_AOT=$(GACTESTLIB_DLLS:.dll=.dll$(PLATFORM_AOT_SUFFIX))
+APP_SIGNED_V1_AOT=$(APP_SIGNED_V1_EXE:.exe=.exe$(PLATFORM_AOT_SUFFIX))
+endif
+
+
+SIGNING_KEY= testkey.snk
+
+# prefix for the testing gac. gacutil will add lib/mono/gac directories
+GACDIR=.
+
+SIGN= -delaysign -keyfile:$(SIGNING_KEY)
+
+
+### autotools stuff
+
+EXTRA_DIST= README $(SIGNING_KEY) $(GACTESTLIB_SRCS)
+
+### Test cases
+
+# MONO_GAC_PREFIX tests
+if FULL_AOT_TESTS
+GAC_TESTS=
+else
+if HYBRID_AOT_TESTS
+GAC_TESTS=
+else
+GAC_TESTS= test-signed-v1-app-gac
+endif
+endif
+
+# MONO_PATH tests
+MP_TESTS= test-signed-v1-app-mp-unsigned-v1 \
+ test-signed-v1-app-mp-signed-v1 \
+ test-signed-v1-app-mp-unsigned-v2-signed-v1 \
+ test-signed-v1-app-mp-signed-v2-signed-v1
+
+###
+
+.PHONY: runtest compile-tests prereqs
+
+runtest: $(MP_TESTS) $(GAC_TESTS)
+
+compile-tests: prereqs $(APP_SIGNED_V1_EXE) $(APP_SIGNED_V1_AOT)
+
+prereqs: $(GACTESTLIB_DLLS) $(GACTESTLIB_DLLS_AOT) gacinstall
+
+$(UNSIGNED_V1_DLL): $(V1_SRC)
+ -mkdir -p $(@D)
+ $(MCS) -out:$@ $<
+
+$(UNSIGNED_V2_DLL): $(V2_SRC)
+ -mkdir -p $(@D)
+ $(MCS) -out:$@ $<
+
+$(SIGNED_V1_DLL): $(V1_SRC) $(SIGNING_KEY)
+ -mkdir -p $(@D)
+ $(MCS) -out:$@ $(SIGN) $< && $(TOOLS_RUNTIME) $(SN) -R $@ $(SIGNING_KEY)
+
+$(SIGNED_V2_DLL): $(V2_SRC) $(SIGNING_KEY)
+ -mkdir -p $(@D)
+ $(MCS) -out:$@ $(SIGN) $< && $(TOOLS_RUNTIME) $(SN) -R $@ $(SIGNING_KEY)
+
+%-v1.exe: v1/%.cs $(SIGNED_V1_DLL)
+ $(MCS) -target:exe -out:$@ -r:$(SIGNED_V1_DLL) $<
+
+%.exe$(PLATFORM_AOT_SUFFIX): %.exe
+ $(TEST_RUNTIME) $(AOT_BUILD_FLAGS) $<
+
+%.dll$(PLATFORM_AOT_SUFFIX): %.dll
+ $(TEST_RUNTIME) $(AOT_BUILD_FLAGS) $<
+
+test-signed-v1-app-mp-unsigned-v1: $(APP_SIGNED_V1_EXE) prereqs
+ $(TOOLS_RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name "testing_gac_$@" --mono-path "unsigned_v1$(PLATFORM_PATH_SEPARATOR)$(BASE_MONO_PATH)" --expected-exit-code 1 $(APP_SIGNED_V1_EXE)
+
+test-signed-v1-app-mp-signed-v1: $(APP_SIGNED_V1_EXE) prereqs
+ $(TOOLS_RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name "testing_gac_$@" --mono-path "signed_v1$(PLATFORM_PATH_SEPARATOR)$(BASE_MONO_PATH)" $(APP_SIGNED_V1_EXE)
+
+test-signed-v1-app-gac: $(APP_SIGNED_V1_EXE) gacinstall prereqs
+ $(TOOLS_RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name "testing_gac_$@" --mono-gac-prefix $(GACDIR) $(APP_SIGNED_V1_EXE)
+
+test-signed-v1-app-mp-unsigned-v2-signed-v1: $(APP_SIGNED_V1_EXE) prereqs
+ $(TOOLS_RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name "testing_gac_$@" --mono-path "unsigned_v2$(PLATFORM_PATH_SEPARATOR)signed_v1$(PLATFORM_PATH_SEPARATOR)$(BASE_MONO_PATH)" $(APP_SIGNED_V1_EXE)
+
+test-signed-v1-app-mp-signed-v2-signed-v1: $(APP_SIGNED_V1_EXE) prereqs
+ $(TOOLS_RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name "testing_gac_$@" --mono-path "signed_v2$(PLATFORM_PATH_SEPARATOR)signed_v1$(PLATFORM_PATH_SEPARATOR)$(BASE_MONO_PATH)" $(APP_SIGNED_V1_EXE)
+
+.PHONY: gacinstall
+
+gacinstall: $(SIGNED_V1_DLL) $(GACTESTLIB_DLLS_AOT)
+ $(TOOLS_RUNTIME) $(GACUTIL) -i $< -gacdir $(GACDIR)
+
+mostlyclean-local: clean-gac-subdir clean-gactestlib-dll
+ -rm -f TestResult-*.xml
+
+.PHONY: clean-gac-subdir clean-gactestlib-dll
+
+clean-gac-subdir:
+ -rm -rf $(GACDIR)/lib/mono/gac/
+
+clean-gactestlib-dll:
+ -rm -f $(GACTESTLIB_DLLS)
+ -rm -f $(GACTESTLIB_DLLS_AOT)
+ -rm -f $(APP_SIGNED_V1_EXE) $(APP_SIGNED_V1_AOT)
--- /dev/null
+This directory is used by some tests in <root>/mono/tests that require a GAC (set via MONO_GAC_PREFIX).
+
+The gac will be in this directory, under lib/mono/gac/
+
+
+
+When clean, this directory should have no files other than this README and Makefile
\ No newline at end of file
--- /dev/null
+using System;
+using System.Reflection;
+
+public class App {
+ const string assemblyName = "gactestlib";
+ const string assemblyVersion = "1.0.0.0";
+ const string assemblyPublicKeyToken = "537eab56aa911cb7"; /* see testkey.snk */
+ public static int Main (string[] args)
+ {
+ TestAssemblyLoad ();
+
+ TestReflectionOnlyLoad ();
+
+ return 0;
+ }
+
+ public static void TestAssemblyLoad ()
+ {
+ var expectedVersion = new Version (assemblyVersion);
+
+ var s = String.Format ("{0}, Version={1}, Culture=\"\", PublicKeyToken={2}",
+ assemblyName, assemblyVersion, assemblyPublicKeyToken);
+ var n = new AssemblyName (s);
+ var a = AppDomain.CurrentDomain.Load (n);
+
+ if (a == null)
+ Environment.Exit (1);
+ if (a.GetName ().Version != expectedVersion)
+ Environment.Exit (2);
+ }
+
+ public static void TestReflectionOnlyLoad ()
+ {
+ var expectedVersion = new Version (assemblyVersion);
+
+ var s = String.Format ("{0}, Version={1}, Culture=\"\", PublicKeyToken={2}",
+ assemblyName, assemblyVersion, assemblyPublicKeyToken);
+ var a = Assembly.ReflectionOnlyLoad (s);
+
+ if (a == null)
+ Environment.Exit (3);
+ if (a.GetName ().Version != expectedVersion)
+ Environment.Exit (4);
+ }
+}
--- /dev/null
+using System;
+
+public class App {
+ public static void Main () {
+ X.N1 ();
+ X.N2 ();
+ }
+}
--- /dev/null
+
+[assembly: System.Reflection.AssemblyVersion ("1.0.0.0")]
+
+public class X
+{
+ public static void N1 ()
+ {
+
+ }
+
+ public static void N2 ()
+ {
+ }
+
+}
--- /dev/null
+
+[assembly: System.Reflection.AssemblyVersion ("1.1.0.0")]
+
+public class X
+{
+ public static void N1 ()
+ {
+
+ }
+
+ // In the "v2" version, let's make this method missing.
+ // public static void N2 ()
+ // {
+ // }
+}
// This test merely creates a Win32Exception that triggers the
// code in mono/io-layer/message.c that validates that the
// error table is propertly sorted
-//
-// If there is output on stderr, we have an error
-//
using System;
using System.ComponentModel;
return new Win32Exception (c).Message;
}
- static void check (int c, string s)
+ static bool check (int c, string s)
{
- if (msg (c) != s)
- Console.WriteLine ("For {0} expected {1} got {2}", c, s, msg (c));
+ if (msg (c) != s) {
+ Console.Error.WriteLine ("For {0} expected {1} got {2}", c, s, msg (c));
+ return false;
+ }
+ return true;
}
- static void Main ()
+ static int Main ()
{
//
// All this test does is instantiate two Win32Exceptions
Exception a = new Win32Exception (99999);
a = new Win32Exception (9805);
- check (2, "Cannot find the specified file");
+ if (!check (2, "Cannot find the specified file"))
+ return 1;
+
+ return 0;
}
-}
\ No newline at end of file
+}
mctx->esi = UCONTEXT_REG_ESI (ctx);
mctx->edi = UCONTEXT_REG_EDI (ctx);
mctx->eip = UCONTEXT_REG_EIP (ctx);
+#ifdef UCONTEXT_REG_XMM
+ mctx->fregs [0] = UCONTEXT_REG_XMM0 (ctx);
+ mctx->fregs [1] = UCONTEXT_REG_XMM1 (ctx);
+ mctx->fregs [2] = UCONTEXT_REG_XMM2 (ctx);
+ mctx->fregs [3] = UCONTEXT_REG_XMM3 (ctx);
+ mctx->fregs [4] = UCONTEXT_REG_XMM4 (ctx);
+ mctx->fregs [5] = UCONTEXT_REG_XMM5 (ctx);
+ mctx->fregs [6] = UCONTEXT_REG_XMM6 (ctx);
+ mctx->fregs [7] = UCONTEXT_REG_XMM7 (ctx);
+#endif
#elif defined(HOST_WIN32)
CONTEXT *context = (CONTEXT*)sigctx;
UCONTEXT_REG_ESI (ctx) = mctx->esi;
UCONTEXT_REG_EDI (ctx) = mctx->edi;
UCONTEXT_REG_EIP (ctx) = mctx->eip;
+#ifdef UCONTEXT_REG_XMM
+ UCONTEXT_REG_XMM0 (ctx) = mctx->fregs [0];
+ UCONTEXT_REG_XMM1 (ctx) = mctx->fregs [1];
+ UCONTEXT_REG_XMM2 (ctx) = mctx->fregs [2];
+ UCONTEXT_REG_XMM3 (ctx) = mctx->fregs [3];
+ UCONTEXT_REG_XMM4 (ctx) = mctx->fregs [4];
+ UCONTEXT_REG_XMM5 (ctx) = mctx->fregs [5];
+ UCONTEXT_REG_XMM6 (ctx) = mctx->fregs [6];
+ UCONTEXT_REG_XMM7 (ctx) = mctx->fregs [7];
+#endif
#elif defined(HOST_WIN32)
CONTEXT *context = (CONTEXT*)sigctx;
[xmm4] MONO_CONTEXT_OFFSET (fregs, X86_XMM4, MonoContextSimdReg), \
[xmm5] MONO_CONTEXT_OFFSET (fregs, X86_XMM5, MonoContextSimdReg), \
[xmm6] MONO_CONTEXT_OFFSET (fregs, X86_XMM6, MonoContextSimdReg), \
- [xmm7] MONO_CONTEXT_OFFSET (fregs, X86_XMM7, MonoContextSimdReg), \
+ [xmm7] MONO_CONTEXT_OFFSET (fregs, X86_XMM7, MonoContextSimdReg)); \
} while (0)
#else
#define MONO_CONTEXT_GET_CURRENT_FREGS(ctx)
#define UCONTEXT_REG_ESI(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__ss.__esi)
#define UCONTEXT_REG_EDI(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__ss.__edi)
#define UCONTEXT_REG_EIP(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__ss.__eip)
+ #define UCONTEXT_REG_XMM
+ #define UCONTEXT_REG_XMM0(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__fs.__fpu_xmm0)
+ #define UCONTEXT_REG_XMM1(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__fs.__fpu_xmm1)
+ #define UCONTEXT_REG_XMM2(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__fs.__fpu_xmm2)
+ #define UCONTEXT_REG_XMM3(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__fs.__fpu_xmm3)
+ #define UCONTEXT_REG_XMM4(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__fs.__fpu_xmm4)
+ #define UCONTEXT_REG_XMM5(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__fs.__fpu_xmm5)
+ #define UCONTEXT_REG_XMM6(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__fs.__fpu_xmm6)
+ #define UCONTEXT_REG_XMM7(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__fs.__fpu_xmm7)
# else
#define UCONTEXT_REG_EAX(ctx) (((ucontext_t*)(ctx))->uc_mcontext->ss.eax)
#define UCONTEXT_REG_EBX(ctx) (((ucontext_t*)(ctx))->uc_mcontext->ss.ebx)
static MonoNativeTlsKey mono_tls_key_thread;
static MonoNativeTlsKey mono_tls_key_jit_tls;
static MonoNativeTlsKey mono_tls_key_domain;
-static MonoNativeTlsKey mono_tls_key_lmf;
static MonoNativeTlsKey mono_tls_key_sgen_thread_info;
static MonoNativeTlsKey mono_tls_key_lmf_addr;
MONO_THREAD_VAR_OFFSET (mono_tls_thread, tls_offsets [TLS_KEY_THREAD]);
MONO_THREAD_VAR_OFFSET (mono_tls_jit_tls, tls_offsets [TLS_KEY_JIT_TLS]);
MONO_THREAD_VAR_OFFSET (mono_tls_domain, tls_offsets [TLS_KEY_DOMAIN]);
- MONO_THREAD_VAR_OFFSET (mono_tls_lmf, tls_offsets [TLS_KEY_LMF]);
MONO_THREAD_VAR_OFFSET (mono_tls_lmf_addr, tls_offsets [TLS_KEY_LMF_ADDR]);
#else
mono_native_tls_alloc (&mono_tls_key_thread, NULL);
MONO_THREAD_VAR_OFFSET (mono_tls_key_jit_tls, tls_offsets [TLS_KEY_JIT_TLS]);
mono_native_tls_alloc (&mono_tls_key_domain, NULL);
MONO_THREAD_VAR_OFFSET (mono_tls_key_domain, tls_offsets [TLS_KEY_DOMAIN]);
- mono_native_tls_alloc (&mono_tls_key_lmf, NULL);
- MONO_THREAD_VAR_OFFSET (mono_tls_key_lmf, tls_offsets [TLS_KEY_LMF]);
mono_native_tls_alloc (&mono_tls_key_lmf_addr, NULL);
MONO_THREAD_VAR_OFFSET (mono_tls_key_lmf_addr, tls_offsets [TLS_KEY_LMF_ADDR]);
#endif
mono_native_tls_free (mono_tls_key_thread);
mono_native_tls_free (mono_tls_key_jit_tls);
mono_native_tls_free (mono_tls_key_domain);
- mono_native_tls_free (mono_tls_key_lmf);
mono_native_tls_free (mono_tls_key_sgen_thread_info);
mono_native_tls_free (mono_tls_key_lmf_addr);
#endif
return name ? (gpointer)"mono_tls_get_jit_tls" : (gpointer)mono_tls_get_jit_tls;
case TLS_KEY_DOMAIN:
return name ? (gpointer)"mono_tls_get_domain" : (gpointer)mono_tls_get_domain;
- case TLS_KEY_LMF:
- return name ? (gpointer)"mono_tls_get_lmf" : (gpointer)mono_tls_get_lmf;
case TLS_KEY_SGEN_THREAD_INFO:
return name ? (gpointer)"mono_tls_get_sgen_thread_info" : (gpointer)mono_tls_get_sgen_thread_info;
case TLS_KEY_LMF_ADDR:
return name ? (gpointer)"mono_tls_set_jit_tls" : (gpointer)mono_tls_set_jit_tls;
case TLS_KEY_DOMAIN:
return name ? (gpointer)"mono_tls_set_domain" : (gpointer)mono_tls_set_domain;
- case TLS_KEY_LMF:
- return name ? (gpointer)"mono_tls_set_lmf" : (gpointer)mono_tls_set_lmf;
case TLS_KEY_SGEN_THREAD_INFO:
return name ? (gpointer)"mono_tls_set_sgen_thread_info" : (gpointer)mono_tls_set_sgen_thread_info;
case TLS_KEY_LMF_ADDR:
return NULL;
}
-gpointer
-mono_tls_get_tls_addr (MonoTlsKey key)
-{
-#ifdef HAVE_GET_TLS_ADDR
- if (key == TLS_KEY_LMF) {
-#if defined(USE_KW_THREAD)
- return &mono_tls_lmf;
-#elif defined(TARGET_MACH)
- return mono_mach_get_tls_address_from_thread (pthread_self (), mono_tls_key_lmf);
-#endif
- }
-#endif
- /* Implement if we ever need for other targets/keys */
- g_assert_not_reached ();
- return NULL;
-}
-
/* Getters for each tls key */
gpointer mono_tls_get_thread (void)
{
return MONO_TLS_GET_VALUE (mono_tls_domain, mono_tls_key_domain);
}
-gpointer mono_tls_get_lmf (void)
-{
- return MONO_TLS_GET_VALUE (mono_tls_lmf, mono_tls_key_lmf);
-}
-
gpointer mono_tls_get_sgen_thread_info (void)
{
return MONO_TLS_GET_VALUE (mono_tls_sgen_thread_info, mono_tls_key_sgen_thread_info);
MONO_TLS_SET_VALUE (mono_tls_domain, mono_tls_key_domain, value);
}
-void mono_tls_set_lmf (gpointer value)
-{
- MONO_TLS_SET_VALUE (mono_tls_lmf, mono_tls_key_lmf, value);
-}
-
void mono_tls_set_sgen_thread_info (gpointer value)
{
MONO_TLS_SET_VALUE (mono_tls_sgen_thread_info, mono_tls_key_sgen_thread_info, value);
TLS_KEY_JIT_TLS = 1,
/* mono_domain_get () */
TLS_KEY_DOMAIN = 2,
- TLS_KEY_LMF = 3,
- TLS_KEY_SGEN_THREAD_INFO = 4,
- TLS_KEY_LMF_ADDR = 5,
- TLS_KEY_NUM = 6
+ TLS_KEY_SGEN_THREAD_INFO = 3,
+ TLS_KEY_LMF_ADDR = 4,
+ TLS_KEY_NUM = 5
} MonoTlsKey;
#ifdef HAVE_KW_THREAD
#define USE_KW_THREAD
#endif
-#if defined(USE_KW_THREAD)
-#define HAVE_GET_TLS_ADDR
-#elif defined(TARGET_MACH) && (defined(TARGET_X86) || defined(TARGET_AMD64))
-/* mono_mach_get_tls_address_from_thread is untested for arm/arm64 */
-#define HAVE_GET_TLS_ADDR
-#endif
-
#ifdef HOST_WIN32
#include <windows.h>
gint32 mono_tls_get_tls_offset (MonoTlsKey key);
gpointer mono_tls_get_tls_getter (MonoTlsKey key, gboolean name);
gpointer mono_tls_get_tls_setter (MonoTlsKey key, gboolean name);
-gpointer mono_tls_get_tls_addr (MonoTlsKey key);
gpointer mono_tls_get_thread (void);
gpointer mono_tls_get_jit_tls (void);
gpointer mono_tls_get_domain (void);
-gpointer mono_tls_get_lmf (void);
gpointer mono_tls_get_sgen_thread_info (void);
gpointer mono_tls_get_lmf_addr (void);
void mono_tls_set_thread (gpointer value);
void mono_tls_set_jit_tls (gpointer value);
void mono_tls_set_domain (gpointer value);
-void mono_tls_set_lmf (gpointer value);
void mono_tls_set_sgen_thread_info (gpointer value);
void mono_tls_set_lmf_addr (gpointer value);
ECHO copy %WIN_CONFIG_H% %CONFIG_H%
copy %WIN_CONFIG_H% %CONFIG_H%
%windir%\system32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -Command "(Get-Content %CONFIG_H%) -replace '#MONO_VERSION#', (Select-String -path %CONFIGURE_AC% -pattern 'AC_INIT\(mono, \[(.*)\]').Matches[0].Groups[1].Value | Set-Content %CONFIG_H%" 2>&1
+ %windir%\system32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -Command "$mono_version=[int[]](Select-String -path %CONFIGURE_AC% -pattern 'AC_INIT\(mono, \[(.*)\]').Matches[0].Groups[1].Value.Split('.'); $corlib_counter=[int](Select-String -path %CONFIGURE_AC% -pattern 'MONO_CORLIB_COUNTER=(.*)').Matches[0].Groups[1].Value; (Get-Content %CONFIG_H%) -replace '#MONO_CORLIB_VERSION#',('1{0:00}{1:00}{2:00}{3:000}' -f $mono_version[0],$mono_version[1],$mono_version[2],$corlib_counter) | Set-Content %CONFIG_H%" 2>&1
)
%windir%\system32\WindowsPowerShell\v1.0\powershell.exe -executionpolicy bypass -NonInteractive -File compare-config-files.ps1 %EGLIB_WIN_CONFIG_H% %EGLIB_CONFIG_H% 2>&1
elif [[ ${CI_TAGS} == *'winaot'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime_preset=winaot";
elif [[ ${CI_TAGS} == *'aot'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime_preset=aot";
elif [[ ${CI_TAGS} == *'bitcode'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-runtime_preset=bitcode";
-elif [[ ${CI_TAGS} == *'interpreter'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-interpreter=yes";
+elif [[ ${CI_TAGS} == *'interpreter'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-interpreter";
elif [[ ${CI_TAGS} == *'acceptance-tests'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --prefix=${MONO_REPO_ROOT}/tmp/mono-acceptance-tests --with-sgen-default-concurrent=yes";
elif [[ ${label} != w* ]] && [[ ${label} != 'debian-8-ppc64el' ]] && [[ ${label} != 'centos-s390x' ]] && [[ ${CI_TAGS} != *'monolite'* ]];
then
export TESTCMD=`dirname "${BASH_SOURCE[0]}"`/run-step.sh
${TESTCMD} --label=interpreter-regression --timeout=10m make -C mono/mini richeck
+${TESTCMD} --label=compile-runtime-tests --timeout=40m make -w -C mono/tests -j4 tests
+${TESTCMD} --label=runtime-interp --timeout=160m make -w -C mono/tests -k testinterp V=1
};
static readonly Dictionary<int, string[][]> GroupSizes = new Dictionary<int, string[][]> {
- { 0x0028, new [] { new [] { "3", "0" }, new [] { "3", "0" }, new [] { "3", "0" } } },
+ { 0x0026, new [] { new [] { "2" }, new [] { "3" }, new [] { "3" } } },
{ 0x0039, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x0045, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x0046, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x0049, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x004a, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x004b, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
- { 0x004c, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
+ { 0x004c, new [] { new [] { "3" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x004d, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x004e, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x004f, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
- { 0x0051, new [] { new [] { "3", "0" }, new [] { "3", "0" }, new [] { "3", "0" } } },
- { 0x0053, new [] { new [] { "3" }, new [] { "3", "0" }, new [] { "3", "0" } } },
- { 0x0054, new [] { new [] { "3", "0" }, new [] { "3", "0" }, new [] { "3", "0" } } },
+ { 0x0051, new [] { new [] { "3", "0" }, new [] { "3" }, new [] { "3" } } },
{ 0x0057, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
- { 0x005b, new [] { new [] { "3" }, new [] { "3", "2" }, new [] { "3", "2" } } },
- { 0x005d, new [] { new [] { "3" }, new [] { "3", "0" }, new [] { "3", "0" } } },
- { 0x005e, new [] { new [] { "3", "0" }, new [] { "3", "0" }, new [] { "3", "0" } } },
+ { 0x0060, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x0061, new [] { new [] { "3" }, new [] { "3", "2" }, new [] { "3", "2" } } },
- { 0x006d, new [] { new [] { "3", "0" }, new [] { "3", "0" }, new [] { "3", "0" } } },
- { 0x006f, new [] { new [] { "3", "0" }, new [] { "3", "0" }, new [] { "3", "0" } } },
- { 0x0078, new [] { new [] { "3" }, new [] { "3", "0" }, new [] { "3", "0" } } },
- { 0x007c, new [] { new [] { "3" }, new [] { "3", "0" }, new [] { "3", "0" } } },
- { 0x0428, new [] { new [] { "3", "0" }, new [] { "3", "0" }, new [] { "3", "0" } } },
+ { 0x006f, new [] { new [] { "3", "0" }, new [] { "3" }, new [] { "3" } } },
+ { 0x0426, new [] { new [] { "2" }, new [] { "3" }, new [] { "3" } } },
{ 0x0439, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x0445, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x0446, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x0449, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x044a, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x044b, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
- { 0x044c, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
+ { 0x044c, new [] { new [] { "3" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x044d, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x044e, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x044f, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
- { 0x0451, new [] { new [] { "3", "0" }, new [] { "3", "0" }, new [] { "3", "0" } } },
- { 0x0453, new [] { new [] { "3" }, new [] { "3", "0" }, new [] { "3", "0" } } },
- { 0x0454, new [] { new [] { "3", "0" }, new [] { "3", "0" }, new [] { "3", "0" } } },
+ { 0x0451, new [] { new [] { "3", "0" }, new [] { "3" }, new [] { "3" } } },
{ 0x0457, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
- { 0x045b, new [] { new [] { "3" }, new [] { "3", "2" }, new [] { "3", "2" } } },
- { 0x045d, new [] { new [] { "3", "0" }, new [] { "3", "0" }, new [] { "3", "0" } } },
- { 0x045e, new [] { new [] { "3", "0" }, new [] { "3", "0" }, new [] { "3", "0" } } },
+ { 0x0460, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x0461, new [] { new [] { "3" }, new [] { "3", "2" }, new [] { "3", "2" } } },
- { 0x046d, new [] { new [] { "3", "0" }, new [] { "3", "0" }, new [] { "3", "0" } } },
- { 0x046f, new [] { new [] { "3", "0" }, new [] { "3", "0" }, new [] { "3", "0" } } },
- { 0x0478, new [] { new [] { "3" }, new [] { "3", "0" }, new [] { "3", "0" } } },
- { 0x047c, new [] { new [] { "3" }, new [] { "3", "0" }, new [] { "3", "0" } } },
+ { 0x046f, new [] { new [] { "3", "0" }, new [] { "3" }, new [] { "3" } } },
+ { 0x0820, new [] { new [] { "3", "2" }, new [] { "3" }, new [] { "3" } } },
{ 0x0845, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
+ { 0x0849, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x0850, new [] { new [] { "3", "0" }, new [] { "3", "0" }, new [] { "3", "0" } } },
- { 0x085d, new [] { new [] { "3" }, new [] { "3", "0" }, new [] { "3", "0" } } },
+ { 0x0860, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
+ { 0x0c50, new [] { new [] { "3", "0" }, new [] { "3", "0" }, new [] { "3", "0" } } },
+ { 0x0c51, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
{ 0x4009, new [] { new [] { "3", "2" }, new [] { "3", "2" }, new [] { "3", "2" } } },
- { 0x540a, new [] { new [] { "3" }, new [] { "3", "0" }, new [] { "3", "0" } } },
- { 0x785d, new [] { new [] { "3", "0" }, new [] { "3", "0" }, new [] { "3", "0" } } },
- { 0x7c28, new [] { new [] { "3", "0" }, new [] { "3", "0" }, new [] { "3", "0" } } },
{ 0x7c50, new [] { new [] { "3", "0" }, new [] { "3", "0" }, new [] { "3", "0" } } },
- { 0x7c5d, new [] { new [] { "3" }, new [] { "3", "0" }, new [] { "3", "0" } } },
};
static readonly Dictionary<int, string[]> Text = new Dictionary<int, string[]> {
nuget-hash-extractor.exe: $(SOURCES)
mcs /r:System.Xml.Linq /r:System.IO.Compression -o:nuget-hash-extractor.exe $(SOURCES)
-download:
+.download_stamp_file: Makefile download.sh
echo "Downloading all the nugets"; \
./download.sh
-run: nuget-hash-extractor.exe
+download: .download_stamp_file
+
+run: nuget-hash-extractor.exe .download_stamp_file
mono nuget-hash-extractor.exe nugets
+
+run-asm: nuget-hash-extractor.exe .download_stamp_file
+ mono nuget-hash-extractor.exe nugets asm
+
+run-ver: nuget-hash-extractor.exe .download_stamp_file
+ mono nuget-hash-extractor.exe nugets ver
+
.PHONY: download run
#System.ValueTuple
wget https://www.nuget.org/api/v2/package/System.ValueTuple/4.3.0 -O nugets/system.valuetuple.4.3.0.nupkg
-#System.Security.Cryptography.OpenSsl when .net 4.6.2 + 1 is out
\ No newline at end of file
+#System.Security.Cryptography.OpenSsl when .net 4.6.2 + 1 is out
+
+touch .download_stamp_file
\ No newline at end of file
LoadAndDump (et, version);
}
}
+
+ static bool dump_asm, dump_ver;
static void Main (string[] args) {
+
+ if (args.Length > 1) {
+ dump_asm = args [1].Equals ("asm");
+ dump_ver = args [1].Equals ("ver");
+ } else {
+ dump_asm = true;
+ }
foreach (var f in Directory.GetFiles (args [0], "*.nupkg")) {
DumpNuget (f);
}
var data = StreamToArray (entry.Open ());
AppDomain ad = AppDomain.CreateDomain ("parse_" + ++domain_id);
DoParse p = (DoParse)ad.CreateInstanceAndUnwrap (typeof (DoParse).Assembly.FullName, typeof (DoParse).FullName);
- p.ParseAssembly (data, version, entry.Name, entry.FullName);
+ p.ParseAssembly (data, version, entry.Name, entry.FullName, dump_asm, dump_ver);
AppDomain.Unload (ad);
}
}
class DoParse : MarshalByRefObject {
+
static int Hash (string str) {
int h = 5381;
for (int i = 0; i < str.Length; ++i)
return parts[parts.Length - 2];
}
- public void ParseAssembly (byte[] data, string version, string name, string fullname) {
+ public void ParseAssembly (byte[] data, string version, string name, string fullname, bool dump_asm, bool dump_ver) {
var a = Assembly.ReflectionOnlyLoad (data);
var m = a.GetModules ()[0];
var id = m.ModuleVersionId.ToString ().ToUpper ();
string ver_str = version + " " + FileToMoniker (fullname);
- Console.WriteLine ($"IGNORED_ASSEMBLY (0x{hash_code}, {str}, \"{id}\", \"{ver_str}\"),");
+ if (dump_asm)
+ Console.WriteLine ($"IGNORED_ASSEMBLY (0x{hash_code}, {str}, \"{id}\", \"{ver_str}\"),");
+
+ //IGNORED_ASM_VER (SYS_IO_COMPRESSION, 4, 1, 2, 0),
+ var ver = a.GetName ().Version;
+ if (dump_ver)
+ Console.WriteLine ($"IGNORED_ASM_VER ({str}, {ver.Major}, {ver.Minor}, {ver.Build}, {ver.Revision}),");
+
}
}
\ No newline at end of file
#include <mono/metadata/debug-helpers.h>
#include <mono/metadata/tokentype.h>
#include <mono/metadata/appdomain.h>
-#include <mono/metadata/assembly.h>
+#include <mono/metadata/assembly-internals.h>
#include <mono/metadata/metadata-internals.h>
#include <mono/metadata/class-internals.h>
#include <mono/metadata/verify-internals.h>
*assembly = NULL;
fullpath = g_build_filename (path1, path2, path3, path4, NULL);
if (g_file_test (fullpath, G_FILE_TEST_IS_REGULAR))
- *assembly = mono_assembly_open_full (fullpath, NULL, refonly);
+ *assembly = mono_assembly_open_predicate (fullpath, refonly, FALSE, NULL, NULL, NULL);
g_free (fullpath);
return (*assembly != NULL);
mono_verifier_set_mode (verifier_mode);
- assembly = mono_assembly_open (file, NULL);
+ assembly = mono_assembly_open_predicate (file, FALSE, FALSE, NULL, NULL, NULL);
/*fake an assembly for netmodules so the verifier works*/
if (!assembly && (image = mono_image_open (file, &status)) && image->tables [MONO_TABLE_ASSEMBLY].rows == 0) {
assembly = g_new0 (MonoAssembly, 1);
/* Version number of package */
#define VERSION "#MONO_VERSION#"
+
+/* Version of the corlib-runtime interface */
+#define MONO_CORLIB_VERSION #MONO_CORLIB_VERSION#
+
#endif