Example #1
0
        /// <summary>
        /// 根据XML对象设置当前元素的属性值
        /// </summary>
        /// <param name="element"></param>
        public override bool InitProperties(XElement element, IBundle bundle)
        {
            bool success = false;

            // 获取页签的唯一标识
            this.Id = element.AttibuteStringValue("id");
            if (string.IsNullOrEmpty(this.Id))
            {
                return(success);
            }
            // 获取图片库
            this.ImageMso = element.AttibuteStringValue("imageMso");
            // 获取用户自定义图片
            this.IconName = element.AttibuteStringValue("iconName");
            // 获取用户自定义图片加载类型
            this.LoadMode = element.AttributeEnumValue <ResourceLoadMode>("loadMode", ResourceLoadMode.Local);
            // 加载用户图片资源
            if (string.IsNullOrEmpty(this.ImageMso) &&
                !string.IsNullOrEmpty(this.IconName))
            {
                this.Image = RibbonUtils.LoadImage(this.IconName, this.LoadMode, bundle);
            }
            // 获取页签名列类型
            string className = element.AttibuteStringValue("type");

            if (string.IsNullOrEmpty(className))
            {
                return(success);
            }
            // 创建页签的命令类型
            this.command = RibbonUtils.NewInstance <RibbonMenuCommand>(className, bundle);
            if (this.command == null)
            {
                return(success);
            }
            this.command.XRibbonElement = this;

            return(true);
        }
        protected override void OnInitCustomRibbonMenuCommands(RibbonMenuCommandCollection cmds)
        {
            base.OnInitCustomRibbonMenuCommands(cmds);

            var cmd = new RibbonMenuCommand("导出授权文件", OnExportActivationResponse, OnCanExportActivationResponse)
            {
                LargeGlyph = SAF.Framework.Properties.Resources.Action_Export_32x32
            };
            cmds.Add(cmd);
        }
Example #3
0
        protected override void OnInitCustomRibbonMenuCommands(RibbonMenuCommandCollection customRibbonMenuCommands)
        {
            base.OnInitCustomRibbonMenuCommands(customRibbonMenuCommands);

            var cmd = new RibbonMenuCommand("刷新\n菜单参数", OnRefreshMenuParam, OnCanRefreshMenuParam)
            {
                LargeGlyph = SAF.Framework.Properties.Resources.Action_Refresh_32x32
            };
            customRibbonMenuCommands.Add(cmd);
        }
Example #4
0
 protected override void OnInitCustomRibbonMenuCommands(RibbonMenuCommandCollection customRibbonMenuCommands)
 {
     base.OnInitCustomRibbonMenuCommands(customRibbonMenuCommands);
     var cmd = new RibbonMenuCommand("重置密码", ResetPassword, ResetPassowrdCanExceute)
     {
         LargeGlyph = Properties.Resources.Action_ResetPassword_32x32
     };
     customRibbonMenuCommands.Add(cmd);
 }