public IEnumerable <IProperty> GetProperties(MemberAccessTypes access) { ReadOnlyCollection <IProperty> readOnlyCollection1; if (this.designPropertySets.TryGetValue(access, out readOnlyCollection1)) { return((IEnumerable <IProperty>)readOnlyCollection1); } IEnumerable <IProperty> properties = this.designType.GetProperties(access); List <IProperty> list = new List <IProperty>(); foreach (IProperty property in properties) { ReferenceStep actualReferenceStep = property as ReferenceStep; if (actualReferenceStep != null) { TypeReflectingProjectContext.DesignTypeProperty createDesignProperty = this.GetOrCreateDesignProperty(actualReferenceStep); list.Add((IProperty)createDesignProperty); } } ReadOnlyCollection <IProperty> readOnlyCollection2 = new ReadOnlyCollection <IProperty>((IList <IProperty>)list); this.designPropertySets[access] = readOnlyCollection2; return((IEnumerable <IProperty>)readOnlyCollection2); }
private TypeReflectingProjectContext.DesignTypeProperty GetOrCreateDesignProperty(ReferenceStep actualReferenceStep) { TypeReflectingProjectContext.DesignTypeProperty designTypeProperty; if (!this.designProperties.TryGetValue(actualReferenceStep, out designTypeProperty)) { IType type = this.resolver.GetType(actualReferenceStep.PropertyType.RuntimeType); designTypeProperty = new TypeReflectingProjectContext.DesignTypeProperty(actualReferenceStep, this, type); this.designProperties[actualReferenceStep] = designTypeProperty; } return(designTypeProperty); }