public TweakerObjectInfo(string name, uint instanceId = 0u, ICustomTweakerAttribute[] customAttributes = null, string description = "") { Name = name; Description = description; InstanceId = instanceId; if (customAttributes == null) { customAttributes = new ICustomTweakerAttribute[0]; } CustomAttributes = customAttributes; }
public TAttribute GetCustomAttribute <TAttribute>() where TAttribute : Attribute, ICustomTweakerAttribute { for (int i = 0; i < CustomAttributes.Length; i++) { ICustomTweakerAttribute customTweakerAttribute = CustomAttributes[i]; if (typeof(TAttribute) == customTweakerAttribute.GetType()) { return(customTweakerAttribute as TAttribute); } } return(null); }