.NET

Reply
Distinguished Contributor
wesbird
Posts: 351
Registered: ‎12-05-2003
Message 1 of 4 (118 Views)

Refresh Palette when switch doc in MDI

118 Views, 3 Replies
12-04-2006 08:10 AM
Hi,
I am lost when I'm working on a palette of MDI (multiple document).
Now in my test project, I just want to show current drawing name in my custom palette when I open a new drawing, switch between drawings... it will be prefect if it get disable/disappear in zero document status.
I add a event handler function in DocumentCollection.DocumentBecameCurrent. How should I do after it. Modeless dialog box should work in the same way, is that correct?
I have a function to initialize palette in IExtensionApplication.Initialize.
Thank you very much.



Wes
Distinguished Contributor
wesbird
Posts: 351
Registered: ‎12-05-2003
Message 2 of 4 (118 Views)

Re: Refresh Palette when switch doc in MDI

12-05-2006 06:14 PM in reply to: wesbird
Hi,
I found the solution: add a documentCollection.DocumentActivated event handle in my Palette function to handle it.
now I have another problem:
My palette is defined in dll A, which is call in Dll B. there is another documentCollection.DocumentActivated defined in IExtensionApplication function of Dll B. Can I assume the documentCollection.DocumentActivated in Dll B will run before the one in Dll A? if not, is there any way I can do about it?


Thank you,

Wes
*Tony Tanzillo
Message 3 of 4 (118 Views)

Re: Refresh Palette when switch doc in MDI

12-06-2006 07:11 AM in reply to: wesbird
Generally, you should not rely on the order in
which multiple handlers for the same event source
are fired, but usually it is the order that they were
added. The first handler added will be called first.

In this case, it will ultimately depend on which
assembly is loaded first, something you should
definitely not rely on, unless you are loading the
assemblies explicitly.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

wrote in message news:5415995@discussion.autodesk.com...
Hi,
I found the solution: add a documentCollection.DocumentActivated event handle in my Palette function to handle it.
now I have another problem:
My palette is defined in dll A, which is call in Dll B. there is another documentCollection.DocumentActivated defined in IExtensionApplication function of Dll B. Can I assume the documentCollection.DocumentActivated in Dll B will run before the one in Dll A? if not, is there any way I can do about it?


Thank you,

Wes
Distinguished Contributor
wesbird
Posts: 351
Registered: ‎12-05-2003
Message 4 of 4 (118 Views)

Re: Refresh Palette when switch doc in MDI

12-06-2006 07:30 AM in reply to: wesbird
Thank you, Tony.
I believe the documentCollection.DocumentActivated, which defined in IExtensionApplication function of Dll B, should run add first when Dll B got loaded in AutoCAD;
the one defined in a palette of Dll A, which referenced in Dll B, will only be loaded when a command called, so it never could load before the one in Dll B.
In this case, my code is safe.
Thank you and Merry Christamas


Wes
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.