Hi Mark. It's kind self-explainatory and only
requires a little thinking, and my comment was
specifically related to your question about using
the same GUID to identify multiple PaletteSets.
Ignoring for the moment, the mechanics of a
GUID and were you get them from, and just
looking at them in purely conceptual terms, their
purpose is to act as a fingerprint of sorts, that
can be associated with something (anything)
that must be uniquely identifiable, and in a
predictable, and consistent manner.
GUID stands for Globally Unique IDentifier, and
if the purpose of using it here, is to uniquely
identify a PaletteSet then I think one can expect
nothing more than the use of a little common
sense to arrive at the conclusion that you can't
use the same GUID to uniquely identify more than
one PaletteSet.
RIGHT?
As far as the backgrounder on what GUIDs are;
how the're constructed, and so on:
http://en.wikipedia.org/wiki/Globally_Unique_IdentifierRegarding the sample code, after looking at it
better, I came to the conclusion that it is very
broken (in terms of design), and that it made
it too easy for misuse to lead to failure, so I've
ripped the entire thing apart and rebuilt it to be
a bit more robust.
See the updated version just posted, at the
same URL.
Mark - Assuming you understand that the GUID is being used to
uniquely identify each PalletSet, it is really necessary to answer
this question?
I'm making stripped-down versions of some utility classes I use
to make working with PaletteSets easier (actually a breeze, or
at least compared to the crappy sample code Autodesk provides).
http://www.caddzone.com/ExtensionApplicationBlock.zip
The project includes a class called PaletteSetFactory that acts
as a kind of "manager" for a PaletteSet (like I showed earlier),
and helps make building them brain-dead simple.
However, to understand that code and exploit it, one must
be able to think about coding in object-oriented terms, such
as consuming existing classes by deriving from them, rather
than creating instances of them. Hopefully, this code will
not only help you build palettes easier, but also help you to
better understand how we solve problems in object-oriented
ways.
. . .
Tony,
I was hoping my question would prompt an explanation more than an answer. I was having a little trouble understanding why all of a sudden I was concerned with GUIDs. I have projects with multiple forms but have never needed to deal with GUIDs. Maybe this is something that Visual Studio was handling for me.
In any case your response and the code you made available is terrific. I am going to start looking at it today. I'll keep you posted with any comments.
Thank you. I really appreciate your willingness to share your experience and knowledge.