LongoMatch.Store.Time.ToSecondsString C# (CSharp) Method

ToSecondsString() public method

String representation in seconds
public ToSecondsString ( ) : string
return string
        public string ToSecondsString()
        {
            int _h, _m, _s, _time;

            _time = MSeconds / 1000;
            _h = (_time / 3600);
            _m = ((_time % 3600) / 60);
            _s = ((_time % 3600) % 60);

            if(_h > 0)
                return String.Format("{0}:{1}:{2}", _h, _m.ToString("d2"),
                                     _s.ToString("d2"));

            return String.Format("{0}:{1}", _m, _s.ToString("d2"));
        }

Usage Example

        private void GdkDraw(EventExpose evnt,int height,int width)
        {
            Time time = new Time();
            layout.SetMarkup("0");
            this.GdkWindow.DrawLayout(this.Style.TextGC(StateType.Normal),0,height-23,layout);

            Gdk.Point topL= new Gdk.Point((int)(CurrentFrame/pixelRatio-Scroll-5),height-15);
            Gdk.Point topR= new Gdk.Point((int)(CurrentFrame/pixelRatio-Scroll+5),height-15);
            Gdk.Point bottom= new Gdk.Point((int)(CurrentFrame/pixelRatio-Scroll),height);
            this.GdkWindow.DrawPolygon(this.Style.TextGC(StateType.Normal),true,new Gdk.Point[] {topL,topR,bottom});

            for(int i=10*FrameRate; i<=frames/pixelRatio;) {
                // Drawing separator line
                evnt.Window.DrawLine(Style.DarkGC(StateType.Normal),i-(int)Scroll,height,i-(int)Scroll,height-10);
                time.Seconds = (int)(i/FrameRate*pixelRatio);
                layout.SetMarkup(time.ToSecondsString());
                this.GdkWindow.DrawLayout(this.Style.TextGC(StateType.Normal),i-(int)Scroll-13,height-23,layout);
                //g.ShowText(time.ToSecondsString());
                i=i+10*FrameRate;
            }

            for(int i=0; i<=frames/pixelRatio;) {
                evnt.Window.DrawLine(Style.DarkGC(StateType.Normal),i-(int)Scroll,height,i-(int)Scroll,height-5);
                i=i+FrameRate;
            }
            // Drawing main line
            evnt.Window.DrawLine(Style.DarkGC(StateType.Normal),0,height,width,height);
        }
All Usage Examples Of LongoMatch.Store.Time::ToSecondsString