Browse Source

Added support for My.Forms.

Added support for ImportProjectItems.
Reworked NRefactory to use List<AttributeSection> instead of ArrayList for attributes and List<ParameterDeclarationExpression> instead of ArrayList for parameter declarations.
Added Ctrl+'.' debug code completion.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@220 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 21 years ago
parent
commit
6dbad22c85
  1. 296
      data/templates/file/CSharp/CSharp.Wizards.TypedCollection.xft
  2. 350
      data/templates/file/CSharp/CSharp.Wizards.TypedHashtable.xft
  3. 11
      data/templates/file/VBNet/VBNet.EmptyClass.xft
  4. 63
      data/templates/file/VBNet/VBNet.Forms.Form.xft
  5. 54
      data/templates/file/VBNet/VBNet.Forms.UserControl.xft
  6. 9
      data/templates/file/VBNet/VBNet.Interface.xft
  7. 24
      data/templates/file/VBNet/VBNet.Module.xft
  8. 54
      data/templates/file/VBNet/VBNet.MyExtensionClass.xft
  9. 37
      data/templates/file/VBNet/VBNet.UnitTest.xft
  10. 304
      data/templates/file/VBNet/VBNet.Wizards.TypedCollection.xft
  11. 327
      data/templates/file/VBNet/VBNet.Wizards.TypedHashtable.xft
  12. 9
      data/templates/project/CSharp/ConsoleProject.xpt
  13. 14
      data/templates/project/CSharp/ControlLibrary.xpt
  14. 18
      data/templates/project/CSharp/Direct3DProject.xpt
  15. 8
      data/templates/project/CSharp/EmptyProject.xpt
  16. 14
      data/templates/project/CSharp/FormsProject.xpt
  17. 8
      data/templates/project/CSharp/Library.xpt
  18. 87
      data/templates/project/CSharp/Service.xpt
  19. 14
      data/templates/project/CSharp/SharpDevelopAddin.xpt
  20. 24
      data/templates/project/VBNet/ConsoleProject.xpt
  21. 88
      data/templates/project/VBNet/ControlLibrary.xpt
  22. 241
      data/templates/project/VBNet/Direct3DProject.xpt
  23. 13
      data/templates/project/VBNet/EmptyProject.xpt
  24. 107
      data/templates/project/VBNet/FormsProject.xpt
  25. 25
      data/templates/project/VBNet/Library.xpt
  26. 85
      data/templates/project/VBNet/Service.xpt
  27. 74
      src/AddIns/BackendBindings/VBNetBinding/Project/Src/MyNamespaceBuilder.cs
  28. 12
      src/AddIns/BackendBindings/VBNetBinding/Project/Src/Parser/Parser.cs
  29. 24
      src/AddIns/BackendBindings/VBNetBinding/Project/Src/Project/VBNetProject.cs
  30. 2
      src/AddIns/Misc/NUnitPad/Project/Src/Gui/NUnitPadContent.cs
  31. 75
      src/Libraries/ICSharpCode.TextEditor/Project/Resources/CSharp-Mode.xshd
  32. 2
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/BracketHighlighter.cs
  33. 13
      src/Libraries/NRefactory/Project/Src/Parser/AST/AttributedNode.cs
  34. 6
      src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Expressions/AnonymousMethodExpression.cs
  35. 4
      src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/TypeLevel/DestructorDeclaration.cs
  36. 12
      src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/TypeLevel/IndexerDeclaration.cs
  37. 9
      src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/TypeLevel/OperatorDeclaration.cs
  38. 24
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/AttributeSection.cs
  39. 8
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/GlobalScope/DelegateDeclaration.cs
  40. 4
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/GlobalScope/TypeDeclaration.cs
  41. 5
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/ConstructorDeclaration.cs
  42. 11
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/EventAddRemoveRegion.cs
  43. 8
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/EventDeclaration.cs
  44. 30
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/FieldDeclaration.cs
  45. 2
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/MethodDeclaration.cs
  46. 6
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/ParameterDeclarationExpression.cs
  47. 4
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/PropertyDeclaration.cs
  48. 15
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/PropertyGetSetRegion.cs
  49. 15
      src/Libraries/NRefactory/Project/Src/Parser/AST/ParametrizedNode.cs
  50. 3
      src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/TypeLevel/DeclareDeclaration.cs
  51. 112
      src/Libraries/NRefactory/Project/Src/Parser/CSharp/Parser.cs
  52. 124
      src/Libraries/NRefactory/Project/Src/Parser/CSharp/cs.ATG
  53. 101
      src/Libraries/NRefactory/Project/Src/Parser/VBNet/Parser.cs
  54. 98
      src/Libraries/NRefactory/Project/Src/Parser/VBNet/VBNET.ATG
  55. 40
      src/Libraries/NRefactory/Test/Parser/GlobalScope/AttributeSectionTests.cs
  56. 4
      src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
  57. 25
      src/Main/Base/Project/Src/Dom/IAttribute.cs
  58. 37
      src/Main/Base/Project/Src/Dom/IAttributeSection.cs
  59. 1
      src/Main/Base/Project/Src/Dom/IClass.cs
  60. 4
      src/Main/Base/Project/Src/Dom/ICompilationUnit.cs
  61. 3
      src/Main/Base/Project/Src/Dom/IDecoration.cs
  62. 6
      src/Main/Base/Project/Src/Dom/Implementations/AbstractDecoration.cs
  63. 2
      src/Main/Base/Project/Src/Dom/Implementations/CompoundClass.cs
  64. 58
      src/Main/Base/Project/Src/Dom/Implementations/DefaultAttribute.cs
  65. 6
      src/Main/Base/Project/Src/Dom/Implementations/DefaultCompilationUnit.cs
  66. 80
      src/Main/Base/Project/Src/Dom/LanguageProperties.cs
  67. 38
      src/Main/Base/Project/Src/Dom/NRefactoryResolver/NRefactoryASTConvertVisitor.cs
  68. 20
      src/Main/Base/Project/Src/Dom/NRefactoryResolver/NRefactoryResolver.cs
  69. 6
      src/Main/Base/Project/Src/Dom/NRefactoryResolver/TypeVisitor.cs
  70. 4
      src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/Commands/ReferenceFolderNodeCommands.cs
  71. 12
      src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/ProjectBrowserControl.cs
  72. 4
      src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/Util/UpdateReferencesVisitor.cs
  73. 43
      src/Main/Base/Project/Src/Internal/Templates/Project/ProjectDescriptor.cs
  74. 28
      src/Main/Base/Project/Src/Internal/Templates/Project/ProjectTemplate.cs
  75. 8
      src/Main/Base/Project/Src/Project/AbstractProject.cs
  76. 27
      src/Main/Base/Project/Src/Project/Items/ImportProjectItem.cs
  77. 4
      src/Main/Base/Project/Src/Project/Items/ProjectItem.cs
  78. 2
      src/Main/Base/Project/Src/Project/Items/ProjectItemFactory.cs
  79. 2
      src/Main/Base/Project/Src/Project/Items/UnknownProjectItem.cs
  80. 12
      src/Main/Base/Project/Src/Project/MSBuildProject.cs
  81. 64
      src/Main/Base/Project/Src/Services/ParserService/DefaultProjectContent.cs
  82. 2
      src/Main/Base/Project/Src/Services/ParserService/IProjectContent.cs
  83. 47
      src/Main/Base/Project/Src/Services/ParserService/ParseProjectContent.cs
  84. 20
      src/Main/Base/Project/Src/Services/ProjectService/ProjectItemEventHandler.cs
  85. 30
      src/Main/Base/Project/Src/Services/ProjectService/ProjectReferenceEventHandler.cs
  86. 48
      src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs
  87. 13
      src/Main/Base/Project/Src/TextEditor/Actions.cs
  88. 20
      src/Main/Base/Project/Src/TextEditor/Gui/Editor/CompletionWindow/CodeCompletionDataProvider.cs
  89. 3
      src/Main/Base/Project/Src/TextEditor/Gui/Editor/SharpDevelopTextAreaControl.cs
  90. 4
      src/Main/Base/Test/SearchClassTests.cs
  91. 82
      src/SharpDevelop.sln

296
data/templates/file/CSharp/CSharp.Wizards.TypedCollection.xft

@ -1,296 +0,0 @@ @@ -1,296 +0,0 @@
<?xml version="1.0"?>
<Template author="Mike Krueger" version="1.0">
<Config
name = "${res:Templates.File.TypedCollection.Name}"
icon = "C#.File.FullFile"
category = "C#"
defaultname = "TypedCollection${Number}.cs"
language = "C#"
/>
<Description>${res:Templates.File.TypedCollection.Description}</Description>
<Properties>
<Property
name = "ItemType"
localizedName = "${res:Templates.File.Properties.TypedCollectionWizard.ItemType}"
type = "System.String"
category = "${res:Templates.File.Properties.ContextCategory}"
description = "${res:Templates.File.Properties.TypedCollectionWizard.ItemType.Description}"
/>
<Property
name = "Accessibility"
localizedName = "${res:Templates.File.Properties.Accessibility}"
type = "Types:Accessibility"
category = "${res:Templates.File.Properties.OptionCategory}"
defaultValue = "public"
description = "${res:Templates.File.Properties.Accessibility.Description}"
/>
<Property
name = "GenerateDocumentation"
localizedName = "${res:Templates.File.Properties.GenerateDocumentation}"
type = "System.Boolean"
category = "${res:Templates.File.Properties.OptionCategory}"
defaultValue = "True"
description = "${res:Templates.File.Properties.GenerateDocumentation}"
/>
</Properties>
<Types>
<Type name = "Accessibility">
<Enum name = "Public" value = "public"/>
<Enum name = "Protected" value = "protected"/>
<Enum name = "Private" value = "private"/>
<Enum name = "Internal" value = "internal"/>
<Enum name = "Protected Internal" value = "protected internal"/>
<Enum name = "Internal Protected" value = "internal protected"/>
</Type>
</Types>
<!--
Special new file templates:
${StandardNamespace} -> Standardnamespace of the current project or FileNameWithoutExtension
${FullName} -> Full generated path name
${FileName} -> File name with extension
${FileNameWithoutExtension} -> File name without extension
${Extension} -> Extension in the form ".cs"
${Path} -> Full path of the file
-->
<Files>
<File name="${FullName}" language="C#"><![CDATA[${StandardHeader.C#}
using System;
using System.Collections;
namespace ${StandardNamespace}
{
<%if (GenerateDocumentation) {%> /// <summary>
/// A collection that stores <see cref='${Properties.ItemType}'/> objects.
/// </summary>
<%}%> [Serializable()]
${Properties.Accessibility} class ${ClassName} : CollectionBase {
<%if (GenerateDocumentation) {%> /// <summary>
/// Initializes a new instance of <see cref='${ClassName}'/>.
/// </summary>
<%}%> public ${ClassName}()
{
}
<%if (GenerateDocumentation) {%> /// <summary>
/// Initializes a new instance of <see cref='${ClassName}'/> based on another <see cref='${ClassName}'/>.
/// </summary>
/// <param name='val'>
/// A <see cref='${ClassName}'/> from which the contents are copied
/// </param>
<%}%> public ${ClassName}(${ClassName} val)
{
this.AddRange(val);
}
<%if (GenerateDocumentation) {%> /// <summary>
/// Initializes a new instance of <see cref='${ClassName}'/> containing any array of <see cref='${Properties.ItemType}'/> objects.
/// </summary>
/// <param name='val'>
/// A array of <see cref='${Properties.ItemType}'/> objects with which to intialize the collection
/// </param>
<%}%> public ${ClassName}(${Properties.ItemType}[] val)
{
this.AddRange(val);
}
<%if (GenerateDocumentation) {%> /// <summary>
/// Represents the entry at the specified index of the <see cref='${Properties.ItemType}'/>.
/// </summary>
/// <param name='index'>The zero-based index of the entry to locate in the collection.</param>
/// <value>The entry at the specified index of the collection.</value>
/// <exception cref='ArgumentOutOfRangeException'><paramref name='index'/> is outside the valid range of indexes for the collection.</exception>
<%}%> public ${Properties.ItemType} this[int index] {
get {
return ((${Properties.ItemType})(List[index]));
}
set {
List[index] = value;
}
}
<%if (GenerateDocumentation) {%> /// <summary>
/// Adds a <see cref='${Properties.ItemType}'/> with the specified value to the
/// <see cref='${ClassName}'/>.
/// </summary>
/// <param name='val'>The <see cref='${Properties.ItemType}'/> to add.</param>
/// <returns>The index at which the new element was inserted.</returns>
/// <seealso cref='${ClassName}.AddRange'/>
<%}%> public int Add(${Properties.ItemType} val)
{
return List.Add(val);
}
<%if (GenerateDocumentation) {%> /// <summary>
/// Copies the elements of an array to the end of the <see cref='${ClassName}'/>.
/// </summary>
/// <param name='val'>
/// An array of type <see cref='${Properties.ItemType}'/> containing the objects to add to the collection.
/// </param>
/// <seealso cref='${ClassName}.Add'/>
<%}%> public void AddRange(${Properties.ItemType}[] val)
{
for (int i = 0; i < val.Length; i++) {
this.Add(val[i]);
}
}
<%if (GenerateDocumentation) {%> /// <summary>
/// Adds the contents of another <see cref='${ClassName}'/> to the end of the collection.
/// </summary>
/// <param name='val'>
/// A <see cref='${ClassName}'/> containing the objects to add to the collection.
/// </param>
/// <seealso cref='${ClassName}.Add'/>
<%}%> public void AddRange(${ClassName} val)
{
for (int i = 0; i < val.Count; i++)
{
this.Add(val[i]);
}
}
<%if (GenerateDocumentation) {%> /// <summary>
/// Gets a value indicating whether the
/// <see cref='${ClassName}'/> contains the specified <see cref='${Properties.ItemType}'/>.
/// </summary>
/// <param name='val'>The <see cref='${Properties.ItemType}'/> to locate.</param>
/// <returns>
/// <see langword='true'/> if the <see cref='${Properties.ItemType}'/> is contained in the collection;
/// otherwise, <see langword='false'/>.
/// </returns>
/// <seealso cref='${ClassName}.IndexOf'/>
<%}%> public bool Contains(${Properties.ItemType} val)
{
return List.Contains(val);
}
<%if (GenerateDocumentation) {%> /// <summary>
/// Copies the <see cref='${ClassName}'/> values to a one-dimensional <see cref='Array'/> instance at the
/// specified index.
/// </summary>
/// <param name='array'>The one-dimensional <see cref='Array'/> that is the destination of the values copied from <see cref='${ClassName}'/>.</param>
/// <param name='index'>The index in <paramref name='array'/> where copying begins.</param>
/// <exception cref='ArgumentException'>
/// <para><paramref name='array'/> is multidimensional.</para>
/// <para>-or-</para>
/// <para>The number of elements in the <see cref='${ClassName}'/> is greater than
/// the available space between <paramref name='arrayIndex'/> and the end of
/// <paramref name='array'/>.</para>
/// </exception>
/// <exception cref='ArgumentNullException'><paramref name='array'/> is <see langword='null'/>. </exception>
/// <exception cref='ArgumentOutOfRangeException'><paramref name='arrayIndex'/> is less than <paramref name='array'/>'s lowbound. </exception>
/// <seealso cref='Array'/>
<%}%> public void CopyTo(${Properties.ItemType}[] array, int index)
{
List.CopyTo(array, index);
}
<%if (GenerateDocumentation) {%> /// <summary>
/// Returns the index of a <see cref='${Properties.ItemType}'/> in
/// the <see cref='${ClassName}'/>.
/// </summary>
/// <param name='val'>The <see cref='${Properties.ItemType}'/> to locate.</param>
/// <returns>
/// The index of the <see cref='${Properties.ItemType}'/> of <paramref name='val'/> in the
/// <see cref='${ClassName}'/>, if found; otherwise, -1.
/// </returns>
/// <seealso cref='${ClassName}.Contains'/>
<%}%> public int IndexOf(${Properties.ItemType} val)
{
return List.IndexOf(val);
}
<%if (GenerateDocumentation) {%> /// <summary>
/// Inserts a <see cref='${Properties.ItemType}'/> into the <see cref='${ClassName}'/> at the specified index.
/// </summary>
/// <param name='index'>The zero-based index where <paramref name='val'/> should be inserted.</param>
/// <param name='val'>The <see cref='${Properties.ItemType}'/> to insert.</param>
/// <seealso cref='${ClassName}.Add'/>
<%}%> public void Insert(int index, ${Properties.ItemType} val)
{
List.Insert(index, val);
}
<%if (GenerateDocumentation) {%> /// <summary>
/// Returns an enumerator that can iterate through the <see cref='${ClassName}'/>.
/// </summary>
/// <seealso cref='IEnumerator'/>
<%}%> public new ${Properties.ItemType}Enumerator GetEnumerator()
{
return new ${Properties.ItemType}Enumerator(this);
}
<%if (GenerateDocumentation) {%> /// <summary>
/// Removes a specific <see cref='${Properties.ItemType}'/> from the <see cref='${ClassName}'/>.
/// </summary>
/// <param name='val'>The <see cref='${Properties.ItemType}'/> to remove from the <see cref='${ClassName}'/>.</param>
/// <exception cref='ArgumentException'><paramref name='val'/> is not found in the Collection.</exception>
<%}%> public void Remove(${Properties.ItemType} val)
{
List.Remove(val);
}
<%if (GenerateDocumentation) {%> /// <summary>
/// Enumerator that can iterate through a ${ClassName}.
/// </summary>
/// <seealso cref='IEnumerator'/>
/// <seealso cref='${ClassName}'/>
/// <seealso cref='${Properties.ItemType}'/>
<%}%> public class ${Properties.ItemType}Enumerator : IEnumerator
{
IEnumerator baseEnumerator;
IEnumerable temp;
<%if (GenerateDocumentation) {%> /// <summary>
/// Initializes a new instance of <see cref='${Properties.ItemType}Enumerator'/>.
/// </summary>
<%}%> public ${Properties.ItemType}Enumerator(${ClassName} mappings)
{
this.temp = ((IEnumerable)(mappings));
this.baseEnumerator = temp.GetEnumerator();
}
<%if (GenerateDocumentation) {%> /// <summary>
/// Gets the current <see cref='${Properties.ItemType}'/> in the <seealso cref='${ClassName}'/>.
/// </summary>
<%}%> public ${Properties.ItemType} Current {
get {
return ((${Properties.ItemType})(baseEnumerator.Current));
}
}
object IEnumerator.Current {
get {
return baseEnumerator.Current;
}
}
<%if (GenerateDocumentation) {%> /// <summary>
/// Advances the enumerator to the next <see cref='${Properties.ItemType}'/> of the <see cref='${ClassName}'/>.
/// </summary>
<%}%> public bool MoveNext()
{
return baseEnumerator.MoveNext();
}
<%if (GenerateDocumentation) {%> /// <summary>
/// Sets the enumerator to its initial position, which is before the first element in the <see cref='${ClassName}'/>.
/// </summary>
<%}%> public void Reset()
{
baseEnumerator.Reset();
}
}
}
}]]></File>
</Files>
<AdditionalOptions/>
</Template>

350
data/templates/file/CSharp/CSharp.Wizards.TypedHashtable.xft

@ -1,350 +0,0 @@ @@ -1,350 +0,0 @@
<?xml version="1.0"?>
<Template author="Mike Krueger" version="1.0">
<Config
name = "${res:Templates.File.TypedHashTable.Name}"
icon = "C#.File.FullFile"
category = "C#"
defaultname = "Class${Number}.cs"
language = "C#"
/>
<Description>${res:Templates.File.TypedHashTable.Description}</Description>
<Properties>
<Property
name = "KeyType"
localizedName = "${res:Templates.File.Properties.TypedHashtableWizard.KeyType}"
type = "System.String"
category = "${res:Templates.File.Properties.ContextCategory}"
description = "${res:Templates.File.Properties.TypedHashtableWizard.KeyType.Description}"
/>
<Property
name = "ValueType"
localizedName = "${res:Templates.File.Properties.TypedHashtableWizard.ValueType}"
type = "System.String"
category = "${res:Templates.File.Properties.ContextCategory}"
description = "${res:Templates.File.Properties.TypedHashtableWizard.ValueType.Description}"
/>
<Property
name = "Accessibility"
localizedName = "${res:Templates.File.Properties.Accessibility}"
type = "Types:Accessibility"
category = "${res:Templates.File.Properties.OptionCategory}"
defaultValue = "public"
description = "${res:Templates.File.Properties.Accessibility.Description}"
/>
</Properties>
<Types>
<Type name = "Accessibility">
<Enum name = "Public" value = "public"/>
<Enum name = "Protected" value = "protected"/>
<Enum name = "Private" value = "private"/>
<Enum name = "Internal" value = "internal"/>
<Enum name = "Protected Internal" value = "protected internal"/>
<Enum name = "Internal Protected" value = "internal protected"/>
</Type>
</Types>
<!--
Special new file templates:
${StandardNamespace} -> Standardnamespace of the current project or FileNameWithoutExtension
${FullName} -> Full generated path name
${FileName} -> File name with extension
${FileNameWithoutExtension} -> File name without extension
${Extension} -> Extension in the form ".cs"
${Path} -> Full path of the file
-->
<Files>
<File name="${FullName}" language="C#"><![CDATA[${StandardHeader.C#}
using System;
using System.Collections;
namespace ${StandardNamespace}
{
${Properties.Accessibility} class ${ClassName} : IDictionary, ICollection, IEnumerable, ICloneable
{
protected Hashtable innerHash;
#region "Constructors"
public ${ClassName}()
{
innerHash = new Hashtable();
}
public ${ClassName}(${ClassName} original)
{
innerHash = new Hashtable(original.innerHash);
}
public ${ClassName}(IDictionary dictionary)
{
innerHash = new Hashtable(dictionary);
}
public ${ClassName}(int capacity)
{
innerHash = new Hashtable(capacity);
}
public ${ClassName}(IDictionary dictionary, float loadFactor)
{
innerHash = new Hashtable(dictionary, loadFactor);
}
public ${ClassName}(IHashCodeProvider codeProvider, IComparer comparer)
{
innerHash = new Hashtable(codeProvider, comparer);
}
public ${ClassName}(int capacity, int loadFactor)
{
innerHash = new Hashtable(capacity, loadFactor);
}
public ${ClassName}(IDictionary dictionary, IHashCodeProvider codeProvider, IComparer comparer)
{
innerHash = new Hashtable(dictionary, codeProvider, comparer);
}
public ${ClassName}(int capacity, IHashCodeProvider codeProvider, IComparer comparer)
{
innerHash = new Hashtable(capacity, codeProvider, comparer);
}
public ${ClassName}(IDictionary dictionary, float loadFactor, IHashCodeProvider codeProvider, IComparer comparer)
{
innerHash = new Hashtable(dictionary, loadFactor, codeProvider, comparer);
}
public ${ClassName}(int capacity, float loadFactor, IHashCodeProvider codeProvider, IComparer comparer)
{
innerHash = new Hashtable(capacity, loadFactor, codeProvider, comparer);
}
#endregion
#region Implementation of IDictionary
public ${ClassName}Enumerator GetEnumerator()
{
return new ${ClassName}Enumerator(this);
}
System.Collections.IDictionaryEnumerator IDictionary.GetEnumerator()
{
return new ${ClassName}Enumerator(this);
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
public void Remove(${Properties.KeyType} key)
{
innerHash.Remove(key);
}
void IDictionary.Remove(object key)
{
Remove ((${Properties.KeyType})key);
}
public bool Contains(${Properties.KeyType} key)
{
return innerHash.Contains(key);
}
bool IDictionary.Contains(object key)
{
return Contains((${Properties.KeyType})key);
}
public void Clear()
{
innerHash.Clear();
}
public void Add(${Properties.KeyType} key, ${Properties.ValueType} value)
{
innerHash.Add(key, value);
}
void IDictionary.Add(object key, object value)
{
Add ((${Properties.KeyType})key, (${Properties.ValueType})value);
}
public bool IsReadOnly {
get {
return innerHash.IsReadOnly;
}
}
public ${Properties.ValueType} this[${Properties.KeyType} key] {
get {
return (${Properties.ValueType}) innerHash[key];
}
set {
innerHash[key] = value;
}
}
object IDictionary.this[object key] {
get {
return this[(${Properties.KeyType})key];
}
set {
this[(${Properties.KeyType})key] = (${Properties.ValueType})value;
}
}
public System.Collections.ICollection Values {
get {
return innerHash.Values;
}
}
public System.Collections.ICollection Keys {
get {
return innerHash.Keys;
}
}
public bool IsFixedSize {
get {
return innerHash.IsFixedSize;
}
}
#endregion
#region Implementation of ICollection
public void CopyTo(System.Array array, int index)
{
innerHash.CopyTo (array, index);
}
public bool IsSynchronized {
get {
return innerHash.IsSynchronized;
}
}
public int Count {
get {
return innerHash.Count;
}
}
public object SyncRoot {
get {
return innerHash.SyncRoot;
}
}
#endregion
#region Implementation of ICloneable
public ${ClassName} Clone()
{
${ClassName} clone = new ${ClassName}();
clone.innerHash = (Hashtable) innerHash.Clone();
return clone;
}
object ICloneable.Clone()
{
return Clone();
}
#endregion
#region "HashTable Methods"
public bool ContainsKey(${Properties.KeyType} key)
{
return innerHash.ContainsKey(key);
}
public bool ContainsValue(${Properties.ValueType} value)
{
return innerHash.ContainsValue(value);
}
public static ${ClassName} Synchronized(${ClassName} nonSync)
{
${ClassName} sync = new ${ClassName}();
sync.innerHash = Hashtable.Synchronized(nonSync.innerHash);
return sync;
}
#endregion
internal Hashtable InnerHash {
get {
return innerHash;
}
}
}
public class ${ClassName}Enumerator : IDictionaryEnumerator
{
private IDictionaryEnumerator innerEnumerator;
internal ${ClassName}Enumerator(${ClassName} enumerable)
{
innerEnumerator = enumerable.InnerHash.GetEnumerator();
}
#region Implementation of IDictionaryEnumerator
public ${Properties.KeyType} Key {
get {
return (${Properties.KeyType})innerEnumerator.Key;
}
}
object IDictionaryEnumerator.Key {
get {
return Key;
}
}
public ${Properties.ValueType} Value {
get {
return (${Properties.ValueType})innerEnumerator.Value;
}
}
object IDictionaryEnumerator.Value {
get {
return Value;
}
}
public System.Collections.DictionaryEntry Entry {
get {
return innerEnumerator.Entry;
}
}
#endregion
#region Implementation of IEnumerator
public void Reset()
{
innerEnumerator.Reset();
}
public bool MoveNext()
{
return innerEnumerator.MoveNext();
}
public object Current {
get {
return innerEnumerator.Current;
}
}
#endregion
}
}]]></File>
</Files>
<AdditionalOptions/>
</Template>

11
data/templates/file/VBNet/VBNet.EmptyClass.xft

@ -23,16 +23,9 @@ @@ -23,16 +23,9 @@
<Files>
<File name="${FullName}" language="VBNET"><![CDATA[${StandardHeader.VBNET}
Imports System
Namespace ${StandardNamespace}
Public Class ${ClassName}
Public Class ${ClassName}
Public Sub New()
End Sub
End Class
End Namespace
End Class
]]></File>
</Files>

63
data/templates/file/VBNet/VBNet.Forms.Form.xft

@ -23,43 +23,34 @@ @@ -23,43 +23,34 @@
<Files>
<File name="${FullName}" language="VBNET"><![CDATA[${StandardHeader.VBNET}
Imports System
Imports System.Drawing
Imports System.Windows.Forms
Namespace ${StandardNamespace}
Public Class ${ClassName}
Inherits Form
Public Sub New()
'
' The Me.InitializeComponent call is required for Windows Forms designer support.
'
Me.InitializeComponent
'
' TODO : Add constructor code after InitializeComponents
'
End Sub
Public Class ${ClassName}
Inherits System.Windows.Forms.Form
Public Sub New()
MyBase.New
'
' The Me.InitializeComponent call is required for Windows Forms designer support.
'
Me.InitializeComponent
'
' TODO : Add constructor code after InitializeComponents
'
End Sub
#Region " Windows Forms Designer generated code "
' This method is required for Windows Forms designer support.
' Do not change the method contents inside the source code editor. The Forms designer might
' not be able to load this method if it was changed manually.
Private Sub InitializeComponent()
'
'${ClassName}
'
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(292, 266)
Me.Name = "${ClassName}"
Me.Text = "${ClassName}"
End Sub
#End Region
End Class
End Namespace
#Region " Windows Forms Designer generated code "
' This method is required for Windows Forms designer support.
' Do not change the method contents inside the source code editor. The Forms designer might
' not be able to load this method if it was changed manually.
Private Sub InitializeComponent()
'
'${ClassName}
'
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(292, 266)
Me.Name = "${ClassName}"
Me.Text = "${ClassName}"
End Sub
#End Region
End Class
]]></File>
</Files>

54
data/templates/file/VBNet/VBNet.Forms.UserControl.xft

@ -22,39 +22,29 @@ @@ -22,39 +22,29 @@
<Files>
<File name="${FullName}" language="VBNET"><![CDATA[${StandardHeader.VBNET}
Imports System
Imports System.Drawing
Imports System.ComponentModel
Imports System.Windows.Forms
Namespace ${StandardNamespace}
Public Class ${ClassName}
Inherits UserControl
Public Sub New()
' Must be called for initialization
Me.InitializeComponent()
'
' TODO : Add constructor code after InitializeComponents
'
End Sub
Public Class ${ClassName}
Inherits System.Windows.Forms.UserControl
Public Sub New()
MyBase.New
' Must be called for initialization
Me.InitializeComponent
'
' TODO : Add constructor code after InitializeComponents
'
End Sub
#Region " Windows Forms Designer generated code "
' This method is required for Windows Forms designer support.
' Do not change the method contents inside the source code editor. The Forms designer might
' not be able to load this method if it was changed manually.
Private Sub InitializeComponent()
'
'${ClassName}
'
Me.Name = "${ClassName}"
End Sub
#End Region
End Class
End Namespace
#Region " Windows Forms Designer generated code "
' This method is required for Windows Forms designer support.
' Do not change the method contents inside the source code editor. The Forms designer might
' not be able to load this method if it was changed manually.
Private Sub InitializeComponent()
'
'${ClassName}
'
Me.Name = "${ClassName}"
End Sub
#End Region
End Class
]]></File>
</Files>

9
data/templates/file/VBNet/VBNet.Interface.xft

@ -23,12 +23,9 @@ @@ -23,12 +23,9 @@
<Files>
<File name="${FullName}" language="VBNET"><![CDATA[${StandardHeader.VBNET}
Imports System
Namespace ${StandardNamespace}
Public Interface ${ClassName}
End Class
Public Interface ${ClassName}
End Class
End Namespace
]]></File>
</Files>

24
data/templates/file/VBNet/VBNet.Patterns.Singleton.xft → data/templates/file/VBNet/VBNet.Module.xft

@ -2,10 +2,10 @@ @@ -2,10 +2,10 @@
<Template author="Markus Palme" version="1.0">
<Config
name = "${res:Templates.File.SingletonClass.Name}"
name = "${res:Templates.File.Module.Name}"
icon = "VBNet.File.NewClass"
category = "VB"
defaultname = "SingletonClass${Number}.vb"
defaultname = "Module${Number}.vb"
language = "VBNET"/>
<Description>${res:Templates.File.SingletonClass.Description}</Description>
@ -22,25 +22,9 @@ @@ -22,25 +22,9 @@
<Files>
<File name="${FullName}" language="VBNET"><![CDATA[${StandardHeader.VBNET}
Imports System
Namespace ${StandardNamespace}
' Description of ${ClassName}.
Public NotInheritable Class ${ClassName}
Public Module ${ClassName}
Private Shared _instance As ${ClassName} = New ${ClassName}()
Public ReadOnly Shared Property Instance As ${ClassName}
Get
Return _instance
End Get
End Property
Private Sub New()
End Sub
End Class
End Namespace
End Class
]]></File>
</Files>

54
data/templates/file/VBNet/VBNet.MyExtensionClass.xft

@ -0,0 +1,54 @@ @@ -0,0 +1,54 @@
<?xml version="1.0"?>
<Template author="Mike Krueger" version="1.0">
<Config
name = "${res:Templates.File.MyExtensionClass.Name}"
icon = "VBNet.File.NewClass"
category = "VB"
defaultname = "Extension${Number}.vb"
language = "VBNET"
/>
<Description>${res:Templates.File.EmptyClass.Description}</Description>
<!--
Special new file templates:
${StandardNamespace} -> Standardnamespace of the current project or FileNameWithoutExtension
${FullName} -> Full generated path name
${FileName} -> File name with extension
${FileNameWithoutExtension} -> File name without extension
${Extension} -> Extension in the form ".cs"
${Path} -> Full path of the file
-->
<Files>
<File name="${FullName}" language="VBNET"><![CDATA[${StandardHeader.VBNET}
Namespace My
<HideModuleName> _
Friend Class My${ClassName}Class
' The methods of this class are shown when typing "My.${ClassName}."
Public Sub TestMethod()
End Sub
End Class
' Register extension in my namespace
<HideModuleName> _
Friend Module My${ClassName}Module
Private instance As New My${ClassName}Class
Public ReadOnly Property ${ClassName}() As My${ClassName}Class
<DebuggerHidden> _
Get
Return instance
End Get
End Property
End Module
End Namespace
]]></File>
</Files>
<AdditionalOptions/>
</Template>

37
data/templates/file/VBNet/VBNet.UnitTest.xft

@ -40,29 +40,26 @@ @@ -40,29 +40,26 @@
<Files>
<File name="${FullName}" language="VBNET"><![CDATA[${StandardHeader.VBNET}
Imports System
Imports NUnit.Framework
Namespace ${StandardNamespace}.Tests
<TestFixture> _
Public Class ${ClassName}
<Test> _
Public Sub TestMethod
' TODO: Add your test.
End Sub<% if (AddSetupCode) { %>
<TestFixture> _
Public Class ${ClassName}
<Test> _
Public Sub TestMethod
' TODO: Add your test.
End Sub<% if (AddSetupCode) { %>
<TestFixtureSetUp> _
Public Sub Init
' TODO: Add Init code.
End Sub<% } if (AddTearDownCode) { %>
<TestFixtureTearDown> _
Public Sub Dispose
' TODO: Add tear down code.
End Sub<% } %>
End Class
End Namespace
<TestFixtureSetUp> _
Public Sub Init
' TODO: Add Init code.
End Sub<% } if (AddTearDownCode) { %>
<TestFixtureTearDown> _
Public Sub Dispose
' TODO: Add tear down code.
End Sub<% } %>
End Class
]]></File>
</Files>

304
data/templates/file/VBNet/VBNet.Wizards.TypedCollection.xft

@ -1,304 +0,0 @@ @@ -1,304 +0,0 @@
<?xml version="1.0"?>
<Template author="Mike Krueger" version="1.0">
<Config
name = "${res:Templates.File.TypedCollection.Name}"
icon = "VBNet.File.FullFile"
category = "VB"
defaultname = "TypedCollection${Number}.vb"
language = "VBNET"
/>
<Description>${res:Templates.File.TypedCollection.Description}</Description>
<Properties>
<Property
name = "ItemType"
localizedName = "${res:Templates.File.Properties.TypedCollectionWizard.ItemType}"
type = "System.String"
category = "${res:Templates.File.Properties.ContextCategory}"
description = "${res:Templates.File.Properties.TypedCollectionWizard.ItemType.Description}"
/>
<Property
name = "Accessibility"
localizedName = "${res:Templates.File.Properties.Accessibility}"
type = "Types:Accessibility"
category = "${res:Templates.File.Properties.OptionCategory}"
defaultValue = "Public"
description = "${res:Templates.File.Properties.Accessibility.Description}"
/>
<Property
name = "GenerateDocumentation"
localizedName = "${res:Templates.File.Properties.GenerateDocumentation}"
type = "System.Boolean"
category = "${res:Templates.File.Properties.OptionCategory}"
defaultValue = "True"
description = "${res:Templates.File.Properties.GenerateDocumentation}"
/>
</Properties>
<Types>
<Type name = "Accessibility">
<Enum name = "Public" value = "Public"/>
<Enum name = "Protected" value = "Protected"/>
<Enum name = "Private" value = "Private"/>
<Enum name = "Friend" value = "Friend"/>
<Enum name = "Protected Friend" value = "Protected Friend"/>
</Type>
</Types>
<!--
Special new file templates:
${StandardNamespace} -> Standardnamespace of the current project or FileNameWithoutExtension
${FullName} -> Full generated path name
${FileName} -> File name with extension
${FileNameWithoutExtension} -> File name without extension
${Extension} -> Extension in the form ".cs"
${Path} -> Full path of the file
-->
<Files>
<File name="${FullName}" language="VBNET"><![CDATA[${StandardHeader.VBNET}
Imports System
Imports System.Collections
Namespace ${StandardNamespace}
<%if (GenerateDocumentation) {%> '<summary>
' <para>
' A collection that stores <see cref='.${Properties.ItemType}'/> objects.
' </para>
'</summary>
'<seealso cref='.${ClassName}'/>
<%}%> <Serializable()> _
${Properties.Accessibility} Class ${ClassName}
Inherits CollectionBase
<%if (GenerateDocumentation) {%> '<summary>
' <para>
' Initializes a new instance of <see cref='.${ClassName}'/>.
' </para>
'</summary>
<%}%> Public Sub New()
MyBase.New
End Sub
<%if (GenerateDocumentation) {%> '<summary>
' <para>
' Initializes a new instance of <see cref='.${ClassName}'/> based on another <see cref='.${ClassName}'/>.
' </para>
'</summary>
'<param name='value'>
' A <see cref='.${ClassName}'/> from which the contents are copied
'</param>
<%}%> Public Sub New(ByVal value As ${ClassName})
MyBase.New
Me.AddRange(value)
End Sub
<%if (GenerateDocumentation) {%> '<summary>
' <para>
' Initializes a new instance of <see cref='.${ClassName}'/> containing any array of <see cref='.${Properties.ItemType}'/> objects.
' </para>
'</summary>
'<param name='value'>
' A array of <see cref='.${Properties.ItemType}'/> objects with which to intialize the collection
'</param>
<%}%> Public Sub New(ByVal value() As ${Properties.ItemType})
MyBase.New
Me.AddRange(value)
End Sub
<%if (GenerateDocumentation) {%> '<summary>
'<para>Represents the entry at the specified index of the <see cref='.${Properties.ItemType}'/>.</para>
'</summary>
'<param name='index'><para>The zero-based index of the entry to locate in the collection.</para></param>
'<value>
' <para> The entry at the specified index of the collection.</para>
'</value>
'<exception cref='System.ArgumentOutOfRangeException'><paramref name='index'/> is outside the valid range of indexes for the collection.</exception>
<%}%> Public Default Property Item(ByVal index As Integer) As ${Properties.ItemType}
Get
Return CType(List(index),${Properties.ItemType})
End Get
Set
List(index) = value
End Set
End Property
<%if (GenerateDocumentation) {%> '<summary>
' <para>Adds a <see cref='.${Properties.ItemType}'/> with the specified value to the
' <see cref='.${ClassName}'/> .</para>
'</summary>
'<param name='value'>The <see cref='.${Properties.ItemType}'/> to add.</param>
'<returns>
' <para>The index at which the new element was inserted.</para>
'</returns>
'<seealso cref='.${ClassName}.AddRange'/>
<%}%> Public Function Add(ByVal value As ${Properties.ItemType}) As Integer
Return List.Add(value)
End Function
<%if (GenerateDocumentation) {%> '<summary>
'<para>Copies the elements of an array to the end of the <see cref='.${ClassName}'/>.</para>
'</summary>
'<param name='value'>
' An array of type <see cref='.${Properties.ItemType}'/> containing the objects to add to the collection.
'</param>
'<returns>
' <para>None.</para>
'</returns>
'<seealso cref='.${ClassName}.Add'/>
<%}%> Public Overloads Sub AddRange(ByVal value() As ${Properties.ItemType})
Dim i As Integer = 0
Do While (i < value.Length)
Me.Add(value(i))
i = (i + 1)
Loop
End Sub
<%if (GenerateDocumentation) {%> '<summary>
' <para>
' Adds the contents of another <see cref='.${ClassName}'/> to the end of the collection.
' </para>
'</summary>
'<param name='value'>
' A <see cref='.${ClassName}'/> containing the objects to add to the collection.
'</param>
'<returns>
' <para>None.</para>
'</returns>
'<seealso cref='.${ClassName}.Add'/>
<%}%> Public Overloads Sub AddRange(ByVal value As ${ClassName})
Dim i As Integer = 0
Do While (i < value.Count)
Me.Add(value(i))
i = (i + 1)
Loop
End Sub
<%if (GenerateDocumentation) {%> '<summary>
'<para>Gets a value indicating whether the
' <see cref='.${ClassName}'/> contains the specified <see cref='.${Properties.ItemType}'/>.</para>
'</summary>
'<param name='value'>The <see cref='.${Properties.ItemType}'/> to locate.</param>
'<returns>
'<para><see langword='true'/> if the <see cref='.${Properties.ItemType}'/> is contained in the collection;
' otherwise, <see langword='false'/>.</para>
'</returns>
'<seealso cref='.${ClassName}.IndexOf'/>
<%}%> Public Function Contains(ByVal value As ${Properties.ItemType}) As Boolean
Return List.Contains(value)
End Function
<%if (GenerateDocumentation) {%> '<summary>
'<para>Copies the <see cref='.${ClassName}'/> values to a one-dimensional <see cref='System.Array'/> instance at the
' specified index.</para>
'</summary>
'<param name='array'><para>The one-dimensional <see cref='System.Array'/> that is the destination of the values copied from <see cref='.${ClassName}'/> .</para></param>
'<param name='index'>The index in <paramref name='array'/> where copying begins.</param>
'<returns>
' <para>None.</para>
'</returns>
'<exception cref='System.ArgumentException'><para><paramref name='array'/> is multidimensional.</para> <para>-or-</para> <para>The number of elements in the <see cref='.${ClassName}'/> is greater than the available space between <paramref name='arrayIndex'/> and the end of <paramref name='array'/>.</para></exception>
'<exception cref='System.ArgumentNullException'><paramref name='array'/> is <see langword='null'/>. </exception>
'<exception cref='System.ArgumentOutOfRangeException'><paramref name='arrayIndex'/> is less than <paramref name='array'/>'s lowbound. </exception>
'<seealso cref='System.Array'/>
<%}%> Public Sub CopyTo(ByVal array() As ${Properties.ItemType}, ByVal index As Integer)
List.CopyTo(array, index)
End Sub
<%if (GenerateDocumentation) {%> '<summary>
' <para>Returns the index of a <see cref='.${Properties.ItemType}'/> in
' the <see cref='.${ClassName}'/> .</para>
'</summary>
'<param name='value'>The <see cref='.${Properties.ItemType}'/> to locate.</param>
'<returns>
'<para>The index of the <see cref='.${Properties.ItemType}'/> of <paramref name='value'/> in the
'<see cref='.${ClassName}'/>, if found; otherwise, -1.</para>
'</returns>
'<seealso cref='.${ClassName}.Contains'/>
<%}%> Public Function IndexOf(ByVal value As ${Properties.ItemType}) As Integer
Return List.IndexOf(value)
End Function
<%if (GenerateDocumentation) {%> '<summary>
'<para>Inserts a <see cref='.${Properties.ItemType}'/> into the <see cref='.${ClassName}'/> at the specified index.</para>
'</summary>
'<param name='index'>The zero-based index where <paramref name='value'/> should be inserted.</param>
'<param name=' value'>The <see cref='.${Properties.ItemType}'/> to insert.</param>
'<returns><para>None.</para></returns>
'<seealso cref='.${ClassName}.Add'/>
<%}%> Public Sub Insert(ByVal index As Integer, ByVal value As ${Properties.ItemType})
List.Insert(index, value)
End Sub
<%if (GenerateDocumentation) {%> '<summary>
' <para>Returns an enumerator that can iterate through
' the <see cref='.${ClassName}'/> .</para>
'</summary>
'<returns><para>None.</para></returns>
'<seealso cref='System.Collections.IEnumerator'/>
<%}%> Public Shadows Function GetEnumerator() As ${Properties.ItemType}Enumerator
Return New ${Properties.ItemType}Enumerator(Me)
End Function
<%if (GenerateDocumentation) {%> '<summary>
' <para> Removes a specific <see cref='.${Properties.ItemType}'/> from the
' <see cref='.${ClassName}'/> .</para>
'</summary>
'<param name='value'>The <see cref='.${Properties.ItemType}'/> to remove from the <see cref='.${ClassName}'/> .</param>
'<returns><para>None.</para></returns>
'<exception cref='System.ArgumentException'><paramref name='value'/> is not found in the Collection. </exception>
<%}%> Public Sub Remove(ByVal value As ${Properties.ItemType})
List.Remove(value)
End Sub
Public Class ${Properties.ItemType}Enumerator
Implements IEnumerator
Private baseEnumerator As IEnumerator
Private temp As IEnumerable
Public Sub New(ByVal mappings As ${ClassName})
MyBase.New
Me.temp = CType(mappings,IEnumerable)
Me.baseEnumerator = temp.GetEnumerator
End Sub
Public ReadOnly Property Current As ${Properties.ItemType}
Get
Return CType(baseEnumerator.Current,${Properties.ItemType})
End Get
End Property
ReadOnly Property IEnumerator_Current As Object Implements IEnumerator.Current
Get
Return baseEnumerator.Current
End Get
End Property
Public Function MoveNext() As Boolean
Return baseEnumerator.MoveNext
End Function
Function IEnumerator_MoveNext() As Boolean Implements IEnumerator.MoveNext
Return baseEnumerator.MoveNext
End Function
Public Sub Reset()
baseEnumerator.Reset
End Sub
Sub IEnumerator_Reset() Implements IEnumerator.Reset
baseEnumerator.Reset
End Sub
End Class
End Class
End Namespace
]]></File>
</Files>
<AdditionalOptions/>
</Template>

327
data/templates/file/VBNet/VBNet.Wizards.TypedHashtable.xft

@ -1,327 +0,0 @@ @@ -1,327 +0,0 @@
<?xml version="1.0"?>
<Template author="Mike Krueger" version="1.0">
<Config
name = "${res:Templates.File.TypedHashTable.Name}"
icon = "VBNet.File.FullFile"
category = "VB"
defaultname = "Class${Number}.vb"
language = "VBNET"
/>
<Description>${res:Templates.File.TypedHashTable.Description}</Description>
<Properties>
<Property
name = "KeyType"
localizedName = "${res:Templates.File.Properties.TypedHashtableWizard.KeyType}"
type = "System.String"
category = "${res:Templates.File.Properties.ContextCategory}"
description = "${res:Templates.File.Properties.TypedHashtableWizard.KeyType.Description}"
/>
<Property
name = "ValueType"
localizedName = "${res:Templates.File.Properties.TypedHashtableWizard.ValueType}"
type = "System.String"
category = "${res:Templates.File.Properties.ContextCategory}"
description = "${res:Templates.File.Properties.TypedHashtableWizard.ValueType.Description}"
/>
<Property
name = "Accessibility"
localizedName = "${res:Templates.File.Properties.Accessibility}"
type = "Types:Accessibility"
category = "${res:Templates.File.Properties.OptionCategory}"
defaultValue = "Public"
description = "${res:Templates.File.Properties.Accessibility.Description}"
/>
</Properties>
<Types>
<Type name = "Accessibility">
<Enum name = "Public" value = "Public"/>
<Enum name = "Protected" value = "Protected"/>
<Enum name = "Private" value = "Private"/>
<Enum name = "Friend" value = "Friend"/>
<Enum name = "Protected Friend" value = "Protected Friend"/>
</Type>
</Types>
<!--
Special new file templates:
${StandardNamespace} -> Standardnamespace of the current project or FileNameWithoutExtension
${FullName} -> Full generated path name
${FileName} -> File name with extension
${FileNameWithoutExtension} -> File name without extension
${Extension} -> Extension in the form ".cs"
${Path} -> Full path of the file
-->
<Files>
<File name="${FullName}" language="VBNET"><![CDATA[${StandardHeader.VBNET}
Option Strict On
Imports System
Imports System.Collections
Namespace ${StandardNamespace}
Public Class ${ClassName}
Implements IDictionary
Implements ICollection
Implements IEnumerable
Implements ICloneable
Protected innerHashtable As Hashtable
#Region "Constructors"
Public Sub New()
innerHashtable = New Hashtable()
End Sub
Public Sub New(ByVal original As ${ClassName})
innerHashtable = New Hashtable(original.innerHash)
End Sub
Public Sub New(ByVal dictionary As IDictionary)
innerHashtable = New Hashtable(dictionary)
End Sub
Public Sub New(ByVal capacity As Integer)
innerHashtable = New Hashtable(capacity)
End Sub
Public Sub New(ByVal dictionary As IDictionary, ByVal loadFactor As Single)
innerHashtable = New Hashtable(dictionary, loadFactor)
End Sub
Public Sub New(ByVal codeProvider As IHashCodeProvider, ByVal comparer As IComparer)
innerHashtable = New Hashtable(codeProvider, comparer)
End Sub
Public Sub New(ByVal capacity As Integer, ByVal loadFactor As Integer)
innerHashtable = New Hashtable(capacity, loadFactor)
End Sub
Public Sub New(ByVal dictionary As IDictionary, ByVal codeProvider As IHashCodeProvider, ByVal comparer As IComparer)
innerHashtable = New Hashtable(dictionary, codeProvider, comparer)
End Sub
Public Sub New(ByVal capacity As Integer, ByVal codeProvider As IHashCodeProvider, ByVal comparer As IComparer)
innerHashtable = New Hashtable(capacity, codeProvider, comparer)
End Sub
Public Sub New(ByVal dictionary As IDictionary, ByVal loadFactor As Single, ByVal codeProvider As IHashCodeProvider, ByVal comparer As IComparer)
innerHashtable = New Hashtable(dictionary, loadFactor, codeProvider, comparer)
End Sub
Public Sub New(ByVal capacity As Integer, ByVal loadFactor As Integer, ByVal codeProvider As IHashCodeProvider, ByVal comparer As IComparer)
innerHashtable = New Hashtable(capacity, loadFactor, codeProvider, comparer)
End Sub
#End Region
#Region "Implementation of IDictionary"
Private Function _GetEnumerator() As IDictionaryEnumerator
Return New ${ClassName}Enumerator(Me)
End Function
Public Function IDictionary_GetEnumerator() As IDictionaryEnumerator Implements IDictionary.GetEnumerator
Return _GetEnumerator()
End Function
Public Function GetEnumerator() As IEnumerator Implements IEnumerable.GetEnumerator
Return _GetEnumerator()
End Function
Public Sub Remove(ByVal key As ${Properties.KeyType})
innerHashtable.Remove(key)
End Sub
Public Sub Remove(ByVal key As Object) Implements IDictionary.Remove
Remove(CType(key, ${Properties.KeyType}))
End Sub
Public Function Contains(ByVal key As ${Properties.KeyType}) As Boolean
Return innerHashtable.Contains(key)
End Function
Public Function Contains(ByVal key As Object) As Boolean Implements IDictionary.Contains
Return Contains(CType(key, ${Properties.KeyType}))
End Function
Public Sub Clear() Implements IDictionary.Clear
innerHashtable.Clear()
End Sub
Public Sub Add(ByVal key As ${Properties.KeyType}, ByVal value As ${Properties.ValueType})
innerHashtable.Add(key, value)
End Sub
Public Sub Add(ByVal key As Object, ByVal value As Object) Implements IDictionary.Add
Add(CType(key, ${Properties.KeyType}), CType(value, ${Properties.ValueType}))
End Sub
Public ReadOnly Property IsReadOnly() As Boolean Implements IDictionary.IsReadOnly
Get
Return innerHashtable.IsReadOnly
End Get
End Property
Default Public Property Item(ByVal key As ${Properties.KeyType}) As ${Properties.ValueType}
Get
Return CType(innerHashtable(key), ${Properties.ValueType})
End Get
Set(ByVal Value As ${Properties.ValueType})
innerHashtable(key) = value
End Set
End Property
Default Public Property Item(ByVal key As Object) As Object Implements IDictionary.Item
Get
Return item(CType(key, ${Properties.KeyType}))
End Get
Set(ByVal Value As Object)
item(CType(key, ${Properties.KeyType})) = CType(value, ${Properties.ValueType})
End Set
End Property
Public ReadOnly Property Values() As System.Collections.ICollection Implements IDictionary.Values
Get
Return innerHashtable.Values
End Get
End Property
Public ReadOnly Property Keys() As System.Collections.ICollection Implements IDictionary.Keys
Get
Return innerHashtable.Keys
End Get
End Property
Public ReadOnly Property IsFixedSize() As Boolean Implements IDictionary.IsFixedSize
Get
Return innerHashtable.IsFixedSize
End Get
End Property
#End Region
#Region "Implementation of ICollection"
Public Sub CopyTo(ByVal array As System.Array, ByVal index As Integer) Implements ICollection.CopyTo
innerHashtable.CopyTo(array, index)
End Sub
Public ReadOnly Property IsSynchronized() As Boolean Implements System.Collections.ICollection.IsSynchronized
Get
Return innerHashtable.IsSynchronized
End Get
End Property
Public ReadOnly Property Count() As Integer Implements System.Collections.ICollection.Count
Get
Return innerHashtable.Count
End Get
End Property
Public ReadOnly Property SyncRoot() As Object Implements System.Collections.ICollection.SyncRoot
Get
Return innerHashtable.SyncRoot
End Get
End Property
#End Region
#Region "Implementation of ICloneable"
Public Function Clone() As ${ClassName}
Dim innerClone As ${ClassName} = New ${ClassName}()
innerClone.innerHashtable = CType(innerHashtable.Clone(), Hashtable)
Return innerClone
End Function
Public Function ICloneable_Clone() As Object Implements ICloneable.Clone
Return Clone()
End Function
#End Region
#Region "HashTable Methods"
Public Function ContainsKey(ByVal key As ${Properties.KeyType}) As Boolean
Return innerHashtable.ContainsKey(key)
End Function
Public Function ContainsValue(ByVal value As ${Properties.ValueType}) As Boolean
Return innerHashtable.ContainsValue(value)
End Function
Public Shared Function Synchronized(ByVal nonSync As ${ClassName}) As ${ClassName}
Dim sync As ${ClassName} = New ${ClassName}()
sync.innerHashtable = Hashtable.Synchronized(nonSync.innerHash)
Return sync
End Function
#End Region
Friend ReadOnly Property InnerHash() As Hashtable
Get
Return innerHashtable
End Get
End Property
End Class
Public Class ${ClassName}Enumerator
Implements IDictionaryEnumerator
Private innerEnumerator As IDictionaryEnumerator
Friend Sub New(ByVal enumerable As ${ClassName})
innerEnumerator = enumerable.InnerHash.GetEnumerator()
End Sub
#Region "Implementation of IDictionaryEnumerator"
Public ReadOnly Property Key() As ${Properties.KeyType}
Get
Return CType(innerEnumerator.Key, ${Properties.KeyType})
End Get
End Property
Public ReadOnly Property IDictionaryEnumerator_Key() As Object Implements IDictionaryEnumerator.Key
Get
Return Key
End Get
End Property
Public ReadOnly Property Value() As ${Properties.ValueType}
Get
Return CType(innerEnumerator.Value, ${Properties.ValueType})
End Get
End Property
Public ReadOnly Property IDictionaryEnumerator_Value() As Object Implements IDictionaryEnumerator.Value
Get
Return Value
End Get
End Property
Public ReadOnly Property Entry() As System.Collections.DictionaryEntry Implements IDictionaryEnumerator.Entry
Get
Return innerEnumerator.Entry
End Get
End Property
#End Region
#Region "Implementation of IEnumerator"
Public Sub Reset() Implements IDictionaryEnumerator.Reset
innerEnumerator.Reset()
End Sub
Public Function MoveNext() As Boolean Implements IDictionaryEnumerator.MoveNext
Return innerEnumerator.MoveNext()
End Function
Public ReadOnly Property Current() As Object Implements IDictionaryEnumerator.Current
Get
Return innerEnumerator.Current
End Get
End Property
#End Region
End Class
End Namespace
]]></File>
</Files>
<AdditionalOptions/>
</Template>

9
data/templates/project/CSharp/ConsoleProject.xpt

@ -26,10 +26,11 @@ @@ -26,10 +26,11 @@
<Project name = "${ProjectName}" directory = ".">
<Options/>
<References>
<Reference type="Gac" refto="System" />
<Reference type="Gac" refto="System.Xml" />
</References>
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ProjectItems>
<Files>
<File name="Main.cs"><![CDATA[${StandardHeader.C#}
using System;

14
data/templates/project/CSharp/ControlLibrary.xpt

@ -25,13 +25,13 @@ @@ -25,13 +25,13 @@
<Project name = "${ProjectName}" directory = ".">
<Options OutputType = "Library" />
<References>
<Reference type="Gac" refto="System" />
<Reference type="Gac" refto="System.Data" />
<Reference type="Gac" refto="System.Drawing" />
<Reference type="Gac" refto="System.Windows.Forms" />
<Reference type="Gac" refto="System.Xml" />
</References>
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ProjectItems>
<Files>
<File name="UserControl1.cs"><![CDATA[${StandardHeader.C#}

18
data/templates/project/CSharp/Direct3DProject.xpt

@ -26,15 +26,15 @@ @@ -26,15 +26,15 @@
<Project name = "${ProjectName}" directory = ".">
<Options/>
<References>
<Reference type="Gac" refto="System" />
<Reference type="Gac" refto="System.Data" />
<Reference type="Gac" refto="System.Drawing" />
<Reference type="Gac" refto="System.Windows.Forms" />
<Reference type="Gac" refto="System.Xml" />
<Reference type="Gac" refto="Microsoft.DirectX" />
<Reference type="Gac" refto="Microsoft.DirectX.Direct3D" />
</References>
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.DirectX" />
<Reference Include="Microsoft.DirectX.Direct3D" />
</ProjectItems>
<Files>
<File name="MainClass.cs"><![CDATA[using System;

8
data/templates/project/CSharp/EmptyProject.xpt

@ -14,10 +14,10 @@ @@ -14,10 +14,10 @@
<Combine name = "${ProjectName}" directory = ".">
<Project name = "${ProjectName}" directory = ".">
<References>
<Reference type="Gac" refto="System" />
<Reference type="Gac" refto="System.Xml" />
</References>
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Xml" />
</ProjectItems>
</Project>
</Combine>
</Template>

14
data/templates/project/CSharp/FormsProject.xpt

@ -25,13 +25,13 @@ @@ -25,13 +25,13 @@
<Project name = "${ProjectName}" directory = ".">
<Options OutputType = "WinExe" />
<References>
<Reference type="Gac" refto="System" />
<Reference type="Gac" refto="System.Data" />
<Reference type="Gac" refto="System.Drawing" />
<Reference type="Gac" refto="System.Windows.Forms" />
<Reference type="Gac" refto="System.Xml" />
</References>
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ProjectItems>
<Files>
<File name="MainForm.cs"><![CDATA[${StandardHeader.C#}

8
data/templates/project/CSharp/Library.xpt

@ -26,10 +26,10 @@ @@ -26,10 +26,10 @@
<Project name = "${ProjectName}" directory = ".">
<Options OutputType = "Library" />
<References>
<Reference type="Gac" refto="System" />
<Reference type="Gac" refto="System.Xml" />
</References>
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Xml" />
</ProjectItems>
<Files>
<File name="MyClass.cs"><![CDATA[${StandardHeader.C#}

87
data/templates/project/CSharp/Service.xpt

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
<?xml version="1.0"?>
<Template originator = "Mike Krueger"
created = "02/01/2003"
lastModified = "23/04/2005">
lastModified = "07/20/2005">
<!-- Template Header -->
<TemplateConfiguration>
@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
<!-- Actions -->
<Actions>
<Open filename = "MyService.cs"/>
<Open filename = "${ProjectName}.cs"/>
</Actions>
<!-- Template Content -->
@ -26,45 +26,38 @@ @@ -26,45 +26,38 @@
<Project name = "${ProjectName}" directory = ".">
<Options />
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Xml" />
</ProjectItems>
<Files>
<File name="MyService.cs"><![CDATA[${StandardHeader.C#}
<File name="${ProjectName}.cs"><![CDATA[${StandardHeader.C#}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.ServiceProcess;
using System.Configuration.Install;
using System.Text;
namespace ${StandardNamespace}
{
/// <summary>
/// This is the class for my Service
/// </summary>
public class MyService : System.ServiceProcess.ServiceBase
public class ${ProjectName} : ServiceBase
{
public MyService()
public ${ProjectName}()
{
InitializeComponents();
// TODO: Add any further initialization code
InitializeComponent();
}
private void InitializeComponents()
private void InitializeComponent()
{
this.ServiceName = "MyService";
this.ServiceName = "${ProjectName}";
}
/// <summary>
/// This method starts the service.
/// </summary>
public static void Main()
{
System.ServiceProcess.ServiceBase.Run(new System.ServiceProcess.ServiceBase[] {
new MyService() // To run more than one service you have to add them here
});
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
@ -73,7 +66,7 @@ namespace ${StandardNamespace} @@ -73,7 +66,7 @@ namespace ${StandardNamespace}
// TODO: Add cleanup code here (if required)
base.Dispose(disposing);
}
/// <summary>
/// Start this service.
/// </summary>
@ -82,7 +75,7 @@ namespace ${StandardNamespace} @@ -82,7 +75,7 @@ namespace ${StandardNamespace}
// TODO: Add start code here (if required)
// to start your service.
}
/// <summary>
/// Stop this service.
/// </summary>
@ -93,23 +86,43 @@ namespace ${StandardNamespace} @@ -93,23 +86,43 @@ namespace ${StandardNamespace}
}
}
}
/// <summary>
/// This method starts the service.
/// </summary>
public static void Main()
{
System.ServiceProcess.ServiceBase.Run(new System.ServiceProcess.ServiceBase[] {
new MyService()
});
}
]]></File>
<File name="Program.cs"><![CDATA[${StandardHeader.C#}
[RunInstaller(true)]
public class ProjectInstaller : Installer
using System;
using System.Collections.Generic;
using System.ServiceProcess;
using System.Text;
namespace ${ProjectName}
{
public ProjectInstaller()
static class Program
{
ServiceProcessInstaller spi = new ServiceProcessInstaller();
spi.Account = ServiceAccount.LocalSystem;
ServiceInstaller si = new ServiceInstaller();
si.ServiceName = "Hello Service Template";
si.StartType = ServiceStartMode.Automatic;
Installers.AddRange(new Installer[] {spi, si});
/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main()
{
ServiceBase[] ServicesToRun;
// To run more than one service you have to add them here
ServicesToRun = new ServiceBase[] { new ${ProjectName}() };
ServiceBase.Run(ServicesToRun);
}
}
}
]]></File>
<File name="AssemblyInfo.cs"><![CDATA[using System.Reflection;
<File name="AssemblyInfo.cs"><![CDATA[using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following

14
data/templates/project/CSharp/SharpDevelopAddin.xpt

@ -25,13 +25,13 @@ @@ -25,13 +25,13 @@
<Project name = "${ProjectName}" directory = ".">
<Options OutputType = "Library" />
<References>
<Reference type="Gac" refto="System" />
<Reference type="Gac" refto="System.Data" />
<Reference type="Gac" refto="System.Drawing" />
<Reference type="Gac" refto="System.Windows.Forms" />
<Reference type="Gac" refto="System.Xml" />
</References>
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ProjectItems>
<Files>
<File name="${ProjectName}.addin"><![CDATA[<AddIn name = "${ProjectName}"

24
data/templates/project/VBNet/ConsoleProject.xpt

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
<?xml version="1.0"?>
<Template originator = "Shinsaku Nakagawa"
created = "11/28/2002"
lastModified = "02/01/2003">
lastModified = "07/20/2005">
<!-- Template Header -->
<TemplateConfiguration>
@ -27,19 +27,23 @@ @@ -27,19 +27,23 @@
<Project name = "${ProjectName}" directory = ".">
<Options />
<References>
<Reference type="Gac" refto="System" />
<Reference type="Gac" refto="System.Data" />
<Reference type="Gac" refto="System.Drawing" />
<Reference type="Gac" refto="System.Xml" />
</References>
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Xml" />
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Data" />
<Import Include="System.Diagnostics" />
</ProjectItems>
<Files>
<File name="Main.vb">
<![CDATA[${StandardHeader.VBNET}
Imports System
Imports System.Collections.Generic
Module Main
Sub Main()
Console.WriteLine("Hello World!")

88
data/templates/project/VBNet/ControlLibrary.xpt

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
<?xml version="1.0"?>
<Template originator = "Markus Palme"
created = "24/11/2002"
lastModified = "02/01/2003">
created = "11/24/2002"
lastModified = "07/20/2005">
<!-- Template Header -->
<TemplateConfiguration>
@ -25,50 +25,48 @@ @@ -25,50 +25,48 @@
<Project name = "${ProjectName}" directory = ".">
<Options OutputType = "Library" />
<References>
<Reference type="Gac" refto="System" />
<Reference type="Gac" refto="System.Data" />
<Reference type="Gac" refto="System.Drawing" />
<Reference type="Gac" refto="System.Windows.Forms" />
<Reference type="Gac" refto="System.Xml" />
</References>
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Data" />
<Import Include="System.Drawing" />
<Import Include="System.Diagnostics" />
<Import Include="System.Windows.Forms" />
</ProjectItems>
<Files>
<File name="UserControl1.vb"><![CDATA[${StandardHeader.VBNET}
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Drawing
Imports System.Windows.Forms
Namespace ${StandardNamespace}
Public Class UserControl1
Inherits System.Windows.Forms.UserControl
Public Sub New()
MyBase.New
' Must be called for initialization
Me.InitializeComponent
'
' TODO : Add constructor code after InitializeComponents
'
End Sub
#Region " Windows Forms Designer generated code "
' This method is required for Windows Forms designer support.
' Do not change the method contents inside the source code editor. The Forms designer might
' not be able to load this method if it was changed manually.
Private Sub InitializeComponent()
'
'UserControl1
'
Me.Name = "UserControl1"
End Sub
#End Region
End Class
End Namespace
Public Class UserControl1
Inherits System.Windows.Forms.UserControl
Public Sub New()
' Must be called for initialization
Me.InitializeComponent
'
' TODO : Add constructor code after InitializeComponents
'
End Sub
#Region " Windows Forms Designer generated code "
' This method is required for Windows Forms designer support.
' Do not change the method contents inside the source code editor. The Forms designer might
' not be able to load this method if it was changed manually.
Private Sub InitializeComponent()
'
'UserControl1
'
Me.Name = "UserControl1"
End Sub
#End Region
End Class
]]></File>
<File name="AssemblyInfo.vb">
<![CDATA[Imports System.Reflection
@ -76,8 +74,8 @@ Imports System.Runtime.CompilerServices @@ -76,8 +74,8 @@ Imports System.Runtime.CompilerServices
' Information about this assembly is defined by the following
' attributes.
' <ProjectOptions Target = "WinExe" PauseConsoleOutput = "False" />
' change them to the information which is associated with the assembly
'
' Change them to the information which is associated with the assembly
' you compile.
<assembly: AssemblyTitle("")>

241
data/templates/project/VBNet/Direct3DProject.xpt

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
<?xml version="1.0"?>
<Template originator = "Markus Palme"
created = "07/03/2004"
lastModified = "20/10/2004">
lastModified = "07/20/2005">
<!-- Template Header -->
<TemplateConfiguration>
@ -26,133 +26,132 @@ @@ -26,133 +26,132 @@
<Project name = "${ProjectName}" directory = ".">
<Options/>
<References>
<Reference type="Gac" refto="System" />
<Reference type="Gac" refto="System.Data" />
<Reference type="Gac" refto="System.Drawing" />
<Reference type="Gac" refto="System.Windows.Forms" />
<Reference type="Gac" refto="System.Xml" />
<Reference type="Gac" refto="Microsoft.DirectX" />
<Reference type="Gac" refto="Microsoft.DirectX.Direct3D" />
</References>
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.DirectX" />
<Reference Include="Microsoft.DirectX.Direct3D" />
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Drawing" />
<Import Include="System.Diagnostics" />
<Import Include="System.Windows.Forms" />
<Import Include="Microsoft.DirectX" />
<Import Include="Microsoft.DirectX.Direct3D" />
</ProjectItems>
<Files>
<File name="MainClass.vb"><![CDATA[${StandardHeader.VBNET}
Imports System
Imports System.Collections
Imports System.ComponentModel
Imports System.Drawing
Imports System.Windows.Forms
Imports Microsoft.DirectX
Imports Microsoft.DirectX.Direct3D
Namespace ${StandardNamespace}
' This is the main class of my Direct3D application
Public Class MainClass
Inherits Form
' This is the main class of my Direct3D application
Public Class MainClass
Inherits Form
' The rendering device
Private device As Device
Public Sub New()
Me.ClientSize = new System.Drawing.Size(640, 480)
Me.Text = "Direct3D Project"
End Sub
Public Function InitializeGraphics() As Boolean
Try
' Now let's setup the Direct3D stuff
Dim presentParams As New PresentParameters()
presentParams.Windowed = true
presentParams.SwapEffect = SwapEffect.Discard
' Create the device
device = new Device(0, DeviceType.Hardware, Me, CreateFlags.SoftwareVertexProcessing, presentParams)
' Setup the event handlers for the device
AddHandler device.DeviceLost, AddressOf InvalidateDeviceObjects
AddHandler device.DeviceReset, AddressOf RestoreDeviceObjects
AddHandler device.Disposing, AddressOf DeleteDeviceObjects
AddHandler device.DeviceResizing, AddressOf EnvironmentResizing
return True
Catch ex As DirectXException
Return False
End Try
End Function
Protected Overridable Sub InvalidateDeviceObjects(sender As Object, e As EventArgs)
End Sub
Protected Overridable Sub RestoreDeviceObjects(sender As Object, e As EventArgs)
End Sub
Protected Overridable Sub DeleteDeviceObjects(sender As Object, e As EventArgs)
End Sub
Protected Overridable Sub EnvironmentResizing(sender As Object, e As CancelEventArgs)
End Sub
' This method moves the scene
Protected Overridable Sub FrameMove()
' TODO : Frame movement
End Sub
' This method renders the scene
Protected Overridable Sub Render()
If Not device Is Nothing
device.Clear(ClearFlags.Target, Color.Blue, 1.0f, 0)
device.BeginScene()
' TODO : Scene rendering
device.EndScene()
device.Present()
End If
End Sub
' Our mainloop
Public Sub Run()
' While the form is still valid, render and process messages
Do While Created
FrameMove()
Render()
Application.DoEvents()
Loop
End Sub
Protected Overrides Sub OnPaint(e As PaintEventArgs)
Me.Render()
End Sub
Protected Overrides Sub OnKeyPress(e As KeyPressEventArgs)
MyBase.OnKeyPress(e)
If Microsoft.VisualBasic.AscW(e.KeyChar) = CInt(System.Windows.Forms.Keys.Escape)
Close()
End If
End Sub
' The main entry point for the application
Shared Sub Main()
Dim mainClass As New MainClass()
' The rendering device
Private device As Device
Public Sub New()
Me.ClientSize = new System.Drawing.Size(640, 480)
Me.Text = "Direct3D Project"
End Sub
Public Function InitializeGraphics() As Boolean
Try
' Now let's setup the Direct3D stuff
Dim presentParams As New PresentParameters()
presentParams.Windowed = true
presentParams.SwapEffect = SwapEffect.Discard
' Create the device
device = new Device(0, DeviceType.Hardware, Me, CreateFlags.SoftwareVertexProcessing, presentParams)
' Setup the event handlers for the device
AddHandler device.DeviceLost, AddressOf InvalidateDeviceObjects
AddHandler device.DeviceReset, AddressOf RestoreDeviceObjects
AddHandler device.Disposing, AddressOf DeleteDeviceObjects
AddHandler device.DeviceResizing, AddressOf EnvironmentResizing
return True
Catch ex As DirectXException
Return False
End Try
End Function
Protected Overridable Sub InvalidateDeviceObjects(sender As Object, e As EventArgs)
End Sub
Protected Overridable Sub RestoreDeviceObjects(sender As Object, e As EventArgs)
End Sub
Protected Overridable Sub DeleteDeviceObjects(sender As Object, e As EventArgs)
End Sub
Protected Overridable Sub EnvironmentResizing(sender As Object, e As CancelEventArgs)
End Sub
' This method moves the scene
Protected Overridable Sub FrameMove()
' TODO : Frame movement
End Sub
' This method renders the scene
Protected Overridable Sub Render()
If Not device Is Nothing
device.Clear(ClearFlags.Target, Color.Blue, 1.0f, 0)
device.BeginScene()
If Not mainClass.InitializeGraphics()
MessageBox.Show("Error while initializing Direct3D")
Return
End If
' TODO : Scene rendering
mainClass.Show()
mainClass.Run()
End Sub
End Class
End Namespace
device.EndScene()
device.Present()
End If
End Sub
' Our mainloop
Public Sub Run()
' While the form is still valid, render and process messages
Do While Created
FrameMove()
Render()
Application.DoEvents()
Loop
End Sub
Protected Overrides Sub OnPaint(e As PaintEventArgs)
Me.Render()
End Sub
Protected Overrides Sub OnKeyPress(e As KeyPressEventArgs)
MyBase.OnKeyPress(e)
If AscW(e.KeyChar) = CInt(Keys.Escape)
Close()
End If
End Sub
' The main entry point for the application
Shared Sub Main()
Dim mainClass As New MainClass()
If Not mainClass.InitializeGraphics()
MessageBox.Show("Error while initializing Direct3D")
Return
End If
mainClass.Show()
mainClass.Run()
End Sub
End Class
]]></File>
<File name="AssemblyInfo.vb"><![CDATA[Imports System.Reflection
Imports System.Runtime.CompilerServices

13
data/templates/project/VBNet/EmptyProject.xpt

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
<?xml version="1.0"?>
<Template originator = "Mike Krueger"
created = "03/10/2001"
lastModified = "02/01/2003">
lastModified = "07/20/2005">
<!-- Template Header -->
<TemplateConfiguration>
@ -16,6 +16,15 @@ @@ -16,6 +16,15 @@
<Options>
<StartupProject>${ProjectName}</StartupProject>
</Options>
<Project name = "${ProjectName}" directory = "."/>
<Project name = "${ProjectName}" directory = ".">
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Import Include="System" />
<Import Include="Microsoft.VisualBasic" />
</ProjectItems>
</Project>
</Combine>
</Template>

107
data/templates/project/VBNet/FormsProject.xpt

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
<?xml version="1.0"?>
<Template originator = "Markus Palme"
created = "15/04/2002"
lastModified = "02/01/2004">
lastModified = "07/20/2005">
<!-- Template Header -->
<TemplateConfiguration>
@ -26,63 +26,78 @@ @@ -26,63 +26,78 @@
<Project name = "${ProjectName}" directory = ".">
<Options OutputType = "WinExe" />
<References>
<Reference type="Gac" refto="System" />
<Reference type="Gac" refto="System.Data" />
<Reference type="Gac" refto="System.Drawing" />
<Reference type="Gac" refto="System.Windows.Forms" />
<Reference type="Gac" refto="System.Xml" />
</References>
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Drawing" />
<Import Include="System.Diagnostics" />
<Import Include="System.Windows.Forms" />
</ProjectItems>
<Files>
<File name="MainForm.vb">
<![CDATA[${StandardHeader.VBNET}
Imports System
Imports System.Collections.Generic
Imports System.Drawing
Imports System.Windows.Forms
Namespace ${StandardNamespace}
Public Class MainForm
Inherits Form
Public Class MainForm
Inherits System.Windows.Forms.Form
Public Shared Sub Main
Application.Run(New MainForm())
End Sub
Public Sub New()
'
' The Me.InitializeComponent call is required for Windows Forms designer support.
'
Me.InitializeComponent
'
' TODO : Add constructor code after InitializeComponents
'
End Sub
#Region " Windows Forms Designer generated code "
' This method is required for Windows Forms designer support.
' Do not change the method contents inside the source code editor. The Forms designer might
' not be able to load this method if it was changed manually.
Private Sub InitializeComponent()
'
'Form1
'
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(292, 266)
Me.Name = "MainForm"
Me.Text = "MainForm"
End Sub
#End Region
End Class
]]></File>
<File name="Program.vb">
<![CDATA[${StandardHeader.VBNET}
Imports Microsoft.VisualBasic.ApplicationServices
Namespace My
' This file controls the behaviour of the application.
Partial Class MyApplication
Public Sub New()
MyBase.New
'
' The Me.InitializeComponent call is required for Windows Forms designer support.
'
Me.InitializeComponent
'
' TODO : Add constructor code after InitializeComponents
'
MyBase.New(AuthenticationMode.Windows)
Me.IsSingleInstance = False
Me.EnableVisualStyles = True
Me.SaveMySettingsOnExit = False ' MySettings are not supported in SharpDevelop.
Me.ShutDownStyle = ShutdownMode.AfterMainFormCloses
End Sub
#Region " Windows Forms Designer generated code "
' This method is required for Windows Forms designer support.
' Do not change the method contents inside the source code editor. The Forms designer might
' not be able to load this method if it was changed manually.
Private Sub InitializeComponent()
'
'Form1
'
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(292, 266)
Me.Name = "MainForm"
Me.Text = "MainForm"
Protected Overrides Sub OnCreateMainForm()
Me.MainForm = My.Forms.MainForm
End Sub
#End Region
End Class
End Namespace
]]></File>
<File name="AssemblyInfo.vb">
<![CDATA[Imports System.Reflection
<File name="AssemblyInfo.vb">
<![CDATA[Imports System.Reflection
Imports System.Runtime.CompilerServices
' Information about this assembly is defined by the following

25
data/templates/project/VBNet/Library.xpt

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
<?xml version="1.0"?>
<Template originator = "Markus Palme"
created = "24/11/2002"
lastModified = "02/01/2003">
lastModified = "07/20/2005">
<!-- Template Header -->
<TemplateConfiguration>
@ -26,16 +26,21 @@ @@ -26,16 +26,21 @@
<Project name = "${ProjectName}" directory = ".">
<Options OutputType = "Library" />
<References>
<Reference type="Gac" refto="System" />
<Reference type="Gac" refto="System.Data" />
<Reference type="Gac" refto="System.Drawing" />
<Reference type="Gac" refto="System.Xml" />
</References>
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Data" />
<Import Include="System.Diagnostics" />
</ProjectItems>
<Files>
<File name="NewClass.vb"><![CDATA[${StandardHeader.VBNET}
Imports System
Public Class NewClass
@ -47,8 +52,8 @@ Imports System.Runtime.CompilerServices @@ -47,8 +52,8 @@ Imports System.Runtime.CompilerServices
' Information about this assembly is defined by the following
' attributes.
' <ProjectOptions Target = "WinExe" PauseConsoleOutput = "False" />
' change them to the information which is associated with the assembly
'
' Change them to the information which is associated with the assembly
' you compile.
<assembly: AssemblyTitle("")>

85
data/templates/project/VBNet/Service.xpt

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
<?xml version="1.0"?>
<Template originator = "Markus Palme"
created = "24/11/2002"
lastModified = "02/01/2003">
lastModified = "07/20/2005">
<!-- Template Header -->
<TemplateConfiguration>
@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
<!-- Actions -->
<Actions>
<Open filename = "MyService.vb"/>
<Open filename = "${ProjectName}.vb"/>
</Actions>
<Combine name = "${ProjectName}" directory = ".">
@ -24,81 +24,48 @@ @@ -24,81 +24,48 @@
<Project name = "${ProjectName}" directory = ".">
<Options />
<References>
<Reference type="Gac" refto="System" />
<Reference type="Gac" refto="System.Data" />
<Reference type="Gac" refto="System.Drawing" />
<Reference type="Gac" refto="System.Xml" />
</References>
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Xml" />
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Data" />
<Import Include="System.Diagnostics" />
</ProjectItems>
<Files>
<File name="MyService.vb"><![CDATA[${StandardHeader.VBNET}
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Diagnostics
Imports System.ServiceProcess
Imports System.Configuration.Install
Public Class MyService
Inherits System.ServiceProcess.ServiceBase
<File name="${ProjectName}.vb"><![CDATA[${StandardHeader.VBNET}
Public Sub New()
MyBase.New()
InitializeComponents()
' TODO: Add any further initialization code
End Sub
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponents()
Me.ServiceName = "Service1"
End Sub
Public Class ${ProjectName}
' This method starts the service.
' The main entry point for the process
<MTAThread()> _
Shared Sub Main()
Dim ServicesToRun() As System.ServiceProcess.ServiceBase
' To run more than one service you have to add them to the array
System.ServiceProcess.ServiceBase.Run(New System.ServiceProcess.ServiceBase() { _
New MyService _
})
End Sub
' Clean up any resources being used.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
MyBase.Dispose(disposing)
' TODO: Add cleanup code here (if required)
' To run more than one service you have to add them here
ServicesToRun = New System.ServiceProcess.ServiceBase() {New ${ProjectName}}
System.ServiceProcess.ServiceBase.Run(ServicesToRun)
End Sub
Protected Overrides Sub OnStart(ByVal args() As String)
' TODO: Add start code here (if required)
' to start your service.
' TODO: Add start code here to start your service.
End Sub
Protected Overrides Sub OnStop()
' TODO: Add tear-down code here (if required)
' to stop your service.
' TODO: Add tear-down code here (if required) to stop your service.
End Sub
End Class
<RunInstaller(True)> _
Public Class ProjectInstaller
Inherits Installer
Public Sub New()
Dim spi As ServiceProcessInstaller = New ServiceProcessInstaller
spi.Account = ServiceAccount.LocalSystem
Dim si As ServiceInstaller = New ServiceInstaller
si.ServiceName = "Hello Service Template"
si.StartType = ServiceStartMode.Automatic
Installers.AddRange(New Installer() {spi, si})
End Sub
End Class
]]></File>
<File name="AssemblyInfo.vb">
<![CDATA[Imports System.Reflection

74
src/AddIns/BackendBindings/VBNetBinding/Project/Src/MyNamespaceBuilder.cs

@ -16,38 +16,64 @@ namespace VBNetBinding @@ -16,38 +16,64 @@ namespace VBNetBinding
{
public static class MyNamespaceBuilder
{
/// <summary>
/// Builds Visual Basic's "My" namespace for the specified project.
/// </summary>
public static void BuildNamespace(IProject project, IProjectContent pc)
{
ICompilationUnit cu = new DefaultCompilationUnit(pc);
const string ns = "My";
cu.FileName = "GeneratedMyNamespace.vb";
string ns;
if (project.RootNamespace == null || project.RootNamespace.Length == 0)
ns = "My";
else
ns = project.RootNamespace + ".My";
IClass myApp = CreateMyApplication(cu, project, ns);
IClass myComp = CreateMyComputer(cu, project, ns);
cu.Classes.Add(myApp);
cu.Classes.Add(myComp);
IClass myForms = null;
if (project.OutputType == OutputType.WinExe) {
myForms = CreateMyForms(cu, project, ns);
cu.Classes.Add(myForms);
}
DefaultClass c = new DefaultClass(cu, ns + ".MyProject");
c.ClassType = ClassType.Module;
c.Modifiers = ModifierEnum.Internal | ModifierEnum.Partial | ModifierEnum.Sealed;
c.Attributes.Add(new DefaultAttribute("Microsoft.VisualBasic.HideModuleNameAttribute"));
// we need to use GetClassReturnType instead of DefaultReturnType because we need
// a reference to the compound class.
c.Properties.Add(new DefaultProperty("Application",
myApp.DefaultReturnType,
ModifierEnum.Internal | ModifierEnum.Static,
new GetClassReturnType(pc, myApp.FullyQualifiedName),
ModifierEnum.Public | ModifierEnum.Static,
null, null, c));
c.Properties.Add(new DefaultProperty("Computer",
myComp.DefaultReturnType,
ModifierEnum.Internal | ModifierEnum.Static,
new GetClassReturnType(pc, myComp.FullyQualifiedName),
ModifierEnum.Public | ModifierEnum.Static,
null, null, c));
if (myForms != null) {
c.Properties.Add(new DefaultProperty("Forms",
new GetClassReturnType(pc, myForms.FullyQualifiedName),
ModifierEnum.Public | ModifierEnum.Static,
null, null, c));
}
c.Properties.Add(new DefaultProperty("User",
new GetClassReturnType(pc, "Microsoft.VisualBasic.ApplicationServices.User"),
ModifierEnum.Internal | ModifierEnum.Static,
ModifierEnum.Public | ModifierEnum.Static,
null, null, c));
cu.Classes.Add(c);
pc.UpdateCompilationUnit(null, cu, "GeneratedMyNamespace.vb", false);
pc.UpdateCompilationUnit(null, cu, cu.FileName, false);
}
static IClass CreateMyApplication(ICompilationUnit cu, IProject project, string ns)
{
DefaultClass c = new DefaultClass(cu, ns + ".MyApplication");
c.ClassType = ClassType.Class;
c.Modifiers = ModifierEnum.Internal | ModifierEnum.Partial | ModifierEnum.Sealed;
c.Modifiers = ModifierEnum.Internal | ModifierEnum.Sealed | ModifierEnum.Partial;
c.Attributes.Add(new DefaultAttribute("Microsoft.VisualBasic.HideModuleNameAttribute"));
switch (project.OutputType) {
case OutputType.WinExe:
c.BaseTypes.Add("Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase");
@ -66,9 +92,39 @@ namespace VBNetBinding @@ -66,9 +92,39 @@ namespace VBNetBinding
{
DefaultClass c = new DefaultClass(cu, ns + ".MyComputer");
c.ClassType = ClassType.Class;
c.Modifiers = ModifierEnum.Internal | ModifierEnum.Partial | ModifierEnum.Sealed;
c.Modifiers = ModifierEnum.Internal | ModifierEnum.Sealed | ModifierEnum.Partial;
c.Attributes.Add(new DefaultAttribute("Microsoft.VisualBasic.HideModuleNameAttribute"));
c.BaseTypes.Add("Microsoft.VisualBasic.Devices.Computer");
return c;
}
static IClass CreateMyForms(ICompilationUnit cu, IProject project, string ns)
{
DefaultClass c = new MyFormsClass(cu, ns + ".MyForms");
c.ClassType = ClassType.Class;
c.Modifiers = ModifierEnum.Internal | ModifierEnum.Sealed; //| ModifierEnum.Partial;
c.Attributes.Add(new DefaultAttribute("Microsoft.VisualBasic.HideModuleNameAttribute"));
return c;
}
class MyFormsClass : DefaultClass
{
public MyFormsClass(ICompilationUnit cu, string fullName) : base(cu, fullName) {}
public override List<IProperty> Properties {
get {
List<IProperty> properties = new List<IProperty>();
foreach (IClass c in this.ProjectContent.Classes) {
if (c.BaseTypes.Contains("System.Windows.Forms.Form")) {
properties.Add(new DefaultProperty(c.Name,
new GetClassReturnType(this.ProjectContent, c.FullyQualifiedName),
ModifierEnum.Public | ModifierEnum.Static,
null, null, c));
}
}
return properties;
}
}
}
}
}

12
src/AddIns/BackendBindings/VBNetBinding/Project/Src/Parser/Parser.cs

@ -116,6 +116,18 @@ namespace VBNetBinding.Parser @@ -116,6 +116,18 @@ namespace VBNetBinding.Parser
visitor.Cu.ErrorsDuringCompile = p.Errors.count > 0;
RetrieveRegions(visitor.Cu, p.Lexer.SpecialTracker);
AddCommentTags(visitor.Cu, p.Lexer.TagComments);
string rootNamespace = null;
ParseProjectContent ppc = projectContent as ParseProjectContent;
if (ppc != null) {
rootNamespace = ppc.Project.RootNamespace;
}
if (rootNamespace != null && rootNamespace.Length > 0) {
foreach (IClass c in visitor.Cu.Classes) {
c.FullyQualifiedName = rootNamespace + "." + c.FullyQualifiedName;
}
}
return visitor.Cu;
}

24
src/AddIns/BackendBindings/VBNetBinding/Project/Src/Project/VBNetProject.cs

@ -39,6 +39,26 @@ namespace VBNetBinding @@ -39,6 +39,26 @@ namespace VBNetBinding
}
}
public override OutputType OutputType {
get {
return base.OutputType;
}
set {
base.OutputType = value;
switch (value) {
case OutputType.WinExe:
BaseConfiguration.Set("MyType", "", "WindowsForms");
break;
case OutputType.Exe:
BaseConfiguration.Set("MyType", "", "Console");
break;
default:
BaseConfiguration.Set("MyType", "", "Windows");
break;
}
}
}
[Browsable(false)]
public override IAmbience Ambience {
get {
@ -224,6 +244,8 @@ namespace VBNetBinding @@ -224,6 +244,8 @@ namespace VBNetBinding
GetConfiguration(configurationName, platform).Set("NoStdLib", false, val);
}
public VBNetProject(string fileName, string projectName)
{
this.Name = projectName;
@ -242,6 +264,8 @@ namespace VBNetBinding @@ -242,6 +264,8 @@ namespace VBNetBinding
public override ParseProjectContent CreateProjectContent()
{
ParseProjectContent pc = base.CreateProjectContent();
ReferenceProjectItem vbRef = new ReferenceProjectItem(this, "Microsoft.VisualBasic");
pc.ReferencedContents.Add(ProjectContentRegistry.GetProjectContentForReference(vbRef));
MyNamespaceBuilder.BuildNamespace(this, pc);
return pc;
}

2
src/AddIns/Misc/NUnitPad/Project/Src/Gui/NUnitPadContent.cs

@ -134,7 +134,7 @@ namespace ICSharpCode.NUnitPad @@ -134,7 +134,7 @@ namespace ICSharpCode.NUnitPad
void AddNUnitReference(object sender, EventArgs e)
{
if (ProjectService.CurrentProject != null) {
ProjectService.AddReference(ProjectService.CurrentProject, new ReferenceProjectItem(ProjectService.CurrentProject, "nunit.framework"));
ProjectService.AddProjectItem(ProjectService.CurrentProject, new ReferenceProjectItem(ProjectService.CurrentProject, "nunit.framework"));
ProjectService.CurrentProject.Save();
}
}

75
src/Libraries/ICSharpCode.TextEditor/Project/Resources/CSharp-Mode.xshd

@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
<RuleSet ignorecase="false">
<Delimiters>&amp;&lt;&gt;~!%^*()-+=|\#/{}[]:;"' , .?</Delimiters>
<Span name = "PreprocessorDirectives" bold="false" italic="false" color="Green" stopateol = "true">
<Span name = "PreprocessorDirectives" rule = "PreprocessorSet" bold="false" italic="false" color="Green" stopateol = "true">
<Begin>#</Begin>
</Span>
@ -111,9 +111,15 @@ @@ -111,9 +111,15 @@
<Key word = "continue" />
<Key word = "goto" />
<Key word = "return" />
</KeyWords>
<KeyWords name = "ContextKeywords" bold="false" italic="false" color="Navy">
<Key word = "yield" />
<Key word = "partial" />
<Key word = "global" />
<Key word = "where" />
</KeyWords>
<KeyWords name = "ExceptionHandlingStatements" bold="true" italic="false" color="Teal">
<Key word = "try" />
<Key word = "throw" />
@ -130,37 +136,23 @@ @@ -130,37 +136,23 @@
<Key word = "fixed" />
<Key word = "unsafe" />
</KeyWords>
<KeyWords name = "PreprocessorDirectives" bold="false" italic="false" color="Green">
<Key word = "#if" />
<Key word = "#else" />
<Key word = "#elif" />
<Key word = "#endif" />
<Key word = "#define" />
<Key word = "#undef" />
<Key word = "#warning" />
<Key word = "#error" />
<Key word = "#line" />
<Key word = "#region" />
<Key word = "#endregion" />
</KeyWords>
<KeyWords name = "ValueTypes" bold="true" italic="false" color="Red">
<Key word = "bool" />
<Key word = "byte" />
<Key word = "char" />
<Key word = "decimal" />
<Key word = "double" />
<Key word = "enum" />
<Key word = "float" />
<Key word = "int" />
<Key word = "long" />
<Key word = "sbyte" />
<Key word = "short" />
<Key word = "struct" />
<Key word = "uint" />
<Key word = "ushort" />
<Key word = "ulong" />
<Key word = "bool" />
<Key word = "byte" />
<Key word = "char" />
<Key word = "decimal" />
<Key word = "double" />
<Key word = "enum" />
<Key word = "float" />
<Key word = "int" />
<Key word = "long" />
<Key word = "sbyte" />
<Key word = "short" />
<Key word = "struct" />
<Key word = "uint" />
<Key word = "ushort" />
<Key word = "ulong" />
</KeyWords>
<KeyWords name = "ReferenceTypes" bold="false" italic="false" color="Red">
@ -260,6 +252,25 @@ @@ -260,6 +252,25 @@
</KeyWords>
</RuleSet>
<RuleSet name = "PreprocessorSet" ignorecase="false">
<Delimiters>&amp;&lt;&gt;~!%^*()-+=|\#/{}[]:;"' , .?</Delimiters>
<KeyWords name = "PreprocessorDirectives" bold="true" italic="false" color="Green">
<Key word = "if" />
<Key word = "else" />
<Key word = "elif" />
<Key word = "endif" />
<Key word = "define" />
<Key word = "undef" />
<Key word = "warning" />
<Key word = "error" />
<Key word = "line" />
<Key word = "region" />
<Key word = "endregion" />
<Key word = "pragma" />
</KeyWords>
</RuleSet>
<RuleSet name = "XmlDocSet" ignorecase = "false">
<Delimiters>&lt;&gt;~!@%^*()-+=|\#/{}[]:;"' , .?</Delimiters>

2
src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/BracketHighlighter.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// <file>
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>

13
src/Libraries/NRefactory/Project/Src/Parser/AST/AttributedNode.cs

@ -17,22 +17,21 @@ @@ -17,22 +17,21 @@
using System;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
public abstract class AttributedNode : AbstractNode
{
// protected List<AttributeSection> attributes;
protected ArrayList attributes;
protected List<AttributeSection> attributes;
protected Modifier modifier;
public ArrayList Attributes {
public List<AttributeSection> Attributes {
get {
return attributes;
}
set {
attributes = value == null ? new ArrayList(1) : value;
attributes = value == null ? new List<AttributeSection>(1) : value;
}
}
@ -45,11 +44,11 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -45,11 +44,11 @@ namespace ICSharpCode.NRefactory.Parser.AST
}
}
public AttributedNode(ArrayList attributes) : this(Modifier.None, attributes)
public AttributedNode(List<AttributeSection> attributes) : this(Modifier.None, attributes)
{
}
public AttributedNode(Modifier modifier, ArrayList attributes)
public AttributedNode(Modifier modifier, List<AttributeSection> attributes)
{
this.modifier = modifier;

6
src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Expressions/AnonymousMethodExpression.cs

@ -8,16 +8,16 @@ @@ -8,16 +8,16 @@
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class AnonymousMethodExpression : Expression
{
ArrayList parameters = new ArrayList(4);
List<ParameterDeclarationExpression> parameters = new List<ParameterDeclarationExpression>(1);
public ArrayList Parameters {
public List<ParameterDeclarationExpression> Parameters {
get {
return parameters;
}

4
src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/TypeLevel/DestructorDeclaration.cs

@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
using System;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
@ -44,7 +44,7 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -44,7 +44,7 @@ namespace ICSharpCode.NRefactory.Parser.AST
}
}
public DestructorDeclaration(string name, Modifier modifier, ArrayList attributes) : base(modifier, attributes)
public DestructorDeclaration(string name, Modifier modifier, List<AttributeSection> attributes) : base(modifier, attributes)
{
this.Name = name;
}

12
src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/TypeLevel/IndexerDeclaration.cs

@ -19,6 +19,7 @@ using System; @@ -19,6 +19,7 @@ using System;
using System.Drawing;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
@ -29,8 +30,7 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -29,8 +30,7 @@ namespace ICSharpCode.NRefactory.Parser.AST
Point bodyStart = new Point(-1, -1);
Point bodyEnd = new Point(-1, -1);
// List<ParameterDeclarationExpression> parameters;
ArrayList parameters;
List<ParameterDeclarationExpression> parameters;
PropertyGetRegion propertyGetRegion = PropertyGetRegion.Null;
PropertySetRegion propertySetRegion = PropertySetRegion.Null;
@ -44,12 +44,12 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -44,12 +44,12 @@ namespace ICSharpCode.NRefactory.Parser.AST
}
}
public ArrayList Parameters {
public List<ParameterDeclarationExpression> Parameters {
get {
return parameters;
}
set {
parameters = value == null ? new ArrayList(1) : value;
parameters = value == null ? new List<ParameterDeclarationExpression>(1) : value;
}
}
@ -121,12 +121,12 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -121,12 +121,12 @@ namespace ICSharpCode.NRefactory.Parser.AST
}
}
public IndexerDeclaration(Modifier modifier, ArrayList parameters, ArrayList attributes) : base(modifier, attributes)
public IndexerDeclaration(Modifier modifier, List<ParameterDeclarationExpression> parameters, List<AttributeSection> attributes) : base(modifier, attributes)
{
this.Parameters = parameters;
}
public IndexerDeclaration(TypeReference typeReference, ArrayList parameters, Modifier modifier, ArrayList attributes) : base(modifier, attributes)
public IndexerDeclaration(TypeReference typeReference, List<ParameterDeclarationExpression> parameters, Modifier modifier, List<AttributeSection> attributes) : base(modifier, attributes)
{
this.TypeReference = typeReference;
this.Parameters = parameters;

9
src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/TypeLevel/OperatorDeclaration.cs

@ -18,6 +18,7 @@ @@ -18,6 +18,7 @@
using System;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
@ -108,8 +109,8 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -108,8 +109,8 @@ namespace ICSharpCode.NRefactory.Parser.AST
/// <param name="modifier"></param>
/// <param name="List"></param>
public OperatorDeclaration(Modifier modifier,
ArrayList attributes,
ArrayList parameters,
List<AttributeSection> attributes,
List<ParameterDeclarationExpression> parameters,
TypeReference convertToType,
ConversionType conversionType
) : base(null, modifier, TypeReference.Null, parameters, attributes)
@ -124,8 +125,8 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -124,8 +125,8 @@ namespace ICSharpCode.NRefactory.Parser.AST
/// <param name="modifier"></param>
/// <param name="List"></param>
public OperatorDeclaration(Modifier modifier,
ArrayList attributes,
ArrayList parameters,
List<AttributeSection> attributes,
List<ParameterDeclarationExpression> parameters,
TypeReference typeReference,
OverloadableOperatorType overloadableOperator
) : base(null, modifier, typeReference, parameters, attributes)

24
src/Libraries/NRefactory/Project/Src/Parser/AST/General/AttributeSection.cs

@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
using System;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
@ -66,12 +66,10 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -66,12 +66,10 @@ namespace ICSharpCode.NRefactory.Parser.AST
public class Attribute : AbstractNode
{
string name = "";
// List<Expression> positionalArguments;
// List<NamedArgumentExpression> namedArguments;
ArrayList positionalArguments;
ArrayList namedArguments;
List<Expression> positionalArguments;
List<NamedArgumentExpression> namedArguments;
public Attribute(string name, ArrayList positionalArguments, ArrayList namedArguments)
public Attribute(string name, List<Expression> positionalArguments, List<NamedArgumentExpression> namedArguments)
{
Debug.Assert(name != null);
Debug.Assert(positionalArguments != null);
@ -88,13 +86,13 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -88,13 +86,13 @@ namespace ICSharpCode.NRefactory.Parser.AST
}
}
public ArrayList PositionalArguments {
public List<Expression> PositionalArguments {
get {
return positionalArguments;
}
}
public ArrayList NamedArguments {
public List<NamedArgumentExpression> NamedArguments {
get {
return namedArguments;
}
@ -117,8 +115,7 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -117,8 +115,7 @@ namespace ICSharpCode.NRefactory.Parser.AST
public class AttributeSection : AbstractNode, INullable
{
string attributeTarget = "";
// List<Attribute> attributes;
ArrayList attributes;
List<Attribute> attributes;
static AttributeSection nullSection = new NullAttributeSection();
public virtual bool IsNull {
@ -147,19 +144,20 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -147,19 +144,20 @@ namespace ICSharpCode.NRefactory.Parser.AST
}
}
public ArrayList Attributes {
public List<Attribute> Attributes {
get {
return attributes;
}
set {
attributes = value == null ? new ArrayList(1) : value;
attributes = value == null ? new List<Attribute>(1) : value;
}
}
public AttributeSection() : this(null, null)
{
}
public AttributeSection(string attributeTarget, ArrayList attributes)
public AttributeSection(string attributeTarget, List<Attribute> attributes)
{
this.AttributeTarget = attributeTarget;
this.Attributes = attributes;

8
src/Libraries/NRefactory/Project/Src/Parser/AST/General/GlobalScope/DelegateDeclaration.cs

@ -17,7 +17,6 @@ @@ -17,7 +17,6 @@
using System;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
@ -26,8 +25,7 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -26,8 +25,7 @@ namespace ICSharpCode.NRefactory.Parser.AST
{
string name = "";
TypeReference returnType = TypeReference.Null;
// List<ParameterDeclarationExpression> parameters = new List<ParameterDeclarationExpression>(1);
ArrayList parameters = new ArrayList(1);
List<ParameterDeclarationExpression> parameters = new List<ParameterDeclarationExpression>(1);
List<TemplateDefinition> templates = new List<TemplateDefinition>();
public string Name {
@ -49,7 +47,7 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -49,7 +47,7 @@ namespace ICSharpCode.NRefactory.Parser.AST
}
}
public ArrayList Parameters {
public List<ParameterDeclarationExpression> Parameters {
get {
return parameters;
}
@ -69,7 +67,7 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -69,7 +67,7 @@ namespace ICSharpCode.NRefactory.Parser.AST
}
}
public DelegateDeclaration(Modifier modifier, ArrayList attributes) : base(modifier, attributes)
public DelegateDeclaration(Modifier modifier, List<AttributeSection> attributes) : base(modifier, attributes)
{
}

4
src/Libraries/NRefactory/Project/Src/Parser/AST/General/GlobalScope/TypeDeclaration.cs

@ -84,7 +84,7 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -84,7 +84,7 @@ namespace ICSharpCode.NRefactory.Parser.AST
}
}
public TypeDeclaration(Modifier modifier, ArrayList attributes) : base(modifier, attributes)
public TypeDeclaration(Modifier modifier, List<AttributeSection> attributes) : base(modifier, attributes)
{
}
@ -135,7 +135,7 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -135,7 +135,7 @@ namespace ICSharpCode.NRefactory.Parser.AST
}
}
public TemplateDefinition(string name, ArrayList attributes) : base(attributes)
public TemplateDefinition(string name, List<AttributeSection> attributes) : base(attributes)
{
if (name == null || name.Length == 0)
name = "?";

5
src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/ConstructorDeclaration.cs

@ -18,6 +18,7 @@ @@ -18,6 +18,7 @@
using System;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
@ -44,11 +45,11 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -44,11 +45,11 @@ namespace ICSharpCode.NRefactory.Parser.AST
}
}
public ConstructorDeclaration(string name, Modifier modifier, ArrayList parameters, ArrayList attributes) : base(modifier, attributes, name, parameters)
public ConstructorDeclaration(string name, Modifier modifier, List<ParameterDeclarationExpression> parameters, List<AttributeSection> attributes) : base(modifier, attributes, name, parameters)
{
}
public ConstructorDeclaration(string name, Modifier modifier, ArrayList parameters, ConstructorInitializer constructorInitializer, ArrayList attributes) : base(modifier, attributes, name, parameters)
public ConstructorDeclaration(string name, Modifier modifier, List<ParameterDeclarationExpression> parameters, ConstructorInitializer constructorInitializer, List<AttributeSection> attributes) : base(modifier, attributes, name, parameters)
{
this.ConstructorInitializer = constructorInitializer;
}

11
src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/EventAddRemoveRegion.cs

@ -18,6 +18,7 @@ @@ -18,6 +18,7 @@
using System;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
@ -51,7 +52,7 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -51,7 +52,7 @@ namespace ICSharpCode.NRefactory.Parser.AST
}
}
public EventAddRemoveRegion(ArrayList attributes) : base(attributes)
public EventAddRemoveRegion(List<AttributeSection> attributes) : base(attributes)
{
Parameters = null;
}
@ -70,7 +71,7 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -70,7 +71,7 @@ namespace ICSharpCode.NRefactory.Parser.AST
}
}
public EventAddRegion(ArrayList attributes) : base (attributes)
public EventAddRegion(List<AttributeSection> attributes) : base (attributes)
{}
public override object AcceptVisitor(IASTVisitor visitor, object data)
@ -94,7 +95,7 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -94,7 +95,7 @@ namespace ICSharpCode.NRefactory.Parser.AST
}
}
public EventRemoveRegion(ArrayList attributes) : base (attributes)
public EventRemoveRegion(List<AttributeSection> attributes) : base (attributes)
{}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
@ -117,7 +118,7 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -117,7 +118,7 @@ namespace ICSharpCode.NRefactory.Parser.AST
}
}
NullEventAddRegion() : base(new ArrayList(1))
NullEventAddRegion() : base(new List<AttributeSection>(1))
{
}
@ -148,7 +149,7 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -148,7 +149,7 @@ namespace ICSharpCode.NRefactory.Parser.AST
}
}
NullEventRemoveRegion() : base(new ArrayList(1))
NullEventRemoveRegion() : base(new List<AttributeSection>(1))
{
}

8
src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/EventDeclaration.cs

@ -106,23 +106,23 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -106,23 +106,23 @@ namespace ICSharpCode.NRefactory.Parser.AST
}
}
public EventDeclaration(Modifier modifier, ArrayList attributes) : base(modifier, attributes)
public EventDeclaration(Modifier modifier, List<AttributeSection> attributes) : base(modifier, attributes)
{
}
public EventDeclaration(TypeReference typeReference, List<VariableDeclaration> variableDeclarators, Modifier modifier, ArrayList attributes) : base(modifier, attributes)
public EventDeclaration(TypeReference typeReference, List<VariableDeclaration> variableDeclarators, Modifier modifier, List<AttributeSection> attributes) : base(modifier, attributes)
{
this.TypeReference = typeReference;
this.VariableDeclarators = variableDeclarators;
}
public EventDeclaration(TypeReference typeReference, string name, Modifier modifier, ArrayList attributes) : base(modifier, attributes, name)
public EventDeclaration(TypeReference typeReference, string name, Modifier modifier, List<AttributeSection> attributes) : base(modifier, attributes, name)
{
this.TypeReference = typeReference;
}
// for VB:
public EventDeclaration(TypeReference typeReference, Modifier modifier, ArrayList parameters, ArrayList attributes, string name, ArrayList implementsClause) : base(modifier, attributes, name, parameters)
public EventDeclaration(TypeReference typeReference, Modifier modifier, List<ParameterDeclarationExpression> parameters, List<AttributeSection> attributes, string name, ArrayList implementsClause) : base(modifier, attributes, name, parameters)
{
this.TypeReference = typeReference;
this.ImplementsClause = implementsClause;

30
src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/FieldDeclaration.cs

@ -22,23 +22,11 @@ using System.Collections.Generic; @@ -22,23 +22,11 @@ using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class FieldDeclaration : AbstractNode
public class FieldDeclaration : AttributedNode
{
// List<AttributeSection> attributes;
ArrayList attributes;
TypeReference typeReference = TypeReference.Null;
Modifier modifier = Modifier.None;
List<VariableDeclaration> fields = new List<VariableDeclaration>(1);
public ArrayList Attributes {
get {
return attributes;
}
set {
Debug.Assert(value != null);
attributes = value;
}
}
public TypeReference TypeReference {
get {
return typeReference;
@ -47,14 +35,7 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -47,14 +35,7 @@ namespace ICSharpCode.NRefactory.Parser.AST
typeReference = TypeReference.CheckNull(value);
}
}
public Modifier Modifier {
get {
return modifier;
}
set {
modifier = value;
}
}
public List<VariableDeclaration> Fields {
get {
return fields;
@ -80,18 +61,15 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -80,18 +61,15 @@ namespace ICSharpCode.NRefactory.Parser.AST
}
// for enum members
public FieldDeclaration(ArrayList attributes)
public FieldDeclaration(List<AttributeSection> attributes) : base(attributes)
{
Debug.Assert(attributes != null);
this.attributes = attributes;
}
// for all other cases
public FieldDeclaration(ArrayList attributes, TypeReference typeReference, Modifier modifier)
public FieldDeclaration(List<AttributeSection> attributes, TypeReference typeReference, Modifier modifier) : base(modifier, attributes)
{
this.attributes = attributes;
this.TypeReference = typeReference;
this.modifier = modifier;
}
public VariableDeclaration GetVariableDeclaration(string variableName)

2
src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/MethodDeclaration.cs

@ -86,7 +86,7 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -86,7 +86,7 @@ namespace ICSharpCode.NRefactory.Parser.AST
}
}
public MethodDeclaration(string name, Modifier modifier, TypeReference typeReference, ArrayList parameters, ArrayList attributes) : base(modifier, attributes, name, parameters)
public MethodDeclaration(string name, Modifier modifier, TypeReference typeReference, List<ParameterDeclarationExpression> parameters, List<AttributeSection> attributes) : base(modifier, attributes, name, parameters)
{
this.TypeReference = typeReference;
}

6
src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/ParameterDeclarationExpression.cs

@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
using System;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
@ -11,7 +11,7 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -11,7 +11,7 @@ namespace ICSharpCode.NRefactory.Parser.AST
TypeReference typeReference = TypeReference.Null;
string parameterName = "";
ParamModifier paramModifier = ParamModifier.In;
ArrayList attributes = new ArrayList(1);
List<AttributeSection> attributes = new List<AttributeSection>(1);
Expression defaultValue = Expression.Null;
public Expression DefaultValue {
@ -51,7 +51,7 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -51,7 +51,7 @@ namespace ICSharpCode.NRefactory.Parser.AST
}
}
public ArrayList Attributes {
public List<AttributeSection> Attributes {
get {
return attributes;
}

4
src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/PropertyDeclaration.cs

@ -19,7 +19,7 @@ using System; @@ -19,7 +19,7 @@ using System;
using System.Drawing;
using System.Diagnostics;
using System.Collections;
using System.Collections.Specialized;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
@ -119,7 +119,7 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -119,7 +119,7 @@ namespace ICSharpCode.NRefactory.Parser.AST
}
}
public PropertyDeclaration(string name, TypeReference typeReference, Modifier modifier, ArrayList attributes) : base(modifier, attributes, name)
public PropertyDeclaration(string name, TypeReference typeReference, Modifier modifier, List<AttributeSection> attributes) : base(modifier, attributes, name)
{
Debug.Assert(typeReference != null);
this.typeReference = typeReference;

15
src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/PropertyGetSetRegion.cs

@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
using System;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
@ -43,7 +43,7 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -43,7 +43,7 @@ namespace ICSharpCode.NRefactory.Parser.AST
}
}
public PropertyGetSetRegion(BlockStatement block, ArrayList attributes) : base(attributes)
public PropertyGetSetRegion(BlockStatement block, List<AttributeSection> attributes) : base(attributes)
{
this.Block = block;
}
@ -57,7 +57,7 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -57,7 +57,7 @@ namespace ICSharpCode.NRefactory.Parser.AST
}
}
public PropertyGetRegion(BlockStatement block, ArrayList attributes) : base(block, attributes)
public PropertyGetRegion(BlockStatement block, List<AttributeSection> attributes) : base(block, attributes)
{}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
@ -73,15 +73,14 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -73,15 +73,14 @@ namespace ICSharpCode.NRefactory.Parser.AST
public class PropertySetRegion : PropertyGetSetRegion
{
// List<ParameterDeclarationExpression> parameters = new List<ParameterDeclarationExpression>(1);
ArrayList parameters = new ArrayList(1);
List<ParameterDeclarationExpression> parameters = new List<ParameterDeclarationExpression>(1);
public ArrayList Parameters {
public List<ParameterDeclarationExpression> Parameters {
get {
return parameters;
}
set {
parameters = value == null ? new ArrayList(1) : value;
parameters = value == null ? new List<ParameterDeclarationExpression>(1) : value;
}
}
public static NullPropertySetRegion Null {
@ -90,7 +89,7 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -90,7 +89,7 @@ namespace ICSharpCode.NRefactory.Parser.AST
}
}
public PropertySetRegion(BlockStatement block, ArrayList attributes) : base(block, attributes)
public PropertySetRegion(BlockStatement block, List<AttributeSection> attributes) : base(block, attributes)
{}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{

15
src/Libraries/NRefactory/Project/Src/Parser/AST/ParametrizedNode.cs

@ -17,15 +17,14 @@ @@ -17,15 +17,14 @@
using System;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
public abstract class ParametrizedNode : AttributedNode
{
protected string name = String.Empty;
// protected List<ParameterDeclarationExpression> parameters;
protected ArrayList parameters;
protected List<ParameterDeclarationExpression> parameters;
public string Name {
get {
@ -36,24 +35,24 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -36,24 +35,24 @@ namespace ICSharpCode.NRefactory.Parser.AST
}
}
public ArrayList Parameters {
public List<ParameterDeclarationExpression> Parameters {
get {
return parameters;
}
set {
parameters = value == null ? new ArrayList(1) : value;
parameters = value == null ? new List<ParameterDeclarationExpression>(1) : value;
}
}
public ParametrizedNode(Modifier modifier, ArrayList attributes) : this(modifier, attributes, null)
public ParametrizedNode(Modifier modifier, List<AttributeSection> attributes) : this(modifier, attributes, null)
{
}
public ParametrizedNode(Modifier modifier, ArrayList attributes, string name) : this(modifier, attributes, name, null)
public ParametrizedNode(Modifier modifier, List<AttributeSection> attributes, string name) : this(modifier, attributes, name, null)
{
}
public ParametrizedNode(Modifier modifier, ArrayList attributes, string name, ArrayList parameters) : base(modifier, attributes)
public ParametrizedNode(Modifier modifier, List<AttributeSection> attributes, string name, List<ParameterDeclarationExpression> parameters) : base(modifier, attributes)
{
// use properties because of the null check.
this.Name = name;

3
src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/TypeLevel/DeclareDeclaration.cs

@ -18,6 +18,7 @@ @@ -18,6 +18,7 @@
using System;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
@ -77,7 +78,7 @@ namespace ICSharpCode.NRefactory.Parser.AST @@ -77,7 +78,7 @@ namespace ICSharpCode.NRefactory.Parser.AST
}
}
public DeclareDeclaration(string name, Modifier modifier, TypeReference returnType, ArrayList parameters, ArrayList attributes, string library, string alias, CharsetModifier charset) : base(modifier, attributes, name, parameters)
public DeclareDeclaration(string name, Modifier modifier, TypeReference returnType, List<ParameterDeclarationExpression> parameters, List<AttributeSection> attributes, string library, string alias, CharsetModifier charset) : base(modifier, attributes, name, parameters)
{
this.TypeReference = returnType;
this.Library = library;

112
src/Libraries/NRefactory/Project/Src/Parser/CSharp/Parser.cs

@ -7,6 +7,7 @@ using System.Collections.Specialized; @@ -7,6 +7,7 @@ using System.Collections.Specialized;
using System.Text;
using ICSharpCode.NRefactory.Parser;
using ICSharpCode.NRefactory.Parser.AST;
using ASTAttribute = ICSharpCode.NRefactory.Parser.AST.Attribute;
/*
Parser.frame file for NRefactory.
*/
@ -490,15 +491,15 @@ out qualident); @@ -490,15 +491,15 @@ out qualident);
void GlobalAttributeSection() {
Expect(17);
#line 586 "cs.ATG"
#line 585 "cs.ATG"
Point startPos = t.Location;
Expect(1);
#line 586 "cs.ATG"
if (t.val != "assembly") Error("global attribute target specifier (\"assembly\") expected");
string attributeTarget = t.val;
ArrayList attributes = new ArrayList();
ICSharpCode.NRefactory.Parser.AST.Attribute attribute;
List<ASTAttribute> attributes = new List<ASTAttribute>();
ASTAttribute attribute;
Expect(9);
Attribute(
@ -535,7 +536,7 @@ out attribute); @@ -535,7 +536,7 @@ out attribute);
#line 678 "cs.ATG"
AttributeSection section;
ArrayList attributes = new ArrayList();
List<AttributeSection> attributes = new List<AttributeSection>();
Modifiers m = new Modifiers();
string qualident;
@ -615,7 +616,7 @@ DotAndIdent()) { @@ -615,7 +616,7 @@ DotAndIdent()) {
void Attribute(
#line 601 "cs.ATG"
out ICSharpCode.NRefactory.Parser.AST.Attribute attribute) {
out ASTAttribute attribute) {
#line 602 "cs.ATG"
string qualident;
@ -624,14 +625,14 @@ out ICSharpCode.NRefactory.Parser.AST.Attribute attribute) { @@ -624,14 +625,14 @@ out ICSharpCode.NRefactory.Parser.AST.Attribute attribute) {
out qualident);
#line 604 "cs.ATG"
ArrayList positional = new ArrayList();
ArrayList named = new ArrayList();
List<Expression> positional = new List<Expression>();
List<NamedArgumentExpression> named = new List<NamedArgumentExpression>();
string name = qualident;
if (la.kind == 19) {
AttributeArguments(
#line 608 "cs.ATG"
ref positional, ref named);
positional, named);
}
#line 608 "cs.ATG"
@ -640,7 +641,7 @@ ref positional, ref named); @@ -640,7 +641,7 @@ ref positional, ref named);
void AttributeArguments(
#line 611 "cs.ATG"
ref ArrayList positional, ref ArrayList named) {
List<Expression> positional, List<NamedArgumentExpression> named) {
#line 613 "cs.ATG"
bool nameFound = false;
@ -750,8 +751,8 @@ out AttributeSection section) { @@ -750,8 +751,8 @@ out AttributeSection section) {
#line 647 "cs.ATG"
string attributeTarget = "";
ArrayList attributes = new ArrayList();
ICSharpCode.NRefactory.Parser.AST.Attribute attribute;
List<ASTAttribute> attributes = new List<ASTAttribute>();
ASTAttribute attribute;
Expect(17);
@ -894,12 +895,12 @@ Modifiers m) { @@ -894,12 +895,12 @@ Modifiers m) {
void TypeDecl(
#line 703 "cs.ATG"
Modifiers m, ArrayList attributes) {
Modifiers m, List<AttributeSection> attributes) {
#line 705 "cs.ATG"
TypeReference type;
ArrayList names;
ArrayList p;
List<ParameterDeclarationExpression> p = new List<ParameterDeclarationExpression>();
string name;
List<TemplateDefinition> templates;
@ -1121,7 +1122,7 @@ templates); @@ -1121,7 +1122,7 @@ templates);
if (StartOf(9)) {
FormalParameterList(
#line 804 "cs.ATG"
out p);
p);
#line 804 "cs.ATG"
delegateDeclr.Parameters = p;
@ -1150,7 +1151,7 @@ List<TemplateDefinition> templates) { @@ -1150,7 +1151,7 @@ List<TemplateDefinition> templates) {
#line 2214 "cs.ATG"
AttributeSection section;
ArrayList attributes = new ArrayList();
List<AttributeSection> attributes = new List<AttributeSection>();
Expect(22);
while (la.kind == 17) {
@ -1266,7 +1267,7 @@ out type); @@ -1266,7 +1267,7 @@ out type);
while (StartOf(10)) {
#line 840 "cs.ATG"
ArrayList attributes = new ArrayList();
List<AttributeSection> attributes = new List<AttributeSection>();
Modifiers m = new Modifiers();
while (la.kind == 17) {
@ -1323,7 +1324,7 @@ out qualident); @@ -1323,7 +1324,7 @@ out qualident);
while (StartOf(12)) {
#line 864 "cs.ATG"
ArrayList attributes = new ArrayList();
List<AttributeSection> attributes = new List<AttributeSection>();
Modifiers m = new Modifiers();
while (la.kind == 17) {
@ -1546,13 +1547,12 @@ IsPointerOrDims()) { @@ -1546,13 +1547,12 @@ IsPointerOrDims()) {
void FormalParameterList(
#line 947 "cs.ATG"
out ArrayList parameter) {
List<ParameterDeclarationExpression> parameter) {
#line 949 "cs.ATG"
parameter = new ArrayList();
#line 950 "cs.ATG"
ParameterDeclarationExpression p;
AttributeSection section;
ArrayList attributes = new ArrayList();
List<AttributeSection> attributes = new List<AttributeSection>();
while (la.kind == 17) {
AttributeSection(
@ -1576,7 +1576,7 @@ out p); @@ -1576,7 +1576,7 @@ out p);
lexer.NextToken();
#line 962 "cs.ATG"
attributes = new ArrayList(); if (paramsFound) Error("params array must be at end of parameter list");
attributes = new List<AttributeSection>(); if (paramsFound) Error("params array must be at end of parameter list");
while (la.kind == 17) {
AttributeSection(
#line 963 "cs.ATG"
@ -1748,7 +1748,7 @@ Modifiers m) { @@ -1748,7 +1748,7 @@ Modifiers m) {
void ClassMemberDecl(
#line 1278 "cs.ATG"
Modifiers m, ArrayList attributes) {
Modifiers m, List<AttributeSection> attributes) {
#line 1279 "cs.ATG"
Statement stmt = null;
@ -1790,13 +1790,13 @@ out stmt); @@ -1790,13 +1790,13 @@ out stmt);
void StructMemberDecl(
#line 1048 "cs.ATG"
Modifiers m, ArrayList attributes) {
Modifiers m, List<AttributeSection> attributes) {
#line 1050 "cs.ATG"
string qualident = null;
TypeReference type;
Expression expr;
ArrayList p = new ArrayList();
List<ParameterDeclarationExpression> p = new List<ParameterDeclarationExpression>();
Statement stmt = null;
List<VariableDeclaration> variableDeclarators = new List<VariableDeclaration>();
List<TemplateDefinition> templates = new List<TemplateDefinition>();
@ -1869,15 +1869,15 @@ templates); @@ -1869,15 +1869,15 @@ templates);
if (StartOf(9)) {
FormalParameterList(
#line 1081 "cs.ATG"
out p);
p);
}
Expect(20);
#line 1081 "cs.ATG"
MethodDeclaration methodDeclaration = new MethodDeclaration(qualident,
m.Modifier,
new TypeReference("void"),
p,
MethodDeclaration methodDeclaration = new MethodDeclaration(qualident,
m.Modifier,
new TypeReference("void"),
p,
attributes);
methodDeclaration.StartLocation = startPos;
methodDeclaration.EndLocation = t.EndLocation;
@ -1983,7 +1983,7 @@ IdentAndLPar()) { @@ -1983,7 +1983,7 @@ IdentAndLPar()) {
m.Check(Modifier.Constructors);
FormalParameterList(
#line 1125 "cs.ATG"
out p);
p);
}
Expect(20);
@ -2056,7 +2056,7 @@ out stmt); @@ -2056,7 +2056,7 @@ out stmt);
} else SynErr(143);
#line 1148 "cs.ATG"
ArrayList parameters = new ArrayList();
List<ParameterDeclarationExpression> parameters = new List<ParameterDeclarationExpression>();
parameters.Add(new ParameterDeclarationExpression(type, varName));
OperatorDeclaration operatorDeclaration = new OperatorDeclaration(m.Modifier,
attributes,
@ -2121,7 +2121,7 @@ out stmt); @@ -2121,7 +2121,7 @@ out stmt);
} else SynErr(145);
#line 1180 "cs.ATG"
ArrayList parameters = new ArrayList();
List<ParameterDeclarationExpression> parameters = new List<ParameterDeclarationExpression>();
parameters.Add(new ParameterDeclarationExpression(firstType, firstName));
if (secondType != null) {
parameters.Add(new ParameterDeclarationExpression(secondType, secondName));
@ -2164,7 +2164,7 @@ variableDeclarators); @@ -2164,7 +2164,7 @@ variableDeclarators);
Expect(17);
FormalParameterList(
#line 1205 "cs.ATG"
out p);
p);
Expect(18);
#line 1205 "cs.ATG"
@ -2211,7 +2211,7 @@ templates); @@ -2211,7 +2211,7 @@ templates);
if (StartOf(9)) {
FormalParameterList(
#line 1225 "cs.ATG"
out p);
p);
}
Expect(20);
@ -2275,7 +2275,7 @@ out getRegion, out setRegion); @@ -2275,7 +2275,7 @@ out getRegion, out setRegion);
Expect(17);
FormalParameterList(
#line 1258 "cs.ATG"
out p);
p);
Expect(18);
#line 1259 "cs.ATG"
@ -2311,11 +2311,11 @@ out getRegion, out setRegion); @@ -2311,11 +2311,11 @@ out getRegion, out setRegion);
#line 1295 "cs.ATG"
TypeReference type;
ArrayList p;
AttributeSection section;
Modifier mod = Modifier.None;
ArrayList attributes = new ArrayList();
ArrayList parameters = new ArrayList();
List<AttributeSection> attributes = new List<AttributeSection>();
List<ParameterDeclarationExpression> parameters = new List<ParameterDeclarationExpression>();
string name;
PropertyGetRegion getBlock;
PropertySetRegion setBlock;
@ -2351,7 +2351,7 @@ NotVoidPointer()) { @@ -2351,7 +2351,7 @@ NotVoidPointer()) {
if (StartOf(9)) {
FormalParameterList(
#line 1313 "cs.ATG"
out parameters);
parameters);
}
Expect(20);
Expect(11);
@ -2385,7 +2385,7 @@ templates); @@ -2385,7 +2385,7 @@ templates);
if (StartOf(9)) {
FormalParameterList(
#line 1326 "cs.ATG"
out parameters);
parameters);
}
Expect(20);
while (
@ -2424,14 +2424,14 @@ out getBlock, out setBlock); @@ -2424,14 +2424,14 @@ out getBlock, out setBlock);
Expect(17);
FormalParameterList(
#line 1339 "cs.ATG"
out p);
parameters);
Expect(18);
#line 1339 "cs.ATG"
Point bracketEndLocation = t.EndLocation;
#line 1339 "cs.ATG"
IndexerDeclaration id = new IndexerDeclaration(type, p, mod, attributes); compilationUnit.AddChild(id);
IndexerDeclaration id = new IndexerDeclaration(type, parameters, mod, attributes); compilationUnit.AddChild(id);
Expect(15);
#line 1340 "cs.ATG"
@ -2472,7 +2472,7 @@ out FieldDeclaration f) { @@ -2472,7 +2472,7 @@ out FieldDeclaration f) {
#line 1353 "cs.ATG"
Expression expr = null;
ArrayList attributes = new ArrayList();
List<AttributeSection> attributes = new List<AttributeSection>();
AttributeSection section = null;
VariableDeclaration varDecl = null;
@ -2692,7 +2692,7 @@ out EventAddRegion addBlock, out EventRemoveRegion removeBlock) { @@ -2692,7 +2692,7 @@ out EventAddRegion addBlock, out EventRemoveRegion removeBlock) {
#line 1412 "cs.ATG"
AttributeSection section;
ArrayList attributes = new ArrayList();
List<AttributeSection> attributes = new List<AttributeSection>();
Statement stmt;
addBlock = null;
removeBlock = null;
@ -2716,7 +2716,7 @@ IdentIsAdd()) { @@ -2716,7 +2716,7 @@ IdentIsAdd()) {
out stmt);
#line 1422 "cs.ATG"
attributes = new ArrayList(); addBlock.Block = (BlockStatement)stmt;
attributes = new List<AttributeSection>(); addBlock.Block = (BlockStatement)stmt;
while (la.kind == 17) {
AttributeSection(
#line 1423 "cs.ATG"
@ -2739,7 +2739,7 @@ IdentIsRemove()) { @@ -2739,7 +2739,7 @@ IdentIsRemove()) {
out stmt);
#line 1426 "cs.ATG"
removeBlock = new EventRemoveRegion(attributes); removeBlock.Block = (BlockStatement)stmt; attributes = new ArrayList();
removeBlock = new EventRemoveRegion(attributes); removeBlock.Block = (BlockStatement)stmt; attributes = new List<AttributeSection>();
while (la.kind == 17) {
AttributeSection(
#line 1427 "cs.ATG"
@ -2970,7 +2970,7 @@ out OverloadableOperatorType op) { @@ -2970,7 +2970,7 @@ out OverloadableOperatorType op) {
out PropertyGetRegion getBlock, out PropertySetRegion setBlock) {
#line 1371 "cs.ATG"
ArrayList attributes = new ArrayList();
List<AttributeSection> attributes = new List<AttributeSection>();
AttributeSection section;
getBlock = null;
setBlock = null;
@ -2992,7 +2992,7 @@ out getBlock, attributes); @@ -2992,7 +2992,7 @@ out getBlock, attributes);
if (la.kind == 1 || la.kind == 17) {
#line 1381 "cs.ATG"
attributes = new ArrayList();
attributes = new List<AttributeSection>();
while (la.kind == 17) {
AttributeSection(
#line 1382 "cs.ATG"
@ -3014,7 +3014,7 @@ out setBlock, attributes); @@ -3014,7 +3014,7 @@ out setBlock, attributes);
if (la.kind == 1 || la.kind == 17) {
#line 1387 "cs.ATG"
attributes = new ArrayList();
attributes = new List<AttributeSection>();
while (la.kind == 17) {
AttributeSection(
#line 1388 "cs.ATG"
@ -3041,7 +3041,7 @@ out PropertyGetRegion getBlock, out PropertySetRegion setBlock) { @@ -3041,7 +3041,7 @@ out PropertyGetRegion getBlock, out PropertySetRegion setBlock) {
#line 1435 "cs.ATG"
AttributeSection section;
ArrayList attributes = new ArrayList();
List<AttributeSection> attributes = new List<AttributeSection>();
getBlock = null; setBlock = null;
while (la.kind == 17) {
@ -3075,7 +3075,7 @@ IdentIsSet()) { @@ -3075,7 +3075,7 @@ IdentIsSet()) {
Expect(11);
#line 1446 "cs.ATG"
attributes = new ArrayList();
attributes = new List<AttributeSection>();
if (la.kind == 1 || la.kind == 17) {
while (la.kind == 17) {
AttributeSection(
@ -3115,7 +3115,7 @@ IdentIsSet()) { @@ -3115,7 +3115,7 @@ IdentIsSet()) {
void GetAccessorDecl(
#line 1395 "cs.ATG"
out PropertyGetRegion getBlock, ArrayList attributes) {
out PropertyGetRegion getBlock, List<AttributeSection> attributes) {
#line 1396 "cs.ATG"
Statement stmt = null;
@ -3137,7 +3137,7 @@ out stmt); @@ -3137,7 +3137,7 @@ out stmt);
void SetAccessorDecl(
#line 1403 "cs.ATG"
out PropertySetRegion setBlock, ArrayList attributes) {
out PropertySetRegion setBlock, List<AttributeSection> attributes) {
#line 1404 "cs.ATG"
Statement stmt = null;
@ -4827,14 +4827,14 @@ out Expression outExpr) { @@ -4827,14 +4827,14 @@ out Expression outExpr) {
AnonymousMethodExpression expr = new AnonymousMethodExpression();
expr.StartLocation = t.Location;
Statement stmt;
ArrayList p;
List<ParameterDeclarationExpression> p = new List<ParameterDeclarationExpression>();
outExpr = expr;
Expect(19);
if (StartOf(9)) {
FormalParameterList(
#line 2058 "cs.ATG"
out p);
p);
#line 2058 "cs.ATG"
expr.Parameters = p;

124
src/Libraries/NRefactory/Project/Src/Parser/CSharp/cs.ATG

@ -5,11 +5,11 @@ using System.Collections.Specialized; @@ -5,11 +5,11 @@ using System.Collections.Specialized;
using System.Text;
using ICSharpCode.NRefactory.Parser;
using ICSharpCode.NRefactory.Parser.AST;
using ASTAttribute = ICSharpCode.NRefactory.Parser.AST.Attribute;
COMPILER CS /* AW 2002-12-30 renamed from CompilationUnit to CS */
/*----------------------------- token sets -------------------------------*/
string assemblyName = null;
StringBuilder qualidentBuilder = new StringBuilder();
@ -582,11 +582,11 @@ UsingDirective @@ -582,11 +582,11 @@ UsingDirective
GlobalAttributeSection
=
"[" (. Point startPos = t.Location; .) ident (. if (t.val != "assembly") Error("global attribute target specifier (\"assembly\") expected");
"[" (. Point startPos = t.Location; .) ident
(. if (t.val != "assembly") Error("global attribute target specifier (\"assembly\") expected");
string attributeTarget = t.val;
ArrayList attributes = new ArrayList();
ICSharpCode.NRefactory.Parser.AST.Attribute attribute;
List<ASTAttribute> attributes = new List<ASTAttribute>();
ASTAttribute attribute;
.)
":" Attribute<out attribute> (. attributes.Add(attribute); .)
{ IF (NotFinalComma()) "," Attribute<out attribute> (. attributes.Add(attribute); .)}
@ -598,17 +598,17 @@ GlobalAttributeSection @@ -598,17 +598,17 @@ GlobalAttributeSection
.)
.
Attribute<out ICSharpCode.NRefactory.Parser.AST.Attribute attribute>
Attribute<out ASTAttribute attribute>
(. string qualident; .)
=
Qualident<out qualident> (. ArrayList positional = new ArrayList();
ArrayList named = new ArrayList();
Qualident<out qualident> (. List<Expression> positional = new List<Expression>();
List<NamedArgumentExpression> named = new List<NamedArgumentExpression>();
string name = qualident;
.)
[ AttributeArguments<ref positional, ref named> ] (. attribute = new ICSharpCode.NRefactory.Parser.AST.Attribute(name, positional, named);.)
[ AttributeArguments<positional, named> ] (. attribute = new ICSharpCode.NRefactory.Parser.AST.Attribute(name, positional, named);.)
.
AttributeArguments<ref ArrayList positional, ref ArrayList named>
AttributeArguments<List<Expression> positional, List<NamedArgumentExpression> named>
(.
bool nameFound = false;
string name = "";
@ -645,8 +645,8 @@ AttributeArguments<ref ArrayList positional, ref ArrayList named> @@ -645,8 +645,8 @@ AttributeArguments<ref ArrayList positional, ref ArrayList named>
AttributeSection<out AttributeSection section>
(.
string attributeTarget = "";
ArrayList attributes = new ArrayList();
ICSharpCode.NRefactory.Parser.AST.Attribute attribute;
List<ASTAttribute> attributes = new List<ASTAttribute>();
ASTAttribute attribute;
.)
=
@ -676,7 +676,7 @@ AttributeSection<out AttributeSection section> @@ -676,7 +676,7 @@ AttributeSection<out AttributeSection section>
NamespaceMemberDecl
(.
AttributeSection section;
ArrayList attributes = new ArrayList();
List<AttributeSection> attributes = new List<AttributeSection>();
Modifiers m = new Modifiers();
string qualident;
.)
@ -700,11 +700,11 @@ NamespaceMemberDecl @@ -700,11 +700,11 @@ NamespaceMemberDecl
TypeDecl<m, attributes>
.
TypeDecl<Modifiers m, ArrayList attributes>
TypeDecl<Modifiers m, List<AttributeSection> attributes>
(.
TypeReference type;
ArrayList names;
ArrayList p;
List<ParameterDeclarationExpression> p = new List<ParameterDeclarationExpression>();
string name;
List<TemplateDefinition> templates;
.)
@ -801,7 +801,7 @@ TypeDecl<Modifiers m, ArrayList attributes> @@ -801,7 +801,7 @@ TypeDecl<Modifiers m, ArrayList attributes>
/* .NET 2.0 */
[ TypeParameterList<templates> ]
"(" [ FormalParameterList<out p> (. delegateDeclr.Parameters = p; .)
"(" [ FormalParameterList<p> (. delegateDeclr.Parameters = p; .)
] ")"
/* .NET 2.0 */
@ -837,7 +837,7 @@ ClassBody @@ -837,7 +837,7 @@ ClassBody
(. AttributeSection section; .)
=
"{"
{ (.ArrayList attributes = new ArrayList();
{ (.List<AttributeSection> attributes = new List<AttributeSection>();
Modifiers m = new Modifiers();
.)
{ AttributeSection<out section> (. attributes.Add(section); .) }
@ -861,7 +861,7 @@ StructBody @@ -861,7 +861,7 @@ StructBody
(. AttributeSection section; .)
=
"{"
{ (.ArrayList attributes = new ArrayList();
{ (.List<AttributeSection> attributes = new List<AttributeSection>();
Modifiers m = new Modifiers();
.)
{ AttributeSection<out section> (. attributes.Add(section); .) }
@ -944,12 +944,12 @@ SimpleType<out string name> @@ -944,12 +944,12 @@ SimpleType<out string name>
.
FormalParameterList<out ArrayList parameter>
FormalParameterList<List<ParameterDeclarationExpression> parameter>
(.
parameter = new ArrayList();
ParameterDeclarationExpression p;
AttributeSection section;
ArrayList attributes = new ArrayList();
List<AttributeSection> attributes = new List<AttributeSection>();
.)
=
{ AttributeSection<out section> (.attributes.Add(section); .) }
@ -959,7 +959,7 @@ FormalParameterList<out ArrayList parameter> @@ -959,7 +959,7 @@ FormalParameterList<out ArrayList parameter>
parameter.Add(p);
.)
{
"," (. attributes = new ArrayList(); if (paramsFound) Error("params array must be at end of parameter list"); .)
"," (. attributes = new List<AttributeSection>(); if (paramsFound) Error("params array must be at end of parameter list"); .)
{ AttributeSection<out section> (.attributes.Add(section); .) }
(
FixedParameter<out p> (. p.Attributes = attributes; parameter.Add(p); .)
@ -1045,12 +1045,12 @@ MemberModifier<Modifiers m> @@ -1045,12 +1045,12 @@ MemberModifier<Modifiers m>
| "volatile" (. m.Add(Modifier.Volatile); .)
.
StructMemberDecl<Modifiers m, ArrayList attributes>
StructMemberDecl<Modifiers m, List<AttributeSection> attributes>
(.
string qualident = null;
TypeReference type;
Expression expr;
ArrayList p = new ArrayList();
List<ParameterDeclarationExpression> p = new List<ParameterDeclarationExpression>();
Statement stmt = null;
List<VariableDeclaration> variableDeclarators = new List<VariableDeclaration>();
List<TemplateDefinition> templates = new List<TemplateDefinition>();
@ -1078,17 +1078,17 @@ StructMemberDecl<Modifiers m, ArrayList attributes> @@ -1078,17 +1078,17 @@ StructMemberDecl<Modifiers m, ArrayList attributes>
[ TypeParameterList<templates> ]
"("
[ FormalParameterList<out p> ] ")" (. MethodDeclaration methodDeclaration = new MethodDeclaration(qualident,
m.Modifier,
new TypeReference("void"),
p,
attributes);
methodDeclaration.StartLocation = startPos;
methodDeclaration.EndLocation = t.EndLocation;
methodDeclaration.Templates = templates;
compilationUnit.AddChild(methodDeclaration);
compilationUnit.BlockStart(methodDeclaration);
.)
[ FormalParameterList<p> ] ")" (. MethodDeclaration methodDeclaration = new MethodDeclaration(qualident,
m.Modifier,
new TypeReference("void"),
p,
attributes);
methodDeclaration.StartLocation = startPos;
methodDeclaration.EndLocation = t.EndLocation;
methodDeclaration.Templates = templates;
compilationUnit.AddChild(methodDeclaration);
compilationUnit.BlockStart(methodDeclaration);
.)
/* .NET 2.0 */
{ IF (IdentIsWhere()) TypeParameterConstraintsClause<templates> }
@ -1122,7 +1122,7 @@ StructMemberDecl<Modifiers m, ArrayList attributes> @@ -1122,7 +1122,7 @@ StructMemberDecl<Modifiers m, ArrayList attributes>
/*--- constructor or static contructor declaration: */
| IF (IdentAndLPar()) (. m.Check(Modifier.Constructors | Modifier.StaticConstructors); .)
ident (. string name = t.val; Point startPos = t.Location; .) "(" [ (. m.Check(Modifier.Constructors); .)
FormalParameterList<out p>
FormalParameterList<p>
]
")" (.ConstructorInitializer init = null; .)
[ (. m.Check(Modifier.Constructors); .)
@ -1145,7 +1145,7 @@ StructMemberDecl<Modifiers m, ArrayList attributes> @@ -1145,7 +1145,7 @@ StructMemberDecl<Modifiers m, ArrayList attributes>
"(" Type<out type> ident (. string varName = t.val; .) ")" ( Block<out stmt> | ";" (. stmt = null; .) )
(.
ArrayList parameters = new ArrayList();
List<ParameterDeclarationExpression> parameters = new List<ParameterDeclarationExpression>();
parameters.Add(new ParameterDeclarationExpression(type, varName));
OperatorDeclaration operatorDeclaration = new OperatorDeclaration(m.Modifier,
attributes,
@ -1177,7 +1177,7 @@ StructMemberDecl<Modifiers m, ArrayList attributes> @@ -1177,7 +1177,7 @@ StructMemberDecl<Modifiers m, ArrayList attributes>
)
")" ( Block<out stmt> | ";" )
(.
ArrayList parameters = new ArrayList();
List<ParameterDeclarationExpression> parameters = new List<ParameterDeclarationExpression>();
parameters.Add(new ParameterDeclarationExpression(firstType, firstName));
if (secondType != null) {
parameters.Add(new ParameterDeclarationExpression(secondType, secondName));
@ -1202,7 +1202,7 @@ StructMemberDecl<Modifiers m, ArrayList attributes> @@ -1202,7 +1202,7 @@ StructMemberDecl<Modifiers m, ArrayList attributes>
/*--- unqualified indexer declaration (without interface name): */
| (. m.Check(Modifier.Indexers); .)
"this" "[" FormalParameterList<out p> "]" (. Point endLocation = t.EndLocation; .) "{" (.
"this" "[" FormalParameterList<p> "]" (. Point endLocation = t.EndLocation; .) "{" (.
IndexerDeclaration indexer = new IndexerDeclaration(type, p, m.Modifier, attributes);
indexer.StartLocation = startPos;
indexer.EndLocation = endLocation;
@ -1222,7 +1222,7 @@ StructMemberDecl<Modifiers m, ArrayList attributes> @@ -1222,7 +1222,7 @@ StructMemberDecl<Modifiers m, ArrayList attributes>
( (. m.Check(Modifier.PropertysEventsMethods); .)
/* .NET 2.0 */
[ TypeParameterList<templates> ]
"(" [ FormalParameterList<out p> ] ")" (.
"(" [ FormalParameterList<p> ] ")" (.
MethodDeclaration methodDeclaration = new MethodDeclaration(qualident,
m.Modifier,
type,
@ -1255,7 +1255,7 @@ StructMemberDecl<Modifiers m, ArrayList attributes> @@ -1255,7 +1255,7 @@ StructMemberDecl<Modifiers m, ArrayList attributes>
/*--- qualified indexer declaration (with interface name): */
| (. m.Check(Modifier.Indexers); .)
"." "this" "[" FormalParameterList<out p> "]" (.
"." "this" "[" FormalParameterList<p> "]" (.
IndexerDeclaration indexer = new IndexerDeclaration(type, p, m.Modifier, attributes);
indexer.StartLocation = startPos;
indexer.EndLocation = t.EndLocation;
@ -1275,7 +1275,7 @@ StructMemberDecl<Modifiers m, ArrayList attributes> @@ -1275,7 +1275,7 @@ StructMemberDecl<Modifiers m, ArrayList attributes>
)
.
ClassMemberDecl<Modifiers m, ArrayList attributes>
ClassMemberDecl<Modifiers m, List<AttributeSection> attributes>
(. Statement stmt = null; .)
=
StructMemberDecl<m, attributes>
@ -1293,11 +1293,11 @@ ClassMemberDecl<Modifiers m, ArrayList attributes> @@ -1293,11 +1293,11 @@ ClassMemberDecl<Modifiers m, ArrayList attributes>
InterfaceMemberDecl
(.
TypeReference type;
ArrayList p;
AttributeSection section;
Modifier mod = Modifier.None;
ArrayList attributes = new ArrayList();
ArrayList parameters = new ArrayList();
List<AttributeSection> attributes = new List<AttributeSection>();
List<ParameterDeclarationExpression> parameters = new List<ParameterDeclarationExpression>();
string name;
PropertyGetRegion getBlock;
PropertySetRegion setBlock;
@ -1310,7 +1310,7 @@ InterfaceMemberDecl @@ -1310,7 +1310,7 @@ InterfaceMemberDecl
(
/*--- interface void method (procedure) declaration: */
IF (NotVoidPointer()) "void" (. if (startLocation.X == -1) startLocation = t.Location; .) ident (. name = t.val; .)
"(" [ FormalParameterList<out parameters> ] ")" ";" (. MethodDeclaration md = new MethodDeclaration(name, mod, new TypeReference("void"), parameters, attributes);
"(" [ FormalParameterList<parameters> ] ")" ";" (. MethodDeclaration md = new MethodDeclaration(name, mod, new TypeReference("void"), parameters, attributes);
md.StartLocation = startLocation;
md.EndLocation = t.EndLocation;
compilationUnit.AddChild(md);
@ -1323,7 +1323,7 @@ InterfaceMemberDecl @@ -1323,7 +1323,7 @@ InterfaceMemberDecl
/*--- interface "not void" method (function) declaration: */
/* .NET 2.0 */
[ TypeParameterList<templates> ]
"(" [ FormalParameterList<out parameters> ] ")"
"(" [ FormalParameterList<parameters> ] ")"
/* .NET 2.0 */
{ IF (IdentIsWhere()) TypeParameterConstraintsClause<templates> }
";" (. MethodDeclaration md = new MethodDeclaration(name, mod, type, parameters, attributes);
@ -1336,7 +1336,7 @@ InterfaceMemberDecl @@ -1336,7 +1336,7 @@ InterfaceMemberDecl
"{" (. Point bodyStart = t.Location;.) InterfaceAccessors<out getBlock, out setBlock> "}" (. pd.GetRegion = getBlock; pd.SetRegion = setBlock; pd.StartLocation = startLocation; pd.EndLocation = qualIdentEndLocation; pd.BodyStart = bodyStart; pd.BodyEnd = t.EndLocation; .)
)
/*--- interface indexer declaration: */
| "this" "[" FormalParameterList<out p> "]" (.Point bracketEndLocation = t.EndLocation; .) (. IndexerDeclaration id = new IndexerDeclaration(type, p, mod, attributes); compilationUnit.AddChild(id); .)
| "this" "[" FormalParameterList<parameters> "]" (.Point bracketEndLocation = t.EndLocation; .) (. IndexerDeclaration id = new IndexerDeclaration(type, parameters, mod, attributes); compilationUnit.AddChild(id); .)
"{" (. Point bodyStart = t.Location;.) InterfaceAccessors<out getBlock, out setBlock> "}" (. id.GetRegion = getBlock; id.SetRegion = setBlock; id.StartLocation = startLocation; id.EndLocation = bracketEndLocation; id.BodyStart = bodyStart; id.BodyEnd = t.EndLocation;.)
)
/*--- interface event declaration: */
@ -1351,7 +1351,7 @@ InterfaceMemberDecl @@ -1351,7 +1351,7 @@ InterfaceMemberDecl
EnumMemberDecl<out FieldDeclaration f>
(.
Expression expr = null;
ArrayList attributes = new ArrayList();
List<AttributeSection> attributes = new List<AttributeSection>();
AttributeSection section = null;
VariableDeclaration varDecl = null;
.)
@ -1368,7 +1368,7 @@ EnumMemberDecl<out FieldDeclaration f> @@ -1368,7 +1368,7 @@ EnumMemberDecl<out FieldDeclaration f>
AccessorDecls<out PropertyGetRegion getBlock, out PropertySetRegion setBlock>
(.
ArrayList attributes = new ArrayList();
List<AttributeSection> attributes = new List<AttributeSection>();
AttributeSection section;
getBlock = null;
setBlock = null;
@ -1378,13 +1378,13 @@ AccessorDecls<out PropertyGetRegion getBlock, out PropertySetRegion setBlock> @@ -1378,13 +1378,13 @@ AccessorDecls<out PropertyGetRegion getBlock, out PropertySetRegion setBlock>
(
IF (IdentIsGet())
GetAccessorDecl<out getBlock, attributes>
[ (. attributes = new ArrayList(); .)
[ (. attributes = new List<AttributeSection>(); .)
{ AttributeSection<out section> (. attributes.Add(section); .) }
SetAccessorDecl<out setBlock, attributes>
]
| IF (IdentIsSet())
SetAccessorDecl<out setBlock, attributes>
[ (. attributes = new ArrayList(); .)
[ (. attributes = new List<AttributeSection>(); .)
{ AttributeSection<out section> (. attributes.Add(section); .) }
GetAccessorDecl<out getBlock, attributes>
]
@ -1392,7 +1392,7 @@ AccessorDecls<out PropertyGetRegion getBlock, out PropertySetRegion setBlock> @@ -1392,7 +1392,7 @@ AccessorDecls<out PropertyGetRegion getBlock, out PropertySetRegion setBlock>
)
.
GetAccessorDecl<out PropertyGetRegion getBlock, ArrayList attributes>
GetAccessorDecl<out PropertyGetRegion getBlock, List<AttributeSection> attributes>
(. Statement stmt = null; .)
=
ident /* "get" is not a keyword!? */
@ -1400,7 +1400,7 @@ GetAccessorDecl<out PropertyGetRegion getBlock, ArrayList attributes> @@ -1400,7 +1400,7 @@ GetAccessorDecl<out PropertyGetRegion getBlock, ArrayList attributes>
( Block<out stmt> | ";" ) (. getBlock = new PropertyGetRegion((BlockStatement)stmt, attributes); .)
.
SetAccessorDecl<out PropertySetRegion setBlock, ArrayList attributes>
SetAccessorDecl<out PropertySetRegion setBlock, List<AttributeSection> attributes>
(. Statement stmt = null; .)
=
ident /* "set" is not a keyword!? */
@ -1410,7 +1410,7 @@ SetAccessorDecl<out PropertySetRegion setBlock, ArrayList attributes> @@ -1410,7 +1410,7 @@ SetAccessorDecl<out PropertySetRegion setBlock, ArrayList attributes>
EventAccessorDecls<out EventAddRegion addBlock, out EventRemoveRegion removeBlock>
(. AttributeSection section;
ArrayList attributes = new ArrayList();
List<AttributeSection> attributes = new List<AttributeSection>();
Statement stmt;
addBlock = null;
removeBlock = null;
@ -1419,11 +1419,11 @@ EventAccessorDecls<out EventAddRegion addBlock, out EventRemoveRegion removeBloc @@ -1419,11 +1419,11 @@ EventAccessorDecls<out EventAddRegion addBlock, out EventRemoveRegion removeBloc
{ AttributeSection<out section> (. attributes.Add(section); .) }
(
IF (IdentIsAdd()) (. addBlock = new EventAddRegion(attributes); .)
AddAccessorDecl<out stmt> (. attributes = new ArrayList(); addBlock.Block = (BlockStatement)stmt; .)
AddAccessorDecl<out stmt> (. attributes = new List<AttributeSection>(); addBlock.Block = (BlockStatement)stmt; .)
{ AttributeSection<out section> (. attributes.Add(section); .)}
RemoveAccessorDecl<out stmt> (. removeBlock = new EventRemoveRegion(attributes); removeBlock.Block = (BlockStatement)stmt; .)
| IF (IdentIsRemove())
RemoveAccessorDecl <out stmt> (. removeBlock = new EventRemoveRegion(attributes); removeBlock.Block = (BlockStatement)stmt; attributes = new ArrayList(); .)
RemoveAccessorDecl <out stmt> (. removeBlock = new EventRemoveRegion(attributes); removeBlock.Block = (BlockStatement)stmt; attributes = new List<AttributeSection>(); .)
{ AttributeSection<out section> (. attributes.Add(section); .) }
AddAccessorDecl<out stmt> (. addBlock = new EventAddRegion(attributes); addBlock.Block = (BlockStatement)stmt; .)
| ident (. Error("add or remove accessor declaration expected"); .)
@ -1433,7 +1433,7 @@ EventAccessorDecls<out EventAddRegion addBlock, out EventRemoveRegion removeBloc @@ -1433,7 +1433,7 @@ EventAccessorDecls<out EventAddRegion addBlock, out EventRemoveRegion removeBloc
InterfaceAccessors<out PropertyGetRegion getBlock, out PropertySetRegion setBlock>
(.
AttributeSection section;
ArrayList attributes = new ArrayList();
List<AttributeSection> attributes = new List<AttributeSection>();
getBlock = null; setBlock = null;
.)
=
@ -1443,7 +1443,7 @@ InterfaceAccessors<out PropertyGetRegion getBlock, out PropertySetRegion setBloc @@ -1443,7 +1443,7 @@ InterfaceAccessors<out PropertyGetRegion getBlock, out PropertySetRegion setBloc
| IF (IdentIsSet()) ident (. setBlock = new PropertySetRegion(null, attributes); .)
| ident (. Error("set or get expected"); .)
)
";" (. attributes = new ArrayList(); .)
";" (. attributes = new List<AttributeSection>(); .)
[
{ AttributeSection<out section> (. attributes.Add(section); .) }
(
@ -2050,12 +2050,12 @@ AnonymousMethodExpr<out Expression outExpr> @@ -2050,12 +2050,12 @@ AnonymousMethodExpr<out Expression outExpr>
AnonymousMethodExpression expr = new AnonymousMethodExpression();
expr.StartLocation = t.Location;
Statement stmt;
ArrayList p;
List<ParameterDeclarationExpression> p = new List<ParameterDeclarationExpression>();
outExpr = expr;
.)
=
"("
[ FormalParameterList<out p> (. expr.Parameters = p; .) ]
[ FormalParameterList<p> (. expr.Parameters = p; .) ]
")"
/*--- ParseExpression doesn't set a compilation unit, */
/*--- so we can't use block then -> skip body of anonymous method */
@ -2212,7 +2212,7 @@ TypeArgumentList<out List<TypeReference> types> @@ -2212,7 +2212,7 @@ TypeArgumentList<out List<TypeReference> types>
TypeParameterList<List<TemplateDefinition> templates>
(.
AttributeSection section;
ArrayList attributes = new ArrayList();
List<AttributeSection> attributes = new List<AttributeSection>();
.)
=
"<" { AttributeSection<out section> (. attributes.Add(section); .) }

101
src/Libraries/NRefactory/Project/Src/Parser/VBNet/Parser.cs

@ -7,6 +7,7 @@ using System.Collections.Specialized; @@ -7,6 +7,7 @@ using System.Collections.Specialized;
using System.Text;
using ICSharpCode.NRefactory.Parser.AST;
using ICSharpCode.NRefactory.Parser.VB;
using ASTAttribute = ICSharpCode.NRefactory.Parser.AST.Attribute;
/*
Parser.frame file for NRefactory.
*/
@ -25,7 +26,7 @@ internal class Parser : AbstractParser @@ -25,7 +26,7 @@ internal class Parser : AbstractParser
const bool x = false;
#line 11 "VBNET.ATG"
#line 12 "VBNET.ATG"
private string assemblyName = null;
private Stack withStatements;
private StringBuilder qualidentBuilder = new StringBuilder();
@ -34,7 +35,6 @@ public string ContainingAssembly @@ -34,7 +35,6 @@ public string ContainingAssembly
{
set { assemblyName = value; }
}
Token t
{
get {
@ -359,9 +359,10 @@ out u); @@ -359,9 +359,10 @@ out u);
lexer.NextToken();
} else SynErr(203);
#line 1787 "VBNET.ATG"
string attributeTarget = t.val.ToLower();ArrayList attributes = new ArrayList();
ICSharpCode.NRefactory.Parser.AST.Attribute attribute;
#line 1786 "VBNET.ATG"
string attributeTarget = t.val.ToLower();
List<ASTAttribute> attributes = new List<ASTAttribute>();
ASTAttribute attribute;
Expect(13);
Attribute(
@ -407,7 +408,7 @@ out attribute); @@ -407,7 +408,7 @@ out attribute);
#line 515 "VBNET.ATG"
Modifiers m = new Modifiers();
AttributeSection section;ArrayList attributes = new ArrayList();
AttributeSection section;List<AttributeSection> attributes = new List<AttributeSection>();
string qualident;
if (la.kind == 125) {
@ -567,8 +568,8 @@ out name); @@ -567,8 +568,8 @@ out name);
out AttributeSection section) {
#line 1856 "VBNET.ATG"
string attributeTarget = "";ArrayList attributes = new ArrayList();
ICSharpCode.NRefactory.Parser.AST.Attribute attribute;
string attributeTarget = "";List<ASTAttribute> attributes = new List<ASTAttribute>();
ASTAttribute attribute;
Expect(26);
@ -698,7 +699,7 @@ Modifiers m) { @@ -698,7 +699,7 @@ Modifiers m) {
void NonModuleDeclaration(
#line 586 "VBNET.ATG"
Modifiers m,ArrayList attributes) {
Modifiers m, List<AttributeSection> attributes) {
#line 588 "VBNET.ATG"
string name = String.Empty;
@ -903,10 +904,10 @@ newType); @@ -903,10 +904,10 @@ newType);
#line 683 "VBNET.ATG"
m.Check(Modifier.VBDelegates);
DelegateDeclaration delegateDeclr = new DelegateDeclaration(m.Modifier, attributes);ArrayList p = null;
DelegateDeclaration delegateDeclr = new DelegateDeclaration(m.Modifier, attributes);
delegateDeclr.ReturnType = new TypeReference("", "System.Void");
delegateDeclr.StartLocation = t.Location;
List<ParameterDeclarationExpression> p = new List<ParameterDeclarationExpression>();
if (la.kind == 167) {
lexer.NextToken();
@ -919,7 +920,7 @@ newType); @@ -919,7 +920,7 @@ newType);
if (StartOf(4)) {
FormalParameterList(
#line 691 "VBNET.ATG"
out p);
p);
}
Expect(24);
@ -937,7 +938,7 @@ out p); @@ -937,7 +938,7 @@ out p);
if (StartOf(4)) {
FormalParameterList(
#line 694 "VBNET.ATG"
out p);
p);
}
Expect(24);
@ -1125,7 +1126,7 @@ TypeDeclaration newType) { @@ -1125,7 +1126,7 @@ TypeDeclaration newType) {
while (StartOf(6)) {
#line 713 "VBNET.ATG"
ArrayList attributes = new ArrayList();
List<AttributeSection> attributes = new List<AttributeSection>();
Modifiers m = new Modifiers();
while (la.kind == 26) {
@ -1162,7 +1163,7 @@ TypeDeclaration newType) { @@ -1162,7 +1163,7 @@ TypeDeclaration newType) {
while (StartOf(6)) {
#line 742 "VBNET.ATG"
ArrayList attributes = new ArrayList();
List<AttributeSection> attributes = new List<AttributeSection>();
Modifiers m = new Modifiers();
while (la.kind == 26) {
@ -1199,7 +1200,7 @@ TypeDeclaration newType) { @@ -1199,7 +1200,7 @@ TypeDeclaration newType) {
while (StartOf(6)) {
#line 727 "VBNET.ATG"
ArrayList attributes = new ArrayList();
List<AttributeSection> attributes = new List<AttributeSection>();
Modifiers m = new Modifiers();
while (la.kind == 26) {
@ -1408,12 +1409,12 @@ TypeDeclaration newType) { @@ -1408,12 +1409,12 @@ TypeDeclaration newType) {
void FormalParameterList(
#line 1888 "VBNET.ATG"
out ArrayList parameter) {
List<ParameterDeclarationExpression> parameter) {
#line 1890 "VBNET.ATG"
parameter = new ArrayList();
ParameterDeclarationExpression p;
AttributeSection section;ArrayList attributes = new ArrayList();
AttributeSection section;
List<AttributeSection> attributes = new List<AttributeSection>();
while (la.kind == 26) {
AttributeSection(
@ -1590,7 +1591,7 @@ Modifiers m) { @@ -1590,7 +1591,7 @@ Modifiers m) {
void ClassMemberDecl(
#line 867 "VBNET.ATG"
Modifiers m,ArrayList attributes) {
Modifiers m, List<AttributeSection> attributes) {
StructureMemberDecl(
#line 868 "VBNET.ATG"
m, attributes);
@ -1598,10 +1599,10 @@ m, attributes); @@ -1598,10 +1599,10 @@ m, attributes);
void StructureMemberDecl(
#line 882 "VBNET.ATG"
Modifiers m, ArrayList attributes) {
Modifiers m, List<AttributeSection> attributes) {
#line 884 "VBNET.ATG"
TypeReference type = null; ArrayList p = null;
TypeReference type = null; List<ParameterDeclarationExpression> p = new List<ParameterDeclarationExpression>();
Statement stmt = null; List<VariableDeclaration> variableDeclarators = new List<VariableDeclaration>();
switch (la.kind) {
@ -1634,7 +1635,7 @@ m, attributes); @@ -1634,7 +1635,7 @@ m, attributes);
if (StartOf(4)) {
FormalParameterList(
#line 903 "VBNET.ATG"
out p);
p);
}
Expect(24);
}
@ -1704,7 +1705,7 @@ out stmt); @@ -1704,7 +1705,7 @@ out stmt);
if (StartOf(4)) {
FormalParameterList(
#line 948 "VBNET.ATG"
out p);
p);
}
Expect(24);
}
@ -1755,7 +1756,7 @@ out stmt); @@ -1755,7 +1756,7 @@ out stmt);
if (StartOf(4)) {
FormalParameterList(
#line 974 "VBNET.ATG"
out p);
p);
}
Expect(24);
}
@ -1873,7 +1874,7 @@ out charsetModifer); @@ -1873,7 +1874,7 @@ out charsetModifer);
if (StartOf(4)) {
FormalParameterList(
#line 1043 "VBNET.ATG"
out p);
p);
}
Expect(24);
}
@ -1908,7 +1909,7 @@ out p); @@ -1908,7 +1909,7 @@ out p);
if (StartOf(4)) {
FormalParameterList(
#line 1056 "VBNET.ATG"
out p);
p);
}
Expect(24);
}
@ -1953,7 +1954,7 @@ out type); @@ -1953,7 +1954,7 @@ out type);
if (StartOf(4)) {
FormalParameterList(
#line 1079 "VBNET.ATG"
out p);
p);
}
Expect(24);
}
@ -2052,7 +2053,7 @@ constantDeclarators); @@ -2052,7 +2053,7 @@ constantDeclarators);
if (StartOf(4)) {
FormalParameterList(
#line 1129 "VBNET.ATG"
out p);
p);
}
Expect(24);
}
@ -2125,7 +2126,7 @@ out getRegion, out setRegion); @@ -2125,7 +2126,7 @@ out getRegion, out setRegion);
out FieldDeclaration f) {
#line 851 "VBNET.ATG"
Expression expr = null;ArrayList attributes = new ArrayList();
Expression expr = null;List<AttributeSection> attributes = new List<AttributeSection>();
AttributeSection section = null;
VariableDeclaration varDecl = null;
@ -2160,10 +2161,10 @@ out expr); @@ -2160,10 +2161,10 @@ out expr);
void InterfaceMemberDecl() {
#line 774 "VBNET.ATG"
TypeReference type =null;ArrayList p = null;
TypeReference type =null; List<ParameterDeclarationExpression> p = new List<ParameterDeclarationExpression>();
AttributeSection section, returnTypeAttributeSection = null;
Modifiers mod = new Modifiers();ArrayList attributes = new ArrayList();
Modifiers mod = new Modifiers();
List<AttributeSection> attributes = new List<AttributeSection>();
string name;
if (StartOf(13)) {
@ -2194,7 +2195,7 @@ mod); @@ -2194,7 +2195,7 @@ mod);
if (StartOf(4)) {
FormalParameterList(
#line 789 "VBNET.ATG"
out p);
p);
}
Expect(24);
}
@ -2225,7 +2226,7 @@ out type); @@ -2225,7 +2226,7 @@ out type);
if (StartOf(4)) {
FormalParameterList(
#line 801 "VBNET.ATG"
out p);
p);
}
Expect(24);
}
@ -2251,7 +2252,7 @@ out p); @@ -2251,7 +2252,7 @@ out p);
if (StartOf(4)) {
FormalParameterList(
#line 813 "VBNET.ATG"
out p);
p);
}
Expect(24);
}
@ -2291,7 +2292,7 @@ out type); @@ -2291,7 +2292,7 @@ out type);
if (StartOf(4)) {
FormalParameterList(
#line 829 "VBNET.ATG"
out p);
p);
}
Expect(24);
}
@ -2558,7 +2559,7 @@ out expr); @@ -2558,7 +2559,7 @@ out expr);
out PropertyGetRegion getBlock, out PropertySetRegion setBlock) {
#line 1176 "VBNET.ATG"
ArrayList attributes = new ArrayList();
List<AttributeSection> attributes = new List<AttributeSection>();
AttributeSection section;
getBlock = null;
setBlock = null;
@ -2578,7 +2579,7 @@ out getBlock, attributes); @@ -2578,7 +2579,7 @@ out getBlock, attributes);
if (la.kind == 26 || la.kind == 156) {
#line 1185 "VBNET.ATG"
attributes = new ArrayList();
attributes = new List<AttributeSection>();
while (la.kind == 26) {
AttributeSection(
#line 1186 "VBNET.ATG"
@ -2598,7 +2599,7 @@ out setBlock, attributes); @@ -2598,7 +2599,7 @@ out setBlock, attributes);
if (la.kind == 26 || la.kind == 100) {
#line 1192 "VBNET.ATG"
attributes = new ArrayList();
attributes = new List<AttributeSection>();
while (la.kind == 26) {
AttributeSection(
#line 1193 "VBNET.ATG"
@ -2616,7 +2617,7 @@ out getBlock, attributes); @@ -2616,7 +2617,7 @@ out getBlock, attributes);
void GetAccessorDecl(
#line 1200 "VBNET.ATG"
out PropertyGetRegion getBlock,ArrayList attributes) {
out PropertyGetRegion getBlock, List<AttributeSection> attributes) {
#line 1201 "VBNET.ATG"
Statement stmt = null;
@ -2636,10 +2637,10 @@ out stmt); @@ -2636,10 +2637,10 @@ out stmt);
void SetAccessorDecl(
#line 1213 "VBNET.ATG"
out PropertySetRegion setBlock,ArrayList attributes) {
out PropertySetRegion setBlock, List<AttributeSection> attributes) {
#line 1215 "VBNET.ATG"
Statement stmt = null;ArrayList p = null;
Statement stmt = null; List<ParameterDeclarationExpression> p = new List<ParameterDeclarationExpression>();
Expect(156);
if (la.kind == 23) {
@ -2647,7 +2648,7 @@ out PropertySetRegion setBlock,ArrayList attributes) { @@ -2647,7 +2648,7 @@ out PropertySetRegion setBlock,ArrayList attributes) {
if (StartOf(4)) {
FormalParameterList(
#line 1218 "VBNET.ATG"
out p);
p);
}
Expect(24);
}
@ -4993,19 +4994,19 @@ out int i) { @@ -4993,19 +4994,19 @@ out int i) {
out ICSharpCode.NRefactory.Parser.AST.Attribute attribute) {
#line 1805 "VBNET.ATG"
string qualident;
string name;
Qualident(
#line 1806 "VBNET.ATG"
out qualident);
out name);
#line 1807 "VBNET.ATG"
ArrayList positional = new ArrayList();ArrayList named = new ArrayList();
string name = qualident;
List<Expression> positional = new List<Expression>();
List<NamedArgumentExpression> named = new List<NamedArgumentExpression>();
if (la.kind == 23) {
AttributeArguments(
#line 1810 "VBNET.ATG"
ref positional, ref named);
positional, named);
}
#line 1812 "VBNET.ATG"
@ -5015,7 +5016,7 @@ ref positional, ref named); @@ -5015,7 +5016,7 @@ ref positional, ref named);
void AttributeArguments(
#line 1817 "VBNET.ATG"
ref ArrayList positional, ref ArrayList named) {
List<Expression> positional, List<NamedArgumentExpression> named) {
#line 1819 "VBNET.ATG"
bool nameFound = false;

98
src/Libraries/NRefactory/Project/Src/Parser/VBNet/VBNET.ATG

@ -5,6 +5,7 @@ using System.Collections.Specialized; @@ -5,6 +5,7 @@ using System.Collections.Specialized;
using System.Text;
using ICSharpCode.NRefactory.Parser.AST;
using ICSharpCode.NRefactory.Parser.VB;
using ASTAttribute = ICSharpCode.NRefactory.Parser.AST.Attribute;
COMPILER VBNET
@ -16,7 +17,6 @@ public string ContainingAssembly @@ -16,7 +17,6 @@ public string ContainingAssembly
{
set { assemblyName = value; }
}
Token t
{
get {
@ -513,7 +513,7 @@ ImportClause<out Using u> @@ -513,7 +513,7 @@ ImportClause<out Using u>
NamespaceMemberDecl
(.
Modifiers m = new Modifiers();
AttributeSection section;ArrayList attributes = new ArrayList();
AttributeSection section;List<AttributeSection> attributes = new List<AttributeSection>();
string qualident;
.) =
"Namespace"
@ -583,7 +583,7 @@ TypeParameterConstraints<TemplateDefinition template> @@ -583,7 +583,7 @@ TypeParameterConstraints<TemplateDefinition template>
.
/* 6.4.2 */
NonModuleDeclaration<Modifiers m,ArrayList attributes>
NonModuleDeclaration<Modifiers m, List<AttributeSection> attributes>
(.
string name = String.Empty;
ArrayList names = null;
@ -681,17 +681,17 @@ NonModuleDeclaration<Modifiers m,ArrayList attributes> @@ -681,17 +681,17 @@ NonModuleDeclaration<Modifiers m,ArrayList attributes>
"Delegate"
(.
m.Check(Modifier.VBDelegates);
DelegateDeclaration delegateDeclr = new DelegateDeclaration(m.Modifier, attributes);ArrayList p = null;
DelegateDeclaration delegateDeclr = new DelegateDeclaration(m.Modifier, attributes);
delegateDeclr.ReturnType = new TypeReference("", "System.Void");
delegateDeclr.StartLocation = t.Location;
List<ParameterDeclarationExpression> p = new List<ParameterDeclarationExpression>();
.)
(
"Sub" Identifier (. delegateDeclr.Name = t.val; .)
[ "(" [ FormalParameterList<out p> ] ")" (. delegateDeclr.Parameters = p; .) ]
[ "(" [ FormalParameterList<p> ] ")" (. delegateDeclr.Parameters = p; .) ]
|
"Function" Identifier (. delegateDeclr.Name = t.val; .)
[ "(" [ FormalParameterList<out p> ] ")" (. delegateDeclr.Parameters = p; .) ]
[ "(" [ FormalParameterList<p> ] ")" (. delegateDeclr.Parameters = p; .) ]
[ "As" (. TypeReference type; .) TypeName<out type> (. delegateDeclr.ReturnType = type; .)]
)
(. delegateDeclr.EndLocation = t.EndLocation; .)
@ -710,7 +710,7 @@ NamespaceBody = @@ -710,7 +710,7 @@ NamespaceBody =
ClassBody<TypeDeclaration newType>
(. AttributeSection section; .) =
{
(.ArrayList attributes = new ArrayList();
(.List<AttributeSection> attributes = new List<AttributeSection>();
Modifiers m = new Modifiers();
.)
{ AttributeSection<out section> (. attributes.Add(section); .) }
@ -724,7 +724,7 @@ ClassBody<TypeDeclaration newType> @@ -724,7 +724,7 @@ ClassBody<TypeDeclaration newType>
StructureBody<TypeDeclaration newType>
(. AttributeSection section; .) =
{
(.ArrayList attributes = new ArrayList();
(.List<AttributeSection> attributes = new List<AttributeSection>();
Modifiers m = new Modifiers();
.)
{ AttributeSection<out section> (. attributes.Add(section); .) }
@ -739,7 +739,7 @@ StructureBody<TypeDeclaration newType> @@ -739,7 +739,7 @@ StructureBody<TypeDeclaration newType>
ModuleBody<TypeDeclaration newType>
(. AttributeSection section; .) =
{
(.ArrayList attributes = new ArrayList();
(.List<AttributeSection> attributes = new List<AttributeSection>();
Modifiers m = new Modifiers();
.)
{ AttributeSection<out section> (. attributes.Add(section); .) }
@ -771,10 +771,10 @@ InterfaceBody<TypeDeclaration newType> = @@ -771,10 +771,10 @@ InterfaceBody<TypeDeclaration newType> =
*/
InterfaceMemberDecl
(.
TypeReference type =null;ArrayList p = null;
TypeReference type =null; List<ParameterDeclarationExpression> p = new List<ParameterDeclarationExpression>();
AttributeSection section, returnTypeAttributeSection = null;
Modifiers mod = new Modifiers();ArrayList attributes = new ArrayList();
Modifiers mod = new Modifiers();
List<AttributeSection> attributes = new List<AttributeSection>();
string name;
.) =
{ AttributeSection<out section> (. attributes.Add(section); .) }
@ -786,7 +786,7 @@ InterfaceMemberDecl @@ -786,7 +786,7 @@ InterfaceMemberDecl
"Event"
(. mod.Check(Modifier.VBInterfaceEvents); .)
Identifier (. name = t.val; .)
[ "(" [ FormalParameterList<out p> ] ")" ]
[ "(" [ FormalParameterList<p> ] ")" ]
[ "As" TypeName<out type> ]
EOL
(.
@ -798,7 +798,7 @@ InterfaceMemberDecl @@ -798,7 +798,7 @@ InterfaceMemberDecl
"Sub"
(. mod.Check(Modifier.VBInterfaceMethods); .)
Identifier (. name = t.val; .)
[ "(" [ FormalParameterList<out p> ] ")" ]
[ "(" [ FormalParameterList<p> ] ")" ]
EOL
(.
MethodDeclaration md = new MethodDeclaration(name, mod.Modifier, null, p, attributes);
@ -810,7 +810,7 @@ InterfaceMemberDecl @@ -810,7 +810,7 @@ InterfaceMemberDecl
"Function"
(. mod.Check(Modifier.VBInterfaceMethods); .)
Identifier (. name = t.val; .)
[ "(" [ FormalParameterList<out p> ] ")" ]
[ "(" [ FormalParameterList<p> ] ")" ]
[ "As" { AttributeSection<out returnTypeAttributeSection> } TypeName<out type> ]
(.
if(type == null) {
@ -826,7 +826,7 @@ InterfaceMemberDecl @@ -826,7 +826,7 @@ InterfaceMemberDecl
"Property"
(. mod.Check(Modifier.VBInterfaceProperties); .)
Identifier (. name = t.val; .)
[ "(" [ FormalParameterList<out p> ] ")" ]
[ "(" [ FormalParameterList<p> ] ")" ]
[ "As" TypeName<out type> ]
(.
if(type == null) {
@ -848,7 +848,7 @@ InterfaceMemberDecl @@ -848,7 +848,7 @@ InterfaceMemberDecl
/* 7.4.1 */
EnumMemberDecl<out FieldDeclaration f>
(.
Expression expr = null;ArrayList attributes = new ArrayList();
Expression expr = null;List<AttributeSection> attributes = new List<AttributeSection>();
AttributeSection section = null;
VariableDeclaration varDecl = null;
.) =
@ -864,7 +864,7 @@ EnumMemberDecl<out FieldDeclaration f> @@ -864,7 +864,7 @@ EnumMemberDecl<out FieldDeclaration f>
EOL
.
ClassMemberDecl<Modifiers m,ArrayList attributes> =
ClassMemberDecl<Modifiers m, List<AttributeSection> attributes> =
StructureMemberDecl<m, attributes>
.
@ -879,9 +879,9 @@ ClassBaseType<out string name> @@ -879,9 +879,9 @@ ClassBaseType<out string name>
.
/* 7.6.1 */
StructureMemberDecl<Modifiers m, ArrayList attributes>
StructureMemberDecl<Modifiers m, List<AttributeSection> attributes>
(.
TypeReference type = null; ArrayList p = null;
TypeReference type = null; List<ParameterDeclarationExpression> p = new List<ParameterDeclarationExpression>();
Statement stmt = null; List<VariableDeclaration> variableDeclarators = new List<VariableDeclaration>();
.)=
NonModuleDeclaration<m, attributes>
@ -900,7 +900,7 @@ StructureMemberDecl<Modifiers m, ArrayList attributes> @@ -900,7 +900,7 @@ StructureMemberDecl<Modifiers m, ArrayList attributes>
name = t.val;
m.Check(Modifier.VBMethods);
.)
[ "(" [ FormalParameterList<out p> ] ")" ]
[ "(" [ FormalParameterList<p> ] ")" ]
[
(
ImplementsClause<out implementsClause>
@ -945,7 +945,7 @@ StructureMemberDecl<Modifiers m, ArrayList attributes> @@ -945,7 +945,7 @@ StructureMemberDecl<Modifiers m, ArrayList attributes>
"End" "Sub" (. methodDeclaration.Body.EndLocation = t.EndLocation; .) EOL
)
/* 9.3 */
| "New" [ "(" [ FormalParameterList<out p> ] ")" ]
| "New" [ "(" [ FormalParameterList<p> ] ")" ]
(. m.Check(Modifier.Constructors); .)
(. Point constructorEndLocation = t.EndLocation; .)
EOL
@ -971,7 +971,7 @@ StructureMemberDecl<Modifiers m, ArrayList attributes> @@ -971,7 +971,7 @@ StructureMemberDecl<Modifiers m, ArrayList attributes>
AttributeSection returnTypeAttributeSection = null;
.)
Identifier (. name = t.val; .)
[ "(" [ FormalParameterList<out p> ] ")" ]
[ "(" [ FormalParameterList<p> ] ")" ]
["As" { AttributeSection<out returnTypeAttributeSection> } TypeName<out type> ]
(.
if(type == null) {
@ -1040,7 +1040,7 @@ StructureMemberDecl<Modifiers m, ArrayList attributes> @@ -1040,7 +1040,7 @@ StructureMemberDecl<Modifiers m, ArrayList attributes>
Identifier (. name = t.val; .)
"Lib" LiteralString (. library = t.val.ToString(); .)
["Alias" LiteralString (. alias = t.val.ToString(); .)]
[ "(" [ FormalParameterList<out p> ] ")" ]
[ "(" [ FormalParameterList<p> ] ")" ]
EOL
(.
DeclareDeclaration declareDeclaration = new DeclareDeclaration(name, m.Modifier, null, p, attributes, library, alias, charsetModifer);
@ -1053,7 +1053,7 @@ StructureMemberDecl<Modifiers m, ArrayList attributes> @@ -1053,7 +1053,7 @@ StructureMemberDecl<Modifiers m, ArrayList attributes>
Identifier (. name = t.val; .)
"Lib" LiteralString (. library = t.val; .)
["Alias" LiteralString (. alias = t.val; .)]
[ "(" [ FormalParameterList<out p> ] ")" ]
[ "(" [ FormalParameterList<p> ] ")" ]
["As" TypeName<out type> ]
EOL
(.
@ -1076,7 +1076,7 @@ StructureMemberDecl<Modifiers m, ArrayList attributes> @@ -1076,7 +1076,7 @@ StructureMemberDecl<Modifiers m, ArrayList attributes>
(
"As" TypeName<out type>
|
[ "(" [ FormalParameterList<out p> ] ")" ]
[ "(" [ FormalParameterList<p> ] ")" ]
)
[ ImplementsClause<out implementsClause> ]
(.
@ -1126,7 +1126,7 @@ StructureMemberDecl<Modifiers m, ArrayList attributes> @@ -1126,7 +1126,7 @@ StructureMemberDecl<Modifiers m, ArrayList attributes>
Point startPos = t.Location;ArrayList implementsClause = null;
.)
Identifier (. string propertyName = t.val; .)
[ "(" [ FormalParameterList<out p> ] ")" ]
[ "(" [ FormalParameterList<p> ] ")" ]
[ "As" TypeName<out type> ]
(.
if(type == null) {
@ -1173,7 +1173,7 @@ StructureMemberDecl<Modifiers m, ArrayList attributes> @@ -1173,7 +1173,7 @@ StructureMemberDecl<Modifiers m, ArrayList attributes>
/* 9.7 */
AccessorDecls<out PropertyGetRegion getBlock, out PropertySetRegion setBlock>
(.ArrayList attributes = new ArrayList();
(.List<AttributeSection> attributes = new List<AttributeSection>();
AttributeSection section;
getBlock = null;
setBlock = null;
@ -1182,14 +1182,14 @@ AccessorDecls<out PropertyGetRegion getBlock, out PropertySetRegion setBlock> @@ -1182,14 +1182,14 @@ AccessorDecls<out PropertyGetRegion getBlock, out PropertySetRegion setBlock>
(
GetAccessorDecl<out getBlock, attributes>
[
(. attributes = new ArrayList(); .)
(. attributes = new List<AttributeSection>(); .)
{ AttributeSection<out section> (. attributes.Add(section); .) }
SetAccessorDecl<out setBlock, attributes>
]
|
SetAccessorDecl<out setBlock, attributes>
[
(. attributes = new ArrayList(); .)
(. attributes = new List<AttributeSection>(); .)
{ AttributeSection<out section> (. attributes.Add(section); .) }
GetAccessorDecl<out getBlock, attributes>
]
@ -1197,7 +1197,7 @@ AccessorDecls<out PropertyGetRegion getBlock, out PropertySetRegion setBlock> @@ -1197,7 +1197,7 @@ AccessorDecls<out PropertyGetRegion getBlock, out PropertySetRegion setBlock>
.
/* 9.7.1 */
GetAccessorDecl<out PropertyGetRegion getBlock,ArrayList attributes>
GetAccessorDecl<out PropertyGetRegion getBlock, List<AttributeSection> attributes>
(. Statement stmt = null; .) =
"Get"
EOL
@ -1210,12 +1210,12 @@ GetAccessorDecl<out PropertyGetRegion getBlock,ArrayList attributes> @@ -1210,12 +1210,12 @@ GetAccessorDecl<out PropertyGetRegion getBlock,ArrayList attributes>
.
/* 9.7.2 */
SetAccessorDecl<out PropertySetRegion setBlock,ArrayList attributes>
SetAccessorDecl<out PropertySetRegion setBlock, List<AttributeSection> attributes>
(.
Statement stmt = null;ArrayList p = null;
Statement stmt = null; List<ParameterDeclarationExpression> p = new List<ParameterDeclarationExpression>();
.) =
"Set"
[ "(" [ FormalParameterList<out p> ] ")" ]
[ "(" [ FormalParameterList<p> ] ")" ]
EOL
Block<out stmt>
(.
@ -1783,9 +1783,9 @@ TypeArgumentList<List<TypeReference> typeArguments> @@ -1783,9 +1783,9 @@ TypeArgumentList<List<TypeReference> typeArguments>
GlobalAttributeSection =
(. Point startPos = t.Location; .)
"<" ("Assembly" | "Module")
(.
string attributeTarget = t.val.ToLower();ArrayList attributes = new ArrayList();
ICSharpCode.NRefactory.Parser.AST.Attribute attribute;
(. string attributeTarget = t.val.ToLower();
List<ASTAttribute> attributes = new List<ASTAttribute>();
ASTAttribute attribute;
.)
":" Attribute<out attribute> (. attributes.Add(attribute); .)
{ IF (NotFinalComma()) ["," ("Assembly" | "Module") ":"] Attribute<out attribute> (. attributes.Add(attribute); .)}
@ -1802,19 +1802,19 @@ GlobalAttributeSection = @@ -1802,19 +1802,19 @@ GlobalAttributeSection =
/* Spec, 5. */
Attribute<out ICSharpCode.NRefactory.Parser.AST.Attribute attribute>
(. string qualident; .) =
Qualident<out qualident>
(.ArrayList positional = new ArrayList();ArrayList named = new ArrayList();
string name = qualident;
(. string name; .) =
Qualident<out name>
(. List<Expression> positional = new List<Expression>();
List<NamedArgumentExpression> named = new List<NamedArgumentExpression>();
.)
[ AttributeArguments<ref positional, ref named> ]
[ AttributeArguments<positional, named> ]
(.
attribute = new ICSharpCode.NRefactory.Parser.AST.Attribute(name, positional, named);
.)
.
/* Spec, 5.2.2 */
AttributeArguments<ref ArrayList positional, ref ArrayList named>
AttributeArguments<List<Expression> positional, List<NamedArgumentExpression> named>
(.
bool nameFound = false;
string name = "";
@ -1853,8 +1853,8 @@ AttributeArguments<ref ArrayList positional, ref ArrayList named> @@ -1853,8 +1853,8 @@ AttributeArguments<ref ArrayList positional, ref ArrayList named>
/* Spec, 5. */
AttributeSection<out AttributeSection section>
(.
string attributeTarget = "";ArrayList attributes = new ArrayList();
ICSharpCode.NRefactory.Parser.AST.Attribute attribute;
string attributeTarget = "";List<ASTAttribute> attributes = new List<ASTAttribute>();
ASTAttribute attribute;
.) =
"<" (. Point startPos = t.Location; .)
@ -1885,11 +1885,11 @@ AttributeSection<out AttributeSection section> @@ -1885,11 +1885,11 @@ AttributeSection<out AttributeSection section>
.
/* 9.2.5 */
FormalParameterList<out ArrayList parameter>
FormalParameterList<List<ParameterDeclarationExpression> parameter>
(.
parameter = new ArrayList();
ParameterDeclarationExpression p;
AttributeSection section;ArrayList attributes = new ArrayList();
AttributeSection section;
List<AttributeSection> attributes = new List<AttributeSection>();
.) =
{ AttributeSection<out section> (.attributes.Add(section); .) }
(

40
src/Libraries/NRefactory/Test/Parser/GlobalScope/AttributeSectionTests.cs

@ -20,21 +20,35 @@ namespace ICSharpCode.NRefactory.Tests.AST @@ -20,21 +20,35 @@ namespace ICSharpCode.NRefactory.Tests.AST
public class AttributeSectionTests
{
[Test]
public void AttributeSection1Test()
public void AttributeOnStructure()
{
// string program = @"
//< StructLayout( LayoutKind.Explicit )> _
//Public Structure MyUnion
//
// < FieldOffset( 0 )> Public i As Integer
// < FieldOffset( 0 )> Public d As Double
//
//End Structure 'MyUnion
//";
// IParser parser = ParserFactory.CreateParser(SupportedLanguages.VBNet, new StringReader(program));
// parser.Parse();
// Assert.IsTrue(parser.Errors.ErrorOutput.Length == 0);
string program = @"
<StructLayout( LayoutKind.Explicit )> _
Public Structure MyUnion
<FieldOffset( 0 )> Public i As Integer
< FieldOffset( 0 )> Public d As Double
End Structure 'MyUnion
";
TypeDeclaration decl = (TypeDeclaration)ParseUtilVBNet.ParseGlobal(program, typeof(TypeDeclaration));
Assert.AreEqual("StructLayout", decl.Attributes[0].Attributes[0].Name);
}
[Test]
public void AttributeOnModule()
{
string program = @"
<HideModule> _
Public Module MyExtra
Public i As Integer
Public d As Double
End Module
";
TypeDeclaration decl = (TypeDeclaration)ParseUtilVBNet.ParseGlobal(program, typeof(TypeDeclaration));
Assert.AreEqual("HideModule", decl.Attributes[0].Attributes[0].Name);
}
}
}

4
src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj

@ -404,7 +404,6 @@ @@ -404,7 +404,6 @@
<Compile Include="Src\Gui\Pads\ProjectBrowser\Commands\ToolbarCommands.cs" />
<Compile Include="Src\Services\LanguageBinding\LanguageBindingDescriptor.cs" />
<Compile Include="Src\Services\DisplayBinding\DisplayBindingDescriptor.cs" />
<Compile Include="Src\Dom\IAttributeSection.cs" />
<Compile Include="Src\Dom\FoldingRegion.cs" />
<Compile Include="Src\Services\ParserService\Erbauer\ParserErbauer.cs" />
<Compile Include="Src\Services\ParserService\Erbauer\ParserDescriptor.cs" />
@ -457,7 +456,7 @@ @@ -457,7 +456,7 @@
<Compile Include="Src\Project\Items\ComReferenceProjectItem.cs" />
<Compile Include="Src\Gui\Pads\ProjectBrowser\TreeNodes\ReferenceFolder.cs" />
<Compile Include="Src\Gui\Pads\ProjectBrowser\TreeNodes\ReferenceNode.cs" />
<Compile Include="Src\Services\ProjectService\ProjectReferenceEventHandler.cs" />
<Compile Include="Src\Services\ProjectService\ProjectItemEventHandler.cs" />
<Compile Include="Src\Gui\Pads\ProjectBrowser\TreeNodes\Util\UpdateReferencesVisitor.cs" />
<Compile Include="Src\Project\Items\TypeLibrary.cs" />
<Compile Include="Src\Project\Items\UnknownProjectItem.cs" />
@ -675,6 +674,7 @@ @@ -675,6 +674,7 @@
<Compile Include="Src\Dom\ExpressionContext.cs" />
<Compile Include="Src\TextEditor\Gui\Editor\CompletionWindow\CachedCompletionDataProvider.cs" />
<Compile Include="Src\Dom\Implementations\CompoundClass.cs" />
<Compile Include="Src\Project\Items\ImportProjectItem.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Libraries\DockPanel_Src\WinFormsUI\WinFormsUI.csproj">

25
src/Main/Base/Project/Src/Dom/IAttribute.cs

@ -1,24 +1,45 @@ @@ -1,24 +1,45 @@
// <file>
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <version value="$version"/>
// </file>
using System;
using System.Collections;
namespace ICSharpCode.SharpDevelop.Dom
{
public interface IAttribute: IComparable
public interface IAttribute : IComparable
{
AttributeTarget AttributeTarget {
get;
}
string Name {
get;
}
ArrayList PositionalArguments { // [expression]
get;
}
SortedList NamedArguments { // string/expression
get;
}
}
public enum AttributeTarget
{
None,
Assembly,
Field,
Event,
Method,
Module,
Param,
Property,
Return,
Type
}
}

37
src/Main/Base/Project/Src/Dom/IAttributeSection.cs

@ -1,37 +0,0 @@ @@ -1,37 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <version value="$version"/>
// </file>
using System;
using System.Collections;
using System.Collections.Generic;
namespace ICSharpCode.SharpDevelop.Dom
{
public interface IAttributeSection: IComparable
{
AttributeTarget AttributeTarget {
get;
}
List<IAttribute> Attributes {
get;
}
}
public enum AttributeTarget
{
None,
Assembly,
Field,
Event,
Method,
Module,
Param,
Property,
Return,
Type
}
}

1
src/Main/Base/Project/Src/Dom/IClass.cs

@ -17,6 +17,7 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -17,6 +17,7 @@ namespace ICSharpCode.SharpDevelop.Dom
{
string FullyQualifiedName {
get;
set;
}
/// <summary>

4
src/Main/Base/Project/Src/Dom/ICompilationUnit.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// <file>
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
@ -35,7 +35,7 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -35,7 +35,7 @@ namespace ICSharpCode.SharpDevelop.Dom
get;
}
List<IAttributeSection> Attributes {
List<IAttribute> Attributes {
get;
}

3
src/Main/Base/Project/Src/Dom/IDecoration.cs

@ -18,9 +18,10 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -18,9 +18,10 @@ namespace ICSharpCode.SharpDevelop.Dom
ModifierEnum Modifiers {
get;
set;
}
List<IAttributeSection> Attributes {
List<IAttribute> Attributes {
get;
}

6
src/Main/Base/Project/Src/Dom/Implementations/AbstractDecoration.cs

@ -16,7 +16,7 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -16,7 +16,7 @@ namespace ICSharpCode.SharpDevelop.Dom
public abstract class AbstractDecoration : MarshalByRefObject, IDecoration
{
ModifierEnum modifiers = ModifierEnum.None;
List<IAttributeSection> attributes = null;
List<IAttribute> attributes = null;
IClass declaringType;
object userData = null;
@ -45,10 +45,10 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -45,10 +45,10 @@ namespace ICSharpCode.SharpDevelop.Dom
}
}
public List<IAttributeSection> Attributes {
public List<IAttribute> Attributes {
get {
if (attributes == null) {
attributes = new List<IAttributeSection>();
attributes = new List<IAttribute>();
}
return attributes;
}

2
src/Main/Base/Project/Src/Dom/Implementations/CompoundClass.cs

@ -51,10 +51,12 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -51,10 +51,12 @@ namespace ICSharpCode.SharpDevelop.Dom
ModifierEnum modifier = ModifierEnum.None;
this.BaseTypes.Clear();
this.TypeParameters.Clear();
this.Attributes.Clear();
foreach (IClass part in parts) {
modifier |= part.Modifiers;
this.BaseTypes.AddRange(part.BaseTypes);
this.TypeParameters.AddRange(part.TypeParameters);
this.Attributes.AddRange(part.Attributes);
}
this.Modifiers = modifier;
}

58
src/Main/Base/Project/Src/Dom/Implementations/DefaultAttribute.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// <file>
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
@ -10,52 +10,12 @@ using System.Collections.Generic; @@ -10,52 +10,12 @@ using System.Collections.Generic;
namespace ICSharpCode.SharpDevelop.Dom
{
[Serializable]
public class DefaultAttributeSection : IAttributeSection
{
AttributeTarget attributeTarget;
List<IAttribute> attributes = null;
public DefaultAttributeSection(AttributeTarget attributeTarget, List<IAttribute> attributes)
{
this.attributeTarget = attributeTarget;
this.attributes = attributes;
}
public AttributeTarget AttributeTarget {
get {
return attributeTarget;
}
set {
attributeTarget = value;
}
}
public List<IAttribute> Attributes {
get {
return attributes;
}
}
public virtual int CompareTo(IAttributeSection value) {
int cmp;
if(0 != (cmp = (int)(AttributeTarget - value.AttributeTarget)))
return cmp;
return DiffUtility.Compare(Attributes, value.Attributes);
}
int IComparable.CompareTo(object value) {
return CompareTo((IAttributeSection)value);
}
}
public class DefaultAttribute : IAttribute
{
string name;
ArrayList positionalArguments;
SortedList namedArguments;
AttributeTarget attributeTarget;
public DefaultAttribute(string name)
{
@ -64,9 +24,10 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -64,9 +24,10 @@ namespace ICSharpCode.SharpDevelop.Dom
this.namedArguments = new SortedList();
}
public DefaultAttribute(string name, ArrayList positionalArguments, SortedList namedArguments)
public DefaultAttribute(string name, AttributeTarget attributeTarget, ArrayList positionalArguments, SortedList namedArguments)
{
this.name = name;
this.attributeTarget = attributeTarget;
this.positionalArguments = positionalArguments;
this.namedArguments = namedArguments;
}
@ -79,11 +40,22 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -79,11 +40,22 @@ namespace ICSharpCode.SharpDevelop.Dom
name = value;
}
}
public AttributeTarget AttributeTarget {
get {
return attributeTarget;
}
set {
attributeTarget = value;
}
}
public ArrayList PositionalArguments { // [expression]
get {
return positionalArguments;
}
}
public SortedList NamedArguments { // string/expression
get {
return namedArguments;

6
src/Main/Base/Project/Src/Dom/Implementations/DefaultCompilationUnit.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// <file>
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
@ -17,7 +17,7 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -17,7 +17,7 @@ namespace ICSharpCode.SharpDevelop.Dom
{
List<IUsing> usings = new List<IUsing>();
List<IClass> classes = new List<IClass>();
List<IAttributeSection> attributes = new List<IAttributeSection>();
List<IAttribute> attributes = new List<IAttribute>();
List<FoldingRegion> foldingRegions = new List<FoldingRegion>();
List<Tag> tagComments = new List<Tag>();
@ -67,7 +67,7 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -67,7 +67,7 @@ namespace ICSharpCode.SharpDevelop.Dom
}
}
public virtual List<IAttributeSection> Attributes {
public virtual List<IAttribute> Attributes {
get {
return attributes;
}

80
src/Main/Base/Project/Src/Dom/LanguageProperties.cs

@ -14,33 +14,6 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -14,33 +14,6 @@ namespace ICSharpCode.SharpDevelop.Dom
public readonly static LanguageProperties CSharp = new LanguageProperties(StringComparer.InvariantCulture);
public readonly static LanguageProperties VBNet = new VBNetProperties();
private class VBNetProperties : LanguageProperties
{
public VBNetProperties() : base(StringComparer.InvariantCultureIgnoreCase) {}
public override bool ShowMember(IMember member, bool showStatic)
{
return member.IsStatic || !showStatic;
}
public override bool ImportNamespaces {
get {
return true;
}
}
public override bool ImportModules {
get {
return true;
}
}
public override string ToString()
{
return "[LanguageProperties: VB.NET]";
}
}
StringComparer nameComparer;
public LanguageProperties(StringComparer nameComparer)
@ -53,7 +26,7 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -53,7 +26,7 @@ namespace ICSharpCode.SharpDevelop.Dom
return nameComparer;
}
}
/// <summary>
/// Gets if namespaces can be imported (i.e. Imports System, Dim a As Collections.ArrayList)
/// </summary>
@ -62,7 +35,7 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -62,7 +35,7 @@ namespace ICSharpCode.SharpDevelop.Dom
return false;
}
}
/// <summary>
/// Gets if modules are imported with their namespace (i.e. Microsoft.VisualBasic.Randomize()).
/// </summary>
@ -72,11 +45,16 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -72,11 +45,16 @@ namespace ICSharpCode.SharpDevelop.Dom
}
}
public virtual bool ShowInNamespaceCompletion(IClass c)
{
return true;
}
public virtual bool ShowMember(IMember member, bool showStatic)
{
return member.IsStatic == showStatic;
}
public override string ToString()
{
if (GetType() == typeof(LanguageProperties) && nameComparer == StringComparer.InvariantCulture)
@ -84,5 +62,47 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -84,5 +62,47 @@ namespace ICSharpCode.SharpDevelop.Dom
else
return "[" + base.ToString() + "]";
}
private class VBNetProperties : LanguageProperties
{
public VBNetProperties() : base(StringComparer.InvariantCultureIgnoreCase) {}
public override bool ShowMember(IMember member, bool showStatic)
{
return member.IsStatic || !showStatic;
}
public override bool ImportNamespaces {
get {
return true;
}
}
public override bool ImportModules {
get {
return true;
}
}
public override bool ShowInNamespaceCompletion(IClass c)
{
foreach (IAttribute attr in c.Attributes) {
if (NameComparer.Equals(attr.Name, "Microsoft.VisualBasic.HideModuleNameAttribute"))
return false;
if (NameComparer.Equals(attr.Name, "HideModuleNameAttribute"))
return false;
if (NameComparer.Equals(attr.Name, "Microsoft.VisualBasic.HideModuleName"))
return false;
if (NameComparer.Equals(attr.Name, "HideModuleName"))
return false;
}
return base.ShowInNamespaceCompletion(c);
}
public override string ToString()
{
return "[LanguageProperties: VB.NET]";
}
}
}
}

38
src/Main/Base/Project/Src/Dom/NRefactoryResolver/NRefactoryASTConvertVisitor.cs

@ -164,18 +164,12 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver @@ -164,18 +164,12 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver
return data;
}
List<IAttributeSection> VisitAttributes(ArrayList attributes)
List<IAttribute> VisitAttributes(List<AST.AttributeSection> attributes)
{
// TODO Expressions???
List<IAttributeSection> result = new List<IAttributeSection>();
List<IAttribute> result = new List<IAttribute>();
foreach (AST.AttributeSection section in attributes) {
List<IAttribute> resultAttributes = new List<IAttribute>();
foreach (AST.Attribute attribute in section.Attributes) {
IAttribute a = new DefaultAttribute(attribute.Name, new ArrayList(attribute.PositionalArguments), new SortedList());
foreach (AST.NamedArgumentExpression n in attribute.NamedArguments) {
a.NamedArguments[n.Name] = n.Expression;
}
}
AttributeTarget target = AttributeTarget.None;
if (section.AttributeTarget != null && section.AttributeTarget != "") {
switch (section.AttributeTarget.ToUpper()) {
@ -212,8 +206,14 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver @@ -212,8 +206,14 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver
}
}
IAttributeSection s = new DefaultAttributeSection(target, resultAttributes);
result.Add(s);
foreach (AST.Attribute attribute in section.Attributes) {
IAttribute a = new DefaultAttribute(attribute.Name, target, new ArrayList(attribute.PositionalArguments), new SortedList());
foreach (AST.NamedArgumentExpression n in attribute.NamedArguments) {
a.NamedArguments[n.Name] = n.Expression;
}
result.Add(a);
}
}
return result;
}
@ -282,6 +282,22 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver @@ -282,6 +282,22 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver
currentClass.Push(c);
object ret = typeDeclaration.AcceptChildren(this, data);
currentClass.Pop();
if (c.ClassType == ClassType.Module) {
foreach (IField f in c.Fields) {
f.Modifiers |= ModifierEnum.Static;
}
foreach (IMethod m in c.Methods) {
m.Modifiers |= ModifierEnum.Static;
}
foreach (IProperty p in c.Properties) {
p.Modifiers |= ModifierEnum.Static;
}
foreach (IEvent e in c.Events) {
e.Modifiers |= ModifierEnum.Static;
}
}
return ret;
}

20
src/Main/Base/Project/Src/Dom/NRefactoryResolver/NRefactoryResolver.cs

@ -365,7 +365,7 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver @@ -365,7 +365,7 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver
#region Resolve Identifier
ResolveResult ResolveIdentifier(string identifier)
{
string name = SearchNamespace(identifier, this.CompilationUnit);
string name = SearchNamespace(identifier);
if (name != null && name != "") {
return new NamespaceResolveResult(callingClass, callingMember, name);
}
@ -373,7 +373,7 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver @@ -373,7 +373,7 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver
ResolveResult result = ResolveIdentifierInternal(identifier);
ResolveResult result2 = null;
IClass c = SearchType(identifier, callingClass, cu);
IClass c = SearchType(identifier);
if (c != null) {
result2 = new TypeResolveResult(callingClass, callingMember, c.DefaultReturnType, c);
}
@ -528,25 +528,17 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver @@ -528,25 +528,17 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver
/// <remarks>
/// use the usings to find the correct name of a namespace
/// </remarks>
public string SearchNamespace(string name, ICompilationUnit unit)
public string SearchNamespace(string name)
{
return projectContent.SearchNamespace(name, unit, caretLine, caretColumn);
return projectContent.SearchNamespace(name, callingClass, cu, caretLine, caretColumn);
}
/// <remarks>
/// use the usings and the name of the namespace to find a class
/// </remarks>
public IClass SearchType(string name, IClass curType)
public IClass SearchType(string name)
{
return projectContent.SearchType(name, curType, caretLine, caretColumn);
}
/// <remarks>
/// use the usings and the name of the namespace to find a class
/// </remarks>
public IClass SearchType(string name, IClass curType, ICompilationUnit unit)
{
return projectContent.SearchType(name, curType, unit, caretLine, caretColumn);
return projectContent.SearchType(name, callingClass, cu, caretLine, caretColumn);
}
#region Helper for TypeVisitor

6
src/Main/Base/Project/Src/Dom/NRefactoryResolver/TypeVisitor.cs

@ -275,11 +275,11 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver @@ -275,11 +275,11 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver
if (identifierExpression == null) {
return null;
}
string name = resolver.SearchNamespace(identifierExpression.Identifier, resolver.CompilationUnit);
string name = resolver.SearchNamespace(identifierExpression.Identifier);
if (name != null && name.Length > 0) {
return new NamespaceReturnType(name);
}
IClass c = resolver.SearchType(identifierExpression.Identifier, resolver.CallingClass, resolver.CompilationUnit);
IClass c = resolver.SearchType(identifierExpression.Identifier);
if (c != null) {
return c.DefaultReturnType;
}
@ -450,7 +450,7 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver @@ -450,7 +450,7 @@ namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver
{
if (reference.IsNull) return null;
IClass callingClass = resolver.CallingClass;
IClass c = resolver.SearchType(reference.SystemType, callingClass);
IClass c = resolver.SearchType(reference.SystemType);
if (c == null) return null;
IReturnType t = c.DefaultReturnType;
if (callingClass != null) {

4
src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/Commands/ReferenceFolderNodeCommands.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// <file>
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
@ -30,7 +30,7 @@ namespace ICSharpCode.SharpDevelop.Project.Commands @@ -30,7 +30,7 @@ namespace ICSharpCode.SharpDevelop.Project.Commands
using (SelectReferenceDialog selDialog = new SelectReferenceDialog(ProjectService.CurrentProject)) {
if (selDialog.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK) {
foreach (ReferenceProjectItem reference in selDialog.ReferenceInformations) {
ProjectService.AddReference(ProjectService.CurrentProject, reference);
ProjectService.AddProjectItem(ProjectService.CurrentProject, reference);
}
ProjectService.SaveSolution();
}

12
src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/ProjectBrowserControl.cs

@ -56,9 +56,9 @@ namespace ICSharpCode.SharpDevelop.Project @@ -56,9 +56,9 @@ namespace ICSharpCode.SharpDevelop.Project
treeView.AfterSelect += new TreeViewEventHandler(TreeViewAfterSelect);
FileService.FileRenaming += new FileRenameEventHandler(FileServiceFileRenaming);
FileService.FileRemoving += new FileEventHandler(FileServiceFileRemoving);
ProjectService.ReferenceAdded += new ProjectReferenceEventHandler(ProjectServiceReferenceAdded);
ProjectService.SolutionFolderRemoved += new SolutionFolderEventHandler(ProjectServiceSolutionFolderRemoved);
ProjectService.ProjectItemAdded += ProjectServiceProjectItemAdded;
ProjectService.SolutionFolderRemoved += ProjectServiceSolutionFolderRemoved;
treeView.DrawNode += TreeViewDrawNode;
}
@ -86,9 +86,11 @@ namespace ICSharpCode.SharpDevelop.Project @@ -86,9 +86,11 @@ namespace ICSharpCode.SharpDevelop.Project
{
CallVisitor(new SolutionFolderRemoveVisitor(e.SolutionFolder));
}
void ProjectServiceReferenceAdded(object sender, ProjectReferenceEventArgs e)
void ProjectServiceProjectItemAdded(object sender, ProjectItemEventArgs e)
{
CallVisitor(new UpdateReferencesVisitor(e));
if (e.ProjectItem is ReferenceProjectItem) {
CallVisitor(new UpdateReferencesVisitor(e));
}
}
void FileServiceFileRemoving(object sender, FileEventArgs e)

4
src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/Util/UpdateReferencesVisitor.cs

@ -4,9 +4,9 @@ namespace ICSharpCode.SharpDevelop.Project @@ -4,9 +4,9 @@ namespace ICSharpCode.SharpDevelop.Project
{
public class UpdateReferencesVisitor : ProjectBrowserTreeNodeVisitor
{
ProjectReferenceEventArgs e;
ProjectItemEventArgs e;
public UpdateReferencesVisitor(ProjectReferenceEventArgs e)
public UpdateReferencesVisitor(ProjectItemEventArgs e)
{
this.e = e;
}

43
src/Main/Base/Project/Src/Internal/Templates/Project/ProjectDescriptor.cs

@ -28,8 +28,8 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -28,8 +28,8 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
string relativePath;
string languageName = null;
ArrayList files = new ArrayList(); // contains FileTemplate classes
ArrayList references = new ArrayList();
List<FileDescriptionTemplate> files = new List<FileDescriptionTemplate>(); // contains FileTemplate classes
List<ProjectItem> projectItems = new List<ProjectItem>();
XmlElement projectOptions = null;
@ -40,15 +40,15 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -40,15 +40,15 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
}
}
public ArrayList Files {
public List<FileDescriptionTemplate> Files {
get {
return files;
}
}
public ArrayList References {
public List<ProjectItem> ProjectItems {
get {
return references;
return projectItems;
}
}
@ -88,8 +88,8 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -88,8 +88,8 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
string newProjectName = StringParser.Parse(name, new string[,] {
{"ProjectName", projectCreateInformation.ProjectName}
});
{"ProjectName", projectCreateInformation.ProjectName}
});
string projectLocation = FileUtility.Combine(projectCreateInformation.ProjectBasePath, newProjectName + LanguageBindingService.GetProjectFileExtension(language));
projectCreateInformation.OutputProjectFileName = projectLocation;
@ -119,10 +119,10 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -119,10 +119,10 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
}
project.RootNamespace = standardNamespace.ToString();
StringParser.Properties["StandardNamespace"] = project.RootNamespace;
// Add References
foreach (ReferenceProjectItem projectReference in references) {
projectReference.Project = project;
project.Items.Add(projectReference);
// Add Project items
foreach (ProjectItem projectItem in projectItems) {
projectItem.Project = project;
project.Items.Add(projectItem);
}
// Add Files
@ -204,16 +204,35 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -204,16 +204,35 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
}
}
if (element["References"] != null) {
MessageService.ShowWarning(element.OwnerDocument.DocumentElement.GetAttribute("fileName") + ")\n"
+ "<References> is obsolete, use <ProjectItems> instead");
foreach (XmlNode node in element["References"].ChildNodes) {
if (node != null && node.Name == "Reference") {
ReferenceProjectItem referenceProjectItem = new ReferenceProjectItem(null);
referenceProjectItem.Include = node.Attributes["refto"].InnerXml;
// projectReference.ReferenceType = (ReferenceType)Enum.Parse(typeof(ReferenceType), node.Attributes["type"].InnerXml);
projectDescriptor.references.Add(referenceProjectItem);
projectDescriptor.projectItems.Add(referenceProjectItem);
}
}
}
if (element["ProjectItems"] != null) {
ReadProjectItems(projectDescriptor, element["ProjectItems"]);
}
return projectDescriptor;
}
static void ReadProjectItems(ProjectDescriptor projectDescriptor, XmlElement xml)
{
//projectDescriptor.references
foreach (XmlNode node in xml.ChildNodes) {
XmlElement el = node as XmlElement;
if (el != null) {
XmlTextReader reader = new XmlTextReader(new StringReader(el.OuterXml));
reader.Read();
projectDescriptor.projectItems.Add(ProjectItem.ReadItem(reader, null, el.Name));
reader.Close();
}
}
}
}
}

28
src/Main/Base/Project/Src/Internal/Templates/Project/ProjectTemplate.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// <file>
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
@ -58,7 +58,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -58,7 +58,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
CombineDescriptor combineDescriptor = null;
#region Template Properties
#region Template Properties
public string WizardPath {
get {
return wizardpath;
@ -116,21 +116,27 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -116,21 +116,27 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
[Browsable(false)]
public CombineDescriptor CombineDescriptor
{
get
get
{
return combineDescriptor;
}
}
#endregion
#endregion
protected ProjectTemplate(string fileName)
{
XmlDocument doc = new XmlDocument();
doc.Load(fileName);
try {
doc.Load(fileName);
} catch (XmlException ex) {
MessageService.ShowError("Invalid xml: " + fileName + "\n" + ex.Message);
return;
}
originator = doc.DocumentElement.Attributes["originator"].InnerText;
created = doc.DocumentElement.Attributes["created"].InnerText;
lastmodified = doc.DocumentElement.Attributes["lastModified"].InnerText;
doc.DocumentElement.SetAttribute("fileName", fileName); // needed for warning messages for unknown elements
originator = doc.DocumentElement.GetAttribute("originator");
created = doc.DocumentElement.GetAttribute("created");
lastmodified = doc.DocumentElement.GetAttribute("lastModified");
XmlElement config = doc.DocumentElement["TemplateConfiguration"];
@ -168,8 +174,8 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -168,8 +174,8 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
public ProjectCreateInformation ProjectCreateInformation
{
get {
return projectCreateInformation;
get {
return projectCreateInformation;
}
}
@ -178,7 +184,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -178,7 +184,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
this.projectCreateInformation = projectCreateInformation;
if (wizardpath != null) {
// TODO: WIZARD
// TODO: WIZARD
Properties customizer = new Properties();
customizer.Set("ProjectCreateInformation", projectCreateInformation);
customizer.Set("ProjectTemplate", this);

8
src/Main/Base/Project/Src/Project/AbstractProject.cs

@ -81,6 +81,12 @@ namespace ICSharpCode.SharpDevelop.Project @@ -81,6 +81,12 @@ namespace ICSharpCode.SharpDevelop.Project
}
}
/// <summary>
/// Gets the list of MSBuild Imports.
/// </summary>
/// <returns>
/// List of Import filenames, <example>$(MSBuildBinPath)\Microsoft.VisualBasic.targets</example>
/// </returns>
[Browsable(false)]
public List<string> Imports {
get {
@ -166,7 +172,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -166,7 +172,7 @@ namespace ICSharpCode.SharpDevelop.Project
}
[Browsable(false)]
public OutputType OutputType {
public virtual OutputType OutputType {
get {
return BaseConfiguration.Get("OutputType", OutputType.Exe);
}

27
src/Main/Base/Project/Src/Project/Items/ImportProjectItem.cs

@ -0,0 +1,27 @@ @@ -0,0 +1,27 @@
/*
* Created by SharpDevelop.
* User: Daniel Grunwald
* Date: 19.07.2005
* Time: 23:34
*/
using System;
namespace ICSharpCode.SharpDevelop.Project
{
/// <summary>
/// Description of ImportProjectItem.
/// </summary>
public class ImportProjectItem : ProjectItem
{
public ImportProjectItem(IProject project) : base(project)
{
}
public override ItemType ItemType {
get {
return ItemType.Import;
}
}
}
}

4
src/Main/Base/Project/Src/Project/Items/ProjectItem.cs

@ -16,6 +16,8 @@ namespace ICSharpCode.SharpDevelop.Project @@ -16,6 +16,8 @@ namespace ICSharpCode.SharpDevelop.Project
ProjectReference,
COMReference,
Import,
WebReferenceUrl,
// FileProjectItem
@ -109,7 +111,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -109,7 +111,7 @@ namespace ICSharpCode.SharpDevelop.Project
Properties);
}
static ProjectItem ReadItem(XmlTextReader reader, IProject project, string itemType)
public static ProjectItem ReadItem(XmlTextReader reader, IProject project, string itemType)
{
ProjectItem newItem = ProjectItemFactory.CreateProjectItem(project, itemType);
newItem.Include = reader.GetAttribute("Include");

2
src/Main/Base/Project/Src/Project/Items/ProjectItemFactory.cs

@ -25,6 +25,8 @@ namespace ICSharpCode.SharpDevelop.Project @@ -25,6 +25,8 @@ namespace ICSharpCode.SharpDevelop.Project
return new ProjectReferenceProjectItem(project);
case "COMReference":
return new ComReferenceProjectItem(project);
case "Import":
return new ImportProjectItem(project);
case "None":
case "Compile":

2
src/Main/Base/Project/Src/Project/Items/UnknownProjectItem.cs

@ -14,7 +14,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -14,7 +14,7 @@ namespace ICSharpCode.SharpDevelop.Project
public override string Tag {
get {
return ItemType.ToString();
return tag;
}
}

12
src/Main/Base/Project/Src/Project/MSBuildProject.cs

@ -165,6 +165,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -165,6 +165,7 @@ namespace ICSharpCode.SharpDevelop.Project
}
List<ProjectItem> references = new List<ProjectItem>();
List<ProjectItem> imports = new List<ProjectItem>();
List<ProjectItem> projectFiles = new List<ProjectItem>();
List<ProjectItem> other = new List<ProjectItem>();
@ -178,6 +179,9 @@ namespace ICSharpCode.SharpDevelop.Project @@ -178,6 +179,9 @@ namespace ICSharpCode.SharpDevelop.Project
case ItemType.None:
projectFiles.Add(item);
break;
case ItemType.Import:
imports.Add(item);
break;
default:
other.Add(item);
break;
@ -188,13 +192,15 @@ namespace ICSharpCode.SharpDevelop.Project @@ -188,13 +192,15 @@ namespace ICSharpCode.SharpDevelop.Project
ProjectItem.WriteItemGroup(writer, references);
}
if (imports.Count > 0) {
ProjectItem.WriteItemGroup(writer, imports);
}
if (projectFiles.Count > 0) {
ProjectItem.WriteItemGroup(writer, projectFiles);
}
if (other.Count > 0) {
ProjectItem.WriteItemGroup(writer, other);
}
ProjectItem.WriteItemGroup(writer, other);
foreach (string import in Imports) {
writer.WriteStartElement("Import");

64
src/Main/Base/Project/Src/Services/ParserService/DefaultProjectContent.cs

@ -29,6 +29,13 @@ namespace ICSharpCode.Core @@ -29,6 +29,13 @@ namespace ICSharpCode.Core
List<Dictionary<string, IClass>> classLists = new List<Dictionary<string, IClass>>();
List<Dictionary<string, NamespaceStruct>> namespaces = new List<Dictionary<string, NamespaceStruct>>();
protected XmlDoc xmlDoc = new XmlDoc();
List<IUsing> defaultImports = new List<IUsing>();
public List<IUsing> DefaultImports {
get {
return defaultImports;
}
}
public List<Dictionary<string, IClass>> ClassLists {
get {
@ -181,8 +188,7 @@ namespace ICSharpCode.Core @@ -181,8 +188,7 @@ namespace ICSharpCode.Core
protected void AddClassToNamespaceListInternal(IClass addClass)
{
if (addClass.IsPartial) {
Console.WriteLine(addClass);
Console.Write("Adding partial class... ");
Console.WriteLine("Adding partial class " + addClass.Name + " from " + Path.GetFileName(addClass.CompilationUnit.FileName));
Dictionary<string, IClass> classes = GetClasses(language);
CompoundClass compound = null;
if (classes.ContainsKey(addClass.FullyQualifiedName))
@ -193,18 +199,17 @@ namespace ICSharpCode.Core @@ -193,18 +199,17 @@ namespace ICSharpCode.Core
if (compound.Parts[i].CompilationUnit.FileName == addClass.CompilationUnit.FileName) {
compound.Parts[i] = addClass;
compound.UpdateInformationFromParts();
Console.WriteLine("Replaced!");
Console.WriteLine("\tReplaced old part!");
return;
}
}
compound.Parts.Add(addClass);
compound.UpdateInformationFromParts();
Console.WriteLine("Added!");
Console.WriteLine("\tAdded new part!");
return;
} else {
addClass = new CompoundClass(addClass);
Console.WriteLine("Compound created!");
Console.WriteLine(addClass);
Console.WriteLine("\tCompound created!");
}
}
@ -431,15 +436,12 @@ namespace ICSharpCode.Core @@ -431,15 +436,12 @@ namespace ICSharpCode.Core
int newCapacity = list.Count + ns.Classes.Count + ns.SubNamespaces.Count;
if (list.Capacity < newCapacity)
list.Capacity = newCapacity;
if (language.ImportModules) {
foreach (IClass c in ns.Classes) {
foreach (IClass c in ns.Classes) {
if (language.ShowInNamespaceCompletion(c))
list.Add(c);
if (c.ClassType == ClassType.Module) {
list.AddRange(c.GetAccessibleMembers(null, true));
}
if (language.ImportModules && c.ClassType == ClassType.Module) {
list.AddRange(c.GetAccessibleMembers(null, true));
}
} else {
list.AddRange(ns.Classes);
}
foreach (string subns in ns.SubNamespaces) {
if (!list.Contains(subns))
@ -471,11 +473,12 @@ namespace ICSharpCode.Core @@ -471,11 +473,12 @@ namespace ICSharpCode.Core
}
public string SearchNamespace(string name, ICompilationUnit unit, int caretLine, int caretColumn)
public string SearchNamespace(string name, IClass curType, ICompilationUnit unit, int caretLine, int caretColumn)
{
if (NamespaceExists(name)) {
return name;
}
if (unit == null) {
return null;
}
@ -488,6 +491,32 @@ namespace ICSharpCode.Core @@ -488,6 +491,32 @@ namespace ICSharpCode.Core
}
}
}
foreach (IUsing u in defaultImports) {
string nameSpace = u.SearchNamespace(name);
if (nameSpace != null) {
return nameSpace;
}
}
if (curType != null) {
// Try parent namespaces of the current class
string fullname = curType.Namespace;
if (fullname != null && fullname.Length > 0) {
string[] namespaces = fullname.Split('.');
StringBuilder curnamespace = new StringBuilder();
for (int i = 0; i < namespaces.Length; ++i) {
curnamespace.Append(namespaces[i]);
curnamespace.Append('.');
curnamespace.Append(name);
string nameSpace = curnamespace.ToString();
if (NamespaceExists(nameSpace)) {
return nameSpace;
}
// remove class name again to try next namespace
curnamespace.Length -= name.Length;
}
}
}
return null;
}
@ -504,6 +533,7 @@ namespace ICSharpCode.Core @@ -504,6 +533,7 @@ namespace ICSharpCode.Core
if (name == null || name.Length == 0) {
return null;
}
// Try if name is already the full type name
IClass c = GetClass(name);
if (c != null) {
@ -548,6 +578,12 @@ namespace ICSharpCode.Core @@ -548,6 +578,12 @@ namespace ICSharpCode.Core
}
}
}
foreach (IUsing u in defaultImports) {
c = u.SearchType(name);
if (c != null) {
return c;
}
}
return null;
}

2
src/Main/Base/Project/Src/Services/ParserService/IProjectContent.cs

@ -57,7 +57,7 @@ namespace ICSharpCode.Core @@ -57,7 +57,7 @@ namespace ICSharpCode.Core
/// </summary>
void AddNamespaceContents(ArrayList list, string subNameSpace, LanguageProperties language, bool lookInReferences);
string SearchNamespace(string name, ICompilationUnit unit, int caretLine, int caretColumn);
string SearchNamespace(string name, IClass curType, ICompilationUnit unit, int caretLine, int caretColumn);
IClass SearchType(string name, IClass curType, int caretLine, int caretColumn);
IClass SearchType(string name, IClass curType, ICompilationUnit unit, int caretLine, int caretColumn);

47
src/Main/Base/Project/Src/Services/ParserService/ParseProjectContent.cs

@ -27,6 +27,13 @@ namespace ICSharpCode.Core @@ -27,6 +27,13 @@ namespace ICSharpCode.Core
}
IProject project;
public IProject Project {
get {
return project;
}
}
bool initializing;
public override string ToString()
@ -37,7 +44,9 @@ namespace ICSharpCode.Core @@ -37,7 +44,9 @@ namespace ICSharpCode.Core
internal void Initialize1()
{
ProjectItem[] items = project.Items.ToArray();
ProjectService.ReferenceAdded += OnReferenceAdded;
ProjectService.ProjectItemAdded += OnProjectItemAdded;
ProjectService.ProjectItemRemoved += OnProjectItemRemoved;
UpdateDefaultImports(items);
foreach (ProjectItem item in items) {
if (!initializing) return; // abort initialization
switch (item.ItemType) {
@ -66,10 +75,39 @@ namespace ICSharpCode.Core @@ -66,10 +75,39 @@ namespace ICSharpCode.Core
}
}
void OnReferenceAdded(object sender, ProjectReferenceEventArgs e)
void OnProjectItemAdded(object sender, ProjectItemEventArgs e)
{
if (e.Project != project) return;
ReferenceProjectItem reference = e.ProjectItem as ReferenceProjectItem;
if (reference != null) {
new AddReferenceDelegate(AddReference).BeginInvoke(reference, null, null);
}
if (e.ProjectItem.ItemType == ItemType.Import) {
UpdateDefaultImports(project.Items.ToArray());
}
}
void OnProjectItemRemoved(object sender, ProjectItemEventArgs e)
{
if (e.Project != project) return;
new AddReferenceDelegate(AddReference).BeginInvoke(e.ReferenceProjectItem, null, null);
if (e.ProjectItem.ItemType == ItemType.Import) {
UpdateDefaultImports(project.Items.ToArray());
}
}
void UpdateDefaultImports(ProjectItem[] items)
{
DefaultImports.Clear();
DefaultUsing u = null;
foreach (ProjectItem item in items) {
if (item.ItemType == ItemType.Import) {
if (u == null) {
u = new DefaultUsing(this);
DefaultImports.Add(u);
}
u.Usings.Add(item.Include);
}
}
}
internal int GetInitializationWorkAmount()
@ -109,7 +147,8 @@ namespace ICSharpCode.Core @@ -109,7 +147,8 @@ namespace ICSharpCode.Core
public override void Dispose()
{
ProjectService.ReferenceAdded -= OnReferenceAdded;
ProjectService.ProjectItemAdded -= OnProjectItemAdded;
ProjectService.ProjectItemRemoved -= OnProjectItemRemoved;
initializing = false;
base.Dispose();
}

20
src/Main/Base/Project/Src/Services/ProjectService/ProjectItemEventHandler.cs

@ -0,0 +1,20 @@ @@ -0,0 +1,20 @@
using System;
namespace ICSharpCode.SharpDevelop.Project
{
public class ProjectItemEventArgs : ProjectEventArgs
{
ProjectItem projectItem;
public ProjectItem ProjectItem {
get {
return projectItem;
}
}
public ProjectItemEventArgs(IProject project, ProjectItem projectItem) : base(project)
{
this.projectItem = projectItem;
}
}
}

30
src/Main/Base/Project/Src/Services/ProjectService/ProjectReferenceEventHandler.cs

@ -1,30 +0,0 @@ @@ -1,30 +0,0 @@
using System;
namespace ICSharpCode.SharpDevelop.Project
{
public delegate void ProjectReferenceEventHandler(object sender, ProjectReferenceEventArgs e);
public class ProjectReferenceEventArgs
{
IProject project;
ReferenceProjectItem referenceProjectItem;
public IProject Project {
get {
return project;
}
}
public ReferenceProjectItem ReferenceProjectItem {
get {
return referenceProjectItem;
}
}
public ProjectReferenceEventArgs(IProject project, ReferenceProjectItem referenceProjectItem)
{
this.project = project;
this.referenceProjectItem = referenceProjectItem;
}
}
}

48
src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs

@ -128,10 +128,28 @@ namespace ICSharpCode.SharpDevelop.Project @@ -128,10 +128,28 @@ namespace ICSharpCode.SharpDevelop.Project
}
}
public static void AddReference(IProject project, ReferenceProjectItem reference)
/// <summary>
/// Adds a project item to the project, raising the ProjectItemAdded event.
/// </summary>
public static void AddProjectItem(IProject project, ProjectItem item)
{
project.Items.Add(reference);
OnReferenceAdded(new ProjectReferenceEventArgs(project, reference));
if (project == null) throw new ArgumentNullException("project");
if (item == null) throw new ArgumentNullException("item");
project.Items.Add(item);
OnProjectItemAdded(new ProjectItemEventArgs(project, item));
}
/// <summary>
/// Removes a project item from the project, raising the ProjectItemRemoved event.
/// </summary>
public static void RemoveProjectItem(IProject project, ProjectItem item)
{
if (project == null) throw new ArgumentNullException("project");
if (item == null) throw new ArgumentNullException("item");
if (!project.Items.Remove(item)) {
throw new ArgumentException("The item was not found in the project!");
}
OnProjectItemRemoved(new ProjectItemEventArgs(project, item));
}
public static void LoadSolution(string fileName)
@ -265,13 +283,6 @@ namespace ICSharpCode.SharpDevelop.Project @@ -265,13 +283,6 @@ namespace ICSharpCode.SharpDevelop.Project
}
}
static void OnReferenceAdded(ProjectReferenceEventArgs e)
{
if (ReferenceAdded != null) {
ReferenceAdded(null, e);
}
}
static void OnStartBuild(EventArgs e)
{
if (StartBuild != null) {
@ -306,6 +317,20 @@ namespace ICSharpCode.SharpDevelop.Project @@ -306,6 +317,20 @@ namespace ICSharpCode.SharpDevelop.Project
SolutionFolderRemoved(null, e);
}
}
static void OnProjectItemAdded(ProjectItemEventArgs e)
{
if (ProjectItemAdded != null) {
ProjectItemAdded(null, e);
}
}
static void OnProjectItemRemoved(ProjectItemEventArgs e)
{
if (ProjectItemRemoved != null) {
ProjectItemRemoved(null, e);
}
}
public static event SolutionFolderEventHandler SolutionFolderRemoved;
public static event EventHandler StartBuild;
@ -322,6 +347,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -322,6 +347,7 @@ namespace ICSharpCode.SharpDevelop.Project
public static event ProjectEventHandler CurrentProjectChanged;
public static event ProjectReferenceEventHandler ReferenceAdded;
public static event EventHandler<ProjectItemEventArgs> ProjectItemAdded;
public static event EventHandler<ProjectItemEventArgs> ProjectItemRemoved;
}
}

13
src/Main/Base/Project/Src/TextEditor/Actions.cs

@ -40,6 +40,19 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Actions @@ -40,6 +40,19 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Actions
}
}
#if DEBUG
public class DebugCodeCompletionAction : AbstractEditAction
{
public override void Execute(TextArea services)
{
SharpDevelopTextAreaControl sdtac = (SharpDevelopTextAreaControl)services.MotherTextEditorControl;
CodeCompletionDataProvider ccdp = new CodeCompletionDataProvider();
ccdp.DebugMode = true;
sdtac.ShowCompletionWindow(ccdp, '.');
}
}
#endif
public class GoToDefinition : AbstractEditAction
{
public override void Execute(TextArea textArea)

20
src/Main/Base/Project/Src/TextEditor/Gui/Editor/CompletionWindow/CodeCompletionDataProvider.cs

@ -6,19 +6,12 @@ @@ -6,19 +6,12 @@
// </file>
using System;
using System.Drawing;
using System.Diagnostics;
using System.Windows.Forms;
using System.Reflection;
using System.Collections;
using System.Collections.Specialized;
using System.Xml;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Internal.Templates;
using ICSharpCode.TextEditor.Document;
using ICSharpCode.TextEditor;
using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.TextEditor;
using ICSharpCode.TextEditor.Document;
using ICSharpCode.TextEditor.Gui.CompletionWindow;
namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
@ -34,11 +27,20 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -34,11 +27,20 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
GenerateCompletionData(textArea, GetExpression(textArea));
}
#if DEBUG
public bool DebugMode = false;
#endif
protected void GenerateCompletionData(TextArea textArea, string expression)
{
if (expression == null || expression.Length == 0) {
return;
}
#if DEBUG
if (DebugMode) {
Debugger.Break();
}
#endif
AddResolveResults(ParserService.Resolve(expression,
caretLineNumber,
caretColumn,

3
src/Main/Base/Project/Src/TextEditor/Gui/Editor/SharpDevelopTextAreaControl.cs

@ -151,6 +151,9 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -151,6 +151,9 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
void GenerateEditActions()
{
#if DEBUG
editactions[Keys.Control | Keys.OemPeriod] = new DebugCodeCompletionAction();
#endif
try {
IEditAction[] actions = (IEditAction[])(AddInTree.GetTreeNode(editActionsPath).BuildChildItems(this)).ToArray(typeof(IEditAction));

4
src/Main/Base/Test/SearchClassTests.cs

@ -66,7 +66,7 @@ namespace ICSharpCode.SharpDevelop.Tests @@ -66,7 +66,7 @@ namespace ICSharpCode.SharpDevelop.Tests
void CheckNamespace(string @namespace, string className, LanguageProperties language)
{
ICompilationUnit cu = Prepare(language);
string ns = cu.ProjectContent.SearchNamespace(@namespace, cu, 1, 1);
string ns = cu.ProjectContent.SearchNamespace(@namespace, null, cu, 1, 1);
Assert.IsNotNull(ns, @namespace + " not found");
foreach (object o in cu.ProjectContent.GetNamespaceContents(ns)) {
IClass c = o as IClass;
@ -130,7 +130,7 @@ namespace ICSharpCode.SharpDevelop.Tests @@ -130,7 +130,7 @@ namespace ICSharpCode.SharpDevelop.Tests
public void SearchNestedNamespace()
{
ICompilationUnit cu = Prepare(LanguageProperties.CSharp);
string ns = cu.ProjectContent.SearchNamespace("Collections.Generic", cu, 1, 1);
string ns = cu.ProjectContent.SearchNamespace("Collections.Generic", null, cu, 1, 1);
Assert.IsNull(ns, "Nested namespaces should not be found in C#");
}

82
src/SharpDevelop.sln

@ -1,35 +1,5 @@ @@ -1,35 +1,5 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# SharpDevelop 2.0.0.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Main", "Main", "{5A3EBEBA-0560-41C1-966B-23F7D03A5486}"
ProjectSection(SolutionItems) = postProject
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop.Tests", "Main\Base\Test\ICSharpCode.SharpDevelop.Tests.csproj", "{4980B743-B32F-4aba-AABD-45E2CAD3568D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop", "Main\Base\Project\ICSharpCode.SharpDevelop.csproj", "{2748AD25-9C63-4E12-877B-4DCE96FBED54}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Core", "Main\Core\Project\ICSharpCode.Core.csproj", "{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StartUp", "Main\StartUp\Project\StartUp.csproj", "{1152B71B-3C05-4598-B20D-823B5D40559E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Core.Tests", "Main\Core\Test\ICSharpCode.Core.Tests.csproj", "{AD6FAA08-D6F5-4DBA-AF85-F4DA9F40C3B5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{9421EDF4-9769-4BE9-B5A6-C87DE221D73C}"
ProjectSection(SolutionItems) = postProject
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit.framework.dll", "Tools\NUnit\src\NUnitFramework\framework\nunit.framework.dll.csproj", "{83DD7E12-A705-4DBA-9D71-09C8973D9382}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit.core.dll", "Tools\NUnit\src\NUnitFramework\core\nunit.core.dll.csproj", "{EBD43A7F-AFCA-4281-BB53-5CDD91F966A3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinFormsUI", "Libraries\DockPanel_Src\WinFormsUI\WinFormsUI.csproj", "{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.TextEditor", "Libraries\ICSharpCode.TextEditor\Project\ICSharpCode.TextEditor.csproj", "{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NRefactory", "Libraries\NRefactory\Project\NRefactory.csproj", "{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit.extensions.dll", "Tools\NUnit\src\NUnitFramework\extensions\nunit.extensions.dll.csproj", "{98B10E98-003C-45A0-9587-119142E39986}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AddIns", "AddIns", "{14A277EE-7DF1-4529-B639-7D1EF334C1C5}"
ProjectSection(SolutionItems) = postProject
EndProjectSection
@ -78,6 +48,36 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StartPage", "AddIns\Misc\St @@ -78,6 +48,36 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StartPage", "AddIns\Misc\St
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AddinScout", "AddIns\Misc\AddinScout\Project\AddinScout.csproj", "{4B8F0F98-8BE1-402B-AA8B-C8D548577B38}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{9421EDF4-9769-4BE9-B5A6-C87DE221D73C}"
ProjectSection(SolutionItems) = postProject
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit.framework.dll", "Tools\NUnit\src\NUnitFramework\framework\nunit.framework.dll.csproj", "{83DD7E12-A705-4DBA-9D71-09C8973D9382}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit.core.dll", "Tools\NUnit\src\NUnitFramework\core\nunit.core.dll.csproj", "{EBD43A7F-AFCA-4281-BB53-5CDD91F966A3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinFormsUI", "Libraries\DockPanel_Src\WinFormsUI\WinFormsUI.csproj", "{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.TextEditor", "Libraries\ICSharpCode.TextEditor\Project\ICSharpCode.TextEditor.csproj", "{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NRefactory", "Libraries\NRefactory\Project\NRefactory.csproj", "{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit.extensions.dll", "Tools\NUnit\src\NUnitFramework\extensions\nunit.extensions.dll.csproj", "{98B10E98-003C-45A0-9587-119142E39986}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Main", "Main", "{5A3EBEBA-0560-41C1-966B-23F7D03A5486}"
ProjectSection(SolutionItems) = postProject
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop.Tests", "Main\Base\Test\ICSharpCode.SharpDevelop.Tests.csproj", "{4980B743-B32F-4aba-AABD-45E2CAD3568D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop", "Main\Base\Project\ICSharpCode.SharpDevelop.csproj", "{2748AD25-9C63-4E12-877B-4DCE96FBED54}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Core", "Main\Core\Project\ICSharpCode.Core.csproj", "{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StartUp", "Main\StartUp\Project\StartUp.csproj", "{1152B71B-3C05-4598-B20D-823B5D40559E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Core.Tests", "Main\Core\Test\ICSharpCode.Core.Tests.csproj", "{AD6FAA08-D6F5-4DBA-AF85-F4DA9F40C3B5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -159,17 +159,6 @@ Global @@ -159,17 +159,6 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{AD6FAA08-D6F5-4DBA-AF85-F4DA9F40C3B5} = {5A3EBEBA-0560-41C1-966B-23F7D03A5486}
{1152B71B-3C05-4598-B20D-823B5D40559E} = {5A3EBEBA-0560-41C1-966B-23F7D03A5486}
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C} = {5A3EBEBA-0560-41C1-966B-23F7D03A5486}
{2748AD25-9C63-4E12-877B-4DCE96FBED54} = {5A3EBEBA-0560-41C1-966B-23F7D03A5486}
{4980B743-B32F-4aba-AABD-45E2CAD3568D} = {5A3EBEBA-0560-41C1-966B-23F7D03A5486}
{98B10E98-003C-45A0-9587-119142E39986} = {9421EDF4-9769-4BE9-B5A6-C87DE221D73C}
{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195} = {9421EDF4-9769-4BE9-B5A6-C87DE221D73C}
{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D} = {9421EDF4-9769-4BE9-B5A6-C87DE221D73C}
{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE} = {9421EDF4-9769-4BE9-B5A6-C87DE221D73C}
{EBD43A7F-AFCA-4281-BB53-5CDD91F966A3} = {9421EDF4-9769-4BE9-B5A6-C87DE221D73C}
{83DD7E12-A705-4DBA-9D71-09C8973D9382} = {9421EDF4-9769-4BE9-B5A6-C87DE221D73C}
{CE5B42B7-6E8C-4385-9E97-F4023FC16BF2} = {14A277EE-7DF1-4529-B639-7D1EF334C1C5}
{FEB825FA-4AD8-425D-8E4A-B5A18EE1B81C} = {14A277EE-7DF1-4529-B639-7D1EF334C1C5}
{4EA396ED-64AD-4AD0-A67A-AB363F3E0C79} = {14A277EE-7DF1-4529-B639-7D1EF334C1C5}
@ -188,5 +177,16 @@ Global @@ -188,5 +177,16 @@ Global
{B08385CD-F0CC-488C-B4F4-EEB34B6D2688} = {6604365C-C702-4C10-9BA8-637F1E3D4D0D}
{1D18D788-F7EE-4585-A23B-34DC8EC63CB8} = {6604365C-C702-4C10-9BA8-637F1E3D4D0D}
{EC06F96A-AEEC-49D6-B03D-AB87C6EB674C} = {6604365C-C702-4C10-9BA8-637F1E3D4D0D}
{98B10E98-003C-45A0-9587-119142E39986} = {9421EDF4-9769-4BE9-B5A6-C87DE221D73C}
{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195} = {9421EDF4-9769-4BE9-B5A6-C87DE221D73C}
{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D} = {9421EDF4-9769-4BE9-B5A6-C87DE221D73C}
{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE} = {9421EDF4-9769-4BE9-B5A6-C87DE221D73C}
{EBD43A7F-AFCA-4281-BB53-5CDD91F966A3} = {9421EDF4-9769-4BE9-B5A6-C87DE221D73C}
{83DD7E12-A705-4DBA-9D71-09C8973D9382} = {9421EDF4-9769-4BE9-B5A6-C87DE221D73C}
{AD6FAA08-D6F5-4DBA-AF85-F4DA9F40C3B5} = {5A3EBEBA-0560-41C1-966B-23F7D03A5486}
{1152B71B-3C05-4598-B20D-823B5D40559E} = {5A3EBEBA-0560-41C1-966B-23F7D03A5486}
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C} = {5A3EBEBA-0560-41C1-966B-23F7D03A5486}
{2748AD25-9C63-4E12-877B-4DCE96FBED54} = {5A3EBEBA-0560-41C1-966B-23F7D03A5486}
{4980B743-B32F-4aba-AABD-45E2CAD3568D} = {5A3EBEBA-0560-41C1-966B-23F7D03A5486}
EndGlobalSection
EndGlobal

Loading…
Cancel
Save