Author Topic: DisposableWrapper Class  (Read 107 times)

0 Members and 1 Guest are viewing this topic.

nekitip

  • Newt
  • Posts: 21
DisposableWrapper Class
« on: January 10, 2019, 03:01:12 AM »
What does
Code: [Select]
DisposableWrapper Class mean to us?
Can I safely copy a class inheriting from it, and apply to another object?

Here is the documentation:
https://help.autodesk.com/view/OARX/2019/ENU/?guid=OREFNET-Autodesk_AutoCAD_Runtime_DisposableWrapper

What I care about it is my "BURST" .NET atempt where I have Color class, and I'm thinking of copy color of object before doing setpropertiesfrom, and later returning to the same object. (check separate topic)
The documentation for color class:
https://help.autodesk.com/view/OARX/2019/ENU/?guid=OREFNET-Autodesk_AutoCAD_Colors_Color

MickD

  • Gator
  • Posts: 3223
  • !false...it's funny 'cause it's true!
Re: DisposableWrapper Class
« Reply #1 on: January 10, 2019, 04:38:08 AM »
The disposable wrapper is a class that wraps the native C++ ARX classes. Unless you are writing a custom object and need to wrap it for .Net consumption I wouldn't worry about it.
So short answer is yes but sometimes you may need to 'clone' to make a copy.

I'd just try it, it will definitely let you know if it fails :)
A programmer's wife tells him, "Run to the store and pick up a loaf of bread. If they have eggs, get a dozen."

The programmer comes home with 12 loaves of bread.

nekitip

  • Newt
  • Posts: 21
Re: DisposableWrapper Class
« Reply #2 on: January 10, 2019, 03:43:11 PM »
I did try, nothing happend for 5 minutes, I had no more patience :roll:. What is the normal time such things to fail?

Anyway, just to fill in, in this particular case, I've managed to find how to instead use EntityColor, which is, if I understand correctly, struct type, so there should be no problem with wrapped pointers. But my fears of wrappers still remain  :2funny: