/// <summary> /// Returns object array of all accessible and modifiable properties and fields. /// </summary> /// <param name="type"><see cref="eGetInfoType"/> enum value /// that tells what objects type should be returned.</param> /// <returns>Array of strings.</returns> public override object[] GetAccessibles(eGetInfoType type) { var list = new List <object>(); foreach (var property in this.GetType().GetProperties()) { if (type == eGetInfoType.PROPERTY_NAMES) { list.Add(property.Name); } else if (type == eGetInfoType.PROPERTY_INFOS) { list.Add(property); } } return(list.ToArray()); }
/// <summary> /// Returns array of all accessible and modifiable properties and fields. /// </summary> /// <returns>Array of strings.</returns> public override object[] GetAccessibles(eGetInfoType type) { var list = new List <object>(); foreach (var property in this.GetType().GetProperties()) { if (Attribute.IsDefined(property, typeof(AccessModifiableAttribute))) { if (type == eGetInfoType.PROPERTY_NAMES) { list.Add(property.Name); } else { list.Add(property); } } } return(list.ToArray()); }
public virtual object[] GetSubnodeAttribs(string NodeName, eGetInfoType type) { var property = this.GetType().GetProperty(NodeName); if (property == null) { return(null); } var result = new List <object>(); foreach (var field in property.PropertyType.GetProperties()) { if (type == eGetInfoType.PROPERTY_NAMES) { result.Add(field.Name); } else { result.Add(field); } } return(result.ToArray()); }
public abstract object[] GetAccessibles(eGetInfoType type);