views:

68

answers:

1

So I try to create opensource C# project for slicing FLVs I began with translating of existing project called flvslicer

Can any one please help me with translating one of their classes

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;
        }
    }
}
+2  A: 

In C# you have two separate items, an EventHandler<TArgs> declaration and the custom EventArgs subclass.

public event EventHandler<MergedEventArgs> MergeComplete;

public class MergedEventArgs : EventArgs {
    public double Time { get; set; }
    public byte[] Stream { get; set;
}
Sam
And if I wanted to add a function to my Event as public override function toString ():String { return "[MergdEvent duration="+time+"]"; } what shall I do?
Blender
And how to create something like 'this.time = end - start;'
Blender
@Ole Jak, you really should pick up some books and tutorials on C# and just work through those. http://www.amazon.com/Learning-C-3-0-Jesse-Liberty/dp/0596521065
Sam