Dispose() protected method

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool true if managed resources should be disposed; otherwise, false.
return void
Esempio n. 1
0
        private void currentFileLabel_MouseDown(object sender, MouseEventArgs e)
        {
            var inputForm = new InputForm(
                "Enter the file number you want to play:\nNote: Value must be between 1 - " + GetTotalItems,
                "Enter File Number",
                (GetPlayingItem.Index + 1).ToString(CultureInfo.InvariantCulture));

            if (inputForm.ShowDialog(this) == DialogResult.OK)
            {
                var i = Functions.TryParse.ToInt(inputForm.GetInputText) - 1;

                if (i >= 0 && i < GetTotalItems)
                {
                    SelectedIndex = i;

                    // play selected item
                    var newUrl = Path.Combine(mp.FileInfo.GetDirectoryName, GetSelectedItem.Text);

                    if (File.Exists(newUrl) && SelectedIndex != GetPlayingItem.Index)
                    {
                        OpenFile(newUrl);
                    }
                }
            }
            inputForm.Dispose();
        }
Esempio n. 2
0
        private void btnChooseSource_Click(object sender, EventArgs e)
        {
            InputForm inputForm = new InputForm();

            if (inputForm.ShowDialog() == DialogResult.OK)
            {
                // Get IVIdeoSource object.
                videoSource    = inputForm.VideoSource;
                txtSource.Text = videoSource.Source;
            }

            inputForm.Dispose();
        }