Author Topic: Custom propertygrid UITypeEditor inside AutoCAD... Wierd  (Read 11690 times)

0 Members and 1 Guest are viewing this topic.

Glenn R

  • Guest
Re: Custom propertygrid UITypeEditor inside AutoCAD... Wierd
« Reply #15 on: July 04, 2007, 01:38:42 AM »
OK,

Toss this somewhere in your startup code for the ProjectEditor:

Code: [Select]
AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);

You're registering for an event - the AssemblyResolve event in particular, which occurs if resolution fails.

Then implement the event handler:

Code: [Select]
System.Reflection.Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
{
string partialName = "YourAssemblyNameGoesHere";
if(args.Name.IndexOf(partialName) != -1)
return typeof(YourNamespace.YourEditorClass).Assembly;
else
return null;
}

...and you should be good to go.

Glenn R

  • Guest
Re: Custom propertygrid UITypeEditor inside AutoCAD... Wierd
« Reply #16 on: July 04, 2007, 01:40:23 AM »
AutoCAD's dialog if I'm dealing with drawings and want the preview image, also I think it's less confusing for the user. They're in acad so give 'em the acad open dialog.

Glenn R

  • Guest
Re: Custom propertygrid UITypeEditor inside AutoCAD... Wierd
« Reply #17 on: July 04, 2007, 01:43:19 AM »
...or is copying the dll files to the acad directory the way to go???

I never copy anything into acad's standard folder structure nor do I modify any of it's files...does that answer the question?  :-D

Chumplybum

  • Newt
  • Posts: 97
Re: Custom propertygrid UITypeEditor inside AutoCAD... Wierd
« Reply #18 on: July 04, 2007, 02:04:21 AM »
perfect... thanks, i never would have got that :|

and thanks for the tips on the dialogs, i totally agree with you about not touching autocad at all


Cheers and thanks again

Mark

Glenn R

  • Guest
Re: Custom propertygrid UITypeEditor inside AutoCAD... Wierd
« Reply #19 on: July 04, 2007, 09:27:01 AM »
Say hello to Martin for me  :evil:

Chumplybum

  • Newt
  • Posts: 97
Re: Custom propertygrid UITypeEditor inside AutoCAD... Wierd
« Reply #20 on: July 04, 2007, 06:17:22 PM »
sure, no worries... small world eh????

Glenn R

  • Guest
Re: Custom propertygrid UITypeEditor inside AutoCAD... Wierd
« Reply #21 on: July 04, 2007, 06:53:30 PM »