如何将这样的AS3类翻译成C#?

时间:2010-05-26 19:57:39

标签: c# flash actionscript events translation

所以我尝试创建用于切片FLV的开源C#项目我开始翻译现有项目flvslicer

任何人都可以帮我翻译其中一个课程

package org.bytearray.video.events
{
    import flash.events.Event;
    import flash.utils.ByteArray;

    public final class MergedEvent extends Event
    {
        public var time:Number;
        public var stream:ByteArray;

        public static const COMPLETE:String = "mergeComplete";

        public function MergedEvent(type:String, stream:ByteArray, duration:Number)
        {
            super(type, false, false); // base
            this.stream = stream;
            this.time = duration;
        }
    }
}

1 个答案:

答案 0 :(得分:2)

在C#中,您有两个单独的项,EventHandler<TArgs>声明和自定义EventArgs子类。

public event EventHandler<MergedEventArgs> MergeComplete;

public class MergedEventArgs : EventArgs {
    public double Time { get; set; }
    public byte[] Stream { get; set;
}