本文介绍了将 ASDoc 与 Bindable metatag 和 mxml 结合使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 ASDoc 创建 flex 项目的文档,但在可绑定元标记方面存在一些问题.

I am creating the documentation of my flex project using ASDoc and having some issues with the bindable metatag.

  • ASDoc 不记录 public Bindable 值,除非 Bindable 标签具有与之关联的事件名称.

例如:

//This is documented correctly
[Bindable("someEvent")]
/*
* public bindable with event name
* */
public var test1:String;

//This is not documented at all
[Bindable]
/*
* public bindable without event name
* */
public var test2:String;  

  • ASDoc 将随机字符串添加到 protected Bindable 值的名称前,如果可绑定标签没有与之关联的事件名称.
  • 例如:

    //This is documented correctly as test3  
    [Bindable("someEvent")]  
    /*  
    * protected bindable with event name  
    * */  
    protected var test3:String;  
    
    //But this is documented as _110251490test4  
    [Bindable]  
    
    /*  
    * protected bindable without event name  
    * */  
    protected var test4:String;
    

    总而言之,ASDoc 对没有事件名称的 Bindable 标签不满意.似乎简单的解决方案是在您将某些内容声明为 Bindable 时指定一个事件名称.但是 flex 文档说u 使用 Bindable 标签指定事件名称,然后您负责生成和调度事件".我的项目几乎完成了,我在很多地方都依赖于绑定(没有事件名称),这使得返回并更改所有内容变得不切实际 - 这将需要很多努力;加上为了创建文档而弄乱工作代码的想法对我来说听起来很可怕.

    To sum it up, ASDoc is not happy with Bindable tags without an event name. The easy solution, it seems, would be to specify an event name whenever you declare something as Bindable. But flex docs say that if u specify an event name with the Bindable tag, then "you are responsible for generating and dispatching the event". My project is almost complete and I've relied on binding (without event names) in a lot of places, making it impractical to go back and change everything - its gonna need a lot of effort; plus the idea of messing up the working code for creating documentation sounds scary to me.

    在生成 asdoc 之前用 [Bindable("blah")] 替换所有 [Bindable] 实例,然后将它们改回来是我能想到的唯一解决方法.但我觉得应该有更好的方法.

    Replacing all [Bindable] instances with [Bindable("blah")] before generating asdoc and then changing them back is the only workaround i can think of. But I feel that there should be a better way.

    Adobe 错误跟踪器 声称公共变量的问题已得到修复在最新版本中,所以我下载了最新的 flex sdk (3.4) 并尝试使用它附带的 ASDoc - 但它给了我相同的结果.

    Adobe bug tracker claims that the problem with public variables have been fixed in the latest build, so I downloaded the latest flex sdk (3.4) and tried with the ASDoc that came with it - but it gave me the same result.

    谁能解释一下这个问题?

    Can anyone shed some light on this issue?

    此外,Adobe 博客说 ASDoc 现在也支持 mxml,但是当我尝试使用最新的 (flex 3.4) ASDoc 时,我的 mxml asdoc 注释(嵌入在 中)没有出现在生成的 html 页面中.有谁知道最新的 asdoc 是否可以单独下载?

    Also, Adobe blog says ASDoc now supports mxml too, but when i tried with the latest (flex 3.4) ASDoc, my mxml asdoc comments (embedded in ) didn't appear in the html page that was generated. does anyone know if latest asdoc is available to download separately?

    推荐答案

    虽然我无法帮助您解决问题,但问题是 [Bindable](无事件名称)生成包装器代码(我相信是一个单独的属性)物业周围.这段代码显然与 asdoc 搞混了.

    While I can't help you with a workaround, the problem is that [Bindable] (no event name) generates wrapper code (I believe a separate property) around the property. This code is obviously messing with asdoc.

    这篇关于将 ASDoc 与 Bindable metatag 和 mxml 结合使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-09 23:26