Yaircc.ThemeFileNameEditor.EditValue C# (CSharp) Метод

EditValue() публичный Метод

Edits the specified object's value using the editor style indicated by the GetEditStyle method.
public EditValue ( System context, IServiceProvider provider, object value ) : object
context System An ITypeDescriptorContext that can be used to gain additional context information.
provider IServiceProvider An IServiceProvider that this editor can use to obtain services.
value object The object to edit.
Результат object
        public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            string retval = string.Empty;
            using (OpenFileDialog dialog = new OpenFileDialog())
            {
                dialog.Filter = "CSS files (*.css)|*.css";
                dialog.InitialDirectory = Path.GetDirectoryName(Application.ExecutablePath);
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    retval = dialog.FileName;
                }
            }

            return retval;
        }