BranchPresets.LayoutHelper.ApplyActionToAllFinalRenderings C# (CSharp) Method

ApplyActionToAllFinalRenderings() public static method

Helper method that loops over all Final renderings in all devices attached to an item and invokes a function on each of them. The function may request the deletion of the item by returning a specific enum value.
public static ApplyActionToAllFinalRenderings ( System.Item item, RenderingActionResult>.Func action ) : void
item System.Item
action RenderingActionResult>.Func
return void
		public static void ApplyActionToAllFinalRenderings(Item item, Func<RenderingDefinition, RenderingActionResult> action)
		{
			// NOTE: when dealing with layouts its important to get and set the field value with LayoutField.Get/SetFieldValue()
			// if you fail to do this you will not process layout deltas correctly and may instead override all fields (breaking full inheritance), 
			// or attempt to get the layout definition for a delta value, which will result in your wiping the layout details when they get saved.

			ApplyActionToAllRenderings(item, FieldIDs.FinalLayoutField, action);
		}