|
发表于 2012-10-15 20:21
|
显示全部楼层
来自: 中国广东清远
ycs_tool.dll反编的源代码
[CommandMethod(S"ycs_hide")]
public: void __gc* ycs_hide()
{
Document __gc* document = Application::get_DocumentManager()->get_MdiActiveDocument();
Database __gc* database = document->get_Database();
Editor __gc* editor = document->get_Editor();
using (Transaction __gc* transaction = database->get_TransactionManager()->StartOpenCloseTransaction())
{
PromptSelectionOptions __gc* options = __gc new PromptSelectionOptions();
options->set_MessageForAdding(S"\u8bf7\u9009\u62e9\u8981\u9690\u85cf\u7684\u5bf9\u8c61\uff1a");
PromptSelectionResult __gc* selection = editor->GetSelection(options);
if (selection->get_Status() == 0x13ec)
{
IEnumerator __gc* enumerator;
SelectionSet __gc* set = selection->get_Value();
try
{
enumerator = set->GetEnumerator();
while (enumerator->MoveNext())
{
SelectedObject __gc* current = *static_cast<__box SelectedObject*>(enumerator->Current);
if (!Information::IsDBNull(current))
{
Entity __gc* expression = transaction->GetObject(current->get_ObjectId(), 1);
if (!Information::IsDBNull(expression))
{
expression->set_Visible(false);
}
}
}
}
finally
{
if ((enumerator is IDisposable))
{
(enumerator as IDisposable)->Dispose();
}
}
}
transaction->Commit();
}
}
|
|