.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Refresh Palette when switch doc in MDI

3 REPLIES 3
Reply
Message 1 of 4
wesbird
241 Views, 3 Replies

Refresh Palette when switch doc in MDI

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
Windows 10 64 bit, AutoCAD (ACA, Map) 2023
3 REPLIES 3
Message 2 of 4
wesbird
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
Windows 10 64 bit, AutoCAD (ACA, Map) 2023
Message 3 of 4
Anonymous
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
Message 4 of 4
wesbird
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
Windows 10 64 bit, AutoCAD (ACA, Map) 2023

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost