- Main Page
- Packages
- Classes
- Files

- File List
- File Members

# D:/guillaume/guillara/3D/DXGfx/DXGfxLib/FileNameEditor.cs

Go to the documentation of this file.

    00001 using System;
    00002 using System.Collections.Generic;
    00003 using System.Text;
    00004 using System.Drawing;
    00005 using System.Drawing.Design;
    00006 using System.ComponentModel;
    00007 using System.ComponentModel.Design;
    00008 using System.Windows.Forms;
    00009 using System.Windows.Forms.Design;
    00010 using System.Globalization;
    00011
    00012 namespace DXGfxLib
    00013 {
    00014     public class FileNameEditor : UITypeEditor
    00015     {
    00016         Object instance = null;
    00017         FileNameUIEditor edtCtrl = null;
    00018
    00019         //public override bool GetPaintValueSupported(ITypeDescriptorContext context)
    00020         //{
    00021         //    instance = context.Instance;
    00022
    00023         //    edtCtrl = new FileNameUIEditor(instance as string);
    00024         //    return true;
    00025         //}
    00026
    00027         //public override void PaintValue(PaintValueEventArgs e)
    00028         //{
    00029         //    edtCtrl.SetBounds(e.Bounds.Left, e.Bounds.Top, e.Bounds.Width, e.Bounds.Height);
    00030         //    edtCtrl.Update();
    00031         //    base.PaintValue(e);
    00032         //}
    00033
    00034         public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
    00035         {
    00036             return UITypeEditorEditStyle.Modal;
    00037         }
    00038
    00039         public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
    00040         {
    00041             IWindowsFormsEditorService edtService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
    00042
    00043             edtCtrl = new FileNameUIEditor(value as string);
    00044
    00045             edtCtrl.Execute();
    00046
    00047             return edtCtrl.associatedFileName;
    00048         }
    00049     }
    00050 }