# CMxType Class

Namespace: `ArchestrA.Toolkit`

CMxType is an abstract class that provides the methods and properties available to all classes for supporting CMx{type}{Array} style classes.

**Syntax**

```csharp
public abstract class CMxType
```

## CMxType Properties

### Attribute Property

Provides a property to hold information about the Attribute from ArchestrA.

**Syntax**

```csharp
protected AttributeHandle attribute;
```

**Returns**

AttributeHandle

### AttributeRef Property

Provides a property to hold the attribute reference string when CMxType classes are used to implement properties of Primitive Attributes.

**Syntax**

```csharp
protected string attributeRef;
```

**Returns**

string

### Owner Property

Provides a property to hold a handle to the owner of the object which also provides access to ArchestrA Site pointers.

**Syntax**

```csharp
protected AObjectBase owner;
```

**Returns**

AObjectBase

### Runtime Property

Provides a property to hold an indication that the object is currently servicing the Runtime.

**Syntax**

```csharp
protected bool runtime;
```

**Returns**

bool

### RuntimeSite2 Property

Provides a property to hold a handle to the IPrimitiveRuntimeSite2 site for the current attribute when the object is correctly configured at Runtime.

**Syntax**

```csharp
protected IPrimitiveRuntimeSite2 runtimeSite2;
```

**Returns**

IPrimitiveRuntimeSite2

### Attribute Property

Provides a property to get and set the AttributeHandle.

**Syntax**

```csharp
AttributeHandle Attribute { get; set; }
```

**Returns**

AttributeHandle

### Category Property

Provides a property to get the MxAttributeCategory.

**Syntax**

```csharp
public virtual MxAttributeCategory Category { get; }
```

**Returns**

MxAttributeCategory

### Checkpoint Property

Provides a property to Checkpoint the attribute at runtime.

**Syntax**

```csharp
public bool Checkpoint { set; }
```

**Returns**

bool

### DataType Property

Provides a property to get the MxDataType.

**Syntax**

```csharp
public virtual MxDataType DataType { get; }
```

**Returns**

MxDataType

### DefValue Property

Provides a property to return the default value as a string.

**Syntax**

```csharp
public abstract string DefValue { get; }
```

**Returns**

string

### LiteMode Property

Provides a property to indicate if the class is running disconnected from ArchestrA.

> **Note** Disconnected refers to an instance of a wrapper that is not associated with an ArchestrA Attribute (that is a CMxValue that is declared locally in the class).

**Syntax**

```csharp
public bool LiteMode { get; }
```

**Returns**

bool

### Locked Property

Provides a property to get and set the lock of the Attribute.

**Syntax**

```csharp
public bool Locked { get; set; }
```

**Returns**

bool

### MxValue Property

Provides a property to get and set the IMxValue of the Attribute.

**Syntax**

```csharp
public virtual IMxValue mxValue { get; set; }
```

**Returns**

MxValueClass

### Quality Property

Provides a property to get and set the Quality of the Attribute.

**Syntax**

```csharp
public abstract CMxDataQuality Quality { get; set; }
```

**Returns**

CMxDataQuality

### Time Property

Provides a property to get and set the Time of the Attribute.

**Syntax**

```csharp
public abstract CMxTime Time { get; set; }
```

**Returns**

CMxTime

### Security Property

Provides a property to get and set the Security of the Attribute.

**Syntax**

```csharp
public virtual MxSecurityClassification Security { get; set; }
```

**Returns**

MxSecurityClassification

### SetHandlerValue Property

Provides a property to set the value from a SetHandlerEventArgs value.

**Syntax**

```csharp
public virtual SetHandlerEventArgs SetHandlerValue { set; }
```

**Returns**

SetHandlerEventArgs

## CMxType Constructor

### CMxType Constructor

Provides a constructor to initialize the class for use in a primitive wrapper.

**Syntax**

```csharp
public CMxType(SupportWrapper _wrapper, string _attributeRef);
```

**Parameters**

**`_wrapper`**

[in] SupportWrapper.

**`_attributeRef`**

[in] string value that holds the attribute reference.

## CMxType Methods

### Initialize Method

Provides a method to initialize the attribute with ArchestrA information.

**Syntax**

```csharp
public void Initialize(AttributeHandle _attribute, AObjectBase _owner, bool _runtime);
```

**Parameters**

**`_attribute`**

[in] AttributeHandle handle as a parameter.

**`_owner`**

[in] base class object of type AObjectBase.

**`_runtime`**

[in] bool value to indicate Runtime or not.

### CheckConnect Method

Provides a method to verify and connect to ArchestrA if needed for primitive wrappers.

**Syntax**

```csharp
protected void CheckConnect();
```

### PadMiliseconds Method

Provides a method to get the ArchestrA style milliseconds as a string from a TimeSpan.

**Syntax**

```csharp
protected string PadMiliseconds(TimeSpan ts);
```

**Parameters**

**`ts`**

[in] TimeSpan value.

**Returns**

string

### UpdateArrayLength Method

Provides a method to set the length of an array to a new length.

**Syntax**

```csharp
protected void UpdateArrayLength(int newLength);
```

**Parameters**

**`newlength`**

[in] int value that holds the new length of the array.
