Click or drag to resize

UserData Class

Provides a base class for custom classes of information which may be attached to geometry or attribute classes.
Inheritance Hierarchy

Namespace:  Rhino.DocObjects.Custom
Assembly:  RhinoCommon (in RhinoCommon.dll)
Syntax
public abstract class UserData : IDisposable

The UserData type exposes the following members.

Constructors
  NameDescription
Protected methodUserData
Initializes a new instance of the UserData class
Top
Properties
  NameDescription
Public propertyDescription
Descriptive name of the user data.
Public propertyShouldWrite
If you want to save this user data in a 3dm file, override ShouldWrite and return true. If you do support serialization, you must also override the Read and Write functions.
Public propertyTransform
Updated if user data is attached to a piece of geometry that is transformed and the virtual OnTransform() is not overridden. If you override OnTransform() and want Transform to be updated, then call the base class OnTransform() in your override. The default constructor sets Transform to the identity.
Top
Methods
  NameDescription
Public methodStatic memberCopy
Expert user tool that copies user data that has a positive CopyCount from the source object to a destination object. Generally speaking you don't need to use Copy(). Simply rely on things like the copy constructors to do the right thing.
Public methodDispose
Actively reclaims unmanaged resources that this instance uses.
Protected methodDispose(Boolean)
For derived class implementers.

This method is called with argument true when class user calls Dispose(), while with argument false when the Garbage Collector invokes the finalizer, or Finalize() method.

You must reclaim all used unmanaged resources in both cases, and can use this chance to call Dispose on disposable fields if the argument is true.

Also, you must call the base virtual method within your overriding method.

Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Passively reclaims unmanaged resources when the class user did not explicitly call Dispose().
(Overrides ObjectFinalize.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodStatic memberMoveUserDataFrom
Moves the user data from objectWithUserData to a temporary data storage identified by the return Guid. When MoveUserDataFrom returns, the objectWithUserData will not have any user data.
Public methodStatic memberMoveUserDataTo
Moves the user data.

See MoveUserDataFrom(CommonObject) for more information.

Protected methodOnDuplicate
Is called when the object is being duplicated.
Protected methodOnTransform
Is called when the object associated with this data is transformed. If you override this function, make sure to call the base class if you want the stored Transform to be updated.
Protected methodRead
Reads the content of this data from a stream archive.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Protected methodWrite
Writes the content of this data to a stream archive.
Top
See Also