Browse Source

Hide EntityDeclaration.Name/NameToken via EditorBrowsableAttribute when they aren't usable in a derived class. (#117)

newNRvisualizers
Daniel Grunwald 13 years ago committed by wiki-import
parent
commit
fb7561e6dc
  1. 17
      ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/EventDeclaration.cs
  2. 16
      ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/FieldDeclaration.cs
  3. 2
      ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/IndexerDeclaration.cs
  4. 2
      ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/OperatorDeclaration.cs

17
ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/EventDeclaration.cs

@ -24,7 +24,10 @@ @@ -24,7 +24,10 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using ICSharpCode.NRefactory.TypeSystem;
namespace ICSharpCode.NRefactory.CSharp
@ -41,6 +44,20 @@ namespace ICSharpCode.NRefactory.CSharp @@ -41,6 +44,20 @@ namespace ICSharpCode.NRefactory.CSharp
get { return GetChildrenByRole (Roles.Variable); }
}
// Hide .Name and .NameToken from users; the actual field names
// are stored in the VariableInitializer.
[EditorBrowsable(EditorBrowsableState.Never)]
public override string Name {
get { return string.Empty; }
set { throw new NotSupportedException(); }
}
[EditorBrowsable(EditorBrowsableState.Never)]
public override Identifier NameToken {
get { return Identifier.Null; }
set { throw new NotSupportedException(); }
}
public override void AcceptVisitor (IAstVisitor visitor)
{
visitor.VisitEventDeclaration (this);

16
ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/FieldDeclaration.cs

@ -24,6 +24,8 @@ @@ -24,6 +24,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using System.ComponentModel;
using ICSharpCode.NRefactory.TypeSystem;
namespace ICSharpCode.NRefactory.CSharp
@ -38,6 +40,20 @@ namespace ICSharpCode.NRefactory.CSharp @@ -38,6 +40,20 @@ namespace ICSharpCode.NRefactory.CSharp
get { return GetChildrenByRole (Roles.Variable); }
}
// Hide .Name and .NameToken from users; the actual field names
// are stored in the VariableInitializer.
[EditorBrowsable(EditorBrowsableState.Never)]
public override string Name {
get { return string.Empty; }
set { throw new NotSupportedException(); }
}
[EditorBrowsable(EditorBrowsableState.Never)]
public override Identifier NameToken {
get { return Identifier.Null; }
set { throw new NotSupportedException(); }
}
public override void AcceptVisitor (IAstVisitor visitor)
{
visitor.VisitFieldDeclaration (this);

2
ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/IndexerDeclaration.cs

@ -25,6 +25,7 @@ @@ -25,6 +25,7 @@
// THE SOFTWARE.
using System;
using System.ComponentModel;
using ICSharpCode.NRefactory.TypeSystem;
namespace ICSharpCode.NRefactory.CSharp
@ -53,6 +54,7 @@ namespace ICSharpCode.NRefactory.CSharp @@ -53,6 +54,7 @@ namespace ICSharpCode.NRefactory.CSharp
set { throw new NotSupportedException(); }
}
[EditorBrowsable(EditorBrowsableState.Never)]
public override Identifier NameToken {
get { return Identifier.Null; }
set { throw new NotSupportedException(); }

2
ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/OperatorDeclaration.cs

@ -25,6 +25,7 @@ @@ -25,6 +25,7 @@
// THE SOFTWARE.
using System;
using System.ComponentModel;
using ICSharpCode.NRefactory.TypeSystem;
namespace ICSharpCode.NRefactory.CSharp
@ -250,6 +251,7 @@ namespace ICSharpCode.NRefactory.CSharp @@ -250,6 +251,7 @@ namespace ICSharpCode.NRefactory.CSharp
set { throw new NotSupportedException(); }
}
[EditorBrowsable(EditorBrowsableState.Never)]
public override Identifier NameToken {
get { return Identifier.Null; }
set { throw new NotSupportedException(); }

Loading…
Cancel
Save