本文整理汇总了C#中Ribbon.RenderSmallButton方法的典型用法代码示例。如果您正苦于以下问题:C# Ribbon.RenderSmallButton方法的具体用法?C# Ribbon.RenderSmallButton怎么用?C# Ribbon.RenderSmallButton使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ribbon
的用法示例。
在下文中一共展示了Ribbon.RenderSmallButton方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderSmallGalleryButton
private static void RenderSmallGalleryButton(HtmlTextWriter output, Item button, CommandContext commandContext,
Ribbon ribbon, string title, string overrideIcon, NameValueCollection parameters)
{
Assert.ArgumentNotNull(output, "output");
Assert.ArgumentNotNull(button, "button");
var enabled = CommandState.Enabled;
var fieldValue = GetFieldValue(button, "Header");
var icon = string.IsNullOrEmpty(overrideIcon) ? GetFieldValue(button, "Icon") : overrideIcon;
var click = GetFieldValue(button, "Command");
var str4 = GetFieldValue(button, "ID");
var keyCode = GetFieldValue(button, "KeyCode");
var str6 = GetFieldValue(button, "Access Key");
var str7 = GetFieldValue(button, "Tooltip");
if (click.Length > 0)
{
var command = CommandManager.GetCommand(GetClick(click));
if (command != null)
{
fieldValue = command.GetHeader(commandContext, fieldValue);
icon = command.GetIcon(commandContext, icon);
click = command.GetClick(commandContext, click);
enabled = CommandManager.QueryState(command, commandContext);
}
}
if (enabled == CommandState.Hidden)
{
return;
}
var itemArray = (commandContext == null) ? new Item[0] : commandContext.Items;
var item = (itemArray.Length > 0) ? itemArray[0] : null;
var itemUrl = GetItemUrl(item, (commandContext != null) ? commandContext.Parameters : null);
var smallButton = new SmallGalleryButton
{
ID = "B" + button.ID.ToShortID()
};
itemUrl.Parameters["id"] = smallButton.ID;
if (str4.Length > 0)
{
smallButton.ID = str4;
}
click = GetClick(click, commandContext);
var width = GetFieldValue(button, "Gallery Width");
var height = GetFieldValue(button, "Gallery Height");
GalleryManager.GetGallerySize(smallButton.ID + "_frame", ref width, ref height);
smallButton.Header = string.IsNullOrEmpty(title) ? fieldValue : title;
smallButton.Icon = icon;
smallButton.Command = click;
smallButton.Gallery = GetFieldValue(button, "Gallery");
smallButton.GalleryHeight = height;
smallButton.GalleryWidth = width;
smallButton.GalleryUrl = itemUrl.ToString();
smallButton.Enabled = enabled != CommandState.Disabled;
smallButton.AccessKey = str6;
smallButton.ToolTip = str7;
smallButton.KeyCode = keyCode;
ribbon.RenderSmallButton(output, smallButton);
if (enabled != CommandState.Disabled)
{
Context.ClientPage.RegisterKey(keyCode, click, ribbon.ID);
}
}