Show / Hide Table of Contents

Class ReversibleChange

This class contains the information to undo a change in the project database. Undoing a change is done by reflection. So we need an object, the name of a method or a property and the parameters to use in the call. This information must be provided in the constructor. The method or property must have public access.

Inheritance
System.Object
ReversibleChange
GeoObjectChange
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: CADability
Assembly: CADability.dll
Syntax
public class ReversibleChange

Constructors

| Improve this Doc View Source

ReversibleChange(Object, String, Object[])

Creates a ReversibleChange object. MethodOrPropertyName must be the name (casesensitive!) of a public method or property that reverses the change when called with the parameters given in the parameter "Parameter". If parameters contains exactly 1 object, the Undo method will first look for a set-property with that type to reverse the change. If there is no set-property with that name and type then the system will look for a method with this single parameter.

Declaration
public ReversibleChange(object objectToChange, string methodOrPropertyName, params object[] parameters)
Parameters
Type Name Description
System.Object objectToChange

The object which will be or was changed

System.String methodOrPropertyName

the case sensitive name of the method or property

System.Object[] parameters

The parameters neede to call this method or property

| Improve this Doc View Source

ReversibleChange(Object, Type, String, Object[])

Creates a ReversibleChange object. MethodOrPropertyName must be the name (casesensitive!) of a public method or property that reverses the change when called with the parameters given in the parameter "Parameter". If parameters contains exactly 1 object, the Undo method will first look for a set-property with that type to reverse the change. If there is no set-property with that name and type then the system will look for a method with this single parameter.

Declaration
public ReversibleChange(object objectToChange, Type interfaceForMethod, string methodOrPropertyName, params object[] parameters)
Parameters
Type Name Description
System.Object objectToChange

The object which will be or was changed

System.Type interfaceForMethod

the interface on which contains the method or property

System.String methodOrPropertyName

the case sensitive name of the method or property

System.Object[] parameters

The parameters neede to call this method or property

Properties

| Improve this Doc View Source

MethodOrPropertyName

Gets the method or property name for this ReversibleChange

Declaration
public string MethodOrPropertyName { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

ObjectToChange

Gets the objects which is changed by this ReversibleChange

Declaration
public object ObjectToChange { get; }
Property Value
Type Description
System.Object
| Improve this Doc View Source

Parameters

Gets the parameters, that can be used in the method call of this ReversibleChange

Declaration
public object[] Parameters { get; }
Property Value
Type Description
System.Object[]

Methods

| Improve this Doc View Source

IsMethod(String)

Checks whether this ReversibleChange ist a method with the given name

Declaration
public bool IsMethod(string methodName)
Parameters
Type Name Description
System.String methodName

The name of the method

Returns
Type Description
System.Boolean

true, if methodName is the name of the ReversibleChange method

| Improve this Doc View Source

ToString()

Overrides objec.ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String

the call for the undo as a string

Overrides
System.Object.ToString()
| Improve this Doc View Source

Undo()

Declaration
public bool Undo()
Returns
Type Description
System.Boolean
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX