static bool RegisterParameter(string groupPath, string name, FieldInfo field, PropertyInfo property) { Trace.Assert(field != null || property != null); foreach (Parameter parameter in parameters) { if (parameter.GroupPath == groupPath && parameter.Field == field && parameter.Property == property) { //Log.Error( "Config: Parameter already registered \"{0}\"", groupPath + "\\" + field.Name ); return(false); } } Parameter p = new Parameter(groupPath, name, field, property); parameters.Add(p); if (textBlock != null) { p.Load(textBlock); } RegisterConfigParameter?.Invoke(/*this, */ p); if (EngineApp.Instance != null) { EngineApp.PerformRegisterConfigParameter(p); } return(true); }