private Jewel BuildJewelInternal(object data, JewelBuildContext jbc) { if (CUIUtility.IsNullOrUndefined(data)) { throw new ArgumentNullException("No Jewel element was present in the data"); } Jewel = new Jewel(DataNodeWrapper.GetAttribute(data, "Id"), DataNodeWrapper.GetNodeAttributes(data).To <JewelProperties>()); // Handle the Jewel Menu Launcher control JewelMenuLauncher jml = BuildJewelMenuLauncher(data, jbc); Jewel.AddChild(jml.CreateComponentForDisplayMode("Default")); Jewel.JewelMenuLauncher = jml; return(Jewel); }
private JewelMenuLauncher BuildJewelMenuLauncher(object data, JewelBuildContext jbc) { JewelMenuLauncherProperties properties = DataNodeWrapper.GetNodeAttributes(data).To <JewelMenuLauncherProperties>(); JSObject[] children = DataNodeWrapper.GetNodeChildren(data); Menu menu = null; MenuLauncherControlProperties launcherProperties = DataNodeWrapper.GetNodeAttributes(data).To <MenuLauncherControlProperties>(); if (!Utility.IsTrue(launcherProperties.PopulateDynamically)) { menu = BuildMenu(children[0], jbc, false); } JewelMenuLauncher jml = new JewelMenuLauncher(Jewel, properties.Id, properties, menu); return(jml); }