Click or drag to resize
XKField Class
Class XKField.

 

Code of field: K

Type of field: color.

Applicable to:

Any ARGB number stored as 32 or 64 bit value.

Warning: if alpha and Red components are zero, the value may be understood as a 32 bit integer instead of a 64 bit integer

Inheritance Hierarchy

Namespace:  Biolomics.BioCallback
Assembly:  Biolomics.BioCallback (in Biolomics.BioCallback.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public class XKField : XField

The XKField type exposes the following members.

Constructors
  NameDescription
Public methodXKField(XKField)
Creates New XKField from source.
Public methodXKField(TKField, XRecord)
Initializes a new instance of the XKField class.
Public methodXKField(XKField, XRecord)
Copy ctor but into a new XRecord
Top
Properties
  NameDescription
Public propertyColor
Gets or sets the Field value as Color.
Public propertyFieldValue
Gets or sets the field value return the Color as Object (to be casted to system.Color).
(Overrides XFieldFieldValue.)
Public propertyIsModified
Gets or sets a value indicating whether this instance is modified.
(Inherited from XField.)
Public propertyValue
Gets or sets the value.
Top
Methods
  NameDescription
Public methodAlpha
Gets Alpha value.
Public methodStatic memberAlpha(Int64)
Gets the Alpha value from given KField value as Long.
Public methodBlue
Get Blue value as Short.
Public methodStatic memberBlue(Int64)
Gets the Blue value from given KField value as Long.
Public methodCanRead
Determines whether current connection can read from Field.
(Inherited from XField.)
Public methodCanWrite
Determines whether current connection can write from Field.
(Inherited from XField.)
Public methodClear
Clears this instance.
(Inherited from XField.)
Public methodClone
Clones this instance.
Public methodCloneAsXField
We cannot use name 'Clone' here otherwise Implements vector.TId(Of XSField) fails because XSField.Clone() returns a XField instead of a XSField !!!
(Overrides XFieldCloneAsXField(XRecord).)
Public methodDataToView
Converts field value to readable string.
(Inherited from XField.)
Public methodDataToView(Int32)
Mandatory otherwise DataToView(5) returns letter 5 of string given by DataToView(), instead of the subfield value
(Inherited from XField.)
Public methodEquals
Determines whether the specified Object is equal to this instance.
(Inherited from XField.)
Protected methodField
each derived class embed its own TField member, which can be a TAField, TCField, TEField, etc. this function must return that original TField
(Overrides XFieldField.)
Public methodFieldDef
Gets the Field definition.
(Inherited from XField.)
Public methodFieldType
The Field type.
(Inherited from XField.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGreen
Gets Green value.
Public methodStatic memberGreen(Int64)
Gets the Green value from given KField value as Long.
Public methodKey
Gets Field Key.
(Inherited from XField.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodParentRecord
Gets the parent record.
(Inherited from XField.)
Public methodRead
Reads the Content from source object.
(Inherited from XField.)
Public methodRed
Gets Red value.
Public methodStatic memberRed(Int64)
Gets the Red value from given KField value as Long.
Public methodReset
Resets this instance.
(Inherited from XField.)
Public methodSetDefaultValues
Sets the default values.
(Inherited from XField.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodWrite
Writes data into a TQuery and Format it depending to field type
(Inherited from XField.)
Top
Remarks
Comments:

Red Green Blue Alfa (RGBA) color space.

RGBA (255, 255, 255, 255) is White.

RGBA (0, 0, 0, 255) is Black.

Examples
This is an example of use of XKField to change XKField value.
Example VB.Net
Imports System
Imports BioloMICS.BioCallback
Imports BioloMICS.SharedClasses
Imports System.Drawing

Public Class Program

    <STAThread()>
    Shared Sub Main()
        Dim program As New Program
        program.ChangeField()
    End Sub
    '    Write sub functions here
    Public Sub ChangeField()
        '    get the current connection
        Dim SqlCo As XConnection = Run.GetCurrentConnection()
        If SqlCo Is Nothing Then
            Return
        End If

        '    get a table from its User name
        Dim TableDef As XTableDef = SqlCo.GetTableDefByUserNameEng("Your_Table_Name")
        If TableDef Is Nothing Then   '    may happen if that table doesn't exist
            Return
        End If
        '    load a E-Field from that table
        Dim FieldDefMap As New XFieldDefMap
        Dim FieldDef As XFieldDef = SqlCo.GetFieldByUserNameEng("Your_K_Field_name", TableDef.Key)
        If FieldDef Is Nothing Then   '    that field doesn't exist
            Return
        End If
        FieldDefMap.Add(FieldDef)

        '    load all records
        Dim Where As XWhere = XWhere.All
        Dim RecordMap As XRecordMap = Run.LoadRecords(TableDef.Key, FieldDefMap, Where)

        For Each Record As XRecord In RecordMap
            Dim Field As XKField = TryCast(Record.Fields(FieldDef.Key), XKField)
            If Field Is Nothing Then   '    this field doesn't exist or is not a E-Field
                Continue For
            End If
            '    *****    K Field    *****
            Field.Color = Color.Red

            Record.Save(False)
        Next
    End Sub

End Class
See Also