Beispiel #1
0
        private void UpdateTimePreview(object sender, EventArgs e)
        {
            var tb = sender as TextBox;

            if (tb == null)
            {
                return;
            }
            var parent = tb.Parent as FormSimplePrompt;

            if (parent == null)
            {
                return;
            }
            Label    lbInfo   = parent.lblDescription;
            Timecode parsedTC = null;

            try
            {
                parsedTC = Timecode.FromPositionString(tb.Text, RulerFormat.Unknown);
            }
            catch
            {
                lbInfo.Text = "";
            }
            if (parsedTC != null)
            {
                lbInfo.Text = parsedTC.ToPositionString(RulerFormat.Unknown);
            }
        }
Beispiel #2
0
        private void tbInterval_TextChanged(object sender, EventArgs e)
        {
            var tb = sender as TextBox;

            if (tb == null)
            {
                return;
            }
            var parent = tb.Parent as FormMarkerCreate;

            if (parent == null)
            {
                return;
            }
            Label    lbInfo   = parent.lbTimecodePreview;
            Timecode parsedTC = null;

            try
            {
                parsedTC = Timecode.FromPositionString(tb.Text, RulerFormat.Unknown);
            }
            catch
            {
                lbInfo.Text = "";
            }
            if (parsedTC != null)
            {
                lbInfo.Text = parsedTC.ToPositionString(RulerFormat.Unknown);
            }
        }
Beispiel #3
0
        private static Timecode ParseTC(string str)
        {
            Timecode parsed;

            try
            {
                parsed = Timecode.FromPositionString(str, RulerFormat.Unknown);
            }
            catch
            {
                return(null);
            }

            return(parsed);
        }
Beispiel #4
0
        public static Timecode GetUserTime(String Caption = "Time entry", String Prompt = "Enter time", String DataLabel = "Time")
        {
            var          myForm = new FormTimeEntry(Caption, Prompt, DataLabel);
            DialogResult rslt   = myForm.ShowDialog();

            if (rslt != DialogResult.OK)
            {
                return(null);
            }

            Timecode parsedTC = Timecode.FromPositionString(myForm.tbUserData.Text, RulerFormat.Unknown);

            if (parsedTC == null)
            {
                return(null);
            }

            return(parsedTC);
        }
Beispiel #5
0
        private void UpdateGrid()
        {
            _renderViews.AddRange(_renderSet.Select(item => new RenderItemView(item)));
            _renderViews.Sort(delegate(RenderItemView a, RenderItemView b)
            {
                var aStart = Timecode.FromPositionString(a.Start, RulerFormat.Unknown);
                var bStart = Timecode.FromPositionString(b.Start, RulerFormat.Unknown);

                if (aStart > bStart)
                {
                    return(1);
                }
                if (aStart < bStart)
                {
                    return(-1);
                }
                return(0);
            });
            renderItemViewBindingSource.ResetBindings(true);
        }