Example #1
0
        private void RegisterCommands(Page page, RibbonCommandRepository commands)
        {
            page.ClientScript.RegisterClientScriptBlock(
                page.GetType(),
                "FluentRibbonCommands",
                ScriptHelper.GetCommandsScript(commands.GetCommands()));

            page.ClientScript.RegisterClientScriptBlock(
                page.GetType(),
                "InitPageComponent",
                ScriptHelper.GetPageComponentScript("FluentRibbon"));

            commands.ClearCommands();
        }
Example #2
0
        private string GetCommandsXML(RibbonDefinition definition)
        {
            var commands = new RibbonCommandRepository();

            commands.AddCommands(definition);
            string commandsXML = String.Empty;

            foreach (var command in commands.GetCommands())
            {
                commandsXML += XmlGenerator.Current.GetCommandUIHandlerXML(command);
            }

            return("<root>" + commandsXML + "</root>");
        }