/// <summary> /// Checks to see if the passed in item has presentation settings for the provided device and sublayout. /// </summary> /// <param name = "theItem">The item.</param> /// <param name = "device">The device.</param> /// <param name = "sublayoutItem">The sublayout item.</param> /// <returns>True if the item contains the device and sublayout in it's presentation settings, false otherwise.</returns> public static bool ItemHasPresentationSettingsForSublayout(Item theItem, DeviceItem device, SublayoutItem sublayoutItem) { if (theItem == null || device == null || sublayoutItem == null) { return(false); } //If the item does not contain settings for the passed in device do not bother with the // rest of the check. if (!ItemHasPresentationSettingsForDevice(theItem, device)) { return(false); } //Try and get the device definition from the layout definition DeviceDefinition deviceDef = GetDeviceDefinition(theItem, device); if (deviceDef == null) { return(false); } //Try and get the rendering for the passed in display item RenderingDefinition rendering = deviceDef.GetRendering(sublayoutItem.ID.ToString()); return(!(rendering == null)); }
/// <summary> /// Checks to see if the passed in item has presentation settings for the provided device and sublayout. /// </summary> /// <param name = "theItem">The item.</param> /// <param name = "device">The device.</param> /// <param name = "sublayoutItem">The sublayout item.</param> /// <returns>True if the item contains the device and sublayout in it's presentation settings, false otherwise.</returns> public static bool ItemHasPresentationSettingsForSublayout(Item theItem, DeviceItem device, SublayoutItem sublayoutItem) { if (theItem == null || device == null || sublayoutItem == null) return false; //If the item does not contain settings for the passed in device do not bother with the // rest of the check. if (!ItemHasPresentationSettingsForDevice(theItem, device)) return false; //Try and get the device definition from the layout definition DeviceDefinition deviceDef = GetDeviceDefinition(theItem, device); if (deviceDef == null) return false; //Try and get the rendering for the passed in display item RenderingDefinition rendering = deviceDef.GetRendering(sublayoutItem.ID.ToString()); return !(rendering == null); }