ICSharpCode.NRefactory.MonoCSharp.TypeDefinition.ComputeIndexerName C# (CSharp) Method

ComputeIndexerName() public method

public ComputeIndexerName ( ) : void
return void
		void ComputeIndexerName ()
		{
			var indexers = MemberCache.FindMembers (spec, MemberCache.IndexerNameAlias, true);
			if (indexers == null)
				return;

			string class_indexer_name = null;

			//
			// Check normal indexers for consistent name, explicit interface implementation
			// indexers are ignored
			//
			foreach (var indexer in indexers) {
				//
				// FindMembers can return unfiltered full hierarchy names
				//
				if (indexer.DeclaringType != spec)
					continue;

				has_normal_indexers = true;

				if (class_indexer_name == null) {
					indexer_name = class_indexer_name = indexer.Name;
					continue;
				}

				if (indexer.Name != class_indexer_name)
					Report.Error (668, ((Indexer)indexer.MemberDefinition).Location,
						"Two indexers have different names; the IndexerName attribute must be used with the same name on every indexer within a type");
			}
		}