/// <summary> /// Get a producer rule for a given producer name and input. /// </summary> /// <param name="producerName">Name of the producer</param> /// <param name="input">Input object of a rule</param> /// <returns>The producer config</returns> public static ProducerRule GetProducerItem(string producerName, Object input) { ProducerRule value; if (input == null) { RulesRepository.TryGetValue(new Tuple <string, object>(producerName, null), out value); } else { RulesRepository.TryGetValue(new Tuple <string, object>(producerName, input.ParentSheetIndex), out value); if (value == null) { foreach (string tag in input.GetContextTagList()) { if (RulesRepository.TryGetValue(new Tuple <string, object>(producerName, tag), out value)) { break; } } } if (value == null) { RulesRepository.TryGetValue(new Tuple <string, object>(producerName, input.Category), out value); } } return(value); }
public static void DumpObject(string sName, SDVObject oObject) { if (oObject == null) { LogTrace("SDVObject " + sName, " is null"); } else { LogTrace("SDVObject " + sName, "Dump"); DumpObject(" Type", oObject.GetType().Name); DumpObject(" name", oObject.Name); DumpObject(" displayname", oObject.DisplayName); DumpObject(" category", oObject.category.Value); DumpObject(" parentindex", oObject.parentSheetIndex.Value); DumpObject(" description", oObject.getDescription()); DumpObject(" contexttags value", oObject.GetContextTagList()); DumpObject(" parentSheetIndex", oObject.parentSheetIndex.Value); DumpObject(" heldObject", oObject.heldObject.Value == null ? "Nothing" : oObject.heldObject.Value.displayName ?? oObject.heldObject.Value.name); DumpObject(" preservedParentSheetIndex", oObject.preservedParentSheetIndex); } }