• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Ribbon类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Ribbon的典型用法代码示例。如果您正苦于以下问题:C# Ribbon类的具体用法?C# Ribbon怎么用?C# Ribbon使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Ribbon类属于命名空间,在下文中一共展示了Ribbon类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: BaseRibbonControl

        /// <summary>
        /// BaseRibbonControl ctor
        /// </summary>
        /// <param name="ribbon">parent ribbon</param>
        /// <param name="commandID">command id attached to this control</param>
        protected BaseRibbonControl(Ribbon ribbon, uint commandID)
        {
            _ribbon = ribbon;
            _commandID = commandID;

            ribbon.AddRibbonControl(this);
        }
开发者ID:ldh9451,项目名称:XLE,代码行数:12,代码来源:BaseRibbonControl.cs


示例2: Render

        public override void Render(HtmlTextWriter output, Ribbon ribbon, Item button, CommandContext context)
        {
            var typeName = context.Parameters["type"];
            var viewName = context.Parameters["viewName"];
            var ruleContext = new RuleContext
            {
                Item = context.CustomData as Item
            };
            ruleContext.Parameters["ViewName"] = viewName;

            if (context.Parameters["features"].Contains(HideListViewFeatures.AllExport.ToString()))
            {
                return;
            }
            bool hideNonSpecific =
                context.Parameters["features"].Contains(HideListViewFeatures.NonSpecificExport.ToString());

            foreach (
                Item scriptItem in
                    ModuleManager.GetFeatureRoots(IntegrationPoints.ListViewExportFeature)
                        .SelectMany(parent => parent.Children)
                        .Where(scriptItem => RulesUtils.EvaluateRules(scriptItem["ShowRule"], ruleContext, hideNonSpecific)))
            {
                RenderSmallButton(output, ribbon, Control.GetUniqueID("export"),
                    Translate.Text(scriptItem.DisplayName),
                    scriptItem["__Icon"], string.Empty,
                    string.Format("export:results(scriptDb={0},scriptID={1})", scriptItem.Database.Name,
                        scriptItem.ID),
                    RulesUtils.EvaluateRules(scriptItem["EnableRule"], context.CustomData as Item) &&
                    context.Parameters["ScriptRunning"] == "0",
                    false);
            }
        }
开发者ID:sobek85,项目名称:Console,代码行数:33,代码来源:RibbonExportScriptsPanel.cs


示例3: RibbonOrbAdornerGlyph

 public RibbonOrbAdornerGlyph(BehaviorService behaviorService, RibbonDesigner designer, Ribbon ribbon)
     : base(new RibbonOrbAdornerGlyphBehavior())
 {
     _behaviorService = behaviorService;
     _componentDesigner = designer;
     _ribbon = ribbon;
 }
开发者ID:sduxiaowu,项目名称:NineLineScore,代码行数:7,代码来源:RibbonOrbAdornerGlyph.cs


示例4: RibbonTab

 public RibbonTab(Ribbon ribbon, uint commandId)
     : base(ribbon, commandId)
 {
     AddPropertiesProvider(_keytipPropertiesProvider = new KeytipPropertiesProvider(ribbon, commandId));
     AddPropertiesProvider(_labelPropertiesProvider = new LabelPropertiesProvider(ribbon, commandId));
     AddPropertiesProvider(_tooltipPropertiesProvider = new TooltipPropertiesProvider(ribbon, commandId));
 }
开发者ID:ldh9451,项目名称:XLE,代码行数:7,代码来源:RibbonTab.cs


示例5: Render2

        public void Render2(HtmlTextWriter output, Ribbon ribbon, Item button, CommandContext context)
        {
            Assert.ArgumentNotNull(output, "output");
            Assert.ArgumentNotNull(ribbon, "ribbon");
            Assert.ArgumentNotNull(button, "button");
            Assert.ArgumentNotNull(context, "context");

            var contextDb = context.Parameters["contextDB"];
            var contextItemId = context.Parameters["contextItem"];
            var currentSessionName = context.Parameters["currentSessionName"];
            var contextItem = !string.IsNullOrEmpty(contextDb) && !string.IsNullOrEmpty(contextItemId)
                ? Factory.GetDatabase(contextDb).GetItem(contextItemId)
                : null;

            output.Write("<div class=\"iseRibbonContextPanel {0}\">",
                context.Parameters["ScriptRunning"] == "1" ? "disabled" : string.Empty);
            // timestamp added because Sitecore won't re-send it to browser it if content didn't change - so changing session to the same wouldn't close the dropdowns
            output.Write("<div class=\"scRibbonToolbarSmallButtons scRibbonContextLabels\" timestamp=\"{0}\">",
                DateTime.Now.ToString("O"));
            output.Write("<div class=\"iseRibbonContextPanelLabel\">");
            output.Write(Translate.Text("Context"));
            output.Write("</div>");
            output.Write("<div class=\"iseRibbonContextPanelLabel\">");
            output.Write(Translate.Text("Session"));
            output.Write("</div>");
            output.Write("</div>");
            var contextButton = Factory.GetDatabase("core").GetItem("{C733DE04-FFA2-4DCB-8D18-18EB1CB898A3}");
            var path = contextItem != null ? contextItem.GetProviderPath().EllipsisString(50) : "none";
            var icon = contextItem != null ? contextItem.Appearance.Icon : contextButton.Appearance.Icon;
            RenderSmallGalleryButton(output, contextButton, context, ribbon, path, icon);
            var sessionButton = Factory.GetDatabase("core").GetItem("{0C784F54-2B46-4EE2-B0BA-72384125E123}");
            RenderSmallGalleryButton(output, sessionButton, context, ribbon, currentSessionName, string.Empty);
            output.Write("</div>");
        }
开发者ID:sobek85,项目名称:Console,代码行数:34,代码来源:IsePluginStrip.cs


示例6: Render

        public override void Render(HtmlTextWriter output, Ribbon ribbon, Item button, CommandContext context)
        {
            var typeName = context.Parameters["type"];
            var viewName = context.Parameters["viewName"];
            var ruleContext = new RuleContext
            {
                Item = context.CustomData as Item
            };
            ruleContext.Parameters["ViewName"] = viewName;

            if (!string.IsNullOrEmpty(typeName))
            {
                foreach (
                    Item scriptItem in
                        ModuleManager.GetFeatureRoots(IntegrationPoints.ListViewRibbonFeature)
                            .Select(parent => parent.Paths.GetSubItem(typeName))
                            .Where(scriptLibrary => scriptLibrary != null)
                            .SelectMany(scriptLibrary => scriptLibrary.Children,
                                (scriptLibrary, scriptItem) => new {scriptLibrary, scriptItem})
                            .Where(
                                @t => RulesUtils.EvaluateRules(@t.scriptItem["ShowRule"], ruleContext)
                                )
                            .Select(@t => @t.scriptItem))
                {
                    RenderSmallButton(output, ribbon, Control.GetUniqueID("export"),
                        Translate.Text(scriptItem.DisplayName),
                        scriptItem["__Icon"], string.Empty,
                        string.Format("listview:action(scriptDb={0},scriptID={1})", scriptItem.Database.Name,
                            scriptItem.ID),
                        RulesUtils.EvaluateRules(scriptItem["EnableRule"], ruleContext) &&
                        context.Parameters["ScriptRunning"] == "0",
                        false);
                }
            }
        }
开发者ID:ostat,项目名称:Console,代码行数:35,代码来源:RibbonActionScriptsPanel.cs


示例7: RibbonSplitButton

 public RibbonSplitButton(Ribbon ribbon, uint commandId)
     : base(ribbon, commandId)
 {
     AddPropertiesProvider(_enabledPropertiesProvider = new EnabledPropertiesProvider(ribbon, commandId));
     AddPropertiesProvider(_keytipPropertiesProvider = new KeytipPropertiesProvider(ribbon, commandId));
     AddPropertiesProvider(_tooltipPropertiesProvider = new TooltipPropertiesProvider(ribbon, commandId));
 }
开发者ID:ldh9451,项目名称:XLE,代码行数:7,代码来源:RibbonSplitButton.cs


示例8: Render

        /// <summary>
        /// The render.
        /// </summary>
        /// <param name="output">
        /// The output.
        /// </param>
        /// <param name="ribbon">
        /// The ribbon.
        /// </param>
        /// <param name="button">
        /// The button.
        /// </param>
        /// <param name="context">
        /// The context.
        /// </param>
        public override void Render(System.Web.UI.HtmlTextWriter output, Ribbon ribbon, Item button, CommandContext context)
        {
            Assert.ArgumentNotNull(output, "output");
            Assert.ArgumentNotNull(ribbon, "ribbon");
            Assert.ArgumentNotNull(button, "button");
            Assert.ArgumentNotNull(context, "context");

            if (!Settings.Analytics.Enabled)
            {
                return;
            }
            Item[] items = context.Items;
            if (items.Length != 1)
            {
                return;
            }
            ID clientDeviceId = WebEditUtil.GetClientDeviceId();
            System.Collections.Generic.IEnumerable<RenderingDefinition> testingRenderings;
            if (Context.ClientPage.IsEvent)
            {
                string text = WebEditUtil.ConvertJSONLayoutToXML(WebUtil.GetFormValue("scLayout"));
                if (text == null)
                {
                    return;
                }
                testingRenderings = GetTestingRenderings(LayoutDefinition.Parse(text), clientDeviceId, Client.ContentDatabase);
            }
            else
            {
                Item item = items[0];
                testingRenderings = GetTestingRenderings(item, clientDeviceId);
            }
            output.Write("<div id=\"ComponentsPanelListHolder\" class=\"scRibbonGallery\">");
            output.Write("<div id=\"ComponentsPanelList\" class=\"scRibbonGalleryList\" style=\"width: 310px;\">");
            int num = 0;
            foreach (RenderingDefinition current in testingRenderings)
            {
                output.Write("<div style=\"display:\"block\">");
                this.RenderComponent(output, current, num,context);
                num++;
                output.Write("</div>");
            }
            output.Write("</div>");
            int val = 500;
            int val2 = 350;
            int num2 = 100;
            int num3 = num * num2 + 80;
            num3 = System.Math.Max(System.Math.Min(val, num3), val2);
            int num4 = 116;
            int num5 = 24;
            int num6 = 30;
            int num7 = num6 + num4 * System.Math.Min(num, 3) + num5;
            string click = (num == 0) ? "javascript:void(0);" : "javascript:return scShowComponentsGallery(this, event, 'Gallery.Components', {{height: {0}, width: {1} }}, {{}});".FormatWith(new object[]
            {
                num7,
                num3
            });
            base.RenderPanelButtons(output, "ComponentsPanelList", click);
            output.Write("</div>");
        }
开发者ID:JobiJoba,项目名称:PageAnalyze,代码行数:75,代码来源:ComponentAnalyze.cs


示例9: Ribbon_Should_Be_Able_To_Store_Multiple_Contextual_Groups

 public void Ribbon_Should_Be_Able_To_Store_Multiple_Contextual_Groups()
 {
     var ribbon = new Ribbon("MyRibbon");
     ribbon.With(() => _sut);
     ribbon.With(() => ContextualGroup.Create("2nd"));
     Assert.AreEqual(2,ribbon._contextualGroups.Count);
 }
开发者ID:ThorstenHans,项目名称:FluentSPRibbon,代码行数:7,代码来源:ContextualGroup_Tests.cs


示例10: Render

        public override void Render(HtmlTextWriter output, Ribbon ribbon, Item button, CommandContext context)
        {
            var psButtons = button.GetChildren();
            foreach (Item psButton in psButtons)
            {
                var msg = Message.Parse(this, psButton["Click"]);
                var scriptDb = msg.Arguments["scriptDB"];
                var scriptId = msg.Arguments["script"];

                if (string.IsNullOrWhiteSpace(scriptDb) || string.IsNullOrWhiteSpace(scriptId))
                {
                    continue;
                }

                var scriptItem = Factory.GetDatabase(scriptDb).GetItem(scriptId);
                if (scriptItem == null || !RulesUtils.EvaluateRules(scriptItem["ShowRule"], context.Items[0]))
                {
                    continue;
                }

                RenderLargeButton(output, ribbon, Control.GetUniqueID("script"),
                    Translate.Text(scriptItem.DisplayName),
                    scriptItem["__Icon"], string.Empty,
                    psButton["Click"],
                    RulesUtils.EvaluateRules(scriptItem["EnableRule"], context.Items[0]),
                    false, context);

                return;
            }
        }
开发者ID:GuitarRich,项目名称:Console,代码行数:30,代码来源:ContentEditorRibbonPanel.cs


示例11: RibbonQuickAccessToolbarGlyph

 public RibbonQuickAccessToolbarGlyph(BehaviorService behaviorService, RibbonDesigner designer, Ribbon ribbon)
     : base(new RibbonQuickAccessGlyphBehavior(designer, ribbon))
 {
     _behaviorService = behaviorService;
     _componentDesigner = designer;
     _ribbon = ribbon;
 }
开发者ID:sduxiaowu,项目名称:NineLineScore,代码行数:7,代码来源:RibbonQuickAccessToolbarGlyph.cs


示例12: Id_Should_Be_Composed_If_Parent_Is_Present

 public void Id_Should_Be_Composed_If_Parent_Is_Present()
 {
     var tab = new Tab("Tab2").With(() => _sut);
     var ribbon = new Ribbon("Ribbon3")
         .With(()=>tab);
     Assert.AreEqual("Ribbon3.Tab2.MyGroup", _sut.Id);
 }
开发者ID:ThorstenHans,项目名称:FluentSPRibbon,代码行数:7,代码来源:Group_Tests.cs


示例13: RibbonMouseSensor

 /// <summary>
 /// Creates a new Sensor for specified objects
 /// </summary>
 /// <param name="control">Control to listen mouse events</param>
 /// <param name="ribbon">Ribbon that will be affected</param>
 /// <param name="tabs">Tabs that will be sensed</param>
 /// <param name="panels">Panels that will be sensed</param>
 /// <param name="items">Items that will be sensed</param>
 public RibbonMouseSensor(Control control, Ribbon ribbon, IEnumerable<RibbonTab> tabs, IEnumerable<RibbonPanel> panels, IEnumerable<RibbonItem> items)
     : this(control, ribbon)
 {
     if (tabs != null) Tabs.AddRange(tabs);
     if (panels != null) Panels.AddRange(panels);
     if (items != null) Items.AddRange(items);
 }
开发者ID:sduxiaowu,项目名称:NineLineScore,代码行数:15,代码来源:RibbonMouseSensor.cs


示例14: AutomateTasksDialog

        //*************************************************************************
        //  Constructor: AutomateTasksDialog()
        //
        /// <summary>
        /// Initializes a new instance of the <see cref="AutomateTasksDialog" />
        /// class.
        /// </summary>
        ///
        /// <param name="thisWorkbook">
        /// Workbook containing the graph contents.
        /// </param>
        ///
        /// <param name="ribbon">
        /// The application's Ribbon.
        /// </param>
        //*************************************************************************
        public AutomateTasksDialog(
            ThisWorkbook thisWorkbook,
            Ribbon ribbon
            )
        {
            Debug.Assert(thisWorkbook != null);
            Debug.Assert(ribbon != null);

            m_oAutomateTasksUserSettings = new AutomateTasksUserSettings();
            m_oThisWorkbook = thisWorkbook;
            m_oRibbon = ribbon;

            InitializeComponent();

            // Instantiate an object that saves and retrieves the user settings for
            // this dialog.  Note that the object automatically saves the settings
            // when the form closes.

            m_oAutomateTasksDialogUserSettings =
            new AutomateTasksDialogUserSettings(this);

            DoDataExchange(false);

            AssertValid();
        }
开发者ID:haisreekanth,项目名称:NetMap,代码行数:41,代码来源:AutomateTasksDialog.cs


示例15: TooltipPropertiesProvider

 /// <summary>
 /// TooltipPropertiesProvider ctor
 /// </summary>
 /// <param name="ribbon">parent ribbon</param>
 /// <param name="commandId">ribbon control command id</param>
 public TooltipPropertiesProvider(Ribbon ribbon, uint commandId)
     : base(ribbon, commandId)
 {
     // add supported properties
     _supportedProperties.Add(RibbonProperties.TooltipTitle);
     _supportedProperties.Add(RibbonProperties.TooltipDescription);
 }
开发者ID:ldh9451,项目名称:XLE,代码行数:12,代码来源:TooltipPropertiesProvider.cs


示例16: Render

 public override void Render(HtmlTextWriter output, Ribbon ribbon, Item button, CommandContext context)
 {
     string typeName = context.Parameters["type"];
     if (!string.IsNullOrEmpty(typeName))
     {
         Item scriptLibrary =
             Factory.GetDatabase("master")
                 .GetItem("/sitecore/system/Modules/PowerShell/Script Library/Internal/List View/Ribbon/"+typeName);
         if (scriptLibrary != null)
         {
             foreach (Item scriptItem in scriptLibrary.Children)
             {
                 if (!EvaluateRules(scriptItem["ShowRule"], context.CustomData as Item))
                 {
                     continue;
                 }
                 RenderSmallButton(output, ribbon, Control.GetUniqueID("export"),
                     Translate.Text(scriptItem.DisplayName),
                     scriptItem["__Icon"], string.Empty,
                     string.Format("listview:action(scriptDb={0},scriptID={1})", scriptItem.Database.Name,
                         scriptItem.ID),
                     EvaluateRules(scriptItem["EnableRule"], context.CustomData as Item), false);
             }
         }
     }
 }
开发者ID:scjunkie,项目名称:Console,代码行数:26,代码来源:RibbonActionScriptsPanel.cs


示例17: Render

        public override void Render(HtmlTextWriter output, Ribbon ribbon, Item button, CommandContext context)
        {
            var contextChunks = context.CustomData as List<Item>;
            if (contextChunks != null)
            {
                var chunk = contextChunks[0];
                contextChunks.RemoveAt(0);
                var psButtons = chunk.Children;
                var contextItem = context.Items.Length > 0 ? context.Items[0] : null;

                var ruleContext = new RuleContext
                {
                    Item = contextItem
                };
                foreach (var parameter in context.Parameters.AllKeys)
                {
                    ruleContext.Parameters[parameter] = context.Parameters[parameter];
                }

                foreach (Item psButton in psButtons)
                {
                    if (!RulesUtils.EvaluateRules(psButton["ShowRule"], ruleContext))
                    {
                        continue;
                    }

                    RenderLargeButton(output, ribbon, Control.GetUniqueID("script"),
                        Translate.Text(psButton.DisplayName),
                        psButton["__Icon"], string.Empty,
                        $"ise:runplugin(scriptDb={psButton.Database.Name},scriptId={psButton.ID})",
                        context.Parameters["ScriptRunning"] == "0" && RulesUtils.EvaluateRules(psButton["EnableRule"], ruleContext),
                        false, context);
                }
            }
        }
开发者ID:GuitarRich,项目名称:Console,代码行数:35,代码来源:IsePluginPanel.cs


示例18: RibbonMenuGroup

 public RibbonMenuGroup(Ribbon ribbon, uint commandId)
     : base(ribbon, commandId)
 {
     AddPropertiesProvider(_enabledPropertiesProvider = new EnabledPropertiesProvider(ribbon, commandId));
     AddPropertiesProvider(_keytipPropertiesProvider = new KeytipPropertiesProvider(ribbon, commandId));
     AddPropertiesProvider(_labelPropertiesProvider = new LabelPropertiesProvider(ribbon, commandId));
     AddPropertiesProvider(_tooltipPropertiesProvider = new TooltipPropertiesProvider(ribbon, commandId));
 }
开发者ID:ldh9451,项目名称:XLE,代码行数:8,代码来源:RibbonMenuGroup.cs


示例19: RibbonTabGlyph

 public RibbonTabGlyph(BehaviorService behaviorService, RibbonDesigner designer, Ribbon ribbon)
     : base(new RibbonTabGlyphBehavior(designer, ribbon))
 {
     _behaviorService = behaviorService;
     _componentDesigner = designer;
     _ribbon = ribbon;
     size = new Size(60, 16);
 }
开发者ID:sduxiaowu,项目名称:NineLineScore,代码行数:8,代码来源:RibbonTabGlyph.cs


示例20: LoginForm

 public LoginForm(string url, Ribbon _parent, bool login)
 {
     InitializeComponent();
     parent = _parent;
     _login = login;
     webBrowser1.Navigated += webBrowser1_Navigated;
     webBrowser1.Url = new Uri(url, UriKind.Absolute);
 }
开发者ID:ly2314,项目名称:PowerPointFacebookAPI,代码行数:8,代码来源:LoginForm.cs



注:本文中的Ribbon类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# RibbonControlEventArgs类代码示例发布时间:2022-05-24
下一篇:
C# RiakObject类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap