/// <summary> /// Creates a native indexer. /// </summary> /// <param name="property"></param> public NativeIndexer(PropertyInfo property) { this.property = property; if (property.Name != "Item") { throw new InvalidOperationException("This property is not an index accessor!"); } FormalParameters = property.GetIndexParameters().Select(p => p.ParameterType).ToArray(); if (!FormalParameters.Any()) { throw new InvalidOperationException("This index accessor has no parameters!"); } ReturnType = property.PropertyType; }