diff options
author | Marek Safar <marek.safar@gmail.com> | 2004-09-06 20:32:53 +0400 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2004-09-06 20:32:53 +0400 |
commit | 5d46b797568a89740318cd629bc6dcc998a638d6 (patch) | |
tree | 7f0a2e383306c5a491ac4d9e4dd82d9dfda948aa /mcs/class | |
parent | 37554304830f7e71d13d79f608473b5b0b6af931 (diff) |
2004-09-06 Marek Safar <marek.safar@seznam.cz>
* CodeCompileUnit.cs,
* CodeMemberMethod.cs,
* CodeMethodReferenceExpression.cs,
* CodeStatement.cs,
* CodeTypeDeclaration.cs,
* CodeTypeMember.cs,
* CodeTypeReference.cs : Implemented NET_2_0.
* CodeChecksumPragma.cs,
* CodeDirective.cs,
* CodeDirectiveCollection.cs,
* CodeRegionDirective.cs,
* CodeRegionMode.cs,
* CodeTypeParameter.cs,
* CodeTypeParameterCollection.cs,
* CodeTypeReferenceOptions.cs : New NET_2_0 files
svn path=/trunk/mcs/; revision=33419
Diffstat (limited to 'mcs/class')
25 files changed, 1084 insertions, 70 deletions
diff --git a/mcs/class/System/Microsoft.CSharp/CSharpCodeGenerator.cs b/mcs/class/System/Microsoft.CSharp/CSharpCodeGenerator.cs index 9bb5a5b767d..db59aadd168 100644 --- a/mcs/class/System/Microsoft.CSharp/CSharpCodeGenerator.cs +++ b/mcs/class/System/Microsoft.CSharp/CSharpCodeGenerator.cs @@ -3,6 +3,7 @@ // // Author: // Daniel Stodden (stodden@in.tum.de) +// Marek Safar (marek.safar@seznam.cz) // // (C) 2002 Ximian, Inc. // @@ -36,6 +37,7 @@ namespace Mono.CSharp using System.IO; using System.Reflection; using System.Collections; + using System.Text; internal class CSharpCodeGenerator : CodeGenerator @@ -147,6 +149,7 @@ namespace Mono.CSharp GenerateComment( new CodeComment( " </autogenerated>" ) ); GenerateComment( new CodeComment( "------------------------------------------------------------------------------" ) ); Output.WriteLine(); + base.GenerateCompileUnitStart (compileUnit); } @@ -234,6 +237,10 @@ namespace Mono.CSharp Output.Write( '.' ); }; Output.Write( GetSafeName (expression.MethodName) ); +#if NET_2_0 + if (expression.TypeArguments.Count > 0) + Output.Write (GetTypeArguments (expression.TypeArguments)); +#endif } protected override void GenerateEventReferenceExpression( CodeEventReferenceExpression expression ) @@ -581,10 +588,18 @@ namespace Mono.CSharp } output.Write( GetSafeName (method.Name) ); +#if NET_2_0 + GenerateGenericsParameters (method.TypeParameters); +#endif + output.Write( '(' ); OutputParameters( method.Parameters ); output.Write( ')' ); +#if NET_2_0 + GenerateGenericsConstraints (method.TypeParameters); +#endif + if ( (attributes & MemberAttributes.ScopeMask) == MemberAttributes.Abstract || declaration.IsInterface) output.WriteLine( ';' ); else { @@ -735,6 +750,9 @@ namespace Mono.CSharp output.Write( GetSafeName (declaration.Name) ); +#if NET_2_0 + GenerateGenericsParameters (declaration.TypeParameters); +#endif output.Write( ' ' ); IEnumerator enumerator = declaration.BaseTypes.GetEnumerator(); @@ -750,13 +768,16 @@ namespace Mono.CSharp output.Write( ", " ); OutputType( type ); } - - output.Write( ' ' ); } + if (del != null) - output.Write ( "(" ); - else - output.WriteLine ( "{" ); + output.Write ( " (" ); + else { +#if NET_2_0 + GenerateGenericsConstraints (declaration.TypeParameters); +#endif + output.WriteLine ( " {" ); + } ++Indent; } @@ -970,6 +991,13 @@ namespace Mono.CSharp output = GetSafeTypeName (output); +#if NET_2_0 + if (type.Options == CodeTypeReferenceOptions.GlobalReference) + output = String.Concat ("global::", output); + + if (type.TypeArguments.Count > 0) + output += GetTypeArguments (type.TypeArguments); +#endif int rank = type.ArrayRank; if ( rank > 0 ) { output += "["; @@ -996,6 +1024,116 @@ namespace Mono.CSharp return true; } +#if NET_2_0 + protected override void GenerateDirectives( CodeDirectiveCollection directives ) + { + foreach (CodeDirective d in directives) { + if (d is CodeChecksumPragma) { + GenerateCodeChecksumPragma ((CodeChecksumPragma)d); + continue; + } + if (d is CodeRegionDirective) { + GenerateCodeRegionDirective ((CodeRegionDirective)d); + continue; + } + throw new NotImplementedException ("Unknown CodeDirective"); + } + } + + void GenerateCodeChecksumPragma (CodeChecksumPragma pragma) + { + Output.Write ("#pragma checksum \""); + Output.Write (pragma.FileName); + Output.Write ("\" \""); + Output.Write (pragma.ChecksumAlgorithmId.ToString ("B")); + Output.Write ("\" \""); + foreach (byte b in pragma.ChecksumData) { + Output.Write (b.ToString ("X2")); + } + Output.WriteLine ("\""); + } + + void GenerateCodeRegionDirective (CodeRegionDirective region) + { + switch (region.RegionMode) { + case CodeRegionMode.Start: + Output.Write ("#region "); + Output.WriteLine (region.RegionText); + return; + case CodeRegionMode.End: + Output.WriteLine ("#endregion"); + return; + } + } + + void GenerateGenericsParameters (CodeTypeParameterCollection parameters) + { + int count = parameters.Count; + if (count == 0) + return; + + Output.Write ('<'); + for (int i = 0; i < count - 1; ++i) { + Output.Write (parameters [i].Name); + Output.Write (", "); + } + Output.Write (parameters [count - 1].Name); + Output.Write ('>'); + } + + void GenerateGenericsConstraints (CodeTypeParameterCollection parameters) + { + int count = parameters.Count; + if (count == 0) + return; + + ++Indent; + foreach (CodeTypeParameter p in parameters) { + if (p.Constraints.Count == 0) + continue; + Output.WriteLine (); + Output.Write ("where "); + Output.Write (p.Name); + Output.Write (" : "); + + bool is_first = true; + foreach (CodeTypeReference r in p.Constraints) { + if (is_first) + is_first = false; + else + Output.Write (", "); + OutputType (r); + } + if (p.HasConstructorConstraint) { + if (!is_first) + Output.Write (", "); + Output.Write ("new ()"); + } + + } + --Indent; + } + + string GetTypeArguments (CodeTypeReferenceCollection collection) + { + StringBuilder sb = new StringBuilder (" <"); + foreach (CodeTypeReference r in collection) { + sb.Append (GetTypeOutput (r)); + sb.Append (", "); + } + sb.Length--; + sb [sb.Length - 1] = '>'; + return sb.ToString (); + } + + internal override void OutputExtraTypeAttribute (CodeTypeDeclaration type) + { + if (type.IsPartial) + Output.Write ("partial "); + } +#endif + + #if false //[MonoTODO] public override void ValidateIdentifier( string identifier ) @@ -1045,7 +1183,10 @@ namespace Mono.CSharp "continue","in","return","using","virtual","default", "interface","sealed","volatile","delegate","internal","do","is", "sizeof","while","lock","stackalloc","else","static","enum", - "namespace" + "namespace", +#if NET_2_0 + "partial", "yield", "where" +#endif }; } } diff --git a/mcs/class/System/Microsoft.CSharp/ChangeLog b/mcs/class/System/Microsoft.CSharp/ChangeLog index 1fd92b908e0..7eb9054ae65 100644 --- a/mcs/class/System/Microsoft.CSharp/ChangeLog +++ b/mcs/class/System/Microsoft.CSharp/ChangeLog @@ -1,3 +1,7 @@ +2004-09-06 Marek Safar <marek.safar@seznam.cz> + + * CSharpCodeGenerator.cs: Implemented NET_2_0 extensions + 2004-09-01 Marek Safar <marek.safar@seznam.cz> * CSharpCodeGenerator.cs : New private member dont_write_semicolon. diff --git a/mcs/class/System/System.CodeDom.Compiler/ChangeLog b/mcs/class/System/System.CodeDom.Compiler/ChangeLog index 6956bd1fff9..f85d56a27af 100755 --- a/mcs/class/System/System.CodeDom.Compiler/ChangeLog +++ b/mcs/class/System/System.CodeDom.Compiler/ChangeLog @@ -1,3 +1,10 @@ +2004-09-06 Marek Safar <marek.safar@seznam.cz> + + * CodeGenerator.cs, + * GeneratorSupport.cs : Implemented NET_2_0 extension + + * CompilerInfo.cs : New NET_2_0 file. + 2004-09-01 Marek Safar <marek.safar@seznam.cz> * CodeGenerator.cs : Added newline after global attributes output. diff --git a/mcs/class/System/System.CodeDom.Compiler/CodeDomProvider.cs b/mcs/class/System/System.CodeDom.Compiler/CodeDomProvider.cs index c52bb7727c1..d03ab42533a 100644 --- a/mcs/class/System/System.CodeDom.Compiler/CodeDomProvider.cs +++ b/mcs/class/System/System.CodeDom.Compiler/CodeDomProvider.cs @@ -3,6 +3,7 @@ // // Author: // Daniel Stodden (stodden@in.tum.de) +// Marek Safar (marek.safar@seznam.cz) // // (C) 2002 Ximian, Inc. // @@ -85,5 +86,41 @@ namespace System.CodeDom.Compiler return TypeDescriptor.GetConverter (type); } +#if NET_2_0 + + public virtual CompilerResults CompileAssemblyFromDom (CompilerParameters options, params CodeCompileUnit[] compilationUnits) + { + return CreateCompiler ().CompileAssemblyFromDomBatch (options, compilationUnits); + } + + public static CodeDomProvider CreateProvider (string language) + { + return GetCompilerInfo (language).CreateProvider (); + } + + public virtual void GenerateCodeFromCompileUnit (CodeCompileUnit compileUnit, + TextWriter writer, CodeGeneratorOptions options) + { + CreateGenerator ().GenerateCodeFromCompileUnit (compileUnit, writer, options); + } + + public virtual void GenerateCodeFromStatement (CodeStatement statement, TextWriter writer, CodeGeneratorOptions options) + { + CreateGenerator ().GenerateCodeFromStatement (statement, writer, options); + } + + [MonoTODO ("Not implemented")] + public static CompilerInfo GetCompilerInfo (string language) + { + return null; + } + + public virtual bool Supports (GeneratorSupport supports) + { + return CreateGenerator ().Supports (supports); + } + +#endif + } } diff --git a/mcs/class/System/System.CodeDom.Compiler/CodeGenerator.cs b/mcs/class/System/System.CodeDom.Compiler/CodeGenerator.cs index 9b051bae070..416a0cc46c9 100755 --- a/mcs/class/System/System.CodeDom.Compiler/CodeGenerator.cs +++ b/mcs/class/System/System.CodeDom.Compiler/CodeGenerator.cs @@ -6,6 +6,7 @@ // Daniel Stodden (stodden@in.tum.de) // Gonzalo Paniagua Javier (gonzalo@ximian.com) // Andreas Nahr (ClassDevelopment@A-SoftTech.com) +// Marek Safar (marek.safar@seznam.cz) // // (C) 2001-2003 Ximian, Inc. // @@ -210,10 +211,20 @@ namespace System.CodeDom.Compiler { protected virtual void GenerateCompileUnitEnd (CodeCompileUnit compileUnit) { +#if NET_2_0 + if (compileUnit.EndDirectives.Count > 0) + GenerateDirectives (compileUnit.EndDirectives); +#endif } protected virtual void GenerateCompileUnitStart (CodeCompileUnit compileUnit) { +#if NET_2_0 + if (compileUnit.StartDirectives.Count > 0) { + GenerateDirectives (compileUnit.StartDirectives); + Output.WriteLine (); + } +#endif } protected abstract void GenerateConditionStatement (CodeConditionStatement s); @@ -508,6 +519,10 @@ namespace System.CodeDom.Compiler { { bool handled = false; +#if NET_2_0 + if (s.StartDirectives.Count > 0) + GenerateDirectives (s.StartDirectives); +#endif if (s.LinePragma != null) GenerateLinePragmaStart (s.LinePragma); @@ -587,7 +602,11 @@ namespace System.CodeDom.Compiler { if (s.LinePragma != null) GenerateLinePragmaEnd (s.LinePragma); - + +#if NET_2_0 + if (s.EndDirectives.Count > 0) + GenerateDirectives (s.EndDirectives); +#endif } protected void GenerateStatements (CodeStatementCollection c) @@ -894,6 +913,9 @@ namespace System.CodeDom.Compiler { break; } + if (!IsCurrentClass) + OutputExtraTypeAttribute (currentType); + if (isStruct) output.Write ("struct "); @@ -910,10 +932,15 @@ namespace System.CodeDom.Compiler { if ((attributes & TypeAttributes.Abstract) != 0) output.Write ("abstract "); + OutputExtraTypeAttribute (currentType); output.Write ("class "); } } } + + internal virtual void OutputExtraTypeAttribute (CodeTypeDeclaration type) + { + } protected virtual void OutputTypeNamePair (CodeTypeReference type, string name) @@ -991,6 +1018,13 @@ namespace System.CodeDom.Compiler { private void GenerateType (CodeTypeDeclaration type) { +#if NET_2_0 + if (type.StartDirectives.Count > 0) + GenerateDirectives (type.StartDirectives); +#endif + foreach (CodeCommentStatement statement in type.Comments) + GenerateCommentStatement (statement); + if (type.LinePragma != null) GenerateLinePragmaStart (type.LinePragma); @@ -1002,6 +1036,11 @@ namespace System.CodeDom.Compiler { if (type.LinePragma != null) GenerateLinePragmaEnd (type.LinePragma); + +#if NET_2_0 + if (type.EndDirectives.Count > 0) + GenerateDirectives (type.EndDirectives); +#endif } private void GenerateDelegate (CodeTypeDelegate type) @@ -1009,9 +1048,6 @@ namespace System.CodeDom.Compiler { CodeTypeDeclaration prevType = this.currentType; this.currentType = type; - foreach (CodeCommentStatement statement in type.Comments) - GenerateCommentStatement (statement); - GenerateTypeStart (type); OutputParameters (type.Parameters); @@ -1025,35 +1061,53 @@ namespace System.CodeDom.Compiler { CodeTypeDeclaration prevType = this.currentType; this.currentType = type; - foreach (CodeCommentStatement statement in type.Comments) - GenerateCommentStatement (statement); - GenerateTypeStart (type); CodeTypeMember [] members = new CodeTypeMember [type.Members.Count]; type.Members.CopyTo (members, 0); - int[] order = new int[members.Length]; - for (int n=0; n<members.Length; n++) - order[n] = Array.IndexOf(memberTypes, members[n].GetType()) * members.Length + n; +#if NET_2_0 + if (!Options.VerbatimOrder) +#endif + { + int[] order = new int[members.Length]; + for (int n=0; n<members.Length; n++) + order[n] = Array.IndexOf(memberTypes, members[n].GetType()) * members.Length + n; - Array.Sort (order, members); + Array.Sort (order, members); + } // WARNING: if anything is missing in the foreach loop and you add it, add the type in // its corresponding place in CodeTypeMemberComparer class (below) + CodeTypeDeclaration subtype = null; foreach (CodeTypeMember member in members) { - CodeTypeMember prevMember = this.currentMember; this.currentMember = member; - if (prevMember != null && prevMember.LinePragma != null) - GenerateLinePragmaEnd (prevMember.LinePragma); + if (prevMember != null && subtype == null) { + if (prevMember.LinePragma != null) + GenerateLinePragmaEnd (prevMember.LinePragma); +#if NET_2_0 + if (prevMember.EndDirectives.Count > 0) + GenerateDirectives (prevMember.EndDirectives); +#endif + } if (options.BlankLinesBetweenMembers) output.WriteLine (); + subtype = member as CodeTypeDeclaration; + if (subtype != null) { + GenerateType (subtype); + continue; + } + +#if NET_2_0 + if (currentMember.StartDirectives.Count > 0) + GenerateDirectives (currentMember.StartDirectives); +#endif foreach (CodeCommentStatement statement in member.Comments) GenerateCommentStatement (statement); @@ -1108,18 +1162,19 @@ namespace System.CodeDom.Compiler { GenerateSnippetMember (snippet); continue; } - CodeTypeDeclaration subtype = member as CodeTypeDeclaration; - if (subtype != null) - { - GenerateType (subtype); - continue; - } this.currentMember = prevMember; } - if (currentMember != null && currentMember.LinePragma != null) - GenerateLinePragmaEnd (currentMember.LinePragma); + // Hack because of previous continue usage + if (currentMember != null && !(currentMember is CodeTypeDeclaration)) { + if (currentMember.LinePragma != null) + GenerateLinePragmaEnd (currentMember.LinePragma); +#if NET_2_0 + if (currentMember.EndDirectives.Count > 0) + GenerateDirectives (currentMember.EndDirectives); +#endif + } GenerateTypeEnd (type); this.currentType = prevType; @@ -1219,5 +1274,13 @@ namespace System.CodeDom.Compiler { typeof (CodeTypeDeclaration), typeof (CodeEntryPointMethod) }; + + +#if NET_2_0 + protected virtual void GenerateDirectives (CodeDirectiveCollection directives) + { + } +#endif + } } diff --git a/mcs/class/System/System.CodeDom.Compiler/CodeGeneratorOptions.cs b/mcs/class/System/System.CodeDom.Compiler/CodeGeneratorOptions.cs index e89628dd8af..f37855a9419 100644 --- a/mcs/class/System/System.CodeDom.Compiler/CodeGeneratorOptions.cs +++ b/mcs/class/System/System.CodeDom.Compiler/CodeGeneratorOptions.cs @@ -48,6 +48,9 @@ namespace System.CodeDom.Compiler properties.Add( "BracingStyle", "Block" ); properties.Add( "ElseOnClosing", false ); properties.Add( "IndentString", " " ); +#if NET_2_0 + properties.Add( "VerbatimOrder", false ); +#endif } // @@ -116,5 +119,16 @@ namespace System.CodeDom.Compiler properties[index] = value; } } + +#if NET_2_0 + public bool VerbatimOrder { + get { + return (bool)properties["VerbatimOrder"]; + } + set { + properties["VerbatimOrder"] = value; + } + } +#endif } } diff --git a/mcs/class/System/System.CodeDom.Compiler/CompilerInfo.cs b/mcs/class/System/System.CodeDom.Compiler/CompilerInfo.cs new file mode 100644 index 00000000000..375f15a5a0b --- /dev/null +++ b/mcs/class/System/System.CodeDom.Compiler/CompilerInfo.cs @@ -0,0 +1,48 @@ +// +// System.CodeDom.Compiler CompilerInfo class +// +// Author: +// Marek Safar (marek.safar@seznam.cz) +// +// (C) 2004 Ximian, Inc. +// + +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +#if NET_2_0 + +namespace System.CodeDom.Compiler +{ + public sealed class CompilerInfo + { + private CompilerInfo () {} + + [MonoTODO] + public CodeDomProvider CreateProvider () + { + throw new NotImplementedException (); + } + } +} + +#endif + diff --git a/mcs/class/System/System.CodeDom.Compiler/GeneratorSupport.cs b/mcs/class/System/System.CodeDom.Compiler/GeneratorSupport.cs index 85719fb7f9d..74c15ecb8f3 100644 --- a/mcs/class/System/System.CodeDom.Compiler/GeneratorSupport.cs +++ b/mcs/class/System/System.CodeDom.Compiler/GeneratorSupport.cs @@ -3,6 +3,7 @@ // // Author: // Daniel Stodden (stodden@in.tum.de) +// Marek Safar (marek.safar@seznam.cz) // // (C) 2002 Ximian, Inc. // @@ -53,7 +54,15 @@ namespace System.CodeDom.Compiler MultipleInterfaceMembers = 1 << 17, PublicStaticMembers = 1 << 18, ComplexExpressions = 1 << 19, - Win32Resources = 1 << 20 + Win32Resources = 1 << 20, + +#if NET_2_0 + Resources = 1 << 21, + PartialTypes = 1 << 22, + GenericTypeReference = 1 << 23, + GenericTypeDeclaration = 1 << 24, + DeclareIndexerProperties = 1 << 25, +#endif } } diff --git a/mcs/class/System/System.CodeDom/ChangeLog b/mcs/class/System/System.CodeDom/ChangeLog index 450d15fdba0..9acecd0de98 100644 --- a/mcs/class/System/System.CodeDom/ChangeLog +++ b/mcs/class/System/System.CodeDom/ChangeLog @@ -1,3 +1,22 @@ +2004-09-06 Marek Safar <marek.safar@seznam.cz> + + * CodeCompileUnit.cs, + * CodeMemberMethod.cs, + * CodeMethodReferenceExpression.cs, + * CodeStatement.cs, + * CodeTypeDeclaration.cs, + * CodeTypeMember.cs, + * CodeTypeReference.cs : Implemented NET_2_0. + + * CodeChecksumPragma.cs, + * CodeDirective.cs, + * CodeDirectiveCollection.cs, + * CodeRegionDirective.cs, + * CodeRegionMode.cs, + * CodeTypeParameter.cs, + * CodeTypeParameterCollection.cs, + * CodeTypeReferenceOptions.cs : New NET_2_0 files + 2004-09-01 Marek Safar <marek.safar@seznam.cz> * CodeCatchClause.cs: System.Exception is default type diff --git a/mcs/class/System/System.CodeDom/CodeChecksumPragma.cs b/mcs/class/System/System.CodeDom/CodeChecksumPragma.cs new file mode 100644 index 00000000000..1801dc949e2 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeChecksumPragma.cs @@ -0,0 +1,86 @@ +// +// System.CodeDom CodeChecksumPragma class +// +// Author: +// Marek Safar (marek.safar@seznam.cz) +// +// (C) 2004 Ximian, Inc. +// + +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +#if NET_2_0 +using System; +using System.Runtime.InteropServices; + +namespace System.CodeDom +{ + [Serializable] + [ComVisible (true), ClassInterface (ClassInterfaceType.AutoDispatch)] + public class CodeChecksumPragma: CodeDirective + { + string fileName; + Guid checksumAlgorithmId; + byte[] checksumData; + + public CodeChecksumPragma () + { + checksumData = new byte[0]; + } + + public CodeChecksumPragma (string fileName, Guid checksumAlgorithmId, byte[] checksumData) + { + this.fileName = fileName; + this.checksumAlgorithmId = checksumAlgorithmId; + this.checksumData = checksumData; + } + + public Guid ChecksumAlgorithmId { + get { + return checksumAlgorithmId; + } + set { + checksumAlgorithmId = value; + } + } + + public byte[] ChecksumData { + get { + return checksumData; + } + set { + checksumData = value; + } + } + + public string FileName { + get { + return fileName; + } + set { + fileName = value; + } + } + } +} + +#endif diff --git a/mcs/class/System/System.CodeDom/CodeCompileUnit.cs b/mcs/class/System/System.CodeDom/CodeCompileUnit.cs index 987d3b3811c..680ccc0c6d4 100644 --- a/mcs/class/System/System.CodeDom/CodeCompileUnit.cs +++ b/mcs/class/System/System.CodeDom/CodeCompileUnit.cs @@ -3,6 +3,7 @@ // // Author: // Daniel Stodden (stodden@in.tum.de) +// Marek Safar (marek.safar@seznam.cz) // // (C) 2002 Ximian, Inc. // @@ -77,5 +78,29 @@ namespace System.CodeDom return referencedAssemblies; } } + +#if NET_2_0 + + CodeDirectiveCollection startDirectives; + CodeDirectiveCollection endDirectives; + + public CodeDirectiveCollection StartDirectives { + get { + if (startDirectives == null) + startDirectives = new CodeDirectiveCollection (); + return startDirectives; + } + } + + public CodeDirectiveCollection EndDirectives { + get { + if (endDirectives == null) + endDirectives = new CodeDirectiveCollection (); + return endDirectives; + } + } + +#endif + } } diff --git a/mcs/class/System/System.CodeDom/CodeDirective.cs b/mcs/class/System/System.CodeDom/CodeDirective.cs new file mode 100644 index 00000000000..494b40d3585 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeDirective.cs @@ -0,0 +1,45 @@ +// +// System.CodeDom CodeDirective class +// +// Author: +// Marek Safar (marek.safar@seznam.cz) +// +// (C) 2004 Ximian, Inc. +// + +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +#if NET_2_0 + +using System.Runtime.InteropServices; + +namespace System.CodeDom +{ + [Serializable] + [ComVisible (true), ClassInterface (ClassInterfaceType.AutoDispatch)] + public class CodeDirective: CodeObject + { + public CodeDirective () {} + } +} + +#endif diff --git a/mcs/class/System/Microsoft.Win32/TODOAttribute.cs b/mcs/class/System/System.CodeDom/CodeDirectiveCollection.cs index 4dae80edb5d..3ad81c3d23c 100644 --- a/mcs/class/System/Microsoft.Win32/TODOAttribute.cs +++ b/mcs/class/System/System.CodeDom/CodeDirectiveCollection.cs @@ -1,11 +1,11 @@ -//
-// TODOAttribute.cs
-//
-// Author:
-// Ravi Pratap (ravi@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
+// +// System.CodeDom CodeDirectiveCollection class +// +// Author: +// Marek Safar (marek.safar@seznam.cz) +// +// (C) 2004 Ximian, Inc. +// // // Permission is hereby granted, free of charge, to any person obtaining @@ -27,33 +27,29 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -
-namespace Microsoft.Win32 {
-
-using System;
-
- /// <summary>
- /// The TODO attribute is used to flag all incomplete bits in our class libraries
- /// </summary>
- ///
- /// <remarks>
- /// Use this to decorate any element which you think is not complete
- /// </remarks>
- [AttributeUsage (AttributeTargets.All)]
- internal class MonoTODOAttribute : Attribute{
-
- string comment;
-
- public MonoTODOAttribute ()
- {}
-
- public MonoTODOAttribute (string comment)
- {
- this.comment = comment;
- }
-
- public string Comment {
- get { return comment; }
- }
- }
-}
+ +#if NET_2_0 + +using System.Runtime.InteropServices; + +namespace System.CodeDom +{ + [Serializable] + [ComVisible (true), ClassInterface (ClassInterfaceType.AutoDispatch)] + public class CodeDirectiveCollection: System.Collections.CollectionBase + { + public CodeDirectiveCollection () {} + + public CodeDirectiveCollection (CodeDirectiveCollection value) + { + } + + public int Add (CodeDirective value) + { + return List.Add (value); + } + + } +} + +#endif diff --git a/mcs/class/System/System.CodeDom/CodeMemberMethod.cs b/mcs/class/System/System.CodeDom/CodeMemberMethod.cs index 8010d9c832e..402b4f9a9ae 100755 --- a/mcs/class/System/System.CodeDom/CodeMemberMethod.cs +++ b/mcs/class/System/System.CodeDom/CodeMemberMethod.cs @@ -46,6 +46,9 @@ namespace System.CodeDom private CodeStatementCollection statements; private CodeAttributeDeclarationCollection returnTypeCustomAttributes; +#if NET_2_0 + CodeTypeParameterCollection typeParameters; +#endif // // Constructors // @@ -118,6 +121,17 @@ namespace System.CodeDom } } +#if NET_2_0 + [ComVisible (false)] + public CodeTypeParameterCollection TypeParameters { + get { + if (typeParameters == null) + typeParameters = new CodeTypeParameterCollection (); + return typeParameters; + } + } +#endif + // // Events // diff --git a/mcs/class/System/System.CodeDom/CodeMethodReferenceExpression.cs b/mcs/class/System/System.CodeDom/CodeMethodReferenceExpression.cs index c673beaa653..0df49461f1c 100644 --- a/mcs/class/System/System.CodeDom/CodeMethodReferenceExpression.cs +++ b/mcs/class/System/System.CodeDom/CodeMethodReferenceExpression.cs @@ -4,6 +4,7 @@ // Author: // Miguel de Icaza (miguel@ximian.com) // Daniel Stodden (stodden@in.tum.de) +// Marek Safar (marek.safar@seznam.cz) // // (C) 2001 Ximian, Inc. // @@ -41,6 +42,9 @@ namespace System.CodeDom { private string methodName; private CodeExpression targetObject; +#if NET_2_0 + CodeTypeReferenceCollection typeArguments; +#endif // // Constructors @@ -56,6 +60,16 @@ namespace System.CodeDom this.methodName = methodName; } +#if NET_2_0 + public CodeMethodReferenceExpression (CodeExpression targetObject, + string methodName, params CodeTypeReference[] typeParameters) : + this (targetObject, methodName) + { + if (typeParameters != null && typeParameters.Length > 0) + TypeArguments.AddRange (typeParameters); + } +#endif + // // Properties // @@ -76,5 +90,16 @@ namespace System.CodeDom targetObject = value; } } + +#if NET_2_0 + [ComVisible (false)] + public CodeTypeReferenceCollection TypeArguments { + get { + if (typeArguments == null) + typeArguments = new CodeTypeReferenceCollection (); + return typeArguments; + } + } +#endif } } diff --git a/mcs/class/System/System.CodeDom/CodeRegionDirective.cs b/mcs/class/System/System.CodeDom/CodeRegionDirective.cs new file mode 100644 index 00000000000..e5ba629e16f --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeRegionDirective.cs @@ -0,0 +1,72 @@ +// +// System.CodeDom CodeRegionDirective class +// +// Author: +// Marek Safar (marek.safar@seznam.cz) +// +// (C) 2004 Ximian, Inc. +// + +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +#if NET_2_0 + +using System.Runtime.InteropServices; + +namespace System.CodeDom +{ + [Serializable] + [ComVisible (true), ClassInterface (ClassInterfaceType.AutoDispatch)] + public class CodeRegionDirective: CodeDirective + { + CodeRegionMode regionMode; + string regionText; + + public CodeRegionDirective () {} + + public CodeRegionDirective (CodeRegionMode regionMode, string regionText) + { + this.regionMode = regionMode; + this.regionText = regionText; + } + + public CodeRegionMode RegionMode { + get { + return regionMode; + } + set { + regionMode = value; + } + } + + public string RegionText { + get { + return regionText; + } + set { + regionText = value; + } + } + } +} + +#endif diff --git a/mcs/class/System/System.CodeDom/CodeRegionMode.cs b/mcs/class/System/System.CodeDom/CodeRegionMode.cs new file mode 100644 index 00000000000..3eab5e6035d --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeRegionMode.cs @@ -0,0 +1,46 @@ +// +// System.CodeDom CodeRegionMode enum +// +// Author: +// Marek Safar (marek.safar@seznam.cz) +// +// (C) 2004 Ximian, Inc. +// + +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +#if NET_2_0 + +using System.Runtime.InteropServices; + +namespace System.CodeDom +{ + [Serializable] + [ComVisible (true)] + public enum CodeRegionMode + { + Start = 1, + End = 1 << 1 + } +} + +#endif diff --git a/mcs/class/System/System.CodeDom/CodeStatement.cs b/mcs/class/System/System.CodeDom/CodeStatement.cs index 661c3b748db..8c039fe0163 100755 --- a/mcs/class/System/System.CodeDom/CodeStatement.cs +++ b/mcs/class/System/System.CodeDom/CodeStatement.cs @@ -4,6 +4,7 @@ // Author: // Sean MacIsaac (macisaac@ximian.com) // Daniel Stodden (stodden@in.tum.de) +// Marek Safar (marek.safar@seznam.cz) // // (C) 2001 Ximian, Inc. // @@ -40,6 +41,11 @@ namespace System.CodeDom : CodeObject { private CodeLinePragma linePragma; + +#if NET_2_0 + CodeDirectiveCollection endDirectives; + CodeDirectiveCollection startDirectives; +#endif // // Constructors @@ -59,5 +65,24 @@ namespace System.CodeDom linePragma = value; } } + +#if NET_2_0 + public CodeDirectiveCollection EndDirectives { + get { + if (endDirectives == null) + endDirectives = new CodeDirectiveCollection (); + return endDirectives; + } + } + + public CodeDirectiveCollection StartDirectives { + get { + if (startDirectives == null) + startDirectives = new CodeDirectiveCollection (); + return startDirectives; + } + } + +#endif } } diff --git a/mcs/class/System/System.CodeDom/CodeTypeDeclaration.cs b/mcs/class/System/System.CodeDom/CodeTypeDeclaration.cs index d5b1e2c9b04..c633c6b8d7e 100755 --- a/mcs/class/System/System.CodeDom/CodeTypeDeclaration.cs +++ b/mcs/class/System/System.CodeDom/CodeTypeDeclaration.cs @@ -4,6 +4,7 @@ // Author: // Sean MacIsaac (macisaac@ximian.com) // Daniel Stodden (stodden@in.tum.de) +// Marek Safar (marek.safar@seznam.cz) // // (C) 2001 Ximian, Inc. // @@ -46,6 +47,11 @@ namespace System.CodeDom private bool isEnum; private bool isStruct; +#if NET_2_0 + bool isPartial; + CodeTypeParameterCollection typeParameters; +#endif + // // Constructors // @@ -160,6 +166,25 @@ namespace System.CodeDom } } +#if NET_2_0 + public bool IsPartial { + get { + return isPartial; + } + set { + isPartial = value; + } + } + + public CodeTypeParameterCollection TypeParameters { + get { + if (typeParameters == null) + typeParameters = new CodeTypeParameterCollection (); + return typeParameters; + } + } +#endif + // // Events // diff --git a/mcs/class/System/System.CodeDom/CodeTypeMember.cs b/mcs/class/System/System.CodeDom/CodeTypeMember.cs index 829c131779c..cdc7641e609 100755 --- a/mcs/class/System/System.CodeDom/CodeTypeMember.cs +++ b/mcs/class/System/System.CodeDom/CodeTypeMember.cs @@ -4,6 +4,7 @@ // Author: // Sean MacIsaac (macisaac@ximian.com) // Daniel Stodden (stodden@in.tum.de) +// Marek Safar (marek.safar@seznam.cz) // // (C) 2001 Ximian, Inc. // @@ -45,6 +46,11 @@ namespace System.CodeDom private CodeAttributeDeclarationCollection customAttributes; private CodeLinePragma linePragma; +#if NET_2_0 + CodeDirectiveCollection endDirectives; + CodeDirectiveCollection startDirectives; +#endif + // // Constructors // @@ -104,5 +110,23 @@ namespace System.CodeDom name = value; } } + +#if NET_2_0 + public CodeDirectiveCollection EndDirectives { + get { + if (endDirectives == null) + endDirectives = new CodeDirectiveCollection (); + return endDirectives; + } + } + + public CodeDirectiveCollection StartDirectives { + get { + if (startDirectives == null) + startDirectives = new CodeDirectiveCollection (); + return startDirectives; + } + } +#endif } } diff --git a/mcs/class/System/System.CodeDom/CodeTypeParameter.cs b/mcs/class/System/System.CodeDom/CodeTypeParameter.cs new file mode 100644 index 00000000000..067898303e0 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeTypeParameter.cs @@ -0,0 +1,88 @@ +// +// System.CodeDom CodeTypeParameter class +// +// Author: +// Marek Safar (marek.safar@seznam.cz) +// +// (C) 2004 Ximian, Inc. +// + +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +#if NET_2_0 + +using System.Runtime.InteropServices; + +namespace System.CodeDom +{ + [Serializable] + [ComVisible (true), ClassInterface (ClassInterfaceType.AutoDispatch)] + public class CodeTypeParameter: CodeObject + { + CodeTypeReferenceCollection constraints; + CodeAttributeDeclarationCollection customAttributes; + bool hasConstructorConstraint; + string name; + + public CodeTypeParameter () {} + + public CodeTypeParameter (string name) + { + this.name = name; + } + + public CodeTypeReferenceCollection Constraints { + get { + if (constraints == null) + constraints = new CodeTypeReferenceCollection (); + return constraints; + } + } + + public CodeAttributeDeclarationCollection CustomAttributes { + get { + if (customAttributes == null) + customAttributes = new CodeAttributeDeclarationCollection (); + return customAttributes; + } + } + + public bool HasConstructorConstraint { + get { + return hasConstructorConstraint; + } + set { + hasConstructorConstraint = value; + } + } + + public string Name { + get { + return name; + } + set { + name = value; + } + } + } +} +#endif diff --git a/mcs/class/System/System.CodeDom/CodeTypeParameterCollection.cs b/mcs/class/System/System.CodeDom/CodeTypeParameterCollection.cs new file mode 100644 index 00000000000..fdcf5a4ead5 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeTypeParameterCollection.cs @@ -0,0 +1,74 @@ +// +// System.CodeDom CodeTypeParameterCollection class +// +// Author: +// Marek Safar (marek.safar@seznam.cz) +// +// (C) 2004 Ximian, Inc. +// + +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +#if NET_2_0 + +using System.Runtime.InteropServices; + +namespace System.CodeDom +{ + [Serializable] + [ComVisible (true), ClassInterface (ClassInterfaceType.AutoDispatch)] + public class CodeTypeParameterCollection: System.Collections.CollectionBase + { + public CodeTypeParameterCollection () {} + + public CodeTypeParameterCollection (CodeTypeParameterCollection value) + { + AddRange (value); + } + + public int Add (CodeTypeParameter value) + { + return List.Add (value); + } + + public void AddRange (CodeTypeParameterCollection value) + { + if (value == null) + return; + + foreach (object o in value) + List.Add (o); + } + + public CodeTypeParameter this [int index] + { + get { + return ((CodeTypeParameter) List [index]); + } + set { + List[index] = value; + } + } + } +} + +#endif diff --git a/mcs/class/System/System.CodeDom/CodeTypeReference.cs b/mcs/class/System/System.CodeDom/CodeTypeReference.cs index 88c0d1d5418..bd50148365e 100644 --- a/mcs/class/System/System.CodeDom/CodeTypeReference.cs +++ b/mcs/class/System/System.CodeDom/CodeTypeReference.cs @@ -3,6 +3,7 @@ // // Author: // Daniel Stodden (stodden@in.tum.de) +// Marek Safar (marek.safar@seznam.cz) // // (C) 2001 Ximian, Inc. // @@ -42,13 +43,38 @@ namespace System.CodeDom private CodeTypeReference arrayType; private int rank; +#if NET_2_0 + CodeTypeReferenceCollection typeArguments; + CodeTypeReferenceOptions codeTypeReferenceOption; +#endif + // // Constructors // - [MonoTODO ("Missing implementation. Implement array info extraction from the string")] public CodeTypeReference( string baseType ) { - this.baseType = baseType; + if (baseType.Length == 0) { + this.baseType = typeof (void).FullName; + return; + } + + int array_start = baseType.IndexOf ('['); + if (array_start == -1) { + this.baseType = baseType; + return; + } + string[] args = baseType.Split (','); + + int array_end = baseType.IndexOf (']'); + +#if NET_2_0 + if ((array_end - array_start) != args.Length) { + arrayType = new CodeTypeReference (baseType.Substring (0, array_start)); + array_start++; + TypeArguments.Add (new CodeTypeReference (baseType.Substring (array_start, array_end - array_start))); + } else +#endif + arrayType = new CodeTypeReference (baseType.Substring (0, array_start), args.Length); } public CodeTypeReference( Type baseType ) @@ -56,6 +82,7 @@ namespace System.CodeDom if (baseType.IsArray) { this.rank = baseType.GetArrayRank (); this.arrayType = new CodeTypeReference (baseType.GetElementType ()); + this.baseType = arrayType.BaseType; return; } this.baseType = baseType.FullName; @@ -73,6 +100,30 @@ namespace System.CodeDom { } +#if NET_2_0 + public CodeTypeReference( CodeTypeParameter typeParameter ) : + this (typeParameter.Name) + { + } + + public CodeTypeReference( string typeName, CodeTypeReferenceOptions codeTypeReferenceOption ) : + this (typeName) + { + this.codeTypeReferenceOption = codeTypeReferenceOption; + } + + public CodeTypeReference( Type type, CodeTypeReferenceOptions codeTypeReferenceOption ) : + this (type) + { + this.codeTypeReferenceOption = codeTypeReferenceOption; + } + + public CodeTypeReference( string typeName, params CodeTypeReference[] typeArguments ) : + this (typeName) + { + TypeArguments.AddRange (typeArguments); + } +#endif // // Properties @@ -108,5 +159,26 @@ namespace System.CodeDom baseType = value; } } + +#if NET_2_0 + [ComVisible (false)] + public CodeTypeReferenceOptions Options { + get { + return codeTypeReferenceOption; + } + set { + codeTypeReferenceOption = value; + } + } + + [ComVisible (false)] + public CodeTypeReferenceCollection TypeArguments { + get { + if (typeArguments == null) + typeArguments = new CodeTypeReferenceCollection (); + return typeArguments; + } + } +#endif } } diff --git a/mcs/class/System/System.CodeDom/CodeTypeReferenceOptions.cs b/mcs/class/System/System.CodeDom/CodeTypeReferenceOptions.cs new file mode 100644 index 00000000000..28211660a76 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeTypeReferenceOptions.cs @@ -0,0 +1,47 @@ +// +// System.CodeDom CodeTypeReferenceOptions enum +// +// Author: +// Marek Safar (marek.safar@seznam.cz) +// +// (C) 2004 Ximian, Inc. +// + +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +#if NET_2_0 + +using System.Runtime.InteropServices; + +namespace System.CodeDom +{ + [Flags] + [Serializable] + [ComVisible (true)] + public enum CodeTypeReferenceOptions + { + GlobalReference = 1, + GenericTypeParameter = 1 << 1 + } +} + +#endif diff --git a/mcs/class/System/System.dll.sources b/mcs/class/System/System.dll.sources index 8e19df236e1..d7a3775ac05 100755 --- a/mcs/class/System/System.dll.sources +++ b/mcs/class/System/System.dll.sources @@ -18,7 +18,6 @@ Microsoft.Win32/SessionEndReasons.cs Microsoft.Win32/SystemEvents.cs Microsoft.Win32/TimerElapsedEventArgs.cs Microsoft.Win32/TimerElapsedEventHandler.cs -Microsoft.Win32/TODOAttribute.cs Microsoft.Win32/UserPreferenceCategory.cs Microsoft.Win32/UserPreferenceChangedEventArgs.cs Microsoft.Win32/UserPreferenceChangedEventHandler.cs @@ -39,6 +38,7 @@ System.CodeDom/CodeBinaryOperatorType.cs System.CodeDom/CodeCastExpression.cs System.CodeDom/CodeCatchClauseCollection.cs System.CodeDom/CodeCatchClause.cs +System.CodeDom/CodeChecksumPragma.cs System.CodeDom/CodeComment.cs System.CodeDom/CodeCommentStatementCollection.cs System.CodeDom/CodeCommentStatement.cs @@ -48,6 +48,8 @@ System.CodeDom/CodeConstructor.cs System.CodeDom/CodeDelegateCreateExpression.cs System.CodeDom/CodeDelegateInvokeExpression.cs System.CodeDom/CodeDirectionExpression.cs +System.CodeDom/CodeDirective.cs +System.CodeDom/CodeDirectiveCollection.cs System.CodeDom/CodeEntryPointMethod.cs System.CodeDom/CodeEventReferenceExpression.cs System.CodeDom/CodeExpressionCollection.cs @@ -77,6 +79,8 @@ System.CodeDom/CodeParameterDeclarationExpression.cs System.CodeDom/CodePrimitiveExpression.cs System.CodeDom/CodePropertyReferenceExpression.cs System.CodeDom/CodePropertySetValueReferenceExpression.cs +System.CodeDom/CodeRegionDirective.cs +System.CodeDom/CodeRegionMode.cs System.CodeDom/CodeRemoveEventStatement.cs System.CodeDom/CodeSnippetCompileUnit.cs System.CodeDom/CodeSnippetExpression.cs @@ -94,9 +98,12 @@ System.CodeDom/CodeTypeDelegate.cs System.CodeDom/CodeTypeMemberCollection.cs System.CodeDom/CodeTypeMember.cs System.CodeDom/CodeTypeOfExpression.cs +System.CodeDom/CodeTypeParameter.cs +System.CodeDom/CodeTypeParameterCollection.cs System.CodeDom/CodeTypeReferenceCollection.cs System.CodeDom/CodeTypeReference.cs System.CodeDom/CodeTypeReferenceExpression.cs +System.CodeDom/CodeTypeReferenceOptions.cs System.CodeDom/CodeVariableDeclarationStatement.cs System.CodeDom/CodeVariableReferenceExpression.cs System.CodeDom.Compiler/CodeCompiler.cs @@ -106,6 +113,7 @@ System.CodeDom.Compiler/CodeGeneratorOptions.cs System.CodeDom.Compiler/CodeParser.cs System.CodeDom.Compiler/CompilerErrorCollection.cs System.CodeDom.Compiler/CompilerError.cs +System.CodeDom.Compiler/CompilerInfo.cs System.CodeDom.Compiler/CompilerParameters.cs System.CodeDom.Compiler/CompilerResults.cs System.CodeDom.Compiler/Executor.cs |