GetDefaultIndexer() static private method

static private GetDefaultIndexer ( Type type, string memberInfo ) : PropertyInfo
type System.Type
memberInfo string
return System.Reflection.PropertyInfo
Example #1
0
        private string WriteDefaultIndexerInit(Type type, string escapedName, bool collectionUseReflection, bool elementUseReflection)
        {
            string       s = this.GenerateVariableName("item", escapedName);
            PropertyInfo defaultIndexer = TypeScope.GetDefaultIndexer(type, null);

            this.writer.Write("static XSArrayInfo ");
            this.writer.Write(s);
            this.writer.Write("= new XSArrayInfo(");
            this.writer.Write(this.GetStringForTypeof(CodeIdentifier.GetCSharpName(type), collectionUseReflection));
            this.writer.Write(".GetProperty(");
            this.WriteQuotedCSharpString(defaultIndexer.Name);
            this.writer.Write(",");
            this.writer.Write(this.GetStringForTypeof(CodeIdentifier.GetCSharpName(defaultIndexer.PropertyType), elementUseReflection));
            this.writer.Write(",new ");
            this.writer.Write(typeof(Type[]).FullName);
            this.writer.WriteLine("{typeof(int)}));");
            this.reflectionVariables.Add("0:" + escapedName, s);
            return(s);
        }