zoukankan      html  css  js  c++  java
  • LinksPersistInfo not work!

    from:http://www1.devexpress.com/Support/Center/p/DB26046.aspx

    This code works only when called from within InitializeComponent() method. If it is invoked later it won't add anything visually (skinItm is BarSubItem placed on an XtraBar).

    BarButtonItem tubo = new DevExpress.XtraBars.BarButtonItem();

    tubo.Caption = "XXX";

    tubo.Name = "Meho";

    barManager.Items.Add(tubo);

    skinItm.LinksPersistInfo.Add(new LinkPersistInfo(tubo));
    <-     Reviewed by DevExpress Team         2006/8/9 5:50:52
    <-     Processed (By Design) by DevExpress Team         2006/8/9 10:14:06

    Please modify your code as shown below.

    Old code:

    [C#]
    skinItm.LinksPersistInfo.Add(new LinkPersistInfo(tubo));

    New code:

    [C#]
    skinItm.ItemLinks.Add(tubo);

    We also advise that you review the AddBarItemLinks tutorial project shipped with the XtraBars.

    Thank you,
    Nick
    ->     Reactivated by Miha Markic         2006/8/9 10:19:19

    Ok, thanks.
    A note here: my old code (bad or good) was working in 6.1.x and it doesn't work anymore so it could be considered as a breaking change and thus the change could be documented in what's new section.
    <-     Processed (By Design) by DevExpress Team         2006/8/9 12:51:37

    Please try to surround your old code with the BarManager.BeginInit / BarManager.EndInit method similar to the code in the InitializeComponent method. The problem should disappear.

    Thank you,
    Nick
    ->     Reactivated by Miha Markic         2006/8/9 12:56:47

    Hi Nick. Sure, I have no problems now and I will happily embrace the proper way via ItemLinks. I was just commenting that it might be good thing to leave a note in what's new section to avoid other people having the same problem.
    <-     Processed (By Design) by DevExpress Team         2006/8/10 19:03:29

    Hi Miha,

    A true developer doesn't need any documentation; source code (or .NET Reflector) is enough :-) So why does one worry about a "What's New"? ;-)

    The XtraBars' documentation suggests using either ItemLinks.Add or AddLink method to add menu items programmatically. Here is the quote from the documentation in regard to the LinksPersistInfo property:

    This member supports the .NET Framework infrastructure and cannot be used directly from your code.
    http://documentation.devexpress.com/#WindowsForms/DevExpressXtraBarsBarLinksPersistInfotopic

    I personally don't see any reason for including a similar note into the What's New document.

    Thank you,
    Nick

    P.S.
    Miha, just between you and me :-), you can use the LinksPersistInfo.Add method, if you want the added item links to persist after the end-user resets a toolbar (Quick Customize | Reset Toolbar). Please don't forget to wrap the LinksPersistInfo.Add calls with BeginInit/EndInit as suggested above. But please keep this in secret, since it is an undocumented feature and for me it might be difficult to support it if anyone starts using it. :-)

    N.

  • 相关阅读:
    【Mocha.js 101】Mocha 入门指南
    CSS 中 Font-Family 中英文对照表
    Android Studio中找出不再使用的资源
    Java反射机制实战——字段篇
    python进阶——day02、03面向对象进阶
    python进阶_day01面对对象编程基础
    day05(文件配置命令和远程登录)
    day04(磁盘管理与目录介绍)
    day03(系统启动及常用的Linux命令的基本使用)
    day02(操作系统简介和Linux的安装与常用命令简介)
  • 原文地址:https://www.cnblogs.com/luoyaoquan/p/2111684.html
Copyright © 2011-2022 走看看