/// <summary> Returns the IAnswerData preload value for the given preload type and parameters /// /// </summary> /// <param name="preloadType">The type of the preload to be returned /// </param> /// <param name="preloadParams">Parameters for the preload handler /// </param> /// <returns> An IAnswerData corresponding to a pre-loaded value for the given /// Arguments. null if no preload could successfully be derived due to either /// the lack of a handler, or to invalid parameters /// </returns> public virtual IAnswerData getQuestionPreload(System.String preloadType, System.String preloadParams) { IPreloadHandler handler = (IPreloadHandler)preloadHandlers.get(preloadType); if (handler != null) { return(handler.handlePreload(preloadParams)); } else { System.Console.Error.WriteLine("Do not know how to handle preloader [" + preloadType + "]"); return(null); } }
public virtual bool questionPostProcess(TreeElement node, System.String preloadType, System.String params_Renamed) { IPreloadHandler handler = (IPreloadHandler)preloadHandlers.get(preloadType); if (handler != null) { return(handler.handlePostProcess(node, params_Renamed)); } else { System.Console.Error.WriteLine("Do not know how to handle preloader [" + preloadType + "]"); return(false); } }
/// <summary> Adds a new preload handler to this preloader. /// /// </summary> /// <param name="handler">an IPreloadHandler that can handle a preload type /// </param> public virtual void addPreloadHandler(IPreloadHandler handler) { preloadHandlers.put(handler.preloadHandled(), handler); }