/// <summary> /// Register a type that can be referenced in a template during the rendering process. /// </summary> /// <param name="type"></param> /// <remarks> /// The [LavaVisible] and [LavaHidden] custom attributes can be applied to determine the visibility of individual properties. /// If these attributes are not applied to any members of the type, all members are visible by default. /// </remarks> public static void RegisterSafeType(Type type) { if (_engine == null) { return; } _engine.RegisterSafeType(type); }
/// <summary> /// For each of the currently enabled Lava Engines, register a safe type. /// </summary> /// <param name="type"></param> public void RegisterSafeType(Type type) { if (DotLiquidEngineIsEnabled) { _dotliquidEngine.RegisterSafeType(type); } if (FluidEngineIsEnabled) { _fluidEngine.RegisterSafeType(type); } }
/// <summary> /// Initializes the lava safe types on the engine. This takes care /// of special types that we don't have direct access to so we can't /// add the proper interfaces to them. /// </summary> /// <param name="engine">The engine.</param> private static void InitializeLavaSafeTypes(ILavaEngine engine) { engine.RegisterSafeType(typeof(Common.Mobile.DeviceData)); }