コード例 #1
0
 public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
 {
     edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
     if (edSvc != null)
     {
         var gumpArtBrowser = new GumpArtBrowser
         {
             GumpID = Conversions.ToInteger(value)
         };
         if (edSvc.ShowDialog(gumpArtBrowser) == DialogResult.OK)
         {
             Image gump = Gumps.GetGump(gumpArtBrowser.GumpID);
             if (gump != null)
             {
                 gump.Dispose();
                 ReturnValue = gumpArtBrowser.GumpID;
                 gumpArtBrowser.Dispose();
                 return(ReturnValue);
             }
             MessageBox.Show("Invalid GumpID");
             return(value);
         }
         gumpArtBrowser.Dispose();
     }
     return(value);
 }
コード例 #2
0
 public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
 {
     this.edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
     if (this.edSvc != null)
     {
         GumpArtBrowser gumpArtBrowser = new GumpArtBrowser();
         gumpArtBrowser.GumpID = Conversions.ToInteger(value);
         if (this.edSvc.ShowDialog((Form)gumpArtBrowser) == DialogResult.OK)
         {
             Image gump = (Image)Gumps.GetGump(gumpArtBrowser.GumpID);
             if (gump != null)
             {
                 gump.Dispose();
                 this.ReturnValue = gumpArtBrowser.GumpID;
                 gumpArtBrowser.Dispose();
                 return((object)this.ReturnValue);
             }
             int num = (int)Interaction.MsgBox((object)"invalid GumpID", MsgBoxStyle.OkOnly, (object)null);
             return(value);
         }
         gumpArtBrowser.Dispose();
     }
     return(value);
 }