Returns an array of all the parameters for the property.
[Visual Basic] MustOverride Public Function GetIndexParameters() As ParameterInfo () [C#] public abstract ParameterInfo[] GetIndexParameters(); [C++] public: virtual ParameterInfo* GetIndexParameters() [] = 0; [JScript] public abstract function GetIndexParameters() : ParameterInfo[];
Returns a ParameterInfo array containing the parameters for the indexes.
Extract any required parameter information from the returned array.
To use the GetIndexParameters method, first get the class Type. From the Type, get the PropertyInfo. From the PropertyInfo, use the GetIndexParameters method.
[C#]
//Make a property public class Myproperty { private string caption = "A Default caption"; public string Caption{ get{return caption;} set {if(caption!=value) {caption = value;} } } } class Mypropertyinfo { public static int Main() { Console.WriteLine ("\nReflection.PropertyInfo"); //Get the type and PropertyInfo Type MyType = Type.GetType("Myproperty"); PropertyInfo Mypropertyinfo = MyType.GetProperty("Caption"); //Get the public GetIndexParameters Method ParameterInfo[] Myparameterinfoarray = Mypropertyinfo.GetIndexParameters(); Console.Write ("\n" + MyType.FullName + "." + Mypropertyinfo.Name + " has " + Myparameterinfoarray.Count + " parameters"); return 0; } } Produces the following output Reflection.PropertyInfo Myproperty.Caption has 0 parameters
PropertyInfo Class | PropertyInfo Members | System.Reflection Namespace