System.Windows.Forms.Design.FileNameEditor.EditValue(System.ComponentModel.ITypeDescriptorContext, System.IServiceProvider, object)

Here are the examples of the csharp api class System.Windows.Forms.Design.FileNameEditor.EditValue(System.ComponentModel.ITypeDescriptorContext, System.IServiceProvider, object) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

26 Examples 7

1. Example

Project: Toxy
Source File: DirectoryNameEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context == null || provider == null)
            {
                return base.EditValue(context, provider, value);
            }
            using (FolderSelectDialog dlg = new FolderSelectDialog())
            {
                dlg.Title = Resources.DirectoryNameEditor_EditValue_Browse_for_a_folder___;
                if (dlg.ShowDialog())
                {
                    value = dlg.FileName;
                }
            }
            return value;
        }

2. Example

Project: ShareX
Source File: DirectoryNameEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context == null || provider == null)
            {
                return base.EditValue(context, provider, value);
            }
            using (FolderSelectDialog dlg = new FolderSelectDialog())
            {
                dlg.Title = Resources.DirectoryNameEditor_EditValue_Browse_for_a_folder___;
                if (dlg.ShowDialog())
                {
                    value = Helpers.GetVariableFolderPath(dlg.FileName);
                }
            }
            return value;
        }

3. Example

Project: ShareX
Source File: DirectoryNameEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context == null || provider == null)
            {
                return base.EditValue(context, provider, value);
            }
            using (FolderSelectDialog dlg = new FolderSelectDialog())
            {
                dlg.Title = Resources.DirectoryNameEditor_EditValue_Browse_for_a_folder___;
                if (dlg.ShowDialog())
                {
                    value = dlg.FileName;
                }
            }
            return value;
        }

4. Example

Project: Toxy
Source File: CssFileNameEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context == null || provider == null)
            {
                return base.EditValue(context, provider, value);
            }
            using (OpenFileDialog dlg = new OpenFileDialog())
            {
                dlg.FileName = "Default.css";
                dlg.Title = Resources.CssFileNameEditor_EditValue_Browse_for_a_Cascading_Style_Sheet___;
                dlg.Filter = "Cascading Style Sheets (*.css)|*.css";
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    value = dlg.FileName;
                }
            }
            return value;
        }

5. Example

Project: Toxy
Source File: ExeFileNameEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context == null || provider == null)
            {
                return base.EditValue(context, provider, value);
            }
            using (OpenFileDialog dlg = new OpenFileDialog())
            {
                dlg.Title = Resources.ExeFileNameEditor_EditValue_Browse_for_executable___;
                dlg.Filter = "Applications (*.exe)|*.exe";
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    value = dlg.FileName;
                }
            }
            return value;
        }

6. Example

Project: Toxy
Source File: ImageFileNameEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context == null || provider == null)
            {
                return base.EditValue(context, provider, value);
            }

            string filePath = ImageHelpers.OpenImageFileDialog();

            if (!string.IsNullOrEmpty(filePath))
            {
                value = filePath;
            }

            return value;
        }

7. Example

Project: Toxy
Source File: JsonFileNameEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context == null || provider == null)
            {
                return base.EditValue(context, provider, value);
            }
            using (OpenFileDialog dlg = new OpenFileDialog())
            {
                dlg.Filter = "JavaScript Object Notation files (*.json)|*.json";
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    value = dlg.FileName;
                }
            }
            return value;
        }

8. Example

Project: TDMaker
Source File: ExeFileNameEditor.cs
View license
public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context == null || provider == null)
            {
                return base.EditValue(context, provider, value);
            }
            OpenFileDialog dlg = new OpenFileDialog();
            dlg.Title = "Browse for Thumbnailer executable...";
            dlg.Filter = "Applications (*.exe)|*.exe";
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                value = dlg.FileName;
            }
            return value;
        }

9. Example

Project: TDMaker
Source File: FontDialogEditor.cs
View license
public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context == null || provider == null)
            {
                return base.EditValue(context, provider, value);
            }
            FontDialog fd = new FontDialog();
            if (fd.ShowDialog() == DialogResult.OK)
            {
                value = fd.Font.Name;
            }
            return value;
        }

10. Example

Project: neo-gui
Source File: ScriptEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            string path = (string)base.EditValue(context, provider, null);
            if (path == null) return null;
            return File.ReadAllBytes(path);
        }

11. Example

Project: ShareX
Source File: CssFileNameEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context == null || provider == null)
            {
                return base.EditValue(context, provider, value);
            }
            using (OpenFileDialog dlg = new OpenFileDialog())
            {
                dlg.FileName = "Default.css";
                dlg.Title = Resources.CssFileNameEditor_EditValue_Browse_for_a_Cascading_Style_Sheet___;
                dlg.Filter = "Cascading Style Sheets (*.css)|*.css";
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    value = dlg.FileName;
                }
            }
            return value;
        }

12. Example

Project: ShareX
Source File: ExeFileNameEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context == null || provider == null)
            {
                return base.EditValue(context, provider, value);
            }
            using (OpenFileDialog dlg = new OpenFileDialog())
            {
                dlg.Title = Resources.ExeFileNameEditor_EditValue_Browse_for_executable___;
                dlg.Filter = "Applications (*.exe)|*.exe";
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    value = dlg.FileName;
                }
            }
            return value;
        }

13. Example

Project: ShareX
Source File: ImageFileNameEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context == null || provider == null)
            {
                return base.EditValue(context, provider, value);
            }

            string filePath = ImageHelpers.OpenImageFileDialog();

            if (!string.IsNullOrEmpty(filePath))
            {
                value = filePath;
            }

            return value;
        }

14. Example

Project: ShareX
Source File: JsonFileNameEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context == null || provider == null)
            {
                return base.EditValue(context, provider, value);
            }
            using (OpenFileDialog dlg = new OpenFileDialog())
            {
                dlg.Filter = "JavaScript Object Notation files (*.json)|*.json";
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    value = dlg.FileName;
                }
            }
            return value;
        }

15. Example

Project: ShareX
Source File: WavFileNameEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context == null || provider == null)
            {
                return base.EditValue(context, provider, value);
            }
            using (OpenFileDialog dlg = new OpenFileDialog())
            {
                dlg.Title = Resources.ExeFileNameEditor_EditValue_Browse_for_executable___;
                dlg.Filter = "Sound file (*.wav)|*.wav";
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    value = dlg.FileName;
                }
            }
            return value;
        }

16. Example

Project: ShareX
Source File: CertFileNameEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context == null || provider == null)
            {
                return base.EditValue(context, provider, value);
            }
            using (OpenFileDialog dlg = new OpenFileDialog())
            {
                dlg.Title = Resources.CertFileNameEditor_EditValue_Browse_for_a_certificate_file___;
                dlg.Filter = "Certificate file (*.cer)|*.cer";
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    value = dlg.FileName;
                }
            }
            return value;
        }

17. Example

Project: ShareX
Source File: KeyFileNameEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context == null || provider == null)
            {
                return base.EditValue(context, provider, value);
            }
            using (OpenFileDialog dlg = new OpenFileDialog())
            {
                dlg.Title = Resources.KeyFileNameEditor_EditValue_Browse_for_a_key_file___;
                dlg.Filter = "Key file (*.*)|*.*";
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    value = dlg.FileName;
                }
            }
            return value;
        }

18. Example

Project: ShareX
Source File: CssFileNameEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context == null || provider == null)
            {
                return base.EditValue(context, provider, value);
            }
            using (OpenFileDialog dlg = new OpenFileDialog())
            {
                dlg.FileName = "Default.css";
                dlg.Title = Resources.CssFileNameEditor_EditValue_Browse_for_a_Cascading_Style_Sheet___;
                dlg.Filter = "Cascading Style Sheets (*.css)|*.css";
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    value = dlg.FileName;
                }
            }
            return value;
        }

19. Example

Project: ShareX
Source File: ExeFileNameEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context == null || provider == null)
            {
                return base.EditValue(context, provider, value);
            }
            using (OpenFileDialog dlg = new OpenFileDialog())
            {
                dlg.Title = Resources.ExeFileNameEditor_EditValue_Browse_for_executable___;
                dlg.Filter = "Applications (*.exe)|*.exe";
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    value = dlg.FileName;
                }
            }
            return value;
        }

20. Example

Project: ShareX
Source File: ImageFileNameEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context == null || provider == null)
            {
                return base.EditValue(context, provider, value);
            }

            string filePath = ImageHelpers.OpenImageFileDialog();

            if (!string.IsNullOrEmpty(filePath))
            {
                value = filePath;
            }

            return value;
        }

21. Example

Project: ShareX
Source File: JsonFileNameEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context == null || provider == null)
            {
                return base.EditValue(context, provider, value);
            }
            using (OpenFileDialog dlg = new OpenFileDialog())
            {
                dlg.Filter = "JavaScript Object Notation files (*.json)|*.json";
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    value = dlg.FileName;
                }
            }
            return value;
        }

22. Example

Project: ShareX
Source File: WavFileNameEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context == null || provider == null)
            {
                return base.EditValue(context, provider, value);
            }
            using (OpenFileDialog dlg = new OpenFileDialog())
            {
                dlg.Title = Resources.ExeFileNameEditor_EditValue_Browse_for_executable___;
                dlg.Filter = "Sound file (*.wav)|*.wav";
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    value = dlg.FileName;
                }
            }
            return value;
        }

23. Example

Project: ShareX
Source File: CertFileNameEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context == null || provider == null)
            {
                return base.EditValue(context, provider, value);
            }
            using (OpenFileDialog dlg = new OpenFileDialog())
            {
                dlg.Title = Resources.CertFileNameEditor_EditValue_Browse_for_a_certificate_file___;
                dlg.Filter = "Certification (*.cer)|*.cer";
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    value = dlg.FileName;
                }
            }
            return value;
        }

24. Example

Project: ShareX
Source File: KeyFileNameEditor.cs
View license
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context == null || provider == null)
            {
                return base.EditValue(context, provider, value);
            }
            using (OpenFileDialog dlg = new OpenFileDialog())
            {
                dlg.Title = Resources.KeyFileNameEditor_EditValue_Browse_for_a_key_file___;
                dlg.Filter = "Keyfile (*.*)|*.*";
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    value = dlg.FileName;
                }
            }
            return value;
        }

25. Example

Project: TDMaker
Source File: ColorDialogEditor.cs
View license
public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context == null || provider == null)
            {
                return base.EditValue(context, provider, value);
            }
            string hexColor = "";
            ColorDialog cd = new ColorDialog();
            cd.FullOpen = true;
            cd.AnyColor = true;

            if (cd.ShowDialog() == DialogResult.OK)
            {
                hexColor = string.Format("0x{0:X8}", cd.Color.ToArgb());
                hexColor = hexColor.Substring(hexColor.Length - 6, 6);
                value = hexColor;
            }
            return value;
        }

26. Example

Project: ATF
Source File: FileUriEditor.cs
View license
public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, System.IServi/n ..... /n //View Source file for more details /n }