BNCS Namespace

The BNCS .NET Library
BNCS Namespace
This namespace consists of handy oft used utilities to retrieve information about BNCS device types, BNCS instances and BNCS system paths. It also has a LogFile class for writing BNCS logs and more.
Classes
Class Description
Public class BNCSApi
A class encapsulating and importing BNCS methods.
Public class BNCSCompositeInstanceGroupItem
A class representing a BNCS composite instance group item
Public class BNCSDeviceInstance
Class encapsulating a BNCS device instance
Public class BNCSDeviceType
A class representing a BNCS device type.
Public class BNCSDeviceTypeParameter
A class representing a parameter of a BNCSDeviceType
Public class BNCSDeviceTypeParameterNode
A class representing a single node of the parameters of a BNCSDeviceTypeParameter
Public class BNCSDeviceTypeParameterState
A class representing the state of the parameters of a BNCSDeviceTypeParameter
Public class BNCSDeviceTypes
A class that contains a collection of device types, objects of type BNCSDeviceType
Public class BNCSEventCatergoryT
A class encapsulating an event catergory defined by foreground and background display colours and generic value.
Public class BNCSEventCatergoryStoreT
An event catergory store for storage and retrieval of BNCSEventCatergories.
Public class BNCSEventItemT
A class encapsulating an event item
Public class BNCSEventItemsLogViewModelT
Class that manages a list of generic EventItems that may be bound to a ListBox
Public class BNCSFilePaths
Class that stores BNCS system path data.
Public class BNCSIdSlotMap
A class to manage a list of slot ranges
Public class BNCSIdSlotRange
A slot range representing a range of slot/parameter pairs (BNCSIdSlotRangeItem) for a single unit
Public class BNCSIdSlotRangeItem
A slot range item consisting of a parameter number and a zero based slot number
Public class BNCSInstanceReference
A class representing a reference to an instance.
BNCSInstances
Class encapsulating a BNCS instances file
Examples
This sample shows how to instantiate BNCSInstances, it also demonstrates use of the BNCSUtilities.GetBNCSFilePaths method.
Copy
class TestClass
{
    static void Main()
    {
        BNCSFilePaths bncsFilePaths = BNCSUtilities.GetBNCSFilePaths();
        BNCSInstances bncsInstances = new BNCSInstances(bncsFilePaths.InstancesPath);
    }
}
Public class BNCSInternalInfoDriver
BNCS "internal" InfoDriver class, a class representing an InfoDriver, ie a dictionary of slot number/value pairs. For use when communication appears to be lost with a real InfoDriver.
Public class BNCSLogFile
A class for writing log entries out to a text file, the file name is constructed like so: YearMonthDay_HourMinuteSecond_DriverName_InfoDriverNumber.log ie, YYYYMMDD_HHMMSS_DRIVERNAME_INFODRIVERNUMBER.log, eg 20150108_165059_S3Fiesta_403.log. An option exists to mirror data to a tail file. The main file is only finalised on closure, the tail file executes an open, write, close operation for each write for use with a tailing program. When archive seconds are defined the file will close and commit to disk after the configured amount of seconds. This action is itself logged as the last line in the current file. A fresh file is created anew with the above naming convention. If calls that do not specify a log directory are used then the directory defaults to the BNCS system log directory.
Public class BncsNetworkMessage
Base class for all network message command classes.
Public class BncsNWMFriendlyPropertyNames
A helper class used to convey friendly property names for UI disp;ay.
Public class BNCSSaveInstances
A static class to save a collection of instances to the BNCS system instances file
Public class BNCSTXCommander
Class for handling TX commands. The Transmit() method when called will fire up the OnTransmit event handler in your driver code.
Public class BNCSTXCommandStack
Class that keeps a queue of command stack items.
Public class BNCSTXCommandStackItem
Class that represents a command stack item.
Public class BNCSTXEventArgs
Argument class that contains elements of a command, this class is passed to the BNCSTXEventHandler handler.
Public class BNCSUtilities
Static class with useful methods to execute oft used BNCS functions.
Public class BNCSWindowHandles
Static class that will return the window handles for CSI, InfoDrivers and GRD's for either v3 or v4.
Public class DeviceParameter
A class representation of a single DeviceParameter derived from interface INotifyPropertyChanged.
Public class DeviceUnit
A simple class that represents a device unit
Public class GPILockMessage
GPILock network message command.
Public class GPIPollMessage
GPIPoll network message command.
Public class GPIQueryMessage
GPIQuery network message command.
Public class GpiSetMessage
GPIO network command class.
Public class InfoLockMessage
InfoLock network message command.
Public class InfoPollMessage
InfoPoll network message command.
Public class InfoQueryMessage
InfoQuery network message command.
Public class InfoWriteMessage
InfoWrite network command message.
Public class LockMessage
Base class for all lock type network command classes.
Public class OnArchiveEventArgs
Event argument class used by OnArchiveEventHandler/>
Public class OnGetParameterValueEventArgs
Event argument class for events that return parameter values
Public class PseudoSlot
A class representing a "pseudo slot", i.e. a slot that is not native to the device type but exists as a concept at the driver level
Public class QueryPollMessage
Base class for all query and poll type network command classes.
Public class RouterCrosspointMessage
RouterCrosspoint network message command.
Public class RouterLockMessage
RouterLock network message command.
Public class RouterModifyMessage
RouterModify network command message.
Public class RouterPollMessage
RouterPoll network message command.
Public class RouterQueryMessage
RouterQuery network message command.
Public class UnitParameterAddress
A simple class containing a unit parameter address, ie unit number and parameter number
Delegates
 | Delegate | Description
Public delegate | BNCSTXEventHandler | Event handler type used by the BNCSTXCommander class.
Public delegate | OnArchiveEventHandler | Delegate that defines the OnArchiveEventHandler event handler.
Public delegate | OnGetParameterValueEvent | Delegate for event handlers get parameter values.
Enumerations
 | Enumeration | Description
Public enumeration | DeferedItemsAction | Action enumeration for defered items.
Public enumeration | InstancesState | An enumeration of instance states, these being InputFileNotFound, NoInstances or HasInstances
Public enumeration | NetworkCommandParams | Enumerator denoting message parameter types.
Public enumeration | NetworkMessageType | Enumerator denoting types of network messages.

2015 Atos


BNCSApi Class

BNCSApi Class
A class encapsulating and importing BNCS methods.
Inheritance Hierarchy
SystemObject
BNCSBNCSApi

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static class BNCSApi

The BNCSApi type exposes the following members.

Methods
Name | Description
BNCS32RxMessage | Import of BNCS32RxMessage() method.
BNCS32TxMessage | Import of BNCS32TxMessage() method.
Top
See Also

Reference

BNCS Namespace


BNCSApi Methods

BNCSApi Methods

The BNCSApi type exposes the following members.

Methods
Name | Description
BNCS32RxMessage | Import of BNCS32RxMessage() method.
BNCS32TxMessage | Import of BNCS32TxMessage() method.
Top
See Also

Reference

BNCSApi Class
BNCS Namespace


BNCSApi.BNCS32RxMessage Method

BNCSApiBNCS32RxMessage Method
Import of BNCS32RxMessage() method.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static int BNCS32RxMessage(
    int _WindowHandler,
    int _wParam,
    int _lParam
)

Parameters

_WindowHandler
Type: SystemInt32
Window handler
_wParam
Type: SystemInt32
WParam
_lParam
Type: SystemInt32
LParam

Return Value

Type: Int32
Integer
See Also

Reference

BNCSApi Class
BNCS Namespace


BNCSApi.BNCS32TxMessage Method

BNCSApiBNCS32TxMessage Method
Import of BNCS32TxMessage() method.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static int BNCS32TxMessage(
    int _WindowHandler,
    int _WM_User,
    int _wParam,
    IntPtr _lParam,
    int _type,
    int _iLen
)

Parameters

_WindowHandler
Type: SystemInt32
Window handler
_WM_User
Type: SystemInt32
WM_USER
_wParam
Type: SystemInt32
WParam
_lParam
Type: SystemIntPtr
LParam
_type
Type: SystemInt32
Type
_iLen
Type: SystemInt32
Length

Return Value

Type: Int32
Integer
See Also

Reference

BNCSApi Class
BNCS Namespace


BNCSCompositeInstanceGroupItem Class

BNCSCompositeInstanceGroupItem Class
A class representing a BNCS composite instance group item
Inheritance Hierarchy
SystemObject
BNCSBNCSCompositeInstanceGroupItem

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BNCSCompositeInstanceGroupItem

The BNCSCompositeInstanceGroupItem type exposes the following members.

Constructors
 | Name | Description
Public method | BNCSCompositeInstanceGroupItem | Constructor that sets the ID and instance name
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the class. (Overrides ObjectToString.)
Top
Properties
 | Name | Description
Public property | Id | Gets the ID
Public property | Instance | Gets the instance name
Public property | IsValid | Returns true if the instance is valid, ie the ID and instance are both assigned.
Top
See Also

Reference

BNCS Namespace


BNCSCompositeInstanceGroupItem Constructor

BNCSCompositeInstanceGroupItem Constructor
Constructor that sets the ID and instance name

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSCompositeInstanceGroupItem(
    string id_,
    string instance_
)

Parameters

id_
Type: SystemString
Instance ID
instance_
Type: SystemString
Instance name
See Also

Reference

BNCSCompositeInstanceGroupItem Class
BNCS Namespace


BNCSCompositeInstanceGroupItem Methods

BNCSCompositeInstanceGroupItem Methods

The BNCSCompositeInstanceGroupItem type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the class. (Overrides ObjectToString.)
Top
See Also

Reference

BNCSCompositeInstanceGroupItem Class
BNCS Namespace


BNCSCompositeInstanceGroupItem.ToString Method

BNCSCompositeInstanceGroupItemToString Method
Returns a string representation of the class.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
If valid the result consists if ID and instance else "Invalid instance of [type]"
See Also

Reference

BNCSCompositeInstanceGroupItem Class
BNCS Namespace


BNCSCompositeInstanceGroupItem Properties

BNCSCompositeInstanceGroupItem Properties

The BNCSCompositeInstanceGroupItem type exposes the following members.

Properties
 | Name | Description
Public property | Id | Gets the ID
Public property | Instance | Gets the instance name
Public property | IsValid | Returns true if the instance is valid, ie the ID and instance are both assigned.
Top
See Also

Reference

BNCSCompositeInstanceGroupItem Class
BNCS Namespace


BNCSCompositeInstanceGroupItem.Id Property

BNCSCompositeInstanceGroupItemId Property
Gets the ID

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Id { get; }

Property Value

Type: String
See Also

Reference

BNCSCompositeInstanceGroupItem Class
BNCS Namespace


BNCSCompositeInstanceGroupItem.Instance Property

BNCSCompositeInstanceGroupItemInstance Property
Gets the instance name

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Instance { get; }

Property Value

Type: String
See Also

Reference

BNCSCompositeInstanceGroupItem Class
BNCS Namespace


BNCSCompositeInstanceGroupItem.IsValid Property

BNCSCompositeInstanceGroupItemIsValid Property
Returns true if the instance is valid, ie the ID and instance are both assigned.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool IsValid { get; }

Property Value

Type: Boolean
See Also

Reference

BNCSCompositeInstanceGroupItem Class
BNCS Namespace


BNCSDeviceInstance Class

BNCSDeviceInstance Class
Class encapsulating a BNCS device instance
Inheritance Hierarchy
SystemObject
BNCSBNCSDeviceInstance

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BNCSDeviceInstance

The BNCSDeviceInstance type exposes the following members.

Constructors
 | Name | Description
Public method | BNCSDeviceInstance(String, Int32) | Constructor that initialises by device type name and InfoDriver number
Public method | BNCSDeviceInstance(XmlAttributeCollection, XmlNodeList) | Constructor to initialise by the supplied XmlAttributeXCollection and XmlModeList
Public method | BNCSDeviceInstance(NullableBoolean, String, String, String, BNCSInstanceReference, String) | Constructor that initialises the composite, ID, type name, location, reference and Alt ID parameters
Top
Methods
 | Name | Description
Public method | Equals | Tests for equality against the object supplied (Overrides ObjectEquals(Object).)
Public method | GetHashCode | Gets the hash code (Overrides ObjectGetHashCode.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | SeekExtraAttribute | Looks up the supplied attribute name in extra attributes and returns the value if found.
Public method | ToString | Returns a string representation of the class (Overrides ObjectToString.)
Top
Properties
 | Name | Description
Public property | AltID | Gets/sets the instance alternative ID
Public property | Composite | Returns true if instance is a composite, false if not or null if not found
Public property | DeviceType | Gets or sets the device type
Public property | DeviceTypeName | Gets/sets the instance type
Public property | ExtraAttributes | Gets a dictionary of all other attributes found, the key being the attribute name and the value it's value.
Public property | GroupItems | Gets a list of group items as type BNCSCompositeInstanceGroupItem
Public property | Id | Gets/sets the instance ID
Public property | IsValid | Returns true if the instance is valid. Validity depends on the following: 1. Composite is non NULL 2. ID and Alt ID lengths are greater than zero 3. If not a composite reference is non null and itself a valid reference and device type name length is greater than zero.
Public property | Location | Gets/sets the instance location
Public property | Reference | Gets/sets the instance reference
Public property | UnitNumber | Gets/sets the optional unit number
Top
See Also

Reference

BNCS Namespace


BNCSDeviceInstance Constructor

BNCSDeviceInstance Constructor
Overload List
 | Name | Description
Public method | BNCSDeviceInstance(String, Int32) | Constructor that initialises by device type name and InfoDriver number
Public method | BNCSDeviceInstance(XmlAttributeCollection, XmlNodeList) | Constructor to initialise by the supplied XmlAttributeXCollection and XmlModeList
Public method | BNCSDeviceInstance(NullableBoolean, String, String, String, BNCSInstanceReference, String) | Constructor that initialises the composite, ID, type name, location, reference and Alt ID parameters
Top
See Also

Reference

BNCSDeviceInstance Class
BNCS Namespace


BNCSDeviceInstance Constructor (String, Int32)

BNCSDeviceInstance Constructor (String, Int32)
Constructor that initialises by device type name and InfoDriver number

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSDeviceInstance(
    string deviceTypeName_,
    int infoDriverDeviceNumber_
)

Parameters

deviceTypeName_
Type: SystemString
Device type name
infoDriverDeviceNumber_
Type: SystemInt32
ID device number
See Also

Reference

BNCSDeviceInstance Class
BNCSDeviceInstance Overload
BNCS Namespace


BNCSDeviceInstance Constructor (XmlAttributeCollection, XmlNodeList)

BNCSDeviceInstance Constructor (XmlAttributeCollection, XmlNodeList)
Constructor to initialise by the supplied XmlAttributeXCollection and XmlModeList

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSDeviceInstance(
    XmlAttributeCollection attributes_,
    XmlNodeList nodes_
)

Parameters

attributes_
Type: System.XmlXmlAttributeCollection
Collection of XML attributes to assign to properties
nodes_
Type: System.XmlXmlNodeList
List of XML nodes
See Also

Reference

BNCSDeviceInstance Class
BNCSDeviceInstance Overload
BNCS Namespace


BNCSDeviceInstance Constructor (Nullable(Boolean), String, String, String, BNCSInstanceReference, String)

BNCSDeviceInstance Constructor (NullableBoolean, String, String, String, BNCSInstanceReference, String)
Constructor that initialises the composite, ID, type name, location, reference and Alt ID parameters

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSDeviceInstance(
    Nullable<bool> composite_,
    string id_,
    string deviceTypeName_,
    string location_,
    BNCSInstanceReference reference_,
    string altID_
)

Parameters

composite_
Type: SystemNullable Boolean
Composite
id_
Type: SystemString
ID
deviceTypeName_
Type: SystemString
Device name type
location_
Type: SystemString
Location
reference_
Type: BNCSBNCSInstanceReference
Reference
altID_
Type: SystemString
Alt ID
See Also

Reference

BNCSDeviceInstance Class
BNCSDeviceInstance Overload
BNCS Namespace


BNCSDeviceInstance Methods

BNCSDeviceInstance Methods

The BNCSDeviceInstance type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Tests for equality against the object supplied (Overrides ObjectEquals(Object).)
Public method | GetHashCode | Gets the hash code (Overrides ObjectGetHashCode.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | SeekExtraAttribute | Looks up the supplied attribute name in extra attributes and returns the value if found.
Public method | ToString | Returns a string representation of the class (Overrides ObjectToString.)
Top
See Also

Reference

BNCSDeviceInstance Class
BNCS Namespace


BNCSDeviceInstance.Equals Method

BNCSDeviceInstanceEquals Method
Tests for equality against the object supplied

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override bool Equals(
    Object obj
)

Parameters

obj
Type: SystemObject
Object to compare with this

Return Value

Type: Boolean
True if "obj" is of type BNCS.BNCSDeviceInstance and their ID properties are equal
See Also

Reference

BNCSDeviceInstance Class
BNCS Namespace


BNCSDeviceInstance.GetHashCode Method

BNCSDeviceInstanceGetHashCode Method
Gets the hash code

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override int GetHashCode()

Return Value

Type: Int32
An integer
See Also

Reference

BNCSDeviceInstance Class
BNCS Namespace


BNCSDeviceInstance.SeekExtraAttribute Method

BNCSDeviceInstanceSeekExtraAttribute Method
Looks up the supplied attribute name in extra attributes and returns the value if found.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string SeekExtraAttribute(
    string attributeName_
)

Parameters

attributeName_
Type: SystemString
Case sensitive attribute name to look up.

Return Value

Type: String
The value of the attribute name sought or NULL if the attribute was not found.
See Also

Reference

BNCSDeviceInstance Class
BNCS Namespace


BNCSDeviceInstance.ToString Method

BNCSDeviceInstanceToString Method
Returns a string representation of the class

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
ID else Alt ID else "Anonymous"
See Also

Reference

BNCSDeviceInstance Class
BNCS Namespace


BNCSDeviceInstance Properties

BNCSDeviceInstance Properties

The BNCSDeviceInstance type exposes the following members.

Properties
 | Name | Description
Public property | AltID | Gets/sets the instance alternative ID
Public property | Composite | Returns true if instance is a composite, false if not or null if not found
Public property | DeviceType | Gets or sets the device type
Public property | DeviceTypeName | Gets/sets the instance type
Public property | ExtraAttributes | Gets a dictionary of all other attributes found, the key being the attribute name and the value it's value.
Public property | GroupItems | Gets a list of group items as type BNCSCompositeInstanceGroupItem
Public property | Id | Gets/sets the instance ID
Public property | IsValid | Returns true if the instance is valid. Validity depends on the following: 1. Composite is non NULL 2. ID and Alt ID lengths are greater than zero 3. If not a composite reference is non null and itself a valid reference and device type name length is greater than zero.
Public property | Location | Gets/sets the instance location
Public property | Reference | Gets/sets the instance reference
Public property | UnitNumber | Gets/sets the optional unit number
Top
See Also

Reference

BNCSDeviceInstance Class
BNCS Namespace


BNCSDeviceInstance.AltID Property

BNCSDeviceInstanceAltID Property
Gets/sets the instance alternative ID

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string AltID { get; set; }

Property Value

Type: String
See Also

Reference

BNCSDeviceInstance Class
BNCS Namespace


BNCSDeviceInstance.Composite Property

BNCSDeviceInstanceComposite Property
Returns true if instance is a composite, false if not or null if not found

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Nullable<bool> Composite { get; set; }

Property Value

Type: Nullable Boolean
See Also

Reference

BNCSDeviceInstance Class
BNCS Namespace


BNCSDeviceInstance.DeviceType Property

BNCSDeviceInstanceDeviceType Property
Gets or sets the device type

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSDeviceType DeviceType { get; set; }

Property Value

Type: BNCSDeviceType
See Also

Reference

BNCSDeviceInstance Class
BNCS Namespace


BNCSDeviceInstance.DeviceTypeName Property

BNCSDeviceInstanceDeviceTypeName Property
Gets/sets the instance type

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string DeviceTypeName { get; set; }

Property Value

Type: String
See Also

Reference

BNCSDeviceInstance Class
BNCS Namespace


BNCSDeviceInstance.ExtraAttributes Property

BNCSDeviceInstanceExtraAttributes Property
Gets a dictionary of all other attributes found, the key being the attribute name and the value it's value.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Dictionary<string, string> ExtraAttributes { get; }

Property Value

Type: Dictionary String, String
See Also

Reference

BNCSDeviceInstance Class
BNCS Namespace


BNCSDeviceInstance.GroupItems Property

BNCSDeviceInstanceGroupItems Property
Gets a list of group items as type BNCSCompositeInstanceGroupItem

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<BNCSCompositeInstanceGroupItem> GroupItems { get; }

Property Value

Type: List BNCSCompositeInstanceGroupItem
See Also

Reference

BNCSDeviceInstance Class
BNCS Namespace


BNCSDeviceInstance.Id Property

BNCSDeviceInstanceId Property
Gets/sets the instance ID

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Id { get; set; }

Property Value

Type: String
See Also

Reference

BNCSDeviceInstance Class
BNCS Namespace


BNCSDeviceInstance.IsValid Property

BNCSDeviceInstanceIsValid Property
Returns true if the instance is valid. Validity depends on the following: 1. Composite is non NULL 2. ID and Alt ID lengths are greater than zero 3. If not a composite reference is non null and itself a valid reference and device type name length is greater than zero.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool IsValid { get; }

Property Value

Type: Boolean
See Also

Reference

BNCSDeviceInstance Class
BNCS Namespace


BNCSDeviceInstance.Location Property

BNCSDeviceInstanceLocation Property
Gets/sets the instance location

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Location { get; set; }

Property Value

Type: String
See Also

Reference

BNCSDeviceInstance Class
BNCS Namespace


BNCSDeviceInstance.Reference Property

BNCSDeviceInstanceReference Property
Gets/sets the instance reference

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSInstanceReference Reference { get; set; }

Property Value

Type: BNCSInstanceReference
See Also

Reference

BNCSDeviceInstance Class
BNCS Namespace


BNCSDeviceInstance.UnitNumber Property

BNCSDeviceInstanceUnitNumber Property
Gets/sets the optional unit number

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int UnitNumber { get; set; }

Property Value

Type: Int32
See Also

Reference

BNCSDeviceInstance Class
BNCS Namespace


BNCSDeviceType Class

BNCSDeviceType Class
A class representing a BNCS device type.
Inheritance Hierarchy
SystemObject
BNCSBNCSDeviceType

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BNCSDeviceType

The BNCSDeviceType type exposes the following members.

Constructors
Name Description
BNCSDeviceType
Constructor receives the path to a device type XML file.
Examples
This example demonstrates getting BNCS file paths, BNCS instances and the device types and their parameters therein.
Copy
BNCSFilePaths paths = BNCSFilePaths.BNCSFilePathsFactory();
BNCSInstances instances = new BNCSInstances(paths.InstancesPath);
foreach (BNCSDeviceInstance instance in instances.Instances)
{
    Console.WriteLine("Instance name: " + instance.DeviceTypeName);
    // The device type will be null, create it from the device type path plaus device type name plus ".xml"
    if (null == instance.DeviceType)
        instance.DeviceType = new BNCSDeviceType(DirFuncs.IncludeTrailingBackslash(paths.DeviceTypesPath) + instance.DeviceTypeName + ".xml");
    if (null != instance.DeviceType)
    {
        Console.WriteLine("Parameters: " + instance.DeviceType.Parameters.Count.ToString());
        foreach (BNCSDeviceTypeParameter parameter in instance.DeviceType.Parameters)
            Console.WriteLine("   " + parameter.Name);
    }
    else
        Console.WriteLine("NULL device type returned!");
}
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
 | ExportDeviceType(String, String, ListDeviceParameter) | Exports a device type to a device type XML file
 | ExportDeviceType(String, String, ObservableCollectionDeviceParameter) | Exports a device type to a device type XML file
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a representation of the class as a string, this string being the Name property or the type if name is not assigned. (Overrides ObjectToString.)
 | xExportDeviceType | Obsolete. This method is (probably) obsolete.
Top
Properties
 | Name | Description
Public property | ErrorMessage | Gets or sets an error message for the instance
Public property | Loaded | Gets a flag that betrays if the device type was successfully loaded. If false check the ErrorMessage property.
Public property | Name | Gets the device types name
Public property | Parameters | Gets the device types parameters
Top
See Also

Reference

BNCS Namespace


BNCSDeviceType Constructor

BNCSDeviceType Constructor
Constructor receives the path to a device type XML file.
Examples
This example demonstrates getting BNCS file paths, BNCS instances and the device types and their parameters therein.
Copy
BNCSFilePaths paths = BNCSFilePaths.BNCSFilePathsFactory();
BNCSInstances instances = new BNCSInstances(paths.InstancesPath);
foreach (BNCSDeviceInstance instance in instances.Instances)
{
    Console.WriteLine("Instance name: " + instance.DeviceTypeName);
    // The device type will be null, create it from the device type path plaus device type name plus ".xml"
    if (null == instance.DeviceType)
        instance.DeviceType = new BNCSDeviceType(DirFuncs.IncludeTrailingBackslash(paths.DeviceTypesPath) + instance.DeviceTypeName + ".xml");
    if (null != instance.DeviceType)
    {
        Console.WriteLine("Parameters: " + instance.DeviceType.Parameters.Count.ToString());
        foreach (BNCSDeviceTypeParameter parameter in instance.DeviceType.Parameters)
            Console.WriteLine("   " + parameter.Name);
    }
    else
        Console.WriteLine("NULL device type returned!");
}

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSDeviceType(
    string filename_
)

Parameters

filename_
Type: SystemString
File name
See Also

Reference

BNCSDeviceType Class
BNCS Namespace


BNCSDeviceType Methods

BNCSDeviceType Methods

The BNCSDeviceType type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
 | ExportDeviceType(String, String, ListDeviceParameter) | Exports a device type to a device type XML file
 | ExportDeviceType(String, String, ObservableCollectionDeviceParameter) | Exports a device type to a device type XML file
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a representation of the class as a string, this string being the Name property or the type if name is not assigned. (Overrides ObjectToString.)
 | xExportDeviceType | Obsolete. This method is (probably) obsolete.
Top
See Also

Reference

BNCSDeviceType Class
BNCS Namespace


BNCSDeviceType.ExportDeviceType Method

BNCSDeviceTypeExportDeviceType Method
Overload List
Name | Description
ExportDeviceType(String, String, ListDeviceParameter) | Exports a device type to a device type XML file
ExportDeviceType(String, String, ObservableCollectionDeviceParameter) | Exports a device type to a device type XML file
Top
See Also

Reference

BNCSDeviceType Class
BNCS Namespace


BNCSDeviceType.ExportDeviceType Method (String, String, List(DeviceParameter))

BNCSDeviceTypeExportDeviceType Method (String, String, ListDeviceParameter)
Exports a device type to a device type XML file

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool ExportDeviceType(
    string filepath_,
    string typeName_,
    List<DeviceParameter> parameters_
)

Parameters

filepath_
Type: SystemString
Path and name of the XML file where the device type will be saved.
typeName_
Type: SystemString
Type name
parameters_
Type: System.Collections.GenericList DeviceParameter
A List of DeviceParameter parameters

Return Value

Type: Boolean
True on success
See Also

Reference

BNCSDeviceType Class
ExportDeviceType Overload
BNCS Namespace


BNCSDeviceType.ExportDeviceType Method (String, String, ObservableCollection(DeviceParameter))

BNCSDeviceTypeExportDeviceType Method (String, String, ObservableCollectionDeviceParameter)
Exports a device type to a device type XML file

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool ExportDeviceType(
    string filepath_,
    string typeName_,
    ObservableCollection<DeviceParameter> parameters_
)

Parameters

filepath_
Type: SystemString
Path and name of the XML file where the device type will be saved.
typeName_
Type: SystemString
Type name
parameters_
Type: System.Collections.ObjectModelObservableCollection DeviceParameter
An ObservableCollection of DeviceParameter parameters

Return Value

Type: Boolean
True on success
See Also

Reference

BNCSDeviceType Class
ExportDeviceType Overload
BNCS Namespace


BNCSDeviceType.ToString Method

BNCSDeviceTypeToString Method
Returns a representation of the class as a string, this string being the Name property or the type if name is not assigned.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
The class as a string
See Also

Reference

BNCSDeviceType Class
BNCS Namespace


BNCSDeviceType.xExportDeviceType Method

BNCSDeviceTypexExportDeviceType Method

Note: This API is now obsolete.

This method is (probably) obsolete.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
[ObsoleteAttribute("Please use ExportDeviceType(string, string, ObservableCollection<DeviceParameter>) instead.")]
public static bool xExportDeviceType(
    string typeName_,
    ObservableCollection<DeviceParameter> parameters_
)

Parameters

typeName_
Type: SystemString
Type name
parameters_
Type: System.Collections.ObjectModelObservableCollection DeviceParameter
An observable collection of DeviceParameter patrameters

Return Value

Type: Boolean
True on success
See Also

Reference

BNCSDeviceType Class
BNCS Namespace


BNCSDeviceType Properties

BNCSDeviceType Properties

The BNCSDeviceType type exposes the following members.

Properties
 | Name | Description
Public property | ErrorMessage | Gets or sets an error message for the instance
Public property | Loaded | Gets a flag that betrays if the device type was successfully loaded. If false check the ErrorMessage property.
Public property | Name | Gets the device types name
Public property | Parameters | Gets the device types parameters
Top
See Also

Reference

BNCSDeviceType Class
BNCS Namespace


BNCSDeviceType.ErrorMessage Property

BNCSDeviceTypeErrorMessage Property
Gets or sets an error message for the instance

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string ErrorMessage { get; set; }

Property Value

Type: String
See Also

Reference

BNCSDeviceType Class
BNCS Namespace


BNCSDeviceType.Loaded Property

BNCSDeviceTypeLoaded Property
Gets a flag that betrays if the device type was successfully loaded. If false check the ErrorMessage property.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Loaded { get; }

Property Value

Type: Boolean
See Also

Reference

BNCSDeviceType Class
BNCS Namespace


BNCSDeviceType.Name Property

BNCSDeviceTypeName Property
Gets the device types name

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Name { get; }

Property Value

Type: String
See Also

Reference

BNCSDeviceType Class
BNCS Namespace


BNCSDeviceType.Parameters Property

BNCSDeviceTypeParameters Property
Gets the device types parameters

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<BNCSDeviceTypeParameter> Parameters { get; }

Property Value

Type: List BNCSDeviceTypeParameter
See Also

Reference

BNCSDeviceType Class
BNCS Namespace


BNCSDeviceTypeParameter Class

BNCSDeviceTypeParameter Class
A class representing a parameter of a BNCSDeviceType
Inheritance Hierarchy
SystemObject
BNCSBNCSDeviceTypeParameter

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BNCSDeviceTypeParameter

The BNCSDeviceTypeParameter type exposes the following members.

Constructors
 | Name | Description
Public method | BNCSDeviceTypeParameter | Constructor that sets it's properties according to the supplied XmlNode.
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ReadParameterNode | Gets a value from a parameter node attribute by node name and key.
Public method | ToString | Gets the class as a string (Overrides ObjectToString.)
Top
Properties
 | Name | Description
Public property | Access | Gets the access
Public property | Class | Gets the class
Public property | IsPseudoParameter | Returns true if this parameter is a pseudo parameter. Such a parameter is indicated as: msg="pN=pseudo".
Public property | IsUserParameter | Returns true if this parameter is a user parameter. Such a parameter is indicated as: msg="pN=user".
Public property | IsValid | Returns true if the parameter is valid, validity relies on the node passed to the constructor and it's attributes being non null and the slot value being greater than zero.
Public property | Message | Gets the message
Public property | Name | Gets the name
Public property | Nodes | Gets a list of all nodes within the parameter
Public property | ParameterNumber | Gets or sets the parameter number
Public property | Slot | Gets the slot
Public property | States | Gets a list of states in the form of BNCSDeviceTypeParameterState
Public property | Style | Gets the style
Top
See Also

Reference

BNCS Namespace


BNCSDeviceTypeParameter Constructor

BNCSDeviceTypeParameter Constructor
Constructor that sets it's properties according to the supplied XmlNode.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSDeviceTypeParameter(
    XmlNode node_
)

Parameters

node_
Type: System.XmlXmlNode
XmlNode whose attribute contains the parameter
See Also

Reference

BNCSDeviceTypeParameter Class
BNCS Namespace


BNCSDeviceTypeParameter Methods

BNCSDeviceTypeParameter Methods

The BNCSDeviceTypeParameter type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ReadParameterNode | Gets a value from a parameter node attribute by node name and key.
Public method | ToString | Gets the class as a string (Overrides ObjectToString.)
Top
See Also

Reference

BNCSDeviceTypeParameter Class
BNCS Namespace


BNCSDeviceTypeParameter.ReadParameterNode Method

BNCSDeviceTypeParameterReadParameterNode Method
Gets a value from a parameter node attribute by node name and key.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string ReadParameterNode(
    string nodeName_,
    string nodeKey_
)

Parameters

nodeName_
Type: SystemString
Name of the BNCSDeviceTypeParameterNode to read
nodeKey_
Type: SystemString
Node attribute key

Return Value

Type: String
Node attribute value or null if not found
See Also

Reference

BNCSDeviceTypeParameter Class
BNCS Namespace


BNCSDeviceTypeParameter.ToString Method

BNCSDeviceTypeParameterToString Method
Gets the class as a string

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
Name property
See Also

Reference

BNCSDeviceTypeParameter Class
BNCS Namespace


BNCSDeviceTypeParameter Properties

BNCSDeviceTypeParameter Properties

The BNCSDeviceTypeParameter type exposes the following members.

Properties
 | Name | Description
Public property | Access | Gets the access
Public property | Class | Gets the class
Public property | IsPseudoParameter | Returns true if this parameter is a pseudo parameter. Such a parameter is indicated as: msg="pN=pseudo".
Public property | IsUserParameter | Returns true if this parameter is a user parameter. Such a parameter is indicated as: msg="pN=user".
Public property | IsValid | Returns true if the parameter is valid, validity relies on the node passed to the constructor and it's attributes being non null and the slot value being greater than zero.
Public property | Message | Gets the message
Public property | Name | Gets the name
Public property | Nodes | Gets a list of all nodes within the parameter
Public property | ParameterNumber | Gets or sets the parameter number
Public property | Slot | Gets the slot
Public property | States | Gets a list of states in the form of BNCSDeviceTypeParameterState
Public property | Style | Gets the style
Top
See Also

Reference

BNCSDeviceTypeParameter Class
BNCS Namespace


BNCSDeviceTypeParameter.Access Property

BNCSDeviceTypeParameterAccess Property
Gets the access

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Access { get; }

Property Value

Type: String
See Also

Reference

BNCSDeviceTypeParameter Class
BNCS Namespace


BNCSDeviceTypeParameter.Class Property

BNCSDeviceTypeParameterClass Property
Gets the class

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Class { get; }

Property Value

Type: String
See Also

Reference

BNCSDeviceTypeParameter Class
BNCS Namespace


BNCSDeviceTypeParameter.IsPseudoParameter Property

BNCSDeviceTypeParameterIsPseudoParameter Property
Returns true if this parameter is a pseudo parameter. Such a parameter is indicated as: msg="pN=pseudo".

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool IsPseudoParameter { get; }

Property Value

Type: Boolean
See Also

Reference

BNCSDeviceTypeParameter Class
BNCS Namespace


BNCSDeviceTypeParameter.IsUserParameter Property

BNCSDeviceTypeParameterIsUserParameter Property
Returns true if this parameter is a user parameter. Such a parameter is indicated as: msg="pN=user".

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool IsUserParameter { get; }

Property Value

Type: Boolean
See Also

Reference

BNCSDeviceTypeParameter Class
BNCS Namespace


BNCSDeviceTypeParameter.IsValid Property

BNCSDeviceTypeParameterIsValid Property
Returns true if the parameter is valid, validity relies on the node passed to the constructor and it's attributes being non null and the slot value being greater than zero.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool IsValid { get; }

Property Value

Type: Boolean
See Also

Reference

BNCSDeviceTypeParameter Class
BNCS Namespace


BNCSDeviceTypeParameter.Message Property

BNCSDeviceTypeParameterMessage Property
Gets the message

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Message { get; }

Property Value

Type: String
See Also

Reference

BNCSDeviceTypeParameter Class
BNCS Namespace


BNCSDeviceTypeParameter.Name Property

BNCSDeviceTypeParameterName Property
Gets the name

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Name { get; }

Property Value

Type: String
See Also

Reference

BNCSDeviceTypeParameter Class
BNCS Namespace


BNCSDeviceTypeParameter.Nodes Property

BNCSDeviceTypeParameterNodes Property
Gets a list of all nodes within the parameter

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<BNCSDeviceTypeParameterNode> Nodes { get; }

Property Value

Type: List BNCSDeviceTypeParameterNode
See Also

Reference

BNCSDeviceTypeParameter Class
BNCS Namespace


BNCSDeviceTypeParameter.ParameterNumber Property

BNCSDeviceTypeParameterParameterNumber Property
Gets or sets the parameter number

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int ParameterNumber { get; set; }

Property Value

Type: Int32
See Also

Reference

BNCSDeviceTypeParameter Class
BNCS Namespace


BNCSDeviceTypeParameter.Slot Property

BNCSDeviceTypeParameterSlot Property
Gets the slot

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Slot { get; }

Property Value

Type: Int32
See Also

Reference

BNCSDeviceTypeParameter Class
BNCS Namespace


BNCSDeviceTypeParameter.States Property

BNCSDeviceTypeParameterStates Property
Gets a list of states in the form of BNCSDeviceTypeParameterState

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<BNCSDeviceTypeParameterState> States { get; }

Property Value

Type: List BNCSDeviceTypeParameterState
See Also

Reference

BNCSDeviceTypeParameter Class
BNCS Namespace


BNCSDeviceTypeParameter.Style Property

BNCSDeviceTypeParameterStyle Property
Gets the style

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Style { get; }

Property Value

Type: String
See Also

Reference

BNCSDeviceTypeParameter Class
BNCS Namespace


BNCSDeviceTypeParameterNode Class

BNCSDeviceTypeParameterNode Class
A class representing a single node of the parameters of a BNCSDeviceTypeParameter
Inheritance Hierarchy
SystemObject
BNCSBNCSDeviceTypeParameterNode

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BNCSDeviceTypeParameterNode

The BNCSDeviceTypeParameterNode type exposes the following members.

Constructors
 | Name | Description
Public method | BNCSDeviceTypeParameterNode | Constructor that sets it's value according to the supplied XmlNode.
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | Attributes | Gets a dictionary of attributes
Public property | Name | Gets the name
Top
See Also

Reference

BNCS Namespace


BNCSDeviceTypeParameterNode Constructor

BNCSDeviceTypeParameterNode Constructor
Constructor that sets it's value according to the supplied XmlNode.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSDeviceTypeParameterNode(
    XmlNode node_
)

Parameters

node_
Type: System.XmlXmlNode
XmlNode to read
See Also

Reference

BNCSDeviceTypeParameterNode Class
BNCS Namespace


BNCSDeviceTypeParameterNode Methods

BNCSDeviceTypeParameterNode Methods

The BNCSDeviceTypeParameterNode type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

BNCSDeviceTypeParameterNode Class
BNCS Namespace


BNCSDeviceTypeParameterNode Properties

BNCSDeviceTypeParameterNode Properties

The BNCSDeviceTypeParameterNode type exposes the following members.

Properties
 | Name | Description
Public property | Attributes | Gets a dictionary of attributes
Public property | Name | Gets the name
Top
See Also

Reference

BNCSDeviceTypeParameterNode Class
BNCS Namespace


BNCSDeviceTypeParameterNode.Attributes Property

BNCSDeviceTypeParameterNodeAttributes Property
Gets a dictionary of attributes

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Dictionary<string, string> Attributes { get; }

Property Value

Type: Dictionary String, String
See Also

Reference

BNCSDeviceTypeParameterNode Class
BNCS Namespace


BNCSDeviceTypeParameterNode.Name Property

BNCSDeviceTypeParameterNodeName Property
Gets the name

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Name { get; }

Property Value

Type: String
See Also

Reference

BNCSDeviceTypeParameterNode Class
BNCS Namespace


BNCSDeviceTypeParameterState Class

BNCSDeviceTypeParameterState Class
A class representing the state of the parameters of a BNCSDeviceTypeParameter
Inheritance Hierarchy
SystemObject
BNCSBNCSDeviceTypeParameterState

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BNCSDeviceTypeParameterState

The BNCSDeviceTypeParameterState type exposes the following members.

Constructors
 | Name | Description
Public method | BNCSDeviceTypeParameterState | Constructor that sets it's value according to the supplied XmlNode.
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Gets a string representation of the instance. (Overrides ObjectToString.)
Top
Properties
 | Name | Description
Public property | Caption | Gets the caption
Public property | Msg | Gets the Msg (message)
Public property | Name | Gets the name
Public property | Style | Gets the style
Public property | Value | Gets the value
Top
See Also

Reference

BNCS Namespace


BNCSDeviceTypeParameterState Constructor

BNCSDeviceTypeParameterState Constructor
Constructor that sets it's value according to the supplied XmlNode.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSDeviceTypeParameterState(
    XmlNode node_
)

Parameters

node_
Type: System.XmlXmlNode
XmlNode to read
See Also

Reference

BNCSDeviceTypeParameterState Class
BNCS Namespace


BNCSDeviceTypeParameterState Methods

BNCSDeviceTypeParameterState Methods

The BNCSDeviceTypeParameterState type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Gets a string representation of the instance. (Overrides ObjectToString.)
Top
See Also

Reference

BNCSDeviceTypeParameterState Class
BNCS Namespace


BNCSDeviceTypeParameterState.ToString Method

BNCSDeviceTypeParameterStateToString Method
Gets a string representation of the instance.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
Returns the name property if populated alse the class name.
See Also

Reference

BNCSDeviceTypeParameterState Class
BNCS Namespace


BNCSDeviceTypeParameterState Properties

BNCSDeviceTypeParameterState Properties

The BNCSDeviceTypeParameterState type exposes the following members.

Properties
 | Name | Description
Public property | Caption | Gets the caption
Public property | Msg | Gets the Msg (message)
Public property | Name | Gets the name
Public property | Style | Gets the style
Public property | Value | Gets the value
Top
See Also

Reference

BNCSDeviceTypeParameterState Class
BNCS Namespace


BNCSDeviceTypeParameterState.Caption Property

BNCSDeviceTypeParameterStateCaption Property
Gets the caption

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Caption { get; }

Property Value

Type: String
See Also

Reference

BNCSDeviceTypeParameterState Class
BNCS Namespace


BNCSDeviceTypeParameterState.Msg Property

BNCSDeviceTypeParameterStateMsg Property
Gets the Msg (message)

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Msg { get; }

Property Value

Type: String
See Also

Reference

BNCSDeviceTypeParameterState Class
BNCS Namespace


BNCSDeviceTypeParameterState.Name Property

BNCSDeviceTypeParameterStateName Property
Gets the name

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Name { get; }

Property Value

Type: String
See Also

Reference

BNCSDeviceTypeParameterState Class
BNCS Namespace


BNCSDeviceTypeParameterState.Style Property

BNCSDeviceTypeParameterStateStyle Property
Gets the style

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Style { get; }

Property Value

Type: String
See Also

Reference

BNCSDeviceTypeParameterState Class
BNCS Namespace


BNCSDeviceTypeParameterState.Value Property

BNCSDeviceTypeParameterStateValue Property
Gets the value

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Value { get; }

Property Value

Type: String
See Also

Reference

BNCSDeviceTypeParameterState Class
BNCS Namespace


BNCSDeviceTypes Class

BNCSDeviceTypes Class
A class that contains a collection of device types, objects of type BNCSDeviceType
Inheritance Hierarchy
SystemObject
BNCSBNCSDeviceTypes

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BNCSDeviceTypes

The BNCSDeviceTypes type exposes the following members.

Constructors
 | Name | Description
Public method | BNCSDeviceTypes | Constructor accepting a path and name of an XML file and a list of instances of type BNCSDeviceInstance
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | DeviceTypes | Gets a list of device types as objects of type BNCSDeviceType
Public property | Errors | Gets a list of any errors that were encountered
Public property | FilePath | Gets the path containing the BNCS device types
Top
See Also

Reference

BNCS Namespace


BNCSDeviceTypes Constructor

BNCSDeviceTypes Constructor
Constructor accepting a path and name of an XML file and a list of instances of type BNCSDeviceInstance

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSDeviceTypes(
    string filePath_,
    List<BNCSDeviceInstance> instances_
)

Parameters

filePath_
Type: SystemString
Path to the BNCS system directory that contains device type files
instances_
Type: System.Collections.GenericList BNCSDeviceInstance
List of instances
See Also

Reference

BNCSDeviceTypes Class
BNCS Namespace


BNCSDeviceTypes Methods

BNCSDeviceTypes Methods

The BNCSDeviceTypes type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

BNCSDeviceTypes Class
BNCS Namespace


BNCSDeviceTypes Properties

BNCSDeviceTypes Properties

The BNCSDeviceTypes type exposes the following members.

Properties
 | Name | Description
Public property | DeviceTypes | Gets a list of device types as objects of type BNCSDeviceType
Public property | Errors | Gets a list of any errors that were encountered
Public property | FilePath | Gets the path containing the BNCS device types
Top
See Also

Reference

BNCSDeviceTypes Class
BNCS Namespace


BNCSDeviceTypes.DeviceTypes Property

BNCSDeviceTypesDeviceTypes Property
Gets a list of device types as objects of type BNCSDeviceType

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<BNCSDeviceType> DeviceTypes { get; }

Property Value

Type: List BNCSDeviceType
See Also

Reference

BNCSDeviceTypes Class
BNCS Namespace


BNCSDeviceTypes.Errors Property

BNCSDeviceTypesErrors Property
Gets a list of any errors that were encountered

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<string> Errors { get; }

Property Value

Type: List String
See Also

Reference

BNCSDeviceTypes Class
BNCS Namespace


BNCSDeviceTypes.FilePath Property

BNCSDeviceTypesFilePath Property
Gets the path containing the BNCS device types

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string FilePath { get; }

Property Value

Type: String
See Also

Reference

BNCSDeviceTypes Class
BNCS Namespace


BNCSEventCatergory(T) Class

BNCSEventCatergoryT Class
A class encapsulating an event catergory defined by foreground and background display colours and generic value.
Inheritance Hierarchy
SystemObject
BNCSBNCSEventCatergoryT

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BNCSEventCatergory<T>

Type Parameters

T

The BNCSEventCatergoryT type exposes the following members.

Constructors
 | Name | Description
Public method | BNCSEventCatergoryT | Constructor
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | Background | Gets or sets the background colour
Public property | Catergory | Gets the Catergory
Public property | Foreground | Gets or sets the foreground colour
Public property | Value | Gets the value
Public property | ValueType | Gets the value type
Top
See Also

Reference

BNCS Namespace


BNCSEventCatergory(T) Constructor

BNCSEventCatergoryT Constructor
Constructor

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSEventCatergory(
    Brush foreground_,
    Brush background_,
    T value_
)

Parameters

foreground_
Type: System.Windows.MediaBrush
Sets the foreground colour for displaying text
background_
Type: System.Windows.MediaBrush
Sets the background colour for displaying text
value_
Type: T
Sets the value
See Also

Reference

BNCSEventCatergoryT Class
BNCS Namespace


BNCSEventCatergory(T) Methods

BNCSEventCatergoryT Methods

The BNCSEventCatergoryT generic type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

BNCSEventCatergoryT Class
BNCS Namespace


BNCSEventCatergory(T) Properties

BNCSEventCatergoryT Properties

The BNCSEventCatergoryT generic type exposes the following members.

Properties
 | Name | Description
Public property | Background | Gets or sets the background colour
Public property | Catergory | Gets the Catergory
Public property | Foreground | Gets or sets the foreground colour
Public property | Value | Gets the value
Public property | ValueType | Gets the value type
Top
See Also

Reference

BNCSEventCatergoryT Class
BNCS Namespace


BNCSEventCatergory(T).Background Property

BNCSEventCatergoryTBackground Property
Gets or sets the background colour

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Brush Background { get; set; }

Property Value

Type: Brush
See Also

Reference

BNCSEventCatergoryT Class
BNCS Namespace


BNCSEventCatergory(T).Catergory Property

BNCSEventCatergoryTCatergory Property
Gets the Catergory

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Catergory { get; }

Property Value

Type: String
See Also

Reference

BNCSEventCatergoryT Class
BNCS Namespace


BNCSEventCatergory(T).Foreground Property

BNCSEventCatergoryTForeground Property
Gets or sets the foreground colour

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Brush Foreground { get; set; }

Property Value

Type: Brush
See Also

Reference

BNCSEventCatergoryT Class
BNCS Namespace


BNCSEventCatergory(T).Value Property

BNCSEventCatergoryTValue Property
Gets the value

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public T Value { get; }

Property Value

Type: T
See Also

Reference

BNCSEventCatergoryT Class
BNCS Namespace


BNCSEventCatergory(T).ValueType Property

BNCSEventCatergoryTValueType Property
Gets the value type

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Type ValueType { get; }

Property Value

Type: Type
See Also

Reference

BNCSEventCatergoryT Class
BNCS Namespace


BNCSEventCatergoryStore(T) Class

BNCSEventCatergoryStoreT Class
An event catergory store for storage and retrieval of BNCSEventCatergories.
Inheritance Hierarchy
SystemObject
BNCSBNCSEventCatergoryStoreT

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BNCSEventCatergoryStore<T>

Type Parameters

T

The BNCSEventCatergoryStoreT type exposes the following members.

Constructors
 | Name | Description
Public method | BNCSEventCatergoryStoreT | Initializes a new instance of the BNCSEventCatergoryStoreT class
Top
Methods
 | Name | Description
Public method | Add(Brush, Brush, T) | Adds a new BNCSEventCatergory to the store
Public method | Add(Brush, Brush, T, Boolean) | Adds a new BNCSEventCatergory to the store that may be marked as default
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetCatergoryByValue | Traverses the store of BNCSEventCatergory items and returns the one, if found, that matches the supplied value.
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | MarkAsDefaultReturnValue | Sets a default failsafe return type for GetCatergoryByValue(), when set to a value found on the store this catergory is returned by GetCatergoryByValue() if it fails to match the value supplied.
Public method | RemoveDefaultReturnValue | Removes the default return value for GetCatergoryByValue()
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

BNCS Namespace


BNCSEventCatergoryStore(T) Constructor

BNCSEventCatergoryStoreT Constructor
Initializes a new instance of the BNCSEventCatergoryStoreT class

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSEventCatergoryStore()
See Also

Reference

BNCSEventCatergoryStoreT Class
BNCS Namespace


BNCSEventCatergoryStore(T) Methods

BNCSEventCatergoryStoreT Methods

The BNCSEventCatergoryStoreT generic type exposes the following members.

Methods
 | Name | Description
Public method | Add(Brush, Brush, T) | Adds a new BNCSEventCatergory to the store
Public method | Add(Brush, Brush, T, Boolean) | Adds a new BNCSEventCatergory to the store that may be marked as default
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetCatergoryByValue | Traverses the store of BNCSEventCatergory items and returns the one, if found, that matches the supplied value.
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | MarkAsDefaultReturnValue | Sets a default failsafe return type for GetCatergoryByValue(), when set to a value found on the store this catergory is returned by GetCatergoryByValue() if it fails to match the value supplied.
Public method | RemoveDefaultReturnValue | Removes the default return value for GetCatergoryByValue()
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

BNCSEventCatergoryStoreT Class
BNCS Namespace


BNCSEventCatergoryStore(T).Add Method

BNCSEventCatergoryStoreTAdd Method
Overload List
 | Name | Description
Public method | Add(Brush, Brush, T) | Adds a new BNCSEventCatergory to the store
Public method | Add(Brush, Brush, T, Boolean) | Adds a new BNCSEventCatergory to the store that may be marked as default
Top
See Also

Reference

BNCSEventCatergoryStoreT Class
BNCS Namespace


BNCSEventCatergoryStore(T).Add Method (Brush, Brush, T)

BNCSEventCatergoryStoreTAdd Method (Brush, Brush, T)
Adds a new BNCSEventCatergory to the store

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Add(
    Brush foreground_,
    Brush background_,
    T value_
)

Parameters

foreground_
Type: System.Windows.MediaBrush
Display foreground colour
background_
Type: System.Windows.MediaBrush
Display background colour
value_
Type: T
Unique value

Return Value

Type: Boolean
True on success, fails if the value exists in a previously supplied item
See Also

Reference

BNCSEventCatergoryStoreT Class
Add Overload
BNCS Namespace


BNCSEventCatergoryStore(T).Add Method (Brush, Brush, T, Boolean)

BNCSEventCatergoryStoreTAdd Method (Brush, Brush, T, Boolean)
Adds a new BNCSEventCatergory to the store that may be marked as default

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Add(
    Brush foreground_,
    Brush background_,
    T value_,
    bool markDefault_
)

Parameters

foreground_
Type: System.Windows.MediaBrush
Display foreground colour
background_
Type: System.Windows.MediaBrush
Display background colour
value_
Type: T
Unique value
markDefault_
Type: SystemBoolean
Default return flag, if true then the value of the newly added catergory becomes the default return when GetCatergoryByValue() fails

Return Value

Type: Boolean
True on success, fails if the value exists in a previously supplied item
See Also

Reference

BNCSEventCatergoryStoreT Class
Add Overload
BNCS Namespace


BNCSEventCatergoryStore(T).GetCatergoryByValue Method

BNCSEventCatergoryStoreTGetCatergoryByValue Method
Traverses the store of BNCSEventCatergory items and returns the one, if found, that matches the supplied value.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSEventCatergory<T> GetCatergoryByValue(
    T value_
)

Parameters

value_
Type: T
Value to match.

Return Value

Type: BNCSEventCatergory T
The BNCSEventCatergory whose value matches that supplied, if not matched returns the member (if any) whose value is marked as default else NULL.
See Also

Reference

BNCSEventCatergoryStoreT Class
BNCS Namespace


BNCSEventCatergoryStore(T).MarkAsDefaultReturnValue Method

BNCSEventCatergoryStoreTMarkAsDefaultReturnValue Method
Sets a default failsafe return type for GetCatergoryByValue(), when set to a value found on the store this catergory is returned by GetCatergoryByValue() if it fails to match the value supplied.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool MarkAsDefaultReturnValue(
    T value_
)

Parameters

value_
Type: T
Default value to set

Return Value

Type: Boolean
True on success, if value_ is not matched in the store it returns false
See Also

Reference

BNCSEventCatergoryStoreT Class
BNCS Namespace


BNCSEventCatergoryStore(T).RemoveDefaultReturnValue Method

BNCSEventCatergoryStoreTRemoveDefaultReturnValue Method
Removes the default return value for GetCatergoryByValue()

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void RemoveDefaultReturnValue()
See Also

Reference

BNCSEventCatergoryStoreT Class
BNCS Namespace


BNCSEventItem(T) Class

BNCSEventItemT Class
A class encapsulating an event item
Inheritance Hierarchy
SystemObject
BNCSBNCSEventItemT

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BNCSEventItem<T>

Type Parameters

T
Generic type

The BNCSEventItemT type exposes the following members.

Constructors
 | Name | Description
Public method | BNCSEventItemT | Constructor that sets the text and catergory.
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Gets the instance as a string (Overrides ObjectToString.)
Top
Properties
 | Name | Description
Public property | Background | Gets the background colour property
Public property | Catergory | Gets the Catergory property
Public property | Foreground | Gets the Foreground colour property
Public property | Processed | Gets or sets the Processed property
Public property | Text | Gets the Text property
Top
See Also

Reference

BNCS Namespace


BNCSEventItem(T) Constructor

BNCSEventItemT Constructor
Constructor that sets the text and catergory.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSEventItem(
    string text_,
    BNCSEventCatergory<T> catergories_
)

Parameters

text_
Type: SystemString
Text of event
catergories_
Type: BNCSBNCSEventCatergory T
Catergory of event
See Also

Reference

BNCSEventItemT Class
BNCS Namespace


BNCSEventItem(T) Methods

BNCSEventItemT Methods

The BNCSEventItemT generic type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Gets the instance as a string (Overrides ObjectToString.)
Top
See Also

Reference

BNCSEventItemT Class
BNCS Namespace


BNCSEventItem(T).ToString Method

BNCSEventItemTToString Method
Gets the instance as a string

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
The Text property
See Also

Reference

BNCSEventItemT Class
BNCS Namespace


BNCSEventItem(T) Properties

BNCSEventItemT Properties

The BNCSEventItemT generic type exposes the following members.

Properties
 | Name | Description
Public property | Background | Gets the background colour property
Public property | Catergory | Gets the Catergory property
Public property | Foreground | Gets the Foreground colour property
Public property | Processed | Gets or sets the Processed property
Public property | Text | Gets the Text property
Top
See Also

Reference

BNCSEventItemT Class
BNCS Namespace


BNCSEventItem(T).Background Property

BNCSEventItemTBackground Property
Gets the background colour property

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Brush Background { get; }

Property Value

Type: Brush
See Also

Reference

BNCSEventItemT Class
BNCS Namespace


BNCSEventItem(T).Catergory Property

BNCSEventItemTCatergory Property
Gets the Catergory property

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSEventCatergory<T> Catergory { get; }

Property Value

Type: BNCSEventCatergory T
See Also

Reference

BNCSEventItemT Class
BNCS Namespace


BNCSEventItem(T).Foreground Property

BNCSEventItemTForeground Property
Gets the Foreground colour property

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Brush Foreground { get; }

Property Value

Type: Brush
See Also

Reference

BNCSEventItemT Class
BNCS Namespace


BNCSEventItem(T).Processed Property

BNCSEventItemTProcessed Property
Gets or sets the Processed property

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Processed { get; set; }

Property Value

Type: Boolean
See Also

Reference

BNCSEventItemT Class
BNCS Namespace


BNCSEventItem(T).Text Property

BNCSEventItemTText Property
Gets the Text property

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Text { get; }

Property Value

Type: String
See Also

Reference

BNCSEventItemT Class
BNCS Namespace


BNCSEventItemsLogViewModel(T) Class

BNCSEventItemsLogViewModelT Class
Class that manages a list of generic EventItems that may be bound to a ListBox
Inheritance Hierarchy
SystemObject
BNCSBNCSEventItemsLogViewModelT

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BNCSEventItemsLogViewModel<T> : INotifyPropertyChanged

Type Parameters

T
Generic type

The BNCSEventItemsLogViewModelT type exposes the following members.

Constructors
 | Name | Description
Public method | BNCSEventItemsLogViewModelT | Initializes a new instance of the BNCSEventItemsLogViewModelT class
Top
Methods
 | Name | Description
Public method | AddItem(String, BNCSEventCatergoryT) | Adds an item defined by test and catergory to the event list
Public method | AddItem(String, Boolean, BNCSEventCatergoryT) | Adds an item defined by test and catergory to the event list
Public method | AddItem(String, Boolean, BNCSEventCatergoryT, Boolean) | Adds an item defined by test and catergory to the event list
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ProcessDeferedItems | Processes actions on defered items
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | AutoScroll | Gets or sets the AutoScroll property for auto scrolling a list box
Public property | Items | Gets or sets the Items property
Public property | LastIndex | Gets or sets the last index property
Public property | ListBox | Gets or sets the ListBox property, set this if you need your ListBox to auto scroll
Top
Events
 | Name | Description
Public event | PropertyChanged | PropertyChanged event handler.
Top
See Also

Reference

BNCS Namespace


BNCSEventItemsLogViewModel(T) Constructor

BNCSEventItemsLogViewModelT Constructor
Initializes a new instance of the BNCSEventItemsLogViewModelT class

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSEventItemsLogViewModel()
See Also

Reference

BNCSEventItemsLogViewModelT Class
BNCS Namespace


BNCSEventItemsLogViewModel(T) Methods

BNCSEventItemsLogViewModelT Methods

The BNCSEventItemsLogViewModelT generic type exposes the following members.

Methods
 | Name | Description
Public method | AddItem(String, BNCSEventCatergoryT) | Adds an item defined by test and catergory to the event list
Public method | AddItem(String, Boolean, BNCSEventCatergoryT) | Adds an item defined by test and catergory to the event list
Public method | AddItem(String, Boolean, BNCSEventCatergoryT, Boolean) | Adds an item defined by test and catergory to the event list
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ProcessDeferedItems | Processes actions on defered items
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

BNCSEventItemsLogViewModelT Class
BNCS Namespace


BNCSEventItemsLogViewModel(T).AddItem Method

BNCSEventItemsLogViewModelTAddItem Method
Overload List
 | Name | Description
Public method | AddItem(String, BNCSEventCatergoryT) | Adds an item defined by test and catergory to the event list
Public method | AddItem(String, Boolean, BNCSEventCatergoryT) | Adds an item defined by test and catergory to the event list
Public method | AddItem(String, Boolean, BNCSEventCatergoryT, Boolean) | Adds an item defined by test and catergory to the event list
Top
See Also

Reference

BNCSEventItemsLogViewModelT Class
BNCS Namespace


BNCSEventItemsLogViewModel(T).AddItem Method (String, BNCSEventCatergory(T))

BNCSEventItemsLogViewModelTAddItem Method (String, BNCSEventCatergoryT)
Adds an item defined by test and catergory to the event list

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool AddItem(
    string text_,
    BNCSEventCatergory<T> catergory_
)

Parameters

text_
Type: SystemString
Text of event
catergory_
Type: BNCSBNCSEventCatergory T
Catergory of event

Return Value

Type: Boolean
True on success
See Also

Reference

BNCSEventItemsLogViewModelT Class
AddItem Overload
BNCS Namespace


BNCSEventItemsLogViewModel(T).AddItem Method (String, Boolean, BNCSEventCatergory(T))

BNCSEventItemsLogViewModelTAddItem Method (String, Boolean, BNCSEventCatergoryT)
Adds an item defined by test and catergory to the event list

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool AddItem(
    string text_,
    bool allowConsecutiveDuplicates_,
    BNCSEventCatergory<T> catergory_
)

Parameters

text_
Type: SystemString
Text of event
allowConsecutiveDuplicates_
Type: SystemBoolean
Allow consecutive duplicate messages flag
catergory_
Type: BNCSBNCSEventCatergory T
Catergory of event

Return Value

Type: Boolean
True on success
See Also

Reference

BNCSEventItemsLogViewModelT Class
AddItem Overload
BNCS Namespace


BNCSEventItemsLogViewModel(T).AddItem Method (String, Boolean, BNCSEventCatergory(T), Boolean)

BNCSEventItemsLogViewModelTAddItem Method (String, Boolean, BNCSEventCatergoryT, Boolean)
Adds an item defined by test and catergory to the event list

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool AddItem(
    string text_,
    bool allowConsecutiveDuplicates_,
    BNCSEventCatergory<T> catergory_,
    bool defer_
)

Parameters

text_
Type: SystemString
Text of event
allowConsecutiveDuplicates_
Type: SystemBoolean
Allow consecutive duplicate messages flag
catergory_
Type: BNCSBNCSEventCatergory T
Catergory of event
defer_
Type: SystemBoolean
Flag to defer display of entry

Return Value

Type: Boolean
True on success
See Also

Reference

BNCSEventItemsLogViewModelT Class
AddItem Overload
BNCS Namespace


BNCSEventItemsLogViewModel(T).ProcessDeferedItems Method

BNCSEventItemsLogViewModelTProcessDeferedItems Method
Processes actions on defered items

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void ProcessDeferedItems(
    DeferedItemsAction action_
)

Parameters

action_
Type: BNCSDeferedItemsAction
Action to perform
See Also

Reference

BNCSEventItemsLogViewModelT Class
BNCS Namespace


BNCSEventItemsLogViewModel(T) Properties

BNCSEventItemsLogViewModelT Properties

The BNCSEventItemsLogViewModelT generic type exposes the following members.

Properties
 | Name | Description
Public property | AutoScroll | Gets or sets the AutoScroll property for auto scrolling a list box
Public property | Items | Gets or sets the Items property
Public property | LastIndex | Gets or sets the last index property
Public property | ListBox | Gets or sets the ListBox property, set this if you need your ListBox to auto scroll
Top
See Also

Reference

BNCSEventItemsLogViewModelT Class
BNCS Namespace


BNCSEventItemsLogViewModel(T).AutoScroll Property

BNCSEventItemsLogViewModelTAutoScroll Property
Gets or sets the AutoScroll property for auto scrolling a list box

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool AutoScroll { get; set; }

Property Value

Type: Boolean
See Also

Reference

BNCSEventItemsLogViewModelT Class
BNCS Namespace


BNCSEventItemsLogViewModel(T).Items Property

BNCSEventItemsLogViewModelTItems Property
Gets or sets the Items property

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ObservableCollection<BNCSEventItem<T>> Items { get; set; }

Property Value

Type: ObservableCollection BNCSEventItem T
See Also

Reference

BNCSEventItemsLogViewModelT Class
BNCS Namespace


BNCSEventItemsLogViewModel(T).LastIndex Property

BNCSEventItemsLogViewModelTLastIndex Property
Gets or sets the last index property

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int LastIndex { get; set; }

Property Value

Type: Int32
See Also

Reference

BNCSEventItemsLogViewModelT Class
BNCS Namespace


BNCSEventItemsLogViewModel(T).ListBox Property

BNCSEventItemsLogViewModelTListBox Property
Gets or sets the ListBox property, set this if you need your ListBox to auto scroll

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ListBox ListBox { get; set; }

Property Value

Type: ListBox
See Also

Reference

BNCSEventItemsLogViewModelT Class
BNCS Namespace


BNCSEventItemsLogViewModel(T) Events

BNCSEventItemsLogViewModelT Events

The BNCSEventItemsLogViewModelT generic type exposes the following members.

Events
 | Name | Description
Public event | PropertyChanged | PropertyChanged event handler.
Top
See Also

Reference

BNCSEventItemsLogViewModelT Class
BNCS Namespace


BNCSEventItemsLogViewModel(T).PropertyChanged Event

BNCSEventItemsLogViewModelTPropertyChanged Event
PropertyChanged event handler.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event PropertyChangedEventHandler PropertyChanged

Value

Type: System.ComponentModelPropertyChangedEventHandler

Implements

INotifyPropertyChangedPropertyChanged
See Also

Reference

BNCSEventItemsLogViewModelT Class
BNCS Namespace


BNCSFilePaths Class

BNCSFilePaths Class
Class that stores BNCS system path data.
Inheritance Hierarchy
SystemObject
BNCSBNCSFilePaths

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BNCSFilePaths

The BNCSFilePaths type exposes the following members.

Methods
Name Description
BNCSFilePathsFactory
Gets the BNCS system file paths.
Examples
This sample shows how to retrieve a list of BNCS system file paths.
Copy
class Program
{
    static void Main()
    {
        BNCSFilePaths bncsFilePaths = BNCSFilePaths.BNCSFilePathsFactory();
        Console.WriteLine("BNCS System Paths for System\"" + bncsFilePaths.SystemName + "\"\n");
        Console.WriteLine("Binary path:\t\t" + bncsFilePaths.BinaryPath);
        Console.WriteLine("Configuration path:\t" + bncsFilePaths.ConfigPath);
        Console.WriteLine("Data path:\t\t" + bncsFilePaths.DataPath);
        Console.WriteLine("Device Types path:\t" + bncsFilePaths.DeviceTypesPath);
        Console.WriteLine("INI files path:\t\t" + bncsFilePaths.IniFilePath);
        Console.WriteLine("Instances path:\t\t" + bncsFilePaths.InstancesPath);
        Console.WriteLine("Library path:\t\t" + bncsFilePaths.LibraryPath);
        Console.WriteLine("Log File path:\t\t" + bncsFilePaths.LogFilePath);
        Console.WriteLine("Root path:\t\t" + bncsFilePaths.RootPath);
    }
}
Public method Equals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public method GetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method ToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Fields
 | Name | Description
Public field | BinaryPath | Gets the binary path.
Public field | ConfigPath | Gets the configuration path.
Public field | DataPath | Gets the data path.
Public field | DeviceTypesPath | Gets the device types path.
Public field | IniFilePath | Gets the INI file path.
Public field | InstancesPath | Gets the instances path.
Public field | LibraryPath | Gets the library path.
Public field | LogFilePath | Gets the log file path.
Public field | RootPath | Gets the root path.
Public field | SystemName | Gets the system name.
Top
See Also

Reference

BNCS Namespace


BNCSFilePaths Fields

BNCSFilePaths Fields

The BNCSFilePaths type exposes the following members.

Fields
 | Name | Description
Public field | BinaryPath | Gets the binary path.
Public field | ConfigPath | Gets the configuration path.
Public field | DataPath | Gets the data path.
Public field | DeviceTypesPath | Gets the device types path.
Public field | IniFilePath | Gets the INI file path.
Public field | InstancesPath | Gets the instances path.
Public field | LibraryPath | Gets the library path.
Public field | LogFilePath | Gets the log file path.
Public field | RootPath | Gets the root path.
Public field | SystemName | Gets the system name.
Top
See Also

Reference

BNCSFilePaths Class
BNCS Namespace


BNCSFilePaths.BinaryPath Field

BNCSFilePathsBinaryPath Field
Gets the binary path.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string BinaryPath

Field Value

Type: String
See Also

Reference

BNCSFilePaths Class
BNCS Namespace


BNCSFilePaths.ConfigPath Field

BNCSFilePathsConfigPath Field
Gets the configuration path.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string ConfigPath

Field Value

Type: String
See Also

Reference

BNCSFilePaths Class
BNCS Namespace


BNCSFilePaths.DataPath Field

BNCSFilePathsDataPath Field
Gets the data path.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string DataPath

Field Value

Type: String
See Also

Reference

BNCSFilePaths Class
BNCS Namespace


BNCSFilePaths.DeviceTypesPath Field

BNCSFilePathsDeviceTypesPath Field
Gets the device types path.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string DeviceTypesPath

Field Value

Type: String
See Also

Reference

BNCSFilePaths Class
BNCS Namespace


BNCSFilePaths.IniFilePath Field

BNCSFilePathsIniFilePath Field
Gets the INI file path.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string IniFilePath

Field Value

Type: String
See Also

Reference

BNCSFilePaths Class
BNCS Namespace


BNCSFilePaths.InstancesPath Field

BNCSFilePathsInstancesPath Field
Gets the instances path.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string InstancesPath

Field Value

Type: String
See Also

Reference

BNCSFilePaths Class
BNCS Namespace


BNCSFilePaths.LibraryPath Field

BNCSFilePathsLibraryPath Field
Gets the library path.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string LibraryPath

Field Value

Type: String
See Also

Reference

BNCSFilePaths Class
BNCS Namespace


BNCSFilePaths.LogFilePath Field

BNCSFilePathsLogFilePath Field
Gets the log file path.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string LogFilePath

Field Value

Type: String
See Also

Reference

BNCSFilePaths Class
BNCS Namespace


BNCSFilePaths.RootPath Field

BNCSFilePathsRootPath Field
Gets the root path.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string RootPath

Field Value

Type: String
See Also

Reference

BNCSFilePaths Class
BNCS Namespace


BNCSFilePaths.SystemName Field

BNCSFilePathsSystemName Field
Gets the system name.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string SystemName

Field Value

Type: String
See Also

Reference

BNCSFilePaths Class
BNCS Namespace


BNCSFilePaths Methods

BNCSFilePaths Methods

The BNCSFilePaths type exposes the following members.

Methods
Name Description
BNCSFilePathsFactory
Gets the BNCS system file paths.
Examples
This sample shows how to retrieve a list of BNCS system file paths.
Copy
class Program
{
    static void Main()
    {
        BNCSFilePaths bncsFilePaths = BNCSFilePaths.BNCSFilePathsFactory();
        Console.WriteLine("BNCS System Paths for System\"" + bncsFilePaths.SystemName + "\"\n");
        Console.WriteLine("Binary path:\t\t" + bncsFilePaths.BinaryPath);
        Console.WriteLine("Configuration path:\t" + bncsFilePaths.ConfigPath);
        Console.WriteLine("Data path:\t\t" + bncsFilePaths.DataPath);
        Console.WriteLine("Device Types path:\t" + bncsFilePaths.DeviceTypesPath);
        Console.WriteLine("INI files path:\t\t" + bncsFilePaths.IniFilePath);
        Console.WriteLine("Instances path:\t\t" + bncsFilePaths.InstancesPath);
        Console.WriteLine("Library path:\t\t" + bncsFilePaths.LibraryPath);
        Console.WriteLine("Log File path:\t\t" + bncsFilePaths.LogFilePath);
        Console.WriteLine("Root path:\t\t" + bncsFilePaths.RootPath);
    }
}
Public method Equals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public method GetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method ToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
See Also

Reference

BNCSFilePaths Class
BNCS Namespace


BNCSFilePaths.BNCSFilePathsFactory Method

BNCSFilePathsBNCSFilePathsFactory Method
Gets the BNCS system file paths.
Examples
This sample shows how to retrieve a list of BNCS system file paths.
Copy
class Program
{
    static void Main()
    {
        BNCSFilePaths bncsFilePaths = BNCSFilePaths.BNCSFilePathsFactory();
        Console.WriteLine("BNCS System Paths for System\"" + bncsFilePaths.SystemName + "\"\n");
        Console.WriteLine("Binary path:\t\t" + bncsFilePaths.BinaryPath);
        Console.WriteLine("Configuration path:\t" + bncsFilePaths.ConfigPath);
        Console.WriteLine("Data path:\t\t" + bncsFilePaths.DataPath);
        Console.WriteLine("Device Types path:\t" + bncsFilePaths.DeviceTypesPath);
        Console.WriteLine("INI files path:\t\t" + bncsFilePaths.IniFilePath);
        Console.WriteLine("Instances path:\t\t" + bncsFilePaths.InstancesPath);
        Console.WriteLine("Library path:\t\t" + bncsFilePaths.LibraryPath);
        Console.WriteLine("Log File path:\t\t" + bncsFilePaths.LogFilePath);
        Console.WriteLine("Root path:\t\t" + bncsFilePaths.RootPath);
    }
}

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static BNCSFilePaths BNCSFilePathsFactory()

Return Value

Type: BNCSFilePaths
The BNCS system paths within a BNCS.BNCSFilePaths object.
See Also

Reference

BNCSFilePaths Class
BNCS Namespace


BNCSIdSlotMap Class

BNCSIdSlotMap Class
A class to manage a list of slot ranges
Inheritance Hierarchy
SystemObject
BNCSBNCSIdSlotMap

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BNCSIdSlotMap

The BNCSIdSlotMap type exposes the following members.

Constructors
 | Name | Description
Public method | BNCSIdSlotMap | Constructor checks the overall available slots, lowest and highest, it may work with. If they exceed 1 through 4096 (maximum slot range for a single InfoDriver) or if the lower limit value is a greater value than the upper limit value a ArgumentOutOfRangeException is thrown.
Top
Methods
 | Name | Description
Public method | Add | Adds the supplied slot range to the internal list, if an overlap occurs and range list editing happens an appropriate warning message is added to the internal list of errors
Public method | Clear | Clears all ranges and error messages
Public method | ContainsParameter | Ascertains if the supplied parameter number is in the slot range for the supplied device number
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetSlot | Gets an offset slot number for the parameter of the device referenced
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | SlotToDeviceParameter | Converts a slot number to it's device parameter
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | ErrorMessages | Gets the error message list, the list is copied and cleared before returning the copy
Public property | Ranges | Gets the range list
Top
See Also

Reference

BNCS Namespace


BNCSIdSlotMap Constructor

BNCSIdSlotMap Constructor
Constructor checks the overall available slots, lowest and highest, it may work with. If they exceed 1 through 4096 (maximum slot range for a single InfoDriver) or if the lower limit value is a greater value than the upper limit value a ArgumentOutOfRangeException is thrown.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSIdSlotMap(
    uint lowestUseableSlot_,
    uint highestUseableSlot_
)

Parameters

lowestUseableSlot_
Type: SystemUInt32
Lower slot limit
highestUseableSlot_
Type: SystemUInt32
Upper slot limit
See Also

Reference

BNCSIdSlotMap Class
BNCS Namespace


BNCSIdSlotMap Methods

BNCSIdSlotMap Methods

The BNCSIdSlotMap type exposes the following members.

Methods
 | Name | Description
Public method | Add | Adds the supplied slot range to the internal list, if an overlap occurs and range list editing happens an appropriate warning message is added to the internal list of errors
Public method | Clear | Clears all ranges and error messages
Public method | ContainsParameter | Ascertains if the supplied parameter number is in the slot range for the supplied device number
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetSlot | Gets an offset slot number for the parameter of the device referenced
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | SlotToDeviceParameter | Converts a slot number to it's device parameter
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

BNCSIdSlotMap Class
BNCS Namespace


BNCSIdSlotMap.Add Method

BNCSIdSlotMapAdd Method
Adds the supplied slot range to the internal list, if an overlap occurs and range list editing happens an appropriate warning message is added to the internal list of errors

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Add(
    BNCSIdSlotRange range_
)

Parameters

range_
Type: BNCSBNCSIdSlotRange
Range to add
See Also

Reference

BNCSIdSlotMap Class
BNCS Namespace


BNCSIdSlotMap.Clear Method

BNCSIdSlotMapClear Method
Clears all ranges and error messages

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Clear()
See Also

Reference

BNCSIdSlotMap Class
BNCS Namespace


BNCSIdSlotMap.ContainsParameter Method

BNCSIdSlotMapContainsParameter Method
Ascertains if the supplied parameter number is in the slot range for the supplied device number

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool ContainsParameter(
    int deviceNumber_,
    int parameterNumber_
)

Parameters

deviceNumber_
Type: SystemInt32
Device number to check
parameterNumber_
Type: SystemInt32
Parameter number to check

Return Value

Type: Boolean
True if the supplied parameter number was found
See Also

Reference

BNCSIdSlotMap Class
BNCS Namespace


BNCSIdSlotMap.GetSlot Method

BNCSIdSlotMapGetSlot Method
Gets an offset slot number for the parameter of the device referenced

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int GetSlot(
    int deviceNumber_,
    int parameterNumber_
)

Parameters

deviceNumber_
Type: SystemInt32
Device number
parameterNumber_
Type: SystemInt32
Parameter number

Return Value

Type: Int32
The literal slot number or zero on error
See Also

Reference

BNCSIdSlotMap Class
BNCS Namespace


BNCSIdSlotMap.SlotToDeviceParameter Method

BNCSIdSlotMapSlotToDeviceParameter Method
Converts a slot number to it's device parameter

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public UnitParameterAddress SlotToDeviceParameter(
    int slot_
)

Parameters

slot_
Type: SystemInt32
Slot to convert

Return Value

Type: UnitParameterAddress
The device parameter as a UnitParameterAddress pertaining to the supplied slot number or NULL
See Also

Reference

BNCSIdSlotMap Class
BNCS Namespace


BNCSIdSlotMap Properties

BNCSIdSlotMap Properties

The BNCSIdSlotMap type exposes the following members.

Properties
 | Name | Description
Public property | ErrorMessages | Gets the error message list, the list is copied and cleared before returning the copy
Public property | Ranges | Gets the range list
Top
See Also

Reference

BNCSIdSlotMap Class
BNCS Namespace


BNCSIdSlotMap.ErrorMessages Property

BNCSIdSlotMapErrorMessages Property
Gets the error message list, the list is copied and cleared before returning the copy

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<string> ErrorMessages { get; }

Property Value

Type: List String
See Also

Reference

BNCSIdSlotMap Class
BNCS Namespace


BNCSIdSlotMap.Ranges Property

BNCSIdSlotMapRanges Property
Gets the range list

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<BNCSIdSlotRange> Ranges { get; }

Property Value

Type: List BNCSIdSlotRange
See Also

Reference

BNCSIdSlotMap Class
BNCS Namespace


BNCSIdSlotRange Class

BNCSIdSlotRange Class
A slot range representing a range of slot/parameter pairs (BNCSIdSlotRangeItem) for a single unit
Inheritance Hierarchy
SystemObject
BNCSBNCSIdSlotRange

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BNCSIdSlotRange : IComparable

The BNCSIdSlotRange type exposes the following members.

Constructors
 | Name | Description
Public method | BNCSIdSlotRange | Constructor sets the device or unit number and the ID slot offset
Top
Methods
 | Name | Description
Public method | CompareTo | CompareTo() method to satisfy IComparable, this is required to ensure a list of BNCSIdSlotRange will be sorted correctly when Sort() is called on the list.
Public method | ContainsParameter | Ascertains if the supplied parameter number is in the slot range
Public method | Equals | Compares this instance with another supplied, this is required so that any IndexOf call on a list of these will match the instances as required (Overrides ObjectEquals(Object).)
Public method | GetHashCode | This must be overriden when Equals() is overriden (Overrides ObjectGetHashCode.)
Public method | GetSlot | Gets the literal slot for the supplied parameter number
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | GetUnitParameterAddress | Gets a device number/parameter number pair based on the supplied slot
Public method | SetSlot | Sets a parameter/slot pair and adds it to the internal list
Public method | Shrink | Shrinks the list of slot range items by one, it removes the last item
Public method | ToString | Returns the class instance as a string (Overrides ObjectToString.)
Top
Properties
 | Name | Description
Public property | DeviceNumber | Gets the device number
Public property | Highest | Gets the highest zero based slot
Public property | LiteralHighest | Gets the highest literal slot (ie slot + offset)
Public property | LiteralLowest | Gets the lowest literal slot (ie slot + offset)
Public property | Lowest | Gets the lowest zero based slot
Public property | SlotOffset | Gets the slot offset
Top
See Also

Reference

BNCS Namespace


BNCSIdSlotRange Constructor

BNCSIdSlotRange Constructor
Constructor sets the device or unit number and the ID slot offset

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSIdSlotRange(
    int deviceNumber_,
    int slotOffset_
)

Parameters

deviceNumber_
Type: SystemInt32
Device number
slotOffset_
Type: SystemInt32
Slot offset
See Also

Reference

BNCSIdSlotRange Class
BNCS Namespace


BNCSIdSlotRange Methods

BNCSIdSlotRange Methods

The BNCSIdSlotRange type exposes the following members.

Methods
 | Name | Description
Public method | CompareTo | CompareTo() method to satisfy IComparable, this is required to ensure a list of BNCSIdSlotRange will be sorted correctly when Sort() is called on the list.
Public method | ContainsParameter | Ascertains if the supplied parameter number is in the slot range
Public method | Equals | Compares this instance with another supplied, this is required so that any IndexOf call on a list of these will match the instances as required (Overrides ObjectEquals(Object).)
Public method | GetHashCode | This must be overriden when Equals() is overriden (Overrides ObjectGetHashCode.)
Public method | GetSlot | Gets the literal slot for the supplied parameter number
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | GetUnitParameterAddress | Gets a device number/parameter number pair based on the supplied slot
Public method | SetSlot | Sets a parameter/slot pair and adds it to the internal list
Public method | Shrink | Shrinks the list of slot range items by one, it removes the last item
Public method | ToString | Returns the class instance as a string (Overrides ObjectToString.)
Top
See Also

Reference

BNCSIdSlotRange Class
BNCS Namespace


BNCSIdSlotRange.CompareTo Method

BNCSIdSlotRangeCompareTo Method
CompareTo() method to satisfy IComparable, this is required to ensure a list of BNCSIdSlotRange will be sorted correctly when Sort() is called on the list.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int CompareTo(
    Object object_
)

Parameters

object_
Type: SystemObject
Other instance to compare with

Return Value

Type: Int32
-1 if THIS is less than the other, 0 if THIS is equal to other or -1 if THIS is greater than other

Implements

IComparableCompareTo(Object)
See Also

Reference

BNCSIdSlotRange Class
BNCS Namespace


BNCSIdSlotRange.ContainsParameter Method

BNCSIdSlotRangeContainsParameter Method
Ascertains if the supplied parameter number is in the slot range

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool ContainsParameter(
    int parameterNumber_
)

Parameters

parameterNumber_
Type: SystemInt32
Parameter number to check

Return Value

Type: Boolean
True if the supplied parameter number was found
See Also

Reference

BNCSIdSlotRange Class
BNCS Namespace


BNCSIdSlotRange.Equals Method

BNCSIdSlotRangeEquals Method
Compares this instance with another supplied, this is required so that any IndexOf call on a list of these will match the instances as required

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override bool Equals(
    Object object_
)

Parameters

object_
Type: SystemObject
Other instance

Return Value

Type: Boolean
True if this instance is equal to the supplied instance
See Also

Reference

BNCSIdSlotRange Class
BNCS Namespace


BNCSIdSlotRange.GetHashCode Method

BNCSIdSlotRangeGetHashCode Method
This must be overriden when Equals() is overriden

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override int GetHashCode()

Return Value

Type: Int32
The base class hash code
See Also

Reference

BNCSIdSlotRange Class
BNCS Namespace


BNCSIdSlotRange.GetSlot Method

BNCSIdSlotRangeGetSlot Method
Gets the literal slot for the supplied parameter number

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int GetSlot(
    int parameter_
)

Parameters

parameter_
Type: SystemInt32
Parameter number

Return Value

Type: Int32
A slot number or -1 if the parameter is not found
See Also

Reference

BNCSIdSlotRange Class
BNCS Namespace


BNCSIdSlotRange.GetUnitParameterAddress Method

BNCSIdSlotRangeGetUnitParameterAddress Method
Gets a device number/parameter number pair based on the supplied slot

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public UnitParameterAddress GetUnitParameterAddress(
    int slot_
)

Parameters

slot_
Type: SystemInt32
Slot to find

Return Value

Type: UnitParameterAddress
A unit/parameter pair object or null if not found
See Also

Reference

BNCSIdSlotRange Class
BNCS Namespace


BNCSIdSlotRange.SetSlot Method

BNCSIdSlotRangeSetSlot Method
Sets a parameter/slot pair and adds it to the internal list

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSIdSlotRangeItem SetSlot(
    int parameter_,
    int slot_
)

Parameters

parameter_
Type: SystemInt32
Parameter number
slot_
Type: SystemInt32
Slot number

Return Value

Type: BNCSIdSlotRangeItem
A slot range item
See Also

Reference

BNCSIdSlotRange Class
BNCS Namespace


BNCSIdSlotRange.Shrink Method

BNCSIdSlotRangeShrink Method
Shrinks the list of slot range items by one, it removes the last item

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Shrink()

Return Value

Type: Boolean
True on success
See Also

Reference

BNCSIdSlotRange Class
BNCS Namespace


BNCSIdSlotRange.ToString Method

BNCSIdSlotRangeToString Method
Returns the class instance as a string

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
A string to represent the class instance
See Also

Reference

BNCSIdSlotRange Class
BNCS Namespace


BNCSIdSlotRange Properties

BNCSIdSlotRange Properties

The BNCSIdSlotRange type exposes the following members.

Properties
 | Name | Description
Public property | DeviceNumber | Gets the device number
Public property | Highest | Gets the highest zero based slot
Public property | LiteralHighest | Gets the highest literal slot (ie slot + offset)
Public property | LiteralLowest | Gets the lowest literal slot (ie slot + offset)
Public property | Lowest | Gets the lowest zero based slot
Public property | SlotOffset | Gets the slot offset
Top
See Also

Reference

BNCSIdSlotRange Class
BNCS Namespace


BNCSIdSlotRange.DeviceNumber Property

BNCSIdSlotRangeDeviceNumber Property
Gets the device number

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int DeviceNumber { get; }

Property Value

Type: Int32
See Also

Reference

BNCSIdSlotRange Class
BNCS Namespace


BNCSIdSlotRange.Highest Property

BNCSIdSlotRangeHighest Property
Gets the highest zero based slot

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Highest { get; }

Property Value

Type: Int32
See Also

Reference

BNCSIdSlotRange Class
BNCS Namespace


BNCSIdSlotRange.LiteralHighest Property

BNCSIdSlotRangeLiteralHighest Property
Gets the highest literal slot (ie slot + offset)

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int LiteralHighest { get; }

Property Value

Type: Int32
See Also

Reference

BNCSIdSlotRange Class
BNCS Namespace


BNCSIdSlotRange.LiteralLowest Property

BNCSIdSlotRangeLiteralLowest Property
Gets the lowest literal slot (ie slot + offset)

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int LiteralLowest { get; }

Property Value

Type: Int32
See Also

Reference

BNCSIdSlotRange Class
BNCS Namespace


BNCSIdSlotRange.Lowest Property

BNCSIdSlotRangeLowest Property
Gets the lowest zero based slot

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Lowest { get; }

Property Value

Type: Int32
See Also

Reference

BNCSIdSlotRange Class
BNCS Namespace


BNCSIdSlotRange.SlotOffset Property

BNCSIdSlotRangeSlotOffset Property
Gets the slot offset

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int SlotOffset { get; }

Property Value

Type: Int32
See Also

Reference

BNCSIdSlotRange Class
BNCS Namespace


BNCSIdSlotRangeItem Class

BNCSIdSlotRangeItem Class
A slot range item consisting of a parameter number and a zero based slot number
Inheritance Hierarchy
SystemObject
BNCSBNCSIdSlotRangeItem

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BNCSIdSlotRangeItem

The BNCSIdSlotRangeItem type exposes the following members.

Constructors
 | Name | Description
Public method | BNCSIdSlotRangeItem | Constructor, sets the slot and parameter values
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the class using it's slot number (Overrides ObjectToString.)
Top
Properties
 | Name | Description
Public property | Parameter | Gets the parameter number
Public property | Slot | Gets the zero based slot number
Top
See Also

Reference

BNCS Namespace


BNCSIdSlotRangeItem Constructor

BNCSIdSlotRangeItem Constructor
Constructor, sets the slot and parameter values

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSIdSlotRangeItem(
    int parameter_,
    int slot_
)

Parameters

parameter_
Type: SystemInt32
Parameter number
slot_
Type: SystemInt32
Slot number
See Also

Reference

BNCSIdSlotRangeItem Class
BNCS Namespace


BNCSIdSlotRangeItem Methods

BNCSIdSlotRangeItem Methods

The BNCSIdSlotRangeItem type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the class using it's slot number (Overrides ObjectToString.)
Top
See Also

Reference

BNCSIdSlotRangeItem Class
BNCS Namespace


BNCSIdSlotRangeItem.ToString Method

BNCSIdSlotRangeItemToString Method
Returns a string representation of the class using it's slot number

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
The slot number as a string.
See Also

Reference

BNCSIdSlotRangeItem Class
BNCS Namespace


BNCSIdSlotRangeItem Properties

BNCSIdSlotRangeItem Properties

The BNCSIdSlotRangeItem type exposes the following members.

Properties
 | Name | Description
Public property | Parameter | Gets the parameter number
Public property | Slot | Gets the zero based slot number
Top
See Also

Reference

BNCSIdSlotRangeItem Class
BNCS Namespace


BNCSIdSlotRangeItem.Parameter Property

BNCSIdSlotRangeItemParameter Property
Gets the parameter number

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Parameter { get; }

Property Value

Type: Int32
See Also

Reference

BNCSIdSlotRangeItem Class
BNCS Namespace


BNCSIdSlotRangeItem.Slot Property

BNCSIdSlotRangeItemSlot Property
Gets the zero based slot number

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Slot { get; }

Property Value

Type: Int32
See Also

Reference

BNCSIdSlotRangeItem Class
BNCS Namespace


BNCSInstanceReference Class

BNCSInstanceReference Class
A class representing a reference to an instance.
Inheritance Hierarchy
SystemObject
BNCSBNCSInstanceReference

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BNCSInstanceReference

The BNCSInstanceReference type exposes the following members.

Constructors
 | Name | Description
Public method | BNCSInstanceReference(String) | Constructor that sets the r/o properties from the string provided.
Public method | BNCSInstanceReference(Int32, Int32) | Constructor that sets the r/o properties directly from the supplied arguments
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the class. (Overrides ObjectToString.)
Top
Properties
 | Name | Description
Public property | DeviceNumber | Returns the device number.
Public property | IsValid | Returns true if an instance is valid. Both device number and slot offset must be greater than -1.
Public property | SlotOffset | Returns the slot offset.
Top
See Also

Reference

BNCS Namespace


BNCSInstanceReference Constructor

BNCSInstanceReference Constructor
Overload List
 | Name | Description
Public method | BNCSInstanceReference(String) | Constructor that sets the r/o properties from the string provided.
Public method | BNCSInstanceReference(Int32, Int32) | Constructor that sets the r/o properties directly from the supplied arguments
Top
See Also

Reference

BNCSInstanceReference Class
BNCS Namespace


BNCSInstanceReference Constructor (String)

BNCSInstanceReference Constructor (String)
Constructor that sets the r/o properties from the string provided.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSInstanceReference(
    string reference_
)

Parameters

reference_
Type: SystemString
An XML string betraying device number and slot offset
See Also

Reference

BNCSInstanceReference Class
BNCSInstanceReference Overload
BNCS Namespace


BNCSInstanceReference Constructor (Int32, Int32)

BNCSInstanceReference Constructor (Int32, Int32)
Constructor that sets the r/o properties directly from the supplied arguments

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSInstanceReference(
    int deviceNumber_,
    int slotOffset_
)

Parameters

deviceNumber_
Type: SystemInt32
The device number
slotOffset_
Type: SystemInt32
Slot offset
See Also

Reference

BNCSInstanceReference Class
BNCSInstanceReference Overload
BNCS Namespace


BNCSInstanceReference Methods

BNCSInstanceReference Methods

The BNCSInstanceReference type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the class. (Overrides ObjectToString.)
Top
See Also

Reference

BNCSInstanceReference Class
BNCS Namespace


BNCSInstanceReference.ToString Method

BNCSInstanceReferenceToString Method
Returns a string representation of the class.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
Returns a string representation of the class in the form "device=N,offset=N"
See Also

Reference

BNCSInstanceReference Class
BNCS Namespace


BNCSInstanceReference Properties

BNCSInstanceReference Properties

The BNCSInstanceReference type exposes the following members.

Properties
 | Name | Description
Public property | DeviceNumber | Returns the device number.
Public property | IsValid | Returns true if an instance is valid. Both device number and slot offset must be greater than -1.
Public property | SlotOffset | Returns the slot offset.
Top
See Also

Reference

BNCSInstanceReference Class
BNCS Namespace


BNCSInstanceReference.DeviceNumber Property

BNCSInstanceReferenceDeviceNumber Property
Returns the device number.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int DeviceNumber { get; }

Property Value

Type: Int32
See Also

Reference

BNCSInstanceReference Class
BNCS Namespace


BNCSInstanceReference.IsValid Property

BNCSInstanceReferenceIsValid Property
Returns true if an instance is valid. Both device number and slot offset must be greater than -1.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool IsValid { get; }

Property Value

Type: Boolean
See Also

Reference

BNCSInstanceReference Class
BNCS Namespace


BNCSInstanceReference.SlotOffset Property

BNCSInstanceReferenceSlotOffset Property
Returns the slot offset.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int SlotOffset { get; }

Property Value

Type: Int32
See Also

Reference

BNCSInstanceReference Class
BNCS Namespace


BNCSInstances Class

BNCSInstances Class
Class encapsulating a BNCS instances file
Examples
This sample shows how to instantiate BNCSInstances, it also demonstrates use of the BNCSUtilities.GetBNCSFilePaths method.
Copy
class TestClass
{
    static void Main()
    {
        BNCSFilePaths bncsFilePaths = BNCSUtilities.GetBNCSFilePaths();
        BNCSInstances bncsInstances = new BNCSInstances(bncsFilePaths.InstancesPath);
    }
}
Inheritance Hierarchy
SystemObject
BNCSBNCSInstances

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BNCSInstances : IEnumerable

The BNCSInstances type exposes the following members.

Constructors
Name Description
BNCSInstances(String)
Constructor receives the path to the BNCS instances XML file.
Examples
This example demonstrates getting BNCS file paths, BNCS instances and the device types and their parameters therein.
Copy
BNCSFilePaths paths = BNCSFilePaths.BNCSFilePathsFactory();
BNCSInstances instances = new BNCSInstances(paths.InstancesPath);
foreach (BNCSDeviceInstance instance in instances.Instances)
{
    Console.WriteLine("Instance name: " + instance.DeviceTypeName);
    // The device type will be null, create it from the device type path plaus device type name plus ".xml"
    if (null == instance.DeviceType)
        instance.DeviceType = new BNCSDeviceType(DirFuncs.IncludeTrailingBackslash(paths.DeviceTypesPath) + instance.DeviceTypeName + ".xml");
    if (null != instance.DeviceType)
    {
        Console.WriteLine("Parameters: " + instance.DeviceType.Parameters.Count.ToString());
        foreach (BNCSDeviceTypeParameter parameter in instance.DeviceType.Parameters)
            Console.WriteLine("   " + parameter.Name);
    }
    else
        Console.WriteLine("NULL device type returned!");
}
BNCSInstances(String, String)
Constructor receives the path to the BNCS instances XML file and the path to the BNCS device types XML files.
Examples
This example demonstrates getting BNCS file paths, BNCS instances and the device types and their parameters therein.
Copy
BNCSFilePaths paths = BNCSFilePaths.BNCSFilePathsFactory();
BNCSInstances instances = new BNCSInstances(paths.InstancesPath, paths.DeviceTypesPath);
foreach (BNCSDeviceInstance instance in instances.Instances)
{
    Console.WriteLine("Instance name: " + instance.DeviceTypeName);
    // If the device type is not null then show the parameter count and list them
    if (null != instance.DeviceType)
    {
        Console.WriteLine("Parameters: " + instance.DeviceType.Parameters.Count.ToString());
        foreach (BNCSDeviceTypeParameter parameter in instance.DeviceType.Parameters)
            Console.WriteLine("   " + parameter.Name);
    }
    else
        Console.WriteLine("NULL device type returned!");
}
Top
Methods
 | Name | Description
Public method | AddInstance | Adds an instance
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetCompositeGroupInstances | Returns composite group instances
Public method | GetEnumerator | Gets the enumerator
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetInstance | Returns a device instance by id
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Save | Writes the instances XML file back to disk
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
Name Description
Public property BadlyFormedXmlLines
Gets a count of badly formatted XML lines encountered (if any)
Public property Count
Gets the number of instances
Public property ErrorMessage
Gets an error string if an error occured
Public property Filename
Gets the instances file path and name
Instances
Gets the instances
Constructor receives the path to a device type XML file.
Examples
This example demonstrates getting BNCS file paths, BNCS instances and the device types and their parameters therein.
Copy
BNCSFilePaths paths = BNCSFilePaths.BNCSFilePathsFactory();
BNCSInstances instances = new BNCSInstances(paths.InstancesPath);
foreach (BNCSDeviceInstance instance in instances.Instances)
{
    Console.WriteLine("Instance name: " + instance.DeviceTypeName);
    // The device type will be null, create it from the device type path plaus device type name plus ".xml"
    if (null == instance.DeviceType)
        instance.DeviceType = new BNCSDeviceType(DirFuncs.IncludeTrailingBackslash(paths.DeviceTypesPath) + instance.DeviceTypeName + ".xml");
    if (null != instance.DeviceType)
    {
        Console.WriteLine("Parameters: " + instance.DeviceType.Parameters.Count.ToString());
        foreach (BNCSDeviceTypeParameter parameter in instance.DeviceType.Parameters)
            Console.WriteLine("   " + parameter.Name);
    }
    else
        Console.WriteLine("NULL device type returned!");
}
Public property InvalidInstances
Gets a list of invalid instances
Public property State
Gets the instance state
Top
See Also

Reference

BNCS Namespace


BNCSInstances Constructor

BNCSInstances Constructor
Overload List
Name Description
BNCSInstances(String)
Constructor receives the path to the BNCS instances XML file.
Examples
This example demonstrates getting BNCS file paths, BNCS instances and the device types and their parameters therein.
Copy
BNCSFilePaths paths = BNCSFilePaths.BNCSFilePathsFactory();
BNCSInstances instances = new BNCSInstances(paths.InstancesPath);
foreach (BNCSDeviceInstance instance in instances.Instances)
{
    Console.WriteLine("Instance name: " + instance.DeviceTypeName);
    // The device type will be null, create it from the device type path plaus device type name plus ".xml"
    if (null == instance.DeviceType)
        instance.DeviceType = new BNCSDeviceType(DirFuncs.IncludeTrailingBackslash(paths.DeviceTypesPath) + instance.DeviceTypeName + ".xml");
    if (null != instance.DeviceType)
    {
        Console.WriteLine("Parameters: " + instance.DeviceType.Parameters.Count.ToString());
        foreach (BNCSDeviceTypeParameter parameter in instance.DeviceType.Parameters)
            Console.WriteLine("   " + parameter.Name);
    }
    else
        Console.WriteLine("NULL device type returned!");
}
BNCSInstances(String, String)
Constructor receives the path to the BNCS instances XML file and the path to the BNCS device types XML files.
Examples
This example demonstrates getting BNCS file paths, BNCS instances and the device types and their parameters therein.
Copy
BNCSFilePaths paths = BNCSFilePaths.BNCSFilePathsFactory();
BNCSInstances instances = new BNCSInstances(paths.InstancesPath, paths.DeviceTypesPath);
foreach (BNCSDeviceInstance instance in instances.Instances)
{
    Console.WriteLine("Instance name: " + instance.DeviceTypeName);
    // If the device type is not null then show the parameter count and list them
    if (null != instance.DeviceType)
    {
        Console.WriteLine("Parameters: " + instance.DeviceType.Parameters.Count.ToString());
        foreach (BNCSDeviceTypeParameter parameter in instance.DeviceType.Parameters)
            Console.WriteLine("   " + parameter.Name);
    }
    else
        Console.WriteLine("NULL device type returned!");
}
Top
See Also

Reference

BNCSInstances Class
BNCS Namespace


BNCSInstances Constructor (String)

BNCSInstances Constructor (String)
Constructor receives the path to the BNCS instances XML file.
Examples
This example demonstrates getting BNCS file paths, BNCS instances and the device types and their parameters therein.
Copy
BNCSFilePaths paths = BNCSFilePaths.BNCSFilePathsFactory();
BNCSInstances instances = new BNCSInstances(paths.InstancesPath);
foreach (BNCSDeviceInstance instance in instances.Instances)
{
    Console.WriteLine("Instance name: " + instance.DeviceTypeName);
    // The device type will be null, create it from the device type path plaus device type name plus ".xml"
    if (null == instance.DeviceType)
        instance.DeviceType = new BNCSDeviceType(DirFuncs.IncludeTrailingBackslash(paths.DeviceTypesPath) + instance.DeviceTypeName + ".xml");
    if (null != instance.DeviceType)
    {
        Console.WriteLine("Parameters: " + instance.DeviceType.Parameters.Count.ToString());
        foreach (BNCSDeviceTypeParameter parameter in instance.DeviceType.Parameters)
            Console.WriteLine("   " + parameter.Name);
    }
    else
        Console.WriteLine("NULL device type returned!");
}

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSInstances(
    string bncsInstancesPath_
)

Parameters

bncsInstancesPath_
Type: SystemString
Path to an XML "BNCS Instances" file
See Also

Reference

BNCSInstances Class
BNCSInstances Overload
BNCS Namespace


BNCSInstances Constructor (String, String)

BNCSInstances Constructor (String, String)
Constructor receives the path to the BNCS instances XML file and the path to the BNCS device types XML files.
Examples
This example demonstrates getting BNCS file paths, BNCS instances and the device types and their parameters therein.
Copy
BNCSFilePaths paths = BNCSFilePaths.BNCSFilePathsFactory();
BNCSInstances instances = new BNCSInstances(paths.InstancesPath, paths.DeviceTypesPath);
foreach (BNCSDeviceInstance instance in instances.Instances)
{
    Console.WriteLine("Instance name: " + instance.DeviceTypeName);
    // If the device type is not null then show the parameter count and list them
    if (null != instance.DeviceType)
    {
        Console.WriteLine("Parameters: " + instance.DeviceType.Parameters.Count.ToString());
        foreach (BNCSDeviceTypeParameter parameter in instance.DeviceType.Parameters)
            Console.WriteLine("   " + parameter.Name);
    }
    else
        Console.WriteLine("NULL device type returned!");
}

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSInstances(
    string bncsInstancePath_,
    string bncsDeviceTypesPath_
)

Parameters

bncsInstancePath_
Type: SystemString
Path to an XML BNCS Instances file
bncsDeviceTypesPath_
Type: SystemString
Path to the XML device types
See Also

Reference

BNCSInstances Class
BNCSInstances Overload
BNCS Namespace


BNCSInstances Methods

BNCSInstances Methods

The BNCSInstances type exposes the following members.

Methods
 | Name | Description
Public method | AddInstance | Adds an instance
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetCompositeGroupInstances | Returns composite group instances
Public method | GetEnumerator | Gets the enumerator
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetInstance | Returns a device instance by id
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Save | Writes the instances XML file back to disk
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

BNCSInstances Class
BNCS Namespace


BNCSInstances.AddInstance Method

BNCSInstancesAddInstance Method
Adds an instance

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool AddInstance(
    BNCSDeviceInstance instance_
)

Parameters

instance_
Type: BNCSBNCSDeviceInstance
Instance to add of type BNCSDeviceInstance

Return Value

Type: Boolean
True on success
See Also

Reference

BNCSInstances Class
BNCS Namespace


BNCSInstances.GetCompositeGroupInstances Method

BNCSInstancesGetCompositeGroupInstances Method
Returns composite group instances

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<BNCSDeviceInstance> GetCompositeGroupInstances(
    string id_
)

Parameters

id_
Type: SystemString
Instance ID to get

Return Value

Type: List BNCSDeviceInstance
A list of instances of type BNCS.BNCSDeviceInstance
See Also

Reference

BNCSInstances Class
BNCS Namespace


BNCSInstances.GetEnumerator Method

BNCSInstancesGetEnumerator Method
Gets the enumerator

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public IEnumerator GetEnumerator()

Return Value

Type: IEnumerator
The instances enumerator

Implements

IEnumerableGetEnumerator
See Also

Reference

BNCSInstances Class
BNCS Namespace


BNCSInstances.GetInstance Method

BNCSInstancesGetInstance Method
Returns a device instance by id

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSDeviceInstance GetInstance(
    string id_
)

Parameters

id_
Type: SystemString
ID to match

Return Value

Type: BNCSDeviceInstance
The device instance or null on failure
See Also

Reference

BNCSInstances Class
BNCS Namespace


BNCSInstances.Save Method

BNCSInstancesSave Method
Writes the instances XML file back to disk

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Save()

Return Value

Type: Boolean
True on success
See Also

Reference

BNCSInstances Class
BNCS Namespace


BNCSInstances Properties

BNCSInstances Properties

The BNCSInstances type exposes the following members.

Properties
Name Description
Public property BadlyFormedXmlLines
Gets a count of badly formatted XML lines encountered (if any)
Public property Count
Gets the number of instances
Public property ErrorMessage
Gets an error string if an error occured
Public property Filename
Gets the instances file path and name
Instances
Gets the instances
Constructor receives the path to a device type XML file.
Examples
This example demonstrates getting BNCS file paths, BNCS instances and the device types and their parameters therein.
Copy
BNCSFilePaths paths = BNCSFilePaths.BNCSFilePathsFactory();
BNCSInstances instances = new BNCSInstances(paths.InstancesPath);
foreach (BNCSDeviceInstance instance in instances.Instances)
{
    Console.WriteLine("Instance name: " + instance.DeviceTypeName);
    // The device type will be null, create it from the device type path plaus device type name plus ".xml"
    if (null == instance.DeviceType)
        instance.DeviceType = new BNCSDeviceType(DirFuncs.IncludeTrailingBackslash(paths.DeviceTypesPath) + instance.DeviceTypeName + ".xml");
    if (null != instance.DeviceType)
    {
        Console.WriteLine("Parameters: " + instance.DeviceType.Parameters.Count.ToString());
        foreach (BNCSDeviceTypeParameter parameter in instance.DeviceType.Parameters)
            Console.WriteLine("   " + parameter.Name);
    }
    else
        Console.WriteLine("NULL device type returned!");
}
Public property InvalidInstances
Gets a list of invalid instances
Public property State
Gets the instance state
Top
See Also

Reference

BNCSInstances Class
BNCS Namespace


BNCSInstances.BadlyFormedXmlLines Property

BNCSInstancesBadlyFormedXmlLines Property
Gets a count of badly formatted XML lines encountered (if any)

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int BadlyFormedXmlLines { get; }

Property Value

Type: Int32
See Also

Reference

BNCSInstances Class
BNCS Namespace


BNCSInstances.Count Property

BNCSInstancesCount Property
Gets the number of instances

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Count { get; }

Property Value

Type: Int32
See Also

Reference

BNCSInstances Class
BNCS Namespace


BNCSInstances.ErrorMessage Property

BNCSInstancesErrorMessage Property
Gets an error string if an error occured

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string ErrorMessage { get; }

Property Value

Type: String
See Also

Reference

BNCSInstances Class
BNCS Namespace


BNCSInstances.Filename Property

BNCSInstancesFilename Property
Gets the instances file path and name

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Filename { get; }

Property Value

Type: String
See Also

Reference

BNCSInstances Class
BNCS Namespace


BNCSInstances.Instances Property

BNCSInstancesInstances Property
Gets the instances
Constructor receives the path to a device type XML file.
Examples
This example demonstrates getting BNCS file paths, BNCS instances and the device types and their parameters therein.
Copy
BNCSFilePaths paths = BNCSFilePaths.BNCSFilePathsFactory();
BNCSInstances instances = new BNCSInstances(paths.InstancesPath);
foreach (BNCSDeviceInstance instance in instances.Instances)
{
    Console.WriteLine("Instance name: " + instance.DeviceTypeName);
    // The device type will be null, create it from the device type path plaus device type name plus ".xml"
    if (null == instance.DeviceType)
        instance.DeviceType = new BNCSDeviceType(DirFuncs.IncludeTrailingBackslash(paths.DeviceTypesPath) + instance.DeviceTypeName + ".xml");
    if (null != instance.DeviceType)
    {
        Console.WriteLine("Parameters: " + instance.DeviceType.Parameters.Count.ToString());
        foreach (BNCSDeviceTypeParameter parameter in instance.DeviceType.Parameters)
            Console.WriteLine("   " + parameter.Name);
    }
    else
        Console.WriteLine("NULL device type returned!");
}

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<BNCSDeviceInstance> Instances { get; }

Property Value

Type: List BNCSDeviceInstance
See Also

Reference

BNCSInstances Class
BNCS Namespace


BNCSInstances.InvalidInstances Property

BNCSInstancesInvalidInstances Property
Gets a list of invalid instances

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<BNCSDeviceInstance> InvalidInstances { get; }

Property Value

Type: List BNCSDeviceInstance
See Also

Reference

BNCSInstances Class
BNCS Namespace


BNCSInstances.State Property

BNCSInstancesState Property
Gets the instance state

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public InstancesState State { get; }

Property Value

Type: InstancesState
See Also

Reference

BNCSInstances Class
BNCS Namespace


BNCSInternalInfoDriver Class

BNCSInternalInfoDriver Class
BNCS "internal" InfoDriver class, a class representing an InfoDriver, ie a dictionary of slot number/value pairs. For use when communication appears to be lost with a real InfoDriver.
Inheritance Hierarchy
SystemObject
BNCSBNCSInternalInfoDriver

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BNCSInternalInfoDriver

The BNCSInternalInfoDriver type exposes the following members.

Constructors
 | Name | Description
Public method | BNCSInternalInfoDriver | Initializes a new instance of the BNCSInternalInfoDriver class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetSlots | Gets a new dictionary instance of all slot/value pairs to write to a real InfoDriver when back on line. The underlying slots are then cleared.
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Public method | WriteToSlot | "Writes" (stores) a string value against a key (integral slot number in memory. If the key is not found it is added else the existing keys value is updated with the data value supplied.
Top
Properties
 | Name | Description
Public property | HasData | Returns true if the instance has at least one slot defined
Top
See Also

Reference

BNCS Namespace


BNCSInternalInfoDriver Constructor

BNCSInternalInfoDriver Constructor
Initializes a new instance of the BNCSInternalInfoDriver class

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSInternalInfoDriver()
See Also

Reference

BNCSInternalInfoDriver Class
BNCS Namespace


BNCSInternalInfoDriver Methods

BNCSInternalInfoDriver Methods

The BNCSInternalInfoDriver type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetSlots | Gets a new dictionary instance of all slot/value pairs to write to a real InfoDriver when back on line. The underlying slots are then cleared.
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Public method | WriteToSlot | "Writes" (stores) a string value against a key (integral slot number in memory. If the key is not found it is added else the existing keys value is updated with the data value supplied.
Top
See Also

Reference

BNCSInternalInfoDriver Class
BNCS Namespace


BNCSInternalInfoDriver.GetSlots Method

BNCSInternalInfoDriverGetSlots Method
Gets a new dictionary instance of all slot/value pairs to write to a real InfoDriver when back on line. The underlying slots are then cleared.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Dictionary<uint, string> GetSlots()

Return Value

Type: Dictionary UInt32, String
Dictionary of uint/string pairs
See Also

Reference

BNCSInternalInfoDriver Class
BNCS Namespace


BNCSInternalInfoDriver.WriteToSlot Method

BNCSInternalInfoDriverWriteToSlot Method
"Writes" (stores) a string value against a key (integral slot number in memory. If the key is not found it is added else the existing keys value is updated with the data value supplied.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void WriteToSlot(
    uint slot_,
    string data_
)

Parameters

slot_
Type: SystemUInt32
Slot number
data_
Type: SystemString
Value
See Also

Reference

BNCSInternalInfoDriver Class
BNCS Namespace


BNCSInternalInfoDriver Properties

BNCSInternalInfoDriver Properties

The BNCSInternalInfoDriver type exposes the following members.

Properties
 | Name | Description
Public property | HasData | Returns true if the instance has at least one slot defined
Top
See Also

Reference

BNCSInternalInfoDriver Class
BNCS Namespace


BNCSInternalInfoDriver.HasData Property

BNCSInternalInfoDriverHasData Property
Returns true if the instance has at least one slot defined

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool HasData { get; }

Property Value

Type: Boolean
See Also

Reference

BNCSInternalInfoDriver Class
BNCS Namespace


BNCSLogFile Class

BNCSLogFile Class
A class for writing log entries out to a text file, the file name is constructed like so: YearMonthDay_HourMinuteSecond_DriverName_InfoDriverNumber.log ie, YYYYMMDD_HHMMSS_DRIVERNAME_INFODRIVERNUMBER.log, eg 20150108_165059_S3Fiesta_403.log. An option exists to mirror data to a tail file. The main file is only finalised on closure, the tail file executes an open, write, close operation for each write for use with a tailing program. When archive seconds are defined the file will close and commit to disk after the configured amount of seconds. This action is itself logged as the last line in the current file. A fresh file is created anew with the above naming convention. If calls that do not specify a log directory are used then the directory defaults to the BNCS system log directory.
Inheritance Hierarchy
SystemObject
BNCSBNCSLogFile

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BNCSLogFile

The BNCSLogFile type exposes the following members.

Constructors
 | Name | Description
Public method | BNCSLogFile(String) | Constructor that takes a driver name. The file will be written to the BNCS system log directory.
Public method | BNCSLogFile(String, Int32) | Constructor that takes a driver name, InfoDriver number and number of seconds to archive. The file will be written to the BNCS system log directory.
Public method | BNCSLogFile(String, String) | Constructor that takes a driver name and the log directory.
Public method | BNCSLogFile(String, UInt32) | Constructor that takes a driver name, and number of seconds to archive. The file will be written to the BNCS system log directory.
Public method | BNCSLogFile(String, Int32, String) | Constructor that takes a driver name, InfoDriver number and the log directory.
Public method | BNCSLogFile(String, Int32, UInt32) | Constructor that takes a driver name, InfoDriver number and number of seconds to archive. The file will be written to the BNCS system log directory.
Public method | BNCSLogFile(String, String, String) | Constructor that takes a driver name, device ID and the log directory.
Public method | BNCSLogFile(String, String, UInt32) | Constructor that takes a driver name, device ID and number of seconds to archive.
Public method | BNCSLogFile(String, UInt32, String) | Constructor that takes a driver name, number of seconds to archive and the log directory.
Public method | BNCSLogFile(String, Int32, UInt32, String) | Constructor that takes a driver name, InfoDriver number, number of seconds to archive and the log directory.
Public method | BNCSLogFile(String, String, UInt32, String) | Constructor that takes a driver name, device ID, number of seconds to archive and the log directory.
Top
Methods
 | Name | Description
Public method | AssignMirrorTailFile(String) | Assigns a tail file to mirror input into
Public method | AssignMirrorTailFile(String, Boolean) | Assigns a tail file to mirror input into
Public method | Close | Stops the archiver, closes and writes the file and disposes of the file object.
Public method | EmptyTailFile | Empties the tail file
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | Flush | Flushes all buffers to force a write to disk
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Public method | Write(String) | Writes the supplied message to the file only
Public method | Write(String) | Writes the supplied message array to the file only
Public method | Write(String, Boolean) | Writes the supplied message to the file
Public method | Write(String, Boolean) | Writes the supplied message array to the file only
Top
Properties
 | Name | Description
Public property | ArchiveSeconds | Gets or sets the number of seconds before the file is closed, archived and reopened anew. When set to a value greater than zero the ArchiveTopOfHour property is set to false.
Public property | ArchiveTopOfHour | Gets or sets a flag that, when true, causes the file to close, archive and reopen anew at the top of every hour. When set to true the ArchiveSeconds property is set to zero.
Public property | Filename | Gets the full path to and name of the log file
Public property | Tailing | Returns true if data is mirrored to a tail file
Top
Events
 | Name | Description
Public event | OnArchive | Event handler that fires each time the log is archived and a new one is created.
Top
See Also

Reference

BNCS Namespace


BNCSLogFile Constructor

BNCSLogFile Constructor
Overload List
 | Name | Description
Public method | BNCSLogFile(String) | Constructor that takes a driver name. The file will be written to the BNCS system log directory.
Public method | BNCSLogFile(String, Int32) | Constructor that takes a driver name, InfoDriver number and number of seconds to archive. The file will be written to the BNCS system log directory.
Public method | BNCSLogFile(String, String) | Constructor that takes a driver name and the log directory.
Public method | BNCSLogFile(String, UInt32) | Constructor that takes a driver name, and number of seconds to archive. The file will be written to the BNCS system log directory.
Public method | BNCSLogFile(String, Int32, String) | Constructor that takes a driver name, InfoDriver number and the log directory.
Public method | BNCSLogFile(String, Int32, UInt32) | Constructor that takes a driver name, InfoDriver number and number of seconds to archive. The file will be written to the BNCS system log directory.
Public method | BNCSLogFile(String, String, String) | Constructor that takes a driver name, device ID and the log directory.
Public method | BNCSLogFile(String, String, UInt32) | Constructor that takes a driver name, device ID and number of seconds to archive.
Public method | BNCSLogFile(String, UInt32, String) | Constructor that takes a driver name, number of seconds to archive and the log directory.
Public method | BNCSLogFile(String, Int32, UInt32, String) | Constructor that takes a driver name, InfoDriver number, number of seconds to archive and the log directory.
Public method | BNCSLogFile(String, String, UInt32, String) | Constructor that takes a driver name, device ID, number of seconds to archive and the log directory.
Top
See Also

Reference

BNCSLogFile Class
BNCS Namespace


BNCSLogFile Constructor (String)

BNCSLogFile Constructor (String)
Constructor that takes a driver name. The file will be written to the BNCS system log directory.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSLogFile(
    string driverName_
)

Parameters

driverName_
Type: SystemString
Name of driver or automatic
See Also

Reference

BNCSLogFile Class
BNCSLogFile Overload
BNCS Namespace


BNCSLogFile Constructor (String, Int32)

BNCSLogFile Constructor (String, Int32)
Constructor that takes a driver name, InfoDriver number and number of seconds to archive. The file will be written to the BNCS system log directory.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSLogFile(
    string driverName_,
    int infoDriverNumber_
)

Parameters

driverName_
Type: SystemString
Name of driver or automatic
infoDriverNumber_
Type: SystemInt32
Info Driver number
See Also

Reference

BNCSLogFile Class
BNCSLogFile Overload
BNCS Namespace


BNCSLogFile Constructor (String, String)

BNCSLogFile Constructor (String, String)
Constructor that takes a driver name and the log directory.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSLogFile(
    string driverName_,
    string logDirectory_
)

Parameters

driverName_
Type: SystemString
Name of driver or automatic
logDirectory_
Type: SystemString
Folder in which to write the log
See Also

Reference

BNCSLogFile Class
BNCSLogFile Overload
BNCS Namespace


BNCSLogFile Constructor (String, UInt32)

BNCSLogFile Constructor (String, UInt32)
Constructor that takes a driver name, and number of seconds to archive. The file will be written to the BNCS system log directory.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSLogFile(
    string driverName_,
    uint archiveSeconds_
)

Parameters

driverName_
Type: SystemString
Name of driver or automatic
archiveSeconds_
Type: SystemUInt32
Number of seconds before log is closed, archived and reopened anew
See Also

Reference

BNCSLogFile Class
BNCSLogFile Overload
BNCS Namespace


BNCSLogFile Constructor (String, Int32, String)

BNCSLogFile Constructor (String, Int32, String)
Constructor that takes a driver name, InfoDriver number and the log directory.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSLogFile(
    string driverName_,
    int infoDriverNumber_,
    string logDirectory_
)

Parameters

driverName_
Type: SystemString
Name of driver or automatic
infoDriverNumber_
Type: SystemInt32
Info Driver number
logDirectory_
Type: SystemString
Folder in which to write the log
See Also

Reference

BNCSLogFile Class
BNCSLogFile Overload
BNCS Namespace


BNCSLogFile Constructor (String, Int32, UInt32)

BNCSLogFile Constructor (String, Int32, UInt32)
Constructor that takes a driver name, InfoDriver number and number of seconds to archive. The file will be written to the BNCS system log directory.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSLogFile(
    string driverName_,
    int infoDriverNumber_,
    uint archiveSeconds_
)

Parameters

driverName_
Type: SystemString
Name of driver or automatic
infoDriverNumber_
Type: SystemInt32
Info Driver number
archiveSeconds_
Type: SystemUInt32
Number of seconds before log is closed, archived and reopened anew
See Also

Reference

BNCSLogFile Class
BNCSLogFile Overload
BNCS Namespace


BNCSLogFile Constructor (String, String, String)

BNCSLogFile Constructor (String, String, String)
Constructor that takes a driver name, device ID and the log directory.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSLogFile(
    string driverName_,
    string deviceID_,
    string logDirectory_
)

Parameters

driverName_
Type: SystemString
Name of driver or automatic
deviceID_
Type: SystemString
A device ID
logDirectory_
Type: SystemString
Folder in which to write the log
See Also

Reference

BNCSLogFile Class
BNCSLogFile Overload
BNCS Namespace


BNCSLogFile Constructor (String, String, UInt32)

BNCSLogFile Constructor (String, String, UInt32)
Constructor that takes a driver name, device ID and number of seconds to archive.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSLogFile(
    string driverName_,
    string deviceID_,
    uint archiveSeconds_
)

Parameters

driverName_
Type: SystemString
Name of driver or automatic
deviceID_
Type: SystemString
A device ID
archiveSeconds_
Type: SystemUInt32
Number of seconds before log is closed, archived and reopened anew
See Also

Reference

BNCSLogFile Class
BNCSLogFile Overload
BNCS Namespace


BNCSLogFile Constructor (String, UInt32, String)

BNCSLogFile Constructor (String, UInt32, String)
Constructor that takes a driver name, number of seconds to archive and the log directory.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSLogFile(
    string driverName_,
    uint archiveSeconds_,
    string logDirectory_
)

Parameters

driverName_
Type: SystemString
Name of driver or automatic
archiveSeconds_
Type: SystemUInt32
Number of seconds before log is closed, archived and reopened anew
logDirectory_
Type: SystemString
Folder in which to write the log
See Also

Reference

BNCSLogFile Class
BNCSLogFile Overload
BNCS Namespace


BNCSLogFile Constructor (String, Int32, UInt32, String)

BNCSLogFile Constructor (String, Int32, UInt32, String)
Constructor that takes a driver name, InfoDriver number, number of seconds to archive and the log directory.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSLogFile(
    string driverName_,
    int infoDriverNumber_,
    uint archiveSeconds_,
    string logDirectory_
)

Parameters

driverName_
Type: SystemString
Name of driver or automatic
infoDriverNumber_
Type: SystemInt32
Info Driver number
archiveSeconds_
Type: SystemUInt32
Number of seconds before log is closed, archived and reopened anew
logDirectory_
Type: SystemString
Folder in which to write the log
See Also

Reference

BNCSLogFile Class
BNCSLogFile Overload
BNCS Namespace


BNCSLogFile Constructor (String, String, UInt32, String)

BNCSLogFile Constructor (String, String, UInt32, String)
Constructor that takes a driver name, device ID, number of seconds to archive and the log directory.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSLogFile(
    string driverName_,
    string deviceID_,
    uint archiveSeconds_,
    string logDirectory_
)

Parameters

driverName_
Type: SystemString
Name of driver or automatic
deviceID_
Type: SystemString
A device ID
archiveSeconds_
Type: SystemUInt32
Number of seconds before log is closed, archived and reopened anew
logDirectory_
Type: SystemString
Folder in which to write the log
See Also

Reference

BNCSLogFile Class
BNCSLogFile Overload
BNCS Namespace


BNCSLogFile Methods

BNCSLogFile Methods

The BNCSLogFile type exposes the following members.

Methods
 | Name | Description
Public method | AssignMirrorTailFile(String) | Assigns a tail file to mirror input into
Public method | AssignMirrorTailFile(String, Boolean) | Assigns a tail file to mirror input into
Public method | Close | Stops the archiver, closes and writes the file and disposes of the file object.
Public method | EmptyTailFile | Empties the tail file
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | Flush | Flushes all buffers to force a write to disk
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Public method | Write(String) | Writes the supplied message to the file only
Public method | Write(String) | Writes the supplied message array to the file only
Public method | Write(String, Boolean) | Writes the supplied message to the file
Public method | Write(String, Boolean) | Writes the supplied message array to the file only
Top
See Also

Reference

BNCSLogFile Class
BNCS Namespace


BNCSLogFile.AssignMirrorTailFile Method

BNCSLogFileAssignMirrorTailFile Method
Overload List
 | Name | Description
Public method | AssignMirrorTailFile(String) | Assigns a tail file to mirror input into
Public method | AssignMirrorTailFile(String, Boolean) | Assigns a tail file to mirror input into
Top
See Also

Reference

BNCSLogFile Class
BNCS Namespace


BNCSLogFile.AssignMirrorTailFile Method (String)

BNCSLogFileAssignMirrorTailFile Method (String)
Assigns a tail file to mirror input into

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void AssignMirrorTailFile(
    string mirrorTailFile_
)

Parameters

mirrorTailFile_
Type: SystemString
Tail file path and name
See Also

Reference

BNCSLogFile Class
AssignMirrorTailFile Overload
BNCS Namespace


BNCSLogFile.AssignMirrorTailFile Method (String, Boolean)

BNCSLogFileAssignMirrorTailFile Method (String, Boolean)
Assigns a tail file to mirror input into

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void AssignMirrorTailFile(
    string mirrorTailFile_,
    bool appendToExistingFile_
)

Parameters

mirrorTailFile_
Type: SystemString
Tail file path and name
appendToExistingFile_
Type: SystemBoolean
Append flag
See Also

Reference

BNCSLogFile Class
AssignMirrorTailFile Overload
BNCS Namespace


BNCSLogFile.Close Method

BNCSLogFileClose Method
Stops the archiver, closes and writes the file and disposes of the file object.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Close()
See Also

Reference

BNCSLogFile Class
BNCS Namespace


BNCSLogFile.EmptyTailFile Method

BNCSLogFileEmptyTailFile Method
Empties the tail file

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void EmptyTailFile()
See Also

Reference

BNCSLogFile Class
BNCS Namespace


BNCSLogFile.Flush Method

BNCSLogFileFlush Method
Flushes all buffers to force a write to disk

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Flush()
See Also

Reference

BNCSLogFile Class
BNCS Namespace


BNCSLogFile.Write Method

BNCSLogFileWrite Method
Overload List
 | Name | Description
Public method | Write(String) | Writes the supplied message to the file only
Public method | Write(String) | Writes the supplied message array to the file only
Public method | Write(String, Boolean) | Writes the supplied message to the file
Public method | Write(String, Boolean) | Writes the supplied message array to the file only
Top
See Also

Reference

BNCSLogFile Class
BNCS Namespace


BNCSLogFile.Write Method (String)

BNCSLogFileWrite Method (String)
Writes the supplied message to the file only

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Write(
    string message_
)

Parameters

message_
Type: SystemString
Log message line to write

Return Value

Type: Boolean
True on success
See Also

Reference

BNCSLogFile Class
Write Overload
BNCS Namespace


BNCSLogFile.Write Method (String[])

BNCSLogFileWrite Method (String)
Writes the supplied message array to the file only

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Write(
    string[] messageElements_
)

Parameters

messageElements_
Type: SystemString
Log message lines to write

Return Value

Type: Boolean
True on success
See Also

Reference

BNCSLogFile Class
Write Overload
BNCS Namespace


BNCSLogFile.Write Method (String, Boolean)

BNCSLogFileWrite Method (String, Boolean)
Writes the supplied message to the file

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Write(
    string message_,
    bool writeToDebug_
)

Parameters

message_
Type: SystemString
Log message line to write
writeToDebug_
Type: SystemBoolean
System debugger flag, if true the message is also written out to the system debugger

Return Value

Type: Boolean
True on success
See Also

Reference

BNCSLogFile Class
Write Overload
BNCS Namespace


BNCSLogFile.Write Method (String[], Boolean)

BNCSLogFileWrite Method (String, Boolean)
Writes the supplied message array to the file only

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Write(
    string[] messageElements_,
    bool writeToDebug_
)

Parameters

messageElements_
Type: SystemString
Log message lines to write
writeToDebug_
Type: SystemBoolean
System debugger flag, if true the message is also written out to the system debugger

Return Value

Type: Boolean
True on success
See Also

Reference

BNCSLogFile Class
Write Overload
BNCS Namespace


BNCSLogFile Properties

BNCSLogFile Properties

The BNCSLogFile type exposes the following members.

Properties
 | Name | Description
Public property | ArchiveSeconds | Gets or sets the number of seconds before the file is closed, archived and reopened anew. When set to a value greater than zero the ArchiveTopOfHour property is set to false.
Public property | ArchiveTopOfHour | Gets or sets a flag that, when true, causes the file to close, archive and reopen anew at the top of every hour. When set to true the ArchiveSeconds property is set to zero.
Public property | Filename | Gets the full path to and name of the log file
Public property | Tailing | Returns true if data is mirrored to a tail file
Top
See Also

Reference

BNCSLogFile Class
BNCS Namespace


BNCSLogFile.ArchiveSeconds Property

BNCSLogFileArchiveSeconds Property
Gets or sets the number of seconds before the file is closed, archived and reopened anew. When set to a value greater than zero the ArchiveTopOfHour property is set to false.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint ArchiveSeconds { get; set; }

Property Value

Type: UInt32
See Also

Reference

BNCSLogFile Class
BNCS Namespace


BNCSLogFile.ArchiveTopOfHour Property

BNCSLogFileArchiveTopOfHour Property
Gets or sets a flag that, when true, causes the file to close, archive and reopen anew at the top of every hour. When set to true the ArchiveSeconds property is set to zero.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool ArchiveTopOfHour { get; set; }

Property Value

Type: Boolean
See Also

Reference

BNCSLogFile Class
BNCS Namespace


BNCSLogFile.Filename Property

BNCSLogFileFilename Property
Gets the full path to and name of the log file

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Filename { get; }

Property Value

Type: String
See Also

Reference

BNCSLogFile Class
BNCS Namespace


BNCSLogFile.Tailing Property

BNCSLogFileTailing Property
Returns true if data is mirrored to a tail file

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Tailing { get; }

Property Value

Type: Boolean
See Also

Reference

BNCSLogFile Class
BNCS Namespace


BNCSLogFile Events

BNCSLogFile Events

The BNCSLogFile type exposes the following members.

Events
 | Name | Description
Public event | OnArchive | Event handler that fires each time the log is archived and a new one is created.
Top
See Also

Reference

BNCSLogFile Class
BNCS Namespace


BNCSLogFile.OnArchive Event

BNCSLogFileOnArchive Event
Event handler that fires each time the log is archived and a new one is created.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnArchiveEventHandler OnArchive

Value

Type: BNCSOnArchiveEventHandler
See Also

Reference

BNCSLogFile Class
BNCS Namespace


BncsNetworkMessage Class

BncsNetworkMessage Class
Base class for all network message command classes.
Inheritance Hierarchy
SystemObject
BNCSBncsNetworkMessage
More...

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public abstract class BncsNetworkMessage

The BncsNetworkMessage type exposes the following members.

Constructors
 | Name | Description
Public method | BncsNetworkMessage | //Constructor
Top
Methods
 | Name | Description
Public method | AssembleCommand | Assembles the command as a string.
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
 | GetFriendlyPropertyNames | Populates property namers based on the supplied type.
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
 | GetNWMType | Gets an appropriate network message type from the supplied command string.
Public method | GetParams | Gets an appropriate parameter descriptor by message type.
 | GetParams(NetworkMessageType) | Gets an appropriate parameter descriptor by the supplied message type.
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
 | StringToMessage | Converts the supplied string to a BNCS network message.
Public method | ToString | Returns a string representation of the network message instance as a string showing it's description. (Overrides ObjectToString.)
Top
Fields
Name | Description
GPICommands | Friendly gpio driver commands.
GRDCommands | Friendly generic router driver commands.
IDCommands | Friendly info driver command names.
Top
Properties
 | Name | Description
Public property | CommandName | Gets the command name.
Public property | Description | Gets the description.
Public property | DeviceNumber | Gets the device number.
Public property | HostDriverType | Gets the host driver type.
Public property | NetworkMessage | Gets the network message string.
Public property | Type | Gets the command type.
Public property | WorkstationNumber | Gets the workstation number.
Top
See Also

Reference

BNCS Namespace
Inheritance Hierarchy
SystemObject
BNCSBncsNetworkMessage
BNCSGpiSetMessage
BNCSInfoWriteMessage
BNCSLockMessage
BNCSQueryPollMessage
BNCSRouterCrosspointMessage
BNCSRouterModifyMessage


BncsNetworkMessage Constructor

BncsNetworkMessage Constructor
//Constructor

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsNetworkMessage(
    string description_,
    string commandName_,
    uint deviceNumber_,
    uint workstationNumber_
)

Parameters

description_
Type: SystemString
Command description
commandName_
Type: SystemString
Command name
deviceNumber_
Type: SystemUInt32
Device number
workstationNumber_
Type: SystemUInt32
Workstation number
See Also

Reference

BncsNetworkMessage Class
BNCS Namespace


BncsNetworkMessage Fields

BncsNetworkMessage Fields

The BncsNetworkMessage type exposes the following members.

Fields
Name | Description
GPICommands | Friendly gpio driver commands.
GRDCommands | Friendly generic router driver commands.
IDCommands | Friendly info driver command names.
Top
See Also

Reference

BncsNetworkMessage Class
BNCS Namespace


BncsNetworkMessage.GPICommands Field

BncsNetworkMessageGPICommands Field
Friendly gpio driver commands.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string[] GPICommands

Field Value

Type: String
See Also

Reference

BncsNetworkMessage Class
BNCS Namespace


BncsNetworkMessage.GRDCommands Field

BncsNetworkMessageGRDCommands Field
Friendly generic router driver commands.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string[] GRDCommands

Field Value

Type: String
See Also

Reference

BncsNetworkMessage Class
BNCS Namespace


BncsNetworkMessage.IDCommands Field

BncsNetworkMessageIDCommands Field
Friendly info driver command names.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string[] IDCommands

Field Value

Type: String
See Also

Reference

BncsNetworkMessage Class
BNCS Namespace


BncsNetworkMessage Methods

BncsNetworkMessage Methods

The BncsNetworkMessage type exposes the following members.

Methods
 | Name | Description
Public method | AssembleCommand | Assembles the command as a string.
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
 | GetFriendlyPropertyNames | Populates property namers based on the supplied type.
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
 | GetNWMType | Gets an appropriate network message type from the supplied command string.
Public method | GetParams | Gets an appropriate parameter descriptor by message type.
 | GetParams(NetworkMessageType) | Gets an appropriate parameter descriptor by the supplied message type.
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
 | StringToMessage | Converts the supplied string to a BNCS network message.
Public method | ToString | Returns a string representation of the network message instance as a string showing it's description. (Overrides ObjectToString.)
Top
See Also

Reference

BncsNetworkMessage Class
BNCS Namespace


BncsNetworkMessage.AssembleCommand Method

BncsNetworkMessageAssembleCommand Method
Assembles the command as a string.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public abstract string AssembleCommand()

Return Value

Type: String
A command string to send to CSI.
See Also

Reference

BncsNetworkMessage Class
BNCS Namespace


BncsNetworkMessage.GetFriendlyPropertyNames Method

BncsNetworkMessageGetFriendlyPropertyNames Method
Populates property namers based on the supplied type.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static BncsNWMFriendlyPropertyNames GetFriendlyPropertyNames(
    NetworkMessageType type_
)

Parameters

type_
Type: BNCSNetworkMessageType
Type of class to populate for

Return Value

Type: BncsNWMFriendlyPropertyNames
A BncsNWMFriendlyPropertyNames with appropriate UI display names or null.
See Also

Reference

BncsNetworkMessage Class
BNCS Namespace


BncsNetworkMessage.GetNWMType Method

BncsNetworkMessageGetNWMType Method
Gets an appropriate network message type from the supplied command string.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static NetworkMessageType GetNWMType(
    string command_
)

Parameters

command_
Type: SystemString
Command string to match

Return Value

Type: NetworkMessageType
A network message type
See Also

Reference

BncsNetworkMessage Class
BNCS Namespace


BncsNetworkMessage.GetParams Method

BncsNetworkMessageGetParams Method
Overload List
 | Name | Description
Public method | GetParams | Gets an appropriate parameter descriptor by message type.
 | GetParams(NetworkMessageType) | Gets an appropriate parameter descriptor by the supplied message type.
Top
See Also

Reference

BncsNetworkMessage Class
BNCS Namespace


BncsNetworkMessage.GetParams Method

BncsNetworkMessageGetParams Method
Gets an appropriate parameter descriptor by message type.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public NetworkCommandParams GetParams()

Return Value

Type: NetworkCommandParams
A network command parameter descriptor.
See Also

Reference

BncsNetworkMessage Class
GetParams Overload
BNCS Namespace


BncsNetworkMessage.GetParams Method (NetworkMessageType)

BncsNetworkMessageGetParams Method (NetworkMessageType)
Gets an appropriate parameter descriptor by the supplied message type.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static NetworkCommandParams GetParams(
    NetworkMessageType type_
)

Parameters

type_
Type: BNCSNetworkMessageType
Network message type

Return Value

Type: NetworkCommandParams
A network command parameter descriptor.
See Also

Reference

BncsNetworkMessage Class
GetParams Overload
BNCS Namespace


BncsNetworkMessage.StringToMessage Method

BncsNetworkMessageStringToMessage Method
Converts the supplied string to a BNCS network message.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static BncsNetworkMessage StringToMessage(
    string command_
)

Parameters

command_
Type: SystemString
String to convert

Return Value

Type: BncsNetworkMessage
A BNCS network message on success else null
See Also

Reference

BncsNetworkMessage Class
BNCS Namespace


BncsNetworkMessage.ToString Method

BncsNetworkMessageToString Method
Returns a string representation of the network message instance as a string showing it's description.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
Returns the description member.
See Also

Reference

BncsNetworkMessage Class
BNCS Namespace


BncsNetworkMessage Properties

BncsNetworkMessage Properties

The BncsNetworkMessage type exposes the following members.

Properties
 | Name | Description
Public property | CommandName | Gets the command name.
Public property | Description | Gets the description.
Public property | DeviceNumber | Gets the device number.
Public property | HostDriverType | Gets the host driver type.
Public property | NetworkMessage | Gets the network message string.
Public property | Type | Gets the command type.
Public property | WorkstationNumber | Gets the workstation number.
Top
See Also

Reference

BncsNetworkMessage Class
BNCS Namespace


BncsNetworkMessage.CommandName Property

BncsNetworkMessageCommandName Property
Gets the command name.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string CommandName { get; }

Property Value

Type: String
See Also

Reference

BncsNetworkMessage Class
BNCS Namespace


BncsNetworkMessage.Description Property

BncsNetworkMessageDescription Property
Gets the description.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Description { get; }

Property Value

Type: String
See Also

Reference

BncsNetworkMessage Class
BNCS Namespace


BncsNetworkMessage.DeviceNumber Property

BncsNetworkMessageDeviceNumber Property
Gets the device number.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint DeviceNumber { get; }

Property Value

Type: UInt32
See Also

Reference

BncsNetworkMessage Class
BNCS Namespace


BncsNetworkMessage.HostDriverType Property

BncsNetworkMessageHostDriverType Property
Gets the host driver type.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public HostDriverType HostDriverType { get; }

Property Value

Type: HostDriverType
See Also

Reference

BncsNetworkMessage Class
BNCS Namespace


BncsNetworkMessage.NetworkMessage Property

BncsNetworkMessageNetworkMessage Property
Gets the network message string.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string NetworkMessage { get; }

Property Value

Type: String
See Also

Reference

BncsNetworkMessage Class
BNCS Namespace


BncsNetworkMessage.Type Property

BncsNetworkMessageType Property
Gets the command type.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public NetworkMessageType Type { get; }

Property Value

Type: NetworkMessageType
See Also

Reference

BncsNetworkMessage Class
BNCS Namespace


BncsNetworkMessage.WorkstationNumber Property

BncsNetworkMessageWorkstationNumber Property
Gets the workstation number.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint WorkstationNumber { get; }

Property Value

Type: UInt32
See Also

Reference

BncsNetworkMessage Class
BNCS Namespace


BncsNWMFriendlyPropertyNames Class

BncsNWMFriendlyPropertyNames Class
A helper class used to convey friendly property names for UI disp;ay.
Inheritance Hierarchy
SystemObject
BNCSBncsNWMFriendlyPropertyNames

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BncsNWMFriendlyPropertyNames

The BncsNWMFriendlyPropertyNames type exposes the following members.

Constructors
 | Name | Description
Public method | BncsNWMFriendlyPropertyNames | Initializes a new instance of the BncsNWMFriendlyPropertyNames class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | BooleanFriendlyName | A commands BOOLEAN properties friendly name.
Public field | StringFriendlyName | A commands STRING properties friendly name.
Public field | Uint1FriendlyName | A commands first UINT properties friendly name.
Public field | Uint2FriendlyName | A commands second UINT properties friendly name.
Top
See Also

Reference

BNCS Namespace


BncsNWMFriendlyPropertyNames Constructor

BncsNWMFriendlyPropertyNames Constructor
Initializes a new instance of the BncsNWMFriendlyPropertyNames class

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsNWMFriendlyPropertyNames()
See Also

Reference

BncsNWMFriendlyPropertyNames Class
BNCS Namespace


BncsNWMFriendlyPropertyNames Fields

BncsNWMFriendlyPropertyNames Fields

The BncsNWMFriendlyPropertyNames type exposes the following members.

Fields
 | Name | Description
Public field | BooleanFriendlyName | A commands BOOLEAN properties friendly name.
Public field | StringFriendlyName | A commands STRING properties friendly name.
Public field | Uint1FriendlyName | A commands first UINT properties friendly name.
Public field | Uint2FriendlyName | A commands second UINT properties friendly name.
Top
See Also

Reference

BncsNWMFriendlyPropertyNames Class
BNCS Namespace


BncsNWMFriendlyPropertyNames.BooleanFriendlyName Field

BncsNWMFriendlyPropertyNamesBooleanFriendlyName Field
A commands BOOLEAN properties friendly name.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string BooleanFriendlyName

Field Value

Type: String
See Also

Reference

BncsNWMFriendlyPropertyNames Class
BNCS Namespace


BncsNWMFriendlyPropertyNames.StringFriendlyName Field

BncsNWMFriendlyPropertyNamesStringFriendlyName Field
A commands STRING properties friendly name.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string StringFriendlyName

Field Value

Type: String
See Also

Reference

BncsNWMFriendlyPropertyNames Class
BNCS Namespace


BncsNWMFriendlyPropertyNames.Uint1FriendlyName Field

BncsNWMFriendlyPropertyNamesUint1FriendlyName Field
A commands first UINT properties friendly name.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Uint1FriendlyName

Field Value

Type: String
See Also

Reference

BncsNWMFriendlyPropertyNames Class
BNCS Namespace


BncsNWMFriendlyPropertyNames.Uint2FriendlyName Field

BncsNWMFriendlyPropertyNamesUint2FriendlyName Field
A commands second UINT properties friendly name.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Uint2FriendlyName

Field Value

Type: String
See Also

Reference

BncsNWMFriendlyPropertyNames Class
BNCS Namespace


BncsNWMFriendlyPropertyNames Methods

BncsNWMFriendlyPropertyNames Methods

The BncsNWMFriendlyPropertyNames type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

BncsNWMFriendlyPropertyNames Class
BNCS Namespace


BNCSSaveInstances Class

BNCSSaveInstances Class
A static class to save a collection of instances to the BNCS system instances file
Inheritance Hierarchy
SystemObject
BNCSBNCSSaveInstances

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static class BNCSSaveInstances
Methods
Name | Description
Save(String, ListBNCSDeviceInstance) | Saves the supplied instances to the supplied file name
Save(String, ListBNCSDeviceInstance, Boolean) | Saves the supplied instances to the supplied file name with an option to backup the existing file first
Top
See Also

Reference

BNCS Namespace


BNCSSaveInstances Methods

BNCSSaveInstances Methods
Methods
Name | Description
Save(String, ListBNCSDeviceInstance) | Saves the supplied instances to the supplied file name
Save(String, ListBNCSDeviceInstance, Boolean) | Saves the supplied instances to the supplied file name with an option to backup the existing file first
Top
See Also

Reference

BNCSSaveInstances Class
BNCS Namespace


BNCSSaveInstances.Save Method

BNCSSaveInstancesSave Method
Overload List
Name | Description
Save(String, ListBNCSDeviceInstance) | Saves the supplied instances to the supplied file name
Save(String, ListBNCSDeviceInstance, Boolean) | Saves the supplied instances to the supplied file name with an option to backup the existing file first
Top
See Also

Reference

BNCSSaveInstances Class
BNCS Namespace


BNCSSaveInstances.Save Method (String, List(BNCSDeviceInstance))

BNCSSaveInstancesSave Method (String, ListBNCSDeviceInstance)
Saves the supplied instances to the supplied file name

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Save(
    string filename_,
    List<BNCSDeviceInstance> instances_
)

Parameters

filename_
Type: SystemString
Path and name of BNCS instances XML file
instances_
Type: System.Collections.GenericList BNCSDeviceInstance
List of instances, ie devices, of type BNCSDeviceInstance

Return Value

Type: Boolean
True on success
See Also

Reference

BNCSSaveInstances Class
Save Overload
BNCS Namespace


BNCSSaveInstances.Save Method (String, List(BNCSDeviceInstance), Boolean)

BNCSSaveInstancesSave Method (String, ListBNCSDeviceInstance, Boolean)
Saves the supplied instances to the supplied file name with an option to backup the existing file first

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Save(
    string filename_,
    List<BNCSDeviceInstance> instances_,
    bool backupBeforeSaving_
)

Parameters

filename_
Type: SystemString
Path and name of BNCS instances XML file
instances_
Type: System.Collections.GenericList BNCSDeviceInstance
List of instances, ie devices, of type BNCSDeviceInstance
backupBeforeSaving_
Type: SystemBoolean
Back up flag

Return Value

Type: Boolean
True on success
See Also

Reference

BNCSSaveInstances Class
Save Overload
BNCS Namespace


BNCSTXCommander Class

BNCSTXCommander Class
Class for handling TX commands. The Transmit() method when called will fire up the OnTransmit event handler in your driver code.
Inheritance Hierarchy
SystemObject
BNCSBNCSTXCommander

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BNCSTXCommander

The BNCSTXCommander type exposes the following members.

Constructors
 | Name | Description
Public method | BNCSTXCommander | Constructor
Top
Methods
 | Name | Description
Public method | Complete | Marks operations as complete by stopping the internal timer.
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Public method | Transmit(Byte) | Transmits the supplied command
Public method | Transmit(Byte, Object) | Transmits the supplied command
Top
Properties
 | Name | Description
Public property | MaximumRetries | Gets or sets the maximum amount of retries before abandoning a command.
Top
See Also

Reference

BNCS Namespace


BNCSTXCommander Constructor

BNCSTXCommander Constructor
Constructor

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSTXCommander(
    BNCSTXEventHandler onTransmit_
)

Parameters

onTransmit_
Type: BNCSBNCSTXEventHandler
The transmit callback routine
See Also

Reference

BNCSTXCommander Class
BNCS Namespace


BNCSTXCommander Methods

BNCSTXCommander Methods

The BNCSTXCommander type exposes the following members.

Methods
 | Name | Description
Public method | Complete | Marks operations as complete by stopping the internal timer.
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Public method | Transmit(Byte) | Transmits the supplied command
Public method | Transmit(Byte, Object) | Transmits the supplied command
Top
See Also

Reference

BNCSTXCommander Class
BNCS Namespace


BNCSTXCommander.Complete Method

BNCSTXCommanderComplete Method
Marks operations as complete by stopping the internal timer.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Complete()
See Also

Reference

BNCSTXCommander Class
BNCS Namespace


BNCSTXCommander.Transmit Method

BNCSTXCommanderTransmit Method
Overload List
 | Name | Description
Public method | Transmit(Byte) | Transmits the supplied command
Public method | Transmit(Byte, Object) | Transmits the supplied command
Top
See Also

Reference

BNCSTXCommander Class
BNCS Namespace


BNCSTXCommander.Transmit Method (Byte[])

BNCSTXCommanderTransmit Method (Byte)
Transmits the supplied command

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Transmit(
    byte[] buffer_
)

Parameters

buffer_
Type: SystemByte
Buffer to send

Return Value

Type: Boolean
True on success, false if not connected, the supplied buffer is null or if a command is awaiting completion
See Also

Reference

BNCSTXCommander Class
Transmit Overload
BNCS Namespace


BNCSTXCommander.Transmit Method (Byte[], Object)

BNCSTXCommanderTransmit Method (Byte, Object)
Transmits the supplied command

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Transmit(
    byte[] buffer_,
    Object commandTag_
)

Parameters

buffer_
Type: SystemByte
Buffer to send
commandTag_
Type: SystemObject
Tag object

Return Value

Type: Boolean
True on success, false if not connected, the supplied buffer is null or if a command is awaiting completion
See Also

Reference

BNCSTXCommander Class
Transmit Overload
BNCS Namespace


BNCSTXCommander Properties

BNCSTXCommander Properties

The BNCSTXCommander type exposes the following members.

Properties
 | Name | Description
Public property | MaximumRetries | Gets or sets the maximum amount of retries before abandoning a command.
Top
See Also

Reference

BNCSTXCommander Class
BNCS Namespace


BNCSTXCommander.MaximumRetries Property

BNCSTXCommanderMaximumRetries Property
Gets or sets the maximum amount of retries before abandoning a command.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int MaximumRetries { get; set; }

Property Value

Type: Int32
See Also

Reference

BNCSTXCommander Class
BNCS Namespace


BNCSTXCommandStack Class

BNCSTXCommandStack Class
Class that keeps a queue of command stack items.
Inheritance Hierarchy
SystemObject
BNCSBNCSTXCommandStack

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BNCSTXCommandStack

The BNCSTXCommandStack type exposes the following members.

Constructors
 | Name | Description
Public method | BNCSTXCommandStack | Initializes a new instance of the BNCSTXCommandStack class
Top
Methods
 | Name | Description
Public method | Add(Byte) | Adds the supplied command to the stack
Public method | Add(Byte, Object) | Adds the supplied command to the stack
Public method | Clear | Clears the stack.
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetNextCommand | Dequeues the next item from the stack and returns it.
Public method | GetNextStackCommand | Dequeues the next item from the stack and returns it.
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | IsExpectedCommand | Flags if the supplied command ID is expected.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | IsEmpty | Returns true if the stack is empty.
Public property | SelectedIndex | Returns the selected index.
Top
See Also

Reference

BNCS Namespace


BNCSTXCommandStack Constructor

BNCSTXCommandStack Constructor
Initializes a new instance of the BNCSTXCommandStack class

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSTXCommandStack()
See Also

Reference

BNCSTXCommandStack Class
BNCS Namespace


BNCSTXCommandStack Methods

BNCSTXCommandStack Methods

The BNCSTXCommandStack type exposes the following members.

Methods
 | Name | Description
Public method | Add(Byte) | Adds the supplied command to the stack
Public method | Add(Byte, Object) | Adds the supplied command to the stack
Public method | Clear | Clears the stack.
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetNextCommand | Dequeues the next item from the stack and returns it.
Public method | GetNextStackCommand | Dequeues the next item from the stack and returns it.
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | IsExpectedCommand | Flags if the supplied command ID is expected.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

BNCSTXCommandStack Class
BNCS Namespace


BNCSTXCommandStack.Add Method

BNCSTXCommandStackAdd Method
Overload List
 | Name | Description
Public method | Add(Byte) | Adds the supplied command to the stack
Public method | Add(Byte, Object) | Adds the supplied command to the stack
Top
See Also

Reference

BNCSTXCommandStack Class
BNCS Namespace


BNCSTXCommandStack.Add Method (Byte[])

BNCSTXCommandStackAdd Method (Byte)
Adds the supplied command to the stack

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Add(
    byte[] command_
)

Parameters

command_
Type: SystemByte
Command to add

Return Value

Type: String
Command ID
See Also

Reference

BNCSTXCommandStack Class
Add Overload
BNCS Namespace


BNCSTXCommandStack.Add Method (Byte[], Object)

BNCSTXCommandStackAdd Method (Byte, Object)
Adds the supplied command to the stack

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Add(
    byte[] command_,
    Object tag_
)

Parameters

command_
Type: SystemByte
Command to add
tag_
Type: SystemObject
Optional tag

Return Value

Type: String
Command ID
See Also

Reference

BNCSTXCommandStack Class
Add Overload
BNCS Namespace


BNCSTXCommandStack.Clear Method

BNCSTXCommandStackClear Method
Clears the stack.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Clear()
See Also

Reference

BNCSTXCommandStack Class
BNCS Namespace


BNCSTXCommandStack.GetNextCommand Method

BNCSTXCommandStackGetNextCommand Method
Dequeues the next item from the stack and returns it.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[] GetNextCommand()

Return Value

Type: Byte
The next command as an array of bytes
See Also

Reference

BNCSTXCommandStack Class
BNCS Namespace


BNCSTXCommandStack.GetNextStackCommand Method

BNCSTXCommandStackGetNextStackCommand Method
Dequeues the next item from the stack and returns it.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSTXCommandStackItem GetNextStackCommand()

Return Value

Type: BNCSTXCommandStackItem
The next command as a BNCSTXCommandStackItem
See Also

Reference

BNCSTXCommandStack Class
BNCS Namespace


BNCSTXCommandStack.IsExpectedCommand Method

BNCSTXCommandStackIsExpectedCommand Method
Flags if the supplied command ID is expected.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool IsExpectedCommand(
    string commandID_
)

Parameters

commandID_
Type: SystemString
Command ID

Return Value

Type: Boolean
True if expected
See Also

Reference

BNCSTXCommandStack Class
BNCS Namespace


BNCSTXCommandStack Properties

BNCSTXCommandStack Properties

The BNCSTXCommandStack type exposes the following members.

Properties
 | Name | Description
Public property | IsEmpty | Returns true if the stack is empty.
Public property | SelectedIndex | Returns the selected index.
Top
See Also

Reference

BNCSTXCommandStack Class
BNCS Namespace


BNCSTXCommandStack.IsEmpty Property

BNCSTXCommandStackIsEmpty Property
Returns true if the stack is empty.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool IsEmpty { get; }

Property Value

Type: Boolean
See Also

Reference

BNCSTXCommandStack Class
BNCS Namespace


BNCSTXCommandStack.SelectedIndex Property

BNCSTXCommandStackSelectedIndex Property
Returns the selected index.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int SelectedIndex { get; }

Property Value

Type: Int32
See Also

Reference

BNCSTXCommandStack Class
BNCS Namespace


BNCSTXCommandStackItem Class

BNCSTXCommandStackItem Class
Class that represents a command stack item.
Inheritance Hierarchy
SystemObject
BNCSBNCSTXCommandStackItem

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BNCSTXCommandStackItem

The BNCSTXCommandStackItem type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | Command | Gets the command element.
Public property | CommandID | Gets the command ID element.
Public property | Tag | Gets the command tag element.
Top
See Also

Reference

BNCS Namespace


BNCSTXCommandStackItem Methods

BNCSTXCommandStackItem Methods

The BNCSTXCommandStackItem type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

BNCSTXCommandStackItem Class
BNCS Namespace


BNCSTXCommandStackItem Properties

BNCSTXCommandStackItem Properties

The BNCSTXCommandStackItem type exposes the following members.

Properties
 | Name | Description
Public property | Command | Gets the command element.
Public property | CommandID | Gets the command ID element.
Public property | Tag | Gets the command tag element.
Top
See Also

Reference

BNCSTXCommandStackItem Class
BNCS Namespace


BNCSTXCommandStackItem.Command Property

BNCSTXCommandStackItemCommand Property
Gets the command element.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[] Command { get; }

Property Value

Type: Byte
See Also

Reference

BNCSTXCommandStackItem Class
BNCS Namespace


BNCSTXCommandStackItem.CommandID Property

BNCSTXCommandStackItemCommandID Property
Gets the command ID element.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string CommandID { get; }

Property Value

Type: String
See Also

Reference

BNCSTXCommandStackItem Class
BNCS Namespace


BNCSTXCommandStackItem.Tag Property

BNCSTXCommandStackItemTag Property
Gets the command tag element.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Object Tag { get; }

Property Value

Type: Object
See Also

Reference

BNCSTXCommandStackItem Class
BNCS Namespace


BNCSTXEventArgs Class

BNCSTXEventArgs Class
Argument class that contains elements of a command, this class is passed to the BNCSTXEventHandler handler.
Inheritance Hierarchy
SystemObject
SystemEventArgs
BNCSBNCSTXEventArgs

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BNCSTXEventArgs : EventArgs

The BNCSTXEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | BNCSTXEventArgs | Initializes a new instance of the BNCSTXEventArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | Command | Command
Public field | ExecuteRetry | Execute retry flag.
Public field | RetryCount | Number of retries executed.
Public field | Tag | Tag object.
Top
See Also

Reference

BNCS Namespace


BNCSTXEventArgs Constructor

BNCSTXEventArgs Constructor
Initializes a new instance of the BNCSTXEventArgs class

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSTXEventArgs()
See Also

Reference

BNCSTXEventArgs Class
BNCS Namespace


BNCSTXEventArgs Fields

BNCSTXEventArgs Fields

The BNCSTXEventArgs type exposes the following members.

Fields
 | Name | Description
Public field | Command | Command
Public field | ExecuteRetry | Execute retry flag.
Public field | RetryCount | Number of retries executed.
Public field | Tag | Tag object.
Top
See Also

Reference

BNCSTXEventArgs Class
BNCS Namespace


BNCSTXEventArgs.Command Field

BNCSTXEventArgsCommand Field
Command

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[] Command

Field Value

Type: Byte
See Also

Reference

BNCSTXEventArgs Class
BNCS Namespace


BNCSTXEventArgs.ExecuteRetry Field

BNCSTXEventArgsExecuteRetry Field
Execute retry flag.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool ExecuteRetry

Field Value

Type: Boolean
See Also

Reference

BNCSTXEventArgs Class
BNCS Namespace


BNCSTXEventArgs.RetryCount Field

BNCSTXEventArgsRetryCount Field
Number of retries executed.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int RetryCount

Field Value

Type: Int32
See Also

Reference

BNCSTXEventArgs Class
BNCS Namespace


BNCSTXEventArgs.Tag Field

BNCSTXEventArgsTag Field
Tag object.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Object Tag

Field Value

Type: Object
See Also

Reference

BNCSTXEventArgs Class
BNCS Namespace


BNCSTXEventArgs Methods

BNCSTXEventArgs Methods

The BNCSTXEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

BNCSTXEventArgs Class
BNCS Namespace


BNCSTXEventHandler Delegate

BNCSTXEventHandler Delegate
Event handler type used by the BNCSTXCommander class.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void BNCSTXEventHandler(
    Object sender,
    BNCSTXEventArgs e
)

Parameters

sender
Type: SystemObject
Calling object
e
Type: BNCSBNCSTXEventArgs
Parameters
See Also

Reference

BNCS Namespace


BNCSUtilities Class

BNCSUtilities Class
Static class with useful methods to execute oft used BNCS functions.
Inheritance Hierarchy
SystemObject
BNCSBNCSUtilities

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static class BNCSUtilities

The BNCSUtilities type exposes the following members.

Methods
Name Description
GetBNCSFilePaths
Gets the BNCS system file paths.
Examples
This sample shows how to retrieve a list of BNCS system file paths.
Copy
class Program
{
    static void Main()
    {
        BNCSFilePaths bncsFilePaths = BNCSUtilities.GetBNCSFilePaths();
        Console.WriteLine("BNCS System Paths for System\"" + bncsFilePaths.SystemName + "\"\n");
        Console.WriteLine("Binary path:\t\t" + bncsFilePaths.BinaryPath);
        Console.WriteLine("Configuration path:\t" + bncsFilePaths.ConfigPath);
        Console.WriteLine("Data path:\t\t" + bncsFilePaths.DataPath);
        Console.WriteLine("Device Types path:\t" + bncsFilePaths.DeviceTypesPath);
        Console.WriteLine("INI files path:\t\t" + bncsFilePaths.IniFilePath);
        Console.WriteLine("Instances path:\t\t" + bncsFilePaths.InstancesPath);
        Console.WriteLine("Library path:\t\t" + bncsFilePaths.LibraryPath);
        Console.WriteLine("Log File path:\t\t" + bncsFilePaths.LogFilePath);
        Console.WriteLine("Root path:\t\t" + bncsFilePaths.RootPath);
    }
}
GetWorkstation
Gets the current workstation number
Top
See Also

Reference

BNCS Namespace


BNCSUtilities Methods

BNCSUtilities Methods

The BNCSUtilities type exposes the following members.

Methods
Name Description
GetBNCSFilePaths
Gets the BNCS system file paths.
Examples
This sample shows how to retrieve a list of BNCS system file paths.
Copy
class Program
{
    static void Main()
    {
        BNCSFilePaths bncsFilePaths = BNCSUtilities.GetBNCSFilePaths();
        Console.WriteLine("BNCS System Paths for System\"" + bncsFilePaths.SystemName + "\"\n");
        Console.WriteLine("Binary path:\t\t" + bncsFilePaths.BinaryPath);
        Console.WriteLine("Configuration path:\t" + bncsFilePaths.ConfigPath);
        Console.WriteLine("Data path:\t\t" + bncsFilePaths.DataPath);
        Console.WriteLine("Device Types path:\t" + bncsFilePaths.DeviceTypesPath);
        Console.WriteLine("INI files path:\t\t" + bncsFilePaths.IniFilePath);
        Console.WriteLine("Instances path:\t\t" + bncsFilePaths.InstancesPath);
        Console.WriteLine("Library path:\t\t" + bncsFilePaths.LibraryPath);
        Console.WriteLine("Log File path:\t\t" + bncsFilePaths.LogFilePath);
        Console.WriteLine("Root path:\t\t" + bncsFilePaths.RootPath);
    }
}
GetWorkstation
Gets the current workstation number
Top
See Also

Reference

BNCSUtilities Class
BNCS Namespace


BNCSUtilities.GetBNCSFilePaths Method

BNCSUtilitiesGetBNCSFilePaths Method
Gets the BNCS system file paths.
Examples
This sample shows how to retrieve a list of BNCS system file paths.
Copy
class Program
{
    static void Main()
    {
        BNCSFilePaths bncsFilePaths = BNCSUtilities.GetBNCSFilePaths();
        Console.WriteLine("BNCS System Paths for System\"" + bncsFilePaths.SystemName + "\"\n");
        Console.WriteLine("Binary path:\t\t" + bncsFilePaths.BinaryPath);
        Console.WriteLine("Configuration path:\t" + bncsFilePaths.ConfigPath);
        Console.WriteLine("Data path:\t\t" + bncsFilePaths.DataPath);
        Console.WriteLine("Device Types path:\t" + bncsFilePaths.DeviceTypesPath);
        Console.WriteLine("INI files path:\t\t" + bncsFilePaths.IniFilePath);
        Console.WriteLine("Instances path:\t\t" + bncsFilePaths.InstancesPath);
        Console.WriteLine("Library path:\t\t" + bncsFilePaths.LibraryPath);
        Console.WriteLine("Log File path:\t\t" + bncsFilePaths.LogFilePath);
        Console.WriteLine("Root path:\t\t" + bncsFilePaths.RootPath);
    }
}

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static BNCSFilePaths GetBNCSFilePaths()

Return Value

Type: BNCSFilePaths
The BNCS system paths within a BNCS.BNCSFilePaths object.
See Also

Reference

BNCSUtilities Class
BNCS Namespace


BNCSUtilities.GetWorkstation Method

BNCSUtilitiesGetWorkstation Method
Gets the current workstation number

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static int GetWorkstation()

Return Value

Type: Int32
The workstation number.
See Also

Reference

BNCSUtilities Class
BNCS Namespace


BNCSWindowHandles Class

BNCSWindowHandles Class
Static class that will return the window handles for CSI, InfoDrivers and GRD's for either v3 or v4.
Inheritance Hierarchy
SystemObject
BNCSBNCSWindowHandles

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static class BNCSWindowHandles

The BNCSWindowHandles type exposes the following members.

Methods
Name | Description
GetCSIHandle | Retrieves the window handle for a CSI instance via the Windows API.
GetGRDHandle | Retrieves the window handle for a GRD instance via the Windows API.
GetIDHandle | Retrieves the window handle for an InfoDriver instance via the Windows API.
Top
See Also

Reference

BNCS Namespace


BNCSWindowHandles Methods

BNCSWindowHandles Methods

The BNCSWindowHandles type exposes the following members.

Methods
Name | Description
GetCSIHandle | Retrieves the window handle for a CSI instance via the Windows API.
GetGRDHandle | Retrieves the window handle for a GRD instance via the Windows API.
GetIDHandle | Retrieves the window handle for an InfoDriver instance via the Windows API.
Top
See Also

Reference

BNCSWindowHandles Class
BNCS Namespace


BNCSWindowHandles.GetCSIHandle Method

BNCSWindowHandlesGetCSIHandle Method
Retrieves the window handle for a CSI instance via the Windows API.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static IntPtr GetCSIHandle()

Return Value

Type: IntPtr
Either a valid IntPtr or IntPtr.Zero
See Also

Reference

BNCSWindowHandles Class
BNCS Namespace


BNCSWindowHandles.GetGRDHandle Method

BNCSWindowHandlesGetGRDHandle Method
Retrieves the window handle for a GRD instance via the Windows API.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static IntPtr GetGRDHandle(
    int deviceNumber_
)

Parameters

deviceNumber_
Type: SystemInt32
Device number who's window handle is to be returned

Return Value

Type: IntPtr
Either a valid IntPtr or IntPtr.Zero
See Also

Reference

BNCSWindowHandles Class
BNCS Namespace


BNCSWindowHandles.GetIDHandle Method

BNCSWindowHandlesGetIDHandle Method
Retrieves the window handle for an InfoDriver instance via the Windows API.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static IntPtr GetIDHandle(
    int deviceNumber_
)

Parameters

deviceNumber_
Type: SystemInt32
Device number who's window handle is to be returned

Return Value

Type: IntPtr
Either a valid IntPtr or IntPtr.Zero
See Also

Reference

BNCSWindowHandles Class
BNCS Namespace


DeferedItemsAction Enumeration

DeferedItemsAction Enumeration
Action enumeration for defered items.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum DeferedItemsAction
Members
Member name | Value | Description
Add | 0 | Add
Clear | 1 | Clear
AddAndClear | 2 | Add and clear
See Also

Reference

BNCS Namespace


DeviceParameter Class

DeviceParameter Class
A class representation of a single DeviceParameter derived from interface INotifyPropertyChanged.
Inheritance Hierarchy
SystemObject
BNCSDeviceParameter

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class DeviceParameter : INotifyPropertyChanged

The DeviceParameter type exposes the following members.

Constructors
 | Name | Description
Public method | DeviceParameter | Initializes a new instance of the DeviceParameter class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the class by returning the Name property (Overrides ObjectToString.)
Top
Properties
 | Name | Description
Public property | BncsName | Gets/sets the devices BNCS name
Public property | EnumList | Gets/sets the device enumeration list
Public property | LastUpdateTime | Gets/sets the devices last update time
Public property | Maximum | Gets/sets the device maximum
Public property | Minimum | Gets/sets the device minimum
Public property | Name | Gets/sets the device name
Public property | Number | Gets/sets the device parameter number
Public property | Privilege | Gets/sets the device privilege
Public property | Slot | Gets/sets the device slot
Public property | Step | Gets/sets the device step
Public property | Type | Gets/sets the devices type
Public property | TypeName | Gets/sets the devices type name
Public property | Units | Gets/sets the device units
Public property | Value | Gets/sets the device value
Top
Events
 | Name | Description
Public event | PropertyChanged | Property changed event handler
Top
See Also

Reference

BNCS Namespace


DeviceParameter Constructor

DeviceParameter Constructor
Initializes a new instance of the DeviceParameter class

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public DeviceParameter()
See Also

Reference

DeviceParameter Class
BNCS Namespace


DeviceParameter Methods

DeviceParameter Methods

The DeviceParameter type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the class by returning the Name property (Overrides ObjectToString.)
Top
See Also

Reference

DeviceParameter Class
BNCS Namespace


DeviceParameter.ToString Method

DeviceParameterToString Method
Returns a string representation of the class by returning the Name property

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
The Name property.
See Also

Reference

DeviceParameter Class
BNCS Namespace


DeviceParameter Properties

DeviceParameter Properties

The DeviceParameter type exposes the following members.

Properties
 | Name | Description
Public property | BncsName | Gets/sets the devices BNCS name
Public property | EnumList | Gets/sets the device enumeration list
Public property | LastUpdateTime | Gets/sets the devices last update time
Public property | Maximum | Gets/sets the device maximum
Public property | Minimum | Gets/sets the device minimum
Public property | Name | Gets/sets the device name
Public property | Number | Gets/sets the device parameter number
Public property | Privilege | Gets/sets the device privilege
Public property | Slot | Gets/sets the device slot
Public property | Step | Gets/sets the device step
Public property | Type | Gets/sets the devices type
Public property | TypeName | Gets/sets the devices type name
Public property | Units | Gets/sets the device units
Public property | Value | Gets/sets the device value
Top
See Also

Reference

DeviceParameter Class
BNCS Namespace


DeviceParameter.BncsName Property

DeviceParameterBncsName Property
Gets/sets the devices BNCS name

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string BncsName { get; set; }

Property Value

Type: String
See Also

Reference

DeviceParameter Class
BNCS Namespace


DeviceParameter.EnumList Property

DeviceParameterEnumList Property
Gets/sets the device enumeration list

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string EnumList { get; set; }

Property Value

Type: String
See Also

Reference

DeviceParameter Class
BNCS Namespace


DeviceParameter.LastUpdateTime Property

DeviceParameterLastUpdateTime Property
Gets/sets the devices last update time

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string LastUpdateTime { get; set; }

Property Value

Type: String
See Also

Reference

DeviceParameter Class
BNCS Namespace


DeviceParameter.Maximum Property

DeviceParameterMaximum Property
Gets/sets the device maximum

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public double Maximum { get; set; }

Property Value

Type: Double
See Also

Reference

DeviceParameter Class
BNCS Namespace


DeviceParameter.Minimum Property

DeviceParameterMinimum Property
Gets/sets the device minimum

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public double Minimum { get; set; }

Property Value

Type: Double
See Also

Reference

DeviceParameter Class
BNCS Namespace


DeviceParameter.Name Property

DeviceParameterName Property
Gets/sets the device name

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Name { get; set; }

Property Value

Type: String
See Also

Reference

DeviceParameter Class
BNCS Namespace


DeviceParameter.Number Property

DeviceParameterNumber Property
Gets/sets the device parameter number

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Number { get; set; }

Property Value

Type: Int32
See Also

Reference

DeviceParameter Class
BNCS Namespace


DeviceParameter.Privilege Property

DeviceParameterPrivilege Property
Gets/sets the device privilege

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Privilege { get; set; }

Property Value

Type: String
See Also

Reference

DeviceParameter Class
BNCS Namespace


DeviceParameter.Slot Property

DeviceParameterSlot Property
Gets/sets the device slot

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Slot { get; set; }

Property Value

Type: Int32
See Also

Reference

DeviceParameter Class
BNCS Namespace


DeviceParameter.Step Property

DeviceParameterStep Property
Gets/sets the device step

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public double Step { get; set; }

Property Value

Type: Double
See Also

Reference

DeviceParameter Class
BNCS Namespace


DeviceParameter.Type Property

DeviceParameterType Property
Gets/sets the devices type

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Type { get; set; }

Property Value

Type: String
See Also

Reference

DeviceParameter Class
BNCS Namespace


DeviceParameter.TypeName Property

DeviceParameterTypeName Property
Gets/sets the devices type name

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string TypeName { get; set; }

Property Value

Type: String
See Also

Reference

DeviceParameter Class
BNCS Namespace


DeviceParameter.Units Property

DeviceParameterUnits Property
Gets/sets the device units

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Units { get; set; }

Property Value

Type: String
See Also

Reference

DeviceParameter Class
BNCS Namespace


DeviceParameter.Value Property

DeviceParameterValue Property
Gets/sets the device value

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Value { get; set; }

Property Value

Type: String
See Also

Reference

DeviceParameter Class
BNCS Namespace


DeviceParameter Events

DeviceParameter Events

The DeviceParameter type exposes the following members.

Events
 | Name | Description
Public event | PropertyChanged | Property changed event handler
Top
See Also

Reference

DeviceParameter Class
BNCS Namespace


DeviceParameter.PropertyChanged Event

DeviceParameterPropertyChanged Event
Property changed event handler

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event PropertyChangedEventHandler PropertyChanged

Value

Type: System.ComponentModelPropertyChangedEventHandler

Implements

INotifyPropertyChangedPropertyChanged
See Also

Reference

DeviceParameter Class
BNCS Namespace


DeviceUnit Class

DeviceUnit Class
A simple class that represents a device unit
Inheritance Hierarchy
SystemObject
BNCSDeviceUnit

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class DeviceUnit

The DeviceUnit type exposes the following members.

Constructors
 | Name | Description
Public method | DeviceUnit | Initializes a new instance of the DeviceUnit class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns the class as a string based on name and/or number (Overrides ObjectToString.)
Top
Fields
 | Name | Description
Public field | Parameters | Gets or sets an ObservableCollection of BNCS.DeviceParameters
Top
Properties
 | Name | Description
Public property | BncsName | Gets/sets the devices BNCS name
Public property | Configured | Gets or sets a boolean that betrays if the device has been configured
Public property | Name | Gets or sets the device name
Public property | Number | Gets/sets the device number
Public property | XmlErrorDetected | Gets or sets a value betraying if an Xml error was detecting during parsing.
Top
See Also

Reference

BNCS Namespace


DeviceUnit Constructor

DeviceUnit Constructor
Initializes a new instance of the DeviceUnit class

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public DeviceUnit()
See Also

Reference

DeviceUnit Class
BNCS Namespace


DeviceUnit Fields

DeviceUnit Fields

The DeviceUnit type exposes the following members.

Fields
 | Name | Description
Public field | Parameters | Gets or sets an ObservableCollection of BNCS.DeviceParameters
Top
See Also

Reference

DeviceUnit Class
BNCS Namespace


DeviceUnit.Parameters Field

DeviceUnitParameters Field
Gets or sets an ObservableCollection of BNCS.DeviceParameters

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ObservableCollection<DeviceParameter> Parameters

Field Value

Type: ObservableCollection DeviceParameter
See Also

Reference

DeviceUnit Class
BNCS Namespace


DeviceUnit Methods

DeviceUnit Methods

The DeviceUnit type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns the class as a string based on name and/or number (Overrides ObjectToString.)
Top
See Also

Reference

DeviceUnit Class
BNCS Namespace


DeviceUnit.ToString Method

DeviceUnitToString Method
Returns the class as a string based on name and/or number

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
Either name, number or unknown device.
See Also

Reference

DeviceUnit Class
BNCS Namespace


DeviceUnit Properties

DeviceUnit Properties

The DeviceUnit type exposes the following members.

Properties
 | Name | Description
Public property | BncsName | Gets/sets the devices BNCS name
Public property | Configured | Gets or sets a boolean that betrays if the device has been configured
Public property | Name | Gets or sets the device name
Public property | Number | Gets/sets the device number
Public property | XmlErrorDetected | Gets or sets a value betraying if an Xml error was detecting during parsing.
Top
See Also

Reference

DeviceUnit Class
BNCS Namespace


DeviceUnit.BncsName Property

DeviceUnitBncsName Property
Gets/sets the devices BNCS name

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string BncsName { get; set; }

Property Value

Type: String
See Also

Reference

DeviceUnit Class
BNCS Namespace


DeviceUnit.Configured Property

DeviceUnitConfigured Property
Gets or sets a boolean that betrays if the device has been configured

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Configured { get; set; }

Property Value

Type: Boolean
See Also

Reference

DeviceUnit Class
BNCS Namespace


DeviceUnit.Name Property

DeviceUnitName Property
Gets or sets the device name

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Name { get; set; }

Property Value

Type: String
See Also

Reference

DeviceUnit Class
BNCS Namespace


DeviceUnit.Number Property

DeviceUnitNumber Property
Gets/sets the device number

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Number { get; set; }

Property Value

Type: Int32
See Also

Reference

DeviceUnit Class
BNCS Namespace


DeviceUnit.XmlErrorDetected Property

DeviceUnitXmlErrorDetected Property
Gets or sets a value betraying if an Xml error was detecting during parsing.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool XmlErrorDetected { get; set; }

Property Value

Type: Boolean
See Also

Reference

DeviceUnit Class
BNCS Namespace


GPILockMessage Class

GPILockMessage Class
GPILock network message command.
Inheritance Hierarchy
SystemObject
BNCSBncsNetworkMessage
BNCSLockMessage
BNCSGPILockMessage

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class GPILockMessage : LockMessage

The GPILockMessage type exposes the following members.

Constructors
 | Name | Description
Public method | GPILockMessage | Constructor
Top
Methods
 | Name | Description
Public method | AssembleCommand | Assembles the command as a string. (Inherited from LockMessage.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetParams | Gets an appropriate parameter descriptor by message type. (Inherited from BncsNetworkMessage.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the network message instance as a string showing it's description. (Inherited from BncsNetworkMessage.)
Top
Properties
 | Name | Description
Public property | CommandName | Gets the command name. (Inherited from BncsNetworkMessage.)
Public property | Description | Gets the description. (Inherited from BncsNetworkMessage.)
Public property | DeviceNumber | Gets the device number. (Inherited from BncsNetworkMessage.)
Public property | HostDriverType | Gets the host driver type. (Inherited from BncsNetworkMessage.)
Public property | NetworkMessage | Gets the network message string. (Inherited from BncsNetworkMessage.)
Public property | Type | Gets the command type. (Inherited from BncsNetworkMessage.)
Public property | WorkstationNumber | Gets the workstation number. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

BNCS Namespace


GPILockMessage Constructor

GPILockMessage Constructor
Constructor

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public GPILockMessage(
    uint deviceNumber_,
    uint firstGpi_,
    uint lastGpi_,
    bool isLocked_,
    uint workstationNumber_
)

Parameters

deviceNumber_
Type: SystemUInt32
Device number
firstGpi_
Type: SystemUInt32
First GPI to lock/unlock
lastGpi_
Type: SystemUInt32
Last GPI to lock/unlock
isLocked_
Type: SystemBoolean
Lock state to apply
workstationNumber_
Type: SystemUInt32
Workstation number
See Also

Reference

GPILockMessage Class
BNCS Namespace


GPILockMessage Methods

GPILockMessage Methods

The GPILockMessage type exposes the following members.

Methods
 | Name | Description
Public method | AssembleCommand | Assembles the command as a string. (Inherited from LockMessage.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetParams | Gets an appropriate parameter descriptor by message type. (Inherited from BncsNetworkMessage.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the network message instance as a string showing it's description. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

GPILockMessage Class
BNCS Namespace


GPILockMessage Properties

GPILockMessage Properties

The GPILockMessage type exposes the following members.

Properties
 | Name | Description
Public property | CommandName | Gets the command name. (Inherited from BncsNetworkMessage.)
Public property | Description | Gets the description. (Inherited from BncsNetworkMessage.)
Public property | DeviceNumber | Gets the device number. (Inherited from BncsNetworkMessage.)
Public property | HostDriverType | Gets the host driver type. (Inherited from BncsNetworkMessage.)
Public property | NetworkMessage | Gets the network message string. (Inherited from BncsNetworkMessage.)
Public property | Type | Gets the command type. (Inherited from BncsNetworkMessage.)
Public property | WorkstationNumber | Gets the workstation number. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

GPILockMessage Class
BNCS Namespace


GPIPollMessage Class

GPIPollMessage Class
GPIPoll network message command.
Inheritance Hierarchy
SystemObject
BNCSBncsNetworkMessage
BNCSQueryPollMessage
BNCSGPIPollMessage

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class GPIPollMessage : QueryPollMessage

The GPIPollMessage type exposes the following members.

Constructors
 | Name | Description
Public method | GPIPollMessage | GPIPoll network message command.
Top
Methods
 | Name | Description
Public method | AssembleCommand | Assembles the command as a string. (Inherited from QueryPollMessage.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetParams | Gets an appropriate parameter descriptor by message type. (Inherited from BncsNetworkMessage.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the network message instance as a string showing it's description. (Inherited from BncsNetworkMessage.)
Top
Properties
 | Name | Description
Public property | CommandName | Gets the command name. (Inherited from BncsNetworkMessage.)
Public property | Description | Gets the description. (Inherited from BncsNetworkMessage.)
Public property | DeviceNumber | Gets the device number. (Inherited from BncsNetworkMessage.)
Public property | HostDriverType | Gets the host driver type. (Inherited from BncsNetworkMessage.)
Public property | NetworkMessage | Gets the network message string. (Inherited from BncsNetworkMessage.)
Public property | Type | Gets the command type. (Inherited from BncsNetworkMessage.)
Public property | WorkstationNumber | Gets the workstation number. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

BNCS Namespace


GPIPollMessage Constructor

GPIPollMessage Constructor
GPIPoll network message command.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public GPIPollMessage(
    uint deviceNumber_,
    uint firstGpi_,
    uint lastGpi_,
    uint workstationNumber_
)

Parameters

deviceNumber_
Type: SystemUInt32
Device number
firstGpi_
Type: SystemUInt32
First GPI to poll
lastGpi_
Type: SystemUInt32
Last GPI to poll
workstationNumber_
Type: SystemUInt32
Workstation number
See Also

Reference

GPIPollMessage Class
BNCS Namespace


GPIPollMessage Methods

GPIPollMessage Methods

The GPIPollMessage type exposes the following members.

Methods
 | Name | Description
Public method | AssembleCommand | Assembles the command as a string. (Inherited from QueryPollMessage.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetParams | Gets an appropriate parameter descriptor by message type. (Inherited from BncsNetworkMessage.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the network message instance as a string showing it's description. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

GPIPollMessage Class
BNCS Namespace


GPIPollMessage Properties

GPIPollMessage Properties

The GPIPollMessage type exposes the following members.

Properties
 | Name | Description
Public property | CommandName | Gets the command name. (Inherited from BncsNetworkMessage.)
Public property | Description | Gets the description. (Inherited from BncsNetworkMessage.)
Public property | DeviceNumber | Gets the device number. (Inherited from BncsNetworkMessage.)
Public property | HostDriverType | Gets the host driver type. (Inherited from BncsNetworkMessage.)
Public property | NetworkMessage | Gets the network message string. (Inherited from BncsNetworkMessage.)
Public property | Type | Gets the command type. (Inherited from BncsNetworkMessage.)
Public property | WorkstationNumber | Gets the workstation number. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

GPIPollMessage Class
BNCS Namespace


GPIQueryMessage Class

GPIQueryMessage Class
GPIQuery network message command.
Inheritance Hierarchy
SystemObject
BNCSBncsNetworkMessage
BNCSQueryPollMessage
BNCSGPIQueryMessage

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class GPIQueryMessage : QueryPollMessage

The GPIQueryMessage type exposes the following members.

Constructors
 | Name | Description
Public method | GPIQueryMessage | GPIPoll network message command.
Top
Methods
 | Name | Description
Public method | AssembleCommand | Assembles the command as a string. (Inherited from QueryPollMessage.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetParams | Gets an appropriate parameter descriptor by message type. (Inherited from BncsNetworkMessage.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the network message instance as a string showing it's description. (Inherited from BncsNetworkMessage.)
Top
Properties
 | Name | Description
Public property | CommandName | Gets the command name. (Inherited from BncsNetworkMessage.)
Public property | Description | Gets the description. (Inherited from BncsNetworkMessage.)
Public property | DeviceNumber | Gets the device number. (Inherited from BncsNetworkMessage.)
Public property | HostDriverType | Gets the host driver type. (Inherited from BncsNetworkMessage.)
Public property | NetworkMessage | Gets the network message string. (Inherited from BncsNetworkMessage.)
Public property | Type | Gets the command type. (Inherited from BncsNetworkMessage.)
Public property | WorkstationNumber | Gets the workstation number. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

BNCS Namespace


GPIQueryMessage Constructor

GPIQueryMessage Constructor
GPIPoll network message command.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public GPIQueryMessage(
    uint deviceNumber_,
    uint firstGpi_,
    uint lastGpi_,
    uint workstationNumber_
)

Parameters

deviceNumber_
Type: SystemUInt32
Device number
firstGpi_
Type: SystemUInt32
First GPI to query
lastGpi_
Type: SystemUInt32
Last GPI to query
workstationNumber_
Type: SystemUInt32
Workstation number
See Also

Reference

GPIQueryMessage Class
BNCS Namespace


GPIQueryMessage Methods

GPIQueryMessage Methods

The GPIQueryMessage type exposes the following members.

Methods
 | Name | Description
Public method | AssembleCommand | Assembles the command as a string. (Inherited from QueryPollMessage.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetParams | Gets an appropriate parameter descriptor by message type. (Inherited from BncsNetworkMessage.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the network message instance as a string showing it's description. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

GPIQueryMessage Class
BNCS Namespace


GPIQueryMessage Properties

GPIQueryMessage Properties

The GPIQueryMessage type exposes the following members.

Properties
 | Name | Description
Public property | CommandName | Gets the command name. (Inherited from BncsNetworkMessage.)
Public property | Description | Gets the description. (Inherited from BncsNetworkMessage.)
Public property | DeviceNumber | Gets the device number. (Inherited from BncsNetworkMessage.)
Public property | HostDriverType | Gets the host driver type. (Inherited from BncsNetworkMessage.)
Public property | NetworkMessage | Gets the network message string. (Inherited from BncsNetworkMessage.)
Public property | Type | Gets the command type. (Inherited from BncsNetworkMessage.)
Public property | WorkstationNumber | Gets the workstation number. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

GPIQueryMessage Class
BNCS Namespace


GpiSetMessage Class

GpiSetMessage Class
GPIO network command class.
Inheritance Hierarchy
SystemObject
BNCSBncsNetworkMessage
BNCSGpiSetMessage

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class GpiSetMessage : BncsNetworkMessage

The GpiSetMessage type exposes the following members.

Constructors
 | Name | Description
Public method | GpiSetMessage | Constructor.
Top
Methods
 | Name | Description
Public method | AssembleCommand | Assembles the command as a string. (Overrides BncsNetworkMessageAssembleCommand.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetParams | Gets an appropriate parameter descriptor by message type. (Inherited from BncsNetworkMessage.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the network message instance as a string showing it's description. (Inherited from BncsNetworkMessage.)
Top
Properties
 | Name | Description
Public property | CommandName | Gets the command name. (Inherited from BncsNetworkMessage.)
Public property | Description | Gets the description. (Inherited from BncsNetworkMessage.)
Public property | DeviceNumber | Gets the device number. (Inherited from BncsNetworkMessage.)
Public property | HostDriverType | Gets the host driver type. (Inherited from BncsNetworkMessage.)
Public property | NetworkMessage | Gets the network message string. (Inherited from BncsNetworkMessage.)
Public property | Type | Gets the command type. (Inherited from BncsNetworkMessage.)
Public property | WorkstationNumber | Gets the workstation number. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

BNCS Namespace


GpiSetMessage Constructor

GpiSetMessage Constructor
Constructor.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public GpiSetMessage(
    uint deviceNumber_,
    uint gpiNumber_,
    bool isEnabled_,
    uint workstationNumber_
)

Parameters

deviceNumber_
Type: SystemUInt32
Device number
gpiNumber_
Type: SystemUInt32
GPIO number
isEnabled_
Type: SystemBoolean
GPIO state
workstationNumber_
Type: SystemUInt32
Workstation number.
See Also

Reference

GpiSetMessage Class
BNCS Namespace


GpiSetMessage Methods

GpiSetMessage Methods

The GpiSetMessage type exposes the following members.

Methods
 | Name | Description
Public method | AssembleCommand | Assembles the command as a string. (Overrides BncsNetworkMessageAssembleCommand.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetParams | Gets an appropriate parameter descriptor by message type. (Inherited from BncsNetworkMessage.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the network message instance as a string showing it's description. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

GpiSetMessage Class
BNCS Namespace


GpiSetMessage.AssembleCommand Method

GpiSetMessageAssembleCommand Method
Assembles the command as a string.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string AssembleCommand()

Return Value

Type: String
A command string to send to CSI.
See Also

Reference

GpiSetMessage Class
BNCS Namespace


GpiSetMessage Properties

GpiSetMessage Properties

The GpiSetMessage type exposes the following members.

Properties
 | Name | Description
Public property | CommandName | Gets the command name. (Inherited from BncsNetworkMessage.)
Public property | Description | Gets the description. (Inherited from BncsNetworkMessage.)
Public property | DeviceNumber | Gets the device number. (Inherited from BncsNetworkMessage.)
Public property | HostDriverType | Gets the host driver type. (Inherited from BncsNetworkMessage.)
Public property | NetworkMessage | Gets the network message string. (Inherited from BncsNetworkMessage.)
Public property | Type | Gets the command type. (Inherited from BncsNetworkMessage.)
Public property | WorkstationNumber | Gets the workstation number. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

GpiSetMessage Class
BNCS Namespace


InfoLockMessage Class

InfoLockMessage Class
InfoLock network message command.
Inheritance Hierarchy
SystemObject
BNCSBncsNetworkMessage
BNCSLockMessage
BNCSInfoLockMessage

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class InfoLockMessage : LockMessage

The InfoLockMessage type exposes the following members.

Constructors
 | Name | Description
Public method | InfoLockMessage | Constructor
Top
Methods
 | Name | Description
Public method | AssembleCommand | Assembles the command as a string. (Inherited from LockMessage.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetParams | Gets an appropriate parameter descriptor by message type. (Inherited from BncsNetworkMessage.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the network message instance as a string showing it's description. (Inherited from BncsNetworkMessage.)
Top
Properties
 | Name | Description
Public property | CommandName | Gets the command name. (Inherited from BncsNetworkMessage.)
Public property | Description | Gets the description. (Inherited from BncsNetworkMessage.)
Public property | DeviceNumber | Gets the device number. (Inherited from BncsNetworkMessage.)
Public property | HostDriverType | Gets the host driver type. (Inherited from BncsNetworkMessage.)
Public property | NetworkMessage | Gets the network message string. (Inherited from BncsNetworkMessage.)
Public property | Type | Gets the command type. (Inherited from BncsNetworkMessage.)
Public property | WorkstationNumber | Gets the workstation number. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

BNCS Namespace


InfoLockMessage Constructor

InfoLockMessage Constructor
Constructor

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public InfoLockMessage(
    uint deviceNumber_,
    uint startSlot_,
    uint endSlot_,
    bool isLocked_,
    uint workstationNumber_
)

Parameters

deviceNumber_
Type: SystemUInt32
Device number
startSlot_
Type: SystemUInt32
First slot to lock/unlock
endSlot_
Type: SystemUInt32
Last slot to lock/unlock
isLocked_
Type: SystemBoolean
Lock state to apply
workstationNumber_
Type: SystemUInt32
Workstation number
See Also

Reference

InfoLockMessage Class
BNCS Namespace


InfoLockMessage Methods

InfoLockMessage Methods

The InfoLockMessage type exposes the following members.

Methods
 | Name | Description
Public method | AssembleCommand | Assembles the command as a string. (Inherited from LockMessage.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetParams | Gets an appropriate parameter descriptor by message type. (Inherited from BncsNetworkMessage.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the network message instance as a string showing it's description. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

InfoLockMessage Class
BNCS Namespace


InfoLockMessage Properties

InfoLockMessage Properties

The InfoLockMessage type exposes the following members.

Properties
 | Name | Description
Public property | CommandName | Gets the command name. (Inherited from BncsNetworkMessage.)
Public property | Description | Gets the description. (Inherited from BncsNetworkMessage.)
Public property | DeviceNumber | Gets the device number. (Inherited from BncsNetworkMessage.)
Public property | HostDriverType | Gets the host driver type. (Inherited from BncsNetworkMessage.)
Public property | NetworkMessage | Gets the network message string. (Inherited from BncsNetworkMessage.)
Public property | Type | Gets the command type. (Inherited from BncsNetworkMessage.)
Public property | WorkstationNumber | Gets the workstation number. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

InfoLockMessage Class
BNCS Namespace


InfoPollMessage Class

InfoPollMessage Class
InfoPoll network message command.
Inheritance Hierarchy
SystemObject
BNCSBncsNetworkMessage
BNCSQueryPollMessage
BNCSInfoPollMessage

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class InfoPollMessage : QueryPollMessage

The InfoPollMessage type exposes the following members.

Constructors
 | Name | Description
Public method | InfoPollMessage | Constructor
Top
Methods
 | Name | Description
Public method | AssembleCommand | Assembles the command as a string. (Inherited from QueryPollMessage.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetParams | Gets an appropriate parameter descriptor by message type. (Inherited from BncsNetworkMessage.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the network message instance as a string showing it's description. (Inherited from BncsNetworkMessage.)
Top
Properties
 | Name | Description
Public property | CommandName | Gets the command name. (Inherited from BncsNetworkMessage.)
Public property | Description | Gets the description. (Inherited from BncsNetworkMessage.)
Public property | DeviceNumber | Gets the device number. (Inherited from BncsNetworkMessage.)
Public property | HostDriverType | Gets the host driver type. (Inherited from BncsNetworkMessage.)
Public property | NetworkMessage | Gets the network message string. (Inherited from BncsNetworkMessage.)
Public property | Type | Gets the command type. (Inherited from BncsNetworkMessage.)
Public property | WorkstationNumber | Gets the workstation number. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

BNCS Namespace


InfoPollMessage Constructor

InfoPollMessage Constructor
Constructor

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public InfoPollMessage(
    uint deviceNumber_,
    uint startSlot_,
    uint endSlot_,
    uint workstationNumber_
)

Parameters

deviceNumber_
Type: SystemUInt32
Device number
startSlot_
Type: SystemUInt32
Slot to begin poll
endSlot_
Type: SystemUInt32
Slot to end poll
workstationNumber_
Type: SystemUInt32
Workstation number
See Also

Reference

InfoPollMessage Class
BNCS Namespace


InfoPollMessage Methods

InfoPollMessage Methods

The InfoPollMessage type exposes the following members.

Methods
 | Name | Description
Public method | AssembleCommand | Assembles the command as a string. (Inherited from QueryPollMessage.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetParams | Gets an appropriate parameter descriptor by message type. (Inherited from BncsNetworkMessage.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the network message instance as a string showing it's description. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

InfoPollMessage Class
BNCS Namespace


InfoPollMessage Properties

InfoPollMessage Properties

The InfoPollMessage type exposes the following members.

Properties
 | Name | Description
Public property | CommandName | Gets the command name. (Inherited from BncsNetworkMessage.)
Public property | Description | Gets the description. (Inherited from BncsNetworkMessage.)
Public property | DeviceNumber | Gets the device number. (Inherited from BncsNetworkMessage.)
Public property | HostDriverType | Gets the host driver type. (Inherited from BncsNetworkMessage.)
Public property | NetworkMessage | Gets the network message string. (Inherited from BncsNetworkMessage.)
Public property | Type | Gets the command type. (Inherited from BncsNetworkMessage.)
Public property | WorkstationNumber | Gets the workstation number. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

InfoPollMessage Class
BNCS Namespace


InfoQueryMessage Class

InfoQueryMessage Class
InfoQuery network message command.
Inheritance Hierarchy
SystemObject
BNCSBncsNetworkMessage
BNCSQueryPollMessage
BNCSInfoQueryMessage

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class InfoQueryMessage : QueryPollMessage

The InfoQueryMessage type exposes the following members.

Constructors
 | Name | Description
Public method | InfoQueryMessage | Constructor
Top
Methods
 | Name | Description
Public method | AssembleCommand | Assembles the command as a string. (Inherited from QueryPollMessage.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetParams | Gets an appropriate parameter descriptor by message type. (Inherited from BncsNetworkMessage.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the network message instance as a string showing it's description. (Inherited from BncsNetworkMessage.)
Top
Properties
 | Name | Description
Public property | CommandName | Gets the command name. (Inherited from BncsNetworkMessage.)
Public property | Description | Gets the description. (Inherited from BncsNetworkMessage.)
Public property | DeviceNumber | Gets the device number. (Inherited from BncsNetworkMessage.)
Public property | HostDriverType | Gets the host driver type. (Inherited from BncsNetworkMessage.)
Public property | NetworkMessage | Gets the network message string. (Inherited from BncsNetworkMessage.)
Public property | Type | Gets the command type. (Inherited from BncsNetworkMessage.)
Public property | WorkstationNumber | Gets the workstation number. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

BNCS Namespace


InfoQueryMessage Constructor

InfoQueryMessage Constructor
Constructor

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public InfoQueryMessage(
    uint deviceNumber_,
    uint startSlot_,
    uint endSlot_,
    uint workstationNumber_
)

Parameters

deviceNumber_
Type: SystemUInt32
Device number
startSlot_
Type: SystemUInt32
Slot to begin query
endSlot_
Type: SystemUInt32
Slot to end query
workstationNumber_
Type: SystemUInt32
Workstation number
See Also

Reference

InfoQueryMessage Class
BNCS Namespace


InfoQueryMessage Methods

InfoQueryMessage Methods

The InfoQueryMessage type exposes the following members.

Methods
 | Name | Description
Public method | AssembleCommand | Assembles the command as a string. (Inherited from QueryPollMessage.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetParams | Gets an appropriate parameter descriptor by message type. (Inherited from BncsNetworkMessage.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the network message instance as a string showing it's description. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

InfoQueryMessage Class
BNCS Namespace


InfoQueryMessage Properties

InfoQueryMessage Properties

The InfoQueryMessage type exposes the following members.

Properties
 | Name | Description
Public property | CommandName | Gets the command name. (Inherited from BncsNetworkMessage.)
Public property | Description | Gets the description. (Inherited from BncsNetworkMessage.)
Public property | DeviceNumber | Gets the device number. (Inherited from BncsNetworkMessage.)
Public property | HostDriverType | Gets the host driver type. (Inherited from BncsNetworkMessage.)
Public property | NetworkMessage | Gets the network message string. (Inherited from BncsNetworkMessage.)
Public property | Type | Gets the command type. (Inherited from BncsNetworkMessage.)
Public property | WorkstationNumber | Gets the workstation number. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

InfoQueryMessage Class
BNCS Namespace


InfoWriteMessage Class

InfoWriteMessage Class
InfoWrite network command message.
Inheritance Hierarchy
SystemObject
BNCSBncsNetworkMessage
BNCSInfoWriteMessage

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class InfoWriteMessage : BncsNetworkMessage

The InfoWriteMessage type exposes the following members.

Constructors
 | Name | Description
Public method | InfoWriteMessage | Constructor
Top
Methods
 | Name | Description
Public method | AssembleCommand | Assembles the command as a string. (Overrides BncsNetworkMessageAssembleCommand.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetParams | Gets an appropriate parameter descriptor by message type. (Inherited from BncsNetworkMessage.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the network message instance as a string showing it's description. (Inherited from BncsNetworkMessage.)
Top
Properties
 | Name | Description
Public property | CommandName | Gets the command name. (Inherited from BncsNetworkMessage.)
Public property | Description | Gets the description. (Inherited from BncsNetworkMessage.)
Public property | DeviceNumber | Gets the device number. (Inherited from BncsNetworkMessage.)
Public property | HostDriverType | Gets the host driver type. (Inherited from BncsNetworkMessage.)
Public property | NetworkMessage | Gets the network message string. (Inherited from BncsNetworkMessage.)
Public property | Type | Gets the command type. (Inherited from BncsNetworkMessage.)
Public property | WorkstationNumber | Gets the workstation number. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

BNCS Namespace


InfoWriteMessage Constructor

InfoWriteMessage Constructor
Constructor

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public InfoWriteMessage(
    uint deviceNumber_,
    string message_,
    uint slot_,
    uint workstationNumber_
)

Parameters

deviceNumber_
Type: SystemUInt32
Device number
message_
Type: SystemString
Slot message
slot_
Type: SystemUInt32
Slot number
workstationNumber_
Type: SystemUInt32
Workstation number
See Also

Reference

InfoWriteMessage Class
BNCS Namespace


InfoWriteMessage Methods

InfoWriteMessage Methods

The InfoWriteMessage type exposes the following members.

Methods
 | Name | Description
Public method | AssembleCommand | Assembles the command as a string. (Overrides BncsNetworkMessageAssembleCommand.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetParams | Gets an appropriate parameter descriptor by message type. (Inherited from BncsNetworkMessage.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the network message instance as a string showing it's description. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

InfoWriteMessage Class
BNCS Namespace


InfoWriteMessage.AssembleCommand Method

InfoWriteMessageAssembleCommand Method
Assembles the command as a string.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string AssembleCommand()

Return Value

Type: String
A command string to send to CSI.
See Also

Reference

InfoWriteMessage Class
BNCS Namespace


InfoWriteMessage Properties

InfoWriteMessage Properties

The InfoWriteMessage type exposes the following members.

Properties
 | Name | Description
Public property | CommandName | Gets the command name. (Inherited from BncsNetworkMessage.)
Public property | Description | Gets the description. (Inherited from BncsNetworkMessage.)
Public property | DeviceNumber | Gets the device number. (Inherited from BncsNetworkMessage.)
Public property | HostDriverType | Gets the host driver type. (Inherited from BncsNetworkMessage.)
Public property | NetworkMessage | Gets the network message string. (Inherited from BncsNetworkMessage.)
Public property | Type | Gets the command type. (Inherited from BncsNetworkMessage.)
Public property | WorkstationNumber | Gets the workstation number. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

InfoWriteMessage Class
BNCS Namespace


InstancesState Enumeration

InstancesState Enumeration
An enumeration of instance states, these being InputFileNotFound, NoInstances or HasInstances

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum InstancesState
Members
Member name | Value | Description
InputFileNotFound | 0 | Input file not found to generate instances from.
NoInstances | 1 | There are no instances.
HasInstances | 2 | There is at least one instance.
See Also

Reference

BNCS Namespace


LockMessage Class

LockMessage Class
Base class for all lock type network command classes.
Inheritance Hierarchy
SystemObject
BNCSBncsNetworkMessage
BNCSLockMessage
BNCSGPILockMessage
BNCSInfoLockMessage
BNCSRouterLockMessage

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public abstract class LockMessage : BncsNetworkMessage

The LockMessage type exposes the following members.

Constructors
 | Name | Description
Public method | LockMessage | Constructor
Top
Methods
 | Name | Description
Public method | AssembleCommand | Assembles the command as a string. (Overrides BncsNetworkMessageAssembleCommand.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetParams | Gets an appropriate parameter descriptor by message type. (Inherited from BncsNetworkMessage.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the network message instance as a string showing it's description. (Inherited from BncsNetworkMessage.)
Top
Properties
 | Name | Description
Public property | CommandName | Gets the command name. (Inherited from BncsNetworkMessage.)
Public property | Description | Gets the description. (Inherited from BncsNetworkMessage.)
Public property | DeviceNumber | Gets the device number. (Inherited from BncsNetworkMessage.)
Public property | HostDriverType | Gets the host driver type. (Inherited from BncsNetworkMessage.)
Public property | NetworkMessage | Gets the network message string. (Inherited from BncsNetworkMessage.)
Public property | Type | Gets the command type. (Inherited from BncsNetworkMessage.)
Public property | WorkstationNumber | Gets the workstation number. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

BNCS Namespace


LockMessage Constructor

LockMessage Constructor
Constructor

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public LockMessage(
    string description_,
    string commandName_,
    uint deviceNumber_,
    uint start_,
    uint end_,
    bool isLocked_,
    uint workstationNumber_
)

Parameters

description_
Type: SystemString
Command description
commandName_
Type: SystemString
Command name
deviceNumber_
Type: SystemUInt32
Device number
start_
Type: SystemUInt32
Start slot or destination
end_
Type: SystemUInt32
End slot or destination
isLocked_
Type: SystemBoolean
Lock state
workstationNumber_
Type: SystemUInt32
Workstation number
See Also

Reference

LockMessage Class
BNCS Namespace


LockMessage Methods

LockMessage Methods

The LockMessage type exposes the following members.

Methods
 | Name | Description
Public method | AssembleCommand | Assembles the command as a string. (Overrides BncsNetworkMessageAssembleCommand.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetParams | Gets an appropriate parameter descriptor by message type. (Inherited from BncsNetworkMessage.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the network message instance as a string showing it's description. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

LockMessage Class
BNCS Namespace


LockMessage.AssembleCommand Method

LockMessageAssembleCommand Method
Assembles the command as a string.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string AssembleCommand()

Return Value

Type: String
A command string to send to CSI.
See Also

Reference

LockMessage Class
BNCS Namespace


LockMessage Properties

LockMessage Properties

The LockMessage type exposes the following members.

Properties
 | Name | Description
Public property | CommandName | Gets the command name. (Inherited from BncsNetworkMessage.)
Public property | Description | Gets the description. (Inherited from BncsNetworkMessage.)
Public property | DeviceNumber | Gets the device number. (Inherited from BncsNetworkMessage.)
Public property | HostDriverType | Gets the host driver type. (Inherited from BncsNetworkMessage.)
Public property | NetworkMessage | Gets the network message string. (Inherited from BncsNetworkMessage.)
Public property | Type | Gets the command type. (Inherited from BncsNetworkMessage.)
Public property | WorkstationNumber | Gets the workstation number. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

LockMessage Class
BNCS Namespace


NetworkCommandParams Enumeration

NetworkCommandParams Enumeration
Enumerator denoting message parameter types.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum NetworkCommandParams
Members
Member name | Value | Description
InvalidRequest | 0 | Invalid message parameter request.
uub | 1 | Message requires uint, uint, bool arguments.
uu | 2 | Message requires uint, uint arguments.
ub | 3 | Message requires uint, bool arguments.
su | 4 | Message requires string, uint arguments.
uuS | 5 | Message requires uint, uint and an optional string arguments.
uusb | 6 | Message requires uint, string, bool arguments.
See Also

Reference

BNCS Namespace


NetworkMessageType Enumeration

NetworkMessageType Enumeration
Enumerator denoting types of network messages.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum NetworkMessageType
Members
Member name | Value | Description
Unknown | 0 | Message type is unknown
InfoWrite | 1 | Info Write message
InfoPoll | 2 | Info Poll message
InfoQuery | 3 | Info Query message
InfoLock | 4 | Info Lock message
RouterModify | 5 | Router Modify message
RouterCrosspoint | 6 | Router Crosspoint message
RouterPoll | 7 | Router Poll message
RouterQuery | 8 | Router Query message
RouterLock | 9 | Router Lock message
GPISet | 10 | GPI Set command
GPIPoll | 11 | GPI Poll command
GPIQuery | 12 | GPI Query command
GPILock | 13 | GPI Lock command
See Also

Reference

BNCS Namespace


OnArchiveEventArgs Class

OnArchiveEventArgs Class
Event argument class used by OnArchiveEventHandler/>
Inheritance Hierarchy
SystemObject
SystemEventArgs
BNCSOnArchiveEventArgs

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class OnArchiveEventArgs : EventArgs

The OnArchiveEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | OnArchiveEventArgs | Initializes a new instance of the OnArchiveEventArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | NewFilename | Gets/sets the new file name
Top
See Also

Reference

BNCS Namespace


OnArchiveEventArgs Constructor

OnArchiveEventArgs Constructor
Initializes a new instance of the OnArchiveEventArgs class

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public OnArchiveEventArgs()
See Also

Reference

OnArchiveEventArgs Class
BNCS Namespace


OnArchiveEventArgs Fields

OnArchiveEventArgs Fields

The OnArchiveEventArgs type exposes the following members.

Fields
 | Name | Description
Public field | NewFilename | Gets/sets the new file name
Top
See Also

Reference

OnArchiveEventArgs Class
BNCS Namespace


OnArchiveEventArgs.NewFilename Field

OnArchiveEventArgsNewFilename Field
Gets/sets the new file name

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string NewFilename

Field Value

Type: String
See Also

Reference

OnArchiveEventArgs Class
BNCS Namespace


OnArchiveEventArgs Methods

OnArchiveEventArgs Methods

The OnArchiveEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

OnArchiveEventArgs Class
BNCS Namespace


OnArchiveEventHandler Delegate

OnArchiveEventHandler Delegate
Delegate that defines the OnArchiveEventHandler event handler.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void OnArchiveEventHandler(
    Object sender,
    OnArchiveEventArgs e
)

Parameters

sender
Type: SystemObject
Calling object
e
Type: BNCSOnArchiveEventArgs
Parameters
See Also

Reference

BNCS Namespace


OnGetParameterValueEvent Delegate

OnGetParameterValueEvent Delegate
Delegate for event handlers get parameter values.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void OnGetParameterValueEvent(
    Object sender,
    OnGetParameterValueEventArgs e
)

Parameters

sender
Type: SystemObject
Calling object
e
Type: BNCSOnGetParameterValueEventArgs
Parameters of type OnGetParameterValueEventArgs
See Also

Reference

BNCS Namespace


OnGetParameterValueEventArgs Class

OnGetParameterValueEventArgs Class
Event argument class for events that return parameter values
Inheritance Hierarchy
SystemObject
SystemEventArgs
BNCSOnGetParameterValueEventArgs

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class OnGetParameterValueEventArgs : EventArgs

The OnGetParameterValueEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | OnGetParameterValueEventArgs | Initializes a new instance of the OnGetParameterValueEventArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | OldValue | Gets or sets the previous value
Public field | Parameter | Gets or sets the parameter number
Public field | Unit | Gets or sets the unit number
Public field | Value | Gets or sets the value
Top
See Also

Reference

BNCS Namespace


OnGetParameterValueEventArgs Constructor

OnGetParameterValueEventArgs Constructor
Initializes a new instance of the OnGetParameterValueEventArgs class

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public OnGetParameterValueEventArgs()
See Also

Reference

OnGetParameterValueEventArgs Class
BNCS Namespace


OnGetParameterValueEventArgs Fields

OnGetParameterValueEventArgs Fields

The OnGetParameterValueEventArgs type exposes the following members.

Fields
 | Name | Description
Public field | OldValue | Gets or sets the previous value
Public field | Parameter | Gets or sets the parameter number
Public field | Unit | Gets or sets the unit number
Public field | Value | Gets or sets the value
Top
See Also

Reference

OnGetParameterValueEventArgs Class
BNCS Namespace


OnGetParameterValueEventArgs.OldValue Field

OnGetParameterValueEventArgsOldValue Field
Gets or sets the previous value

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string OldValue

Field Value

Type: String
See Also

Reference

OnGetParameterValueEventArgs Class
BNCS Namespace


OnGetParameterValueEventArgs.Parameter Field

OnGetParameterValueEventArgsParameter Field
Gets or sets the parameter number

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Parameter

Field Value

Type: Int32
See Also

Reference

OnGetParameterValueEventArgs Class
BNCS Namespace


OnGetParameterValueEventArgs.Unit Field

OnGetParameterValueEventArgsUnit Field
Gets or sets the unit number

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Unit

Field Value

Type: Int32
See Also

Reference

OnGetParameterValueEventArgs Class
BNCS Namespace


OnGetParameterValueEventArgs.Value Field

OnGetParameterValueEventArgsValue Field
Gets or sets the value

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Value

Field Value

Type: String
See Also

Reference

OnGetParameterValueEventArgs Class
BNCS Namespace


OnGetParameterValueEventArgs Methods

OnGetParameterValueEventArgs Methods

The OnGetParameterValueEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

OnGetParameterValueEventArgs Class
BNCS Namespace


PseudoSlot Class

PseudoSlot Class
A class representing a "pseudo slot", i.e. a slot that is not native to the device type but exists as a concept at the driver level
Inheritance Hierarchy
SystemObject
BNCSPseudoSlot

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class PseudoSlot

The PseudoSlot type exposes the following members.

Constructors
Name Description
PseudoSlot(String, UInt32, UInt32)
Constructor that sets the name, device number and literal slot number
Examples
Copy
public partial class MainWindow : Window
{
    public void CreatePseudoSlots()
    {
        foreach (BNCSDeviceType deviceType in _types.DeviceTypes)
        {
            foreach (BNCSDeviceTypeParameter parameter in deviceType.Parameters)
            {
                if (parameter.IsPseudoParameter && parameter.Name.Equals("Communications"))
                {
                    PseudoSlot pslot = new PseudoSlot(parameter.Name, (uint)deviceInstance.UnitNumber, (uint)parameter.Slot + (uint)offset);
                    if (!_pslots.Contains(pslot))
                    {
                        _pslots.Add(pslot);
                        WriteToInfodriverSlot(pslot.LiteralSlotNumber, PSLOT_NORMAL);
                    }
                }
            }
        }
    }
}
Public method PseudoSlot(String, UInt32, UInt32, ListBNCSDeviceTypeParameterState)
Constructor that sets the name, device number, literal slot number and device type parameter states.
Top
Methods
 | Name | Description
Public method | Equals | Tests for equality with the supplied object (Overrides ObjectEquals(Object).)
Public method | GetHashCode | Gets the hash code (Overrides ObjectGetHashCode.)
Public method | GetStateValueByStateMsg | Gets a state value by state message
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the class (Overrides ObjectToString.)
Top
Properties
 | Name | Description
Public property | DeviceNumber | Gets the device number
Public property | LiteralSlotNumber | Gets the literal slot number
Public property | Name | Gets the name
Public property | States | Gets the list of device type parameter states of type BNCSDeviceTypeParameterState
Public property | Value | Gets/sets the value
Top
See Also

Reference

BNCS Namespace


PseudoSlot Constructor

PseudoSlot Constructor
Overload List
Name Description
PseudoSlot(String, UInt32, UInt32)
Constructor that sets the name, device number and literal slot number
Examples
Copy
public partial class MainWindow : Window
{
    public void CreatePseudoSlots()
    {
        foreach (BNCSDeviceType deviceType in _types.DeviceTypes)
        {
            foreach (BNCSDeviceTypeParameter parameter in deviceType.Parameters)
            {
                if (parameter.IsPseudoParameter && parameter.Name.Equals("Communications"))
                {
                    PseudoSlot pslot = new PseudoSlot(parameter.Name, (uint)deviceInstance.UnitNumber, (uint)parameter.Slot + (uint)offset);
                    if (!_pslots.Contains(pslot))
                    {
                        _pslots.Add(pslot);
                        WriteToInfodriverSlot(pslot.LiteralSlotNumber, PSLOT_NORMAL);
                    }
                }
            }
        }
    }
}
Public method PseudoSlot(String, UInt32, UInt32, ListBNCSDeviceTypeParameterState)
Constructor that sets the name, device number, literal slot number and device type parameter states.
Top
See Also

Reference

PseudoSlot Class
BNCS Namespace


PseudoSlot Constructor (String, UInt32, UInt32)

PseudoSlot Constructor (String, UInt32, UInt32)
Constructor that sets the name, device number and literal slot number
Examples
Copy
public partial class MainWindow : Window
{
    public void CreatePseudoSlots()
    {
        foreach (BNCSDeviceType deviceType in _types.DeviceTypes)
        {
            foreach (BNCSDeviceTypeParameter parameter in deviceType.Parameters)
            {
                if (parameter.IsPseudoParameter && parameter.Name.Equals("Communications"))
                {
                    PseudoSlot pslot = new PseudoSlot(parameter.Name, (uint)deviceInstance.UnitNumber, (uint)parameter.Slot + (uint)offset);
                    if (!_pslots.Contains(pslot))
                    {
                        _pslots.Add(pslot);
                        WriteToInfodriverSlot(pslot.LiteralSlotNumber, PSLOT_NORMAL);
                    }
                }
            }
        }
    }
}

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public PseudoSlot(
    string name_,
    uint deviceNumber_,
    uint literalSlotNumber_
)

Parameters

name_
Type: SystemString
Pseudo slot name
deviceNumber_
Type: SystemUInt32
Device numnber
literalSlotNumber_
Type: SystemUInt32
Literal slot number
See Also

Reference

PseudoSlot Class
PseudoSlot Overload
BNCS Namespace


PseudoSlot Constructor (String, UInt32, UInt32, List(BNCSDeviceTypeParameterState))

PseudoSlot Constructor (String, UInt32, UInt32, ListBNCSDeviceTypeParameterState)
Constructor that sets the name, device number, literal slot number and device type parameter states.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public PseudoSlot(
    string name_,
    uint deviceNumber_,
    uint literalSlotNumber_,
    List<BNCSDeviceTypeParameterState> states_
)

Parameters

name_
Type: SystemString
Pseudo slot name
deviceNumber_
Type: SystemUInt32
Device numnber
literalSlotNumber_
Type: SystemUInt32
Literal slot number
states_
Type: System.Collections.GenericList BNCSDeviceTypeParameterState
Device type parameter states, a list of BNCSDeviceTypeParameterState
See Also

Reference

PseudoSlot Class
PseudoSlot Overload
BNCS Namespace


PseudoSlot Methods

PseudoSlot Methods

The PseudoSlot type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Tests for equality with the supplied object (Overrides ObjectEquals(Object).)
Public method | GetHashCode | Gets the hash code (Overrides ObjectGetHashCode.)
Public method | GetStateValueByStateMsg | Gets a state value by state message
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the class (Overrides ObjectToString.)
Top
See Also

Reference

PseudoSlot Class
BNCS Namespace


PseudoSlot.Equals Method

PseudoSlotEquals Method
Tests for equality with the supplied object

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override bool Equals(
    Object obj
)

Parameters

obj
Type: SystemObject
Object to compare

Return Value

Type: Boolean
True if "obj" is of type PseudoSlot and its device and literal slot numbers are equal to this instances values
See Also

Reference

PseudoSlot Class
BNCS Namespace


PseudoSlot.GetHashCode Method

PseudoSlotGetHashCode Method
Gets the hash code

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override int GetHashCode()

Return Value

Type: Int32
A hash code
See Also

Reference

PseudoSlot Class
BNCS Namespace


PseudoSlot.GetStateValueByStateMsg Method

PseudoSlotGetStateValueByStateMsg Method
Gets a state value by state message

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string GetStateValueByStateMsg(
    string msg_
)

Parameters

msg_
Type: SystemString
State message to examine

Return Value

Type: String
The state value according to message or NULL
See Also

Reference

PseudoSlot Class
BNCS Namespace


PseudoSlot.ToString Method

PseudoSlotToString Method
Returns a string representation of the class

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
A string consisting of name, device and literal slot numbers.
See Also

Reference

PseudoSlot Class
BNCS Namespace


PseudoSlot Properties

PseudoSlot Properties

The PseudoSlot type exposes the following members.

Properties
 | Name | Description
Public property | DeviceNumber | Gets the device number
Public property | LiteralSlotNumber | Gets the literal slot number
Public property | Name | Gets the name
Public property | States | Gets the list of device type parameter states of type BNCSDeviceTypeParameterState
Public property | Value | Gets/sets the value
Top
See Also

Reference

PseudoSlot Class
BNCS Namespace


PseudoSlot.DeviceNumber Property

PseudoSlotDeviceNumber Property
Gets the device number

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint DeviceNumber { get; }

Property Value

Type: UInt32
See Also

Reference

PseudoSlot Class
BNCS Namespace


PseudoSlot.LiteralSlotNumber Property

PseudoSlotLiteralSlotNumber Property
Gets the literal slot number

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint LiteralSlotNumber { get; }

Property Value

Type: UInt32
See Also

Reference

PseudoSlot Class
BNCS Namespace


PseudoSlot.Name Property

PseudoSlotName Property
Gets the name

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Name { get; }

Property Value

Type: String
See Also

Reference

PseudoSlot Class
BNCS Namespace


PseudoSlot.States Property

PseudoSlotStates Property
Gets the list of device type parameter states of type BNCSDeviceTypeParameterState

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<BNCSDeviceTypeParameterState> States { get; }

Property Value

Type: List BNCSDeviceTypeParameterState
See Also

Reference

PseudoSlot Class
BNCS Namespace


PseudoSlot.Value Property

PseudoSlotValue Property
Gets/sets the value

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Value { get; set; }

Property Value

Type: String
See Also

Reference

PseudoSlot Class
BNCS Namespace


QueryPollMessage Class

QueryPollMessage Class
Base class for all query and poll type network command classes.
Inheritance Hierarchy
SystemObject
BNCSBncsNetworkMessage
BNCSQueryPollMessage
More...

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public abstract class QueryPollMessage : BncsNetworkMessage

The QueryPollMessage type exposes the following members.

Constructors
 | Name | Description
Public method | QueryPollMessage | Constructor
Top
Methods
 | Name | Description
Public method | AssembleCommand | Assembles the command as a string. (Overrides BncsNetworkMessageAssembleCommand.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetParams | Gets an appropriate parameter descriptor by message type. (Inherited from BncsNetworkMessage.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the network message instance as a string showing it's description. (Inherited from BncsNetworkMessage.)
Top
Properties
 | Name | Description
Public property | CommandName | Gets the command name. (Inherited from BncsNetworkMessage.)
Public property | Description | Gets the description. (Inherited from BncsNetworkMessage.)
Public property | DeviceNumber | Gets the device number. (Inherited from BncsNetworkMessage.)
Public property | HostDriverType | Gets the host driver type. (Inherited from BncsNetworkMessage.)
Public property | NetworkMessage | Gets the network message string. (Inherited from BncsNetworkMessage.)
Public property | Type | Gets the command type. (Inherited from BncsNetworkMessage.)
Public property | WorkstationNumber | Gets the workstation number. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

BNCS Namespace
Inheritance Hierarchy
SystemObject
BNCSBncsNetworkMessage
BNCSQueryPollMessage
BNCSGPIPollMessage
BNCSGPIQueryMessage
BNCSInfoPollMessage
BNCSInfoQueryMessage
BNCSRouterPollMessage
BNCSRouterQueryMessage


QueryPollMessage Constructor

QueryPollMessage Constructor
Constructor

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public QueryPollMessage(
    string description_,
    string commandName_,
    uint deviceNumber_,
    uint first_,
    uint last_,
    uint workstationNumber_
)

Parameters

description_
Type: SystemString
Command description
commandName_
Type: SystemString
Command name
deviceNumber_
Type: SystemUInt32
Device number
first_
Type: SystemUInt32
First slot or destination
last_
Type: SystemUInt32
Last slot or destination
workstationNumber_
Type: SystemUInt32
Workstation number
See Also

Reference

QueryPollMessage Class
BNCS Namespace


QueryPollMessage Methods

QueryPollMessage Methods

The QueryPollMessage type exposes the following members.

Methods
 | Name | Description
Public method | AssembleCommand | Assembles the command as a string. (Overrides BncsNetworkMessageAssembleCommand.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetParams | Gets an appropriate parameter descriptor by message type. (Inherited from BncsNetworkMessage.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the network message instance as a string showing it's description. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

QueryPollMessage Class
BNCS Namespace


QueryPollMessage.AssembleCommand Method

QueryPollMessageAssembleCommand Method
Assembles the command as a string.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string AssembleCommand()

Return Value

Type: String
A command string to send to CSI.
See Also

Reference

QueryPollMessage Class
BNCS Namespace


QueryPollMessage Properties

QueryPollMessage Properties

The QueryPollMessage type exposes the following members.

Properties
 | Name | Description
Public property | CommandName | Gets the command name. (Inherited from BncsNetworkMessage.)
Public property | Description | Gets the description. (Inherited from BncsNetworkMessage.)
Public property | DeviceNumber | Gets the device number. (Inherited from BncsNetworkMessage.)
Public property | HostDriverType | Gets the host driver type. (Inherited from BncsNetworkMessage.)
Public property | NetworkMessage | Gets the network message string. (Inherited from BncsNetworkMessage.)
Public property | Type | Gets the command type. (Inherited from BncsNetworkMessage.)
Public property | WorkstationNumber | Gets the workstation number. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

QueryPollMessage Class
BNCS Namespace


RouterCrosspointMessage Class

RouterCrosspointMessage Class
RouterCrosspoint network message command.
Inheritance Hierarchy
SystemObject
BNCSBncsNetworkMessage
BNCSRouterCrosspointMessage

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class RouterCrosspointMessage : BncsNetworkMessage

The RouterCrosspointMessage type exposes the following members.

Constructors
 | Name | Description
Public method | RouterCrosspointMessage(UInt32, UInt32, UInt32, UInt32) | Constructor with no mask argument, mask is set to "','"
Public method | RouterCrosspointMessage(UInt32, UInt32, UInt32, String, UInt32) | Constructor with a mask argument.
Top
Methods
 | Name | Description
Public method | AssembleCommand | Assembles the command as a string. (Overrides BncsNetworkMessageAssembleCommand.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetParams | Gets an appropriate parameter descriptor by message type. (Inherited from BncsNetworkMessage.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the network message instance as a string showing it's description. (Inherited from BncsNetworkMessage.)
Top
Properties
 | Name | Description
Public property | CommandName | Gets the command name. (Inherited from BncsNetworkMessage.)
Public property | Description | Gets the description. (Inherited from BncsNetworkMessage.)
Public property | DeviceNumber | Gets the device number. (Inherited from BncsNetworkMessage.)
Public property | HostDriverType | Gets the host driver type. (Inherited from BncsNetworkMessage.)
Public property | NetworkMessage | Gets the network message string. (Inherited from BncsNetworkMessage.)
Public property | Type | Gets the command type. (Inherited from BncsNetworkMessage.)
Public property | WorkstationNumber | Gets the workstation number. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

BNCS Namespace


RouterCrosspointMessage Constructor

RouterCrosspointMessage Constructor
Overload List
 | Name | Description
Public method | RouterCrosspointMessage(UInt32, UInt32, UInt32, UInt32) | Constructor with no mask argument, mask is set to "','"
Public method | RouterCrosspointMessage(UInt32, UInt32, UInt32, String, UInt32) | Constructor with a mask argument.
Top
See Also

Reference

RouterCrosspointMessage Class
BNCS Namespace


RouterCrosspointMessage Constructor (UInt32, UInt32, UInt32, UInt32)

RouterCrosspointMessage Constructor (UInt32, UInt32, UInt32, UInt32)
Constructor with no mask argument, mask is set to "','"

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public RouterCrosspointMessage(
    uint deviceNumber_,
    uint source_,
    uint destination_,
    uint workstationNumber_
)

Parameters

deviceNumber_
Type: SystemUInt32
Device number
source_
Type: SystemUInt32
Source number
destination_
Type: SystemUInt32
Destination number
workstationNumber_
Type: SystemUInt32
Workstation number
See Also

Reference

RouterCrosspointMessage Class
RouterCrosspointMessage Overload
BNCS Namespace


RouterCrosspointMessage Constructor (UInt32, UInt32, UInt32, String, UInt32)

RouterCrosspointMessage Constructor (UInt32, UInt32, UInt32, String, UInt32)
Constructor with a mask argument.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public RouterCrosspointMessage(
    uint deviceNumber_,
    uint source_,
    uint destination_,
    string mask_,
    uint workstationNumber_
)

Parameters

deviceNumber_
Type: SystemUInt32
Device number
source_
Type: SystemUInt32
Source number
destination_
Type: SystemUInt32
Destination number
mask_
Type: SystemString
Mask, inserted into "','" if not passed already.
workstationNumber_
Type: SystemUInt32
Workstation number
See Also

Reference

RouterCrosspointMessage Class
RouterCrosspointMessage Overload
BNCS Namespace


RouterCrosspointMessage Methods

RouterCrosspointMessage Methods

The RouterCrosspointMessage type exposes the following members.

Methods
 | Name | Description
Public method | AssembleCommand | Assembles the command as a string. (Overrides BncsNetworkMessageAssembleCommand.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetParams | Gets an appropriate parameter descriptor by message type. (Inherited from BncsNetworkMessage.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the network message instance as a string showing it's description. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

RouterCrosspointMessage Class
BNCS Namespace


RouterCrosspointMessage.AssembleCommand Method

RouterCrosspointMessageAssembleCommand Method
Assembles the command as a string.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string AssembleCommand()

Return Value

Type: String
A command string to send to CSI.
See Also

Reference

RouterCrosspointMessage Class
BNCS Namespace


RouterCrosspointMessage Properties

RouterCrosspointMessage Properties

The RouterCrosspointMessage type exposes the following members.

Properties
 | Name | Description
Public property | CommandName | Gets the command name. (Inherited from BncsNetworkMessage.)
Public property | Description | Gets the description. (Inherited from BncsNetworkMessage.)
Public property | DeviceNumber | Gets the device number. (Inherited from BncsNetworkMessage.)
Public property | HostDriverType | Gets the host driver type. (Inherited from BncsNetworkMessage.)
Public property | NetworkMessage | Gets the network message string. (Inherited from BncsNetworkMessage.)
Public property | Type | Gets the command type. (Inherited from BncsNetworkMessage.)
Public property | WorkstationNumber | Gets the workstation number. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

RouterCrosspointMessage Class
BNCS Namespace


RouterLockMessage Class

RouterLockMessage Class
RouterLock network message command.
Inheritance Hierarchy
SystemObject
BNCSBncsNetworkMessage
BNCSLockMessage
BNCSRouterLockMessage

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class RouterLockMessage : LockMessage

The RouterLockMessage type exposes the following members.

Constructors
 | Name | Description
Public method | RouterLockMessage | Initializes a new instance of the RouterLockMessage class
Top
Methods
 | Name | Description
Public method | AssembleCommand | Assembles the command as a string. (Inherited from LockMessage.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetParams | Gets an appropriate parameter descriptor by message type. (Inherited from BncsNetworkMessage.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the network message instance as a string showing it's description. (Inherited from BncsNetworkMessage.)
Top
Properties
 | Name | Description
Public property | CommandName | Gets the command name. (Inherited from BncsNetworkMessage.)
Public property | Description | Gets the description. (Inherited from BncsNetworkMessage.)
Public property | DeviceNumber | Gets the device number. (Inherited from BncsNetworkMessage.)
Public property | HostDriverType | Gets the host driver type. (Inherited from BncsNetworkMessage.)
Public property | NetworkMessage | Gets the network message string. (Inherited from BncsNetworkMessage.)
Public property | Type | Gets the command type. (Inherited from BncsNetworkMessage.)
Public property | WorkstationNumber | Gets the workstation number. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

BNCS Namespace


RouterLockMessage Constructor

RouterLockMessage Constructor
Initializes a new instance of the RouterLockMessage class

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public RouterLockMessage(
    uint deviceNumber_,
    uint firstDestination_,
    uint endDestination_,
    bool isLocked_,
    uint workstationNumber_
)

Parameters

deviceNumber_
Type: SystemUInt32
Device number
firstDestination_
Type: SystemUInt32
First destination to lock/unlock
endDestination_
Type: SystemUInt32
Last destination to lock/unlock
isLocked_
Type: SystemBoolean
Lock state to apply
workstationNumber_
Type: SystemUInt32
Workstation number
See Also

Reference

RouterLockMessage Class
BNCS Namespace


RouterLockMessage Methods

RouterLockMessage Methods

The RouterLockMessage type exposes the following members.

Methods
 | Name | Description
Public method | AssembleCommand | Assembles the command as a string. (Inherited from LockMessage.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetParams | Gets an appropriate parameter descriptor by message type. (Inherited from BncsNetworkMessage.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the network message instance as a string showing it's description. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

RouterLockMessage Class
BNCS Namespace


RouterLockMessage Properties

RouterLockMessage Properties

The RouterLockMessage type exposes the following members.

Properties
 | Name | Description
Public property | CommandName | Gets the command name. (Inherited from BncsNetworkMessage.)
Public property | Description | Gets the description. (Inherited from BncsNetworkMessage.)
Public property | DeviceNumber | Gets the device number. (Inherited from BncsNetworkMessage.)
Public property | HostDriverType | Gets the host driver type. (Inherited from BncsNetworkMessage.)
Public property | NetworkMessage | Gets the network message string. (Inherited from BncsNetworkMessage.)
Public property | Type | Gets the command type. (Inherited from BncsNetworkMessage.)
Public property | WorkstationNumber | Gets the workstation number. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

RouterLockMessage Class
BNCS Namespace


RouterModifyMessage Class

RouterModifyMessage Class
RouterModify network command message.
Inheritance Hierarchy
SystemObject
BNCSBncsNetworkMessage
BNCSRouterModifyMessage

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class RouterModifyMessage : BncsNetworkMessage

The RouterModifyMessage type exposes the following members.

Constructors
 | Name | Description
Public method | RouterModifyMessage | Constructor
Top
Methods
 | Name | Description
Public method | AssembleCommand | Assembles the command as a string. (Overrides BncsNetworkMessageAssembleCommand.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetParams | Gets an appropriate parameter descriptor by message type. (Inherited from BncsNetworkMessage.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the network message instance as a string showing it's description. (Inherited from BncsNetworkMessage.)
Top
Properties
 | Name | Description
Public property | CommandName | Gets the command name. (Inherited from BncsNetworkMessage.)
Public property | Description | Gets the description. (Inherited from BncsNetworkMessage.)
Public property | DeviceNumber | Gets the device number. (Inherited from BncsNetworkMessage.)
Public property | HostDriverType | Gets the host driver type. (Inherited from BncsNetworkMessage.)
Public property | NetworkMessage | Gets the network message string. (Inherited from BncsNetworkMessage.)
Public property | Type | Gets the command type. (Inherited from BncsNetworkMessage.)
Public property | WorkstationNumber | Gets the workstation number. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

BNCS Namespace


RouterModifyMessage Constructor

RouterModifyMessage Constructor
Constructor

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public RouterModifyMessage(
    uint deviceNumber_,
    uint database_,
    uint index_,
    string name_,
    bool tallyDump_,
    uint workstationNumber_
)

Parameters

deviceNumber_
Type: SystemUInt32
Device number
database_
Type: SystemUInt32
Database number
index_
Type: SystemUInt32
Index
name_
Type: SystemString
Name
tallyDump_
Type: SystemBoolean
Tally dump
workstationNumber_
Type: SystemUInt32
Workstation number
See Also

Reference

RouterModifyMessage Class
BNCS Namespace


RouterModifyMessage Methods

RouterModifyMessage Methods

The RouterModifyMessage type exposes the following members.

Methods
 | Name | Description
Public method | AssembleCommand | Assembles the command as a string. (Overrides BncsNetworkMessageAssembleCommand.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetParams | Gets an appropriate parameter descriptor by message type. (Inherited from BncsNetworkMessage.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the network message instance as a string showing it's description. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

RouterModifyMessage Class
BNCS Namespace


RouterModifyMessage.AssembleCommand Method

RouterModifyMessageAssembleCommand Method
Assembles the command as a string.

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string AssembleCommand()

Return Value

Type: String
A command string to send to CSI.
See Also

Reference

RouterModifyMessage Class
BNCS Namespace


RouterModifyMessage Properties

RouterModifyMessage Properties

The RouterModifyMessage type exposes the following members.

Properties
 | Name | Description
Public property | CommandName | Gets the command name. (Inherited from BncsNetworkMessage.)
Public property | Description | Gets the description. (Inherited from BncsNetworkMessage.)
Public property | DeviceNumber | Gets the device number. (Inherited from BncsNetworkMessage.)
Public property | HostDriverType | Gets the host driver type. (Inherited from BncsNetworkMessage.)
Public property | NetworkMessage | Gets the network message string. (Inherited from BncsNetworkMessage.)
Public property | Type | Gets the command type. (Inherited from BncsNetworkMessage.)
Public property | WorkstationNumber | Gets the workstation number. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

RouterModifyMessage Class
BNCS Namespace


RouterPollMessage Class

RouterPollMessage Class
RouterPoll network message command.
Inheritance Hierarchy
SystemObject
BNCSBncsNetworkMessage
BNCSQueryPollMessage
BNCSRouterPollMessage

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class RouterPollMessage : QueryPollMessage

The RouterPollMessage type exposes the following members.

Constructors
 | Name | Description
Public method | RouterPollMessage | Constructor
Top
Methods
 | Name | Description
Public method | AssembleCommand | Assembles the command as a string. (Inherited from QueryPollMessage.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetParams | Gets an appropriate parameter descriptor by message type. (Inherited from BncsNetworkMessage.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the network message instance as a string showing it's description. (Inherited from BncsNetworkMessage.)
Top
Properties
 | Name | Description
Public property | CommandName | Gets the command name. (Inherited from BncsNetworkMessage.)
Public property | Description | Gets the description. (Inherited from BncsNetworkMessage.)
Public property | DeviceNumber | Gets the device number. (Inherited from BncsNetworkMessage.)
Public property | HostDriverType | Gets the host driver type. (Inherited from BncsNetworkMessage.)
Public property | NetworkMessage | Gets the network message string. (Inherited from BncsNetworkMessage.)
Public property | Type | Gets the command type. (Inherited from BncsNetworkMessage.)
Public property | WorkstationNumber | Gets the workstation number. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

BNCS Namespace


RouterPollMessage Constructor

RouterPollMessage Constructor
Constructor

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public RouterPollMessage(
    uint deviceNumber_,
    uint firstDestination_,
    uint lastDestination_,
    uint workstationNumber_
)

Parameters

deviceNumber_
Type: SystemUInt32
Device number
firstDestination_
Type: SystemUInt32
First destination to poll
lastDestination_
Type: SystemUInt32
Last destination to poll
workstationNumber_
Type: SystemUInt32
Workstation number
See Also

Reference

RouterPollMessage Class
BNCS Namespace


RouterPollMessage Methods

RouterPollMessage Methods

The RouterPollMessage type exposes the following members.

Methods
 | Name | Description
Public method | AssembleCommand | Assembles the command as a string. (Inherited from QueryPollMessage.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetParams | Gets an appropriate parameter descriptor by message type. (Inherited from BncsNetworkMessage.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the network message instance as a string showing it's description. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

RouterPollMessage Class
BNCS Namespace


RouterPollMessage Properties

RouterPollMessage Properties

The RouterPollMessage type exposes the following members.

Properties
 | Name | Description
Public property | CommandName | Gets the command name. (Inherited from BncsNetworkMessage.)
Public property | Description | Gets the description. (Inherited from BncsNetworkMessage.)
Public property | DeviceNumber | Gets the device number. (Inherited from BncsNetworkMessage.)
Public property | HostDriverType | Gets the host driver type. (Inherited from BncsNetworkMessage.)
Public property | NetworkMessage | Gets the network message string. (Inherited from BncsNetworkMessage.)
Public property | Type | Gets the command type. (Inherited from BncsNetworkMessage.)
Public property | WorkstationNumber | Gets the workstation number. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

RouterPollMessage Class
BNCS Namespace


RouterQueryMessage Class

RouterQueryMessage Class
RouterQuery network message command.
Inheritance Hierarchy
SystemObject
BNCSBncsNetworkMessage
BNCSQueryPollMessage
BNCSRouterQueryMessage

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class RouterQueryMessage : QueryPollMessage

The RouterQueryMessage type exposes the following members.

Constructors
 | Name | Description
Public method | RouterQueryMessage | Constructor
Top
Methods
 | Name | Description
Public method | AssembleCommand | Assembles the command as a string. (Inherited from QueryPollMessage.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetParams | Gets an appropriate parameter descriptor by message type. (Inherited from BncsNetworkMessage.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the network message instance as a string showing it's description. (Inherited from BncsNetworkMessage.)
Top
Properties
 | Name | Description
Public property | CommandName | Gets the command name. (Inherited from BncsNetworkMessage.)
Public property | Description | Gets the description. (Inherited from BncsNetworkMessage.)
Public property | DeviceNumber | Gets the device number. (Inherited from BncsNetworkMessage.)
Public property | HostDriverType | Gets the host driver type. (Inherited from BncsNetworkMessage.)
Public property | NetworkMessage | Gets the network message string. (Inherited from BncsNetworkMessage.)
Public property | Type | Gets the command type. (Inherited from BncsNetworkMessage.)
Public property | WorkstationNumber | Gets the workstation number. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

BNCS Namespace


RouterQueryMessage Constructor

RouterQueryMessage Constructor
Constructor

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public RouterQueryMessage(
    uint deviceNumber_,
    uint firstDestination_,
    uint lastDestination_,
    uint workstationNumber_
)

Parameters

deviceNumber_
Type: SystemUInt32
Device number
firstDestination_
Type: SystemUInt32
First destination to query
lastDestination_
Type: SystemUInt32
Last destination to query
workstationNumber_
Type: SystemUInt32
Workstation number
See Also

Reference

RouterQueryMessage Class
BNCS Namespace


RouterQueryMessage Methods

RouterQueryMessage Methods

The RouterQueryMessage type exposes the following members.

Methods
 | Name | Description
Public method | AssembleCommand | Assembles the command as a string. (Inherited from QueryPollMessage.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetParams | Gets an appropriate parameter descriptor by message type. (Inherited from BncsNetworkMessage.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the network message instance as a string showing it's description. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

RouterQueryMessage Class
BNCS Namespace


RouterQueryMessage Properties

RouterQueryMessage Properties

The RouterQueryMessage type exposes the following members.

Properties
 | Name | Description
Public property | CommandName | Gets the command name. (Inherited from BncsNetworkMessage.)
Public property | Description | Gets the description. (Inherited from BncsNetworkMessage.)
Public property | DeviceNumber | Gets the device number. (Inherited from BncsNetworkMessage.)
Public property | HostDriverType | Gets the host driver type. (Inherited from BncsNetworkMessage.)
Public property | NetworkMessage | Gets the network message string. (Inherited from BncsNetworkMessage.)
Public property | Type | Gets the command type. (Inherited from BncsNetworkMessage.)
Public property | WorkstationNumber | Gets the workstation number. (Inherited from BncsNetworkMessage.)
Top
See Also

Reference

RouterQueryMessage Class
BNCS Namespace


UnitParameterAddress Class

UnitParameterAddress Class
A simple class containing a unit parameter address, ie unit number and parameter number
Inheritance Hierarchy
SystemObject
BNCSUnitParameterAddress

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class UnitParameterAddress

The UnitParameterAddress type exposes the following members.

Constructors
 | Name | Description
Public method | UnitParameterAddress | Initializes a new instance of the UnitParameterAddress class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | ParameterNumber | Gets/sets the parameter number
Public field | UnitNumber | Gets/sets the unit number
Top
Properties
 | Name | Description
Public property | IsUserSlot | Gets the user slot flag
Top
See Also

Reference

BNCS Namespace


UnitParameterAddress Constructor

UnitParameterAddress Constructor
Initializes a new instance of the UnitParameterAddress class

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public UnitParameterAddress()
See Also

Reference

UnitParameterAddress Class
BNCS Namespace


UnitParameterAddress Fields

UnitParameterAddress Fields

The UnitParameterAddress type exposes the following members.

Fields
 | Name | Description
Public field | ParameterNumber | Gets/sets the parameter number
Public field | UnitNumber | Gets/sets the unit number
Top
See Also

Reference

UnitParameterAddress Class
BNCS Namespace


UnitParameterAddress.ParameterNumber Field

UnitParameterAddressParameterNumber Field
Gets/sets the parameter number

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int ParameterNumber

Field Value

Type: Int32
See Also

Reference

UnitParameterAddress Class
BNCS Namespace


UnitParameterAddress.UnitNumber Field

UnitParameterAddressUnitNumber Field
Gets/sets the unit number

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int UnitNumber

Field Value

Type: Int32
See Also

Reference

UnitParameterAddress Class
BNCS Namespace


UnitParameterAddress Methods

UnitParameterAddress Methods

The UnitParameterAddress type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

UnitParameterAddress Class
BNCS Namespace


UnitParameterAddress Properties

UnitParameterAddress Properties

The UnitParameterAddress type exposes the following members.

Properties
 | Name | Description
Public property | IsUserSlot | Gets the user slot flag
Top
See Also

Reference

UnitParameterAddress Class
BNCS Namespace


UnitParameterAddress.IsUserSlot Property

UnitParameterAddressIsUserSlot Property
Gets the user slot flag

Namespace: BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool IsUserSlot { get; }

Property Value

Type: Boolean
See Also

Reference

UnitParameterAddress Class
BNCS Namespace


Bncs.Comms Namespace

Bncs.Comms Namespace
This namespace consists of class to invoke two way communications over Serial, TCP and UDP connections.
Classes
 | Class | Description
Public class | AsynchPingResultEventArgs | EventArgs class for asynchronous ping event handler.
Public class | BncsPing | Class that executes a ping on an IP address.
Public class | CommsClient | A communications class for sending and receiving data over Serial, UDP or TCP/IP according to the provided settings type assigned. The method used for data exchange is polling within a thread.
Public class | CommsClient2 | A communications class for sending and receiving data over Serial, UDP or TCP/IP according to the provided settings type assigned. The method used for data exchange is event driven.
Public class | CommsClientCollection | A class that keeps a collection of CommsClient instances. This class does not generate objects of type CommsClient2
Public class | CommsClientDebugger | A debugger class manipulated by instances of the CommsClient and CommsClient2 classes. An instantiation of this class can be assigned to the aforementioned classes Debugger and Debugger properties. When assigned all raw transmitted and/or received data is logged.
Public class | CommsSerialSettings | Serialisable communications settings for serial connections.
Public class | CommsSettings | Base class for all communications settings, this class all derivitives are serialisable as they are derived from PersistedXML
Public class | CommsTCPSettings | Serialisable communications settings for TCP connections.
Public class | CommsThroughput | Helper class for recording data throughput volumes in a TxRxCommsThroughput. instance.
Public class | CommsUDPSettings | Serialisable communications settings for UDP connections.
Public class | CommsUtils | Communications utilities.
Public class | ConnectionDataItem | A class encapsulating a single BNCS log file string, if valid a list of these objects will be presented to the user to select valid connect, disconnect, reconnecting entries
Public class | DispatcherEventArgs | The base class for all EventArgs used in CommsClient and CommsClient2 event handlers. When any event fires the Dispatch member is true. When needing to handle this asynchronously simply change the argument to false and recall your event handler to carry out operations such as UI updating within the context of your main thread.
Public class | HourlyUpdateEventArgs | Event argument class for OnHourlyUpdate event handler.
Public class | HTTPRequestError | Error handling class for the HTTPWebRequest
Public class | HTTPWebRequest | A class that allows connection to and writing to and reading from an HTTP server
Public class | InitialisedEventArgs | Event argument class for OnInitialised event handler.
Public class | InitialisingEventArgs | Event argument class for OnInitialising event handler.
Public class | OnBufferFullEventArgs | Event arguments for the OnBufferFull and OnBufferFull event handlers
Public class | OnConnectionStatusChangedEventArgs | Event arguments for the OnConnectionStateChanged event handler
Public class | OnConnectionStatusChangedEventArgs2 | Event arguments for connection status changed event handler for OnConnectionStateChanged.
Public class | OnDebugEventArgs | OnDebug and OnDebug event handlers
Public class | OnErrorEventArgs | Event arguments for a server error
Public class | OnExceptionEventArgs | OnException and OnException event handlers
Public class | OnPersecondChangeEventArgs | Event argument type of the OnPersecondChange event handler.
Public class | OnReadTimeOutEventArgs | OnReadTimeOut and OnReadTimeOut event handlers
Public class | OnReceiveEventArgs | Event arguments class for Receive and Receive event handlers.
Public class | OnSendEventArgs | Event arguments class for Sent and Sent event handlers.
Public class | OnServerDispatchEventArgs | Event arguments to a server dispatch OnWrite
Public class | OnServerResponseEventArgs | Event arguments for a server response to a OnRead
Public class | OnTxRxDebugEventArgs | OnDebug and OnDebug event handlers
Public class | PingStringResult | A class encapsulating a ping result.
Public class | RegexStore | A static class that retrieves some popular regular expressions
Public class | ReplayEventArgs | Event argument class for Bncs.Comms.CCDLogServer.OnReplay event handler.
Public class | ResolvedUri | Class that contains a URI or a URI resolved from a host name or an error message
Public class | SystemSerialPorts | Static class for retrieving serial port lists
Public class | TCPClient | Class that wraps a TcpClient, has uniformed public methods to disconnect and write
Public class | TCPOnClientConnectingArgs | Event args class for Bncs.Comms.TCPServer.OnClientConnecting event.
Public class | TCPOnClientConnectRequestArgs | Event args class for OnClientConnectRequest event.
Public class | TCPOnClientDisconnectingArgs | Event args class for Bncs.Comms.TCPServer.OnClientDisconnecting event.
Public class | TCPOnConnectionStateChangeArgs | Event args class for Bncs.Comms.TCPServer.OnConnectionStateChanged event.
Public class | TCPOnExceptionEventArgs | Event args class for OnException event
Public class | TCPOnReceiveEventArgs | Event args class for Receive event
Public class | TCPOnStartListenerArgs | Not currently implemented.
Public class | TCPServer | Class encapsulating a TCP/IP server
Public class | TxRxCommsThroughput | Class for recording data throughput volumes.
Public class | UDPOnClientStatusChangedEventArgs | Event args class used by the OnClientStatusChanged event.
Public class | UDPOnConnectionStateChangeArgs | Event args class used by the OnConnectionStateChanged event.
Public class | UDPOnExceptionArgs | Event args class used by the OnException event.
Public class | UDPOnSendReceiveEventArgs | Event args class used by Receive and OnSend events.
Public class | UDPServer | Class encapsulating a UDP server.
Structures
 | Structure | Description
Public structure | TxRxDebugData | Structure for transmitting TxRx messages to a debug application via Windows messaging
Delegates
 | Delegate | Description
Public delegate | AsynchPingResultEventHandler | Delegate for asynchronous ping events.
Public delegate | HourlyUpdateEventHandler | Delegate for the OnHourlyUpdate event.
Public delegate | InitialisedEventHandler | Delegate for the OnInitialised event.
Public delegate | InitialisingEventHandler | Delegate for the OnInitialising event.
Public delegate | OnBufferFullEventHandler | Delegate for the OnBufferFull and OnBufferFull event handlers.
Public delegate | OnConnectionStatusChangedEventHandler | Delegate for the OnConnectionStateChanged event handler.
Public delegate | OnConnectionStatusChangedEventHandler2 | Delegate for OnConnectionStateChanged event handler.
Public delegate | OnDailyRolloverEventHandler | Event handler delegate for log roll over.
Public delegate | OnDebugEventHandler | Delegate for the OnDebug and OnDebug event handlers.
Public delegate | OnErrorEventHandler | Delegate for OnError event
Public delegate | OnExceptionEventHandler | Delegate for the OnException and OnException event handlers.
Public delegate | OnPersecondChangeEventHandler | Event delegate type of the OnPersecondChange event handler.
Public delegate | OnReadTimeOutEventHandler | Delegate for the OnReadTimeOut and OnReadTimeOut event handlers.
Public delegate | OnReceiveEventHandler | Delegate for the Receive and Receive event handlers.
Public delegate | OnSendEventHandler | Delegate for the Sent and Sent event handlers.
Public delegate | OnServerDispatchEventHandler | Delegate for OnWrite
Public delegate | OnServerResponseEventHandler | Delegate for OnRead event
Public delegate | OnTxRxDebugEventHandler | Delegate for the OnDebug and OnDebug event handlers.
Public delegate | ReplayEventHandler | Delegate for the OnReplay event.
Public delegate | TCPOnClientConnectingEvent | Event delegate for OnClientConnecting event.
Public delegate | TCPOnClientConnectRequestEvent | Event delegate for OnClientConnectRequest event.
Public delegate | TCPOnClientDisconnectingEvent | Event delegate for OnClientDisconnecting event.
Public delegate | TCPOnConnectionStateChangeEvent | Event delegate for OnConnectionStateChanged event.
Public delegate | TCPOnExceptionEventHandler | Event delegate for OnException event.
Public delegate | TCPOnReceiveEventHandler | Event delegate for Receive event.
Public delegate | TCPOnStartListenerEvent | Not currently implemented.
Public delegate | UDPOnClientStatusChangedEventHandler | Delegate used by the OnClientStatusChanged event.
Public delegate | UDPOnConnectionStateChangeEventHandler | Delegate used by the OnConnectionStateChanged event.
Public delegate | UDPOnExceptionEventHandler | Delegate used by the OnException event.
Public delegate | UDPOnReceiveEventHandler | Delegate used by Receive event.
Public delegate | UDPOnSendEventHandler | Delegate used by OnSend event.
Enumerations
 | Enumeration | Description
Public enumeration | ClientAction | Enumeration to express a UDP client action.
Public enumeration | CommsSettingsCompareCriteria | Enumeration that dictates whether the host name should be a part of the comparison criteria when comparing objects of type CommsSettings.
Public enumeration | ConnectChangeInstigator | Connection change instigator enumeration
Public enumeration | ConnectionState | Connection state enumeration
Public enumeration | ConnectionStatus | Connection status enumeration
Public enumeration | ConnectionStatus2 | Enumeration to indicate CommsClient2 connection state.
Public enumeration | ConnectionType | Connection type enumeration
Public enumeration | ContentDataType | Enumerator to dictate content data type
Public enumeration | ContentFormat | Enumerator to dictate content format.
Public enumeration | DataBit | Enumeration synonymous with data bit settings for serial communications.
Public enumeration | DebugContent | Enumerator to dictate debug content.
Public enumeration | ExceptionActivity | Enumeration denoting the type of activity that was happening when an exception occured.
Public enumeration | ExceptionCaller | Enumeration denoting the operation that raised an exception.
Public enumeration | ExceptionResponse | Exception response enumeration when handling exceptions via in OnException.
Public enumeration | HTTPRequestAuthenticationType | Enumerator that controls password authentication, either via credentials or writing directly to the header
Public enumeration | HTTPRequestMethodType | Enumerator containing the HTTP method type
Public enumeration | LogServerItemType | Enumeration representing log server item types Tx, Rx, Connected and Disconnected.
Public enumeration | Measurement | Enumeration denoting throughput measurment as being either by bits per second or data packets per second.
Public enumeration | ProcessRole | Enumeration representing process roles.
Public enumeration | ReplayResult | Enumeration representing log replay results.
Public enumeration | ReplayStatus | Enumeration representing log replay status.
Public enumeration | TCPExceptionResponse | Enumeration indicating an exception event response.
Public enumeration | TxRxResetType | Enumeration denoting whether to reset TX, RX or both counts.


AsynchPingResultEventArgs Class

AsynchPingResultEventArgs Class
EventArgs class for asynchronous ping event handler.
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.CommsAsynchPingResultEventArgs

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class AsynchPingResultEventArgs : EventArgs

The AsynchPingResultEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | AsynchPingResultEventArgs | Initializes a new instance of the AsynchPingResultEventArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | Cancelled | Gets or sets the cancellation status.
Public field | Error | Gets or sets the error message.
Public field | Reply | Gets or sets the ping reply.
Top
See Also

Reference

Bncs.Comms Namespace


AsynchPingResultEventArgs Constructor

AsynchPingResultEventArgs Constructor
Initializes a new instance of the AsynchPingResultEventArgs class

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public AsynchPingResultEventArgs()
See Also

Reference

AsynchPingResultEventArgs Class
Bncs.Comms Namespace


AsynchPingResultEventArgs Fields

AsynchPingResultEventArgs Fields

The AsynchPingResultEventArgs type exposes the following members.

Fields
 | Name | Description
Public field | Cancelled | Gets or sets the cancellation status.
Public field | Error | Gets or sets the error message.
Public field | Reply | Gets or sets the ping reply.
Top
See Also

Reference

AsynchPingResultEventArgs Class
Bncs.Comms Namespace


AsynchPingResultEventArgs.Cancelled Field

AsynchPingResultEventArgsCancelled Field
Gets or sets the cancellation status.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Cancelled

Field Value

Type: Boolean
See Also

Reference

AsynchPingResultEventArgs Class
Bncs.Comms Namespace


AsynchPingResultEventArgs.Error Field

AsynchPingResultEventArgsError Field
Gets or sets the error message.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Error

Field Value

Type: String
See Also

Reference

AsynchPingResultEventArgs Class
Bncs.Comms Namespace


AsynchPingResultEventArgs.Reply Field

AsynchPingResultEventArgsReply Field
Gets or sets the ping reply.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public PingReply Reply

Field Value

Type: PingReply
See Also

Reference

AsynchPingResultEventArgs Class
Bncs.Comms Namespace


AsynchPingResultEventArgs Methods

AsynchPingResultEventArgs Methods

The AsynchPingResultEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

AsynchPingResultEventArgs Class
Bncs.Comms Namespace


AsynchPingResultEventHandler Delegate

AsynchPingResultEventHandler Delegate
Delegate for asynchronous ping events.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void AsynchPingResultEventHandler(
    Object sender,
    AsynchPingResultEventArgs e
)

Parameters

sender
Type: SystemObject
Calling object.
e
Type: Bncs.CommsAsynchPingResultEventArgs
Parameters
See Also

Reference

Bncs.Comms Namespace


BncsPing Class

BncsPing Class
Class that executes a ping on an IP address.
Inheritance Hierarchy
SystemObject
Bncs.CommsBncsPing

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BncsPing

The BncsPing type exposes the following members.

Constructors
 | Name | Description
Public method | BncsPing | Default constructor initialised with the loopback address.
Public method | BncsPing(String) | Constructor that sets the IP address from the supplied arguement.
Top
Methods
 | Name | Description
Public method | AsynchPing | Executes an asynchronous ping on the pre-configured IP address.
Public method | AsynchPing(String) | Executes an asynchronous ping on the supplied IP address.
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Ping | Pings the pre-configured IP address.
Public method | Ping(String) | Pings the supplied IP address.
 | PingReplyToString | Converts a PingReply to a string.
Public method | PingToPingStringResult | Executes a ping to the pre-configured IP address.
Public method | PingToPingStringResult(String) | Executes a ping to the supplied IP address.
Public method | PingToString | Executes a ping to the pre-configured IP address.
Public method | PingToString(String) | Executes a ping to the supplied IP address.
 | QuickPing | Quickly pings the supplied IP address.
 | QuickPingToString | Quickly pings the supplied IP address.
 | QuickPingToStringResult | Quickly pings the supplied IP address.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | BytesOfData | Gets or sets the bytes of data count.
Public property | DontFragment | Gets or sets no fragmentation flag
Public property | IpAddress | Gets or sets the IP address.
Public property | TimeOut | Gets or sets the time out in milliseconds, the default value is 10 seconds.
Public property | TimeToLive | Gets or sets time to live value.
Top
Events
 | Name | Description
Public event | OnPing | Event handler for asynchronous ping requests.
Top
See Also

Reference

Bncs.Comms Namespace


BncsPing Constructor

BncsPing Constructor
Overload List
 | Name | Description
Public method | BncsPing | Default constructor initialised with the loopback address.
Public method | BncsPing(String) | Constructor that sets the IP address from the supplied arguement.
Top
See Also

Reference

BncsPing Class
Bncs.Comms Namespace


BncsPing Constructor

BncsPing Constructor
Default constructor initialised with the loopback address.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsPing()
See Also

Reference

BncsPing Class
BncsPing Overload
Bncs.Comms Namespace


BncsPing Constructor (String)

BncsPing Constructor (String)
Constructor that sets the IP address from the supplied arguement.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsPing(
    string ipAddress_
)

Parameters

ipAddress_
Type: SystemString
IP address to ping
See Also

Reference

BncsPing Class
BncsPing Overload
Bncs.Comms Namespace


BncsPing Methods

BncsPing Methods

The BncsPing type exposes the following members.

Methods
 | Name | Description
Public method | AsynchPing | Executes an asynchronous ping on the pre-configured IP address.
Public method | AsynchPing(String) | Executes an asynchronous ping on the supplied IP address.
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Ping | Pings the pre-configured IP address.
Public method | Ping(String) | Pings the supplied IP address.
 | PingReplyToString | Converts a PingReply to a string.
Public method | PingToPingStringResult | Executes a ping to the pre-configured IP address.
Public method | PingToPingStringResult(String) | Executes a ping to the supplied IP address.
Public method | PingToString | Executes a ping to the pre-configured IP address.
Public method | PingToString(String) | Executes a ping to the supplied IP address.
 | QuickPing | Quickly pings the supplied IP address.
 | QuickPingToString | Quickly pings the supplied IP address.
 | QuickPingToStringResult | Quickly pings the supplied IP address.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

BncsPing Class
Bncs.Comms Namespace


BncsPing.AsynchPing Method

BncsPingAsynchPing Method
Overload List
 | Name | Description
Public method | AsynchPing | Executes an asynchronous ping on the pre-configured IP address.
Public method | AsynchPing(String) | Executes an asynchronous ping on the supplied IP address.
Top
See Also

Reference

BncsPing Class
Bncs.Comms Namespace


BncsPing.AsynchPing Method

BncsPingAsynchPing Method
Executes an asynchronous ping on the pre-configured IP address.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool AsynchPing()

Return Value

Type: Boolean
True on success
See Also

Reference

BncsPing Class
AsynchPing Overload
Bncs.Comms Namespace


BncsPing.AsynchPing Method (String)

BncsPingAsynchPing Method (String)
Executes an asynchronous ping on the supplied IP address.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool AsynchPing(
    string ipAddress_
)

Parameters

ipAddress_
Type: SystemString
IP address to ping.

Return Value

Type: Boolean
True if the ping was dispatched successfully
See Also

Reference

BncsPing Class
AsynchPing Overload
Bncs.Comms Namespace


BncsPing.Ping Method

BncsPingPing Method
Overload List
 | Name | Description
Public method | Ping | Pings the pre-configured IP address.
Public method | Ping(String) | Pings the supplied IP address.
Top
See Also

Reference

BncsPing Class
Bncs.Comms Namespace


BncsPing.Ping Method

BncsPingPing Method
Pings the pre-configured IP address.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public PingReply Ping()

Return Value

Type: PingReply
A PingReply object containing the results of the ping.
See Also

Reference

BncsPing Class
Ping Overload
Bncs.Comms Namespace


BncsPing.Ping Method (String)

BncsPingPing Method (String)
Pings the supplied IP address.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public PingReply Ping(
    string ipAddress_
)

Parameters

ipAddress_
Type: SystemString
IP address to ping

Return Value

Type: PingReply
A PingReply object containing the results of the ping.
See Also

Reference

BncsPing Class
Ping Overload
Bncs.Comms Namespace


BncsPing.PingReplyToString Method

BncsPingPingReplyToString Method
Converts a PingReply to a string.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string PingReplyToString(
    PingReply reply_
)

Parameters

reply_
Type: System.Net.NetworkInformationPingReply
Ping reply to convert.

Return Value

Type: String
The ping reply as a string.
See Also

Reference

BncsPing Class
Bncs.Comms Namespace


BncsPing.PingToPingStringResult Method

BncsPingPingToPingStringResult Method
Overload List
 | Name | Description
Public method | PingToPingStringResult | Executes a ping to the pre-configured IP address.
Public method | PingToPingStringResult(String) | Executes a ping to the supplied IP address.
Top
See Also

Reference

BncsPing Class
Bncs.Comms Namespace


BncsPing.PingToPingStringResult Method

BncsPingPingToPingStringResult Method
Executes a ping to the pre-configured IP address.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public PingStringResult PingToPingStringResult()

Return Value

Type: PingStringResult
A Bncs.Comms.PingStringResult instance
See Also

Reference

BncsPing Class
PingToPingStringResult Overload
Bncs.Comms Namespace


BncsPing.PingToPingStringResult Method (String)

BncsPingPingToPingStringResult Method (String)
Executes a ping to the supplied IP address.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public PingStringResult PingToPingStringResult(
    string ipAddress_
)

Parameters

ipAddress_
Type: SystemString
IP address to ping.

Return Value

Type: PingStringResult
A Bncs.Comms.PingStringResult instance.
See Also

Reference

BncsPing Class
PingToPingStringResult Overload
Bncs.Comms Namespace


BncsPing.PingToString Method

BncsPingPingToString Method
Overload List
 | Name | Description
Public method | PingToString | Executes a ping to the pre-configured IP address.
Public method | PingToString(String) | Executes a ping to the supplied IP address.
Top
See Also

Reference

BncsPing Class
Bncs.Comms Namespace


BncsPing.PingToString Method

BncsPingPingToString Method
Executes a ping to the pre-configured IP address.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string PingToString()

Return Value

Type: String
Ping results in the form of a string.
See Also

Reference

BncsPing Class
PingToString Overload
Bncs.Comms Namespace


BncsPing.PingToString Method (String)

BncsPingPingToString Method (String)
Executes a ping to the supplied IP address.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string PingToString(
    string ipAddress_
)

Parameters

ipAddress_
Type: SystemString
IP address to ping.

Return Value

Type: String
Ping results in the form of a string.
See Also

Reference

BncsPing Class
PingToString Overload
Bncs.Comms Namespace


BncsPing.QuickPing Method

BncsPingQuickPing Method
Quickly pings the supplied IP address.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static PingReply QuickPing(
    string ipAddress_
)

Parameters

ipAddress_
Type: SystemString
IP address to ping.

Return Value

Type: PingReply
A ping reply.
See Also

Reference

BncsPing Class
Bncs.Comms Namespace


BncsPing.QuickPingToString Method

BncsPingQuickPingToString Method
Quickly pings the supplied IP address.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string QuickPingToString(
    string ipAddress_
)

Parameters

ipAddress_
Type: SystemString
IP address to ping.

Return Value

Type: String
The ping reply as a string.
See Also

Reference

BncsPing Class
Bncs.Comms Namespace


BncsPing.QuickPingToStringResult Method

BncsPingQuickPingToStringResult Method
Quickly pings the supplied IP address.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static PingStringResult QuickPingToStringResult(
    string ipAddress_
)

Parameters

ipAddress_
Type: SystemString
IP address to ping.

Return Value

Type: PingStringResult
The ping reply as a Bncs.PingStringResult
See Also

Reference

BncsPing Class
Bncs.Comms Namespace


BncsPing Properties

BncsPing Properties

The BncsPing type exposes the following members.

Properties
 | Name | Description
Public property | BytesOfData | Gets or sets the bytes of data count.
Public property | DontFragment | Gets or sets no fragmentation flag
Public property | IpAddress | Gets or sets the IP address.
Public property | TimeOut | Gets or sets the time out in milliseconds, the default value is 10 seconds.
Public property | TimeToLive | Gets or sets time to live value.
Top
See Also

Reference

BncsPing Class
Bncs.Comms Namespace


BncsPing.BytesOfData Property

BncsPingBytesOfData Property
Gets or sets the bytes of data count.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint BytesOfData { get; set; }

Property Value

Type: UInt32
See Also

Reference

BncsPing Class
Bncs.Comms Namespace


BncsPing.DontFragment Property

BncsPingDontFragment Property
Gets or sets no fragmentation flag

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool DontFragment { get; set; }

Property Value

Type: Boolean
See Also

Reference

BncsPing Class
Bncs.Comms Namespace


BncsPing.IpAddress Property

BncsPingIpAddress Property
Gets or sets the IP address.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string IpAddress { get; set; }

Property Value

Type: String
See Also

Reference

BncsPing Class
Bncs.Comms Namespace


BncsPing.TimeOut Property

BncsPingTimeOut Property
Gets or sets the time out in milliseconds, the default value is 10 seconds.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int TimeOut { get; set; }

Property Value

Type: Int32
See Also

Reference

BncsPing Class
Bncs.Comms Namespace


BncsPing.TimeToLive Property

BncsPingTimeToLive Property
Gets or sets time to live value.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int TimeToLive { get; set; }

Property Value

Type: Int32
See Also

Reference

BncsPing Class
Bncs.Comms Namespace


BncsPing Events

BncsPing Events

The BncsPing type exposes the following members.

Events
 | Name | Description
Public event | OnPing | Event handler for asynchronous ping requests.
Top
See Also

Reference

BncsPing Class
Bncs.Comms Namespace


BncsPing.OnPing Event

BncsPingOnPing Event
Event handler for asynchronous ping requests.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event AsynchPingResultEventHandler OnPing

Value

Type: Bncs.CommsAsynchPingResultEventHandler
See Also

Reference

BncsPing Class
Bncs.Comms Namespace


ClientAction Enumeration

ClientAction Enumeration
Enumeration to express a UDP client action.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum ClientAction
Members
Member name | Value | Description
Joining | 0 | The client has connected.
Leaving | 1 | The client has disconnected.
Replacing | 2 | The client has disconnected and another has connected in it's place.
See Also

Reference

Bncs.Comms Namespace


CommsClient Class

CommsClient Class
A communications class for sending and receiving data over Serial, UDP or TCP/IP according to the provided settings type assigned. The method used for data exchange is polling within a thread.
Inheritance Hierarchy
SystemObject
Bncs.CommsCommsClient

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class CommsClient

The CommsClient type exposes the following members.

Constructors
Name Description
Public method CommsClient
Default constructor
Public method CommsClient(CommsSettings)
Constructor accepting an object of base typ CommsSettings, the type of this object dictates the communications method. This constructor may be used without concern for the communications method.
CommsClient(String, Int32)
Constructor accepting a TCP server address and port. Only use this constructor for TCP communications only.
Examples
This sample shows how to create an object of type CommsClient and connect to a TCP server.
Copy
class Program
{
    static void Main()
    {
        // Create a client specifying address and port
        CommsClient client = new CommsClient("192.168.1.1", 8090);
        // Attempt connection to server
        if (true == client.Connect())
            Console.WriteLine("Connected to the server at " + client.Settings.ToString());
        else
            Console.WriteLine("Failed to connect to the server at " + client.Settings.ToString());

        // Wait for user input
        Console.ReadKey();

        // Disconnect from server
        if (client.IsConnected)
            client.Disconnect();
    }
}
Public method CommsClient(String, Int32, Int32)
Constructor accepting a TCP server address, port and read buffer size. Only use this constructor for TCP communications only.
Public method CommsClient(String, Int32, UInt32)
Constructor accepting a TCP server address, port and auto reconnect settings. Only use this constructor for TCP communications only.
Public method CommsClient(String, Int32, UInt32, Int32)
Constructor accepting a TCP server address, port, auto reconnect settings and read buffer size. Only use this constructor for TCP communications only.
Top
Methods
 | Name | Description
Public method | AssumeServerDisconnect | Disconnects from the TCP, UDP server or serial device (as applicable). Unlike Disconnect this method forces the OnConnectionStateChanged event handler to report the instigator of the disconnection to be the server.
Public method | Connect | Connects to a TCP, UDP server or a serial port depending on the type of configuration settings applied to the Settings property. This is a blocking call so on failure to connect it will only return after a time out period.
Public method | Connect(Boolean) | Connects to a TCP, UDP server or a serial port depending on the type of configuration settings applied to the Settings property. Waits or fires and forgets according to the wait_ argument.
Public method | Disconnect | Disconnects from the TCP, UDP server or serial device (as applicable).
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | Flush | Flushes the stream.
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Read |
Public method | Send(Byte) | Writes a single byte to the conbnection
Public method | Send(Byte) | Writes an array of bytes to the connection
Public method | Send(String) | Writes a string to the connection
Public method | SetDeveloperDebugReceiveMessage(Byte) | THIS METHOD SHOULD ONLY BE USED TO SIMULATE A MESSAGE IN FROM THE SERVER FOR DEBUG PURPOSES The message_ argument is assigned to a private variable that is otherwise null. When not null on the next read pass this message is returned before the next read. The underlying variable is then nulled after transmission.
Public method | SetDeveloperDebugReceiveMessage(String) | THIS METHOD SHOULD ONLY BE USED TO SIMULATE A MESSAGE IN FROM THE SERVER FOR DEBUG PURPOSES The message_ argument is assigned to a private variable that is otherwise null. When not null on the next read pass this message is returned before the next read. The underlying variable is then nulled after transmission.
Public method | ToString | Returns a string representation of the instance, this being the string representation of the settings assigned. (Overrides ObjectToString.)
Top
Properties
 | Name | Description
Public property | ConnectionType | Gets a value betraying the connection type, ie TCP, UDP or Serial.
Public property | Debugger | Gets or sets a debugger, see the CommsClientDebugger class for more information.
Public property | IsConnected | Gets a value betratying the connection status
 | Localhost | Gets the value of "localhost", the loopback address.
Public property | Settings | Gets or sets the settings
Public property | SettingsChanged | Gets a value betraying the whether the settings have been changed
Public property | Status | Gets a value betraying the connection status
Public property | Tag | Gets or sets the Tag property, use this to associate an object with the session.
 | Version | Gets the CommsClient edition, this will always be v1 for this class.
Public property | WriteOnly | Gets or sets a value betraying whether the client is w/o or not. The default is false, this value should be set to true when using a one way write only protocol so as to save the resource of the read thread from running.
Top
Events
 | Name | Description
Public event | OnBufferFull | Buffer full event handler, fires when a read filled the entire buffer.
Public event | OnConnectionStateChanged | Connection state changed event handler, fires each time the connection state changes
Public event | OnDebug | If assigned fires when pertanent extra debug information is available.
Public event | OnException | OnException event, fires whenever an exception is raised
Public event | OnReadTimeOut | OnReadTimeOut event handler
Public event | Receive | Receive event, fires whenever a message has been read from the connection
Public event | Sent | Sent event, fires whenever a message has been written to the connection
Top
See Also

Reference

Bncs.Comms Namespace


CommsClient Constructor

CommsClient Constructor
Overload List
Name Description
Public method CommsClient
Default constructor
Public method CommsClient(CommsSettings)
Constructor accepting an object of base typ CommsSettings, the type of this object dictates the communications method. This constructor may be used without concern for the communications method.
CommsClient(String, Int32)
Constructor accepting a TCP server address and port. Only use this constructor for TCP communications only.
Examples
This sample shows how to create an object of type CommsClient and connect to a TCP server.
Copy
class Program
{
    static void Main()
    {
        // Create a client specifying address and port
        CommsClient client = new CommsClient("192.168.1.1", 8090);
        // Attempt connection to server
        if (true == client.Connect())
            Console.WriteLine("Connected to the server at " + client.Settings.ToString());
        else
            Console.WriteLine("Failed to connect to the server at " + client.Settings.ToString());

        // Wait for user input
        Console.ReadKey();

        // Disconnect from server
        if (client.IsConnected)
            client.Disconnect();
    }
}
Public method CommsClient(String, Int32, Int32)
Constructor accepting a TCP server address, port and read buffer size. Only use this constructor for TCP communications only.
Public method CommsClient(String, Int32, UInt32)
Constructor accepting a TCP server address, port and auto reconnect settings. Only use this constructor for TCP communications only.
Public method CommsClient(String, Int32, UInt32, Int32)
Constructor accepting a TCP server address, port, auto reconnect settings and read buffer size. Only use this constructor for TCP communications only.
Top
See Also

Reference

CommsClient Class
Bncs.Comms Namespace


CommsClient Constructor

CommsClient Constructor
Default constructor

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsClient()
See Also

Reference

CommsClient Class
CommsClient Overload
Bncs.Comms Namespace


CommsClient Constructor (CommsSettings)

CommsClient Constructor (CommsSettings)
Constructor accepting an object of base typ CommsSettings, the type of this object dictates the communications method. This constructor may be used without concern for the communications method.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsClient(
    CommsSettings settings_
)

Parameters

settings_
Type: Bncs.CommsCommsSettings
See Also

Reference

CommsClient Class
CommsClient Overload
Bncs.Comms Namespace


CommsClient Constructor (String, Int32)

CommsClient Constructor (String, Int32)
Constructor accepting a TCP server address and port. Only use this constructor for TCP communications only.
Examples
This sample shows how to create an object of type CommsClient and connect to a TCP server.
Copy
class Program
{
    static void Main()
    {
        // Create a client specifying address and port
        CommsClient client = new CommsClient("192.168.1.1", 8090);
        // Attempt connection to server
        if (true == client.Connect())
            Console.WriteLine("Connected to the server at " + client.Settings.ToString());
        else
            Console.WriteLine("Failed to connect to the server at " + client.Settings.ToString());

        // Wait for user input
        Console.ReadKey();

        // Disconnect from server
        if (client.IsConnected)
            client.Disconnect();
    }
}

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsClient(
    string ipAddress_,
    int ipPort_
)

Parameters

ipAddress_
Type: SystemString
Address of TCP server.
ipPort_
Type: SystemInt32
TCP port number.
See Also

Reference

CommsClient Class
CommsClient Overload
Bncs.Comms Namespace


CommsClient Constructor (String, Int32, Int32)

CommsClient Constructor (String, Int32, Int32)
Constructor accepting a TCP server address, port and read buffer size. Only use this constructor for TCP communications only.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsClient(
    string ipAddress_,
    int ipPort_,
    int bufferSizeBytes_
)

Parameters

ipAddress_
Type: SystemString
Address of TCP server.
ipPort_
Type: SystemInt32
TCP port number.
bufferSizeBytes_
Type: SystemInt32
Read buffer size, determines the amount of data that may be read in a single read operation.
See Also

Reference

CommsClient Class
CommsClient Overload
Bncs.Comms Namespace


CommsClient Constructor (String, Int32, UInt32)

CommsClient Constructor (String, Int32, UInt32)
Constructor accepting a TCP server address, port and auto reconnect settings. Only use this constructor for TCP communications only.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsClient(
    string ipAddress_,
    int ipPort_,
    uint autoReconnectSeconds_
)

Parameters

ipAddress_
Type: SystemString
Address of TCP server.
ipPort_
Type: SystemInt32
TCP port number.
autoReconnectSeconds_
Type: SystemUInt32
Number of seconds to elapse before re-attempting auto connect after a server instigated disconnection.
See Also

Reference

CommsClient Class
CommsClient Overload
Bncs.Comms Namespace


CommsClient Constructor (String, Int32, UInt32, Int32)

CommsClient Constructor (String, Int32, UInt32, Int32)
Constructor accepting a TCP server address, port, auto reconnect settings and read buffer size. Only use this constructor for TCP communications only.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsClient(
    string ipAddress_,
    int ipPort_,
    uint autoReconnectSeconds_,
    int bufferSizeBytes_
)

Parameters

ipAddress_
Type: SystemString
Address of TCP server.
ipPort_
Type: SystemInt32
TCP port number.
autoReconnectSeconds_
Type: SystemUInt32
Number of seconds to elapse before re-attempting auto connect after a server instigated disconnection.
bufferSizeBytes_
Type: SystemInt32
Read buffer size, determines the amount of data that may be read in a single read operation.
See Also

Reference

CommsClient Class
CommsClient Overload
Bncs.Comms Namespace


CommsClient Methods

CommsClient Methods

The CommsClient type exposes the following members.

Methods
 | Name | Description
Public method | AssumeServerDisconnect | Disconnects from the TCP, UDP server or serial device (as applicable). Unlike Disconnect this method forces the OnConnectionStateChanged event handler to report the instigator of the disconnection to be the server.
Public method | Connect | Connects to a TCP, UDP server or a serial port depending on the type of configuration settings applied to the Settings property. This is a blocking call so on failure to connect it will only return after a time out period.
Public method | Connect(Boolean) | Connects to a TCP, UDP server or a serial port depending on the type of configuration settings applied to the Settings property. Waits or fires and forgets according to the wait_ argument.
Public method | Disconnect | Disconnects from the TCP, UDP server or serial device (as applicable).
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | Flush | Flushes the stream.
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Read |
Public method | Send(Byte) | Writes a single byte to the conbnection
Public method | Send(Byte) | Writes an array of bytes to the connection
Public method | Send(String) | Writes a string to the connection
Public method | SetDeveloperDebugReceiveMessage(Byte) | THIS METHOD SHOULD ONLY BE USED TO SIMULATE A MESSAGE IN FROM THE SERVER FOR DEBUG PURPOSES The message_ argument is assigned to a private variable that is otherwise null. When not null on the next read pass this message is returned before the next read. The underlying variable is then nulled after transmission.
Public method | SetDeveloperDebugReceiveMessage(String) | THIS METHOD SHOULD ONLY BE USED TO SIMULATE A MESSAGE IN FROM THE SERVER FOR DEBUG PURPOSES The message_ argument is assigned to a private variable that is otherwise null. When not null on the next read pass this message is returned before the next read. The underlying variable is then nulled after transmission.
Public method | ToString | Returns a string representation of the instance, this being the string representation of the settings assigned. (Overrides ObjectToString.)
Top
See Also

Reference

CommsClient Class
Bncs.Comms Namespace


CommsClient.AssumeServerDisconnect Method

CommsClientAssumeServerDisconnect Method
Disconnects from the TCP, UDP server or serial device (as applicable). Unlike Disconnect this method forces the OnConnectionStateChanged event handler to report the instigator of the disconnection to be the server.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void AssumeServerDisconnect()
See Also

Reference

CommsClient Class
Bncs.Comms Namespace


CommsClient.Connect Method

CommsClientConnect Method
Overload List
 | Name | Description
Public method | Connect | Connects to a TCP, UDP server or a serial port depending on the type of configuration settings applied to the Settings property. This is a blocking call so on failure to connect it will only return after a time out period.
Public method | Connect(Boolean) | Connects to a TCP, UDP server or a serial port depending on the type of configuration settings applied to the Settings property. Waits or fires and forgets according to the wait_ argument.
Top
See Also

Reference

CommsClient Class
Bncs.Comms Namespace


CommsClient.Connect Method

CommsClientConnect Method
Connects to a TCP, UDP server or a serial port depending on the type of configuration settings applied to the Settings property. This is a blocking call so on failure to connect it will only return after a time out period.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Connect()

Return Value

Type: Boolean
True on success
See Also

Reference

CommsClient Class
Connect Overload
Bncs.Comms Namespace


CommsClient.Connect Method (Boolean)

CommsClientConnect Method (Boolean)
Connects to a TCP, UDP server or a serial port depending on the type of configuration settings applied to the Settings property. Waits or fires and forgets according to the wait_ argument.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Nullable<bool> Connect(
    bool wait_
)

Parameters

wait_
Type: SystemBoolean
Blocking flag, if true then this becomes a blocking call else the connect is threaded and this method will always return immediatley.

Return Value

Type: Nullable Boolean
When wait_ is true: this method will return True on success of False on failure When wait_ is false: returns null providing we are disconnected and have valid settings returns false if we are either already connected or our settings are invalid
See Also

Reference

CommsClient Class
Connect Overload
Bncs.Comms Namespace


CommsClient.Disconnect Method

CommsClientDisconnect Method
Disconnects from the TCP, UDP server or serial device (as applicable).

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Disconnect()
See Also

Reference

CommsClient Class
Bncs.Comms Namespace


CommsClient.Flush Method

CommsClientFlush Method
Flushes the stream.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Flush()

Return Value

Type: Boolean
Returns true on success.
See Also

Reference

CommsClient Class
Bncs.Comms Namespace


CommsClient.Read Method

CommsClientRead Method

[Missing <summary> documentation for "M:Bncs.Comms.CommsClient.Read(System.Int32)"]

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[] Read(
    int numberOfBytes_
)

Parameters

numberOfBytes_
Type: SystemInt32

[Missing <param name="numberOfBytes_"/> documentation for "M:Bncs.Comms.CommsClient.Read(System.Int32)"]

Return Value

Type: Byte

[Missing <returns> documentation for "M:Bncs.Comms.CommsClient.Read(System.Int32)"]

See Also

Reference

CommsClient Class
Bncs.Comms Namespace


CommsClient.Send Method

CommsClientSend Method
Overload List
 | Name | Description
Public method | Send(Byte) | Writes a single byte to the conbnection
Public method | Send(Byte) | Writes an array of bytes to the connection
Public method | Send(String) | Writes a string to the connection
Top
See Also

Reference

CommsClient Class
Bncs.Comms Namespace


CommsClient.Send Method (Byte)

CommsClientSend Method (Byte)
Writes a single byte to the conbnection

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Send(
    byte dataByte_
)

Parameters

dataByte_
Type: SystemByte
Byte to write

Return Value

Type: Boolean
True on success
See Also

Reference

CommsClient Class
Send Overload
Bncs.Comms Namespace


CommsClient.Send Method (Byte[])

CommsClientSend Method (Byte)
Writes an array of bytes to the connection

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Send(
    byte[] buffer_
)

Parameters

buffer_
Type: SystemByte
Array of bytes

Return Value

Type: Boolean
True on success
See Also

Reference

CommsClient Class
Send Overload
Bncs.Comms Namespace


CommsClient.Send Method (String)

CommsClientSend Method (String)
Writes a string to the connection

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Send(
    string data_
)

Parameters

data_
Type: SystemString
String data to write

Return Value

Type: Boolean
True on success
See Also

Reference

CommsClient Class
Send Overload
Bncs.Comms Namespace


CommsClient.SetDeveloperDebugReceiveMessage Method

CommsClientSetDeveloperDebugReceiveMessage Method
Overload List
 | Name | Description
Public method | SetDeveloperDebugReceiveMessage(Byte) | THIS METHOD SHOULD ONLY BE USED TO SIMULATE A MESSAGE IN FROM THE SERVER FOR DEBUG PURPOSES The message_ argument is assigned to a private variable that is otherwise null. When not null on the next read pass this message is returned before the next read. The underlying variable is then nulled after transmission.
Public method | SetDeveloperDebugReceiveMessage(String) | THIS METHOD SHOULD ONLY BE USED TO SIMULATE A MESSAGE IN FROM THE SERVER FOR DEBUG PURPOSES The message_ argument is assigned to a private variable that is otherwise null. When not null on the next read pass this message is returned before the next read. The underlying variable is then nulled after transmission.
Top
See Also

Reference

CommsClient Class
Bncs.Comms Namespace


CommsClient.SetDeveloperDebugReceiveMessage Method (Byte[])

CommsClientSetDeveloperDebugReceiveMessage Method (Byte)
THIS METHOD SHOULD ONLY BE USED TO SIMULATE A MESSAGE IN FROM THE SERVER FOR DEBUG PURPOSES The message_ argument is assigned to a private variable that is otherwise null. When not null on the next read pass this message is returned before the next read. The underlying variable is then nulled after transmission.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void SetDeveloperDebugReceiveMessage(
    byte[] message_
)

Parameters

message_
Type: SystemByte
Debug message to simulate receipt of
See Also

Reference

CommsClient Class
SetDeveloperDebugReceiveMessage Overload
Bncs.Comms Namespace


CommsClient.SetDeveloperDebugReceiveMessage Method (String)

CommsClientSetDeveloperDebugReceiveMessage Method (String)
THIS METHOD SHOULD ONLY BE USED TO SIMULATE A MESSAGE IN FROM THE SERVER FOR DEBUG PURPOSES The message_ argument is assigned to a private variable that is otherwise null. When not null on the next read pass this message is returned before the next read. The underlying variable is then nulled after transmission.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void SetDeveloperDebugReceiveMessage(
    string message_
)

Parameters

message_
Type: SystemString
Debug message to simulate receipt of
See Also

Reference

CommsClient Class
SetDeveloperDebugReceiveMessage Overload
Bncs.Comms Namespace


CommsClient.ToString Method

CommsClientToString Method
Returns a string representation of the instance, this being the string representation of the settings assigned.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
The settings as a string else the class name.
See Also

Reference

CommsClient Class
Bncs.Comms Namespace


CommsClient Properties

CommsClient Properties

The CommsClient type exposes the following members.

Properties
 | Name | Description
Public property | ConnectionType | Gets a value betraying the connection type, ie TCP, UDP or Serial.
Public property | Debugger | Gets or sets a debugger, see the CommsClientDebugger class for more information.
Public property | IsConnected | Gets a value betratying the connection status
 | Localhost | Gets the value of "localhost", the loopback address.
Public property | Settings | Gets or sets the settings
Public property | SettingsChanged | Gets a value betraying the whether the settings have been changed
Public property | Status | Gets a value betraying the connection status
Public property | Tag | Gets or sets the Tag property, use this to associate an object with the session.
 | Version | Gets the CommsClient edition, this will always be v1 for this class.
Public property | WriteOnly | Gets or sets a value betraying whether the client is w/o or not. The default is false, this value should be set to true when using a one way write only protocol so as to save the resource of the read thread from running.
Top
See Also

Reference

CommsClient Class
Bncs.Comms Namespace


CommsClient.ConnectionType Property

CommsClientConnectionType Property
Gets a value betraying the connection type, ie TCP, UDP or Serial.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ConnectionType ConnectionType { get; }

Property Value

Type: ConnectionType
See Also

Reference

CommsClient Class
Bncs.Comms Namespace


CommsClient.Debugger Property

CommsClientDebugger Property
Gets or sets a debugger, see the CommsClientDebugger class for more information.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsClientDebugger Debugger { get; set; }

Property Value

Type: CommsClientDebugger
See Also

Reference

CommsClient Class
Bncs.Comms Namespace


CommsClient.IsConnected Property

CommsClientIsConnected Property
Gets a value betratying the connection status

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool IsConnected { get; }

Property Value

Type: Boolean
See Also

Reference

CommsClient Class
Bncs.Comms Namespace


CommsClient.Localhost Property

CommsClientLocalhost Property
Gets the value of "localhost", the loopback address.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string Localhost { get; }

Property Value

Type: String
See Also

Reference

CommsClient Class
Bncs.Comms Namespace


CommsClient.Settings Property

CommsClientSettings Property
Gets or sets the settings

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsSettings Settings { get; set; }

Property Value

Type: CommsSettings
See Also

Reference

CommsClient Class
Bncs.Comms Namespace


CommsClient.SettingsChanged Property

CommsClientSettingsChanged Property
Gets a value betraying the whether the settings have been changed

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool SettingsChanged { get; }

Property Value

Type: Boolean
See Also

Reference

CommsClient Class
Bncs.Comms Namespace


CommsClient.Status Property

CommsClientStatus Property
Gets a value betraying the connection status

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ConnectionStatus Status { get; }

Property Value

Type: ConnectionStatus
See Also

Reference

CommsClient Class
Bncs.Comms Namespace


CommsClient.Tag Property

CommsClientTag Property
Gets or sets the Tag property, use this to associate an object with the session.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Object Tag { get; set; }

Property Value

Type: Object
See Also

Reference

CommsClient Class
Bncs.Comms Namespace


CommsClient.Version Property

CommsClientVersion Property
Gets the CommsClient edition, this will always be v1 for this class.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string Version { get; }

Property Value

Type: String
See Also

Reference

CommsClient Class
Bncs.Comms Namespace


CommsClient.WriteOnly Property

CommsClientWriteOnly Property
Gets or sets a value betraying whether the client is w/o or not. The default is false, this value should be set to true when using a one way write only protocol so as to save the resource of the read thread from running.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool WriteOnly { get; set; }

Property Value

Type: Boolean
See Also

Reference

CommsClient Class
Bncs.Comms Namespace


CommsClient Events

CommsClient Events

The CommsClient type exposes the following members.

Events
 | Name | Description
Public event | OnBufferFull | Buffer full event handler, fires when a read filled the entire buffer.
Public event | OnConnectionStateChanged | Connection state changed event handler, fires each time the connection state changes
Public event | OnDebug | If assigned fires when pertanent extra debug information is available.
Public event | OnException | OnException event, fires whenever an exception is raised
Public event | OnReadTimeOut | OnReadTimeOut event handler
Public event | Receive | Receive event, fires whenever a message has been read from the connection
Public event | Sent | Sent event, fires whenever a message has been written to the connection
Top
See Also

Reference

CommsClient Class
Bncs.Comms Namespace


CommsClient.OnBufferFull Event

CommsClientOnBufferFull Event
Buffer full event handler, fires when a read filled the entire buffer.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnBufferFullEventHandler OnBufferFull

Value

Type: Bncs.CommsOnBufferFullEventHandler
See Also

Reference

CommsClient Class
Bncs.Comms Namespace


CommsClient.OnConnectionStateChanged Event

CommsClientOnConnectionStateChanged Event
Connection state changed event handler, fires each time the connection state changes

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnConnectionStatusChangedEventHandler OnConnectionStateChanged

Value

Type: Bncs.CommsOnConnectionStatusChangedEventHandler
See Also

Reference

CommsClient Class
Bncs.Comms Namespace


CommsClient.OnDebug Event

CommsClientOnDebug Event
If assigned fires when pertanent extra debug information is available.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnDebugEventHandler OnDebug

Value

Type: Bncs.CommsOnDebugEventHandler
See Also

Reference

CommsClient Class
Bncs.Comms Namespace


CommsClient.OnException Event

CommsClientOnException Event
OnException event, fires whenever an exception is raised

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnExceptionEventHandler OnException

Value

Type: Bncs.CommsOnExceptionEventHandler
See Also

Reference

CommsClient Class
Bncs.Comms Namespace


CommsClient.OnReadTimeOut Event

CommsClientOnReadTimeOut Event
OnReadTimeOut event handler

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnReadTimeOutEventHandler OnReadTimeOut

Value

Type: Bncs.CommsOnReadTimeOutEventHandler
See Also

Reference

CommsClient Class
Bncs.Comms Namespace


CommsClient.Receive Event

CommsClientReceive Event
Receive event, fires whenever a message has been read from the connection

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnReceiveEventHandler Receive

Value

Type: Bncs.CommsOnReceiveEventHandler
See Also

Reference

CommsClient Class
Bncs.Comms Namespace


CommsClient.Sent Event

CommsClientSent Event
Sent event, fires whenever a message has been written to the connection

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnSendEventHandler Sent

Value

Type: Bncs.CommsOnSendEventHandler
See Also

Reference

CommsClient Class
Bncs.Comms Namespace


CommsClient2 Class

CommsClient2 Class
A communications class for sending and receiving data over Serial, UDP or TCP/IP according to the provided settings type assigned. The method used for data exchange is event driven.
Inheritance Hierarchy
SystemObject
Bncs.CommsCommsClient2

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class CommsClient2

The CommsClient2 type exposes the following members.

Constructors
Name Description
CommsClient2
Default constructor
Examples
This sample shows how to create an object of type CommsClient2 and connect to a TCP server.
Copy
class Program
{
    static void Main()
    {
        // Create a client
        CommsClient2 client = new CommsClient2();
        // Set the TCP host and port
        client.Settings.Host = "192.168.1.13";
        ((CommsTCPSettings)client.Settings).Port = 8090;
    }
}
Public method CommsClient2(CommsSettings)
Constructor accepting an object of base typ CommsSettings, the type of this object dictates the communications method. This constructor may be used without concern for the communications method.
Public method CommsClient2(String, Int32)
Constructor accepting a TCP server address and port. Only use this constructor for TCP communications only.
Public method CommsClient2(String, Int32, Int32)
Constructor accepting a TCP server address, port and read buffer size. Only use this constructor for TCP communications only.
Public method CommsClient2(String, Int32, UInt32)
Constructor accepting a TCP server address, port and auto reconnect settings. Only use this constructor for TCP communications only.
Public method CommsClient2(String, Int32, UInt32, Int32)
Constructor accepting a TCP server address, port, auto reconnect settings and read buffer size. Only use this constructor for TCP communications only.
Top
Methods
 | Name | Description
Public method | AssumeServerDisconnect | Disconnects from the TCP, UDP server or serial device (as applicable). Unlike Disconnect() this method forces the [!:Bncs.Comms.CommsClient.OnConnectionStatusChangedEventHandler] event handler to report the instigator of the disconnection to be the server.
Public method | Connect | Connects to the TCP/IP server and blocks until connection success/failure is established
Public method | Connect(Boolean) | Connects to a TCP server. Waits or fires and forgets according to the wait_ argument.
Public method | Disconnect | Disconnects from the TCP/IP server
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Send(Byte) | Writes the supplied byte to the server
Public method | Send(Byte) | Writes the supplied buffer to the server
Public method | Send(String) | Writes the supplied string to the server
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | ConnectionType | Gets the connection type.
Public property | Debugger | Gets or sets a debugger, see the CommsClientDebugger class for more information.
Public property | IsConnected | Returns true if connection is established.
Public property | Settings | Gets or sets the settings
Public property | Status | Gets the current connection status.
Public property | Tag | Gets or sets the Tag property, use this to associate an object with the session.
 | Version | Gets the CommsClient2 edition, this will always be v2 for this class.
Top
Events
 | Name | Description
Public event | OnBufferFull | Buffer full event handler, fires when a read filled the entire buffer.
Public event | OnConnectionStateChanged | Fires when the connection state changes.
Public event | OnDebug | If assigned fires when pertanent extra debug information is available.
Public event | OnException | Fires when an exception has been caught.
Public event | OnReadTimeOut | Fires when a read time out occurs.
Public event | Receive | Fires when bytes have been read into the input buffer from the server.
Public event | Sent | Fires when bytes have been written to the server.
Top
See Also

Reference

Bncs.Comms Namespace


CommsClient2 Constructor

CommsClient2 Constructor
Overload List
Name Description
CommsClient2
Default constructor
Examples
This sample shows how to create an object of type CommsClient2 and connect to a TCP server.
Copy
class Program
{
    static void Main()
    {
        // Create a client
        CommsClient2 client = new CommsClient2();
        // Set the TCP host and port
        client.Settings.Host = "192.168.1.13";
        ((CommsTCPSettings)client.Settings).Port = 8090;
    }
}
Public method CommsClient2(CommsSettings)
Constructor accepting an object of base typ CommsSettings, the type of this object dictates the communications method. This constructor may be used without concern for the communications method.
Public method CommsClient2(String, Int32)
Constructor accepting a TCP server address and port. Only use this constructor for TCP communications only.
Public method CommsClient2(String, Int32, Int32)
Constructor accepting a TCP server address, port and read buffer size. Only use this constructor for TCP communications only.
Public method CommsClient2(String, Int32, UInt32)
Constructor accepting a TCP server address, port and auto reconnect settings. Only use this constructor for TCP communications only.
Public method CommsClient2(String, Int32, UInt32, Int32)
Constructor accepting a TCP server address, port, auto reconnect settings and read buffer size. Only use this constructor for TCP communications only.
Top
See Also

Reference

CommsClient2 Class
Bncs.Comms Namespace


CommsClient2 Constructor

CommsClient2 Constructor
Default constructor
Examples
This sample shows how to create an object of type CommsClient2 and connect to a TCP server.
Copy
class Program
{
    static void Main()
    {
        // Create a client
        CommsClient2 client = new CommsClient2();
        // Set the TCP host and port
        client.Settings.Host = "192.168.1.13";
        ((CommsTCPSettings)client.Settings).Port = 8090;
    }
}

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsClient2()
See Also

Reference

CommsClient2 Class
CommsClient2 Overload
Bncs.Comms Namespace


CommsClient2 Constructor (CommsSettings)

CommsClient2 Constructor (CommsSettings)
Constructor accepting an object of base typ CommsSettings, the type of this object dictates the communications method. This constructor may be used without concern for the communications method.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsClient2(
    CommsSettings settings_
)

Parameters

settings_
Type: Bncs.CommsCommsSettings
See Also

Reference

CommsClient2 Class
CommsClient2 Overload
Bncs.Comms Namespace


CommsClient2 Constructor (String, Int32)

CommsClient2 Constructor (String, Int32)
Constructor accepting a TCP server address and port. Only use this constructor for TCP communications only.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsClient2(
    string ipAddress_,
    int ipPort_
)

Parameters

ipAddress_
Type: SystemString
Address of TCP server.
ipPort_
Type: SystemInt32
TCP port number.
See Also

Reference

CommsClient2 Class
CommsClient2 Overload
Bncs.Comms Namespace


CommsClient2 Constructor (String, Int32, Int32)

CommsClient2 Constructor (String, Int32, Int32)
Constructor accepting a TCP server address, port and read buffer size. Only use this constructor for TCP communications only.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsClient2(
    string ipAddress_,
    int ipPort_,
    int bufferSizeBytes_
)

Parameters

ipAddress_
Type: SystemString
Address of TCP server.
ipPort_
Type: SystemInt32
TCP port number.
bufferSizeBytes_
Type: SystemInt32
Read buffer size, determines the amount of data that may be read in a single read operation.
See Also

Reference

CommsClient2 Class
CommsClient2 Overload
Bncs.Comms Namespace


CommsClient2 Constructor (String, Int32, UInt32)

CommsClient2 Constructor (String, Int32, UInt32)
Constructor accepting a TCP server address, port and auto reconnect settings. Only use this constructor for TCP communications only.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsClient2(
    string ipAddress_,
    int ipPort_,
    uint autoReconnectSeconds_
)

Parameters

ipAddress_
Type: SystemString
Address of TCP server.
ipPort_
Type: SystemInt32
TCP port number.
autoReconnectSeconds_
Type: SystemUInt32
Number of seconds to elapse before re-attempting auto connect after a server instigated disconnection.
See Also

Reference

CommsClient2 Class
CommsClient2 Overload
Bncs.Comms Namespace


CommsClient2 Constructor (String, Int32, UInt32, Int32)

CommsClient2 Constructor (String, Int32, UInt32, Int32)
Constructor accepting a TCP server address, port, auto reconnect settings and read buffer size. Only use this constructor for TCP communications only.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsClient2(
    string ipAddress_,
    int ipPort_,
    uint autoReconnectSeconds_,
    int bufferSizeBytes_
)

Parameters

ipAddress_
Type: SystemString
Address of TCP server.
ipPort_
Type: SystemInt32
TCP port number.
autoReconnectSeconds_
Type: SystemUInt32
Number of seconds to elapse before re-attempting auto connect after a server instigated disconnection.
bufferSizeBytes_
Type: SystemInt32
Read buffer size, determines the amount of data that may be read in a single read operation.
See Also

Reference

CommsClient2 Class
CommsClient2 Overload
Bncs.Comms Namespace


CommsClient2 Methods

CommsClient2 Methods

The CommsClient2 type exposes the following members.

Methods
 | Name | Description
Public method | AssumeServerDisconnect | Disconnects from the TCP, UDP server or serial device (as applicable). Unlike Disconnect() this method forces the [!:Bncs.Comms.CommsClient.OnConnectionStatusChangedEventHandler] event handler to report the instigator of the disconnection to be the server.
Public method | Connect | Connects to the TCP/IP server and blocks until connection success/failure is established
Public method | Connect(Boolean) | Connects to a TCP server. Waits or fires and forgets according to the wait_ argument.
Public method | Disconnect | Disconnects from the TCP/IP server
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Send(Byte) | Writes the supplied byte to the server
Public method | Send(Byte) | Writes the supplied buffer to the server
Public method | Send(String) | Writes the supplied string to the server
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

CommsClient2 Class
Bncs.Comms Namespace


CommsClient2.AssumeServerDisconnect Method

CommsClient2AssumeServerDisconnect Method
Disconnects from the TCP, UDP server or serial device (as applicable). Unlike Disconnect() this method forces the [!:Bncs.Comms.CommsClient.OnConnectionStatusChangedEventHandler] event handler to report the instigator of the disconnection to be the server.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void AssumeServerDisconnect()
See Also

Reference

CommsClient2 Class
Bncs.Comms Namespace


CommsClient2.Connect Method

CommsClient2Connect Method
Overload List
 | Name | Description
Public method | Connect | Connects to the TCP/IP server and blocks until connection success/failure is established
Public method | Connect(Boolean) | Connects to a TCP server. Waits or fires and forgets according to the wait_ argument.
Top
See Also

Reference

CommsClient2 Class
Bncs.Comms Namespace


CommsClient2.Connect Method

CommsClient2Connect Method
Connects to the TCP/IP server and blocks until connection success/failure is established

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Connect()

Return Value

Type: Boolean
True if connected
See Also

Reference

CommsClient2 Class
Connect Overload
Bncs.Comms Namespace


CommsClient2.Connect Method (Boolean)

CommsClient2Connect Method (Boolean)
Connects to a TCP server. Waits or fires and forgets according to the wait_ argument.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Nullable<bool> Connect(
    bool wait_
)

Parameters

wait_
Type: SystemBoolean
Blocking flag, if true then this becomes a blocking call else the connect is threaded and this method will always return immediatley.

Return Value

Type: Nullable Boolean
When wait_ is true: this method will return True on success of False on failure When wait_ is false: returns null providing we are disconnected and have valid settings returns false if we are either already connected or our settings are invalid
See Also

Reference

CommsClient2 Class
Connect Overload
Bncs.Comms Namespace


CommsClient2.Disconnect Method

CommsClient2Disconnect Method
Disconnects from the TCP/IP server

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Disconnect()
See Also

Reference

CommsClient2 Class
Bncs.Comms Namespace


CommsClient2.Send Method

CommsClient2Send Method
Overload List
 | Name | Description
Public method | Send(Byte) | Writes the supplied byte to the server
Public method | Send(Byte) | Writes the supplied buffer to the server
Public method | Send(String) | Writes the supplied string to the server
Top
See Also

Reference

CommsClient2 Class
Bncs.Comms Namespace


CommsClient2.Send Method (Byte)

CommsClient2Send Method (Byte)
Writes the supplied byte to the server

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Send(
    byte dataByte_
)

Parameters

dataByte_
Type: SystemByte
Byte to write to the server

Return Value

Type: Boolean
True on success
See Also

Reference

CommsClient2 Class
Send Overload
Bncs.Comms Namespace


CommsClient2.Send Method (Byte[])

CommsClient2Send Method (Byte)
Writes the supplied buffer to the server

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Send(
    byte[] buffer_
)

Parameters

buffer_
Type: SystemByte
Array of bytes to write to the server

Return Value

Type: Boolean
True on success
See Also

Reference

CommsClient2 Class
Send Overload
Bncs.Comms Namespace


CommsClient2.Send Method (String)

CommsClient2Send Method (String)
Writes the supplied string to the server

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Send(
    string data_
)

Parameters

data_
Type: SystemString
String to write to the server

Return Value

Type: Boolean
True on success
See Also

Reference

CommsClient2 Class
Send Overload
Bncs.Comms Namespace


CommsClient2 Properties

CommsClient2 Properties

The CommsClient2 type exposes the following members.

Properties
 | Name | Description
Public property | ConnectionType | Gets the connection type.
Public property | Debugger | Gets or sets a debugger, see the CommsClientDebugger class for more information.
Public property | IsConnected | Returns true if connection is established.
Public property | Settings | Gets or sets the settings
Public property | Status | Gets the current connection status.
Public property | Tag | Gets or sets the Tag property, use this to associate an object with the session.
 | Version | Gets the CommsClient2 edition, this will always be v2 for this class.
Top
See Also

Reference

CommsClient2 Class
Bncs.Comms Namespace


CommsClient2.ConnectionType Property

CommsClient2ConnectionType Property
Gets the connection type.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ConnectionType ConnectionType { get; }

Property Value

Type: ConnectionType
See Also

Reference

CommsClient2 Class
Bncs.Comms Namespace


CommsClient2.Debugger Property

CommsClient2Debugger Property
Gets or sets a debugger, see the CommsClientDebugger class for more information.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsClientDebugger Debugger { get; set; }

Property Value

Type: CommsClientDebugger
See Also

Reference

CommsClient2 Class
Bncs.Comms Namespace


CommsClient2.IsConnected Property

CommsClient2IsConnected Property
Returns true if connection is established.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool IsConnected { get; }

Property Value

Type: Boolean
See Also

Reference

CommsClient2 Class
Bncs.Comms Namespace


CommsClient2.Settings Property

CommsClient2Settings Property
Gets or sets the settings

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsSettings Settings { get; set; }

Property Value

Type: CommsSettings
See Also

Reference

CommsClient2 Class
Bncs.Comms Namespace


CommsClient2.Status Property

CommsClient2Status Property
Gets the current connection status.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ConnectionStatus2 Status { get; }

Property Value

Type: ConnectionStatus2
See Also

Reference

CommsClient2 Class
Bncs.Comms Namespace


CommsClient2.Tag Property

CommsClient2Tag Property
Gets or sets the Tag property, use this to associate an object with the session.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Object Tag { get; set; }

Property Value

Type: Object
See Also

Reference

CommsClient2 Class
Bncs.Comms Namespace


CommsClient2.Version Property

CommsClient2Version Property
Gets the CommsClient2 edition, this will always be v2 for this class.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string Version { get; }

Property Value

Type: String
See Also

Reference

CommsClient2 Class
Bncs.Comms Namespace


CommsClient2 Events

CommsClient2 Events

The CommsClient2 type exposes the following members.

Events
 | Name | Description
Public event | OnBufferFull | Buffer full event handler, fires when a read filled the entire buffer.
Public event | OnConnectionStateChanged | Fires when the connection state changes.
Public event | OnDebug | If assigned fires when pertanent extra debug information is available.
Public event | OnException | Fires when an exception has been caught.
Public event | OnReadTimeOut | Fires when a read time out occurs.
Public event | Receive | Fires when bytes have been read into the input buffer from the server.
Public event | Sent | Fires when bytes have been written to the server.
Top
See Also

Reference

CommsClient2 Class
Bncs.Comms Namespace


CommsClient2.OnBufferFull Event

CommsClient2OnBufferFull Event
Buffer full event handler, fires when a read filled the entire buffer.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnBufferFullEventHandler OnBufferFull

Value

Type: Bncs.CommsOnBufferFullEventHandler
See Also

Reference

CommsClient2 Class
Bncs.Comms Namespace


CommsClient2.OnConnectionStateChanged Event

CommsClient2OnConnectionStateChanged Event
Fires when the connection state changes.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnConnectionStatusChangedEventHandler2 OnConnectionStateChanged

Value

Type: Bncs.CommsOnConnectionStatusChangedEventHandler2
See Also

Reference

CommsClient2 Class
Bncs.Comms Namespace


CommsClient2.OnDebug Event

CommsClient2OnDebug Event
If assigned fires when pertanent extra debug information is available.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnDebugEventHandler OnDebug

Value

Type: Bncs.CommsOnDebugEventHandler
See Also

Reference

CommsClient2 Class
Bncs.Comms Namespace


CommsClient2.OnException Event

CommsClient2OnException Event
Fires when an exception has been caught.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnExceptionEventHandler OnException

Value

Type: Bncs.CommsOnExceptionEventHandler
See Also

Reference

CommsClient2 Class
Bncs.Comms Namespace


CommsClient2.OnReadTimeOut Event

CommsClient2OnReadTimeOut Event
Fires when a read time out occurs.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnReadTimeOutEventHandler OnReadTimeOut

Value

Type: Bncs.CommsOnReadTimeOutEventHandler
See Also

Reference

CommsClient2 Class
Bncs.Comms Namespace


CommsClient2.Receive Event

CommsClient2Receive Event
Fires when bytes have been read into the input buffer from the server.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnReceiveEventHandler Receive

Value

Type: Bncs.CommsOnReceiveEventHandler
See Also

Reference

CommsClient2 Class
Bncs.Comms Namespace


CommsClient2.Sent Event

CommsClient2Sent Event
Fires when bytes have been written to the server.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnSendEventHandler Sent

Value

Type: Bncs.CommsOnSendEventHandler
See Also

Reference

CommsClient2 Class
Bncs.Comms Namespace


CommsClientCollection Class

CommsClientCollection Class
A class that keeps a collection of CommsClient instances. This class does not generate objects of type CommsClient2
Inheritance Hierarchy
SystemObject
Bncs.CommsCommsClientCollection

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class CommsClientCollection

The CommsClientCollection type exposes the following members.

Constructors
 | Name | Description
Public method | CommsClientCollection | Default constructor
Public method | CommsClientCollection(CommsSettings) | Constaructor accepting CommsSettings parameters
Public method | CommsClientCollection(ListCommsSettings) | Constructor accepting a List of CommsSettings instances
Top
Methods
 | Name | Description
Public method | AddSettings | Creates and adds a new CommsClient by setting
Public method | AssumeServerDisconnect | Assum,es server disconnection for all clients
Public method | Connect | Connects and waits for all clients
Public method | Connect(Boolean) | Connects to all clients
Public method | Contains | Ascertains if the list of clients includes the one passed as an argument
Public method | Disconnect | Disconnects from all clients.
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | Flush | Flushes all client buffers
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Send(Byte) | Sends data to all clients
Public method | Send(Byte) | Sends data to all clients
Public method | Send(String) | Sends data to all clients
Public method | SetDeveloperDebugReceiveMessage(Byte) | Sets developer debug receive message
Public method | SetDeveloperDebugReceiveMessage(String) | Sets developer debug receive message
Public method | ToString | Converts this to a string (Overrides ObjectToString.)
Top
Properties
 | Name | Description
Public property | Count | Gets the number of clients on the list
Public property | Debugger | Assigns a debugger, CommsClientDebugger, to all clients in the collection.
Public property | Item | Default indexer property returns all CommsClient children
Public property | WriteOnly | Sets the WriteOnly property for all clients in the collection.
Top
Events
 | Name | Description
Public event | OnBufferFull | OnBufferFull event handler
Public event | OnConnectionStateChanged | Connection state changed event handler, fires each time the connection state changes
Public event | OnDebug | OnDebug event handler
Public event | OnException | OnException event, fires whenever an exception is raised
Public event | OnReadTimeOut | OnReadTimeOut event handler
Public event | Receive | Receive event, fires whenever a message has been read from the connection
Top
See Also

Reference

Bncs.Comms Namespace


CommsClientCollection Constructor

CommsClientCollection Constructor
Overload List
 | Name | Description
Public method | CommsClientCollection | Default constructor
Public method | CommsClientCollection(CommsSettings) | Constaructor accepting CommsSettings parameters
Public method | CommsClientCollection(ListCommsSettings) | Constructor accepting a List of CommsSettings instances
Top
See Also

Reference

CommsClientCollection Class
Bncs.Comms Namespace


CommsClientCollection Constructor

CommsClientCollection Constructor
Default constructor

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsClientCollection()
See Also

Reference

CommsClientCollection Class
CommsClientCollection Overload
Bncs.Comms Namespace


CommsClientCollection Constructor (CommsSettings[])

CommsClientCollection Constructor (CommsSettings)
Constaructor accepting CommsSettings parameters

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsClientCollection(
    params CommsSettings[] settings_
)

Parameters

settings_
Type: Bncs.CommsCommsSettings
See Also

Reference

CommsClientCollection Class
CommsClientCollection Overload
Bncs.Comms Namespace


CommsClientCollection Constructor (List(CommsSettings))

CommsClientCollection Constructor (ListCommsSettings)
Constructor accepting a List of CommsSettings instances

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsClientCollection(
    List<CommsSettings> settings_
)

Parameters

settings_
Type: System.Collections.GenericList CommsSettings
See Also

Reference

CommsClientCollection Class
CommsClientCollection Overload
Bncs.Comms Namespace


CommsClientCollection Methods

CommsClientCollection Methods

The CommsClientCollection type exposes the following members.

Methods
 | Name | Description
Public method | AddSettings | Creates and adds a new CommsClient by setting
Public method | AssumeServerDisconnect | Assum,es server disconnection for all clients
Public method | Connect | Connects and waits for all clients
Public method | Connect(Boolean) | Connects to all clients
Public method | Contains | Ascertains if the list of clients includes the one passed as an argument
Public method | Disconnect | Disconnects from all clients.
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | Flush | Flushes all client buffers
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Send(Byte) | Sends data to all clients
Public method | Send(Byte) | Sends data to all clients
Public method | Send(String) | Sends data to all clients
Public method | SetDeveloperDebugReceiveMessage(Byte) | Sets developer debug receive message
Public method | SetDeveloperDebugReceiveMessage(String) | Sets developer debug receive message
Public method | ToString | Converts this to a string (Overrides ObjectToString.)
Top
See Also

Reference

CommsClientCollection Class
Bncs.Comms Namespace


CommsClientCollection.AddSettings Method

CommsClientCollectionAddSettings Method
Creates and adds a new CommsClient by setting

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void AddSettings(
    CommsSettings setting_
)

Parameters

setting_
Type: Bncs.CommsCommsSettings
CommsSetting to use
See Also

Reference

CommsClientCollection Class
Bncs.Comms Namespace


CommsClientCollection.AssumeServerDisconnect Method

CommsClientCollectionAssumeServerDisconnect Method
Assum,es server disconnection for all clients

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void AssumeServerDisconnect()
See Also

Reference

CommsClientCollection Class
Bncs.Comms Namespace


CommsClientCollection.Connect Method

CommsClientCollectionConnect Method
Overload List
 | Name | Description
Public method | Connect | Connects and waits for all clients
Public method | Connect(Boolean) | Connects to all clients
Top
See Also

Reference

CommsClientCollection Class
Bncs.Comms Namespace


CommsClientCollection.Connect Method

CommsClientCollectionConnect Method
Connects and waits for all clients

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Connect()
See Also

Reference

CommsClientCollection Class
Connect Overload
Bncs.Comms Namespace


CommsClientCollection.Connect Method (Boolean)

CommsClientCollectionConnect Method (Boolean)
Connects to all clients

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Connect(
    bool wait_
)

Parameters

wait_
Type: SystemBoolean
If true it waits for results
See Also

Reference

CommsClientCollection Class
Connect Overload
Bncs.Comms Namespace


CommsClientCollection.Contains Method

CommsClientCollectionContains Method
Ascertains if the list of clients includes the one passed as an argument

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Contains(
    CommsSettings setting_
)

Parameters

setting_
Type: Bncs.CommsCommsSettings
Setting to seek

Return Value

Type: Boolean
True if a CommsClient with the supplied settings already exists
See Also

Reference

CommsClientCollection Class
Bncs.Comms Namespace


CommsClientCollection.Disconnect Method

CommsClientCollectionDisconnect Method
Disconnects from all clients.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Disconnect()
See Also

Reference

CommsClientCollection Class
Bncs.Comms Namespace


CommsClientCollection.Flush Method

CommsClientCollectionFlush Method
Flushes all client buffers

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Flush()
See Also

Reference

CommsClientCollection Class
Bncs.Comms Namespace


CommsClientCollection.Send Method

CommsClientCollectionSend Method
Overload List
 | Name | Description
Public method | Send(Byte) | Sends data to all clients
Public method | Send(Byte) | Sends data to all clients
Public method | Send(String) | Sends data to all clients
Top
See Also

Reference

CommsClientCollection Class
Bncs.Comms Namespace


CommsClientCollection.Send Method (Byte)

CommsClientCollectionSend Method (Byte)
Sends data to all clients

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Send(
    byte dataByte_
)

Parameters

dataByte_
Type: SystemByte
Data to send
See Also

Reference

CommsClientCollection Class
Send Overload
Bncs.Comms Namespace


CommsClientCollection.Send Method (Byte[])

CommsClientCollectionSend Method (Byte)
Sends data to all clients

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Send(
    byte[] buffer_
)

Parameters

buffer_
Type: SystemByte
Data to send
See Also

Reference

CommsClientCollection Class
Send Overload
Bncs.Comms Namespace


CommsClientCollection.Send Method (String)

CommsClientCollectionSend Method (String)
Sends data to all clients

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Send(
    string data_
)

Parameters

data_
Type: SystemString
Data to send
See Also

Reference

CommsClientCollection Class
Send Overload
Bncs.Comms Namespace


CommsClientCollection.SetDeveloperDebugReceiveMessage Method

CommsClientCollectionSetDeveloperDebugReceiveMessage Method
Overload List
 | Name | Description
Public method | SetDeveloperDebugReceiveMessage(Byte) | Sets developer debug receive message
Public method | SetDeveloperDebugReceiveMessage(String) | Sets developer debug receive message
Top
See Also

Reference

CommsClientCollection Class
Bncs.Comms Namespace


CommsClientCollection.SetDeveloperDebugReceiveMessage Method (Byte[])

CommsClientCollectionSetDeveloperDebugReceiveMessage Method (Byte)
Sets developer debug receive message

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void SetDeveloperDebugReceiveMessage(
    byte[] message_
)

Parameters

message_
Type: SystemByte
Bytes to use
See Also

Reference

CommsClientCollection Class
SetDeveloperDebugReceiveMessage Overload
Bncs.Comms Namespace


CommsClientCollection.SetDeveloperDebugReceiveMessage Method (String)

CommsClientCollectionSetDeveloperDebugReceiveMessage Method (String)
Sets developer debug receive message

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void SetDeveloperDebugReceiveMessage(
    string message_
)

Parameters

message_
Type: SystemString
String to use
See Also

Reference

CommsClientCollection Class
SetDeveloperDebugReceiveMessage Overload
Bncs.Comms Namespace


CommsClientCollection.ToString Method

CommsClientCollectionToString Method
Converts this to a string

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
This as a string
See Also

Reference

CommsClientCollection Class
Bncs.Comms Namespace


CommsClientCollection Properties

CommsClientCollection Properties

The CommsClientCollection type exposes the following members.

Properties
 | Name | Description
Public property | Count | Gets the number of clients on the list
Public property | Debugger | Assigns a debugger, CommsClientDebugger, to all clients in the collection.
Public property | Item | Default indexer property returns all CommsClient children
Public property | WriteOnly | Sets the WriteOnly property for all clients in the collection.
Top
See Also

Reference

CommsClientCollection Class
Bncs.Comms Namespace


CommsClientCollection.Count Property

CommsClientCollectionCount Property
Gets the number of clients on the list

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Count { get; }

Property Value

Type: Int32
See Also

Reference

CommsClientCollection Class
Bncs.Comms Namespace


CommsClientCollection.Debugger Property

CommsClientCollectionDebugger Property
Assigns a debugger, CommsClientDebugger, to all clients in the collection.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsClientDebugger Debugger { set; }

Property Value

Type: CommsClientDebugger
See Also

Reference

CommsClientCollection Class
Bncs.Comms Namespace


CommsClientCollection.Item Property

CommsClientCollectionItem Property
Default indexer property returns all CommsClient children

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsClient this[
    int index_
] { get; }

Parameters

index_
Type: SystemInt32
Index to seek

Return Value

Type: CommsClient
A CommsClient instance else null if none found
See Also

Reference

CommsClientCollection Class
Bncs.Comms Namespace


CommsClientCollection.WriteOnly Property

CommsClientCollectionWriteOnly Property
Sets the WriteOnly property for all clients in the collection.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool WriteOnly { set; }

Property Value

Type: Boolean
See Also

Reference

CommsClientCollection Class
Bncs.Comms Namespace


CommsClientCollection Events

CommsClientCollection Events

The CommsClientCollection type exposes the following members.

Events
 | Name | Description
Public event | OnBufferFull | OnBufferFull event handler
Public event | OnConnectionStateChanged | Connection state changed event handler, fires each time the connection state changes
Public event | OnDebug | OnDebug event handler
Public event | OnException | OnException event, fires whenever an exception is raised
Public event | OnReadTimeOut | OnReadTimeOut event handler
Public event | Receive | Receive event, fires whenever a message has been read from the connection
Top
See Also

Reference

CommsClientCollection Class
Bncs.Comms Namespace


CommsClientCollection.OnBufferFull Event

CommsClientCollectionOnBufferFull Event
OnBufferFull event handler

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnBufferFullEventHandler OnBufferFull

Value

Type: Bncs.CommsOnBufferFullEventHandler
See Also

Reference

CommsClientCollection Class
Bncs.Comms Namespace


CommsClientCollection.OnConnectionStateChanged Event

CommsClientCollectionOnConnectionStateChanged Event
Connection state changed event handler, fires each time the connection state changes

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnConnectionStatusChangedEventHandler OnConnectionStateChanged

Value

Type: Bncs.CommsOnConnectionStatusChangedEventHandler
See Also

Reference

CommsClientCollection Class
Bncs.Comms Namespace


CommsClientCollection.OnDebug Event

CommsClientCollectionOnDebug Event
OnDebug event handler

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnDebugEventHandler OnDebug

Value

Type: Bncs.CommsOnDebugEventHandler
See Also

Reference

CommsClientCollection Class
Bncs.Comms Namespace


CommsClientCollection.OnException Event

CommsClientCollectionOnException Event
OnException event, fires whenever an exception is raised

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnExceptionEventHandler OnException

Value

Type: Bncs.CommsOnExceptionEventHandler
See Also

Reference

CommsClientCollection Class
Bncs.Comms Namespace


CommsClientCollection.OnReadTimeOut Event

CommsClientCollectionOnReadTimeOut Event
OnReadTimeOut event handler

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnReadTimeOutEventHandler OnReadTimeOut

Value

Type: Bncs.CommsOnReadTimeOutEventHandler
See Also

Reference

CommsClientCollection Class
Bncs.Comms Namespace


CommsClientCollection.Receive Event

CommsClientCollectionReceive Event
Receive event, fires whenever a message has been read from the connection

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnReceiveEventHandler Receive

Value

Type: Bncs.CommsOnReceiveEventHandler
See Also

Reference

CommsClientCollection Class
Bncs.Comms Namespace


CommsClientDebugger Class

CommsClientDebugger Class
A debugger class manipulated by instances of the CommsClient and CommsClient2 classes. An instantiation of this class can be assigned to the aforementioned classes Debugger and Debugger properties. When assigned all raw transmitted and/or received data is logged.
Inheritance Hierarchy
SystemObject
Bncs.CommsCommsClientDebugger

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class CommsClientDebugger

The CommsClientDebugger type exposes the following members.

Constructors
Name Description
Public method CommsClientDebugger(String, DebugContent, Boolean, ContentDataType)
Constructor setting the file name, content, overwrite flag and data type properties.
Public method CommsClientDebugger(DebugContent, ContentDataType, ContentFormat, Boolean)
Constructor setting the content, data type, format and annotate properties. This version does not write to a disk file, to receive messages you must assign the OnDebug event handler.
CommsClientDebugger(String, DebugContent, Boolean, ContentDataType, Boolean)
Constructor setting the file name, content, overwrite flag, data type and annotate properties.
Examples
This sample shows how to create a CommsClient and create a debug file to capture all input and output.
Copy
class Program
{
    static void Main()
    {
        // Create a client
        CommsClient client = new CommsClient("192.168.1.1", 8090);
        // Create a debugger to output raw packets to using input and output
        client.Debugger = new CommsClientDebugger(@"c:\mylogs\logfile.log", DebugContent.dcBoth, false, ContentDataType.cdtText, true);
    }
}
Public method CommsClientDebugger(String, DebugContent, Boolean, ContentDataType, ContentFormat, Boolean)
Constructor setting the file name, content, overwrite flag, data type, format and split flag properties.
Public method CommsClientDebugger(String, DebugContent, Boolean, ContentDataType, ContentFormat, Boolean, Boolean)
Constructor setting the file name, content, overwrite flag, data type, format, split flag and annotate properties.
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Public method | WriteLine(String) | Writes the supplied string to the output file.
 | WriteLine(String, String) | Static method that writes the supplied message string to the supplied file name.
Public method | WriteRx(Byte) | Writes the supplied buffer to the output file as RX information.
Public method | WriteRx(String) | Writes the supplied string to the output file as RX information.
Public method | WriteTx(Byte) | Writes the supplied buffer to the output file as TX information.
Public method | WriteTx(String) | Writes the supplied string to the output file as TX information.
Top
Properties
 | Name | Description
Public property | RxFilename | Gets the full path of the file that logs the data received if the logging is not configured as split mode
Public property | SplitFiles | Gets a flag that betrays if the TX/RX logging is split into seperate files
Public property | TxFilename | Gets the full path of the file that logs the transmitted data or transmitted and received if the logging is not configured as split mode
Top
Events
 | Name | Description
Public event | OnDailyRollover | Event handler that fires when the date changes to enable daily logs. Implementations of this should return a new file name to recommence data output to.
Public event | OnDebug | Event handler that fires when a debug message occurs
Top
See Also

Reference

Bncs.Comms Namespace


CommsClientDebugger Constructor

CommsClientDebugger Constructor
Overload List
Name Description
Public method CommsClientDebugger(String, DebugContent, Boolean, ContentDataType)
Constructor setting the file name, content, overwrite flag and data type properties.
Public method CommsClientDebugger(DebugContent, ContentDataType, ContentFormat, Boolean)
Constructor setting the content, data type, format and annotate properties. This version does not write to a disk file, to receive messages you must assign the OnDebug event handler.
CommsClientDebugger(String, DebugContent, Boolean, ContentDataType, Boolean)
Constructor setting the file name, content, overwrite flag, data type and annotate properties.
Examples
This sample shows how to create a CommsClient and create a debug file to capture all input and output.
Copy
class Program
{
    static void Main()
    {
        // Create a client
        CommsClient client = new CommsClient("192.168.1.1", 8090);
        // Create a debugger to output raw packets to using input and output
        client.Debugger = new CommsClientDebugger(@"c:\mylogs\logfile.log", DebugContent.dcBoth, false, ContentDataType.cdtText, true);
    }
}
Public method CommsClientDebugger(String, DebugContent, Boolean, ContentDataType, ContentFormat, Boolean)
Constructor setting the file name, content, overwrite flag, data type, format and split flag properties.
Public method CommsClientDebugger(String, DebugContent, Boolean, ContentDataType, ContentFormat, Boolean, Boolean)
Constructor setting the file name, content, overwrite flag, data type, format, split flag and annotate properties.
Top
See Also

Reference

CommsClientDebugger Class
Bncs.Comms Namespace


CommsClientDebugger Constructor (String, DebugContent, Boolean, ContentDataType)

CommsClientDebugger Constructor (String, DebugContent, Boolean, ContentDataType)
Constructor setting the file name, content, overwrite flag and data type properties.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsClientDebugger(
    string filename_,
    DebugContent content_,
    bool overwrite_,
    ContentDataType dataType_
)

Parameters

filename_
Type: SystemString
Full path and name of file to output to
content_
Type: Bncs.CommsDebugContent
Content type
overwrite_
Type: SystemBoolean
Overwrite flag
dataType_
Type: Bncs.CommsContentDataType
Data type
See Also

Reference

CommsClientDebugger Class
CommsClientDebugger Overload
Bncs.Comms Namespace


CommsClientDebugger Constructor (DebugContent, ContentDataType, ContentFormat, Boolean)

CommsClientDebugger Constructor (DebugContent, ContentDataType, ContentFormat, Boolean)
Constructor setting the content, data type, format and annotate properties. This version does not write to a disk file, to receive messages you must assign the OnDebug event handler.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsClientDebugger(
    DebugContent content_,
    ContentDataType dataType_,
    ContentFormat format_,
    bool annotate_
)

Parameters

content_
Type: Bncs.CommsDebugContent
Content type
dataType_
Type: Bncs.CommsContentDataType
Data type
format_
Type: Bncs.CommsContentFormat
Data format
annotate_
Type: SystemBoolean
Annotation flag, if set the file(s) produced will include TX/RX source information prior to each packet logged
See Also

Reference

CommsClientDebugger Class
CommsClientDebugger Overload
Bncs.Comms Namespace


CommsClientDebugger Constructor (String, DebugContent, Boolean, ContentDataType, Boolean)

CommsClientDebugger Constructor (String, DebugContent, Boolean, ContentDataType, Boolean)
Constructor setting the file name, content, overwrite flag, data type and annotate properties.
Examples
This sample shows how to create a CommsClient and create a debug file to capture all input and output.
Copy
class Program
{
    static void Main()
    {
        // Create a client
        CommsClient client = new CommsClient("192.168.1.1", 8090);
        // Create a debugger to output raw packets to using input and output
        client.Debugger = new CommsClientDebugger(@"c:\mylogs\logfile.log", DebugContent.dcBoth, false, ContentDataType.cdtText, true);
    }
}

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsClientDebugger(
    string filename_,
    DebugContent content_,
    bool overwrite_,
    ContentDataType dataType_,
    bool annotate_
)

Parameters

filename_
Type: SystemString
Full path and name of file to output to
content_
Type: Bncs.CommsDebugContent
Content type
overwrite_
Type: SystemBoolean
Overwrite flag
dataType_
Type: Bncs.CommsContentDataType
Data type
annotate_
Type: SystemBoolean
See Also

Reference

CommsClientDebugger Class
CommsClientDebugger Overload
Bncs.Comms Namespace


CommsClientDebugger Constructor (String, DebugContent, Boolean, ContentDataType, ContentFormat, Boolean)

CommsClientDebugger Constructor (String, DebugContent, Boolean, ContentDataType, ContentFormat, Boolean)
Constructor setting the file name, content, overwrite flag, data type, format and split flag properties.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsClientDebugger(
    string filename_,
    DebugContent content_,
    bool overwrite_,
    ContentDataType dataType_,
    ContentFormat format_,
    bool splitTxRxFiles_
)

Parameters

filename_
Type: SystemString
Full path and name of file to output to
content_
Type: Bncs.CommsDebugContent
Content type
overwrite_
Type: SystemBoolean
Overwrite flag
dataType_
Type: Bncs.CommsContentDataType
Data type
format_
Type: Bncs.CommsContentFormat
Data format
splitTxRxFiles_
Type: SystemBoolean
Flag for splitting TX and RX data in to seperate files.
See Also

Reference

CommsClientDebugger Class
CommsClientDebugger Overload
Bncs.Comms Namespace


CommsClientDebugger Constructor (String, DebugContent, Boolean, ContentDataType, ContentFormat, Boolean, Boolean)

CommsClientDebugger Constructor (String, DebugContent, Boolean, ContentDataType, ContentFormat, Boolean, Boolean)
Constructor setting the file name, content, overwrite flag, data type, format, split flag and annotate properties.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsClientDebugger(
    string filename_,
    DebugContent content_,
    bool overwrite_,
    ContentDataType dataType_,
    ContentFormat format_,
    bool splitTxRxFiles_,
    bool annotate_
)

Parameters

filename_
Type: SystemString
Full path and name of file to output to
content_
Type: Bncs.CommsDebugContent
Content type
overwrite_
Type: SystemBoolean
Overwrite flag
dataType_
Type: Bncs.CommsContentDataType
Data type
format_
Type: Bncs.CommsContentFormat
Data format
splitTxRxFiles_
Type: SystemBoolean
Flag for splitting TX and RX data in to seperate files.
annotate_
Type: SystemBoolean
Annotation flag, if set the file(s) produced will include TX/RX source information prior to each packet logged
See Also

Reference

CommsClientDebugger Class
CommsClientDebugger Overload
Bncs.Comms Namespace


CommsClientDebugger Methods

CommsClientDebugger Methods

The CommsClientDebugger type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Public method | WriteLine(String) | Writes the supplied string to the output file.
 | WriteLine(String, String) | Static method that writes the supplied message string to the supplied file name.
Public method | WriteRx(Byte) | Writes the supplied buffer to the output file as RX information.
Public method | WriteRx(String) | Writes the supplied string to the output file as RX information.
Public method | WriteTx(Byte) | Writes the supplied buffer to the output file as TX information.
Public method | WriteTx(String) | Writes the supplied string to the output file as TX information.
Top
See Also

Reference

CommsClientDebugger Class
Bncs.Comms Namespace


CommsClientDebugger.WriteLine Method

CommsClientDebuggerWriteLine Method
Overload List
 | Name | Description
Public method | WriteLine(String) | Writes the supplied string to the output file.
 | WriteLine(String, String) | Static method that writes the supplied message string to the supplied file name.
Top
See Also

Reference

CommsClientDebugger Class
Bncs.Comms Namespace


CommsClientDebugger.WriteLine Method (String)

CommsClientDebuggerWriteLine Method (String)
Writes the supplied string to the output file.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void WriteLine(
    string message_
)

Parameters

message_
Type: SystemString
String to write.
See Also

Reference

CommsClientDebugger Class
WriteLine Overload
Bncs.Comms Namespace


CommsClientDebugger.WriteLine Method (String, String)

CommsClientDebuggerWriteLine Method (String, String)
Static method that writes the supplied message string to the supplied file name.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static void WriteLine(
    string message_,
    string filename_
)

Parameters

message_
Type: SystemString
String to write to the output file.
filename_
Type: SystemString
Path and name of the output file.
See Also

Reference

CommsClientDebugger Class
WriteLine Overload
Bncs.Comms Namespace


CommsClientDebugger.WriteRx Method

CommsClientDebuggerWriteRx Method
Overload List
 | Name | Description
Public method | WriteRx(Byte) | Writes the supplied buffer to the output file as RX information.
Public method | WriteRx(String) | Writes the supplied string to the output file as RX information.
Top
See Also

Reference

CommsClientDebugger Class
Bncs.Comms Namespace


CommsClientDebugger.WriteRx Method (Byte[])

CommsClientDebuggerWriteRx Method (Byte)
Writes the supplied buffer to the output file as RX information.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void WriteRx(
    byte[] buffer_
)

Parameters

buffer_
Type: SystemByte
Data to log
See Also

Reference

CommsClientDebugger Class
WriteRx Overload
Bncs.Comms Namespace


CommsClientDebugger.WriteRx Method (String)

CommsClientDebuggerWriteRx Method (String)
Writes the supplied string to the output file as RX information.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void WriteRx(
    string message_
)

Parameters

message_
Type: SystemString
String to log
See Also

Reference

CommsClientDebugger Class
WriteRx Overload
Bncs.Comms Namespace


CommsClientDebugger.WriteTx Method

CommsClientDebuggerWriteTx Method
Overload List
 | Name | Description
Public method | WriteTx(Byte) | Writes the supplied buffer to the output file as TX information.
Public method | WriteTx(String) | Writes the supplied string to the output file as TX information.
Top
See Also

Reference

CommsClientDebugger Class
Bncs.Comms Namespace


CommsClientDebugger.WriteTx Method (Byte[])

CommsClientDebuggerWriteTx Method (Byte)
Writes the supplied buffer to the output file as TX information.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void WriteTx(
    byte[] buffer_
)

Parameters

buffer_
Type: SystemByte
Data to log
See Also

Reference

CommsClientDebugger Class
WriteTx Overload
Bncs.Comms Namespace


CommsClientDebugger.WriteTx Method (String)

CommsClientDebuggerWriteTx Method (String)
Writes the supplied string to the output file as TX information.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void WriteTx(
    string message_
)

Parameters

message_
Type: SystemString
String to log
See Also

Reference

CommsClientDebugger Class
WriteTx Overload
Bncs.Comms Namespace


CommsClientDebugger Properties

CommsClientDebugger Properties

The CommsClientDebugger type exposes the following members.

Properties
 | Name | Description
Public property | RxFilename | Gets the full path of the file that logs the data received if the logging is not configured as split mode
Public property | SplitFiles | Gets a flag that betrays if the TX/RX logging is split into seperate files
Public property | TxFilename | Gets the full path of the file that logs the transmitted data or transmitted and received if the logging is not configured as split mode
Top
See Also

Reference

CommsClientDebugger Class
Bncs.Comms Namespace


CommsClientDebugger.RxFilename Property

CommsClientDebuggerRxFilename Property
Gets the full path of the file that logs the data received if the logging is not configured as split mode

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string RxFilename { get; }

Property Value

Type: String
See Also

Reference

CommsClientDebugger Class
Bncs.Comms Namespace


CommsClientDebugger.SplitFiles Property

CommsClientDebuggerSplitFiles Property
Gets a flag that betrays if the TX/RX logging is split into seperate files

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool SplitFiles { get; }

Property Value

Type: Boolean
See Also

Reference

CommsClientDebugger Class
Bncs.Comms Namespace


CommsClientDebugger.TxFilename Property

CommsClientDebuggerTxFilename Property
Gets the full path of the file that logs the transmitted data or transmitted and received if the logging is not configured as split mode

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string TxFilename { get; }

Property Value

Type: String
See Also

Reference

CommsClientDebugger Class
Bncs.Comms Namespace


CommsClientDebugger Events

CommsClientDebugger Events

The CommsClientDebugger type exposes the following members.

Events
 | Name | Description
Public event | OnDailyRollover | Event handler that fires when the date changes to enable daily logs. Implementations of this should return a new file name to recommence data output to.
Public event | OnDebug | Event handler that fires when a debug message occurs
Top
See Also

Reference

CommsClientDebugger Class
Bncs.Comms Namespace


CommsClientDebugger.OnDailyRollover Event

CommsClientDebuggerOnDailyRollover Event
Event handler that fires when the date changes to enable daily logs. Implementations of this should return a new file name to recommence data output to.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnDailyRolloverEventHandler OnDailyRollover

Value

Type: Bncs.CommsOnDailyRolloverEventHandler
See Also

Reference

CommsClientDebugger Class
Bncs.Comms Namespace


CommsClientDebugger.OnDebug Event

CommsClientDebuggerOnDebug Event
Event handler that fires when a debug message occurs

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnTxRxDebugEventHandler OnDebug

Value

Type: Bncs.CommsOnTxRxDebugEventHandler
See Also

Reference

CommsClientDebugger Class
Bncs.Comms Namespace


CommsSerialSettings Class

CommsSerialSettings Class
Serialisable communications settings for serial connections.
Inheritance Hierarchy
SystemObject
Bncs.XMLPersistedXML
Bncs.CommsCommsSettings
Bncs.CommsCommsSerialSettings

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class CommsSerialSettings : CommsSettings

The CommsSerialSettings type exposes the following members.

Constructors
Name Description
Public method CommsSerialSettings
Default constructor
CommsSerialSettings(String)
Constructor that sets the host property, this being the comms port.
Examples
This sample shows how to create an object of type CommsSerialSettings and use it to instantiate a CommsClient object.
Copy
class Program
{
    static void Main()
    {
        // Create serial settings for COM1 with the default electrical settings
        CommsSerialSettings serSettings = new CommsSerialSettings("COM1");
        // Create a CommsClient from the settings
        CommsClient client = new CommsClient(serSettings);
        // Try and connect
        if (true == client.Connect())
            Console.WriteLine("Connected to the device at " + serSettings.ToString());
        else
            Console.WriteLine("Failed to connect to the device at " + serSettings.ToString());

        // Wait for user input
        Console.ReadKey();

        // Disconnect the client
        if (client.IsConnected)
            client.Disconnect();
    }
}
Top
Methods
Name Description
Public method Equals
Tests for equality between this and the supplied object.
(Overrides CommsSettingsEquals(Object).)
Public method GetHashCode
Gets the hash code.
(Overrides CommsSettingsGetHashCode.)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method Save
Serializes the repository to a NON-read only XML file providing that the Filename property has been set. Error information is accessable through the SaveErrorInformation property.
(Inherited from PersistedXML.)
Save(String)
Serializes the repository to a NON-read only XML file with no error information.
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}
(Inherited from PersistedXML.)
Public method Save(String, String)
Serializes the repository to a NON-read only XML file with no error information.
(Inherited from PersistedXML.)
Save(String, String)
Serializes the repository to a NON-read only XML file with error information.
Examples
This code demonstrates how to serialise/deserialise objects to and from disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File name to serialise/deserialise to/from
        const string filename = @"c:\MyObject.xml";
        // Our PersistedXML object
        MyObject myObject = null;
        // Debug message variable
        string debug;
        // New instance of object flag
        bool newInstance;

        // Check file exists ...
        if (FileFuncs.Exists(filename))
        {
            // ... it does so deserialise the onject ...
            myObject = ((MyObject)MyObject.Open(filename, typeof(MyObject), out debug, out newInstance));
            if (null == myObject) // we have a problem!
                Console.WriteLine("Deserialisation returned NULL: " + debug);
            else
            {
                // Report instance and data deserialised to user
                Console.WriteLine(newInstance ? "A new instance was initialised." : "Data deserialised from file ok.");
                if (myObject.IsValid)
                {
                    Console.WriteLine("Name: " + myObject.Name);
                    Console.WriteLine("Number: " + myObject.Number.ToString());
                }
                else
                    Console.WriteLine("Object could not be validated.");

                if (debug.Length > 0)
                    Console.WriteLine("Debug from deserialiser reads: \"" + debug + "\"");
            }
        }
        else
        {
            // ... it doesn't so create and then serialise the onject ...
            myObject = new MyObject();
            // set some properties ...
            myObject.Name = "Fred";
            myObject.Number = 13;
            // Report object data to user
            Console.WriteLine("Name: " + myObject.Name);
            Console.WriteLine("Number: " + myObject.Number.ToString());
            // Serialise the object to disk file
            Console.WriteLine("Serialising to disk file...");
            if (myObject.Save(filename, out debug))
                // Alls well
                Console.WriteLine("Rerun this app to deserialise this object from disk file.");
            else
            {
                // Report deserialisation error
                string message = "Error serialising to disk file";
                if (myObject.SaveErrorMessage.Length > 0)
                    message += ": \"" + myObject.SaveErrorMessage + "\"";
                else if (debug.Length > 0)
                    message += ": \"" + debug + "\"";
                Console.WriteLine(message);
            }
        }

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }
}
(Inherited from PersistedXML.)
Public method Save(String, String, Boolean)
Serializes the repository to an XML file with error information.
(Inherited from PersistedXML.)
Public method Save(String, String, String)
Serializes the repository to a NON-read only XML file with error information.
(Inherited from PersistedXML.)
Public method Save(String, String, Boolean, String)
Serializes the repository to an XML file with error information.
(Inherited from PersistedXML.)
Public method Save(String, String, Boolean, Boolean, String)
Serializes the repository to an XML file with error information.
(Inherited from PersistedXML.)
SaveToBuffer
Serializes the object to a buffer
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}
(Inherited from PersistedXML.)
Public method SaveToBuffer(String)
Serializes the object to a buffer
(Inherited from PersistedXML.)
Public method SaveToBuffer(String, String)
Serializes the object to a buffer
(Inherited from PersistedXML.)
Public method ToString
Returns the class as as string
(Inherited from CommsSettings.)
Top
Properties
Name Description
Public property AutoReconnectSeconds
Gets or sets the auto reconnection attempt period (in seconds). The default is zero, when greater than zero a CommsClient will try every n seconds to re-establish connection to the server when the disconnect is insigated by the server.
(Inherited from CommsSettings.)
AvailableSerialPorts
Gets a list of available serial ports, i.e. ports not currently in use
Public property Baudrate
Gets or sets the baud rate
Public property BufferSize
Gets or sets the buffersize, this being the maximum amount of bytes returned by a single read operation.
(Inherited from CommsSettings.)
Public property CompareCriteria
Gets or sets a value that determines if the host name should be a consideration when comparing objects of this type.
(Inherited from CommsSettings.)
Public property CpuMilliseconds
Gets or sets a value that determines how many milliseconds thread cycle delay should be employed when used in a object of type CommsClient.
(Inherited from CommsSettings.)
Public property CpuMilliseconds2
Gets or sets a value that determines how many milliseconds thread cycle delay should be employed when used in a object of type CommsClient2.
(Inherited from CommsSettings.)
Public property DataBits
Gets or sets the data bits
Public property Filename
Gets or sets the XML file name property.
(Inherited from PersistedXML.)
Public property HandShake
Gets or sets the handshake
Public property Host
Gets or sets the Serial Port
(Overrides CommsSettingsHost.)
Public property HostIsLocalMachine
Returns true if the host resides on the local machine.
(Inherited from CommsSettings.)
Public property IsValid
Returns true if the host is assigned
(Inherited from CommsSettings.)
Public property Name
Gets or sets an optional friendly name for a configuration
(Inherited from CommsSettings.)
NextFreeSerialPortIndex
Gets the index of the next serial port index that is not in use
Public property Parity
Gets or sets the parity
Public property ReadTimeout
Gets or sets the read time out in milliseconds
(Inherited from CommsSettings.)
SaveErrorMessage
Gets an error message set if the previous Save() operation failed.
Examples
This code demonstrates how to serialise/deserialise objects to and from disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File name to serialise/deserialise to/from
        const string filename = @"c:\MyObject.xml";
        // Our PersistedXML object
        MyObject myObject = null;
        // Debug message variable
        string debug;
        // New instance of object flag
        bool newInstance;

        // Check file exists ...
        if (FileFuncs.Exists(filename))
        {
            // ... it does so deserialise the onject ...
            myObject = ((MyObject)MyObject.Open(filename, typeof(MyObject), out debug, out newInstance));
            if (null == myObject) // we have a problem!
                Console.WriteLine("Deserialisation returned NULL: " + debug);
            else
            {
                // Report instance and data deserialised to user
                Console.WriteLine(newInstance ? "A new instance was initialised." : "Data deserialised from file ok.");
                if (myObject.IsValid)
                {
                    Console.WriteLine("Name: " + myObject.Name);
                    Console.WriteLine("Number: " + myObject.Number.ToString());
                }
                else
                    Console.WriteLine("Object could not be validated.");

                if (debug.Length > 0)
                    Console.WriteLine("Debug from deserialiser reads: \"" + debug + "\"");
            }
        }
        else
        {
            // ... it doesn't so create and then serialise the onject ...
            myObject = new MyObject();
            // set some properties ...
            myObject.Name = "Fred";
            myObject.Number = 13;
            // Report object data to user
            Console.WriteLine("Name: " + myObject.Name);
            Console.WriteLine("Number: " + myObject.Number.ToString());
            // Serialise the object to disk file
            Console.WriteLine("Serialising to disk file...");
            if (myObject.Save(filename, out debug))
                // Alls well
                Console.WriteLine("Rerun this app to deserialise this object from disk file.");
            else
            {
                // Report deserialisation error
                string message = "Error serialising to disk file";
                if (myObject.SaveErrorMessage.Length > 0)
                    message += ": \"" + myObject.SaveErrorMessage + "\"";
                else if (debug.Length > 0)
                    message += ": \"" + debug + "\"";
                Console.WriteLine(message);
            }
        }

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }
}
(Inherited from PersistedXML.)
Public property StopBits
Gets or sets the stop bites
SystemSerialPorts
Gets a list of all serial ports on the system whether in use or not
Public property WriteTimeout
Gets or sets the the write time out in milliseconds
(Inherited from CommsSettings.)
Top
See Also

Reference

Bncs.Comms Namespace


CommsSerialSettings Constructor

CommsSerialSettings Constructor
Overload List
Name Description
Public method CommsSerialSettings
Default constructor
CommsSerialSettings(String)
Constructor that sets the host property, this being the comms port.
Examples
This sample shows how to create an object of type CommsSerialSettings and use it to instantiate a CommsClient object.
Copy
class Program
{
    static void Main()
    {
        // Create serial settings for COM1 with the default electrical settings
        CommsSerialSettings serSettings = new CommsSerialSettings("COM1");
        // Create a CommsClient from the settings
        CommsClient client = new CommsClient(serSettings);
        // Try and connect
        if (true == client.Connect())
            Console.WriteLine("Connected to the device at " + serSettings.ToString());
        else
            Console.WriteLine("Failed to connect to the device at " + serSettings.ToString());

        // Wait for user input
        Console.ReadKey();

        // Disconnect the client
        if (client.IsConnected)
            client.Disconnect();
    }
}
Top
See Also

Reference

CommsSerialSettings Class
Bncs.Comms Namespace


CommsSerialSettings Constructor

CommsSerialSettings Constructor
Default constructor

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsSerialSettings()
See Also

Reference

CommsSerialSettings Class
CommsSerialSettings Overload
Bncs.Comms Namespace


CommsSerialSettings Constructor (String)

CommsSerialSettings Constructor (String)
Constructor that sets the host property, this being the comms port.
Examples
This sample shows how to create an object of type CommsSerialSettings and use it to instantiate a CommsClient object.
Copy
class Program
{
    static void Main()
    {
        // Create serial settings for COM1 with the default electrical settings
        CommsSerialSettings serSettings = new CommsSerialSettings("COM1");
        // Create a CommsClient from the settings
        CommsClient client = new CommsClient(serSettings);
        // Try and connect
        if (true == client.Connect())
            Console.WriteLine("Connected to the device at " + serSettings.ToString());
        else
            Console.WriteLine("Failed to connect to the device at " + serSettings.ToString());

        // Wait for user input
        Console.ReadKey();

        // Disconnect the client
        if (client.IsConnected)
            client.Disconnect();
    }
}

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsSerialSettings(
    string host_
)

Parameters

host_
Type: SystemString
See Also

Reference

CommsSerialSettings Class
CommsSerialSettings Overload
Bncs.Comms Namespace


CommsSerialSettings Methods

CommsSerialSettings Methods

The CommsSerialSettings type exposes the following members.

Methods
Name Description
Public method Equals
Tests for equality between this and the supplied object.
(Overrides CommsSettingsEquals(Object).)
Public method GetHashCode
Gets the hash code.
(Overrides CommsSettingsGetHashCode.)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method Save
Serializes the repository to a NON-read only XML file providing that the Filename property has been set. Error information is accessable through the SaveErrorInformation property.
(Inherited from PersistedXML.)
Save(String)
Serializes the repository to a NON-read only XML file with no error information.
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}
(Inherited from PersistedXML.)
Public method Save(String, String)
Serializes the repository to a NON-read only XML file with no error information.
(Inherited from PersistedXML.)
Save(String, String)
Serializes the repository to a NON-read only XML file with error information.
Examples
This code demonstrates how to serialise/deserialise objects to and from disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File name to serialise/deserialise to/from
        const string filename = @"c:\MyObject.xml";
        // Our PersistedXML object
        MyObject myObject = null;
        // Debug message variable
        string debug;
        // New instance of object flag
        bool newInstance;

        // Check file exists ...
        if (FileFuncs.Exists(filename))
        {
            // ... it does so deserialise the onject ...
            myObject = ((MyObject)MyObject.Open(filename, typeof(MyObject), out debug, out newInstance));
            if (null == myObject) // we have a problem!
                Console.WriteLine("Deserialisation returned NULL: " + debug);
            else
            {
                // Report instance and data deserialised to user
                Console.WriteLine(newInstance ? "A new instance was initialised." : "Data deserialised from file ok.");
                if (myObject.IsValid)
                {
                    Console.WriteLine("Name: " + myObject.Name);
                    Console.WriteLine("Number: " + myObject.Number.ToString());
                }
                else
                    Console.WriteLine("Object could not be validated.");

                if (debug.Length > 0)
                    Console.WriteLine("Debug from deserialiser reads: \"" + debug + "\"");
            }
        }
        else
        {
            // ... it doesn't so create and then serialise the onject ...
            myObject = new MyObject();
            // set some properties ...
            myObject.Name = "Fred";
            myObject.Number = 13;
            // Report object data to user
            Console.WriteLine("Name: " + myObject.Name);
            Console.WriteLine("Number: " + myObject.Number.ToString());
            // Serialise the object to disk file
            Console.WriteLine("Serialising to disk file...");
            if (myObject.Save(filename, out debug))
                // Alls well
                Console.WriteLine("Rerun this app to deserialise this object from disk file.");
            else
            {
                // Report deserialisation error
                string message = "Error serialising to disk file";
                if (myObject.SaveErrorMessage.Length > 0)
                    message += ": \"" + myObject.SaveErrorMessage + "\"";
                else if (debug.Length > 0)
                    message += ": \"" + debug + "\"";
                Console.WriteLine(message);
            }
        }

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }
}
(Inherited from PersistedXML.)
Public method Save(String, String, Boolean)
Serializes the repository to an XML file with error information.
(Inherited from PersistedXML.)
Public method Save(String, String, String)
Serializes the repository to a NON-read only XML file with error information.
(Inherited from PersistedXML.)
Public method Save(String, String, Boolean, String)
Serializes the repository to an XML file with error information.
(Inherited from PersistedXML.)
Public method Save(String, String, Boolean, Boolean, String)
Serializes the repository to an XML file with error information.
(Inherited from PersistedXML.)
SaveToBuffer
Serializes the object to a buffer
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}
(Inherited from PersistedXML.)
Public method SaveToBuffer(String)
Serializes the object to a buffer
(Inherited from PersistedXML.)
Public method SaveToBuffer(String, String)
Serializes the object to a buffer
(Inherited from PersistedXML.)
Public method ToString
Returns the class as as string
(Inherited from CommsSettings.)
Top
See Also

Reference

CommsSerialSettings Class
Bncs.Comms Namespace


CommsSerialSettings.Equals Method

CommsSerialSettingsEquals Method
Tests for equality between this and the supplied object.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override bool Equals(
    Object obj
)

Parameters

obj
Type: SystemObject
Object to compare

Return Value

Type: Boolean
Returns true is this object and that supplied are equal.
See Also

Reference

CommsSerialSettings Class
Bncs.Comms Namespace


CommsSerialSettings.GetHashCode Method

CommsSerialSettingsGetHashCode Method
Gets the hash code.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override int GetHashCode()

Return Value

Type: Int32
A hash code
See Also

Reference

CommsSerialSettings Class
Bncs.Comms Namespace


CommsSerialSettings Properties

CommsSerialSettings Properties

The CommsSerialSettings type exposes the following members.

Properties
Name Description
Public property AutoReconnectSeconds
Gets or sets the auto reconnection attempt period (in seconds). The default is zero, when greater than zero a CommsClient will try every n seconds to re-establish connection to the server when the disconnect is insigated by the server.
(Inherited from CommsSettings.)
AvailableSerialPorts
Gets a list of available serial ports, i.e. ports not currently in use
Public property Baudrate
Gets or sets the baud rate
Public property BufferSize
Gets or sets the buffersize, this being the maximum amount of bytes returned by a single read operation.
(Inherited from CommsSettings.)
Public property CompareCriteria
Gets or sets a value that determines if the host name should be a consideration when comparing objects of this type.
(Inherited from CommsSettings.)
Public property CpuMilliseconds
Gets or sets a value that determines how many milliseconds thread cycle delay should be employed when used in a object of type CommsClient.
(Inherited from CommsSettings.)
Public property CpuMilliseconds2
Gets or sets a value that determines how many milliseconds thread cycle delay should be employed when used in a object of type CommsClient2.
(Inherited from CommsSettings.)
Public property DataBits
Gets or sets the data bits
Public property Filename
Gets or sets the XML file name property.
(Inherited from PersistedXML.)
Public property HandShake
Gets or sets the handshake
Public property Host
Gets or sets the Serial Port
(Overrides CommsSettingsHost.)
Public property HostIsLocalMachine
Returns true if the host resides on the local machine.
(Inherited from CommsSettings.)
Public property IsValid
Returns true if the host is assigned
(Inherited from CommsSettings.)
Public property Name
Gets or sets an optional friendly name for a configuration
(Inherited from CommsSettings.)
NextFreeSerialPortIndex
Gets the index of the next serial port index that is not in use
Public property Parity
Gets or sets the parity
Public property ReadTimeout
Gets or sets the read time out in milliseconds
(Inherited from CommsSettings.)
SaveErrorMessage
Gets an error message set if the previous Save() operation failed.
Examples
This code demonstrates how to serialise/deserialise objects to and from disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File name to serialise/deserialise to/from
        const string filename = @"c:\MyObject.xml";
        // Our PersistedXML object
        MyObject myObject = null;
        // Debug message variable
        string debug;
        // New instance of object flag
        bool newInstance;

        // Check file exists ...
        if (FileFuncs.Exists(filename))
        {
            // ... it does so deserialise the onject ...
            myObject = ((MyObject)MyObject.Open(filename, typeof(MyObject), out debug, out newInstance));
            if (null == myObject) // we have a problem!
                Console.WriteLine("Deserialisation returned NULL: " + debug);
            else
            {
                // Report instance and data deserialised to user
                Console.WriteLine(newInstance ? "A new instance was initialised." : "Data deserialised from file ok.");
                if (myObject.IsValid)
                {
                    Console.WriteLine("Name: " + myObject.Name);
                    Console.WriteLine("Number: " + myObject.Number.ToString());
                }
                else
                    Console.WriteLine("Object could not be validated.");

                if (debug.Length > 0)
                    Console.WriteLine("Debug from deserialiser reads: \"" + debug + "\"");
            }
        }
        else
        {
            // ... it doesn't so create and then serialise the onject ...
            myObject = new MyObject();
            // set some properties ...
            myObject.Name = "Fred";
            myObject.Number = 13;
            // Report object data to user
            Console.WriteLine("Name: " + myObject.Name);
            Console.WriteLine("Number: " + myObject.Number.ToString());
            // Serialise the object to disk file
            Console.WriteLine("Serialising to disk file...");
            if (myObject.Save(filename, out debug))
                // Alls well
                Console.WriteLine("Rerun this app to deserialise this object from disk file.");
            else
            {
                // Report deserialisation error
                string message = "Error serialising to disk file";
                if (myObject.SaveErrorMessage.Length > 0)
                    message += ": \"" + myObject.SaveErrorMessage + "\"";
                else if (debug.Length > 0)
                    message += ": \"" + debug + "\"";
                Console.WriteLine(message);
            }
        }

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }
}
(Inherited from PersistedXML.)
Public property StopBits
Gets or sets the stop bites
SystemSerialPorts
Gets a list of all serial ports on the system whether in use or not
Public property WriteTimeout
Gets or sets the the write time out in milliseconds
(Inherited from CommsSettings.)
Top
See Also

Reference

CommsSerialSettings Class
Bncs.Comms Namespace


CommsSerialSettings.AvailableSerialPorts Property

CommsSerialSettingsAvailableSerialPorts Property
Gets a list of available serial ports, i.e. ports not currently in use

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static List<string> AvailableSerialPorts { get; }

Property Value

Type: List String
See Also

Reference

CommsSerialSettings Class
Bncs.Comms Namespace


CommsSerialSettings.Baudrate Property

CommsSerialSettingsBaudrate Property
Gets or sets the baud rate

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Baudrate { get; set; }

Property Value

Type: Int32
See Also

Reference

CommsSerialSettings Class
Bncs.Comms Namespace


CommsSerialSettings.DataBits Property

CommsSerialSettingsDataBits Property
Gets or sets the data bits

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public DataBit DataBits { get; set; }

Property Value

Type: DataBit
See Also

Reference

CommsSerialSettings Class
Bncs.Comms Namespace


CommsSerialSettings.HandShake Property

CommsSerialSettingsHandShake Property
Gets or sets the handshake

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Handshake HandShake { get; set; }

Property Value

Type: Handshake
See Also

Reference

CommsSerialSettings Class
Bncs.Comms Namespace


CommsSerialSettings.Host Property

CommsSerialSettingsHost Property
Gets or sets the Serial Port

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string Host { get; set; }

Property Value

Type: String
See Also

Reference

CommsSerialSettings Class
Bncs.Comms Namespace


CommsSerialSettings.NextFreeSerialPortIndex Property

CommsSerialSettingsNextFreeSerialPortIndex Property
Gets the index of the next serial port index that is not in use

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static int NextFreeSerialPortIndex { get; }

Property Value

Type: Int32
See Also

Reference

CommsSerialSettings Class
Bncs.Comms Namespace


CommsSerialSettings.Parity Property

CommsSerialSettingsParity Property
Gets or sets the parity

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Parity Parity { get; set; }

Property Value

Type: Parity
See Also

Reference

CommsSerialSettings Class
Bncs.Comms Namespace


CommsSerialSettings.StopBits Property

CommsSerialSettingsStopBits Property
Gets or sets the stop bites

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public StopBits StopBits { get; set; }

Property Value

Type: StopBits
See Also

Reference

CommsSerialSettings Class
Bncs.Comms Namespace


CommsSerialSettings.SystemSerialPorts Property

CommsSerialSettingsSystemSerialPorts Property
Gets a list of all serial ports on the system whether in use or not

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static List<string> SystemSerialPorts { get; }

Property Value

Type: List String
See Also

Reference

CommsSerialSettings Class
Bncs.Comms Namespace


CommsSettings Class

CommsSettings Class
Base class for all communications settings, this class all derivitives are serialisable as they are derived from PersistedXML
Inheritance Hierarchy
SystemObject
Bncs.XMLPersistedXML
Bncs.CommsCommsSettings
Bncs.CommsCommsSerialSettings
Bncs.CommsCommsTCPSettings
Bncs.CommsCommsUDPSettings

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public abstract class CommsSettings : PersistedXML

The CommsSettings type exposes the following members.

Constructors
 | Name | Description
Public method | CommsSettings | Constructor that accepts a host setting used to set the Host property.
Top
Methods
Name Description
Public method Equals
Tests if the supplied object is equal to this.
(Overrides ObjectEquals(Object).)
Public method GetHashCode
Gets the hash code.
(Overrides ObjectGetHashCode.)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method Save
Serializes the repository to a NON-read only XML file providing that the Filename property has been set. Error information is accessable through the SaveErrorInformation property.
(Inherited from PersistedXML.)
Save(String)
Serializes the repository to a NON-read only XML file with no error information.
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}
(Inherited from PersistedXML.)
Public method Save(String, String)
Serializes the repository to a NON-read only XML file with no error information.
(Inherited from PersistedXML.)
Save(String, String)
Serializes the repository to a NON-read only XML file with error information.
Examples
This code demonstrates how to serialise/deserialise objects to and from disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File name to serialise/deserialise to/from
        const string filename = @"c:\MyObject.xml";
        // Our PersistedXML object
        MyObject myObject = null;
        // Debug message variable
        string debug;
        // New instance of object flag
        bool newInstance;

        // Check file exists ...
        if (FileFuncs.Exists(filename))
        {
            // ... it does so deserialise the onject ...
            myObject = ((MyObject)MyObject.Open(filename, typeof(MyObject), out debug, out newInstance));
            if (null == myObject) // we have a problem!
                Console.WriteLine("Deserialisation returned NULL: " + debug);
            else
            {
                // Report instance and data deserialised to user
                Console.WriteLine(newInstance ? "A new instance was initialised." : "Data deserialised from file ok.");
                if (myObject.IsValid)
                {
                    Console.WriteLine("Name: " + myObject.Name);
                    Console.WriteLine("Number: " + myObject.Number.ToString());
                }
                else
                    Console.WriteLine("Object could not be validated.");

                if (debug.Length > 0)
                    Console.WriteLine("Debug from deserialiser reads: \"" + debug + "\"");
            }
        }
        else
        {
            // ... it doesn't so create and then serialise the onject ...
            myObject = new MyObject();
            // set some properties ...
            myObject.Name = "Fred";
            myObject.Number = 13;
            // Report object data to user
            Console.WriteLine("Name: " + myObject.Name);
            Console.WriteLine("Number: " + myObject.Number.ToString());
            // Serialise the object to disk file
            Console.WriteLine("Serialising to disk file...");
            if (myObject.Save(filename, out debug))
                // Alls well
                Console.WriteLine("Rerun this app to deserialise this object from disk file.");
            else
            {
                // Report deserialisation error
                string message = "Error serialising to disk file";
                if (myObject.SaveErrorMessage.Length > 0)
                    message += ": \"" + myObject.SaveErrorMessage + "\"";
                else if (debug.Length > 0)
                    message += ": \"" + debug + "\"";
                Console.WriteLine(message);
            }
        }

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }
}
(Inherited from PersistedXML.)
Public method Save(String, String, Boolean)
Serializes the repository to an XML file with error information.
(Inherited from PersistedXML.)
Public method Save(String, String, String)
Serializes the repository to a NON-read only XML file with error information.
(Inherited from PersistedXML.)
Public method Save(String, String, Boolean, String)
Serializes the repository to an XML file with error information.
(Inherited from PersistedXML.)
Public method Save(String, String, Boolean, Boolean, String)
Serializes the repository to an XML file with error information.
(Inherited from PersistedXML.)
SaveToBuffer
Serializes the object to a buffer
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}
(Inherited from PersistedXML.)
Public method SaveToBuffer(String)
Serializes the object to a buffer
(Inherited from PersistedXML.)
Public method SaveToBuffer(String, String)
Serializes the object to a buffer
(Inherited from PersistedXML.)
Public method ToString
Returns the class as as string
(Overrides ObjectToString.)
Top
Properties
Name Description
Public property AutoReconnectSeconds
Gets or sets the auto reconnection attempt period (in seconds). The default is zero, when greater than zero a CommsClient will try every n seconds to re-establish connection to the server when the disconnect is insigated by the server.
Public property BufferSize
Gets or sets the buffersize, this being the maximum amount of bytes returned by a single read operation.
Public property CompareCriteria
Gets or sets a value that determines if the host name should be a consideration when comparing objects of this type.
Public property CpuMilliseconds
Gets or sets a value that determines how many milliseconds thread cycle delay should be employed when used in a object of type CommsClient.
Public property CpuMilliseconds2
Gets or sets a value that determines how many milliseconds thread cycle delay should be employed when used in a object of type CommsClient2.
Public property Filename
Gets or sets the XML file name property.
(Inherited from PersistedXML.)
Public property Host
Gets or sets the host, the host is the TCP/IP Server for CommsTCPSettings and the serial port for CommsSerialSeettings objects
Public property HostIsLocalMachine
Returns true if the host resides on the local machine.
Public property IsValid
Returns true if the host is assigned
Public property Name
Gets or sets an optional friendly name for a configuration
Public property ReadTimeout
Gets or sets the read time out in milliseconds
SaveErrorMessage
Gets an error message set if the previous Save() operation failed.
Examples
This code demonstrates how to serialise/deserialise objects to and from disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File name to serialise/deserialise to/from
        const string filename = @"c:\MyObject.xml";
        // Our PersistedXML object
        MyObject myObject = null;
        // Debug message variable
        string debug;
        // New instance of object flag
        bool newInstance;

        // Check file exists ...
        if (FileFuncs.Exists(filename))
        {
            // ... it does so deserialise the onject ...
            myObject = ((MyObject)MyObject.Open(filename, typeof(MyObject), out debug, out newInstance));
            if (null == myObject) // we have a problem!
                Console.WriteLine("Deserialisation returned NULL: " + debug);
            else
            {
                // Report instance and data deserialised to user
                Console.WriteLine(newInstance ? "A new instance was initialised." : "Data deserialised from file ok.");
                if (myObject.IsValid)
                {
                    Console.WriteLine("Name: " + myObject.Name);
                    Console.WriteLine("Number: " + myObject.Number.ToString());
                }
                else
                    Console.WriteLine("Object could not be validated.");

                if (debug.Length > 0)
                    Console.WriteLine("Debug from deserialiser reads: \"" + debug + "\"");
            }
        }
        else
        {
            // ... it doesn't so create and then serialise the onject ...
            myObject = new MyObject();
            // set some properties ...
            myObject.Name = "Fred";
            myObject.Number = 13;
            // Report object data to user
            Console.WriteLine("Name: " + myObject.Name);
            Console.WriteLine("Number: " + myObject.Number.ToString());
            // Serialise the object to disk file
            Console.WriteLine("Serialising to disk file...");
            if (myObject.Save(filename, out debug))
                // Alls well
                Console.WriteLine("Rerun this app to deserialise this object from disk file.");
            else
            {
                // Report deserialisation error
                string message = "Error serialising to disk file";
                if (myObject.SaveErrorMessage.Length > 0)
                    message += ": \"" + myObject.SaveErrorMessage + "\"";
                else if (debug.Length > 0)
                    message += ": \"" + debug + "\"";
                Console.WriteLine(message);
            }
        }

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }
}
(Inherited from PersistedXML.)
Public property WriteTimeout
Gets or sets the the write time out in milliseconds
Top
See Also

Reference

Bncs.Comms Namespace


CommsSettings Constructor

CommsSettings Constructor
Constructor that accepts a host setting used to set the Host property.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsSettings(
    string host_
)

Parameters

host_
Type: SystemString
Host to assign, this might be an IP address or a serial port.
See Also

Reference

CommsSettings Class
Bncs.Comms Namespace


CommsSettings Methods

CommsSettings Methods

The CommsSettings type exposes the following members.

Methods
Name Description
Public method Equals
Tests if the supplied object is equal to this.
(Overrides ObjectEquals(Object).)
Public method GetHashCode
Gets the hash code.
(Overrides ObjectGetHashCode.)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method Save
Serializes the repository to a NON-read only XML file providing that the Filename property has been set. Error information is accessable through the SaveErrorInformation property.
(Inherited from PersistedXML.)
Save(String)
Serializes the repository to a NON-read only XML file with no error information.
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}
(Inherited from PersistedXML.)
Public method Save(String, String)
Serializes the repository to a NON-read only XML file with no error information.
(Inherited from PersistedXML.)
Save(String, String)
Serializes the repository to a NON-read only XML file with error information.
Examples
This code demonstrates how to serialise/deserialise objects to and from disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File name to serialise/deserialise to/from
        const string filename = @"c:\MyObject.xml";
        // Our PersistedXML object
        MyObject myObject = null;
        // Debug message variable
        string debug;
        // New instance of object flag
        bool newInstance;

        // Check file exists ...
        if (FileFuncs.Exists(filename))
        {
            // ... it does so deserialise the onject ...
            myObject = ((MyObject)MyObject.Open(filename, typeof(MyObject), out debug, out newInstance));
            if (null == myObject) // we have a problem!
                Console.WriteLine("Deserialisation returned NULL: " + debug);
            else
            {
                // Report instance and data deserialised to user
                Console.WriteLine(newInstance ? "A new instance was initialised." : "Data deserialised from file ok.");
                if (myObject.IsValid)
                {
                    Console.WriteLine("Name: " + myObject.Name);
                    Console.WriteLine("Number: " + myObject.Number.ToString());
                }
                else
                    Console.WriteLine("Object could not be validated.");

                if (debug.Length > 0)
                    Console.WriteLine("Debug from deserialiser reads: \"" + debug + "\"");
            }
        }
        else
        {
            // ... it doesn't so create and then serialise the onject ...
            myObject = new MyObject();
            // set some properties ...
            myObject.Name = "Fred";
            myObject.Number = 13;
            // Report object data to user
            Console.WriteLine("Name: " + myObject.Name);
            Console.WriteLine("Number: " + myObject.Number.ToString());
            // Serialise the object to disk file
            Console.WriteLine("Serialising to disk file...");
            if (myObject.Save(filename, out debug))
                // Alls well
                Console.WriteLine("Rerun this app to deserialise this object from disk file.");
            else
            {
                // Report deserialisation error
                string message = "Error serialising to disk file";
                if (myObject.SaveErrorMessage.Length > 0)
                    message += ": \"" + myObject.SaveErrorMessage + "\"";
                else if (debug.Length > 0)
                    message += ": \"" + debug + "\"";
                Console.WriteLine(message);
            }
        }

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }
}
(Inherited from PersistedXML.)
Public method Save(String, String, Boolean)
Serializes the repository to an XML file with error information.
(Inherited from PersistedXML.)
Public method Save(String, String, String)
Serializes the repository to a NON-read only XML file with error information.
(Inherited from PersistedXML.)
Public method Save(String, String, Boolean, String)
Serializes the repository to an XML file with error information.
(Inherited from PersistedXML.)
Public method Save(String, String, Boolean, Boolean, String)
Serializes the repository to an XML file with error information.
(Inherited from PersistedXML.)
SaveToBuffer
Serializes the object to a buffer
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}
(Inherited from PersistedXML.)
Public method SaveToBuffer(String)
Serializes the object to a buffer
(Inherited from PersistedXML.)
Public method SaveToBuffer(String, String)
Serializes the object to a buffer
(Inherited from PersistedXML.)
Public method ToString
Returns the class as as string
(Overrides ObjectToString.)
Top
See Also

Reference

CommsSettings Class
Bncs.Comms Namespace


CommsSettings.Equals Method

CommsSettingsEquals Method
Tests if the supplied object is equal to this.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override bool Equals(
    Object obj
)

Parameters

obj
Type: SystemObject
Object to test

Return Value

Type: Boolean
True if equal
See Also

Reference

CommsSettings Class
Bncs.Comms Namespace


CommsSettings.GetHashCode Method

CommsSettingsGetHashCode Method
Gets the hash code.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override int GetHashCode()

Return Value

Type: Int32
Hash code
See Also

Reference

CommsSettings Class
Bncs.Comms Namespace


CommsSettings.ToString Method

CommsSettingsToString Method
Returns the class as as string

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
The Host property.
See Also

Reference

CommsSettings Class
Bncs.Comms Namespace


CommsSettings Properties

CommsSettings Properties

The CommsSettings type exposes the following members.

Properties
Name Description
Public property AutoReconnectSeconds
Gets or sets the auto reconnection attempt period (in seconds). The default is zero, when greater than zero a CommsClient will try every n seconds to re-establish connection to the server when the disconnect is insigated by the server.
Public property BufferSize
Gets or sets the buffersize, this being the maximum amount of bytes returned by a single read operation.
Public property CompareCriteria
Gets or sets a value that determines if the host name should be a consideration when comparing objects of this type.
Public property CpuMilliseconds
Gets or sets a value that determines how many milliseconds thread cycle delay should be employed when used in a object of type CommsClient.
Public property CpuMilliseconds2
Gets or sets a value that determines how many milliseconds thread cycle delay should be employed when used in a object of type CommsClient2.
Public property Filename
Gets or sets the XML file name property.
(Inherited from PersistedXML.)
Public property Host
Gets or sets the host, the host is the TCP/IP Server for CommsTCPSettings and the serial port for CommsSerialSeettings objects
Public property HostIsLocalMachine
Returns true if the host resides on the local machine.
Public property IsValid
Returns true if the host is assigned
Public property Name
Gets or sets an optional friendly name for a configuration
Public property ReadTimeout
Gets or sets the read time out in milliseconds
SaveErrorMessage
Gets an error message set if the previous Save() operation failed.
Examples
This code demonstrates how to serialise/deserialise objects to and from disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File name to serialise/deserialise to/from
        const string filename = @"c:\MyObject.xml";
        // Our PersistedXML object
        MyObject myObject = null;
        // Debug message variable
        string debug;
        // New instance of object flag
        bool newInstance;

        // Check file exists ...
        if (FileFuncs.Exists(filename))
        {
            // ... it does so deserialise the onject ...
            myObject = ((MyObject)MyObject.Open(filename, typeof(MyObject), out debug, out newInstance));
            if (null == myObject) // we have a problem!
                Console.WriteLine("Deserialisation returned NULL: " + debug);
            else
            {
                // Report instance and data deserialised to user
                Console.WriteLine(newInstance ? "A new instance was initialised." : "Data deserialised from file ok.");
                if (myObject.IsValid)
                {
                    Console.WriteLine("Name: " + myObject.Name);
                    Console.WriteLine("Number: " + myObject.Number.ToString());
                }
                else
                    Console.WriteLine("Object could not be validated.");

                if (debug.Length > 0)
                    Console.WriteLine("Debug from deserialiser reads: \"" + debug + "\"");
            }
        }
        else
        {
            // ... it doesn't so create and then serialise the onject ...
            myObject = new MyObject();
            // set some properties ...
            myObject.Name = "Fred";
            myObject.Number = 13;
            // Report object data to user
            Console.WriteLine("Name: " + myObject.Name);
            Console.WriteLine("Number: " + myObject.Number.ToString());
            // Serialise the object to disk file
            Console.WriteLine("Serialising to disk file...");
            if (myObject.Save(filename, out debug))
                // Alls well
                Console.WriteLine("Rerun this app to deserialise this object from disk file.");
            else
            {
                // Report deserialisation error
                string message = "Error serialising to disk file";
                if (myObject.SaveErrorMessage.Length > 0)
                    message += ": \"" + myObject.SaveErrorMessage + "\"";
                else if (debug.Length > 0)
                    message += ": \"" + debug + "\"";
                Console.WriteLine(message);
            }
        }

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }
}
(Inherited from PersistedXML.)
Public property WriteTimeout
Gets or sets the the write time out in milliseconds
Top
See Also

Reference

CommsSettings Class
Bncs.Comms Namespace


CommsSettings.AutoReconnectSeconds Property

CommsSettingsAutoReconnectSeconds Property
Gets or sets the auto reconnection attempt period (in seconds). The default is zero, when greater than zero a CommsClient will try every n seconds to re-establish connection to the server when the disconnect is insigated by the server.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint AutoReconnectSeconds { get; set; }

Property Value

Type: UInt32
See Also

Reference

CommsSettings Class
Bncs.Comms Namespace


CommsSettings.BufferSize Property

CommsSettingsBufferSize Property
Gets or sets the buffersize, this being the maximum amount of bytes returned by a single read operation.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int BufferSize { get; set; }

Property Value

Type: Int32
See Also

Reference

CommsSettings Class
Bncs.Comms Namespace


CommsSettings.CompareCriteria Property

CommsSettingsCompareCriteria Property
Gets or sets a value that determines if the host name should be a consideration when comparing objects of this type.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsSettingsCompareCriteria CompareCriteria { get; set; }

Property Value

Type: CommsSettingsCompareCriteria
See Also

Reference

CommsSettings Class
Bncs.Comms Namespace


CommsSettings.CpuMilliseconds Property

CommsSettingsCpuMilliseconds Property
Gets or sets a value that determines how many milliseconds thread cycle delay should be employed when used in a object of type CommsClient.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint CpuMilliseconds { get; set; }

Property Value

Type: UInt32
See Also

Reference

CommsSettings Class
Bncs.Comms Namespace


CommsSettings.CpuMilliseconds2 Property

CommsSettingsCpuMilliseconds2 Property
Gets or sets a value that determines how many milliseconds thread cycle delay should be employed when used in a object of type CommsClient2.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint CpuMilliseconds2 { get; set; }

Property Value

Type: UInt32
See Also

Reference

CommsSettings Class
Bncs.Comms Namespace


CommsSettings.Host Property

CommsSettingsHost Property
Gets or sets the host, the host is the TCP/IP Server for CommsTCPSettings and the serial port for CommsSerialSeettings objects

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public virtual string Host { get; set; }

Property Value

Type: String
See Also

Reference

CommsSettings Class
Bncs.Comms Namespace


CommsSettings.HostIsLocalMachine Property

CommsSettingsHostIsLocalMachine Property
Returns true if the host resides on the local machine.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool HostIsLocalMachine { get; }

Property Value

Type: Boolean
See Also

Reference

CommsSettings Class
Bncs.Comms Namespace


CommsSettings.IsValid Property

CommsSettingsIsValid Property
Returns true if the host is assigned

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public virtual bool IsValid { get; }

Property Value

Type: Boolean
See Also

Reference

CommsSettings Class
Bncs.Comms Namespace


CommsSettings.Name Property

CommsSettingsName Property
Gets or sets an optional friendly name for a configuration

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Name { get; set; }

Property Value

Type: String
See Also

Reference

CommsSettings Class
Bncs.Comms Namespace


CommsSettings.ReadTimeout Property

CommsSettingsReadTimeout Property
Gets or sets the read time out in milliseconds

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int ReadTimeout { get; set; }

Property Value

Type: Int32
See Also

Reference

CommsSettings Class
Bncs.Comms Namespace


CommsSettings.WriteTimeout Property

CommsSettingsWriteTimeout Property
Gets or sets the the write time out in milliseconds

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int WriteTimeout { get; set; }

Property Value

Type: Int32
See Also

Reference

CommsSettings Class
Bncs.Comms Namespace


CommsSettingsCompareCriteria Enumeration

CommsSettingsCompareCriteria Enumeration
Enumeration that dictates whether the host name should be a part of the comparison criteria when comparing objects of type CommsSettings.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum CommsSettingsCompareCriteria
Members
Member name | Value | Description
IgnoreName | 0 | When comparing two CommsSettings instances the name is ignored when running the comparison.
IncludeName | 1 | When comparing two CommsSettings instances the name is included when running the comparison.
See Also

Reference

Bncs.Comms Namespace


CommsTCPSettings Class

CommsTCPSettings Class
Serialisable communications settings for TCP connections.
Inheritance Hierarchy
SystemObject
Bncs.XMLPersistedXML
Bncs.CommsCommsSettings
Bncs.CommsCommsTCPSettings

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class CommsTCPSettings : CommsSettings

The CommsTCPSettings type exposes the following members.

Constructors
Name Description
Public method CommsTCPSettings
Default constructor.
Public method CommsTCPSettings(String)
Constructor that sets the host.
CommsTCPSettings(UInt32)
Constructor that sets the auto reconnect seconds only.
Examples
This sample shows how to create an object of type CommsTCPSettings and use it to instantiate a CommsClient object.
Copy
class Program
{
    static void Main()
    {
        // Create settings specifying the host, port and auto reconnect time
        CommsTCPSettings tcpSettings = new CommsTCPSettings("192.168.1.1", 8090, 10);
        // Use the settings to create a client
        CommsClient client = new CommsClient(tcpSettings);
        // Attempt connection to server
        if (true == client.Connect())
            Console.WriteLine("Connected to the server at " + tcpSettings.ToString());
        else
            Console.WriteLine("Failed to connect to the server at " + tcpSettings.ToString());

        // Wait for user input
        Console.ReadKey();

        // Disconnect from server
        if (client.IsConnected)
            client.Disconnect();
    }
}
Public method CommsTCPSettings(String, Int32)
Constructor that sets the host and port.
Public method CommsTCPSettings(String, Int32, UInt32)
Constructor that sets the host, port and auto reconnect seconds.
Public method CommsTCPSettings(String, Int32, UInt32, Boolean)
Constructor that sets the host, port, auto reconnect seconds and naggle flag.
Top
Methods
Name Description
Public method Equals
Tests if this is equal to the object supplied.
(Overrides CommsSettingsEquals(Object).)
Public method GetHashCode
Gets the hash code.
(Overrides CommsSettingsGetHashCode.)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method Save
Serializes the repository to a NON-read only XML file providing that the Filename property has been set. Error information is accessable through the SaveErrorInformation property.
(Inherited from PersistedXML.)
Save(String)
Serializes the repository to a NON-read only XML file with no error information.
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}
(Inherited from PersistedXML.)
Public method Save(String, String)
Serializes the repository to a NON-read only XML file with no error information.
(Inherited from PersistedXML.)
Save(String, String)
Serializes the repository to a NON-read only XML file with error information.
Examples
This code demonstrates how to serialise/deserialise objects to and from disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File name to serialise/deserialise to/from
        const string filename = @"c:\MyObject.xml";
        // Our PersistedXML object
        MyObject myObject = null;
        // Debug message variable
        string debug;
        // New instance of object flag
        bool newInstance;

        // Check file exists ...
        if (FileFuncs.Exists(filename))
        {
            // ... it does so deserialise the onject ...
            myObject = ((MyObject)MyObject.Open(filename, typeof(MyObject), out debug, out newInstance));
            if (null == myObject) // we have a problem!
                Console.WriteLine("Deserialisation returned NULL: " + debug);
            else
            {
                // Report instance and data deserialised to user
                Console.WriteLine(newInstance ? "A new instance was initialised." : "Data deserialised from file ok.");
                if (myObject.IsValid)
                {
                    Console.WriteLine("Name: " + myObject.Name);
                    Console.WriteLine("Number: " + myObject.Number.ToString());
                }
                else
                    Console.WriteLine("Object could not be validated.");

                if (debug.Length > 0)
                    Console.WriteLine("Debug from deserialiser reads: \"" + debug + "\"");
            }
        }
        else
        {
            // ... it doesn't so create and then serialise the onject ...
            myObject = new MyObject();
            // set some properties ...
            myObject.Name = "Fred";
            myObject.Number = 13;
            // Report object data to user
            Console.WriteLine("Name: " + myObject.Name);
            Console.WriteLine("Number: " + myObject.Number.ToString());
            // Serialise the object to disk file
            Console.WriteLine("Serialising to disk file...");
            if (myObject.Save(filename, out debug))
                // Alls well
                Console.WriteLine("Rerun this app to deserialise this object from disk file.");
            else
            {
                // Report deserialisation error
                string message = "Error serialising to disk file";
                if (myObject.SaveErrorMessage.Length > 0)
                    message += ": \"" + myObject.SaveErrorMessage + "\"";
                else if (debug.Length > 0)
                    message += ": \"" + debug + "\"";
                Console.WriteLine(message);
            }
        }

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }
}
(Inherited from PersistedXML.)
Public method Save(String, String, Boolean)
Serializes the repository to an XML file with error information.
(Inherited from PersistedXML.)
Public method Save(String, String, String)
Serializes the repository to a NON-read only XML file with error information.
(Inherited from PersistedXML.)
Public method Save(String, String, Boolean, String)
Serializes the repository to an XML file with error information.
(Inherited from PersistedXML.)
Public method Save(String, String, Boolean, Boolean, String)
Serializes the repository to an XML file with error information.
(Inherited from PersistedXML.)
SaveToBuffer
Serializes the object to a buffer
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}
(Inherited from PersistedXML.)
Public method SaveToBuffer(String)
Serializes the object to a buffer
(Inherited from PersistedXML.)
Public method SaveToBuffer(String, String)
Serializes the object to a buffer
(Inherited from PersistedXML.)
Public method ToString
Returns the class as a string.
(Overrides CommsSettingsToString.)
Top
Properties
Name Description
Public property AutoReconnectSeconds
Gets or sets the auto reconnection attempt period (in seconds). The default is zero, when greater than zero a CommsClient will try every n seconds to re-establish connection to the server when the disconnect is insigated by the server.
(Inherited from CommsSettings.)
Public property BufferSize
Gets or sets the buffersize, this being the maximum amount of bytes returned by a single read operation.
(Inherited from CommsSettings.)
Public property CompareCriteria
Gets or sets a value that determines if the host name should be a consideration when comparing objects of this type.
(Inherited from CommsSettings.)
Public property CpuMilliseconds
Gets or sets a value that determines how many milliseconds thread cycle delay should be employed when used in a object of type CommsClient.
(Inherited from CommsSettings.)
Public property CpuMilliseconds2
Gets or sets a value that determines how many milliseconds thread cycle delay should be employed when used in a object of type CommsClient2.
(Inherited from CommsSettings.)
Public property Filename
Gets or sets the XML file name property.
(Inherited from PersistedXML.)
Public property Host
Gets or sets the TCP Server address
(Overrides CommsSettingsHost.)
Public property HostIsLocalMachine
Returns true if the host resides on the local machine.
(Inherited from CommsSettings.)
Public property IsValid
Returns true if rhe host is set and the port is greater than zero
(Overrides CommsSettingsIsValid.)
Public property Name
Gets or sets an optional friendly name for a configuration
(Inherited from CommsSettings.)
Public property Port
Gets or sets the TCP port number
Public property ReadTimeout
Gets or sets the read time out in milliseconds
(Inherited from CommsSettings.)
SaveErrorMessage
Gets an error message set if the previous Save() operation failed.
Examples
This code demonstrates how to serialise/deserialise objects to and from disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File name to serialise/deserialise to/from
        const string filename = @"c:\MyObject.xml";
        // Our PersistedXML object
        MyObject myObject = null;
        // Debug message variable
        string debug;
        // New instance of object flag
        bool newInstance;

        // Check file exists ...
        if (FileFuncs.Exists(filename))
        {
            // ... it does so deserialise the onject ...
            myObject = ((MyObject)MyObject.Open(filename, typeof(MyObject), out debug, out newInstance));
            if (null == myObject) // we have a problem!
                Console.WriteLine("Deserialisation returned NULL: " + debug);
            else
            {
                // Report instance and data deserialised to user
                Console.WriteLine(newInstance ? "A new instance was initialised." : "Data deserialised from file ok.");
                if (myObject.IsValid)
                {
                    Console.WriteLine("Name: " + myObject.Name);
                    Console.WriteLine("Number: " + myObject.Number.ToString());
                }
                else
                    Console.WriteLine("Object could not be validated.");

                if (debug.Length > 0)
                    Console.WriteLine("Debug from deserialiser reads: \"" + debug + "\"");
            }
        }
        else
        {
            // ... it doesn't so create and then serialise the onject ...
            myObject = new MyObject();
            // set some properties ...
            myObject.Name = "Fred";
            myObject.Number = 13;
            // Report object data to user
            Console.WriteLine("Name: " + myObject.Name);
            Console.WriteLine("Number: " + myObject.Number.ToString());
            // Serialise the object to disk file
            Console.WriteLine("Serialising to disk file...");
            if (myObject.Save(filename, out debug))
                // Alls well
                Console.WriteLine("Rerun this app to deserialise this object from disk file.");
            else
            {
                // Report deserialisation error
                string message = "Error serialising to disk file";
                if (myObject.SaveErrorMessage.Length > 0)
                    message += ": \"" + myObject.SaveErrorMessage + "\"";
                else if (debug.Length > 0)
                    message += ": \"" + debug + "\"";
                Console.WriteLine(message);
            }
        }

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }
}
(Inherited from PersistedXML.)
Public property UseNagleAlgorithim
Gets or sets a value that dictates whether the connection will use the Nagle algorithim. The Nagle algorithm is designed to reduce network traffic by causing the socket to buffer small packets and then combine and send them in one packet under certain circumstances. The majority of network applications should use the Nagle algorithm, therefore it's default value is true.
Public property WriteTimeout
Gets or sets the the write time out in milliseconds
(Inherited from CommsSettings.)
Top
See Also

Reference

Bncs.Comms Namespace


CommsTCPSettings Constructor

CommsTCPSettings Constructor
Overload List
Name Description
Public method CommsTCPSettings
Default constructor.
Public method CommsTCPSettings(String)
Constructor that sets the host.
CommsTCPSettings(UInt32)
Constructor that sets the auto reconnect seconds only.
Examples
This sample shows how to create an object of type CommsTCPSettings and use it to instantiate a CommsClient object.
Copy
class Program
{
    static void Main()
    {
        // Create settings specifying the host, port and auto reconnect time
        CommsTCPSettings tcpSettings = new CommsTCPSettings("192.168.1.1", 8090, 10);
        // Use the settings to create a client
        CommsClient client = new CommsClient(tcpSettings);
        // Attempt connection to server
        if (true == client.Connect())
            Console.WriteLine("Connected to the server at " + tcpSettings.ToString());
        else
            Console.WriteLine("Failed to connect to the server at " + tcpSettings.ToString());

        // Wait for user input
        Console.ReadKey();

        // Disconnect from server
        if (client.IsConnected)
            client.Disconnect();
    }
}
Public method CommsTCPSettings(String, Int32)
Constructor that sets the host and port.
Public method CommsTCPSettings(String, Int32, UInt32)
Constructor that sets the host, port and auto reconnect seconds.
Public method CommsTCPSettings(String, Int32, UInt32, Boolean)
Constructor that sets the host, port, auto reconnect seconds and naggle flag.
Top
See Also

Reference

CommsTCPSettings Class
Bncs.Comms Namespace


CommsTCPSettings Constructor

CommsTCPSettings Constructor
Default constructor.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsTCPSettings()
See Also

Reference

CommsTCPSettings Class
CommsTCPSettings Overload
Bncs.Comms Namespace


CommsTCPSettings Constructor (String)

CommsTCPSettings Constructor (String)
Constructor that sets the host.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsTCPSettings(
    string host_
)

Parameters

host_
Type: SystemString
Address of TCP server.
See Also

Reference

CommsTCPSettings Class
CommsTCPSettings Overload
Bncs.Comms Namespace


CommsTCPSettings Constructor (UInt32)

CommsTCPSettings Constructor (UInt32)
Constructor that sets the auto reconnect seconds only.
Examples
This sample shows how to create an object of type CommsTCPSettings and use it to instantiate a CommsClient object.
Copy
class Program
{
    static void Main()
    {
        // Create settings specifying the host, port and auto reconnect time
        CommsTCPSettings tcpSettings = new CommsTCPSettings("192.168.1.1", 8090, 10);
        // Use the settings to create a client
        CommsClient client = new CommsClient(tcpSettings);
        // Attempt connection to server
        if (true == client.Connect())
            Console.WriteLine("Connected to the server at " + tcpSettings.ToString());
        else
            Console.WriteLine("Failed to connect to the server at " + tcpSettings.ToString());

        // Wait for user input
        Console.ReadKey();

        // Disconnect from server
        if (client.IsConnected)
            client.Disconnect();
    }
}

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsTCPSettings(
    uint autoRecconectSeconds_
)

Parameters

autoRecconectSeconds_
Type: SystemUInt32
Number of seconds to elapse before re-attempting auto connect after a server instigated disconnection.
See Also

Reference

CommsTCPSettings Class
CommsTCPSettings Overload
Bncs.Comms Namespace


CommsTCPSettings Constructor (String, Int32)

CommsTCPSettings Constructor (String, Int32)
Constructor that sets the host and port.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsTCPSettings(
    string host_,
    int port_
)

Parameters

host_
Type: SystemString
Address of TCP server.
port_
Type: SystemInt32
TCP server port.
See Also

Reference

CommsTCPSettings Class
CommsTCPSettings Overload
Bncs.Comms Namespace


CommsTCPSettings Constructor (String, Int32, UInt32)

CommsTCPSettings Constructor (String, Int32, UInt32)
Constructor that sets the host, port and auto reconnect seconds.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsTCPSettings(
    string host_,
    int port_,
    uint autoRecconectSeconds_
)

Parameters

host_
Type: SystemString
Address of TCP server.
port_
Type: SystemInt32
TCP server port.
autoRecconectSeconds_
Type: SystemUInt32
Number of seconds to elapse before re-attempting auto connect after a server instigated disconnection.
See Also

Reference

CommsTCPSettings Class
CommsTCPSettings Overload
Bncs.Comms Namespace


CommsTCPSettings Constructor (String, Int32, UInt32, Boolean)

CommsTCPSettings Constructor (String, Int32, UInt32, Boolean)
Constructor that sets the host, port, auto reconnect seconds and naggle flag.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsTCPSettings(
    string host_,
    int port_,
    uint autoRecconectSeconds_,
    bool useNagleAlgorithim_
)

Parameters

host_
Type: SystemString
Address of TCP server.
port_
Type: SystemInt32
TCP server port.
autoRecconectSeconds_
Type: SystemUInt32
Number of seconds to elapse before re-attempting auto connect after a server instigated disconnection.
useNagleAlgorithim_
Type: SystemBoolean
Naggle flag
See Also

Reference

CommsTCPSettings Class
CommsTCPSettings Overload
Bncs.Comms Namespace


CommsTCPSettings Methods

CommsTCPSettings Methods

The CommsTCPSettings type exposes the following members.

Methods
Name Description
Public method Equals
Tests if this is equal to the object supplied.
(Overrides CommsSettingsEquals(Object).)
Public method GetHashCode
Gets the hash code.
(Overrides CommsSettingsGetHashCode.)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method Save
Serializes the repository to a NON-read only XML file providing that the Filename property has been set. Error information is accessable through the SaveErrorInformation property.
(Inherited from PersistedXML.)
Save(String)
Serializes the repository to a NON-read only XML file with no error information.
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}
(Inherited from PersistedXML.)
Public method Save(String, String)
Serializes the repository to a NON-read only XML file with no error information.
(Inherited from PersistedXML.)
Save(String, String)
Serializes the repository to a NON-read only XML file with error information.
Examples
This code demonstrates how to serialise/deserialise objects to and from disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File name to serialise/deserialise to/from
        const string filename = @"c:\MyObject.xml";
        // Our PersistedXML object
        MyObject myObject = null;
        // Debug message variable
        string debug;
        // New instance of object flag
        bool newInstance;

        // Check file exists ...
        if (FileFuncs.Exists(filename))
        {
            // ... it does so deserialise the onject ...
            myObject = ((MyObject)MyObject.Open(filename, typeof(MyObject), out debug, out newInstance));
            if (null == myObject) // we have a problem!
                Console.WriteLine("Deserialisation returned NULL: " + debug);
            else
            {
                // Report instance and data deserialised to user
                Console.WriteLine(newInstance ? "A new instance was initialised." : "Data deserialised from file ok.");
                if (myObject.IsValid)
                {
                    Console.WriteLine("Name: " + myObject.Name);
                    Console.WriteLine("Number: " + myObject.Number.ToString());
                }
                else
                    Console.WriteLine("Object could not be validated.");

                if (debug.Length > 0)
                    Console.WriteLine("Debug from deserialiser reads: \"" + debug + "\"");
            }
        }
        else
        {
            // ... it doesn't so create and then serialise the onject ...
            myObject = new MyObject();
            // set some properties ...
            myObject.Name = "Fred";
            myObject.Number = 13;
            // Report object data to user
            Console.WriteLine("Name: " + myObject.Name);
            Console.WriteLine("Number: " + myObject.Number.ToString());
            // Serialise the object to disk file
            Console.WriteLine("Serialising to disk file...");
            if (myObject.Save(filename, out debug))
                // Alls well
                Console.WriteLine("Rerun this app to deserialise this object from disk file.");
            else
            {
                // Report deserialisation error
                string message = "Error serialising to disk file";
                if (myObject.SaveErrorMessage.Length > 0)
                    message += ": \"" + myObject.SaveErrorMessage + "\"";
                else if (debug.Length > 0)
                    message += ": \"" + debug + "\"";
                Console.WriteLine(message);
            }
        }

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }
}
(Inherited from PersistedXML.)
Public method Save(String, String, Boolean)
Serializes the repository to an XML file with error information.
(Inherited from PersistedXML.)
Public method Save(String, String, String)
Serializes the repository to a NON-read only XML file with error information.
(Inherited from PersistedXML.)
Public method Save(String, String, Boolean, String)
Serializes the repository to an XML file with error information.
(Inherited from PersistedXML.)
Public method Save(String, String, Boolean, Boolean, String)
Serializes the repository to an XML file with error information.
(Inherited from PersistedXML.)
SaveToBuffer
Serializes the object to a buffer
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}
(Inherited from PersistedXML.)
Public method SaveToBuffer(String)
Serializes the object to a buffer
(Inherited from PersistedXML.)
Public method SaveToBuffer(String, String)
Serializes the object to a buffer
(Inherited from PersistedXML.)
Public method ToString
Returns the class as a string.
(Overrides CommsSettingsToString.)
Top
See Also

Reference

CommsTCPSettings Class
Bncs.Comms Namespace


CommsTCPSettings.Equals Method

CommsTCPSettingsEquals Method
Tests if this is equal to the object supplied.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override bool Equals(
    Object obj
)

Parameters

obj
Type: SystemObject
Object to test

Return Value

Type: Boolean
True if both are equal.
See Also

Reference

CommsTCPSettings Class
Bncs.Comms Namespace


CommsTCPSettings.GetHashCode Method

CommsTCPSettingsGetHashCode Method
Gets the hash code.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override int GetHashCode()

Return Value

Type: Int32
Hash code
See Also

Reference

CommsTCPSettings Class
Bncs.Comms Namespace


CommsTCPSettings.ToString Method

CommsTCPSettingsToString Method
Returns the class as a string.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
Host and port
See Also

Reference

CommsTCPSettings Class
Bncs.Comms Namespace


CommsTCPSettings Properties

CommsTCPSettings Properties

The CommsTCPSettings type exposes the following members.

Properties
Name Description
Public property AutoReconnectSeconds
Gets or sets the auto reconnection attempt period (in seconds). The default is zero, when greater than zero a CommsClient will try every n seconds to re-establish connection to the server when the disconnect is insigated by the server.
(Inherited from CommsSettings.)
Public property BufferSize
Gets or sets the buffersize, this being the maximum amount of bytes returned by a single read operation.
(Inherited from CommsSettings.)
Public property CompareCriteria
Gets or sets a value that determines if the host name should be a consideration when comparing objects of this type.
(Inherited from CommsSettings.)
Public property CpuMilliseconds
Gets or sets a value that determines how many milliseconds thread cycle delay should be employed when used in a object of type CommsClient.
(Inherited from CommsSettings.)
Public property CpuMilliseconds2
Gets or sets a value that determines how many milliseconds thread cycle delay should be employed when used in a object of type CommsClient2.
(Inherited from CommsSettings.)
Public property Filename
Gets or sets the XML file name property.
(Inherited from PersistedXML.)
Public property Host
Gets or sets the TCP Server address
(Overrides CommsSettingsHost.)
Public property HostIsLocalMachine
Returns true if the host resides on the local machine.
(Inherited from CommsSettings.)
Public property IsValid
Returns true if rhe host is set and the port is greater than zero
(Overrides CommsSettingsIsValid.)
Public property Name
Gets or sets an optional friendly name for a configuration
(Inherited from CommsSettings.)
Public property Port
Gets or sets the TCP port number
Public property ReadTimeout
Gets or sets the read time out in milliseconds
(Inherited from CommsSettings.)
SaveErrorMessage
Gets an error message set if the previous Save() operation failed.
Examples
This code demonstrates how to serialise/deserialise objects to and from disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File name to serialise/deserialise to/from
        const string filename = @"c:\MyObject.xml";
        // Our PersistedXML object
        MyObject myObject = null;
        // Debug message variable
        string debug;
        // New instance of object flag
        bool newInstance;

        // Check file exists ...
        if (FileFuncs.Exists(filename))
        {
            // ... it does so deserialise the onject ...
            myObject = ((MyObject)MyObject.Open(filename, typeof(MyObject), out debug, out newInstance));
            if (null == myObject) // we have a problem!
                Console.WriteLine("Deserialisation returned NULL: " + debug);
            else
            {
                // Report instance and data deserialised to user
                Console.WriteLine(newInstance ? "A new instance was initialised." : "Data deserialised from file ok.");
                if (myObject.IsValid)
                {
                    Console.WriteLine("Name: " + myObject.Name);
                    Console.WriteLine("Number: " + myObject.Number.ToString());
                }
                else
                    Console.WriteLine("Object could not be validated.");

                if (debug.Length > 0)
                    Console.WriteLine("Debug from deserialiser reads: \"" + debug + "\"");
            }
        }
        else
        {
            // ... it doesn't so create and then serialise the onject ...
            myObject = new MyObject();
            // set some properties ...
            myObject.Name = "Fred";
            myObject.Number = 13;
            // Report object data to user
            Console.WriteLine("Name: " + myObject.Name);
            Console.WriteLine("Number: " + myObject.Number.ToString());
            // Serialise the object to disk file
            Console.WriteLine("Serialising to disk file...");
            if (myObject.Save(filename, out debug))
                // Alls well
                Console.WriteLine("Rerun this app to deserialise this object from disk file.");
            else
            {
                // Report deserialisation error
                string message = "Error serialising to disk file";
                if (myObject.SaveErrorMessage.Length > 0)
                    message += ": \"" + myObject.SaveErrorMessage + "\"";
                else if (debug.Length > 0)
                    message += ": \"" + debug + "\"";
                Console.WriteLine(message);
            }
        }

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }
}
(Inherited from PersistedXML.)
Public property UseNagleAlgorithim
Gets or sets a value that dictates whether the connection will use the Nagle algorithim. The Nagle algorithm is designed to reduce network traffic by causing the socket to buffer small packets and then combine and send them in one packet under certain circumstances. The majority of network applications should use the Nagle algorithm, therefore it's default value is true.
Public property WriteTimeout
Gets or sets the the write time out in milliseconds
(Inherited from CommsSettings.)
Top
See Also

Reference

CommsTCPSettings Class
Bncs.Comms Namespace


CommsTCPSettings.Host Property

CommsTCPSettingsHost Property
Gets or sets the TCP Server address

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string Host { get; set; }

Property Value

Type: String
See Also

Reference

CommsTCPSettings Class
Bncs.Comms Namespace


CommsTCPSettings.IsValid Property

CommsTCPSettingsIsValid Property
Returns true if rhe host is set and the port is greater than zero

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override bool IsValid { get; }

Property Value

Type: Boolean
See Also

Reference

CommsTCPSettings Class
Bncs.Comms Namespace


CommsTCPSettings.Port Property

CommsTCPSettingsPort Property
Gets or sets the TCP port number

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Port { get; set; }

Property Value

Type: Int32
See Also

Reference

CommsTCPSettings Class
Bncs.Comms Namespace


CommsTCPSettings.UseNagleAlgorithim Property

CommsTCPSettingsUseNagleAlgorithim Property
Gets or sets a value that dictates whether the connection will use the Nagle algorithim. The Nagle algorithm is designed to reduce network traffic by causing the socket to buffer small packets and then combine and send them in one packet under certain circumstances. The majority of network applications should use the Nagle algorithm, therefore it's default value is true.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool UseNagleAlgorithim { get; set; }

Property Value

Type: Boolean
See Also

Reference

CommsTCPSettings Class
Bncs.Comms Namespace


CommsThroughput Class

CommsThroughput Class
Helper class for recording data throughput volumes in a TxRxCommsThroughput. instance.
Inheritance Hierarchy
SystemObject
Bncs.CommsCommsThroughput

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class CommsThroughput

The CommsThroughput type exposes the following members.

Constructors
 | Name | Description
Public method | CommsThroughput | Default constructor using a bits per second measurment.
Public method | CommsThroughput(Measurement) | Constructor accepting an argument of type Measurement.
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | NotifyThroughput | Notifies the instance of an amount of throughput.
Public method | Reset | Resets totals
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | Active | Returns true when active.
Public property | Measurement | Gets or sets the measuremnt type.
Public property | Peak | Returns the peak
Public property | Total | Returns the total.
Top
Events
 | Name | Description
Public event | OnPersecondChange | Event handler that fires on change.
Top
See Also

Reference

Bncs.Comms Namespace


CommsThroughput Constructor

CommsThroughput Constructor
Overload List
 | Name | Description
Public method | CommsThroughput | Default constructor using a bits per second measurment.
Public method | CommsThroughput(Measurement) | Constructor accepting an argument of type Measurement.
Top
See Also

Reference

CommsThroughput Class
Bncs.Comms Namespace


CommsThroughput Constructor

CommsThroughput Constructor
Default constructor using a bits per second measurment.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsThroughput()
See Also

Reference

CommsThroughput Class
CommsThroughput Overload
Bncs.Comms Namespace


CommsThroughput Constructor (Measurement)

CommsThroughput Constructor (Measurement)
Constructor accepting an argument of type Measurement.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsThroughput(
    Measurement measurement_
)

Parameters

measurement_
Type: Bncs.CommsMeasurement
Initialises either bits or packets per second
See Also

Reference

CommsThroughput Class
CommsThroughput Overload
Bncs.Comms Namespace


CommsThroughput Methods

CommsThroughput Methods

The CommsThroughput type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | NotifyThroughput | Notifies the instance of an amount of throughput.
Public method | Reset | Resets totals
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

CommsThroughput Class
Bncs.Comms Namespace


CommsThroughput.NotifyThroughput Method

CommsThroughputNotifyThroughput Method
Notifies the instance of an amount of throughput.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void NotifyThroughput(
    ulong count_
)

Parameters

count_
Type: SystemUInt64
Amount of packets or bits per second
See Also

Reference

CommsThroughput Class
Bncs.Comms Namespace


CommsThroughput.Reset Method

CommsThroughputReset Method
Resets totals

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Reset()
See Also

Reference

CommsThroughput Class
Bncs.Comms Namespace


CommsThroughput Properties

CommsThroughput Properties

The CommsThroughput type exposes the following members.

Properties
 | Name | Description
Public property | Active | Returns true when active.
Public property | Measurement | Gets or sets the measuremnt type.
Public property | Peak | Returns the peak
Public property | Total | Returns the total.
Top
See Also

Reference

CommsThroughput Class
Bncs.Comms Namespace


CommsThroughput.Active Property

CommsThroughputActive Property
Returns true when active.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Active { get; set; }

Property Value

Type: Boolean
See Also

Reference

CommsThroughput Class
Bncs.Comms Namespace


CommsThroughput.Measurement Property

CommsThroughputMeasurement Property
Gets or sets the measuremnt type.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Measurement Measurement { get; set; }

Property Value

Type: Measurement
See Also

Reference

CommsThroughput Class
Bncs.Comms Namespace


CommsThroughput.Peak Property

CommsThroughputPeak Property
Returns the peak

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ulong Peak { get; }

Property Value

Type: UInt64
See Also

Reference

CommsThroughput Class
Bncs.Comms Namespace


CommsThroughput.Total Property

CommsThroughputTotal Property
Returns the total.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ulong Total { get; }

Property Value

Type: UInt64
See Also

Reference

CommsThroughput Class
Bncs.Comms Namespace


CommsThroughput Events

CommsThroughput Events

The CommsThroughput type exposes the following members.

Events
 | Name | Description
Public event | OnPersecondChange | Event handler that fires on change.
Top
See Also

Reference

CommsThroughput Class
Bncs.Comms Namespace


CommsThroughput.OnPersecondChange Event

CommsThroughputOnPersecondChange Event
Event handler that fires on change.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnPersecondChangeEventHandler OnPersecondChange

Value

Type: Bncs.CommsOnPersecondChangeEventHandler
See Also

Reference

CommsThroughput Class
Bncs.Comms Namespace


CommsUDPSettings Class

CommsUDPSettings Class
Serialisable communications settings for UDP connections.
Inheritance Hierarchy
SystemObject
Bncs.XMLPersistedXML
Bncs.CommsCommsSettings
Bncs.CommsCommsUDPSettings

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class CommsUDPSettings : CommsSettings

The CommsUDPSettings type exposes the following members.

Constructors
 | Name | Description
Public method | CommsUDPSettings | Default constructor.
Public method | CommsUDPSettings(String) | Constructor that sets the host.
Public method | CommsUDPSettings(UInt32) | Constructor that sets the auto reconnect settings value only.
Public method | CommsUDPSettings(String, Int32) | Initializes a new instance of the CommsUDPSettings class
Public method | CommsUDPSettings(String, Int32, UInt32) | Constructor that sets the host, port and number of seconds between auto reconnection attempts.
Public method | CommsUDPSettings(String, Int32, UInt32, AddressFamily, SocketType) | Initializes a new instance of the CommsUDPSettings class
Top
Methods
Name Description
Public method Equals
Tests if this is equal to the supplied objuect.
(Overrides CommsSettingsEquals(Object).)
Public method GetHashCode
Gets the hash code
(Overrides CommsSettingsGetHashCode.)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method Save
Serializes the repository to a NON-read only XML file providing that the Filename property has been set. Error information is accessable through the SaveErrorInformation property.
(Inherited from PersistedXML.)
Save(String)
Serializes the repository to a NON-read only XML file with no error information.
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}
(Inherited from PersistedXML.)
Public method Save(String, String)
Serializes the repository to a NON-read only XML file with no error information.
(Inherited from PersistedXML.)
Save(String, String)
Serializes the repository to a NON-read only XML file with error information.
Examples
This code demonstrates how to serialise/deserialise objects to and from disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File name to serialise/deserialise to/from
        const string filename = @"c:\MyObject.xml";
        // Our PersistedXML object
        MyObject myObject = null;
        // Debug message variable
        string debug;
        // New instance of object flag
        bool newInstance;

        // Check file exists ...
        if (FileFuncs.Exists(filename))
        {
            // ... it does so deserialise the onject ...
            myObject = ((MyObject)MyObject.Open(filename, typeof(MyObject), out debug, out newInstance));
            if (null == myObject) // we have a problem!
                Console.WriteLine("Deserialisation returned NULL: " + debug);
            else
            {
                // Report instance and data deserialised to user
                Console.WriteLine(newInstance ? "A new instance was initialised." : "Data deserialised from file ok.");
                if (myObject.IsValid)
                {
                    Console.WriteLine("Name: " + myObject.Name);
                    Console.WriteLine("Number: " + myObject.Number.ToString());
                }
                else
                    Console.WriteLine("Object could not be validated.");

                if (debug.Length > 0)
                    Console.WriteLine("Debug from deserialiser reads: \"" + debug + "\"");
            }
        }
        else
        {
            // ... it doesn't so create and then serialise the onject ...
            myObject = new MyObject();
            // set some properties ...
            myObject.Name = "Fred";
            myObject.Number = 13;
            // Report object data to user
            Console.WriteLine("Name: " + myObject.Name);
            Console.WriteLine("Number: " + myObject.Number.ToString());
            // Serialise the object to disk file
            Console.WriteLine("Serialising to disk file...");
            if (myObject.Save(filename, out debug))
                // Alls well
                Console.WriteLine("Rerun this app to deserialise this object from disk file.");
            else
            {
                // Report deserialisation error
                string message = "Error serialising to disk file";
                if (myObject.SaveErrorMessage.Length > 0)
                    message += ": \"" + myObject.SaveErrorMessage + "\"";
                else if (debug.Length > 0)
                    message += ": \"" + debug + "\"";
                Console.WriteLine(message);
            }
        }

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }
}
(Inherited from PersistedXML.)
Public method Save(String, String, Boolean)
Serializes the repository to an XML file with error information.
(Inherited from PersistedXML.)
Public method Save(String, String, String)
Serializes the repository to a NON-read only XML file with error information.
(Inherited from PersistedXML.)
Public method Save(String, String, Boolean, String)
Serializes the repository to an XML file with error information.
(Inherited from PersistedXML.)
Public method Save(String, String, Boolean, Boolean, String)
Serializes the repository to an XML file with error information.
(Inherited from PersistedXML.)
SaveToBuffer
Serializes the object to a buffer
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}
(Inherited from PersistedXML.)
Public method SaveToBuffer(String)
Serializes the object to a buffer
(Inherited from PersistedXML.)
Public method SaveToBuffer(String, String)
Serializes the object to a buffer
(Inherited from PersistedXML.)
Public method ToString
Returns the class as a string.
(Overrides CommsSettingsToString.)
Top
Properties
Name Description
Public property AddressFamily
Gets or sets the address family value
Public property AutoReconnectSeconds
Gets or sets the auto reconnection attempt period (in seconds). The default is zero, when greater than zero a CommsClient will try every n seconds to re-establish connection to the server when the disconnect is insigated by the server.
(Inherited from CommsSettings.)
Public property BufferSize
Gets or sets the buffersize, this being the maximum amount of bytes returned by a single read operation.
(Inherited from CommsSettings.)
Public property CompareCriteria
Gets or sets a value that determines if the host name should be a consideration when comparing objects of this type.
(Inherited from CommsSettings.)
Public property CpuMilliseconds
Gets or sets a value that determines how many milliseconds thread cycle delay should be employed when used in a object of type CommsClient.
(Inherited from CommsSettings.)
Public property CpuMilliseconds2
Gets or sets a value that determines how many milliseconds thread cycle delay should be employed when used in a object of type CommsClient2.
(Inherited from CommsSettings.)
Public property Filename
Gets or sets the XML file name property.
(Inherited from PersistedXML.)
Public property Host
Gets or sets the TCP Server address
(Overrides CommsSettingsHost.)
Public property HostIsLocalMachine
Returns true if the host resides on the local machine.
(Inherited from CommsSettings.)
Public property IsValid
Returns true if rhe host is set and the port is greater than zero
(Overrides CommsSettingsIsValid.)
Public property Name
Gets or sets an optional friendly name for a configuration
(Inherited from CommsSettings.)
Public property Port
Gets or sets the TCP port number
Public property ReadTimeout
Gets or sets the read time out in milliseconds
(Inherited from CommsSettings.)
SaveErrorMessage
Gets an error message set if the previous Save() operation failed.
Examples
This code demonstrates how to serialise/deserialise objects to and from disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File name to serialise/deserialise to/from
        const string filename = @"c:\MyObject.xml";
        // Our PersistedXML object
        MyObject myObject = null;
        // Debug message variable
        string debug;
        // New instance of object flag
        bool newInstance;

        // Check file exists ...
        if (FileFuncs.Exists(filename))
        {
            // ... it does so deserialise the onject ...
            myObject = ((MyObject)MyObject.Open(filename, typeof(MyObject), out debug, out newInstance));
            if (null == myObject) // we have a problem!
                Console.WriteLine("Deserialisation returned NULL: " + debug);
            else
            {
                // Report instance and data deserialised to user
                Console.WriteLine(newInstance ? "A new instance was initialised." : "Data deserialised from file ok.");
                if (myObject.IsValid)
                {
                    Console.WriteLine("Name: " + myObject.Name);
                    Console.WriteLine("Number: " + myObject.Number.ToString());
                }
                else
                    Console.WriteLine("Object could not be validated.");

                if (debug.Length > 0)
                    Console.WriteLine("Debug from deserialiser reads: \"" + debug + "\"");
            }
        }
        else
        {
            // ... it doesn't so create and then serialise the onject ...
            myObject = new MyObject();
            // set some properties ...
            myObject.Name = "Fred";
            myObject.Number = 13;
            // Report object data to user
            Console.WriteLine("Name: " + myObject.Name);
            Console.WriteLine("Number: " + myObject.Number.ToString());
            // Serialise the object to disk file
            Console.WriteLine("Serialising to disk file...");
            if (myObject.Save(filename, out debug))
                // Alls well
                Console.WriteLine("Rerun this app to deserialise this object from disk file.");
            else
            {
                // Report deserialisation error
                string message = "Error serialising to disk file";
                if (myObject.SaveErrorMessage.Length > 0)
                    message += ": \"" + myObject.SaveErrorMessage + "\"";
                else if (debug.Length > 0)
                    message += ": \"" + debug + "\"";
                Console.WriteLine(message);
            }
        }

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }
}
(Inherited from PersistedXML.)
Public property SocketType
Gets or sets the socket type value
Public property WriteTimeout
Gets or sets the the write time out in milliseconds
(Inherited from CommsSettings.)
Top
See Also

Reference

Bncs.Comms Namespace


CommsUDPSettings Constructor

CommsUDPSettings Constructor
Overload List
 | Name | Description
Public method | CommsUDPSettings | Default constructor.
Public method | CommsUDPSettings(String) | Constructor that sets the host.
Public method | CommsUDPSettings(UInt32) | Constructor that sets the auto reconnect settings value only.
Public method | CommsUDPSettings(String, Int32) | Initializes a new instance of the CommsUDPSettings class
Public method | CommsUDPSettings(String, Int32, UInt32) | Constructor that sets the host, port and number of seconds between auto reconnection attempts.
Public method | CommsUDPSettings(String, Int32, UInt32, AddressFamily, SocketType) | Initializes a new instance of the CommsUDPSettings class
Top
See Also

Reference

CommsUDPSettings Class
Bncs.Comms Namespace


CommsUDPSettings Constructor

CommsUDPSettings Constructor
Default constructor.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsUDPSettings()
See Also

Reference

CommsUDPSettings Class
CommsUDPSettings Overload
Bncs.Comms Namespace


CommsUDPSettings Constructor (String)

CommsUDPSettings Constructor (String)
Constructor that sets the host.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsUDPSettings(
    string host_
)

Parameters

host_
Type: SystemString
Address of the UDP server.
See Also

Reference

CommsUDPSettings Class
CommsUDPSettings Overload
Bncs.Comms Namespace


CommsUDPSettings Constructor (UInt32)

CommsUDPSettings Constructor (UInt32)
Constructor that sets the auto reconnect settings value only.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsUDPSettings(
    uint autoRecconectSeconds_
)

Parameters

autoRecconectSeconds_
Type: SystemUInt32
Number of seconds to elapse before re-attempting auto connect after a server instigated disconnection.
See Also

Reference

CommsUDPSettings Class
CommsUDPSettings Overload
Bncs.Comms Namespace


CommsUDPSettings Constructor (String, Int32)

CommsUDPSettings Constructor (String, Int32)
Initializes a new instance of the CommsUDPSettings class

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsUDPSettings(
    string host_,
    int port_
)

Parameters

host_
Type: SystemString

[Missing <param name="host_"/> documentation for "M:Bncs.Comms.CommsUDPSettings.#ctor(System.String,System.Int32)"]

port_
Type: SystemInt32

[Missing <param name="port_"/> documentation for "M:Bncs.Comms.CommsUDPSettings.#ctor(System.String,System.Int32)"]

See Also

Reference

CommsUDPSettings Class
CommsUDPSettings Overload
Bncs.Comms Namespace


CommsUDPSettings Constructor (String, Int32, UInt32)

CommsUDPSettings Constructor (String, Int32, UInt32)
Constructor that sets the host, port and number of seconds between auto reconnection attempts.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsUDPSettings(
    string host_,
    int port_,
    uint autoRecconectSeconds_
)

Parameters

host_
Type: SystemString
Address of the UDP server
port_
Type: SystemInt32
UDP port number
autoRecconectSeconds_
Type: SystemUInt32
Number of seconds to elapse before re-attempting auto connect after a server instigated disconnection.
See Also

Reference

CommsUDPSettings Class
CommsUDPSettings Overload
Bncs.Comms Namespace


CommsUDPSettings Constructor (String, Int32, UInt32, AddressFamily, SocketType)

CommsUDPSettings Constructor (String, Int32, UInt32, AddressFamily, SocketType)
Initializes a new instance of the CommsUDPSettings class

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsUDPSettings(
    string host_,
    int port_,
    uint autoRecconectSeconds_,
    AddressFamily addressFamily_,
    SocketType socketType_
)

Parameters

host_
Type: SystemString

[Missing <param name="host_"/> documentation for "M:Bncs.Comms.CommsUDPSettings.#ctor(System.String,System.Int32,System.UInt32,System.Net.Sockets.AddressFamily,System.Net.Sockets.SocketType)"]

port_
Type: SystemInt32

[Missing <param name="port_"/> documentation for "M:Bncs.Comms.CommsUDPSettings.#ctor(System.String,System.Int32,System.UInt32,System.Net.Sockets.AddressFamily,System.Net.Sockets.SocketType)"]

autoRecconectSeconds_
Type: SystemUInt32

[Missing <param name="autoRecconectSeconds_"/> documentation for "M:Bncs.Comms.CommsUDPSettings.#ctor(System.String,System.Int32,System.UInt32,System.Net.Sockets.AddressFamily,System.Net.Sockets.SocketType)"]

addressFamily_
Type: System.Net.SocketsAddressFamily

[Missing <param name="addressFamily_"/> documentation for "M:Bncs.Comms.CommsUDPSettings.#ctor(System.String,System.Int32,System.UInt32,System.Net.Sockets.AddressFamily,System.Net.Sockets.SocketType)"]

socketType_
Type: System.Net.SocketsSocketType

[Missing <param name="socketType_"/> documentation for "M:Bncs.Comms.CommsUDPSettings.#ctor(System.String,System.Int32,System.UInt32,System.Net.Sockets.AddressFamily,System.Net.Sockets.SocketType)"]

See Also

Reference

CommsUDPSettings Class
CommsUDPSettings Overload
Bncs.Comms Namespace


CommsUDPSettings Methods

CommsUDPSettings Methods

The CommsUDPSettings type exposes the following members.

Methods
Name Description
Public method Equals
Tests if this is equal to the supplied objuect.
(Overrides CommsSettingsEquals(Object).)
Public method GetHashCode
Gets the hash code
(Overrides CommsSettingsGetHashCode.)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method Save
Serializes the repository to a NON-read only XML file providing that the Filename property has been set. Error information is accessable through the SaveErrorInformation property.
(Inherited from PersistedXML.)
Save(String)
Serializes the repository to a NON-read only XML file with no error information.
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}
(Inherited from PersistedXML.)
Public method Save(String, String)
Serializes the repository to a NON-read only XML file with no error information.
(Inherited from PersistedXML.)
Save(String, String)
Serializes the repository to a NON-read only XML file with error information.
Examples
This code demonstrates how to serialise/deserialise objects to and from disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File name to serialise/deserialise to/from
        const string filename = @"c:\MyObject.xml";
        // Our PersistedXML object
        MyObject myObject = null;
        // Debug message variable
        string debug;
        // New instance of object flag
        bool newInstance;

        // Check file exists ...
        if (FileFuncs.Exists(filename))
        {
            // ... it does so deserialise the onject ...
            myObject = ((MyObject)MyObject.Open(filename, typeof(MyObject), out debug, out newInstance));
            if (null == myObject) // we have a problem!
                Console.WriteLine("Deserialisation returned NULL: " + debug);
            else
            {
                // Report instance and data deserialised to user
                Console.WriteLine(newInstance ? "A new instance was initialised." : "Data deserialised from file ok.");
                if (myObject.IsValid)
                {
                    Console.WriteLine("Name: " + myObject.Name);
                    Console.WriteLine("Number: " + myObject.Number.ToString());
                }
                else
                    Console.WriteLine("Object could not be validated.");

                if (debug.Length > 0)
                    Console.WriteLine("Debug from deserialiser reads: \"" + debug + "\"");
            }
        }
        else
        {
            // ... it doesn't so create and then serialise the onject ...
            myObject = new MyObject();
            // set some properties ...
            myObject.Name = "Fred";
            myObject.Number = 13;
            // Report object data to user
            Console.WriteLine("Name: " + myObject.Name);
            Console.WriteLine("Number: " + myObject.Number.ToString());
            // Serialise the object to disk file
            Console.WriteLine("Serialising to disk file...");
            if (myObject.Save(filename, out debug))
                // Alls well
                Console.WriteLine("Rerun this app to deserialise this object from disk file.");
            else
            {
                // Report deserialisation error
                string message = "Error serialising to disk file";
                if (myObject.SaveErrorMessage.Length > 0)
                    message += ": \"" + myObject.SaveErrorMessage + "\"";
                else if (debug.Length > 0)
                    message += ": \"" + debug + "\"";
                Console.WriteLine(message);
            }
        }

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }
}
(Inherited from PersistedXML.)
Public method Save(String, String, Boolean)
Serializes the repository to an XML file with error information.
(Inherited from PersistedXML.)
Public method Save(String, String, String)
Serializes the repository to a NON-read only XML file with error information.
(Inherited from PersistedXML.)
Public method Save(String, String, Boolean, String)
Serializes the repository to an XML file with error information.
(Inherited from PersistedXML.)
Public method Save(String, String, Boolean, Boolean, String)
Serializes the repository to an XML file with error information.
(Inherited from PersistedXML.)
SaveToBuffer
Serializes the object to a buffer
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}
(Inherited from PersistedXML.)
Public method SaveToBuffer(String)
Serializes the object to a buffer
(Inherited from PersistedXML.)
Public method SaveToBuffer(String, String)
Serializes the object to a buffer
(Inherited from PersistedXML.)
Public method ToString
Returns the class as a string.
(Overrides CommsSettingsToString.)
Top
See Also

Reference

CommsUDPSettings Class
Bncs.Comms Namespace


CommsUDPSettings.Equals Method

CommsUDPSettingsEquals Method
Tests if this is equal to the supplied objuect.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override bool Equals(
    Object obj
)

Parameters

obj
Type: SystemObject
Object to compare

Return Value

Type: Boolean
True on equality
See Also

Reference

CommsUDPSettings Class
Bncs.Comms Namespace


CommsUDPSettings.GetHashCode Method

CommsUDPSettingsGetHashCode Method
Gets the hash code

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override int GetHashCode()

Return Value

Type: Int32
A hash code
See Also

Reference

CommsUDPSettings Class
Bncs.Comms Namespace


CommsUDPSettings.ToString Method

CommsUDPSettingsToString Method
Returns the class as a string.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
Host and port
See Also

Reference

CommsUDPSettings Class
Bncs.Comms Namespace


CommsUDPSettings Properties

CommsUDPSettings Properties

The CommsUDPSettings type exposes the following members.

Properties
Name Description
Public property AddressFamily
Gets or sets the address family value
Public property AutoReconnectSeconds
Gets or sets the auto reconnection attempt period (in seconds). The default is zero, when greater than zero a CommsClient will try every n seconds to re-establish connection to the server when the disconnect is insigated by the server.
(Inherited from CommsSettings.)
Public property BufferSize
Gets or sets the buffersize, this being the maximum amount of bytes returned by a single read operation.
(Inherited from CommsSettings.)
Public property CompareCriteria
Gets or sets a value that determines if the host name should be a consideration when comparing objects of this type.
(Inherited from CommsSettings.)
Public property CpuMilliseconds
Gets or sets a value that determines how many milliseconds thread cycle delay should be employed when used in a object of type CommsClient.
(Inherited from CommsSettings.)
Public property CpuMilliseconds2
Gets or sets a value that determines how many milliseconds thread cycle delay should be employed when used in a object of type CommsClient2.
(Inherited from CommsSettings.)
Public property Filename
Gets or sets the XML file name property.
(Inherited from PersistedXML.)
Public property Host
Gets or sets the TCP Server address
(Overrides CommsSettingsHost.)
Public property HostIsLocalMachine
Returns true if the host resides on the local machine.
(Inherited from CommsSettings.)
Public property IsValid
Returns true if rhe host is set and the port is greater than zero
(Overrides CommsSettingsIsValid.)
Public property Name
Gets or sets an optional friendly name for a configuration
(Inherited from CommsSettings.)
Public property Port
Gets or sets the TCP port number
Public property ReadTimeout
Gets or sets the read time out in milliseconds
(Inherited from CommsSettings.)
SaveErrorMessage
Gets an error message set if the previous Save() operation failed.
Examples
This code demonstrates how to serialise/deserialise objects to and from disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File name to serialise/deserialise to/from
        const string filename = @"c:\MyObject.xml";
        // Our PersistedXML object
        MyObject myObject = null;
        // Debug message variable
        string debug;
        // New instance of object flag
        bool newInstance;

        // Check file exists ...
        if (FileFuncs.Exists(filename))
        {
            // ... it does so deserialise the onject ...
            myObject = ((MyObject)MyObject.Open(filename, typeof(MyObject), out debug, out newInstance));
            if (null == myObject) // we have a problem!
                Console.WriteLine("Deserialisation returned NULL: " + debug);
            else
            {
                // Report instance and data deserialised to user
                Console.WriteLine(newInstance ? "A new instance was initialised." : "Data deserialised from file ok.");
                if (myObject.IsValid)
                {
                    Console.WriteLine("Name: " + myObject.Name);
                    Console.WriteLine("Number: " + myObject.Number.ToString());
                }
                else
                    Console.WriteLine("Object could not be validated.");

                if (debug.Length > 0)
                    Console.WriteLine("Debug from deserialiser reads: \"" + debug + "\"");
            }
        }
        else
        {
            // ... it doesn't so create and then serialise the onject ...
            myObject = new MyObject();
            // set some properties ...
            myObject.Name = "Fred";
            myObject.Number = 13;
            // Report object data to user
            Console.WriteLine("Name: " + myObject.Name);
            Console.WriteLine("Number: " + myObject.Number.ToString());
            // Serialise the object to disk file
            Console.WriteLine("Serialising to disk file...");
            if (myObject.Save(filename, out debug))
                // Alls well
                Console.WriteLine("Rerun this app to deserialise this object from disk file.");
            else
            {
                // Report deserialisation error
                string message = "Error serialising to disk file";
                if (myObject.SaveErrorMessage.Length > 0)
                    message += ": \"" + myObject.SaveErrorMessage + "\"";
                else if (debug.Length > 0)
                    message += ": \"" + debug + "\"";
                Console.WriteLine(message);
            }
        }

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }
}
(Inherited from PersistedXML.)
Public property SocketType
Gets or sets the socket type value
Public property WriteTimeout
Gets or sets the the write time out in milliseconds
(Inherited from CommsSettings.)
Top
See Also

Reference

CommsUDPSettings Class
Bncs.Comms Namespace


CommsUDPSettings.AddressFamily Property

CommsUDPSettingsAddressFamily Property
Gets or sets the address family value

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public AddressFamily AddressFamily { get; set; }

Property Value

Type: AddressFamily
See Also

Reference

CommsUDPSettings Class
Bncs.Comms Namespace


CommsUDPSettings.Host Property

CommsUDPSettingsHost Property
Gets or sets the TCP Server address

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string Host { get; set; }

Property Value

Type: String
See Also

Reference

CommsUDPSettings Class
Bncs.Comms Namespace


CommsUDPSettings.IsValid Property

CommsUDPSettingsIsValid Property
Returns true if rhe host is set and the port is greater than zero

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override bool IsValid { get; }

Property Value

Type: Boolean
See Also

Reference

CommsUDPSettings Class
Bncs.Comms Namespace


CommsUDPSettings.Port Property

CommsUDPSettingsPort Property
Gets or sets the TCP port number

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Port { get; set; }

Property Value

Type: Int32
See Also

Reference

CommsUDPSettings Class
Bncs.Comms Namespace


CommsUDPSettings.SocketType Property

CommsUDPSettingsSocketType Property
Gets or sets the socket type value

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public SocketType SocketType { get; set; }

Property Value

Type: SocketType
See Also

Reference

CommsUDPSettings Class
Bncs.Comms Namespace


CommsUtils Class

CommsUtils Class
Communications utilities.
Inheritance Hierarchy
SystemObject
Bncs.CommsCommsUtils

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static class CommsUtils

The CommsUtils type exposes the following members.

Methods
Name | Description
GetIPAddress | Returns the IP address according to family
IsValidIPAddress | Returns true if the supplied IP address is a valid one.
Top
Properties
Name | Description
IPAddress | Gets the IPv4 address
Top
See Also

Reference

Bncs.Comms Namespace


CommsUtils Methods

CommsUtils Methods

The CommsUtils type exposes the following members.

Methods
Name | Description
GetIPAddress | Returns the IP address according to family
IsValidIPAddress | Returns true if the supplied IP address is a valid one.
Top
See Also

Reference

CommsUtils Class
Bncs.Comms Namespace


CommsUtils.GetIPAddress Method

CommsUtilsGetIPAddress Method
Returns the IP address according to family

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string GetIPAddress(
    AddressFamily family_
)

Parameters

family_
Type: System.Net.SocketsAddressFamily
Family enumeration

Return Value

Type: String
The IP address else ? if not found
See Also

Reference

CommsUtils Class
Bncs.Comms Namespace


CommsUtils.IsValidIPAddress Method

CommsUtilsIsValidIPAddress Method
Returns true if the supplied IP address is a valid one.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool IsValidIPAddress(
    string ipAddress_
)

Parameters

ipAddress_
Type: SystemString
IP address to test.

Return Value

Type: Boolean
True if valid
See Also

Reference

CommsUtils Class
Bncs.Comms Namespace


CommsUtils Properties

CommsUtils Properties

The CommsUtils type exposes the following members.

Properties
Name | Description
IPAddress | Gets the IPv4 address
Top
See Also

Reference

CommsUtils Class
Bncs.Comms Namespace


CommsUtils.IPAddress Property

CommsUtilsIPAddress Property
Gets the IPv4 address

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string IPAddress { get; }

Property Value

Type: String
See Also

Reference

CommsUtils Class
Bncs.Comms Namespace


ConnectChangeInstigator Enumeration

ConnectChangeInstigator Enumeration
Connection change instigator enumeration

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum ConnectChangeInstigator
Members
Member name | Value | Description
Client | 0 | Connection change instigated on client machine.
Server | 1 | Connection change instigated on server machine.
See Also

Reference

Bncs.Comms Namespace


ConnectionDataItem Class

ConnectionDataItem Class
A class encapsulating a single BNCS log file string, if valid a list of these objects will be presented to the user to select valid connect, disconnect, reconnecting entries
Inheritance Hierarchy
SystemObject
Bncs.CommsConnectionDataItem

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class ConnectionDataItem

The ConnectionDataItem type exposes the following members.

Constructors
 | Name | Description
Public method | ConnectionDataItem | Default constructor.
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the instance using date/time, status and message. (Overrides ObjectToString.)
Top
Properties
 | Name | Description
Public property | IsValid | Returns true if the instance represents a valid log string.
Public property | Message | Gets or sets the message property.
Public property | Status | Gets or sets the connection status.
Public property | TimeStamp | Gets or sets the time stamp.
Public property | TimeStampString | Gets or sets the time stamp string.
Top
See Also

Reference

Bncs.Comms Namespace


ConnectionDataItem Constructor

ConnectionDataItem Constructor
Default constructor.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ConnectionDataItem()
See Also

Reference

ConnectionDataItem Class
Bncs.Comms Namespace


ConnectionDataItem Methods

ConnectionDataItem Methods

The ConnectionDataItem type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the instance using date/time, status and message. (Overrides ObjectToString.)
Top
See Also

Reference

ConnectionDataItem Class
Bncs.Comms Namespace


ConnectionDataItem.ToString Method

ConnectionDataItemToString Method
Returns a string representation of the instance using date/time, status and message.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
Date, time, status and message.
See Also

Reference

ConnectionDataItem Class
Bncs.Comms Namespace


ConnectionDataItem Properties

ConnectionDataItem Properties

The ConnectionDataItem type exposes the following members.

Properties
 | Name | Description
Public property | IsValid | Returns true if the instance represents a valid log string.
Public property | Message | Gets or sets the message property.
Public property | Status | Gets or sets the connection status.
Public property | TimeStamp | Gets or sets the time stamp.
Public property | TimeStampString | Gets or sets the time stamp string.
Top
See Also

Reference

ConnectionDataItem Class
Bncs.Comms Namespace


ConnectionDataItem.IsValid Property

ConnectionDataItemIsValid Property
Returns true if the instance represents a valid log string.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool IsValid { get; }

Property Value

Type: Boolean
See Also

Reference

ConnectionDataItem Class
Bncs.Comms Namespace


ConnectionDataItem.Message Property

ConnectionDataItemMessage Property
Gets or sets the message property.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Message { get; set; }

Property Value

Type: String
See Also

Reference

ConnectionDataItem Class
Bncs.Comms Namespace


ConnectionDataItem.Status Property

ConnectionDataItemStatus Property
Gets or sets the connection status.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ConnectionStatus Status { get; set; }

Property Value

Type: ConnectionStatus
See Also

Reference

ConnectionDataItem Class
Bncs.Comms Namespace


ConnectionDataItem.TimeStamp Property

ConnectionDataItemTimeStamp Property
Gets or sets the time stamp.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public DateTime TimeStamp { get; set; }

Property Value

Type: DateTime
See Also

Reference

ConnectionDataItem Class
Bncs.Comms Namespace


ConnectionDataItem.TimeStampString Property

ConnectionDataItemTimeStampString Property
Gets or sets the time stamp string.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string TimeStampString { get; set; }

Property Value

Type: String
See Also

Reference

ConnectionDataItem Class
Bncs.Comms Namespace


ConnectionState Enumeration

ConnectionState Enumeration
Connection state enumeration

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum ConnectionState
Members
Member name | Value | Description
Connected | 0 | Comms are currently connected ok.
ServerDisconnect | 1 | Comms are currently disconnected, this was instigated by the server.
ClientDisconnect | 2 | Comms are currently disconnected, this was instigated on the client.
See Also

Reference

Bncs.Comms Namespace


ConnectionStatus Enumeration

ConnectionStatus Enumeration
Connection status enumeration

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum ConnectionStatus
Members
Member name | Value | Description
Connected | 0 | Currently connected.
Disconnected | 1 | Currently disconnected.
Reconnecting | 2 | Currently reconnecting.
See Also

Reference

Bncs.Comms Namespace


ConnectionStatus2 Enumeration

ConnectionStatus2 Enumeration
Enumeration to indicate CommsClient2 connection state.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum ConnectionStatus2
Members
Member name | Value | Description
Disconnected | 0 | Client is disconnected.
Connecting | 1 | Client is connecting.
Connected | 2 | Client is connected.
Reconnecting | 3 | Client is reconnecting.
Disconnecting | 4 | Client is disconnecting.
See Also

Reference

Bncs.Comms Namespace


ConnectionType Enumeration

ConnectionType Enumeration
Connection type enumeration

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum ConnectionType
Members
Member name | Value | Description
TCP | 0 | Connected over TCP/IP.
UDP | 1 | Connected over UDP.
Serial | 2 | Connected over a Serial connection.
See Also

Reference

Bncs.Comms Namespace


ContentDataType Enumeration

ContentDataType Enumeration
Enumerator to dictate content data type

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum ContentDataType
Members
Member name | Value | Description
cdtBytes | 0 | Data is in bytes.
cdtText | 1 | Data is in plain printable text.
See Also

Reference

Bncs.Comms Namespace


ContentFormat Enumeration

ContentFormat Enumeration
Enumerator to dictate content format.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum ContentFormat
Members
Member name | Value | Description
cfRaw | 0 | Raw content
cfDated | 1 | Date is auto included.
See Also

Reference

Bncs.Comms Namespace


DataBit Enumeration

DataBit Enumeration
Enumeration synonymous with data bit settings for serial communications.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum DataBit
Members
Member name | Value | Description
Five | 5 | Five data bits.
Six | 6 | Six data bits.
Seven | 7 | Seven data bits.
Eight | 8 | Eight data bits.
See Also

Reference

Bncs.Comms Namespace


DebugContent Enumeration

DebugContent Enumeration
Enumerator to dictate debug content.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum DebugContent
Members
Member name | Value | Description
dcTx | 0 | Include transmissions only.
dcRx | 1 | Include received only.
dcBoth | 2 | Include both.
See Also

Reference

Bncs.Comms Namespace


DispatcherEventArgs Class

DispatcherEventArgs Class
The base class for all EventArgs used in CommsClient and CommsClient2 event handlers. When any event fires the Dispatch member is true. When needing to handle this asynchronously simply change the argument to false and recall your event handler to carry out operations such as UI updating within the context of your main thread.
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.CommsDispatcherEventArgs
More...

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class DispatcherEventArgs : EventArgs

The DispatcherEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | DispatcherEventArgs | Initializes a new instance of the DispatcherEventArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | Dispatch | If true the handler must be re-called asynchronously with this property set to false to flag that UI processing is now safe.
Top
See Also

Reference

Bncs.Comms Namespace
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.CommsDispatcherEventArgs
Bncs.CommsOnBufferFullEventArgs
Bncs.CommsOnConnectionStatusChangedEventArgs
Bncs.CommsOnConnectionStatusChangedEventArgs2
Bncs.CommsOnDebugEventArgs
Bncs.CommsOnExceptionEventArgs
Bncs.CommsOnPersecondChangeEventArgs
Bncs.CommsOnReadTimeOutEventArgs
Bncs.CommsOnReceiveEventArgs
Bncs.CommsOnTxRxDebugEventArgs


DispatcherEventArgs Constructor

DispatcherEventArgs Constructor
Initializes a new instance of the DispatcherEventArgs class

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public DispatcherEventArgs()
See Also

Reference

DispatcherEventArgs Class
Bncs.Comms Namespace


DispatcherEventArgs Fields

DispatcherEventArgs Fields

The DispatcherEventArgs type exposes the following members.

Fields
 | Name | Description
Public field | Dispatch | If true the handler must be re-called asynchronously with this property set to false to flag that UI processing is now safe.
Top
See Also

Reference

DispatcherEventArgs Class
Bncs.Comms Namespace


DispatcherEventArgs.Dispatch Field

DispatcherEventArgsDispatch Field
If true the handler must be re-called asynchronously with this property set to false to flag that UI processing is now safe.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Dispatch

Field Value

Type: Boolean
See Also

Reference

DispatcherEventArgs Class
Bncs.Comms Namespace


DispatcherEventArgs Methods

DispatcherEventArgs Methods

The DispatcherEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

DispatcherEventArgs Class
Bncs.Comms Namespace


ExceptionActivity Enumeration

ExceptionActivity Enumeration
Enumeration denoting the type of activity that was happening when an exception occured.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum ExceptionActivity
Members
Member name | Value | Description
Send | 0 | Data was being written.
Receive | 1 | Data was being read.
OpeningPort | 2 | The listener port was being turned on.
See Also

Reference

Bncs.Comms Namespace


ExceptionCaller Enumeration

ExceptionCaller Enumeration
Enumeration denoting the operation that raised an exception.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum ExceptionCaller
Members
Member name | Value | Description
Connect | 0 | Exception was caught while connecting.
Read | 1 | Exception was caught while reading.
Write | 2 | Exception was caught while writing.
See Also

Reference

Bncs.Comms Namespace


ExceptionResponse Enumeration

ExceptionResponse Enumeration
Exception response enumeration when handling exceptions via in OnException.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum ExceptionResponse
Members
Member name | Value | Description
Handled | 0 | Exception has been handled, continue
Throw | 1 | Throw the exception again
Disconnect | 2 | Disconnect from the server.
DisconnectAndThrow | 3 | Disconnect from the server and then throw the exception again.
HostDisconnect | 4 | Disconnect the host.
See Also

Reference

Bncs.Comms Namespace


HourlyUpdateEventArgs Class

HourlyUpdateEventArgs Class
Event argument class for OnHourlyUpdate event handler.
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.CommsHourlyUpdateEventArgs

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class HourlyUpdateEventArgs : EventArgs

The HourlyUpdateEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | HourlyUpdateEventArgs | Initializes a new instance of the HourlyUpdateEventArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | Items | LogProtocol server items collection
Public field | MoreToFollow | More to follow flag.
Top
See Also

Reference

Bncs.Comms Namespace


HourlyUpdateEventArgs Constructor

HourlyUpdateEventArgs Constructor
Initializes a new instance of the HourlyUpdateEventArgs class

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public HourlyUpdateEventArgs()
See Also

Reference

HourlyUpdateEventArgs Class
Bncs.Comms Namespace


HourlyUpdateEventArgs Fields

HourlyUpdateEventArgs Fields

The HourlyUpdateEventArgs type exposes the following members.

Fields
 | Name | Description
Public field | Items | LogProtocol server items collection
Public field | MoreToFollow | More to follow flag.
Top
See Also

Reference

HourlyUpdateEventArgs Class
Bncs.Comms Namespace


HourlyUpdateEventArgs.Items Field

HourlyUpdateEventArgsItems Field
LogProtocol server items collection

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CCDLogServerItemCollection Items

Field Value

Type: CCDLogServerItemCollection
See Also

Reference

HourlyUpdateEventArgs Class
Bncs.Comms Namespace


HourlyUpdateEventArgs.MoreToFollow Field

HourlyUpdateEventArgsMoreToFollow Field
More to follow flag.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool MoreToFollow

Field Value

Type: Boolean
See Also

Reference

HourlyUpdateEventArgs Class
Bncs.Comms Namespace


HourlyUpdateEventArgs Methods

HourlyUpdateEventArgs Methods

The HourlyUpdateEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

HourlyUpdateEventArgs Class
Bncs.Comms Namespace


HourlyUpdateEventHandler Delegate

HourlyUpdateEventHandler Delegate
Delegate for the OnHourlyUpdate event.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void HourlyUpdateEventHandler(
    Object sender,
    HourlyUpdateEventArgs e
)

Parameters

sender
Type: SystemObject
Calling object.
e
Type: Bncs.CommsHourlyUpdateEventArgs
Parameters
See Also

Reference

Bncs.Comms Namespace


HTTPRequestAuthenticationType Enumeration

HTTPRequestAuthenticationType Enumeration
Enumerator that controls password authentication, either via credentials or writing directly to the header

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum HTTPRequestAuthenticationType
Members
Member name | Value | Description
SetCredentials | 0 |
WriteToHeader | 1 |
See Also

Reference

Bncs.Comms Namespace


HTTPRequestError Class

HTTPRequestError Class
Error handling class for the HTTPWebRequest
Inheritance Hierarchy
SystemObject
Bncs.CommsHTTPRequestError

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class HTTPRequestError

The HTTPRequestError type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | (Overrides ObjectToString.)
Top
Properties
 | Name | Description
Public property | IsError | Gets a flag which if true indicates an error
Public property | Message | Gets the outer exception message
Public property | MessageTree | Gets the outer and all inner exception messages
Public property | OuterExceptionType | Gets the outer exception type
Public property | TargetSite | Gets the target site
Top
See Also

Reference

Bncs.Comms Namespace


HTTPRequestError Methods

HTTPRequestError Methods

The HTTPRequestError type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | (Overrides ObjectToString.)
Top
See Also

Reference

HTTPRequestError Class
Bncs.Comms Namespace


HTTPRequestError.ToString Method

HTTPRequestErrorToString Method

[Missing <summary> documentation for "M:Bncs.Comms.HTTPRequestError.ToString"]

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String

[Missing <returns> documentation for "M:Bncs.Comms.HTTPRequestError.ToString"]

See Also

Reference

HTTPRequestError Class
Bncs.Comms Namespace


HTTPRequestError Properties

HTTPRequestError Properties

The HTTPRequestError type exposes the following members.

Properties
 | Name | Description
Public property | IsError | Gets a flag which if true indicates an error
Public property | Message | Gets the outer exception message
Public property | MessageTree | Gets the outer and all inner exception messages
Public property | OuterExceptionType | Gets the outer exception type
Public property | TargetSite | Gets the target site
Top
See Also

Reference

HTTPRequestError Class
Bncs.Comms Namespace


HTTPRequestError.IsError Property

HTTPRequestErrorIsError Property
Gets a flag which if true indicates an error

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool IsError { get; }

Property Value

Type: Boolean
See Also

Reference

HTTPRequestError Class
Bncs.Comms Namespace


HTTPRequestError.Message Property

HTTPRequestErrorMessage Property
Gets the outer exception message

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Message { get; }

Property Value

Type: String
See Also

Reference

HTTPRequestError Class
Bncs.Comms Namespace


HTTPRequestError.MessageTree Property

HTTPRequestErrorMessageTree Property
Gets the outer and all inner exception messages

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<string> MessageTree { get; }

Property Value

Type: List String
See Also

Reference

HTTPRequestError Class
Bncs.Comms Namespace


HTTPRequestError.OuterExceptionType Property

HTTPRequestErrorOuterExceptionType Property
Gets the outer exception type

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Type OuterExceptionType { get; }

Property Value

Type: Type
See Also

Reference

HTTPRequestError Class
Bncs.Comms Namespace


HTTPRequestError.TargetSite Property

HTTPRequestErrorTargetSite Property
Gets the target site

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string TargetSite { get; }

Property Value

Type: String
See Also

Reference

HTTPRequestError Class
Bncs.Comms Namespace


HTTPRequestMethodType Enumeration

HTTPRequestMethodType Enumeration
Enumerator containing the HTTP method type

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum HTTPRequestMethodType
Members
Member name | Value | Description
Options | 0 |
Get | 1 |
Head | 2 |
Post | 3 |
Put | 4 |
Delete | 5 |
Trace | 6 |
Connect | 7 |
See Also

Reference

Bncs.Comms Namespace


HTTPWebRequest Class

HTTPWebRequest Class
A class that allows connection to and writing to and reading from an HTTP server
Inheritance Hierarchy
SystemObject
Bncs.CommsHTTPWebRequest

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class HTTPWebRequest

The HTTPWebRequest type exposes the following members.

Constructors
 | Name | Description
Public method | HTTPWebRequest(String) | Constructor that sets the URI, there is no username or password used, method defaults to POST and there is no content type set.
Public method | HTTPWebRequest(String, String) | Constructor that sets the URI and content type, there is no username or password used, method defaults to POST.
Public method | HTTPWebRequest(String, HTTPRequestMethodType, String) | Constructor that sets the URI, method and content type, there is no username or password used.
Public method | HTTPWebRequest(String, HTTPRequestMethodType, String, String, String) | Constructor that sets the URI, method, content type, username and password. Authentication type defaults to write to header.
Public method | HTTPWebRequest(String, HTTPRequestMethodType, String, String, String, HTTPRequestAuthenticationType) | Constructor that sets the URI, method, content type, username, password and authentication type
Public method | HTTPWebRequest(String, HTTPRequestMethodType, String, String, String, SecurityProtocolType) | Initializes a new instance of the HTTPWebRequest class
Public method | HTTPWebRequest(String, HTTPRequestMethodType, String, String, String, HTTPRequestAuthenticationType, SecurityProtocolType) | Initializes a new instance of the HTTPWebRequest class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Read | Reads from the server
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Public method | Write(Byte) | Writes a byte to the server
Public method | Write(Byte) | Writes a byte array to the server
Public method | Write(Char) | Writes a character to the server
Public method | Write(String) | é Writes a string to the server
Top
Properties
 | Name | Description
Public property | AuthenticationType | Gets / sets the authentication type, the default is WriteToHeader
Public property | Debugger | Gets or sets a debugger, see the CommsClientDebugger class for more information.
Public property | DispatchTime | Gets the time span for the last write operation
Public property | LastError | Gets the last error message if any
Public property | LastServerResponse | Gets the last read from the server if any
Public property | MethodType | Gets / sets the method type
Public property | ReceiveTime | Gets the time span for the last read operation
Public property | SecurityProtocolType | Gets / sets the security protocol type to be used
Public property | ServerTimeoutSeconds | Gets / sets the server time out, if left at the default zero then the server dictates the time out
Public property | UseSecurePassword | Gets / sets the secure password flag, the default is true. This property is only applicable when AuthenticationType is set to SetCredentials
Top
Events
 | Name | Description
Public event | OnError | Fires when an error occurs
Public event | OnRead | Fires when a string is read from the server
Public event | OnWrite | Fires when a message is written to the server
Top
See Also

Reference

Bncs.Comms Namespace


HTTPWebRequest Constructor

HTTPWebRequest Constructor
Overload List
 | Name | Description
Public method | HTTPWebRequest(String) | Constructor that sets the URI, there is no username or password used, method defaults to POST and there is no content type set.
Public method | HTTPWebRequest(String, String) | Constructor that sets the URI and content type, there is no username or password used, method defaults to POST.
Public method | HTTPWebRequest(String, HTTPRequestMethodType, String) | Constructor that sets the URI, method and content type, there is no username or password used.
Public method | HTTPWebRequest(String, HTTPRequestMethodType, String, String, String) | Constructor that sets the URI, method, content type, username and password. Authentication type defaults to write to header.
Public method | HTTPWebRequest(String, HTTPRequestMethodType, String, String, String, HTTPRequestAuthenticationType) | Constructor that sets the URI, method, content type, username, password and authentication type
Public method | HTTPWebRequest(String, HTTPRequestMethodType, String, String, String, SecurityProtocolType) | Initializes a new instance of the HTTPWebRequest class
Public method | HTTPWebRequest(String, HTTPRequestMethodType, String, String, String, HTTPRequestAuthenticationType, SecurityProtocolType) | Initializes a new instance of the HTTPWebRequest class
Top
See Also

Reference

HTTPWebRequest Class
Bncs.Comms Namespace


HTTPWebRequest Constructor (String)

HTTPWebRequest Constructor (String)
Constructor that sets the URI, there is no username or password used, method defaults to POST and there is no content type set.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public HTTPWebRequest(
    string requestUriString_
)

Parameters

requestUriString_
Type: SystemString
URI of server
See Also

Reference

HTTPWebRequest Class
HTTPWebRequest Overload
Bncs.Comms Namespace


HTTPWebRequest Constructor (String, String)

HTTPWebRequest Constructor (String, String)
Constructor that sets the URI and content type, there is no username or password used, method defaults to POST.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public HTTPWebRequest(
    string requestUriString_,
    string contentType_
)

Parameters

requestUriString_
Type: SystemString
URI of server
contentType_
Type: SystemString
Sets the content type
See Also

Reference

HTTPWebRequest Class
HTTPWebRequest Overload
Bncs.Comms Namespace


HTTPWebRequest Constructor (String, HTTPRequestMethodType, String)

HTTPWebRequest Constructor (String, HTTPRequestMethodType, String)
Constructor that sets the URI, method and content type, there is no username or password used.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public HTTPWebRequest(
    string requestUriString_,
    HTTPRequestMethodType method_,
    string contentType_
)

Parameters

requestUriString_
Type: SystemString
URI of server
method_
Type: Bncs.CommsHTTPRequestMethodType
Sets the method
contentType_
Type: SystemString
Sets the content type
See Also

Reference

HTTPWebRequest Class
HTTPWebRequest Overload
Bncs.Comms Namespace


HTTPWebRequest Constructor (String, HTTPRequestMethodType, String, String, String)

HTTPWebRequest Constructor (String, HTTPRequestMethodType, String, String, String)
Constructor that sets the URI, method, content type, username and password. Authentication type defaults to write to header.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public HTTPWebRequest(
    string requestUriString_,
    HTTPRequestMethodType method_,
    string contentType_,
    string username_,
    string password_
)

Parameters

requestUriString_
Type: SystemString
URI of server
method_
Type: Bncs.CommsHTTPRequestMethodType
Sets the method
contentType_
Type: SystemString
Sets the content type
username_
Type: SystemString
User name
password_
Type: SystemString
Password
See Also

Reference

HTTPWebRequest Class
HTTPWebRequest Overload
Bncs.Comms Namespace


HTTPWebRequest Constructor (String, HTTPRequestMethodType, String, String, String, HTTPRequestAuthenticationType)

HTTPWebRequest Constructor (String, HTTPRequestMethodType, String, String, String, HTTPRequestAuthenticationType)
Constructor that sets the URI, method, content type, username, password and authentication type

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public HTTPWebRequest(
    string requestUriString_,
    HTTPRequestMethodType method_,
    string contentType_,
    string username_,
    string password_,
    HTTPRequestAuthenticationType authenticationType_
)

Parameters

requestUriString_
Type: SystemString
URI of server
method_
Type: Bncs.CommsHTTPRequestMethodType
Sets the method
contentType_
Type: SystemString
Sets the content type
username_
Type: SystemString
User name
password_
Type: SystemString
Password
authenticationType_
Type: Bncs.CommsHTTPRequestAuthenticationType
Authentication type
See Also

Reference

HTTPWebRequest Class
HTTPWebRequest Overload
Bncs.Comms Namespace


HTTPWebRequest Constructor (String, HTTPRequestMethodType, String, String, String, SecurityProtocolType)

HTTPWebRequest Constructor (String, HTTPRequestMethodType, String, String, String, SecurityProtocolType)
Initializes a new instance of the HTTPWebRequest class

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public HTTPWebRequest(
    string requestUriString_,
    HTTPRequestMethodType method_,
    string contentType_,
    string username_,
    string password_,
    SecurityProtocolType securityProtocolType_
)

Parameters

requestUriString_
Type: SystemString

[Missing <param name="requestUriString_"/> documentation for "M:Bncs.Comms.HTTPWebRequest.#ctor(System.String,Bncs.Comms.HTTPRequestMethodType,System.String,System.String,System.String,System.Net.SecurityProtocolType)"]

method_
Type: Bncs.CommsHTTPRequestMethodType

[Missing <param name="method_"/> documentation for "M:Bncs.Comms.HTTPWebRequest.#ctor(System.String,Bncs.Comms.HTTPRequestMethodType,System.String,System.String,System.String,System.Net.SecurityProtocolType)"]

contentType_
Type: SystemString

[Missing <param name="contentType_"/> documentation for "M:Bncs.Comms.HTTPWebRequest.#ctor(System.String,Bncs.Comms.HTTPRequestMethodType,System.String,System.String,System.String,System.Net.SecurityProtocolType)"]

username_
Type: SystemString

[Missing <param name="username_"/> documentation for "M:Bncs.Comms.HTTPWebRequest.#ctor(System.String,Bncs.Comms.HTTPRequestMethodType,System.String,System.String,System.String,System.Net.SecurityProtocolType)"]

password_
Type: SystemString

[Missing <param name="password_"/> documentation for "M:Bncs.Comms.HTTPWebRequest.#ctor(System.String,Bncs.Comms.HTTPRequestMethodType,System.String,System.String,System.String,System.Net.SecurityProtocolType)"]

securityProtocolType_
Type: System.NetSecurityProtocolType

[Missing <param name="securityProtocolType_"/> documentation for "M:Bncs.Comms.HTTPWebRequest.#ctor(System.String,Bncs.Comms.HTTPRequestMethodType,System.String,System.String,System.String,System.Net.SecurityProtocolType)"]

See Also

Reference

HTTPWebRequest Class
HTTPWebRequest Overload
Bncs.Comms Namespace


HTTPWebRequest Constructor (String, HTTPRequestMethodType, String, String, String, HTTPRequestAuthenticationType, SecurityProtocolType)

HTTPWebRequest Constructor (String, HTTPRequestMethodType, String, String, String, HTTPRequestAuthenticationType, SecurityProtocolType)
Initializes a new instance of the HTTPWebRequest class

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public HTTPWebRequest(
    string requestUriString_,
    HTTPRequestMethodType method_,
    string contentType_,
    string username_,
    string password_,
    HTTPRequestAuthenticationType authenticationType_,
    SecurityProtocolType securityProtocolType_
)

Parameters

requestUriString_
Type: SystemString

[Missing <param name="requestUriString_"/> documentation for "M:Bncs.Comms.HTTPWebRequest.#ctor(System.String,Bncs.Comms.HTTPRequestMethodType,System.String,System.String,System.String,Bncs.Comms.HTTPRequestAuthenticationType,System.Net.SecurityProtocolType)"]

method_
Type: Bncs.CommsHTTPRequestMethodType

[Missing <param name="method_"/> documentation for "M:Bncs.Comms.HTTPWebRequest.#ctor(System.String,Bncs.Comms.HTTPRequestMethodType,System.String,System.String,System.String,Bncs.Comms.HTTPRequestAuthenticationType,System.Net.SecurityProtocolType)"]

contentType_
Type: SystemString

[Missing <param name="contentType_"/> documentation for "M:Bncs.Comms.HTTPWebRequest.#ctor(System.String,Bncs.Comms.HTTPRequestMethodType,System.String,System.String,System.String,Bncs.Comms.HTTPRequestAuthenticationType,System.Net.SecurityProtocolType)"]

username_
Type: SystemString

[Missing <param name="username_"/> documentation for "M:Bncs.Comms.HTTPWebRequest.#ctor(System.String,Bncs.Comms.HTTPRequestMethodType,System.String,System.String,System.String,Bncs.Comms.HTTPRequestAuthenticationType,System.Net.SecurityProtocolType)"]

password_
Type: SystemString

[Missing <param name="password_"/> documentation for "M:Bncs.Comms.HTTPWebRequest.#ctor(System.String,Bncs.Comms.HTTPRequestMethodType,System.String,System.String,System.String,Bncs.Comms.HTTPRequestAuthenticationType,System.Net.SecurityProtocolType)"]

authenticationType_
Type: Bncs.CommsHTTPRequestAuthenticationType

[Missing <param name="authenticationType_"/> documentation for "M:Bncs.Comms.HTTPWebRequest.#ctor(System.String,Bncs.Comms.HTTPRequestMethodType,System.String,System.String,System.String,Bncs.Comms.HTTPRequestAuthenticationType,System.Net.SecurityProtocolType)"]

securityProtocolType_
Type: System.NetSecurityProtocolType

[Missing <param name="securityProtocolType_"/> documentation for "M:Bncs.Comms.HTTPWebRequest.#ctor(System.String,Bncs.Comms.HTTPRequestMethodType,System.String,System.String,System.String,Bncs.Comms.HTTPRequestAuthenticationType,System.Net.SecurityProtocolType)"]

See Also

Reference

HTTPWebRequest Class
HTTPWebRequest Overload
Bncs.Comms Namespace


HTTPWebRequest Methods

HTTPWebRequest Methods

The HTTPWebRequest type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Read | Reads from the server
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Public method | Write(Byte) | Writes a byte to the server
Public method | Write(Byte) | Writes a byte array to the server
Public method | Write(Char) | Writes a character to the server
Public method | Write(String) | é Writes a string to the server
Top
See Also

Reference

HTTPWebRequest Class
Bncs.Comms Namespace


HTTPWebRequest.Read Method

HTTPWebRequestRead Method
Reads from the server

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Read()

Return Value

Type: Boolean
True on success
See Also

Reference

HTTPWebRequest Class
Bncs.Comms Namespace


HTTPWebRequest.Write Method

HTTPWebRequestWrite Method
Overload List
 | Name | Description
Public method | Write(Byte) | Writes a byte to the server
Public method | Write(Byte) | Writes a byte array to the server
Public method | Write(Char) | Writes a character to the server
Public method | Write(String) | é Writes a string to the server
Top
See Also

Reference

HTTPWebRequest Class
Bncs.Comms Namespace


HTTPWebRequest.Write Method (Byte)

HTTPWebRequestWrite Method (Byte)
Writes a byte to the server

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Write(
    byte byte_
)

Parameters

byte_
Type: SystemByte
Byte to write

Return Value

Type: Boolean
True on success
See Also

Reference

HTTPWebRequest Class
Write Overload
Bncs.Comms Namespace


HTTPWebRequest.Write Method (Byte[])

HTTPWebRequestWrite Method (Byte)
Writes a byte array to the server

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Write(
    byte[] message_
)

Parameters

message_
Type: SystemByte
Bytes to write

Return Value

Type: Boolean
True on success
See Also

Reference

HTTPWebRequest Class
Write Overload
Bncs.Comms Namespace


HTTPWebRequest.Write Method (Char)

HTTPWebRequestWrite Method (Char)
Writes a character to the server

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Write(
    char character_
)

Parameters

character_
Type: SystemChar
Character to write

Return Value

Type: Boolean
True on success
See Also

Reference

HTTPWebRequest Class
Write Overload
Bncs.Comms Namespace


HTTPWebRequest.Write Method (String)

HTTPWebRequestWrite Method (String)
é Writes a string to the server

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Write(
    string message_
)

Parameters

message_
Type: SystemString
String to write

Return Value

Type: Boolean
True on success
See Also

Reference

HTTPWebRequest Class
Write Overload
Bncs.Comms Namespace


HTTPWebRequest Properties

HTTPWebRequest Properties

The HTTPWebRequest type exposes the following members.

Properties
 | Name | Description
Public property | AuthenticationType | Gets / sets the authentication type, the default is WriteToHeader
Public property | Debugger | Gets or sets a debugger, see the CommsClientDebugger class for more information.
Public property | DispatchTime | Gets the time span for the last write operation
Public property | LastError | Gets the last error message if any
Public property | LastServerResponse | Gets the last read from the server if any
Public property | MethodType | Gets / sets the method type
Public property | ReceiveTime | Gets the time span for the last read operation
Public property | SecurityProtocolType | Gets / sets the security protocol type to be used
Public property | ServerTimeoutSeconds | Gets / sets the server time out, if left at the default zero then the server dictates the time out
Public property | UseSecurePassword | Gets / sets the secure password flag, the default is true. This property is only applicable when AuthenticationType is set to SetCredentials
Top
See Also

Reference

HTTPWebRequest Class
Bncs.Comms Namespace


HTTPWebRequest.AuthenticationType Property

HTTPWebRequestAuthenticationType Property
Gets / sets the authentication type, the default is WriteToHeader

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public HTTPRequestAuthenticationType AuthenticationType { get; set; }

Property Value

Type: HTTPRequestAuthenticationType
See Also

Reference

HTTPWebRequest Class
Bncs.Comms Namespace


HTTPWebRequest.Debugger Property

HTTPWebRequestDebugger Property
Gets or sets a debugger, see the CommsClientDebugger class for more information.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CommsClientDebugger Debugger { get; set; }

Property Value

Type: CommsClientDebugger
See Also

Reference

HTTPWebRequest Class
Bncs.Comms Namespace


HTTPWebRequest.DispatchTime Property

HTTPWebRequestDispatchTime Property
Gets the time span for the last write operation

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public TimeSpan DispatchTime { get; }

Property Value

Type: TimeSpan
See Also

Reference

HTTPWebRequest Class
Bncs.Comms Namespace


HTTPWebRequest.LastError Property

HTTPWebRequestLastError Property
Gets the last error message if any

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public HTTPRequestError LastError { get; }

Property Value

Type: HTTPRequestError
See Also

Reference

HTTPWebRequest Class
Bncs.Comms Namespace


HTTPWebRequest.LastServerResponse Property

HTTPWebRequestLastServerResponse Property
Gets the last read from the server if any

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string LastServerResponse { get; }

Property Value

Type: String
See Also

Reference

HTTPWebRequest Class
Bncs.Comms Namespace


HTTPWebRequest.MethodType Property

HTTPWebRequestMethodType Property
Gets / sets the method type

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public HTTPRequestMethodType MethodType { get; set; }

Property Value

Type: HTTPRequestMethodType
See Also

Reference

HTTPWebRequest Class
Bncs.Comms Namespace


HTTPWebRequest.ReceiveTime Property

HTTPWebRequestReceiveTime Property
Gets the time span for the last read operation

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public TimeSpan ReceiveTime { get; }

Property Value

Type: TimeSpan
See Also

Reference

HTTPWebRequest Class
Bncs.Comms Namespace


HTTPWebRequest.SecurityProtocolType Property

HTTPWebRequestSecurityProtocolType Property
Gets / sets the security protocol type to be used

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public SecurityProtocolType SecurityProtocolType { get; set; }

Property Value

Type: SecurityProtocolType
See Also

Reference

HTTPWebRequest Class
Bncs.Comms Namespace


HTTPWebRequest.ServerTimeoutSeconds Property

HTTPWebRequestServerTimeoutSeconds Property
Gets / sets the server time out, if left at the default zero then the server dictates the time out

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint ServerTimeoutSeconds { get; set; }

Property Value

Type: UInt32
See Also

Reference

HTTPWebRequest Class
Bncs.Comms Namespace


HTTPWebRequest.UseSecurePassword Property

HTTPWebRequestUseSecurePassword Property
Gets / sets the secure password flag, the default is true. This property is only applicable when AuthenticationType is set to SetCredentials

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool UseSecurePassword { get; set; }

Property Value

Type: Boolean
See Also

Reference

HTTPWebRequest Class
Bncs.Comms Namespace


HTTPWebRequest Events

HTTPWebRequest Events

The HTTPWebRequest type exposes the following members.

Events
 | Name | Description
Public event | OnError | Fires when an error occurs
Public event | OnRead | Fires when a string is read from the server
Public event | OnWrite | Fires when a message is written to the server
Top
See Also

Reference

HTTPWebRequest Class
Bncs.Comms Namespace


HTTPWebRequest.OnError Event

HTTPWebRequestOnError Event
Fires when an error occurs

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnErrorEventHandler OnError

Value

Type: Bncs.CommsOnErrorEventHandler
See Also

Reference

HTTPWebRequest Class
Bncs.Comms Namespace


HTTPWebRequest.OnRead Event

HTTPWebRequestOnRead Event
Fires when a string is read from the server

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnServerResponseEventHandler OnRead

Value

Type: Bncs.CommsOnServerResponseEventHandler
See Also

Reference

HTTPWebRequest Class
Bncs.Comms Namespace


HTTPWebRequest.OnWrite Event

HTTPWebRequestOnWrite Event
Fires when a message is written to the server

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnServerDispatchEventHandler OnWrite

Value

Type: Bncs.CommsOnServerDispatchEventHandler
See Also

Reference

HTTPWebRequest Class
Bncs.Comms Namespace


InitialisedEventArgs Class

InitialisedEventArgs Class
Event argument class for OnInitialised event handler.
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.CommsInitialisedEventArgs

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class InitialisedEventArgs : EventArgs

The InitialisedEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | InitialisedEventArgs | Initializes a new instance of the InitialisedEventArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | ConnectionDataItems | List of connection data items.
Public field | Count | Count
Public field | ErrorMessage | Error message
Public field | MoreToFollow | More to follow flag.
Top
See Also

Reference

Bncs.Comms Namespace


InitialisedEventArgs Constructor

InitialisedEventArgs Constructor
Initializes a new instance of the InitialisedEventArgs class

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public InitialisedEventArgs()
See Also

Reference

InitialisedEventArgs Class
Bncs.Comms Namespace


InitialisedEventArgs Fields

InitialisedEventArgs Fields

The InitialisedEventArgs type exposes the following members.

Fields
 | Name | Description
Public field | ConnectionDataItems | List of connection data items.
Public field | Count | Count
Public field | ErrorMessage | Error message
Public field | MoreToFollow | More to follow flag.
Top
See Also

Reference

InitialisedEventArgs Class
Bncs.Comms Namespace


InitialisedEventArgs.ConnectionDataItems Field

InitialisedEventArgsConnectionDataItems Field
List of connection data items.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<ConnectionDataItem> ConnectionDataItems

Field Value

Type: List ConnectionDataItem
See Also

Reference

InitialisedEventArgs Class
Bncs.Comms Namespace


InitialisedEventArgs.Count Field

InitialisedEventArgsCount Field
Count

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Count

Field Value

Type: Int32
See Also

Reference

InitialisedEventArgs Class
Bncs.Comms Namespace


InitialisedEventArgs.ErrorMessage Field

InitialisedEventArgsErrorMessage Field
Error message

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string ErrorMessage

Field Value

Type: String
See Also

Reference

InitialisedEventArgs Class
Bncs.Comms Namespace


InitialisedEventArgs.MoreToFollow Field

InitialisedEventArgsMoreToFollow Field
More to follow flag.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool MoreToFollow

Field Value

Type: Boolean
See Also

Reference

InitialisedEventArgs Class
Bncs.Comms Namespace


InitialisedEventArgs Methods

InitialisedEventArgs Methods

The InitialisedEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

InitialisedEventArgs Class
Bncs.Comms Namespace


InitialisedEventHandler Delegate

InitialisedEventHandler Delegate
Delegate for the OnInitialised event.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void InitialisedEventHandler(
    Object sender,
    InitialisedEventArgs e
)

Parameters

sender
Type: SystemObject
Calling object.
e
Type: Bncs.CommsInitialisedEventArgs
Parameters
See Also

Reference

Bncs.Comms Namespace


InitialisingEventArgs Class

InitialisingEventArgs Class
Event argument class for OnInitialising event handler.
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.CommsInitialisingEventArgs

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class InitialisingEventArgs : EventArgs

The InitialisingEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | InitialisingEventArgs | Initializes a new instance of the InitialisingEventArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | Percentage | Percentage done.
Top
See Also

Reference

Bncs.Comms Namespace


InitialisingEventArgs Constructor

InitialisingEventArgs Constructor
Initializes a new instance of the InitialisingEventArgs class

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public InitialisingEventArgs()
See Also

Reference

InitialisingEventArgs Class
Bncs.Comms Namespace


InitialisingEventArgs Fields

InitialisingEventArgs Fields

The InitialisingEventArgs type exposes the following members.

Fields
 | Name | Description
Public field | Percentage | Percentage done.
Top
See Also

Reference

InitialisingEventArgs Class
Bncs.Comms Namespace


InitialisingEventArgs.Percentage Field

InitialisingEventArgsPercentage Field
Percentage done.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Percentage

Field Value

Type: Int32
See Also

Reference

InitialisingEventArgs Class
Bncs.Comms Namespace


InitialisingEventArgs Methods

InitialisingEventArgs Methods

The InitialisingEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

InitialisingEventArgs Class
Bncs.Comms Namespace


InitialisingEventHandler Delegate

InitialisingEventHandler Delegate
Delegate for the OnInitialising event.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void InitialisingEventHandler(
    Object sender,
    InitialisingEventArgs e
)

Parameters

sender
Type: SystemObject
Calling object.
e
Type: Bncs.CommsInitialisingEventArgs
Parameters
See Also

Reference

Bncs.Comms Namespace


LogServerItemType Enumeration

LogServerItemType Enumeration
Enumeration representing log server item types Tx, Rx, Connected and Disconnected.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum LogServerItemType
Members
Member name | Value | Description
Tx | 0 | Transmitted message log entry
Rx | 1 | Received message log entry
Cn | 2 | Connection established type log entry
Dc | 3 | Connection dropped type log entry
See Also

Reference

Bncs.Comms Namespace


Measurement Enumeration

Measurement Enumeration
Enumeration denoting throughput measurment as being either by bits per second or data packets per second.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum Measurement
Members
Member name | Value | Description
Bps | 0 | Bytes per second.
DPps | 1 | Data packets per second.
See Also

Reference

Bncs.Comms Namespace


OnBufferFullEventArgs Class

OnBufferFullEventArgs Class
Event arguments for the OnBufferFull and OnBufferFull event handlers
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.CommsDispatcherEventArgs
Bncs.CommsOnBufferFullEventArgs

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class OnBufferFullEventArgs : DispatcherEventArgs

The OnBufferFullEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | OnBufferFullEventArgs | Initializes a new instance of the OnBufferFullEventArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | Buffersize | Buffer size.
Public field | Dispatch | If true the handler must be re-called asynchronously with this property set to false to flag that UI processing is now safe. (Inherited from DispatcherEventArgs.)
Top
See Also

Reference

Bncs.Comms Namespace


OnBufferFullEventArgs Constructor

OnBufferFullEventArgs Constructor
Initializes a new instance of the OnBufferFullEventArgs class

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public OnBufferFullEventArgs()
See Also

Reference

OnBufferFullEventArgs Class
Bncs.Comms Namespace


OnBufferFullEventArgs Fields

OnBufferFullEventArgs Fields

The OnBufferFullEventArgs type exposes the following members.

Fields
 | Name | Description
Public field | Buffersize | Buffer size.
Public field | Dispatch | If true the handler must be re-called asynchronously with this property set to false to flag that UI processing is now safe. (Inherited from DispatcherEventArgs.)
Top
See Also

Reference

OnBufferFullEventArgs Class
Bncs.Comms Namespace


OnBufferFullEventArgs.Buffersize Field

OnBufferFullEventArgsBuffersize Field
Buffer size.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Buffersize

Field Value

Type: Int32
See Also

Reference

OnBufferFullEventArgs Class
Bncs.Comms Namespace


OnBufferFullEventArgs Methods

OnBufferFullEventArgs Methods

The OnBufferFullEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

OnBufferFullEventArgs Class
Bncs.Comms Namespace


OnBufferFullEventHandler Delegate

OnBufferFullEventHandler Delegate
Delegate for the OnBufferFull and OnBufferFull event handlers.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void OnBufferFullEventHandler(
    Object sender,
    OnBufferFullEventArgs e,
    ref bool DontWarnAgain
)

Parameters

sender
Type: SystemObject
Calling object
e
Type: Bncs.CommsOnBufferFullEventArgs
Arguments
DontWarnAgain
Type: SystemBoolean
See Also

Reference

Bncs.Comms Namespace


OnConnectionStatusChangedEventArgs Class

OnConnectionStatusChangedEventArgs Class
Event arguments for the OnConnectionStateChanged event handler
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.CommsDispatcherEventArgs
Bncs.CommsOnConnectionStatusChangedEventArgs

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class OnConnectionStatusChangedEventArgs : DispatcherEventArgs

The OnConnectionStatusChangedEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | OnConnectionStatusChangedEventArgs | Initializes a new instance of the OnConnectionStatusChangedEventArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | Dispatch | If true the handler must be re-called asynchronously with this property set to false to flag that UI processing is now safe. (Inherited from DispatcherEventArgs.)
Public field | Instigator | Connection change instigator.
Public field | Status | Connection status
Public field | Type | Connection type
Top
See Also

Reference

Bncs.Comms Namespace


OnConnectionStatusChangedEventArgs Constructor

OnConnectionStatusChangedEventArgs Constructor
Initializes a new instance of the OnConnectionStatusChangedEventArgs class

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public OnConnectionStatusChangedEventArgs()
See Also

Reference

OnConnectionStatusChangedEventArgs Class
Bncs.Comms Namespace


OnConnectionStatusChangedEventArgs Fields

OnConnectionStatusChangedEventArgs Fields

The OnConnectionStatusChangedEventArgs type exposes the following members.

Fields
 | Name | Description
Public field | Dispatch | If true the handler must be re-called asynchronously with this property set to false to flag that UI processing is now safe. (Inherited from DispatcherEventArgs.)
Public field | Instigator | Connection change instigator.
Public field | Status | Connection status
Public field | Type | Connection type
Top
See Also

Reference

OnConnectionStatusChangedEventArgs Class
Bncs.Comms Namespace


OnConnectionStatusChangedEventArgs.Instigator Field

OnConnectionStatusChangedEventArgsInstigator Field
Connection change instigator.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ConnectChangeInstigator Instigator

Field Value

Type: ConnectChangeInstigator
See Also

Reference

OnConnectionStatusChangedEventArgs Class
Bncs.Comms Namespace


OnConnectionStatusChangedEventArgs.Status Field

OnConnectionStatusChangedEventArgsStatus Field
Connection status

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ConnectionStatus Status

Field Value

Type: ConnectionStatus
See Also

Reference

OnConnectionStatusChangedEventArgs Class
Bncs.Comms Namespace


OnConnectionStatusChangedEventArgs.Type Field

OnConnectionStatusChangedEventArgsType Field
Connection type

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ConnectionType Type

Field Value

Type: ConnectionType
See Also

Reference

OnConnectionStatusChangedEventArgs Class
Bncs.Comms Namespace


OnConnectionStatusChangedEventArgs Methods

OnConnectionStatusChangedEventArgs Methods

The OnConnectionStatusChangedEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

OnConnectionStatusChangedEventArgs Class
Bncs.Comms Namespace


OnConnectionStatusChangedEventArgs2 Class

OnConnectionStatusChangedEventArgs2 Class
Event arguments for connection status changed event handler for OnConnectionStateChanged.
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.CommsDispatcherEventArgs
Bncs.CommsOnConnectionStatusChangedEventArgs2

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class OnConnectionStatusChangedEventArgs2 : DispatcherEventArgs

The OnConnectionStatusChangedEventArgs2 type exposes the following members.

Constructors
 | Name | Description
Public method | OnConnectionStatusChangedEventArgs2 | Initializes a new instance of the OnConnectionStatusChangedEventArgs2 class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | Dispatch | If true the handler must be re-called asynchronously with this property set to false to flag that UI processing is now safe. (Inherited from DispatcherEventArgs.)
Public field | Instigator | Instigator
Public field | Status | Status
Public field | Type | Type
Top
See Also

Reference

Bncs.Comms Namespace


OnConnectionStatusChangedEventArgs2 Constructor

OnConnectionStatusChangedEventArgs2 Constructor
Initializes a new instance of the OnConnectionStatusChangedEventArgs2 class

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public OnConnectionStatusChangedEventArgs2()
See Also

Reference

OnConnectionStatusChangedEventArgs2 Class
Bncs.Comms Namespace


OnConnectionStatusChangedEventArgs2 Fields

OnConnectionStatusChangedEventArgs2 Fields

The OnConnectionStatusChangedEventArgs2 type exposes the following members.

Fields
 | Name | Description
Public field | Dispatch | If true the handler must be re-called asynchronously with this property set to false to flag that UI processing is now safe. (Inherited from DispatcherEventArgs.)
Public field | Instigator | Instigator
Public field | Status | Status
Public field | Type | Type
Top
See Also

Reference

OnConnectionStatusChangedEventArgs2 Class
Bncs.Comms Namespace


OnConnectionStatusChangedEventArgs2.Instigator Field

OnConnectionStatusChangedEventArgs2Instigator Field
Instigator

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ConnectChangeInstigator Instigator

Field Value

Type: ConnectChangeInstigator
See Also

Reference

OnConnectionStatusChangedEventArgs2 Class
Bncs.Comms Namespace


OnConnectionStatusChangedEventArgs2.Status Field

OnConnectionStatusChangedEventArgs2Status Field
Status

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ConnectionStatus2 Status

Field Value

Type: ConnectionStatus2
See Also

Reference

OnConnectionStatusChangedEventArgs2 Class
Bncs.Comms Namespace


OnConnectionStatusChangedEventArgs2.Type Field

OnConnectionStatusChangedEventArgs2Type Field
Type

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ConnectionType Type

Field Value

Type: ConnectionType
See Also

Reference

OnConnectionStatusChangedEventArgs2 Class
Bncs.Comms Namespace


OnConnectionStatusChangedEventArgs2 Methods

OnConnectionStatusChangedEventArgs2 Methods

The OnConnectionStatusChangedEventArgs2 type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

OnConnectionStatusChangedEventArgs2 Class
Bncs.Comms Namespace


OnConnectionStatusChangedEventHandler Delegate

OnConnectionStatusChangedEventHandler Delegate
Delegate for the OnConnectionStateChanged event handler.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void OnConnectionStatusChangedEventHandler(
    Object sender,
    OnConnectionStatusChangedEventArgs e
)

Parameters

sender
Type: SystemObject
Calling object
e
Type: Bncs.CommsOnConnectionStatusChangedEventArgs
Arguments
See Also

Reference

Bncs.Comms Namespace


OnConnectionStatusChangedEventHandler2 Delegate

OnConnectionStatusChangedEventHandler2 Delegate
Delegate for OnConnectionStateChanged event handler.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void OnConnectionStatusChangedEventHandler2(
    Object sender,
    OnConnectionStatusChangedEventArgs2 e
)

Parameters

sender
Type: SystemObject
Calling object
e
Type: Bncs.CommsOnConnectionStatusChangedEventArgs2
Parameters
See Also

Reference

Bncs.Comms Namespace


OnDailyRolloverEventHandler Delegate

OnDailyRolloverEventHandler Delegate
Event handler delegate for log roll over.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate string OnDailyRolloverEventHandler(
    Object sender
)

Parameters

sender
Type: SystemObject
Calling object

Return Value

Type: String
A string containing the new file name.
See Also

Reference

Bncs.Comms Namespace


OnDebugEventArgs Class

OnDebugEventArgs Class
OnDebug and OnDebug event handlers
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.CommsDispatcherEventArgs
Bncs.CommsOnDebugEventArgs

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class OnDebugEventArgs : DispatcherEventArgs

The OnDebugEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | OnDebugEventArgs | Initializes a new instance of the OnDebugEventArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | Dispatch | If true the handler must be re-called asynchronously with this property set to false to flag that UI processing is now safe. (Inherited from DispatcherEventArgs.)
Public field | Message | Debug message.
Top
See Also

Reference

Bncs.Comms Namespace


OnDebugEventArgs Constructor

OnDebugEventArgs Constructor
Initializes a new instance of the OnDebugEventArgs class

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public OnDebugEventArgs()
See Also

Reference

OnDebugEventArgs Class
Bncs.Comms Namespace


OnDebugEventArgs Fields

OnDebugEventArgs Fields

The OnDebugEventArgs type exposes the following members.

Fields
 | Name | Description
Public field | Dispatch | If true the handler must be re-called asynchronously with this property set to false to flag that UI processing is now safe. (Inherited from DispatcherEventArgs.)
Public field | Message | Debug message.
Top
See Also

Reference

OnDebugEventArgs Class
Bncs.Comms Namespace


OnDebugEventArgs.Message Field

OnDebugEventArgsMessage Field
Debug message.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Message

Field Value

Type: String
See Also

Reference

OnDebugEventArgs Class
Bncs.Comms Namespace


OnDebugEventArgs Methods

OnDebugEventArgs Methods

The OnDebugEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

OnDebugEventArgs Class
Bncs.Comms Namespace


OnDebugEventHandler Delegate

OnDebugEventHandler Delegate
Delegate for the OnDebug and OnDebug event handlers.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void OnDebugEventHandler(
    Object sender,
    OnDebugEventArgs e
)

Parameters

sender
Type: SystemObject
Calling object
e
Type: Bncs.CommsOnDebugEventArgs
Arguments
See Also

Reference

Bncs.Comms Namespace


OnErrorEventArgs Class

OnErrorEventArgs Class
Event arguments for a server error
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.CommsOnErrorEventArgs

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class OnErrorEventArgs : EventArgs

The OnErrorEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | OnErrorEventArgs | Initializes a new instance of the OnErrorEventArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | Dispatched | Dispatched flag, when false and fired from a thread set to true and dispatch the event handler call before writing to the UI
Public field | Error | The error
Top
See Also

Reference

Bncs.Comms Namespace


OnErrorEventArgs Constructor

OnErrorEventArgs Constructor
Initializes a new instance of the OnErrorEventArgs class

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public OnErrorEventArgs()
See Also

Reference

OnErrorEventArgs Class
Bncs.Comms Namespace


OnErrorEventArgs Fields

OnErrorEventArgs Fields

The OnErrorEventArgs type exposes the following members.

Fields
 | Name | Description
Public field | Dispatched | Dispatched flag, when false and fired from a thread set to true and dispatch the event handler call before writing to the UI
Public field | Error | The error
Top
See Also

Reference

OnErrorEventArgs Class
Bncs.Comms Namespace


OnErrorEventArgs.Dispatched Field

OnErrorEventArgsDispatched Field
Dispatched flag, when false and fired from a thread set to true and dispatch the event handler call before writing to the UI

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Dispatched

Field Value

Type: Boolean
See Also

Reference

OnErrorEventArgs Class
Bncs.Comms Namespace


OnErrorEventArgs.Error Field

OnErrorEventArgsError Field
The error

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public HTTPRequestError Error

Field Value

Type: HTTPRequestError
See Also

Reference

OnErrorEventArgs Class
Bncs.Comms Namespace


OnErrorEventArgs Methods

OnErrorEventArgs Methods

The OnErrorEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

OnErrorEventArgs Class
Bncs.Comms Namespace


OnErrorEventHandler Delegate

OnErrorEventHandler Delegate
Delegate for OnError event

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void OnErrorEventHandler(
    Object sender,
    OnErrorEventArgs e
)

Parameters

sender
Type: SystemObject
Calling object
e
Type: Bncs.CommsOnErrorEventArgs
Arguments
See Also

Reference

Bncs.Comms Namespace


OnExceptionEventArgs Class

OnExceptionEventArgs Class
OnException and OnException event handlers
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.CommsDispatcherEventArgs
Bncs.CommsOnExceptionEventArgs

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class OnExceptionEventArgs : DispatcherEventArgs

The OnExceptionEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | OnExceptionEventArgs | Initializes a new instance of the OnExceptionEventArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | Dispatch | If true the handler must be re-called asynchronously with this property set to false to flag that UI processing is now safe. (Inherited from DispatcherEventArgs.)
Public field | Exception | The exception caught.
Public field | IsConnected | Connected flag.
Top
See Also

Reference

Bncs.Comms Namespace


OnExceptionEventArgs Constructor

OnExceptionEventArgs Constructor
Initializes a new instance of the OnExceptionEventArgs class

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public OnExceptionEventArgs()
See Also

Reference

OnExceptionEventArgs Class
Bncs.Comms Namespace


OnExceptionEventArgs Fields

OnExceptionEventArgs Fields

The OnExceptionEventArgs type exposes the following members.

Fields
 | Name | Description
Public field | Dispatch | If true the handler must be re-called asynchronously with this property set to false to flag that UI processing is now safe. (Inherited from DispatcherEventArgs.)
Public field | Exception | The exception caught.
Public field | IsConnected | Connected flag.
Top
See Also

Reference

OnExceptionEventArgs Class
Bncs.Comms Namespace


OnExceptionEventArgs.Exception Field

OnExceptionEventArgsException Field
The exception caught.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Exception Exception

Field Value

Type: Exception
See Also

Reference

OnExceptionEventArgs Class
Bncs.Comms Namespace


OnExceptionEventArgs.IsConnected Field

OnExceptionEventArgsIsConnected Field
Connected flag.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool IsConnected

Field Value

Type: Boolean
See Also

Reference

OnExceptionEventArgs Class
Bncs.Comms Namespace


OnExceptionEventArgs Methods

OnExceptionEventArgs Methods

The OnExceptionEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

OnExceptionEventArgs Class
Bncs.Comms Namespace


OnExceptionEventHandler Delegate

OnExceptionEventHandler Delegate
Delegate for the OnException and OnException event handlers.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate ExceptionResponse OnExceptionEventHandler(
    Object sender,
    OnExceptionEventArgs e
)

Parameters

sender
Type: SystemObject
Calling object
e
Type: Bncs.CommsOnExceptionEventArgs
Arguments

Return Value

Type: ExceptionResponse
An exception response telling the caller how to handle the exception
See Also

Reference

Bncs.Comms Namespace


OnPersecondChangeEventArgs Class

OnPersecondChangeEventArgs Class
Event argument type of the OnPersecondChange event handler.
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.CommsDispatcherEventArgs
Bncs.CommsOnPersecondChangeEventArgs

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class OnPersecondChangeEventArgs : DispatcherEventArgs

The OnPersecondChangeEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | OnPersecondChangeEventArgs | Initializes a new instance of the OnPersecondChangeEventArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | Dispatch | If true the handler must be re-called asynchronously with this property set to false to flag that UI processing is now safe. (Inherited from DispatcherEventArgs.)
Public field | Measurement | Measurment type
Public field | PerSecond | Count per second
Public field | ResetOccured | Reset flag
Top
See Also

Reference

Bncs.Comms Namespace


OnPersecondChangeEventArgs Constructor

OnPersecondChangeEventArgs Constructor
Initializes a new instance of the OnPersecondChangeEventArgs class

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public OnPersecondChangeEventArgs()
See Also

Reference

OnPersecondChangeEventArgs Class
Bncs.Comms Namespace


OnPersecondChangeEventArgs Fields

OnPersecondChangeEventArgs Fields

The OnPersecondChangeEventArgs type exposes the following members.

Fields
 | Name | Description
Public field | Dispatch | If true the handler must be re-called asynchronously with this property set to false to flag that UI processing is now safe. (Inherited from DispatcherEventArgs.)
Public field | Measurement | Measurment type
Public field | PerSecond | Count per second
Public field | ResetOccured | Reset flag
Top
See Also

Reference

OnPersecondChangeEventArgs Class
Bncs.Comms Namespace


OnPersecondChangeEventArgs.Measurement Field

OnPersecondChangeEventArgsMeasurement Field
Measurment type

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Measurement Measurement

Field Value

Type: Measurement
See Also

Reference

OnPersecondChangeEventArgs Class
Bncs.Comms Namespace


OnPersecondChangeEventArgs.PerSecond Field

OnPersecondChangeEventArgsPerSecond Field
Count per second

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ulong PerSecond

Field Value

Type: UInt64
See Also

Reference

OnPersecondChangeEventArgs Class
Bncs.Comms Namespace


OnPersecondChangeEventArgs.ResetOccured Field

OnPersecondChangeEventArgsResetOccured Field
Reset flag

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool ResetOccured

Field Value

Type: Boolean
See Also

Reference

OnPersecondChangeEventArgs Class
Bncs.Comms Namespace


OnPersecondChangeEventArgs Methods

OnPersecondChangeEventArgs Methods

The OnPersecondChangeEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

OnPersecondChangeEventArgs Class
Bncs.Comms Namespace


OnPersecondChangeEventHandler Delegate

OnPersecondChangeEventHandler Delegate
Event delegate type of the OnPersecondChange event handler.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void OnPersecondChangeEventHandler(
    Object sender,
    OnPersecondChangeEventArgs e
)

Parameters

sender
Type: SystemObject
e
Type: Bncs.CommsOnPersecondChangeEventArgs
See Also

Reference

Bncs.Comms Namespace


OnReadTimeOutEventArgs Class

OnReadTimeOutEventArgs Class
OnReadTimeOut and OnReadTimeOut event handlers
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.CommsDispatcherEventArgs
Bncs.CommsOnReadTimeOutEventArgs

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class OnReadTimeOutEventArgs : DispatcherEventArgs

The OnReadTimeOutEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | OnReadTimeOutEventArgs | Initializes a new instance of the OnReadTimeOutEventArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | Dispatch | If true the handler must be re-called asynchronously with this property set to false to flag that UI processing is now safe. (Inherited from DispatcherEventArgs.)
Public field | TimeOutMilliseconds | Reports the time out setting in milliseconds.
Top
See Also

Reference

Bncs.Comms Namespace


OnReadTimeOutEventArgs Constructor

OnReadTimeOutEventArgs Constructor
Initializes a new instance of the OnReadTimeOutEventArgs class

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public OnReadTimeOutEventArgs()
See Also

Reference

OnReadTimeOutEventArgs Class
Bncs.Comms Namespace


OnReadTimeOutEventArgs Fields

OnReadTimeOutEventArgs Fields

The OnReadTimeOutEventArgs type exposes the following members.

Fields
 | Name | Description
Public field | Dispatch | If true the handler must be re-called asynchronously with this property set to false to flag that UI processing is now safe. (Inherited from DispatcherEventArgs.)
Public field | TimeOutMilliseconds | Reports the time out setting in milliseconds.
Top
See Also

Reference

OnReadTimeOutEventArgs Class
Bncs.Comms Namespace


OnReadTimeOutEventArgs.TimeOutMilliseconds Field

OnReadTimeOutEventArgsTimeOutMilliseconds Field
Reports the time out setting in milliseconds.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int TimeOutMilliseconds

Field Value

Type: Int32
See Also

Reference

OnReadTimeOutEventArgs Class
Bncs.Comms Namespace


OnReadTimeOutEventArgs Methods

OnReadTimeOutEventArgs Methods

The OnReadTimeOutEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

OnReadTimeOutEventArgs Class
Bncs.Comms Namespace


OnReadTimeOutEventHandler Delegate

OnReadTimeOutEventHandler Delegate
Delegate for the OnReadTimeOut and OnReadTimeOut event handlers.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void OnReadTimeOutEventHandler(
    Object sender,
    OnReadTimeOutEventArgs e
)

Parameters

sender
Type: SystemObject
Calling object
e
Type: Bncs.CommsOnReadTimeOutEventArgs
Arguments
See Also

Reference

Bncs.Comms Namespace


OnReceiveEventArgs Class

OnReceiveEventArgs Class
Event arguments class for Receive and Receive event handlers.
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.CommsDispatcherEventArgs
Bncs.CommsOnReceiveEventArgs
Bncs.CommsOnSendEventArgs

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class OnReceiveEventArgs : DispatcherEventArgs

The OnReceiveEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | OnReceiveEventArgs | Initializes a new instance of the OnReceiveEventArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | AsHexString | Bytes read as a hexidecimal string.
Public field | Buffer | Array of bytes read.
Public field | Dispatch | If true the handler must be re-called asynchronously with this property set to false to flag that UI processing is now safe. (Inherited from DispatcherEventArgs.)
Top
See Also

Reference

Bncs.Comms Namespace


OnReceiveEventArgs Constructor

OnReceiveEventArgs Constructor
Initializes a new instance of the OnReceiveEventArgs class

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public OnReceiveEventArgs()
See Also

Reference

OnReceiveEventArgs Class
Bncs.Comms Namespace


OnReceiveEventArgs Fields

OnReceiveEventArgs Fields

The OnReceiveEventArgs type exposes the following members.

Fields
 | Name | Description
Public field | AsHexString | Bytes read as a hexidecimal string.
Public field | Buffer | Array of bytes read.
Public field | Dispatch | If true the handler must be re-called asynchronously with this property set to false to flag that UI processing is now safe. (Inherited from DispatcherEventArgs.)
Top
See Also

Reference

OnReceiveEventArgs Class
Bncs.Comms Namespace


OnReceiveEventArgs.AsHexString Field

OnReceiveEventArgsAsHexString Field
Bytes read as a hexidecimal string.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string AsHexString

Field Value

Type: String
See Also

Reference

OnReceiveEventArgs Class
Bncs.Comms Namespace


OnReceiveEventArgs.Buffer Field

OnReceiveEventArgsBuffer Field
Array of bytes read.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[] Buffer

Field Value

Type: Byte
See Also

Reference

OnReceiveEventArgs Class
Bncs.Comms Namespace


OnReceiveEventArgs Methods

OnReceiveEventArgs Methods

The OnReceiveEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

OnReceiveEventArgs Class
Bncs.Comms Namespace


OnReceiveEventHandler Delegate

OnReceiveEventHandler Delegate
Delegate for the Receive and Receive event handlers.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void OnReceiveEventHandler(
    Object sender,
    OnReceiveEventArgs e
)

Parameters

sender
Type: SystemObject
Calling object
e
Type: Bncs.CommsOnReceiveEventArgs
Parameters
See Also

Reference

Bncs.Comms Namespace


OnSendEventArgs Class

OnSendEventArgs Class
Event arguments class for Sent and Sent event handlers.
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.CommsDispatcherEventArgs
Bncs.CommsOnReceiveEventArgs
Bncs.CommsOnSendEventArgs

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class OnSendEventArgs : OnReceiveEventArgs

The OnSendEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | OnSendEventArgs | Initializes a new instance of the OnSendEventArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | AsHexString | Bytes read as a hexidecimal string. (Inherited from OnReceiveEventArgs.)
Public field | Buffer | Array of bytes read. (Inherited from OnReceiveEventArgs.)
Public field | Dispatch | If true the handler must be re-called asynchronously with this property set to false to flag that UI processing is now safe. (Inherited from DispatcherEventArgs.)
Top
See Also

Reference

Bncs.Comms Namespace


OnSendEventArgs Constructor

OnSendEventArgs Constructor
Initializes a new instance of the OnSendEventArgs class

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public OnSendEventArgs()
See Also

Reference

OnSendEventArgs Class
Bncs.Comms Namespace


OnSendEventArgs Fields

OnSendEventArgs Fields

The OnSendEventArgs type exposes the following members.

Fields
 | Name | Description
Public field | AsHexString | Bytes read as a hexidecimal string. (Inherited from OnReceiveEventArgs.)
Public field | Buffer | Array of bytes read. (Inherited from OnReceiveEventArgs.)
Public field | Dispatch | If true the handler must be re-called asynchronously with this property set to false to flag that UI processing is now safe. (Inherited from DispatcherEventArgs.)
Top
See Also

Reference

OnSendEventArgs Class
Bncs.Comms Namespace


OnSendEventArgs Methods

OnSendEventArgs Methods

The OnSendEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

OnSendEventArgs Class
Bncs.Comms Namespace


OnSendEventHandler Delegate

OnSendEventHandler Delegate
Delegate for the Sent and Sent event handlers.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void OnSendEventHandler(
    Object sender,
    OnSendEventArgs e
)

Parameters

sender
Type: SystemObject
Calling object
e
Type: Bncs.CommsOnSendEventArgs
Parameters
See Also

Reference

Bncs.Comms Namespace


OnServerDispatchEventArgs Class

OnServerDispatchEventArgs Class
Event arguments to a server dispatch OnWrite
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.CommsOnServerDispatchEventArgs
Bncs.CommsOnServerResponseEventArgs

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class OnServerDispatchEventArgs : EventArgs

The OnServerDispatchEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | OnServerDispatchEventArgs | Initializes a new instance of the OnServerDispatchEventArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | Dispatched | Dispatched flag, when false and fired from a thread set to true and dispatch the event handler call before writing to the UI
Public field | Span | Amount of time taken to send the message
Top
See Also

Reference

Bncs.Comms Namespace


OnServerDispatchEventArgs Constructor

OnServerDispatchEventArgs Constructor
Initializes a new instance of the OnServerDispatchEventArgs class

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public OnServerDispatchEventArgs()
See Also

Reference

OnServerDispatchEventArgs Class
Bncs.Comms Namespace


OnServerDispatchEventArgs Fields

OnServerDispatchEventArgs Fields

The OnServerDispatchEventArgs type exposes the following members.

Fields
 | Name | Description
Public field | Dispatched | Dispatched flag, when false and fired from a thread set to true and dispatch the event handler call before writing to the UI
Public field | Span | Amount of time taken to send the message
Top
See Also

Reference

OnServerDispatchEventArgs Class
Bncs.Comms Namespace


OnServerDispatchEventArgs.Dispatched Field

OnServerDispatchEventArgsDispatched Field
Dispatched flag, when false and fired from a thread set to true and dispatch the event handler call before writing to the UI

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Dispatched

Field Value

Type: Boolean
See Also

Reference

OnServerDispatchEventArgs Class
Bncs.Comms Namespace


OnServerDispatchEventArgs.Span Field

OnServerDispatchEventArgsSpan Field
Amount of time taken to send the message

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public TimeSpan Span

Field Value

Type: TimeSpan
See Also

Reference

OnServerDispatchEventArgs Class
Bncs.Comms Namespace


OnServerDispatchEventArgs Methods

OnServerDispatchEventArgs Methods

The OnServerDispatchEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

OnServerDispatchEventArgs Class
Bncs.Comms Namespace


OnServerDispatchEventHandler Delegate

OnServerDispatchEventHandler Delegate
Delegate for OnWrite

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void OnServerDispatchEventHandler(
    Object sender,
    OnServerDispatchEventArgs e
)

Parameters

sender
Type: SystemObject
Calling object
e
Type: Bncs.CommsOnServerDispatchEventArgs
Arguments
See Also

Reference

Bncs.Comms Namespace


OnServerResponseEventArgs Class

OnServerResponseEventArgs Class
Event arguments for a server response to a OnRead
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.CommsOnServerDispatchEventArgs
Bncs.CommsOnServerResponseEventArgs

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class OnServerResponseEventArgs : OnServerDispatchEventArgs

The OnServerResponseEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | OnServerResponseEventArgs | Initializes a new instance of the OnServerResponseEventArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | Dispatched | Dispatched flag, when false and fired from a thread set to true and dispatch the event handler call before writing to the UI (Inherited from OnServerDispatchEventArgs.)
Public field | Message | Message received
Public field | Span | Amount of time taken to send the message (Inherited from OnServerDispatchEventArgs.)
Top
See Also

Reference

Bncs.Comms Namespace


OnServerResponseEventArgs Constructor

OnServerResponseEventArgs Constructor
Initializes a new instance of the OnServerResponseEventArgs class

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public OnServerResponseEventArgs()
See Also

Reference

OnServerResponseEventArgs Class
Bncs.Comms Namespace


OnServerResponseEventArgs Fields

OnServerResponseEventArgs Fields

The OnServerResponseEventArgs type exposes the following members.

Fields
 | Name | Description
Public field | Dispatched | Dispatched flag, when false and fired from a thread set to true and dispatch the event handler call before writing to the UI (Inherited from OnServerDispatchEventArgs.)
Public field | Message | Message received
Public field | Span | Amount of time taken to send the message (Inherited from OnServerDispatchEventArgs.)
Top
See Also

Reference

OnServerResponseEventArgs Class
Bncs.Comms Namespace


OnServerResponseEventArgs.Message Field

OnServerResponseEventArgsMessage Field
Message received

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Message

Field Value

Type: String
See Also

Reference

OnServerResponseEventArgs Class
Bncs.Comms Namespace


OnServerResponseEventArgs Methods

OnServerResponseEventArgs Methods

The OnServerResponseEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

OnServerResponseEventArgs Class
Bncs.Comms Namespace


OnServerResponseEventHandler Delegate

OnServerResponseEventHandler Delegate
Delegate for OnRead event

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void OnServerResponseEventHandler(
    Object sender,
    OnServerResponseEventArgs e
)

Parameters

sender
Type: SystemObject
Calling object
e
Type: Bncs.CommsOnServerResponseEventArgs
Arguments
See Also

Reference

Bncs.Comms Namespace


OnTxRxDebugEventArgs Class

OnTxRxDebugEventArgs Class
OnDebug and OnDebug event handlers
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.CommsDispatcherEventArgs
Bncs.CommsOnTxRxDebugEventArgs

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class OnTxRxDebugEventArgs : DispatcherEventArgs

The OnTxRxDebugEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | OnTxRxDebugEventArgs | Initializes a new instance of the OnTxRxDebugEventArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | Annotate | Annotate flag
Public field | Content | Content, Tx, Rx or both
Public field | DataType | Content data type, byte array or string
Public field | Dispatch | If true the handler must be re-called asynchronously with this property set to false to flag that UI processing is now safe. (Inherited from DispatcherEventArgs.)
Public field | Format | Content format, dated or raw
Public field | IsTx | Tx/Rx Flag
Public field | Message | Debug message.
Top
See Also

Reference

Bncs.Comms Namespace


OnTxRxDebugEventArgs Constructor

OnTxRxDebugEventArgs Constructor
Initializes a new instance of the OnTxRxDebugEventArgs class

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public OnTxRxDebugEventArgs()
See Also

Reference

OnTxRxDebugEventArgs Class
Bncs.Comms Namespace


OnTxRxDebugEventArgs Fields

OnTxRxDebugEventArgs Fields

The OnTxRxDebugEventArgs type exposes the following members.

Fields
 | Name | Description
Public field | Annotate | Annotate flag
Public field | Content | Content, Tx, Rx or both
Public field | DataType | Content data type, byte array or string
Public field | Dispatch | If true the handler must be re-called asynchronously with this property set to false to flag that UI processing is now safe. (Inherited from DispatcherEventArgs.)
Public field | Format | Content format, dated or raw
Public field | IsTx | Tx/Rx Flag
Public field | Message | Debug message.
Top
See Also

Reference

OnTxRxDebugEventArgs Class
Bncs.Comms Namespace


OnTxRxDebugEventArgs.Annotate Field

OnTxRxDebugEventArgsAnnotate Field
Annotate flag

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Annotate

Field Value

Type: Boolean
See Also

Reference

OnTxRxDebugEventArgs Class
Bncs.Comms Namespace


OnTxRxDebugEventArgs.Content Field

OnTxRxDebugEventArgsContent Field
Content, Tx, Rx or both

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public DebugContent Content

Field Value

Type: DebugContent
See Also

Reference

OnTxRxDebugEventArgs Class
Bncs.Comms Namespace


OnTxRxDebugEventArgs.DataType Field

OnTxRxDebugEventArgsDataType Field
Content data type, byte array or string

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ContentDataType DataType

Field Value

Type: ContentDataType
See Also

Reference

OnTxRxDebugEventArgs Class
Bncs.Comms Namespace


OnTxRxDebugEventArgs.Format Field

OnTxRxDebugEventArgsFormat Field
Content format, dated or raw

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ContentFormat Format

Field Value

Type: ContentFormat
See Also

Reference

OnTxRxDebugEventArgs Class
Bncs.Comms Namespace


OnTxRxDebugEventArgs.IsTx Field

OnTxRxDebugEventArgsIsTx Field
Tx/Rx Flag

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Nullable<bool> IsTx

Field Value

Type: Nullable Boolean
See Also

Reference

OnTxRxDebugEventArgs Class
Bncs.Comms Namespace


OnTxRxDebugEventArgs.Message Field

OnTxRxDebugEventArgsMessage Field
Debug message.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Object Message

Field Value

Type: Object
See Also

Reference

OnTxRxDebugEventArgs Class
Bncs.Comms Namespace


OnTxRxDebugEventArgs Methods

OnTxRxDebugEventArgs Methods

The OnTxRxDebugEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

OnTxRxDebugEventArgs Class
Bncs.Comms Namespace


OnTxRxDebugEventHandler Delegate

OnTxRxDebugEventHandler Delegate
Delegate for the OnDebug and OnDebug event handlers.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void OnTxRxDebugEventHandler(
    Object sender,
    OnTxRxDebugEventArgs e
)

Parameters

sender
Type: SystemObject
Calling object
e
Type: Bncs.CommsOnTxRxDebugEventArgs
Arguments
See Also

Reference

Bncs.Comms Namespace


PingStringResult Class

PingStringResult Class
A class encapsulating a ping result.
Inheritance Hierarchy
SystemObject
Bncs.CommsPingStringResult

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class PingStringResult

The PingStringResult type exposes the following members.

Constructors
 | Name | Description
Public method | PingStringResult | Initializes a new instance of the PingStringResult class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | Message | Gets or sets the message.
Public field | Status | Gets or sets the IP status.
Top
See Also

Reference

Bncs.Comms Namespace


PingStringResult Constructor

PingStringResult Constructor
Initializes a new instance of the PingStringResult class

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public PingStringResult()
See Also

Reference

PingStringResult Class
Bncs.Comms Namespace


PingStringResult Fields

PingStringResult Fields

The PingStringResult type exposes the following members.

Fields
 | Name | Description
Public field | Message | Gets or sets the message.
Public field | Status | Gets or sets the IP status.
Top
See Also

Reference

PingStringResult Class
Bncs.Comms Namespace


PingStringResult.Message Field

PingStringResultMessage Field
Gets or sets the message.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Message

Field Value

Type: String
See Also

Reference

PingStringResult Class
Bncs.Comms Namespace


PingStringResult.Status Field

PingStringResultStatus Field
Gets or sets the IP status.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public IPStatus Status

Field Value

Type: IPStatus
See Also

Reference

PingStringResult Class
Bncs.Comms Namespace


PingStringResult Methods

PingStringResult Methods

The PingStringResult type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

PingStringResult Class
Bncs.Comms Namespace


ProcessRole Enumeration

ProcessRole Enumeration
Enumeration representing process roles.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum ProcessRole
Members
Member name | Value | Description
Client | 0 |
Server | 1 |
See Also

Reference

Bncs.Comms Namespace


RegexStore Class

RegexStore Class
A static class that retrieves some popular regular expressions
Inheritance Hierarchy
SystemObject
Bncs.CommsRegexStore

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static class RegexStore

The RegexStore type exposes the following members.

Methods
Name | Description
Concatenate | Joins two regular expressions by removing the firsts trailing $ and the seconds leading ^ seperated by the supplied delimiter
GetNumberedDate | Gets a regex for a numeric type date, matches: d/m/yyyy, dd/m/yyyy, d/mm/yyyy, dd/mm/yyyy
GetTextDate |
GetTimeToMillisecond |
GetTimeToMinute |
GetTimeToSecond |
Top
See Also

Reference

Bncs.Comms Namespace


RegexStore Methods

RegexStore Methods

The RegexStore type exposes the following members.

Methods
Name | Description
Concatenate | Joins two regular expressions by removing the firsts trailing $ and the seconds leading ^ seperated by the supplied delimiter
GetNumberedDate | Gets a regex for a numeric type date, matches: d/m/yyyy, dd/m/yyyy, d/mm/yyyy, dd/mm/yyyy
GetTextDate |
GetTimeToMillisecond |
GetTimeToMinute |
GetTimeToSecond |
Top
See Also

Reference

RegexStore Class
Bncs.Comms Namespace


RegexStore.Concatenate Method

RegexStoreConcatenate Method
Joins two regular expressions by removing the firsts trailing $ and the seconds leading ^ seperated by the supplied delimiter

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string Concatenate(
    string regex1_,
    string delimiter_,
    string regex2_
)

Parameters

regex1_
Type: SystemString
First regular expression
delimiter_
Type: SystemString
Delimiter
regex2_
Type: SystemString
Second regular expression

Return Value

Type: String
An appropriate regular expression as a string
See Also

Reference

RegexStore Class
Bncs.Comms Namespace


RegexStore.GetNumberedDate Method

RegexStoreGetNumberedDate Method
Gets a regex for a numeric type date, matches: d/m/yyyy, dd/m/yyyy, d/mm/yyyy, dd/mm/yyyy

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string GetNumberedDate()

Return Value

Type: String
An appropriate regular expression as a string
See Also

Reference

RegexStore Class
Bncs.Comms Namespace


RegexStore.GetTextDate Method

RegexStoreGetTextDate Method

[Missing <summary> documentation for "M:Bncs.Comms.RegexStore.GetTextDate"]

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string GetTextDate()

Return Value

Type: String

[Missing <returns> documentation for "M:Bncs.Comms.RegexStore.GetTextDate"]

See Also

Reference

RegexStore Class
Bncs.Comms Namespace


RegexStore.GetTimeToMillisecond Method

RegexStoreGetTimeToMillisecond Method

[Missing <summary> documentation for "M:Bncs.Comms.RegexStore.GetTimeToMillisecond"]

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string GetTimeToMillisecond()

Return Value

Type: String

[Missing <returns> documentation for "M:Bncs.Comms.RegexStore.GetTimeToMillisecond"]

See Also

Reference

RegexStore Class
Bncs.Comms Namespace


RegexStore.GetTimeToMinute Method

RegexStoreGetTimeToMinute Method

[Missing <summary> documentation for "M:Bncs.Comms.RegexStore.GetTimeToMinute"]

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string GetTimeToMinute()

Return Value

Type: String

[Missing <returns> documentation for "M:Bncs.Comms.RegexStore.GetTimeToMinute"]

See Also

Reference

RegexStore Class
Bncs.Comms Namespace


RegexStore.GetTimeToSecond Method

RegexStoreGetTimeToSecond Method

[Missing <summary> documentation for "M:Bncs.Comms.RegexStore.GetTimeToSecond"]

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string GetTimeToSecond()

Return Value

Type: String

[Missing <returns> documentation for "M:Bncs.Comms.RegexStore.GetTimeToSecond"]

See Also

Reference

RegexStore Class
Bncs.Comms Namespace


ReplayEventArgs Class

ReplayEventArgs Class
Event argument class for Bncs.Comms.CCDLogServer.OnReplay event handler.
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.CommsReplayEventArgs

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class ReplayEventArgs : EventArgs

The ReplayEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | ReplayEventArgs | Initializes a new instance of the ReplayEventArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | DispatchType | Dispatch type.
Public field | IsFinalMessage | Final message flag
Public field | Message | Message
Public field | TimeStamp | Time stamp
Top
See Also

Reference

Bncs.Comms Namespace


ReplayEventArgs Constructor

ReplayEventArgs Constructor
Initializes a new instance of the ReplayEventArgs class

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ReplayEventArgs()
See Also

Reference

ReplayEventArgs Class
Bncs.Comms Namespace


ReplayEventArgs Fields

ReplayEventArgs Fields

The ReplayEventArgs type exposes the following members.

Fields
 | Name | Description
Public field | DispatchType | Dispatch type.
Public field | IsFinalMessage | Final message flag
Public field | Message | Message
Public field | TimeStamp | Time stamp
Top
See Also

Reference

ReplayEventArgs Class
Bncs.Comms Namespace


ReplayEventArgs.DispatchType Field

ReplayEventArgsDispatchType Field
Dispatch type.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public LogServerItemType DispatchType

Field Value

Type: LogServerItemType
See Also

Reference

ReplayEventArgs Class
Bncs.Comms Namespace


ReplayEventArgs.IsFinalMessage Field

ReplayEventArgsIsFinalMessage Field
Final message flag

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool IsFinalMessage

Field Value

Type: Boolean
See Also

Reference

ReplayEventArgs Class
Bncs.Comms Namespace


ReplayEventArgs.Message Field

ReplayEventArgsMessage Field
Message

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[] Message

Field Value

Type: Byte
See Also

Reference

ReplayEventArgs Class
Bncs.Comms Namespace


ReplayEventArgs.TimeStamp Field

ReplayEventArgsTimeStamp Field
Time stamp

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public DateTime TimeStamp

Field Value

Type: DateTime
See Also

Reference

ReplayEventArgs Class
Bncs.Comms Namespace


ReplayEventArgs Methods

ReplayEventArgs Methods

The ReplayEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

ReplayEventArgs Class
Bncs.Comms Namespace


ReplayEventHandler Delegate

ReplayEventHandler Delegate
Delegate for the OnReplay event.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void ReplayEventHandler(
    Object sender,
    ReplayEventArgs e
)

Parameters

sender
Type: SystemObject
Calling object.
e
Type: Bncs.CommsReplayEventArgs
Parameters
See Also

Reference

Bncs.Comms Namespace


ReplayResult Enumeration

ReplayResult Enumeration
Enumeration representing log replay results.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum ReplayResult
Members
Member name | Value | Description
Failure | 0 |
Success | 1 |
SuccessIgnore | 2 |
SuccessEof | 3 |
AlreadyRunning | 4 |
CallbackNotDefined | 5 |
See Also

Reference

Bncs.Comms Namespace


ReplayStatus Enumeration

ReplayStatus Enumeration
Enumeration representing log replay status.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum ReplayStatus
Members
Member name | Value | Description
Stopped | 0 |
Initialising | 1 |
Playing | 2 |
Paused | 3 |
See Also

Reference

Bncs.Comms Namespace


ResolvedUri Class

ResolvedUri Class
Class that contains a URI or a URI resolved from a host name or an error message
Inheritance Hierarchy
SystemObject
Bncs.CommsResolvedUri

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class ResolvedUri

The ResolvedUri type exposes the following members.

Constructors
 | Name | Description
Public method | ResolvedUri | Constructor that takes a string containing a host name to be resolved or an IP address.
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Gets the string representation of this instance (Overrides ObjectToString.)
Top
Properties
 | Name | Description
Public property | ErrorMessage | Gets the error message if any else returns null
Public property | HasValidUri | Gets a value indicating if the URI is valid
Public property | IpAddress | Gets the URI as a string minus the prepended protocol
Public property | Uri | Gets the URI or null if not resolved
Public property | Url | Gets the URI as a string
Public property | WasResolvedFromHostName | Gets a value indicating if the if the URI was resolved from a host name
Top
See Also

Reference

Bncs.Comms Namespace


ResolvedUri Constructor

ResolvedUri Constructor
Constructor that takes a string containing a host name to be resolved or an IP address.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ResolvedUri(
    string urlOrHostname_,
    bool secure_ = false
)

Parameters

urlOrHostname_
Type: SystemString
The URL or a host name to resolve
secure_ (Optional)
Type: SystemBoolean
Flag for prepending the protocol to the IP address, if true it will return https else http
See Also

Reference

ResolvedUri Class
Bncs.Comms Namespace


ResolvedUri Methods

ResolvedUri Methods

The ResolvedUri type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Gets the string representation of this instance (Overrides ObjectToString.)
Top
See Also

Reference

ResolvedUri Class
Bncs.Comms Namespace


ResolvedUri.ToString Method

ResolvedUriToString Method
Gets the string representation of this instance

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
The URI and, if resolved from a host name, the host name in square parenthesis. If no URI could be validated returns the error message.
See Also

Reference

ResolvedUri Class
Bncs.Comms Namespace


ResolvedUri Properties

ResolvedUri Properties

The ResolvedUri type exposes the following members.

Properties
 | Name | Description
Public property | ErrorMessage | Gets the error message if any else returns null
Public property | HasValidUri | Gets a value indicating if the URI is valid
Public property | IpAddress | Gets the URI as a string minus the prepended protocol
Public property | Uri | Gets the URI or null if not resolved
Public property | Url | Gets the URI as a string
Public property | WasResolvedFromHostName | Gets a value indicating if the if the URI was resolved from a host name
Top
See Also

Reference

ResolvedUri Class
Bncs.Comms Namespace


ResolvedUri.ErrorMessage Property

ResolvedUriErrorMessage Property
Gets the error message if any else returns null

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string ErrorMessage { get; }

Property Value

Type: String
See Also

Reference

ResolvedUri Class
Bncs.Comms Namespace


ResolvedUri.HasValidUri Property

ResolvedUriHasValidUri Property
Gets a value indicating if the URI is valid

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool HasValidUri { get; }

Property Value

Type: Boolean
See Also

Reference

ResolvedUri Class
Bncs.Comms Namespace


ResolvedUri.IpAddress Property

ResolvedUriIpAddress Property
Gets the URI as a string minus the prepended protocol

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string IpAddress { get; }

Property Value

Type: String
See Also

Reference

ResolvedUri Class
Bncs.Comms Namespace


ResolvedUri.Uri Property

ResolvedUriUri Property
Gets the URI or null if not resolved

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Uri Uri { get; }

Property Value

Type: Uri
See Also

Reference

ResolvedUri Class
Bncs.Comms Namespace


ResolvedUri.Url Property

ResolvedUriUrl Property
Gets the URI as a string

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Url { get; }

Property Value

Type: String
See Also

Reference

ResolvedUri Class
Bncs.Comms Namespace


ResolvedUri.WasResolvedFromHostName Property

ResolvedUriWasResolvedFromHostName Property
Gets a value indicating if the if the URI was resolved from a host name

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool WasResolvedFromHostName { get; }

Property Value

Type: Boolean
See Also

Reference

ResolvedUri Class
Bncs.Comms Namespace


SystemSerialPorts Class

SystemSerialPorts Class
Static class for retrieving serial port lists
Inheritance Hierarchy
SystemObject
Bncs.CommsSystemSerialPorts

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static class SystemSerialPorts

The SystemSerialPorts type exposes the following members.

Methods
Name | Description
GetAvailableSerialPorts | Gets a list of available serial ports, i.e. ports not currently in use
GetNextFreeSerialPortIndex | Gets the next serial port index that is not in use
GetSystemSerialPorts | Gets a list of all serial ports on the system
Top
See Also

Reference

Bncs.Comms Namespace


SystemSerialPorts Methods

SystemSerialPorts Methods

The SystemSerialPorts type exposes the following members.

Methods
Name | Description
GetAvailableSerialPorts | Gets a list of available serial ports, i.e. ports not currently in use
GetNextFreeSerialPortIndex | Gets the next serial port index that is not in use
GetSystemSerialPorts | Gets a list of all serial ports on the system
Top
See Also

Reference

SystemSerialPorts Class
Bncs.Comms Namespace


SystemSerialPorts.GetAvailableSerialPorts Method

SystemSerialPortsGetAvailableSerialPorts Method
Gets a list of available serial ports, i.e. ports not currently in use

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static List<string> GetAvailableSerialPorts()

Return Value

Type: List String
A list of serial port names that are not currently in use
See Also

Reference

SystemSerialPorts Class
Bncs.Comms Namespace


SystemSerialPorts.GetNextFreeSerialPortIndex Method

SystemSerialPortsGetNextFreeSerialPortIndex Method
Gets the next serial port index that is not in use

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static int GetNextFreeSerialPortIndex()

Return Value

Type: Int32
Index of the next available serial port or -1 if none are available
See Also

Reference

SystemSerialPorts Class
Bncs.Comms Namespace


SystemSerialPorts.GetSystemSerialPorts Method

SystemSerialPortsGetSystemSerialPorts Method
Gets a list of all serial ports on the system

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static List<string> GetSystemSerialPorts()

Return Value

Type: List String
A list of serial port names whether currently in use or not
See Also

Reference

SystemSerialPorts Class
Bncs.Comms Namespace


TCPClient Class

TCPClient Class
Class that wraps a TcpClient, has uniformed public methods to disconnect and write
Inheritance Hierarchy
SystemObject
Bncs.CommsTCPClient

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class TCPClient

The TCPClient type exposes the following members.

Constructors
 | Name | Description
Public method | TCPClient | Constructor
Top
Methods
 | Name | Description
Public method | Disconnect | Disconnects the client
Public method | Equals | Returns true if this insrance and that passed have the same guid (Overrides ObjectEquals(Object).)
Public method | GetHashCode | GetHashCode has to be overridden when Equals() is (Overrides ObjectGetHashCode.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Read | Reads a buffer from the client
Public method | ToString | Returns the object in string fomrat (Overrides ObjectToString.)
Public method | Write(Byte) | Writes the supplied buffer to the client
Public method | Write(String) | Writes the supplied buffer to the client
Top
Properties
 | Name | Description
Public property | Address | Gets the TCP/IP address
Public property | CanRead | Returns true if there is data waiting to be read from the server buffer.
Public property | Port | Gets the port number
Public property | Uid | Gets the globally unique id of the object
Public property | Writable | Gets or sets a values that determines if the client is r/o, returns false for r/o.
Top
See Also

Reference

Bncs.Comms Namespace


TCPClient Constructor

TCPClient Constructor
Constructor

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public TCPClient(
    TcpClient client_
)

Parameters

client_
Type: System.Net.SocketsTcpClient
TCP client
See Also

Reference

TCPClient Class
Bncs.Comms Namespace


TCPClient Methods

TCPClient Methods

The TCPClient type exposes the following members.

Methods
 | Name | Description
Public method | Disconnect | Disconnects the client
Public method | Equals | Returns true if this insrance and that passed have the same guid (Overrides ObjectEquals(Object).)
Public method | GetHashCode | GetHashCode has to be overridden when Equals() is (Overrides ObjectGetHashCode.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Read | Reads a buffer from the client
Public method | ToString | Returns the object in string fomrat (Overrides ObjectToString.)
Public method | Write(Byte) | Writes the supplied buffer to the client
Public method | Write(String) | Writes the supplied buffer to the client
Top
See Also

Reference

TCPClient Class
Bncs.Comms Namespace


TCPClient.Disconnect Method

TCPClientDisconnect Method
Disconnects the client

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Disconnect()
See Also

Reference

TCPClient Class
Bncs.Comms Namespace


TCPClient.Equals Method

TCPClientEquals Method
Returns true if this insrance and that passed have the same guid

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override bool Equals(
    Object obj
)

Parameters

obj
Type: SystemObject
TCPClient to compare

Return Value

Type: Boolean
True if the items have identical guids
See Also

Reference

TCPClient Class
Bncs.Comms Namespace


TCPClient.GetHashCode Method

TCPClientGetHashCode Method
GetHashCode has to be overridden when Equals() is

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override int GetHashCode()

Return Value

Type: Int32
An integer from the base class version
See Also

Reference

TCPClient Class
Bncs.Comms Namespace


TCPClient.Read Method

TCPClientRead Method
Reads a buffer from the client

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[] Read()

Return Value

Type: Byte
The bytes read or null if none read
See Also

Reference

TCPClient Class
Bncs.Comms Namespace


TCPClient.ToString Method

TCPClientToString Method
Returns the object in string fomrat

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
A string in the format ADDRESS:PORT
See Also

Reference

TCPClient Class
Bncs.Comms Namespace


TCPClient.Write Method

TCPClientWrite Method
Overload List
 | Name | Description
Public method | Write(Byte) | Writes the supplied buffer to the client
Public method | Write(String) | Writes the supplied buffer to the client
Top
See Also

Reference

TCPClient Class
Bncs.Comms Namespace


TCPClient.Write Method (Byte[])

TCPClientWrite Method (Byte)
Writes the supplied buffer to the client

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Write(
    byte[] buffer_
)

Parameters

buffer_
Type: SystemByte
Data to write
See Also

Reference

TCPClient Class
Write Overload
Bncs.Comms Namespace


TCPClient.Write Method (String)

TCPClientWrite Method (String)
Writes the supplied buffer to the client

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Write(
    string buffer_
)

Parameters

buffer_
Type: SystemString
Data to write
See Also

Reference

TCPClient Class
Write Overload
Bncs.Comms Namespace


TCPClient Properties

TCPClient Properties

The TCPClient type exposes the following members.

Properties
 | Name | Description
Public property | Address | Gets the TCP/IP address
Public property | CanRead | Returns true if there is data waiting to be read from the server buffer.
Public property | Port | Gets the port number
Public property | Uid | Gets the globally unique id of the object
Public property | Writable | Gets or sets a values that determines if the client is r/o, returns false for r/o.
Top
See Also

Reference

TCPClient Class
Bncs.Comms Namespace


TCPClient.Address Property

TCPClientAddress Property
Gets the TCP/IP address

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Address { get; }

Property Value

Type: String
See Also

Reference

TCPClient Class
Bncs.Comms Namespace


TCPClient.CanRead Property

TCPClientCanRead Property
Returns true if there is data waiting to be read from the server buffer.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool CanRead { get; }

Property Value

Type: Boolean
See Also

Reference

TCPClient Class
Bncs.Comms Namespace


TCPClient.Port Property

TCPClientPort Property
Gets the port number

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Port { get; }

Property Value

Type: Int32
See Also

Reference

TCPClient Class
Bncs.Comms Namespace


TCPClient.Uid Property

TCPClientUid Property
Gets the globally unique id of the object

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Uid { get; }

Property Value

Type: String
See Also

Reference

TCPClient Class
Bncs.Comms Namespace


TCPClient.Writable Property

TCPClientWritable Property
Gets or sets a values that determines if the client is r/o, returns false for r/o.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Writable { get; set; }

Property Value

Type: Boolean
See Also

Reference

TCPClient Class
Bncs.Comms Namespace


TCPExceptionResponse Enumeration

TCPExceptionResponse Enumeration
Enumeration indicating an exception event response.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum TCPExceptionResponse
Members
Member name | Value | Description
Handled | 0 | The exception has been handled so carry on.
Throw | 1 | Throw the exception.
Disconnect | 2 | Drop the connection.
DisconnectAndThrow | 3 | Drop the connection then throw the exception.
See Also

Reference

Bncs.Comms Namespace


TCPOnClientConnectingArgs Class

TCPOnClientConnectingArgs Class
Event args class for Bncs.Comms.TCPServer.OnClientConnecting event.
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.CommsTCPOnClientConnectingArgs

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class TCPOnClientConnectingArgs : EventArgs

The TCPOnClientConnectingArgs type exposes the following members.

Constructors
 | Name | Description
Public method | TCPOnClientConnectingArgs | Initializes a new instance of the TCPOnClientConnectingArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | Client | TCP client
Top
See Also

Reference

Bncs.Comms Namespace


TCPOnClientConnectingArgs Constructor

TCPOnClientConnectingArgs Constructor
Initializes a new instance of the TCPOnClientConnectingArgs class

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public TCPOnClientConnectingArgs()
See Also

Reference

TCPOnClientConnectingArgs Class
Bncs.Comms Namespace


TCPOnClientConnectingArgs Fields

TCPOnClientConnectingArgs Fields

The TCPOnClientConnectingArgs type exposes the following members.

Fields
 | Name | Description
Public field | Client | TCP client
Top
See Also

Reference

TCPOnClientConnectingArgs Class
Bncs.Comms Namespace


TCPOnClientConnectingArgs.Client Field

TCPOnClientConnectingArgsClient Field
TCP client

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public TCPClient Client

Field Value

Type: TCPClient
See Also

Reference

TCPOnClientConnectingArgs Class
Bncs.Comms Namespace


TCPOnClientConnectingArgs Methods

TCPOnClientConnectingArgs Methods

The TCPOnClientConnectingArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

TCPOnClientConnectingArgs Class
Bncs.Comms Namespace


TCPOnClientConnectingEvent Delegate

TCPOnClientConnectingEvent Delegate
Event delegate for OnClientConnecting event.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void TCPOnClientConnectingEvent(
    Object sender,
    TCPOnClientConnectingArgs e
)

Parameters

sender
Type: SystemObject
e
Type: Bncs.CommsTCPOnClientConnectingArgs
See Also

Reference

Bncs.Comms Namespace


TCPOnClientConnectRequestArgs Class

TCPOnClientConnectRequestArgs Class
Event args class for OnClientConnectRequest event.
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.CommsTCPOnClientConnectRequestArgs

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class TCPOnClientConnectRequestArgs : EventArgs

The TCPOnClientConnectRequestArgs type exposes the following members.

Constructors
 | Name | Description
Public method | TCPOnClientConnectRequestArgs | Initializes a new instance of the TCPOnClientConnectRequestArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | Client | Client address
Top
See Also

Reference

Bncs.Comms Namespace


TCPOnClientConnectRequestArgs Constructor

TCPOnClientConnectRequestArgs Constructor
Initializes a new instance of the TCPOnClientConnectRequestArgs class

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public TCPOnClientConnectRequestArgs()
See Also

Reference

TCPOnClientConnectRequestArgs Class
Bncs.Comms Namespace


TCPOnClientConnectRequestArgs Fields

TCPOnClientConnectRequestArgs Fields

The TCPOnClientConnectRequestArgs type exposes the following members.

Fields
 | Name | Description
Public field | Client | Client address
Top
See Also

Reference

TCPOnClientConnectRequestArgs Class
Bncs.Comms Namespace


TCPOnClientConnectRequestArgs.Client Field

TCPOnClientConnectRequestArgsClient Field
Client address

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Client

Field Value

Type: String
See Also

Reference

TCPOnClientConnectRequestArgs Class
Bncs.Comms Namespace


TCPOnClientConnectRequestArgs Methods

TCPOnClientConnectRequestArgs Methods

The TCPOnClientConnectRequestArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

TCPOnClientConnectRequestArgs Class
Bncs.Comms Namespace


TCPOnClientConnectRequestEvent Delegate

TCPOnClientConnectRequestEvent Delegate
Event delegate for OnClientConnectRequest event.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate bool TCPOnClientConnectRequestEvent(
    Object sender,
    TCPOnClientConnectRequestArgs e,
    ref byte[] OptionalMessageToClient
)

Parameters

sender
Type: SystemObject
e
Type: Bncs.CommsTCPOnClientConnectRequestArgs
OptionalMessageToClient
Type: SystemByte

Return Value

Type: Boolean
See Also

Reference

Bncs.Comms Namespace


TCPOnClientDisconnectingArgs Class

TCPOnClientDisconnectingArgs Class
Event args class for Bncs.Comms.TCPServer.OnClientDisconnecting event.
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.CommsTCPOnClientDisconnectingArgs

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class TCPOnClientDisconnectingArgs : EventArgs

The TCPOnClientDisconnectingArgs type exposes the following members.

Constructors
 | Name | Description
Public method | TCPOnClientDisconnectingArgs | Initializes a new instance of the TCPOnClientDisconnectingArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | Client | TCP client
Public field | Index | Client index
Top
See Also

Reference

Bncs.Comms Namespace


TCPOnClientDisconnectingArgs Constructor

TCPOnClientDisconnectingArgs Constructor
Initializes a new instance of the TCPOnClientDisconnectingArgs class

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public TCPOnClientDisconnectingArgs()
See Also

Reference

TCPOnClientDisconnectingArgs Class
Bncs.Comms Namespace


TCPOnClientDisconnectingArgs Fields

TCPOnClientDisconnectingArgs Fields

The TCPOnClientDisconnectingArgs type exposes the following members.

Fields
 | Name | Description
Public field | Client | TCP client
Public field | Index | Client index
Top
See Also

Reference

TCPOnClientDisconnectingArgs Class
Bncs.Comms Namespace


TCPOnClientDisconnectingArgs.Client Field

TCPOnClientDisconnectingArgsClient Field
TCP client

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public TCPClient Client

Field Value

Type: TCPClient
See Also

Reference

TCPOnClientDisconnectingArgs Class
Bncs.Comms Namespace


TCPOnClientDisconnectingArgs.Index Field

TCPOnClientDisconnectingArgsIndex Field
Client index

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Index

Field Value

Type: Int32
See Also

Reference

TCPOnClientDisconnectingArgs Class
Bncs.Comms Namespace


TCPOnClientDisconnectingArgs Methods

TCPOnClientDisconnectingArgs Methods

The TCPOnClientDisconnectingArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

TCPOnClientDisconnectingArgs Class
Bncs.Comms Namespace


TCPOnClientDisconnectingEvent Delegate

TCPOnClientDisconnectingEvent Delegate
Event delegate for OnClientDisconnecting event.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void TCPOnClientDisconnectingEvent(
    Object sender,
    TCPOnClientDisconnectingArgs e
)

Parameters

sender
Type: SystemObject
e
Type: Bncs.CommsTCPOnClientDisconnectingArgs
See Also

Reference

Bncs.Comms Namespace


TCPOnConnectionStateChangeArgs Class

TCPOnConnectionStateChangeArgs Class
Event args class for Bncs.Comms.TCPServer.OnConnectionStateChanged event.
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.CommsTCPOnConnectionStateChangeArgs

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class TCPOnConnectionStateChangeArgs : EventArgs

The TCPOnConnectionStateChangeArgs type exposes the following members.

Constructors
 | Name | Description
Public method | TCPOnConnectionStateChangeArgs | Initializes a new instance of the TCPOnConnectionStateChangeArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | Connected | Connected flag
Public field | Message | Message
Top
See Also

Reference

Bncs.Comms Namespace


TCPOnConnectionStateChangeArgs Constructor

TCPOnConnectionStateChangeArgs Constructor
Initializes a new instance of the TCPOnConnectionStateChangeArgs class

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public TCPOnConnectionStateChangeArgs()
See Also

Reference

TCPOnConnectionStateChangeArgs Class
Bncs.Comms Namespace


TCPOnConnectionStateChangeArgs Fields

TCPOnConnectionStateChangeArgs Fields

The TCPOnConnectionStateChangeArgs type exposes the following members.

Fields
 | Name | Description
Public field | Connected | Connected flag
Public field | Message | Message
Top
See Also

Reference

TCPOnConnectionStateChangeArgs Class
Bncs.Comms Namespace


TCPOnConnectionStateChangeArgs.Connected Field

TCPOnConnectionStateChangeArgsConnected Field
Connected flag

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Connected

Field Value

Type: Boolean
See Also

Reference

TCPOnConnectionStateChangeArgs Class
Bncs.Comms Namespace


TCPOnConnectionStateChangeArgs.Message Field

TCPOnConnectionStateChangeArgsMessage Field
Message

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Message

Field Value

Type: String
See Also

Reference

TCPOnConnectionStateChangeArgs Class
Bncs.Comms Namespace


TCPOnConnectionStateChangeArgs Methods

TCPOnConnectionStateChangeArgs Methods

The TCPOnConnectionStateChangeArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

TCPOnConnectionStateChangeArgs Class
Bncs.Comms Namespace


TCPOnConnectionStateChangeEvent Delegate

TCPOnConnectionStateChangeEvent Delegate
Event delegate for OnConnectionStateChanged event.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void TCPOnConnectionStateChangeEvent(
    Object sender,
    TCPOnConnectionStateChangeArgs e
)

Parameters

sender
Type: SystemObject
e
Type: Bncs.CommsTCPOnConnectionStateChangeArgs
See Also

Reference

Bncs.Comms Namespace


TCPOnExceptionEventArgs Class

TCPOnExceptionEventArgs Class
Event args class for OnException event
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.CommsTCPOnExceptionEventArgs

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class TCPOnExceptionEventArgs : EventArgs

The TCPOnExceptionEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | TCPOnExceptionEventArgs | Initializes a new instance of the TCPOnExceptionEventArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | Exception | Exception caught
Public field | IsConnected | Connection flag
Top
See Also

Reference

Bncs.Comms Namespace


TCPOnExceptionEventArgs Constructor

TCPOnExceptionEventArgs Constructor
Initializes a new instance of the TCPOnExceptionEventArgs class

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public TCPOnExceptionEventArgs()
See Also

Reference

TCPOnExceptionEventArgs Class
Bncs.Comms Namespace


TCPOnExceptionEventArgs Fields

TCPOnExceptionEventArgs Fields

The TCPOnExceptionEventArgs type exposes the following members.

Fields
 | Name | Description
Public field | Exception | Exception caught
Public field | IsConnected | Connection flag
Top
See Also

Reference

TCPOnExceptionEventArgs Class
Bncs.Comms Namespace


TCPOnExceptionEventArgs.Exception Field

TCPOnExceptionEventArgsException Field
Exception caught

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Exception Exception

Field Value

Type: Exception
See Also

Reference

TCPOnExceptionEventArgs Class
Bncs.Comms Namespace


TCPOnExceptionEventArgs.IsConnected Field

TCPOnExceptionEventArgsIsConnected Field
Connection flag

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool IsConnected

Field Value

Type: Boolean
See Also

Reference

TCPOnExceptionEventArgs Class
Bncs.Comms Namespace


TCPOnExceptionEventArgs Methods

TCPOnExceptionEventArgs Methods

The TCPOnExceptionEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

TCPOnExceptionEventArgs Class
Bncs.Comms Namespace


TCPOnExceptionEventHandler Delegate

TCPOnExceptionEventHandler Delegate
Event delegate for OnException event.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate TCPExceptionResponse TCPOnExceptionEventHandler(
    Object sender,
    TCPOnExceptionEventArgs e
)

Parameters

sender
Type: SystemObject
e
Type: Bncs.CommsTCPOnExceptionEventArgs

Return Value

Type: TCPExceptionResponse
See Also

Reference

Bncs.Comms Namespace


TCPOnReceiveEventArgs Class

TCPOnReceiveEventArgs Class
Event args class for Receive event
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.CommsTCPOnReceiveEventArgs

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class TCPOnReceiveEventArgs : EventArgs

The TCPOnReceiveEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | TCPOnReceiveEventArgs | Initializes a new instance of the TCPOnReceiveEventArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | AsHexString | Contents as hex string
Public field | Buffer | Buffer contents
Public field | Client | TCP client
Top
See Also

Reference

Bncs.Comms Namespace


TCPOnReceiveEventArgs Constructor

TCPOnReceiveEventArgs Constructor
Initializes a new instance of the TCPOnReceiveEventArgs class

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public TCPOnReceiveEventArgs()
See Also

Reference

TCPOnReceiveEventArgs Class
Bncs.Comms Namespace


TCPOnReceiveEventArgs Fields

TCPOnReceiveEventArgs Fields

The TCPOnReceiveEventArgs type exposes the following members.

Fields
 | Name | Description
Public field | AsHexString | Contents as hex string
Public field | Buffer | Buffer contents
Public field | Client | TCP client
Top
See Also

Reference

TCPOnReceiveEventArgs Class
Bncs.Comms Namespace


TCPOnReceiveEventArgs.AsHexString Field

TCPOnReceiveEventArgsAsHexString Field
Contents as hex string

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string AsHexString

Field Value

Type: String
See Also

Reference

TCPOnReceiveEventArgs Class
Bncs.Comms Namespace


TCPOnReceiveEventArgs.Buffer Field

TCPOnReceiveEventArgsBuffer Field
Buffer contents

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[] Buffer

Field Value

Type: Byte
See Also

Reference

TCPOnReceiveEventArgs Class
Bncs.Comms Namespace


TCPOnReceiveEventArgs.Client Field

TCPOnReceiveEventArgsClient Field
TCP client

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public TCPClient Client

Field Value

Type: TCPClient
See Also

Reference

TCPOnReceiveEventArgs Class
Bncs.Comms Namespace


TCPOnReceiveEventArgs Methods

TCPOnReceiveEventArgs Methods

The TCPOnReceiveEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

TCPOnReceiveEventArgs Class
Bncs.Comms Namespace


TCPOnReceiveEventHandler Delegate

TCPOnReceiveEventHandler Delegate
Event delegate for Receive event.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void TCPOnReceiveEventHandler(
    Object sender,
    TCPOnReceiveEventArgs e
)

Parameters

sender
Type: SystemObject
e
Type: Bncs.CommsTCPOnReceiveEventArgs
See Also

Reference

Bncs.Comms Namespace


TCPOnStartListenerArgs Class

TCPOnStartListenerArgs Class
Not currently implemented.
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.CommsTCPOnStartListenerArgs

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class TCPOnStartListenerArgs : EventArgs

The TCPOnStartListenerArgs type exposes the following members.

Constructors
 | Name | Description
Public method | TCPOnStartListenerArgs | Initializes a new instance of the TCPOnStartListenerArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | Listening | Listening flag
Public field | Port | TCP Port
Top
See Also

Reference

Bncs.Comms Namespace


TCPOnStartListenerArgs Constructor

TCPOnStartListenerArgs Constructor
Initializes a new instance of the TCPOnStartListenerArgs class

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public TCPOnStartListenerArgs()
See Also

Reference

TCPOnStartListenerArgs Class
Bncs.Comms Namespace


TCPOnStartListenerArgs Fields

TCPOnStartListenerArgs Fields

The TCPOnStartListenerArgs type exposes the following members.

Fields
 | Name | Description
Public field | Listening | Listening flag
Public field | Port | TCP Port
Top
See Also

Reference

TCPOnStartListenerArgs Class
Bncs.Comms Namespace


TCPOnStartListenerArgs.Listening Field

TCPOnStartListenerArgsListening Field
Listening flag

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Listening

Field Value

Type: Boolean
See Also

Reference

TCPOnStartListenerArgs Class
Bncs.Comms Namespace


TCPOnStartListenerArgs.Port Field

TCPOnStartListenerArgsPort Field
TCP Port

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Port

Field Value

Type: Int32
See Also

Reference

TCPOnStartListenerArgs Class
Bncs.Comms Namespace


TCPOnStartListenerArgs Methods

TCPOnStartListenerArgs Methods

The TCPOnStartListenerArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

TCPOnStartListenerArgs Class
Bncs.Comms Namespace


TCPOnStartListenerEvent Delegate

TCPOnStartListenerEvent Delegate
Not currently implemented.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void TCPOnStartListenerEvent(
    Object sender,
    TCPOnStartListenerArgs e
)

Parameters

sender
Type: SystemObject
e
Type: Bncs.CommsTCPOnStartListenerArgs
See Also

Reference

Bncs.Comms Namespace


TCPServer Class

TCPServer Class
Class encapsulating a TCP/IP server
Inheritance Hierarchy
SystemObject
Bncs.CommsTCPServer

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class TCPServer

The TCPServer type exposes the following members.

Constructors
 | Name | Description
Public method | TCPServer | Default constructor
Public method | TCPServer(Int32) | Constructor that sets the port number
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Send(Byte) | Writes the supplied buffer to all connected clients
Public method | Send(String) | Writes the supplied buffer to all connected clients
Public method | Send(Byte, TCPClient) | Writes the supplied buffer to rhe specified client
Public method | Send(String, TCPClient) | Writes the supplied buffer to rhe specified client
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | Active | Gets or sets a value that toggles the server on and off. IT IS ESSENTIAL that you set this to false when exiting your program else it will not go out of process.
Public property | AutoReconnect | Gets or sets the auto recon flag
Public property | Clients | Gets a list of clients currently connected
Public property | Count | Gets the number of clients connected to the server
Public property | Port | Gets or sets the TCP/IP port
Top
Events
 | Name | Description
Public event | OnClientConnecting | Called when the client has been approved for connection. Any writes in event handler code to e.Client should be wrapped in a Dispatcher.BeginInvoke() call
Public event | OnClientConnectRequest | Called when a client has connected, return true to allow the connection or false to disconnect. Populate the OptionalMessageToClient argument if you wish to message the client, typically with a rejection reason.
Public event | OnClientDisconnecting | Called when the client has disconnected. Any writes in event handler code to e.Client should be wrapped in a Dispatcher.BeginInvoke() call, but this is futile!
Public event | OnConnectionStateChanged | Called when the connection state changes.
Public event | OnException | Fires when an exception occurs.
Public event | Receive | Fires when data is read from a client.
Top
See Also

Reference

Bncs.Comms Namespace


TCPServer Constructor

TCPServer Constructor
Overload List
 | Name | Description
Public method | TCPServer | Default constructor
Public method | TCPServer(Int32) | Constructor that sets the port number
Top
See Also

Reference

TCPServer Class
Bncs.Comms Namespace


TCPServer Constructor

TCPServer Constructor
Default constructor

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public TCPServer()
See Also

Reference

TCPServer Class
TCPServer Overload
Bncs.Comms Namespace


TCPServer Constructor (Int32)

TCPServer Constructor (Int32)
Constructor that sets the port number

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public TCPServer(
    int port_
)

Parameters

port_
Type: SystemInt32
TCP port number
See Also

Reference

TCPServer Class
TCPServer Overload
Bncs.Comms Namespace


TCPServer Methods

TCPServer Methods

The TCPServer type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Send(Byte) | Writes the supplied buffer to all connected clients
Public method | Send(String) | Writes the supplied buffer to all connected clients
Public method | Send(Byte, TCPClient) | Writes the supplied buffer to rhe specified client
Public method | Send(String, TCPClient) | Writes the supplied buffer to rhe specified client
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

TCPServer Class
Bncs.Comms Namespace


TCPServer.Send Method

TCPServerSend Method
Overload List
 | Name | Description
Public method | Send(Byte) | Writes the supplied buffer to all connected clients
Public method | Send(String) | Writes the supplied buffer to all connected clients
Public method | Send(Byte, TCPClient) | Writes the supplied buffer to rhe specified client
Public method | Send(String, TCPClient) | Writes the supplied buffer to rhe specified client
Top
See Also

Reference

TCPServer Class
Bncs.Comms Namespace


TCPServer.Send Method (Byte[])

TCPServerSend Method (Byte)
Writes the supplied buffer to all connected clients

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Send(
    byte[] buffer_
)

Parameters

buffer_
Type: SystemByte
Buffer to write
See Also

Reference

TCPServer Class
Send Overload
Bncs.Comms Namespace


TCPServer.Send Method (String)

TCPServerSend Method (String)
Writes the supplied buffer to all connected clients

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Send(
    string buffer_
)

Parameters

buffer_
Type: SystemString
Buffer to write
See Also

Reference

TCPServer Class
Send Overload
Bncs.Comms Namespace


TCPServer.Send Method (Byte[], TCPClient)

TCPServerSend Method (Byte, TCPClient)
Writes the supplied buffer to rhe specified client

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Send(
    byte[] buffer_,
    TCPClient client_
)

Parameters

buffer_
Type: SystemByte
Buffer to write
client_
Type: Bncs.CommsTCPClient
Client to write to
See Also

Reference

TCPServer Class
Send Overload
Bncs.Comms Namespace


TCPServer.Send Method (String, TCPClient)

TCPServerSend Method (String, TCPClient)
Writes the supplied buffer to rhe specified client

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Send(
    string buffer_,
    TCPClient client_
)

Parameters

buffer_
Type: SystemString
Buffer to write
client_
Type: Bncs.CommsTCPClient
Client to write to
See Also

Reference

TCPServer Class
Send Overload
Bncs.Comms Namespace


TCPServer Properties

TCPServer Properties

The TCPServer type exposes the following members.

Properties
 | Name | Description
Public property | Active | Gets or sets a value that toggles the server on and off. IT IS ESSENTIAL that you set this to false when exiting your program else it will not go out of process.
Public property | AutoReconnect | Gets or sets the auto recon flag
Public property | Clients | Gets a list of clients currently connected
Public property | Count | Gets the number of clients connected to the server
Public property | Port | Gets or sets the TCP/IP port
Top
See Also

Reference

TCPServer Class
Bncs.Comms Namespace


TCPServer.Active Property

TCPServerActive Property
Gets or sets a value that toggles the server on and off. IT IS ESSENTIAL that you set this to false when exiting your program else it will not go out of process.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Active { get; set; }

Property Value

Type: Boolean
See Also

Reference

TCPServer Class
Bncs.Comms Namespace


TCPServer.AutoReconnect Property

TCPServerAutoReconnect Property
Gets or sets the auto recon flag

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool AutoReconnect { get; set; }

Property Value

Type: Boolean
See Also

Reference

TCPServer Class
Bncs.Comms Namespace


TCPServer.Clients Property

TCPServerClients Property
Gets a list of clients currently connected

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ObservableCollection<TCPClient> Clients { get; }

Property Value

Type: ObservableCollection TCPClient
See Also

Reference

TCPServer Class
Bncs.Comms Namespace


TCPServer.Count Property

TCPServerCount Property
Gets the number of clients connected to the server

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Count { get; }

Property Value

Type: Int32
See Also

Reference

TCPServer Class
Bncs.Comms Namespace


TCPServer.Port Property

TCPServerPort Property
Gets or sets the TCP/IP port

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Port { get; set; }

Property Value

Type: Int32
See Also

Reference

TCPServer Class
Bncs.Comms Namespace


TCPServer Events

TCPServer Events

The TCPServer type exposes the following members.

Events
 | Name | Description
Public event | OnClientConnecting | Called when the client has been approved for connection. Any writes in event handler code to e.Client should be wrapped in a Dispatcher.BeginInvoke() call
Public event | OnClientConnectRequest | Called when a client has connected, return true to allow the connection or false to disconnect. Populate the OptionalMessageToClient argument if you wish to message the client, typically with a rejection reason.
Public event | OnClientDisconnecting | Called when the client has disconnected. Any writes in event handler code to e.Client should be wrapped in a Dispatcher.BeginInvoke() call, but this is futile!
Public event | OnConnectionStateChanged | Called when the connection state changes.
Public event | OnException | Fires when an exception occurs.
Public event | Receive | Fires when data is read from a client.
Top
See Also

Reference

TCPServer Class
Bncs.Comms Namespace


TCPServer.OnClientConnecting Event

TCPServerOnClientConnecting Event
Called when the client has been approved for connection. Any writes in event handler code to e.Client should be wrapped in a Dispatcher.BeginInvoke() call

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event TCPOnClientConnectingEvent OnClientConnecting

Value

Type: Bncs.CommsTCPOnClientConnectingEvent
See Also

Reference

TCPServer Class
Bncs.Comms Namespace


TCPServer.OnClientConnectRequest Event

TCPServerOnClientConnectRequest Event
Called when a client has connected, return true to allow the connection or false to disconnect. Populate the OptionalMessageToClient argument if you wish to message the client, typically with a rejection reason.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event TCPOnClientConnectRequestEvent OnClientConnectRequest

Value

Type: Bncs.CommsTCPOnClientConnectRequestEvent
See Also

Reference

TCPServer Class
Bncs.Comms Namespace


TCPServer.OnClientDisconnecting Event

TCPServerOnClientDisconnecting Event
Called when the client has disconnected. Any writes in event handler code to e.Client should be wrapped in a Dispatcher.BeginInvoke() call, but this is futile!

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event TCPOnClientDisconnectingEvent OnClientDisconnecting

Value

Type: Bncs.CommsTCPOnClientDisconnectingEvent
See Also

Reference

TCPServer Class
Bncs.Comms Namespace


TCPServer.OnConnectionStateChanged Event

TCPServerOnConnectionStateChanged Event
Called when the connection state changes.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event TCPOnConnectionStateChangeEvent OnConnectionStateChanged

Value

Type: Bncs.CommsTCPOnConnectionStateChangeEvent
See Also

Reference

TCPServer Class
Bncs.Comms Namespace


TCPServer.OnException Event

TCPServerOnException Event
Fires when an exception occurs.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event TCPOnExceptionEventHandler OnException

Value

Type: Bncs.CommsTCPOnExceptionEventHandler
See Also

Reference

TCPServer Class
Bncs.Comms Namespace


TCPServer.Receive Event

TCPServerReceive Event
Fires when data is read from a client.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event TCPOnReceiveEventHandler Receive

Value

Type: Bncs.CommsTCPOnReceiveEventHandler
See Also

Reference

TCPServer Class
Bncs.Comms Namespace


TxRxCommsThroughput Class

TxRxCommsThroughput Class
Class for recording data throughput volumes.
Inheritance Hierarchy
SystemObject
Bncs.CommsTxRxCommsThroughput

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class TxRxCommsThroughput

The TxRxCommsThroughput type exposes the following members.

Constructors
 | Name | Description
Public method | TxRxCommsThroughput | Default constructor using a bits per second measurment.
Public method | TxRxCommsThroughput(Measurement) | Constructor accepting an argument of type Measurement.
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | NotifyRXThroughput | Notifies the instance of an amount of RX throughput.
Public method | NotifyTXThroughput | Notifies the instance of an amount of TX throughput.
Public method | Reset | Resets TX and RX count data to zero.
Public method | Reset(TxRxResetType) | Resets TX and/or RX count data to zero.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | Active | Returns true if active.
Public property | Measurement | Gets or sets the measurment type.
Public property | RxPeak | Gets the RX peak.
Public property | RxTotal | Returns the total RX count
Public property | Total | Returns the total TX/RX count
Public property | TxPeak | Gets the TX peak.
Public property | TxTotal | Returns the total TX count
Top
Events
 | Name | Description
Public event | OnRXPersecondChange | Event handler that fires on RX change.
Public event | OnTXPersecondChange | Event handler that fires on TX change.
Top
See Also

Reference

Bncs.Comms Namespace


TxRxCommsThroughput Constructor

TxRxCommsThroughput Constructor
Overload List
 | Name | Description
Public method | TxRxCommsThroughput | Default constructor using a bits per second measurment.
Public method | TxRxCommsThroughput(Measurement) | Constructor accepting an argument of type Measurement.
Top
See Also

Reference

TxRxCommsThroughput Class
Bncs.Comms Namespace


TxRxCommsThroughput Constructor

TxRxCommsThroughput Constructor
Default constructor using a bits per second measurment.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public TxRxCommsThroughput()
See Also

Reference

TxRxCommsThroughput Class
TxRxCommsThroughput Overload
Bncs.Comms Namespace


TxRxCommsThroughput Constructor (Measurement)

TxRxCommsThroughput Constructor (Measurement)
Constructor accepting an argument of type Measurement.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public TxRxCommsThroughput(
    Measurement measurement_
)

Parameters

measurement_
Type: Bncs.CommsMeasurement
Initialises either bits or packets per second
See Also

Reference

TxRxCommsThroughput Class
TxRxCommsThroughput Overload
Bncs.Comms Namespace


TxRxCommsThroughput Methods

TxRxCommsThroughput Methods

The TxRxCommsThroughput type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | NotifyRXThroughput | Notifies the instance of an amount of RX throughput.
Public method | NotifyTXThroughput | Notifies the instance of an amount of TX throughput.
Public method | Reset | Resets TX and RX count data to zero.
Public method | Reset(TxRxResetType) | Resets TX and/or RX count data to zero.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

TxRxCommsThroughput Class
Bncs.Comms Namespace


TxRxCommsThroughput.NotifyRXThroughput Method

TxRxCommsThroughputNotifyRXThroughput Method
Notifies the instance of an amount of RX throughput.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void NotifyRXThroughput(
    ulong count_
)

Parameters

count_
Type: SystemUInt64
Amount of packets or bits per second
See Also

Reference

TxRxCommsThroughput Class
Bncs.Comms Namespace


TxRxCommsThroughput.NotifyTXThroughput Method

TxRxCommsThroughputNotifyTXThroughput Method
Notifies the instance of an amount of TX throughput.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void NotifyTXThroughput(
    ulong count_
)

Parameters

count_
Type: SystemUInt64
Amount of packets or bits per second
See Also

Reference

TxRxCommsThroughput Class
Bncs.Comms Namespace


TxRxCommsThroughput.Reset Method

TxRxCommsThroughputReset Method
Overload List
 | Name | Description
Public method | Reset | Resets TX and RX count data to zero.
Public method | Reset(TxRxResetType) | Resets TX and/or RX count data to zero.
Top
See Also

Reference

TxRxCommsThroughput Class
Bncs.Comms Namespace


TxRxCommsThroughput.Reset Method

TxRxCommsThroughputReset Method
Resets TX and RX count data to zero.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Reset()
See Also

Reference

TxRxCommsThroughput Class
Reset Overload
Bncs.Comms Namespace


TxRxCommsThroughput.Reset Method (TxRxResetType)

TxRxCommsThroughputReset Method (TxRxResetType)
Resets TX and/or RX count data to zero.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Reset(
    TxRxResetType type_
)

Parameters

type_
Type: Bncs.CommsTxRxResetType
Indicate which data to reset, TX, RX or both.
See Also

Reference

TxRxCommsThroughput Class
Reset Overload
Bncs.Comms Namespace


TxRxCommsThroughput Properties

TxRxCommsThroughput Properties

The TxRxCommsThroughput type exposes the following members.

Properties
 | Name | Description
Public property | Active | Returns true if active.
Public property | Measurement | Gets or sets the measurment type.
Public property | RxPeak | Gets the RX peak.
Public property | RxTotal | Returns the total RX count
Public property | Total | Returns the total TX/RX count
Public property | TxPeak | Gets the TX peak.
Public property | TxTotal | Returns the total TX count
Top
See Also

Reference

TxRxCommsThroughput Class
Bncs.Comms Namespace


TxRxCommsThroughput.Active Property

TxRxCommsThroughputActive Property
Returns true if active.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Active { get; set; }

Property Value

Type: Boolean
See Also

Reference

TxRxCommsThroughput Class
Bncs.Comms Namespace


TxRxCommsThroughput.Measurement Property

TxRxCommsThroughputMeasurement Property
Gets or sets the measurment type.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Measurement Measurement { get; set; }

Property Value

Type: Measurement
See Also

Reference

TxRxCommsThroughput Class
Bncs.Comms Namespace


TxRxCommsThroughput.RxPeak Property

TxRxCommsThroughputRxPeak Property
Gets the RX peak.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ulong RxPeak { get; }

Property Value

Type: UInt64
See Also

Reference

TxRxCommsThroughput Class
Bncs.Comms Namespace


TxRxCommsThroughput.RxTotal Property

TxRxCommsThroughputRxTotal Property
Returns the total RX count

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ulong RxTotal { get; }

Property Value

Type: UInt64
See Also

Reference

TxRxCommsThroughput Class
Bncs.Comms Namespace


TxRxCommsThroughput.Total Property

TxRxCommsThroughputTotal Property
Returns the total TX/RX count

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ulong Total { get; }

Property Value

Type: UInt64
See Also

Reference

TxRxCommsThroughput Class
Bncs.Comms Namespace


TxRxCommsThroughput.TxPeak Property

TxRxCommsThroughputTxPeak Property
Gets the TX peak.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ulong TxPeak { get; }

Property Value

Type: UInt64
See Also

Reference

TxRxCommsThroughput Class
Bncs.Comms Namespace


TxRxCommsThroughput.TxTotal Property

TxRxCommsThroughputTxTotal Property
Returns the total TX count

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ulong TxTotal { get; }

Property Value

Type: UInt64
See Also

Reference

TxRxCommsThroughput Class
Bncs.Comms Namespace


TxRxCommsThroughput Events

TxRxCommsThroughput Events

The TxRxCommsThroughput type exposes the following members.

Events
 | Name | Description
Public event | OnRXPersecondChange | Event handler that fires on RX change.
Public event | OnTXPersecondChange | Event handler that fires on TX change.
Top
See Also

Reference

TxRxCommsThroughput Class
Bncs.Comms Namespace


TxRxCommsThroughput.OnRXPersecondChange Event

TxRxCommsThroughputOnRXPersecondChange Event
Event handler that fires on RX change.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnPersecondChangeEventHandler OnRXPersecondChange

Value

Type: Bncs.CommsOnPersecondChangeEventHandler
See Also

Reference

TxRxCommsThroughput Class
Bncs.Comms Namespace


TxRxCommsThroughput.OnTXPersecondChange Event

TxRxCommsThroughputOnTXPersecondChange Event
Event handler that fires on TX change.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnPersecondChangeEventHandler OnTXPersecondChange

Value

Type: Bncs.CommsOnPersecondChangeEventHandler
See Also

Reference

TxRxCommsThroughput Class
Bncs.Comms Namespace


TxRxDebugData Structure

TxRxDebugData Structure
Structure for transmitting TxRx messages to a debug application via Windows messaging

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public struct TxRxDebugData

The TxRxDebugData type exposes the following members.

Constructors
 | Name | Description
Public method | TxRxDebugData | Constructor
Top
Methods
 | Name | Description
Public method | Equals | Indicates whether this instance and a specified object are equal. (Inherited from ValueType.)
Public method | GetHashCode | Returns the hash code for this instance. (Inherited from ValueType.)
Public method | GetMessageAsString | Gets the message as a string
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns the fully qualified type name of this instance. (Inherited from ValueType.)
Top
Fields
 | Name | Description
Public field | Annotate | Annotate flag
Public field | ApplicationName | An optional application name to be populated at the application level if sending to BNCSTxRxLogDisplay application,
Public field | Content | Content, Tx, Rx or both
Public field | DataType | Content data type, byte array or string
Public field | Format | Content format, dated or raw
Public field | IsTx | Tx/Rx Flag
Public field | Message | Debug message.
Top
See Also

Reference

Bncs.Comms Namespace


TxRxDebugData Constructor

TxRxDebugData Constructor
Constructor

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public TxRxDebugData(
    OnTxRxDebugEventArgs args_
)

Parameters

args_
Type: Bncs.CommsOnTxRxDebugEventArgs
OnTxRxDebugEventArgs data to transmit
See Also

Reference

TxRxDebugData Structure
Bncs.Comms Namespace


TxRxDebugData Fields

TxRxDebugData Fields

The TxRxDebugData type exposes the following members.

Fields
 | Name | Description
Public field | Annotate | Annotate flag
Public field | ApplicationName | An optional application name to be populated at the application level if sending to BNCSTxRxLogDisplay application,
Public field | Content | Content, Tx, Rx or both
Public field | DataType | Content data type, byte array or string
Public field | Format | Content format, dated or raw
Public field | IsTx | Tx/Rx Flag
Public field | Message | Debug message.
Top
See Also

Reference

TxRxDebugData Structure
Bncs.Comms Namespace


TxRxDebugData.Annotate Field

TxRxDebugDataAnnotate Field
Annotate flag

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Annotate

Field Value

Type: Boolean
See Also

Reference

TxRxDebugData Structure
Bncs.Comms Namespace


TxRxDebugData.ApplicationName Field

TxRxDebugDataApplicationName Field
An optional application name to be populated at the application level if sending to BNCSTxRxLogDisplay application,

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string ApplicationName

Field Value

Type: String
See Also

Reference

TxRxDebugData Structure
Bncs.Comms Namespace


TxRxDebugData.Content Field

TxRxDebugDataContent Field
Content, Tx, Rx or both

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public DebugContent Content

Field Value

Type: DebugContent
See Also

Reference

TxRxDebugData Structure
Bncs.Comms Namespace


TxRxDebugData.DataType Field

TxRxDebugDataDataType Field
Content data type, byte array or string

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ContentDataType DataType

Field Value

Type: ContentDataType
See Also

Reference

TxRxDebugData Structure
Bncs.Comms Namespace


TxRxDebugData.Format Field

TxRxDebugDataFormat Field
Content format, dated or raw

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ContentFormat Format

Field Value

Type: ContentFormat
See Also

Reference

TxRxDebugData Structure
Bncs.Comms Namespace


TxRxDebugData.IsTx Field

TxRxDebugDataIsTx Field
Tx/Rx Flag

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Nullable<bool> IsTx

Field Value

Type: Nullable Boolean
See Also

Reference

TxRxDebugData Structure
Bncs.Comms Namespace


TxRxDebugData.Message Field

TxRxDebugDataMessage Field
Debug message.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[] Message

Field Value

Type: Byte
See Also

Reference

TxRxDebugData Structure
Bncs.Comms Namespace


TxRxDebugData Methods

TxRxDebugData Methods

The TxRxDebugData type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Indicates whether this instance and a specified object are equal. (Inherited from ValueType.)
Public method | GetHashCode | Returns the hash code for this instance. (Inherited from ValueType.)
Public method | GetMessageAsString | Gets the message as a string
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns the fully qualified type name of this instance. (Inherited from ValueType.)
Top
See Also

Reference

TxRxDebugData Structure
Bncs.Comms Namespace


TxRxDebugData.GetMessageAsString Method

TxRxDebugDataGetMessageAsString Method
Gets the message as a string

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string GetMessageAsString()

Return Value

Type: String
The message as a string when DataType is cdtText else as a hex value string
See Also

Reference

TxRxDebugData Structure
Bncs.Comms Namespace


TxRxResetType Enumeration

TxRxResetType Enumeration
Enumeration denoting whether to reset TX, RX or both counts.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum TxRxResetType
Members
Member name | Value | Description
Both | 0 | Reset both counts.
Tx | 1 | Reset the TX count.
Rx | 2 | Reset the RX count.
See Also

Reference

Bncs.Comms Namespace


UDPOnClientStatusChangedEventArgs Class

UDPOnClientStatusChangedEventArgs Class
Event args class used by the OnClientStatusChanged event.
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.CommsUDPOnClientStatusChangedEventArgs

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class UDPOnClientStatusChangedEventArgs : EventArgs

The UDPOnClientStatusChangedEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | UDPOnClientStatusChangedEventArgs | Initializes a new instance of the UDPOnClientStatusChangedEventArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | Client | Handle back to the client.
Public field | ClientAction | The client action.
Public field | ClientIndex | The client index.
Public field | Count | Number of
Public field | Dispatch | Dispatch flag, if true then change to false and recall your event handler asynchronously to avoid cross threading.
Top
See Also

Reference

Bncs.Comms Namespace


UDPOnClientStatusChangedEventArgs Constructor

UDPOnClientStatusChangedEventArgs Constructor
Initializes a new instance of the UDPOnClientStatusChangedEventArgs class

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public UDPOnClientStatusChangedEventArgs()
See Also

Reference

UDPOnClientStatusChangedEventArgs Class
Bncs.Comms Namespace


UDPOnClientStatusChangedEventArgs Fields

UDPOnClientStatusChangedEventArgs Fields

The UDPOnClientStatusChangedEventArgs type exposes the following members.

Fields
 | Name | Description
Public field | Client | Handle back to the client.
Public field | ClientAction | The client action.
Public field | ClientIndex | The client index.
Public field | Count | Number of
Public field | Dispatch | Dispatch flag, if true then change to false and recall your event handler asynchronously to avoid cross threading.
Top
See Also

Reference

UDPOnClientStatusChangedEventArgs Class
Bncs.Comms Namespace


UDPOnClientStatusChangedEventArgs.Client Field

UDPOnClientStatusChangedEventArgsClient Field
Handle back to the client.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public IPEndPoint Client

Field Value

Type: IPEndPoint
See Also

Reference

UDPOnClientStatusChangedEventArgs Class
Bncs.Comms Namespace


UDPOnClientStatusChangedEventArgs.ClientAction Field

UDPOnClientStatusChangedEventArgsClientAction Field
The client action.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ClientAction ClientAction

Field Value

Type: ClientAction
See Also

Reference

UDPOnClientStatusChangedEventArgs Class
Bncs.Comms Namespace


UDPOnClientStatusChangedEventArgs.ClientIndex Field

UDPOnClientStatusChangedEventArgsClientIndex Field
The client index.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int ClientIndex

Field Value

Type: Int32
See Also

Reference

UDPOnClientStatusChangedEventArgs Class
Bncs.Comms Namespace


UDPOnClientStatusChangedEventArgs.Count Field

UDPOnClientStatusChangedEventArgsCount Field
Number of

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Count

Field Value

Type: Int32
See Also

Reference

UDPOnClientStatusChangedEventArgs Class
Bncs.Comms Namespace


UDPOnClientStatusChangedEventArgs.Dispatch Field

UDPOnClientStatusChangedEventArgsDispatch Field
Dispatch flag, if true then change to false and recall your event handler asynchronously to avoid cross threading.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Dispatch

Field Value

Type: Boolean
See Also

Reference

UDPOnClientStatusChangedEventArgs Class
Bncs.Comms Namespace


UDPOnClientStatusChangedEventArgs Methods

UDPOnClientStatusChangedEventArgs Methods

The UDPOnClientStatusChangedEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

UDPOnClientStatusChangedEventArgs Class
Bncs.Comms Namespace


UDPOnClientStatusChangedEventHandler Delegate

UDPOnClientStatusChangedEventHandler Delegate
Delegate used by the OnClientStatusChanged event.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void UDPOnClientStatusChangedEventHandler(
    Object sender,
    UDPOnClientStatusChangedEventArgs e
)

Parameters

sender
Type: SystemObject
Calling object
e
Type: Bncs.CommsUDPOnClientStatusChangedEventArgs
Arguements
See Also

Reference

Bncs.Comms Namespace


UDPOnConnectionStateChangeArgs Class

UDPOnConnectionStateChangeArgs Class
Event args class used by the OnConnectionStateChanged event.
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.CommsUDPOnConnectionStateChangeArgs

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class UDPOnConnectionStateChangeArgs : EventArgs

The UDPOnConnectionStateChangeArgs type exposes the following members.

Constructors
 | Name | Description
Public method | UDPOnConnectionStateChangeArgs | Initializes a new instance of the UDPOnConnectionStateChangeArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | Connected | Connection flag.
Public field | Expected | Expected change flag.
Public field | Message | A message.
Top
See Also

Reference

Bncs.Comms Namespace


UDPOnConnectionStateChangeArgs Constructor

UDPOnConnectionStateChangeArgs Constructor
Initializes a new instance of the UDPOnConnectionStateChangeArgs class

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public UDPOnConnectionStateChangeArgs()
See Also

Reference

UDPOnConnectionStateChangeArgs Class
Bncs.Comms Namespace


UDPOnConnectionStateChangeArgs Fields

UDPOnConnectionStateChangeArgs Fields

The UDPOnConnectionStateChangeArgs type exposes the following members.

Fields
 | Name | Description
Public field | Connected | Connection flag.
Public field | Expected | Expected change flag.
Public field | Message | A message.
Top
See Also

Reference

UDPOnConnectionStateChangeArgs Class
Bncs.Comms Namespace


UDPOnConnectionStateChangeArgs.Connected Field

UDPOnConnectionStateChangeArgsConnected Field
Connection flag.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Connected

Field Value

Type: Boolean
See Also

Reference

UDPOnConnectionStateChangeArgs Class
Bncs.Comms Namespace


UDPOnConnectionStateChangeArgs.Expected Field

UDPOnConnectionStateChangeArgsExpected Field
Expected change flag.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Expected

Field Value

Type: Boolean
See Also

Reference

UDPOnConnectionStateChangeArgs Class
Bncs.Comms Namespace


UDPOnConnectionStateChangeArgs.Message Field

UDPOnConnectionStateChangeArgsMessage Field
A message.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Message

Field Value

Type: String
See Also

Reference

UDPOnConnectionStateChangeArgs Class
Bncs.Comms Namespace


UDPOnConnectionStateChangeArgs Methods

UDPOnConnectionStateChangeArgs Methods

The UDPOnConnectionStateChangeArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

UDPOnConnectionStateChangeArgs Class
Bncs.Comms Namespace


UDPOnConnectionStateChangeEventHandler Delegate

UDPOnConnectionStateChangeEventHandler Delegate
Delegate used by the OnConnectionStateChanged event.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void UDPOnConnectionStateChangeEventHandler(
    Object sender,
    UDPOnConnectionStateChangeArgs e
)

Parameters

sender
Type: SystemObject
Calling object
e
Type: Bncs.CommsUDPOnConnectionStateChangeArgs
Arguements
See Also

Reference

Bncs.Comms Namespace


UDPOnExceptionArgs Class

UDPOnExceptionArgs Class
Event args class used by the OnException event.
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.CommsUDPOnExceptionArgs

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class UDPOnExceptionArgs : EventArgs

The UDPOnExceptionArgs type exposes the following members.

Constructors
 | Name | Description
Public method | UDPOnExceptionArgs | Initializes a new instance of the UDPOnExceptionArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | Activity | Activity type occuring at the time.
Public field | Exception | The exception caught.
Public field | Skip | Skip flag.
Top
See Also

Reference

Bncs.Comms Namespace


UDPOnExceptionArgs Constructor

UDPOnExceptionArgs Constructor
Initializes a new instance of the UDPOnExceptionArgs class

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public UDPOnExceptionArgs()
See Also

Reference

UDPOnExceptionArgs Class
Bncs.Comms Namespace


UDPOnExceptionArgs Fields

UDPOnExceptionArgs Fields

The UDPOnExceptionArgs type exposes the following members.

Fields
 | Name | Description
Public field | Activity | Activity type occuring at the time.
Public field | Exception | The exception caught.
Public field | Skip | Skip flag.
Top
See Also

Reference

UDPOnExceptionArgs Class
Bncs.Comms Namespace


UDPOnExceptionArgs.Activity Field

UDPOnExceptionArgsActivity Field
Activity type occuring at the time.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ExceptionActivity Activity

Field Value

Type: ExceptionActivity
See Also

Reference

UDPOnExceptionArgs Class
Bncs.Comms Namespace


UDPOnExceptionArgs.Exception Field

UDPOnExceptionArgsException Field
The exception caught.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Exception Exception

Field Value

Type: Exception
See Also

Reference

UDPOnExceptionArgs Class
Bncs.Comms Namespace


UDPOnExceptionArgs.Skip Field

UDPOnExceptionArgsSkip Field
Skip flag.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Skip

Field Value

Type: Boolean
See Also

Reference

UDPOnExceptionArgs Class
Bncs.Comms Namespace


UDPOnExceptionArgs Methods

UDPOnExceptionArgs Methods

The UDPOnExceptionArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

UDPOnExceptionArgs Class
Bncs.Comms Namespace


UDPOnExceptionEventHandler Delegate

UDPOnExceptionEventHandler Delegate
Delegate used by the OnException event.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void UDPOnExceptionEventHandler(
    Object sender,
    UDPOnExceptionArgs e
)

Parameters

sender
Type: SystemObject
Calling object
e
Type: Bncs.CommsUDPOnExceptionArgs
Arguements
See Also

Reference

Bncs.Comms Namespace


UDPOnReceiveEventHandler Delegate

UDPOnReceiveEventHandler Delegate
Delegate used by Receive event.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate byte[] UDPOnReceiveEventHandler(
    Object sender,
    UDPOnSendReceiveEventArgs e
)

Parameters

sender
Type: SystemObject
Calling object
e
Type: Bncs.CommsUDPOnSendReceiveEventArgs
Arguements

Return Value

Type: Byte
See Also

Reference

Bncs.Comms Namespace


UDPOnSendEventHandler Delegate

UDPOnSendEventHandler Delegate
Delegate used by OnSend event.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void UDPOnSendEventHandler(
    Object sender,
    UDPOnSendReceiveEventArgs e
)

Parameters

sender
Type: SystemObject
Calling object
e
Type: Bncs.CommsUDPOnSendReceiveEventArgs
Arguements
See Also

Reference

Bncs.Comms Namespace


UDPOnSendReceiveEventArgs Class

UDPOnSendReceiveEventArgs Class
Event args class used by Receive and OnSend events.
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.CommsUDPOnSendReceiveEventArgs

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class UDPOnSendReceiveEventArgs : EventArgs

The UDPOnSendReceiveEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | UDPOnSendReceiveEventArgs | Initializes a new instance of the UDPOnSendReceiveEventArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | Buffer | The byte array being sent or received.
Public field | Sender | The originating IPEndPoint of the data packet.
Top
See Also

Reference

Bncs.Comms Namespace


UDPOnSendReceiveEventArgs Constructor

UDPOnSendReceiveEventArgs Constructor
Initializes a new instance of the UDPOnSendReceiveEventArgs class

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public UDPOnSendReceiveEventArgs()
See Also

Reference

UDPOnSendReceiveEventArgs Class
Bncs.Comms Namespace


UDPOnSendReceiveEventArgs Fields

UDPOnSendReceiveEventArgs Fields

The UDPOnSendReceiveEventArgs type exposes the following members.

Fields
 | Name | Description
Public field | Buffer | The byte array being sent or received.
Public field | Sender | The originating IPEndPoint of the data packet.
Top
See Also

Reference

UDPOnSendReceiveEventArgs Class
Bncs.Comms Namespace


UDPOnSendReceiveEventArgs.Buffer Field

UDPOnSendReceiveEventArgsBuffer Field
The byte array being sent or received.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[] Buffer

Field Value

Type: Byte
See Also

Reference

UDPOnSendReceiveEventArgs Class
Bncs.Comms Namespace


UDPOnSendReceiveEventArgs.Sender Field

UDPOnSendReceiveEventArgsSender Field
The originating IPEndPoint of the data packet.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public IPEndPoint Sender

Field Value

Type: IPEndPoint
See Also

Reference

UDPOnSendReceiveEventArgs Class
Bncs.Comms Namespace


UDPOnSendReceiveEventArgs Methods

UDPOnSendReceiveEventArgs Methods

The UDPOnSendReceiveEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

UDPOnSendReceiveEventArgs Class
Bncs.Comms Namespace


UDPServer Class

UDPServer Class
Class encapsulating a UDP server.
Inheritance Hierarchy
SystemObject
Bncs.CommsUDPServer

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class UDPServer

The UDPServer type exposes the following members.

Constructors
 | Name | Description
Public method | UDPServer | Default constructor
Public method | UDPServer(Int32) | Constructor setting the UDP port number.
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | RemoveClient | Removes the supplied client from the list of end points.
Public method | Send(Byte) | Writes the supplied array of bytes to all clients.
Public method | Send(String) | Writes the supplied string to all clients.
Public method | Send(Int32, Byte) | Writes the supplied array of bytes to the indexed client.
Public method | Send(Int32, String) | Writes the supplied string to the indexed client.
Public method | Send(IPEndPoint, Byte) | Writes the supplied array of bytes to the specified client.
Public method | Send(IPEndPoint, String) | Writes the supplied string to the specified client.
Public method | Send(IPEndPoint, Byte) | Writes the supplied array of bytes to the specified clients.
Public method | Send(IPEndPoint, String) | Writes the supplied string to the specified clients.
Public method | SendExclude(Int32, Byte) | Writes the supplied array of bytes to all clients bar the client specified by index.
Public method | SendExclude(Int32, String) | Writes the supplied string to all clients bar the client specified by index.
Public method | SendExclude(IPEndPoint, Byte) | Writes the supplied array of bytes to all clients bar the client specified.
Public method | SendExclude(IPEndPoint, String) | Writes the supplied string to all clients bar the client specified.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | Active | Gets or sets a value which if true causes the server to open a connection else it will close the connection.
Public property | Clients | Gets a list of connected clients (IPEndPoint).
Public property | Port | Gets or sets the UDP port number.
Top
Events
 | Name | Description
Public event | OnClientStatusChanged | Fires when a clients status changes.
Public event | OnConnectionStateChanged | Fires whebn the connection state changes.
Public event | OnException | Fires when an Exception is caught.
Public event | OnSend | Fires when bytes are written to a client on the output buffer.
Public event | Receive | Fires when bytes are received from a client on the input buffer.
Top
See Also

Reference

Bncs.Comms Namespace


UDPServer Constructor

UDPServer Constructor
Overload List
 | Name | Description
Public method | UDPServer | Default constructor
Public method | UDPServer(Int32) | Constructor setting the UDP port number.
Top
See Also

Reference

UDPServer Class
Bncs.Comms Namespace


UDPServer Constructor

UDPServer Constructor
Default constructor

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public UDPServer()
See Also

Reference

UDPServer Class
UDPServer Overload
Bncs.Comms Namespace


UDPServer Constructor (Int32)

UDPServer Constructor (Int32)
Constructor setting the UDP port number.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public UDPServer(
    int port_
)

Parameters

port_
Type: SystemInt32
UDP port number
See Also

Reference

UDPServer Class
UDPServer Overload
Bncs.Comms Namespace


UDPServer Methods

UDPServer Methods

The UDPServer type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | RemoveClient | Removes the supplied client from the list of end points.
Public method | Send(Byte) | Writes the supplied array of bytes to all clients.
Public method | Send(String) | Writes the supplied string to all clients.
Public method | Send(Int32, Byte) | Writes the supplied array of bytes to the indexed client.
Public method | Send(Int32, String) | Writes the supplied string to the indexed client.
Public method | Send(IPEndPoint, Byte) | Writes the supplied array of bytes to the specified client.
Public method | Send(IPEndPoint, String) | Writes the supplied string to the specified client.
Public method | Send(IPEndPoint, Byte) | Writes the supplied array of bytes to the specified clients.
Public method | Send(IPEndPoint, String) | Writes the supplied string to the specified clients.
Public method | SendExclude(Int32, Byte) | Writes the supplied array of bytes to all clients bar the client specified by index.
Public method | SendExclude(Int32, String) | Writes the supplied string to all clients bar the client specified by index.
Public method | SendExclude(IPEndPoint, Byte) | Writes the supplied array of bytes to all clients bar the client specified.
Public method | SendExclude(IPEndPoint, String) | Writes the supplied string to all clients bar the client specified.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

UDPServer Class
Bncs.Comms Namespace


UDPServer.RemoveClient Method

UDPServerRemoveClient Method
Removes the supplied client from the list of end points.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool RemoveClient(
    IPEndPoint client_
)

Parameters

client_
Type: System.NetIPEndPoint
Client to remove

Return Value

Type: Boolean
True on success
See Also

Reference

UDPServer Class
Bncs.Comms Namespace


UDPServer.Send Method

UDPServerSend Method
Overload List
 | Name | Description
Public method | Send(Byte) | Writes the supplied array of bytes to all clients.
Public method | Send(String) | Writes the supplied string to all clients.
Public method | Send(Int32, Byte) | Writes the supplied array of bytes to the indexed client.
Public method | Send(Int32, String) | Writes the supplied string to the indexed client.
Public method | Send(IPEndPoint, Byte) | Writes the supplied array of bytes to the specified client.
Public method | Send(IPEndPoint, String) | Writes the supplied string to the specified client.
Public method | Send(IPEndPoint, Byte) | Writes the supplied array of bytes to the specified clients.
Public method | Send(IPEndPoint, String) | Writes the supplied string to the specified clients.
Top
See Also

Reference

UDPServer Class
Bncs.Comms Namespace


UDPServer.Send Method (Byte[])

UDPServerSend Method (Byte)
Writes the supplied array of bytes to all clients.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Send(
    byte[] datagram_
)

Parameters

datagram_
Type: SystemByte
Array of bytes to write

Return Value

Type: Int32
Number of bytes sent
See Also

Reference

UDPServer Class
Send Overload
Bncs.Comms Namespace


UDPServer.Send Method (String)

UDPServerSend Method (String)
Writes the supplied string to all clients.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Send(
    string datagram_
)

Parameters

datagram_
Type: SystemString
Data string to write.

Return Value

Type: Int32
Number of bytes sent
See Also

Reference

UDPServer Class
Send Overload
Bncs.Comms Namespace


UDPServer.Send Method (Int32, Byte[])

UDPServerSend Method (Int32, Byte)
Writes the supplied array of bytes to the indexed client.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Send(
    int clientIndex_,
    byte[] datagram_
)

Parameters

clientIndex_
Type: SystemInt32
Index of target client
datagram_
Type: SystemByte
Data array to write

Return Value

Type: Int32
Number of bytes sent
See Also

Reference

UDPServer Class
Send Overload
Bncs.Comms Namespace


UDPServer.Send Method (Int32, String)

UDPServerSend Method (Int32, String)
Writes the supplied string to the indexed client.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Send(
    int clientIndex_,
    string datagram_
)

Parameters

clientIndex_
Type: SystemInt32
Index of target client
datagram_
Type: SystemString
Data string to write

Return Value

Type: Int32
Number of bytes sent
See Also

Reference

UDPServer Class
Send Overload
Bncs.Comms Namespace


UDPServer.Send Method (IPEndPoint, Byte[])

UDPServerSend Method (IPEndPoint, Byte)
Writes the supplied array of bytes to the specified client.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Send(
    IPEndPoint client_,
    byte[] datagram_
)

Parameters

client_
Type: System.NetIPEndPoint
End point to write to
datagram_
Type: SystemByte
Array of bytes to write

Return Value

Type: Int32
Number of bytes sent
See Also

Reference

UDPServer Class
Send Overload
Bncs.Comms Namespace


UDPServer.Send Method (IPEndPoint, String)

UDPServerSend Method (IPEndPoint, String)
Writes the supplied string to the specified client.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Send(
    IPEndPoint client_,
    string datagram_
)

Parameters

client_
Type: System.NetIPEndPoint
End point to write to
datagram_
Type: SystemString
String to write

Return Value

Type: Int32
Number of bytes sent
See Also

Reference

UDPServer Class
Send Overload
Bncs.Comms Namespace


UDPServer.Send Method (IPEndPoint[], Byte[])

UDPServerSend Method (IPEndPoint, Byte)
Writes the supplied array of bytes to the specified clients.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Send(
    IPEndPoint[] clients_,
    byte[] datagram_
)

Parameters

clients_
Type: System.NetIPEndPoint
End points to write to
datagram_
Type: SystemByte
Array of bytes to write

Return Value

Type: Int32
Number of bytes sent
See Also

Reference

UDPServer Class
Send Overload
Bncs.Comms Namespace


UDPServer.Send Method (IPEndPoint[], String)

UDPServerSend Method (IPEndPoint, String)
Writes the supplied string to the specified clients.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Send(
    IPEndPoint[] clients_,
    string datagram_
)

Parameters

clients_
Type: System.NetIPEndPoint
End points to write to
datagram_
Type: SystemString
String to write

Return Value

Type: Int32
Number of bytes sent
See Also

Reference

UDPServer Class
Send Overload
Bncs.Comms Namespace


UDPServer.SendExclude Method

UDPServerSendExclude Method
Overload List
 | Name | Description
Public method | SendExclude(Int32, Byte) | Writes the supplied array of bytes to all clients bar the client specified by index.
Public method | SendExclude(Int32, String) | Writes the supplied string to all clients bar the client specified by index.
Public method | SendExclude(IPEndPoint, Byte) | Writes the supplied array of bytes to all clients bar the client specified.
Public method | SendExclude(IPEndPoint, String) | Writes the supplied string to all clients bar the client specified.
Top
See Also

Reference

UDPServer Class
Bncs.Comms Namespace


UDPServer.SendExclude Method (Int32, Byte[])

UDPServerSendExclude Method (Int32, Byte)
Writes the supplied array of bytes to all clients bar the client specified by index.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int SendExclude(
    int clientIndex_,
    byte[] datagram_
)

Parameters

clientIndex_
Type: SystemInt32
Client index to ignore
datagram_
Type: SystemByte
Array of bytes to write

Return Value

Type: Int32
Number of bytes sent
See Also

Reference

UDPServer Class
SendExclude Overload
Bncs.Comms Namespace


UDPServer.SendExclude Method (Int32, String)

UDPServerSendExclude Method (Int32, String)
Writes the supplied string to all clients bar the client specified by index.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int SendExclude(
    int clientIndex_,
    string datagram_
)

Parameters

clientIndex_
Type: SystemInt32
Client index to ignore
datagram_
Type: SystemString
String to write

Return Value

Type: Int32
Number of bytes sent
See Also

Reference

UDPServer Class
SendExclude Overload
Bncs.Comms Namespace


UDPServer.SendExclude Method (IPEndPoint, Byte[])

UDPServerSendExclude Method (IPEndPoint, Byte)
Writes the supplied array of bytes to all clients bar the client specified.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int SendExclude(
    IPEndPoint client_,
    byte[] datagram_
)

Parameters

client_
Type: System.NetIPEndPoint
Client to ignore
datagram_
Type: SystemByte
Array of bytes to write

Return Value

Type: Int32
Number of bytes sent
See Also

Reference

UDPServer Class
SendExclude Overload
Bncs.Comms Namespace


UDPServer.SendExclude Method (IPEndPoint, String)

UDPServerSendExclude Method (IPEndPoint, String)
Writes the supplied string to all clients bar the client specified.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int SendExclude(
    IPEndPoint client_,
    string datagram_
)

Parameters

client_
Type: System.NetIPEndPoint
Client to ignore
datagram_
Type: SystemString
String to write

Return Value

Type: Int32
Number of bytes sent
See Also

Reference

UDPServer Class
SendExclude Overload
Bncs.Comms Namespace


UDPServer Properties

UDPServer Properties

The UDPServer type exposes the following members.

Properties
 | Name | Description
Public property | Active | Gets or sets a value which if true causes the server to open a connection else it will close the connection.
Public property | Clients | Gets a list of connected clients (IPEndPoint).
Public property | Port | Gets or sets the UDP port number.
Top
See Also

Reference

UDPServer Class
Bncs.Comms Namespace


UDPServer.Active Property

UDPServerActive Property
Gets or sets a value which if true causes the server to open a connection else it will close the connection.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Active { get; set; }

Property Value

Type: Boolean
See Also

Reference

UDPServer Class
Bncs.Comms Namespace


UDPServer.Clients Property

UDPServerClients Property
Gets a list of connected clients (IPEndPoint).

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<IPEndPoint> Clients { get; }

Property Value

Type: List IPEndPoint
See Also

Reference

UDPServer Class
Bncs.Comms Namespace


UDPServer.Port Property

UDPServerPort Property
Gets or sets the UDP port number.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Port { get; set; }

Property Value

Type: Int32
See Also

Reference

UDPServer Class
Bncs.Comms Namespace


UDPServer Events

UDPServer Events

The UDPServer type exposes the following members.

Events
 | Name | Description
Public event | OnClientStatusChanged | Fires when a clients status changes.
Public event | OnConnectionStateChanged | Fires whebn the connection state changes.
Public event | OnException | Fires when an Exception is caught.
Public event | OnSend | Fires when bytes are written to a client on the output buffer.
Public event | Receive | Fires when bytes are received from a client on the input buffer.
Top
See Also

Reference

UDPServer Class
Bncs.Comms Namespace


UDPServer.OnClientStatusChanged Event

UDPServerOnClientStatusChanged Event
Fires when a clients status changes.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event UDPOnClientStatusChangedEventHandler OnClientStatusChanged

Value

Type: Bncs.CommsUDPOnClientStatusChangedEventHandler
See Also

Reference

UDPServer Class
Bncs.Comms Namespace


UDPServer.OnConnectionStateChanged Event

UDPServerOnConnectionStateChanged Event
Fires whebn the connection state changes.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event UDPOnConnectionStateChangeEventHandler OnConnectionStateChanged

Value

Type: Bncs.CommsUDPOnConnectionStateChangeEventHandler
See Also

Reference

UDPServer Class
Bncs.Comms Namespace


UDPServer.OnException Event

UDPServerOnException Event
Fires when an Exception is caught.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event UDPOnExceptionEventHandler OnException

Value

Type: Bncs.CommsUDPOnExceptionEventHandler
See Also

Reference

UDPServer Class
Bncs.Comms Namespace


UDPServer.OnSend Event

UDPServerOnSend Event
Fires when bytes are written to a client on the output buffer.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event UDPOnSendEventHandler OnSend

Value

Type: Bncs.CommsUDPOnSendEventHandler
See Also

Reference

UDPServer Class
Bncs.Comms Namespace


UDPServer.Receive Event

UDPServerReceive Event
Fires when bytes are received from a client on the input buffer.

Namespace: Bncs.Comms
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event UDPOnReceiveEventHandler Receive

Value

Type: Bncs.CommsUDPOnReceiveEventHandler
See Also

Reference

UDPServer Class
Bncs.Comms Namespace


Bncs.CSharp Namespace

Bncs.CSharp Namespace

[Missing <summary> documentation for "N:Bncs.CSharp"]

Classes
 | Class | Description
Public class | CSClass | A class that encapsulates a C# class. This class may only be instantiated by CSUnit.
Public class | CSConstructor | A class that encapsulates a C# constructor. This class may only be instantiated by CSUnit.
Public class | CSDestructor | A class that encapsulates a C# destructor. This class may only be instantiated by CSUnit.
Public class | CSFuncs | Static class that contains a number of pertinent helper methods and properties.
Public class | CSMethod | A class that encapsulates a C# method. This class may only be instantiated by CSUnit.
Public class | CSMethodConstruct | The base class for CSMethod, CSConstructor and CSDestructor. This class may only be instantiated by CSUnit.
Public class | CSType |
Public class | CSUnit | A class that encapsulates a C# source code file (or unit).
Public class | SourceReference | Class for storing a methods file locale, i.e. line. column, method name and class name. This class may only be instantiated by CSUnit.
Enumerations
 | Enumeration | Description
Public enumeration | CSAccessModifiers | Enumerator representing C# access modifiers.
Public enumeration | CSPropertyReadWriteAccess | Enumerator representing a CSProperty read/write access.


CSAccessModifiers Enumeration

CSAccessModifiers Enumeration
Enumerator representing C# access modifiers.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum CSAccessModifiers
Members
Member name | Value | Description
Private | 0 | Variable, method or class is Private.
Protected | 1 | Variable, method or class is Protected.
Public | 2 | Variable, method or class is Public.
Internal | 3 | Variable, method or class is Internal.
ProtectedInternal | 4 | Variable, method or class is Private Internal.
See Also

Reference

Bncs.CSharp Namespace


CSClass Class

CSClass Class
A class that encapsulates a C# class. This class may only be instantiated by CSUnit.
Inheritance Hierarchy
SystemObject
Bncs.CSharpCSClass

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class CSClass : IComparable

The CSClass type exposes the following members.

Methods
 | Name | Description
Public method | CompareTo | IComparable method for sorting by name.
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ScanForRecursiveCalls | Scans the class for recursive calls that may (or may not) be indicative of a Stack Overflow.
Public method | ToString | Returns a string representation of the instance. (Overrides ObjectToString.)
Top
Properties
 | Name | Description
Public property | Constructors | Gets the classes constructors.
Public property | Destructors | Gets the class destructors.
Public property | Methods | Gets the classes methods.
Public property | Name | Gets the class name.
Public property | SourceCode | Gets the classes source code.
Public property | UnitName | Gets the unit name.
Top
See Also

Reference

Bncs.CSharp Namespace


CSClass Methods

CSClass Methods

The CSClass type exposes the following members.

Methods
 | Name | Description
Public method | CompareTo | IComparable method for sorting by name.
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ScanForRecursiveCalls | Scans the class for recursive calls that may (or may not) be indicative of a Stack Overflow.
Public method | ToString | Returns a string representation of the instance. (Overrides ObjectToString.)
Top
See Also

Reference

CSClass Class
Bncs.CSharp Namespace


CSClass.CompareTo Method

CSClassCompareTo Method
IComparable method for sorting by name.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int CompareTo(
    Object object_
)

Parameters

object_
Type: SystemObject
Object to compare.

Return Value

Type: Int32
The compare to result

Implements

IComparableCompareTo(Object)
See Also

Reference

CSClass Class
Bncs.CSharp Namespace


CSClass.ScanForRecursiveCalls Method

CSClassScanForRecursiveCalls Method
Scans the class for recursive calls that may (or may not) be indicative of a Stack Overflow.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<SourceReference> ScanForRecursiveCalls(
    bool considerMethodSignature_
)

Parameters

considerMethodSignature_
Type: SystemBoolean
If true the method signature is taken into account and therefore SHOULD(?) exclude calls to overloaded versions. Else all calls to the same method name are flagged as potentially recursive calls.

Return Value

Type: List SourceReference
A list of source references if recursive calls are flagged else an empty list.
See Also

Reference

CSClass Class
Bncs.CSharp Namespace


CSClass.ToString Method

CSClassToString Method
Returns a string representation of the instance.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
The class name.
See Also

Reference

CSClass Class
Bncs.CSharp Namespace


CSClass Properties

CSClass Properties

The CSClass type exposes the following members.

Properties
 | Name | Description
Public property | Constructors | Gets the classes constructors.
Public property | Destructors | Gets the class destructors.
Public property | Methods | Gets the classes methods.
Public property | Name | Gets the class name.
Public property | SourceCode | Gets the classes source code.
Public property | UnitName | Gets the unit name.
Top
See Also

Reference

CSClass Class
Bncs.CSharp Namespace


CSClass.Constructors Property

CSClassConstructors Property
Gets the classes constructors.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<CSMethodConstruct> Constructors { get; }

Property Value

Type: List CSMethodConstruct
See Also

Reference

CSClass Class
Bncs.CSharp Namespace


CSClass.Destructors Property

CSClassDestructors Property
Gets the class destructors.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<CSMethodConstruct> Destructors { get; }

Property Value

Type: List CSMethodConstruct
See Also

Reference

CSClass Class
Bncs.CSharp Namespace


CSClass.Methods Property

CSClassMethods Property
Gets the classes methods.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<CSMethodConstruct> Methods { get; }

Property Value

Type: List CSMethodConstruct
See Also

Reference

CSClass Class
Bncs.CSharp Namespace


CSClass.Name Property

CSClassName Property
Gets the class name.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Name { get; }

Property Value

Type: String
See Also

Reference

CSClass Class
Bncs.CSharp Namespace


CSClass.SourceCode Property

CSClassSourceCode Property
Gets the classes source code.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<string> SourceCode { get; }

Property Value

Type: List String
See Also

Reference

CSClass Class
Bncs.CSharp Namespace


CSClass.UnitName Property

CSClassUnitName Property
Gets the unit name.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string UnitName { get; }

Property Value

Type: String
See Also

Reference

CSClass Class
Bncs.CSharp Namespace


CSConstructor Class

CSConstructor Class
A class that encapsulates a C# constructor. This class may only be instantiated by CSUnit.
Inheritance Hierarchy
SystemObject
Bncs.CSharpCSMethodConstruct
Bncs.CSharpCSConstructor

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class CSConstructor : CSMethodConstruct

The CSConstructor type exposes the following members.

Methods
 | Name | Description
Public method | CompareTo | IComparable method for sorting by name. (Inherited from CSMethodConstruct.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ScanForRecursiveCall | Scans the method for recursive calls that may (or may not) be indicative of a Stack Overflow. (Inherited from CSMethodConstruct.)
Public method | ToString | Gets a string representation of the instance. (Inherited from CSMethodConstruct.)
Top
Properties
 | Name | Description
Public property | AccessModifier | Gets the methods access modifier. (Inherited from CSMethodConstruct.)
Public property | Arguments | Gets the methods argument list. (Inherited from CSMethodConstruct.)
Public property | Code | Gets the methods source code. (Inherited from CSMethodConstruct.)
Public property | Name | Gets the methods name. (Inherited from CSMethodConstruct.)
Public property | Parent | Gets the methods parent class. (Inherited from CSMethodConstruct.)
Public property | Signature | Gets the methods signature. (Inherited from CSMethodConstruct.)
Top
See Also

Reference

Bncs.CSharp Namespace


CSConstructor Methods

CSConstructor Methods

The CSConstructor type exposes the following members.

Methods
 | Name | Description
Public method | CompareTo | IComparable method for sorting by name. (Inherited from CSMethodConstruct.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ScanForRecursiveCall | Scans the method for recursive calls that may (or may not) be indicative of a Stack Overflow. (Inherited from CSMethodConstruct.)
Public method | ToString | Gets a string representation of the instance. (Inherited from CSMethodConstruct.)
Top
See Also

Reference

CSConstructor Class
Bncs.CSharp Namespace


CSConstructor Properties

CSConstructor Properties

The CSConstructor type exposes the following members.

Properties
 | Name | Description
Public property | AccessModifier | Gets the methods access modifier. (Inherited from CSMethodConstruct.)
Public property | Arguments | Gets the methods argument list. (Inherited from CSMethodConstruct.)
Public property | Code | Gets the methods source code. (Inherited from CSMethodConstruct.)
Public property | Name | Gets the methods name. (Inherited from CSMethodConstruct.)
Public property | Parent | Gets the methods parent class. (Inherited from CSMethodConstruct.)
Public property | Signature | Gets the methods signature. (Inherited from CSMethodConstruct.)
Top
See Also

Reference

CSConstructor Class
Bncs.CSharp Namespace


CSDestructor Class

CSDestructor Class
A class that encapsulates a C# destructor. This class may only be instantiated by CSUnit.
Inheritance Hierarchy
SystemObject
Bncs.CSharpCSMethodConstruct
Bncs.CSharpCSDestructor

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class CSDestructor : CSMethodConstruct

The CSDestructor type exposes the following members.

Methods
 | Name | Description
Public method | CompareTo | IComparable method for sorting by name. (Inherited from CSMethodConstruct.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ScanForRecursiveCall | Scans the method for recursive calls that may (or may not) be indicative of a Stack Overflow. (Inherited from CSMethodConstruct.)
Public method | ToString | Gets a string representation of the instance. (Inherited from CSMethodConstruct.)
Top
Properties
 | Name | Description
Public property | AccessModifier | Gets the methods access modifier. (Inherited from CSMethodConstruct.)
Public property | Arguments | Gets the methods argument list. (Inherited from CSMethodConstruct.)
Public property | Code | Gets the methods source code. (Inherited from CSMethodConstruct.)
Public property | Name | Gets the methods name. (Inherited from CSMethodConstruct.)
Public property | Parent | Gets the methods parent class. (Inherited from CSMethodConstruct.)
Public property | Signature | Gets the methods signature. (Inherited from CSMethodConstruct.)
Top
See Also

Reference

Bncs.CSharp Namespace


CSDestructor Methods

CSDestructor Methods

The CSDestructor type exposes the following members.

Methods
 | Name | Description
Public method | CompareTo | IComparable method for sorting by name. (Inherited from CSMethodConstruct.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ScanForRecursiveCall | Scans the method for recursive calls that may (or may not) be indicative of a Stack Overflow. (Inherited from CSMethodConstruct.)
Public method | ToString | Gets a string representation of the instance. (Inherited from CSMethodConstruct.)
Top
See Also

Reference

CSDestructor Class
Bncs.CSharp Namespace


CSDestructor Properties

CSDestructor Properties

The CSDestructor type exposes the following members.

Properties
 | Name | Description
Public property | AccessModifier | Gets the methods access modifier. (Inherited from CSMethodConstruct.)
Public property | Arguments | Gets the methods argument list. (Inherited from CSMethodConstruct.)
Public property | Code | Gets the methods source code. (Inherited from CSMethodConstruct.)
Public property | Name | Gets the methods name. (Inherited from CSMethodConstruct.)
Public property | Parent | Gets the methods parent class. (Inherited from CSMethodConstruct.)
Public property | Signature | Gets the methods signature. (Inherited from CSMethodConstruct.)
Top
See Also

Reference

CSDestructor Class
Bncs.CSharp Namespace


CSFuncs Class

CSFuncs Class
Static class that contains a number of pertinent helper methods and properties.
Inheritance Hierarchy
SystemObject
Bncs.CSharpCSFuncs

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static class CSFuncs

The CSFuncs type exposes the following members.

Methods
Name | Description
ExtractFilenames | Reads the supplied file name irespective of whether it is a C# source unit (.cs) or a C# project (.csproj) and extracts a list of source code units.
FindEquals | Ascertains if the line of source code provided contains the = operator.
Top
Properties
Name | Description
DNetTypes | Gets an array of strings containing .Net types.
Operators | Gets an array of strings containing all C# operators.
Types | Gets an array of strings containing C# types.
Top
See Also

Reference

Bncs.CSharp Namespace


CSFuncs Methods

CSFuncs Methods

The CSFuncs type exposes the following members.

Methods
Name | Description
ExtractFilenames | Reads the supplied file name irespective of whether it is a C# source unit (.cs) or a C# project (.csproj) and extracts a list of source code units.
FindEquals | Ascertains if the line of source code provided contains the = operator.
Top
See Also

Reference

CSFuncs Class
Bncs.CSharp Namespace


CSFuncs.ExtractFilenames Method

CSFuncsExtractFilenames Method
Reads the supplied file name irespective of whether it is a C# source unit (.cs) or a C# project (.csproj) and extracts a list of source code units.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static List<string> ExtractFilenames(
    string filename_
)

Parameters

filename_
Type: SystemString
File name from which to extract C# unit file names.

Return Value

Type: List String
A list of fully qualified file names.
See Also

Reference

CSFuncs Class
Bncs.CSharp Namespace


CSFuncs.FindEquals Method

CSFuncsFindEquals Method
Ascertains if the line of source code provided contains the = operator.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static Point FindEquals(
    string sourceCode_
)

Parameters

sourceCode_
Type: SystemString
Code to analyse

Return Value

Type: Point
A Point object where X is the index and Y is the length. If not found returns -1, -1
See Also

Reference

CSFuncs Class
Bncs.CSharp Namespace


CSFuncs Properties

CSFuncs Properties

The CSFuncs type exposes the following members.

Properties
Name | Description
DNetTypes | Gets an array of strings containing .Net types.
Operators | Gets an array of strings containing all C# operators.
Types | Gets an array of strings containing C# types.
Top
See Also

Reference

CSFuncs Class
Bncs.CSharp Namespace


CSFuncs.DNetTypes Property

CSFuncsDNetTypes Property
Gets an array of strings containing .Net types.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string[] DNetTypes { get; }

Property Value

Type: String
See Also

Reference

CSFuncs Class
Bncs.CSharp Namespace


CSFuncs.Operators Property

CSFuncsOperators Property
Gets an array of strings containing all C# operators.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string[] Operators { get; }

Property Value

Type: String
See Also

Reference

CSFuncs Class
Bncs.CSharp Namespace


CSFuncs.Types Property

CSFuncsTypes Property
Gets an array of strings containing C# types.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string[] Types { get; }

Property Value

Type: String
See Also

Reference

CSFuncs Class
Bncs.CSharp Namespace


CSMethod Class

CSMethod Class
A class that encapsulates a C# method. This class may only be instantiated by CSUnit.
Inheritance Hierarchy
SystemObject
Bncs.CSharpCSMethodConstruct
Bncs.CSharpCSMethod

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class CSMethod : CSMethodConstruct

The CSMethod type exposes the following members.

Methods
 | Name | Description
Public method | CompareTo | IComparable method for sorting by name. (Inherited from CSMethodConstruct.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ScanForRecursiveCall | Scans the method for recursive calls that may (or may not) be indicative of a Stack Overflow. (Inherited from CSMethodConstruct.)
Public method | ToString | Gets a string representation of the instance. (Inherited from CSMethodConstruct.)
Top
Properties
 | Name | Description
Public property | AccessModifier | Gets the methods access modifier. (Inherited from CSMethodConstruct.)
Public property | Arguments | Gets the methods argument list. (Inherited from CSMethodConstruct.)
Public property | Code | Gets the methods source code. (Inherited from CSMethodConstruct.)
Public property | Name | Gets the methods name. (Inherited from CSMethodConstruct.)
Public property | Parent | Gets the methods parent class. (Inherited from CSMethodConstruct.)
Public property | Signature | Gets the methods signature. (Inherited from CSMethodConstruct.)
Top
See Also

Reference

Bncs.CSharp Namespace


CSMethod Methods

CSMethod Methods

The CSMethod type exposes the following members.

Methods
 | Name | Description
Public method | CompareTo | IComparable method for sorting by name. (Inherited from CSMethodConstruct.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ScanForRecursiveCall | Scans the method for recursive calls that may (or may not) be indicative of a Stack Overflow. (Inherited from CSMethodConstruct.)
Public method | ToString | Gets a string representation of the instance. (Inherited from CSMethodConstruct.)
Top
See Also

Reference

CSMethod Class
Bncs.CSharp Namespace


CSMethod Properties

CSMethod Properties

The CSMethod type exposes the following members.

Properties
 | Name | Description
Public property | AccessModifier | Gets the methods access modifier. (Inherited from CSMethodConstruct.)
Public property | Arguments | Gets the methods argument list. (Inherited from CSMethodConstruct.)
Public property | Code | Gets the methods source code. (Inherited from CSMethodConstruct.)
Public property | Name | Gets the methods name. (Inherited from CSMethodConstruct.)
Public property | Parent | Gets the methods parent class. (Inherited from CSMethodConstruct.)
Public property | Signature | Gets the methods signature. (Inherited from CSMethodConstruct.)
Top
See Also

Reference

CSMethod Class
Bncs.CSharp Namespace


CSMethodConstruct Class

CSMethodConstruct Class
The base class for CSMethod, CSConstructor and CSDestructor. This class may only be instantiated by CSUnit.
Inheritance Hierarchy
SystemObject
Bncs.CSharpCSMethodConstruct
Bncs.CSharpCSConstructor
Bncs.CSharpCSDestructor
Bncs.CSharpCSMethod

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class CSMethodConstruct : IComparable

The CSMethodConstruct type exposes the following members.

Methods
 | Name | Description
Public method | CompareTo | IComparable method for sorting by name.
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ScanForRecursiveCall | Scans the method for recursive calls that may (or may not) be indicative of a Stack Overflow.
Public method | ToString | Gets a string representation of the instance. (Overrides ObjectToString.)
Top
Properties
 | Name | Description
Public property | AccessModifier | Gets the methods access modifier.
Public property | Arguments | Gets the methods argument list.
Public property | Code | Gets the methods source code.
Public property | Name | Gets the methods name.
Public property | Parent | Gets the methods parent class.
Public property | Signature | Gets the methods signature.
Top
See Also

Reference

Bncs.CSharp Namespace


CSMethodConstruct Methods

CSMethodConstruct Methods

The CSMethodConstruct type exposes the following members.

Methods
 | Name | Description
Public method | CompareTo | IComparable method for sorting by name.
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ScanForRecursiveCall | Scans the method for recursive calls that may (or may not) be indicative of a Stack Overflow.
Public method | ToString | Gets a string representation of the instance. (Overrides ObjectToString.)
Top
See Also

Reference

CSMethodConstruct Class
Bncs.CSharp Namespace


CSMethodConstruct.CompareTo Method

CSMethodConstructCompareTo Method
IComparable method for sorting by name.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int CompareTo(
    Object object_
)

Parameters

object_
Type: SystemObject
Object to compare.

Return Value

Type: Int32
The compare to result

Implements

IComparableCompareTo(Object)
See Also

Reference

CSMethodConstruct Class
Bncs.CSharp Namespace


CSMethodConstruct.ScanForRecursiveCall Method

CSMethodConstructScanForRecursiveCall Method
Scans the method for recursive calls that may (or may not) be indicative of a Stack Overflow.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public SourceReference ScanForRecursiveCall(
    bool considerMethodSignature_
)

Parameters

considerMethodSignature_
Type: SystemBoolean
If true the method signature is taken into account and therefore SHOULD(?) exclude calls to overloaded versions. Else all calls to the same method name are flagged as potentially recursive calls.

Return Value

Type: SourceReference
A source reference if a recursive call is flagged else null.
See Also

Reference

CSMethodConstruct Class
Bncs.CSharp Namespace


CSMethodConstruct.ToString Method

CSMethodConstructToString Method
Gets a string representation of the instance.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
Name plus signature.
See Also

Reference

CSMethodConstruct Class
Bncs.CSharp Namespace


CSMethodConstruct Properties

CSMethodConstruct Properties

The CSMethodConstruct type exposes the following members.

Properties
 | Name | Description
Public property | AccessModifier | Gets the methods access modifier.
Public property | Arguments | Gets the methods argument list.
Public property | Code | Gets the methods source code.
Public property | Name | Gets the methods name.
Public property | Parent | Gets the methods parent class.
Public property | Signature | Gets the methods signature.
Top
See Also

Reference

CSMethodConstruct Class
Bncs.CSharp Namespace


CSMethodConstruct.AccessModifier Property

CSMethodConstructAccessModifier Property
Gets the methods access modifier.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CSAccessModifiers AccessModifier { get; }

Property Value

Type: CSAccessModifiers
See Also

Reference

CSMethodConstruct Class
Bncs.CSharp Namespace


CSMethodConstruct.Arguments Property

CSMethodConstructArguments Property
Gets the methods argument list.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string[] Arguments { get; }

Property Value

Type: String
See Also

Reference

CSMethodConstruct Class
Bncs.CSharp Namespace


CSMethodConstruct.Code Property

CSMethodConstructCode Property
Gets the methods source code.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<string> Code { get; }

Property Value

Type: List String
See Also

Reference

CSMethodConstruct Class
Bncs.CSharp Namespace


CSMethodConstruct.Name Property

CSMethodConstructName Property
Gets the methods name.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Name { get; }

Property Value

Type: String
See Also

Reference

CSMethodConstruct Class
Bncs.CSharp Namespace


CSMethodConstruct.Parent Property

CSMethodConstructParent Property
Gets the methods parent class.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CSClass Parent { get; }

Property Value

Type: CSClass
See Also

Reference

CSMethodConstruct Class
Bncs.CSharp Namespace


CSMethodConstruct.Signature Property

CSMethodConstructSignature Property
Gets the methods signature.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Signature { get; }

Property Value

Type: String
See Also

Reference

CSMethodConstruct Class
Bncs.CSharp Namespace


CSPropertyReadWriteAccess Enumeration

CSPropertyReadWriteAccess Enumeration
Enumerator representing a CSProperty read/write access.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum CSPropertyReadWriteAccess
Members
Member name | Value | Description
ReadWrite | 0 | Property has a getter and a setter.
ReadOnly | 1 | Property has a getter only.
WriteOnly | 2 | Property has a setter only.
See Also

Reference

Bncs.CSharp Namespace


CSType Class

CSType Class

[Missing <summary> documentation for "T:Bncs.CSharp.CSType"]

Inheritance Hierarchy
SystemObject
Bncs.CSharpCSType

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class CSType

The CSType type exposes the following members.

Constructors
 | Name | Description
Public method | CSType(String, ListString) | Initializes a new instance of the CSType class
Public method | CSType(String, ListString, ListCSType) | Initializes a new instance of the CSType class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | (Overrides ObjectToString.)
Top
Properties
 | Name | Description
Public property | FullName |
Public property | Name |
Public property | Validated |
Top
See Also

Reference

Bncs.CSharp Namespace


CSType Constructor

CSType Constructor
Overload List
 | Name | Description
Public method | CSType(String, ListString) | Initializes a new instance of the CSType class
Public method | CSType(String, ListString, ListCSType) | Initializes a new instance of the CSType class
Top
See Also

Reference

CSType Class
Bncs.CSharp Namespace


CSType Constructor (String, List(String))

CSType Constructor (String, ListString)
Initializes a new instance of the CSType class

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CSType(
    string name_,
    List<string> assemblies_
)

Parameters

name_
Type: SystemString

[Missing <param name="name_"/> documentation for "M:Bncs.CSharp.CSType.#ctor(System.String,System.Collections.Generic.List{System.String})"]

assemblies_
Type: System.Collections.GenericList String

[Missing <param name="assemblies_"/> documentation for "M:Bncs.CSharp.CSType.#ctor(System.String,System.Collections.Generic.List{System.String})"]

See Also

Reference

CSType Class
CSType Overload
Bncs.CSharp Namespace


CSType Constructor (String, List(String), List(CSType))

CSType Constructor (String, ListString, ListCSType)
Initializes a new instance of the CSType class

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CSType(
    string name_,
    List<string> assemblies_,
    List<CSType> subTypes_
)

Parameters

name_
Type: SystemString

[Missing <param name="name_"/> documentation for "M:Bncs.CSharp.CSType.#ctor(System.String,System.Collections.Generic.List{System.String},System.Collections.Generic.List{Bncs.CSharp.CSType})"]

assemblies_
Type: System.Collections.GenericList String

[Missing <param name="assemblies_"/> documentation for "M:Bncs.CSharp.CSType.#ctor(System.String,System.Collections.Generic.List{System.String},System.Collections.Generic.List{Bncs.CSharp.CSType})"]

subTypes_
Type: System.Collections.GenericList CSType

[Missing <param name="subTypes_"/> documentation for "M:Bncs.CSharp.CSType.#ctor(System.String,System.Collections.Generic.List{System.String},System.Collections.Generic.List{Bncs.CSharp.CSType})"]

See Also

Reference

CSType Class
CSType Overload
Bncs.CSharp Namespace


CSType Methods

CSType Methods

The CSType type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | (Overrides ObjectToString.)
Top
See Also

Reference

CSType Class
Bncs.CSharp Namespace


CSType.ToString Method

CSTypeToString Method

[Missing <summary> documentation for "M:Bncs.CSharp.CSType.ToString"]

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String

[Missing <returns> documentation for "M:Bncs.CSharp.CSType.ToString"]

See Also

Reference

CSType Class
Bncs.CSharp Namespace


CSType Properties

CSType Properties

The CSType type exposes the following members.

Properties
 | Name | Description
Public property | FullName |
Public property | Name |
Public property | Validated |
Top
See Also

Reference

CSType Class
Bncs.CSharp Namespace


CSType.FullName Property

CSTypeFullName Property

[Missing <summary> documentation for "P:Bncs.CSharp.CSType.FullName"]

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string FullName { get; }

Property Value

Type: String
See Also

Reference

CSType Class
Bncs.CSharp Namespace


CSType.Name Property

CSTypeName Property

[Missing <summary> documentation for "P:Bncs.CSharp.CSType.Name"]

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Name { get; }

Property Value

Type: String
See Also

Reference

CSType Class
Bncs.CSharp Namespace


CSType.Validated Property

CSTypeValidated Property

[Missing <summary> documentation for "P:Bncs.CSharp.CSType.Validated"]

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Validated { get; }

Property Value

Type: Boolean
See Also

Reference

CSType Class
Bncs.CSharp Namespace


CSUnit Class

CSUnit Class
A class that encapsulates a C# source code file (or unit).
Inheritance Hierarchy
SystemObject
Bncs.CSharpCSUnit

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class CSUnit

The CSUnit type exposes the following members.

Constructors
Name Description
CSUnit
Constructor that reads the supplied file name to extract data from.
Examples
This example reads the supplied C# unit and fills a ListBox with the names of all methods therein.
Copy
private void ReadCSUnit(string filename_)
{
    CSUnit unit = new CSUnit(filename_);
    foreach (CSClass csclass in unit.Classes)
    {
        foreach (CSMethod method in csclass.Methods)
            lbMethods.Items.Add(method);
    }
}
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ScanForRecursiveCalls | Scans the unit for recursive calls that may (or may not) be indicative of a Stack Overflow.
Public method | ToString | Gets a string representation of the instance. (Overrides ObjectToString.)
Top
Properties
 | Name | Description
Public property | Classes | Gets a list of classes in the unit.
Public property | Filename | Gets the file name of the unit.
Public property | HasMethods | Gets a value indicating if at least one class therein contains at least one method.
Public property | Namespaces | Gets a list of namespaces within the file.
Public property | SourceCode | Gets the source code, file content, from within the file.
Public property | Using | Gets a list of using declarations within the file.
Top
See Also

Reference

Bncs.CSharp Namespace


CSUnit Constructor

CSUnit Constructor
Constructor that reads the supplied file name to extract data from.
Examples
This example reads the supplied C# unit and fills a ListBox with the names of all methods therein.
Copy
private void ReadCSUnit(string filename_)
{
    CSUnit unit = new CSUnit(filename_);
    foreach (CSClass csclass in unit.Classes)
    {
        foreach (CSMethod method in csclass.Methods)
            lbMethods.Items.Add(method);
    }
}

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CSUnit(
    string fileName_
)

Parameters

fileName_
Type: SystemString
The full path of the file.
See Also

Reference

CSUnit Class
Bncs.CSharp Namespace


CSUnit Methods

CSUnit Methods

The CSUnit type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ScanForRecursiveCalls | Scans the unit for recursive calls that may (or may not) be indicative of a Stack Overflow.
Public method | ToString | Gets a string representation of the instance. (Overrides ObjectToString.)
Top
See Also

Reference

CSUnit Class
Bncs.CSharp Namespace


CSUnit.ScanForRecursiveCalls Method

CSUnitScanForRecursiveCalls Method
Scans the unit for recursive calls that may (or may not) be indicative of a Stack Overflow.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<SourceReference> ScanForRecursiveCalls(
    bool considerMethodSignature_
)

Parameters

considerMethodSignature_
Type: SystemBoolean
If true the method signature is taken into account and therefore SHOULD(?) exclude calls to overloaded versions. Else all calls to the same method name are flagged as potentially recursive calls.

Return Value

Type: List SourceReference
A list of source references if recursive calls are flagged else an empty list.
See Also

Reference

CSUnit Class
Bncs.CSharp Namespace


CSUnit.ToString Method

CSUnitToString Method
Gets a string representation of the instance.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
The unit file name.
See Also

Reference

CSUnit Class
Bncs.CSharp Namespace


CSUnit Properties

CSUnit Properties

The CSUnit type exposes the following members.

Properties
 | Name | Description
Public property | Classes | Gets a list of classes in the unit.
Public property | Filename | Gets the file name of the unit.
Public property | HasMethods | Gets a value indicating if at least one class therein contains at least one method.
Public property | Namespaces | Gets a list of namespaces within the file.
Public property | SourceCode | Gets the source code, file content, from within the file.
Public property | Using | Gets a list of using declarations within the file.
Top
See Also

Reference

CSUnit Class
Bncs.CSharp Namespace


CSUnit.Classes Property

CSUnitClasses Property
Gets a list of classes in the unit.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<CSClass> Classes { get; }

Property Value

Type: List CSClass
See Also

Reference

CSUnit Class
Bncs.CSharp Namespace


CSUnit.Filename Property

CSUnitFilename Property
Gets the file name of the unit.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Filename { get; }

Property Value

Type: String
See Also

Reference

CSUnit Class
Bncs.CSharp Namespace


CSUnit.HasMethods Property

CSUnitHasMethods Property
Gets a value indicating if at least one class therein contains at least one method.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool HasMethods { get; }

Property Value

Type: Boolean
See Also

Reference

CSUnit Class
Bncs.CSharp Namespace


CSUnit.Namespaces Property

CSUnitNamespaces Property
Gets a list of namespaces within the file.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<string> Namespaces { get; }

Property Value

Type: List String
See Also

Reference

CSUnit Class
Bncs.CSharp Namespace


CSUnit.SourceCode Property

CSUnitSourceCode Property
Gets the source code, file content, from within the file.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<string> SourceCode { get; }

Property Value

Type: List String
See Also

Reference

CSUnit Class
Bncs.CSharp Namespace


CSUnit.Using Property

CSUnitUsing Property
Gets a list of using declarations within the file.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<string> Using { get; }

Property Value

Type: List String
See Also

Reference

CSUnit Class
Bncs.CSharp Namespace


SourceReference Class

SourceReference Class
Class for storing a methods file locale, i.e. line. column, method name and class name. This class may only be instantiated by CSUnit.
Inheritance Hierarchy
SystemObject
Bncs.CSharpSourceReference

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class SourceReference

The SourceReference type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the instance. (Overrides ObjectToString.)
Top
Fields
 | Name | Description
Public field | ClassName | Gets / sets the class name.
Public field | Column | Gets / sets the column number.
Public field | Line | Gets / sets the line number.
Public field | MethodName | Gets / sets the method name.
Public field | Unit | Gets / sets the unit name.
Top
See Also

Reference

Bncs.CSharp Namespace


SourceReference Fields

SourceReference Fields

The SourceReference type exposes the following members.

Fields
 | Name | Description
Public field | ClassName | Gets / sets the class name.
Public field | Column | Gets / sets the column number.
Public field | Line | Gets / sets the line number.
Public field | MethodName | Gets / sets the method name.
Public field | Unit | Gets / sets the unit name.
Top
See Also

Reference

SourceReference Class
Bncs.CSharp Namespace


SourceReference.ClassName Field

SourceReferenceClassName Field
Gets / sets the class name.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string ClassName

Field Value

Type: String
See Also

Reference

SourceReference Class
Bncs.CSharp Namespace


SourceReference.Column Field

SourceReferenceColumn Field
Gets / sets the column number.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint Column

Field Value

Type: UInt32
See Also

Reference

SourceReference Class
Bncs.CSharp Namespace


SourceReference.Line Field

SourceReferenceLine Field
Gets / sets the line number.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint Line

Field Value

Type: UInt32
See Also

Reference

SourceReference Class
Bncs.CSharp Namespace


SourceReference.MethodName Field

SourceReferenceMethodName Field
Gets / sets the method name.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string MethodName

Field Value

Type: String
See Also

Reference

SourceReference Class
Bncs.CSharp Namespace


SourceReference.Unit Field

SourceReferenceUnit Field
Gets / sets the unit name.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Unit

Field Value

Type: String
See Also

Reference

SourceReference Class
Bncs.CSharp Namespace


SourceReference Methods

SourceReference Methods

The SourceReference type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the instance. (Overrides ObjectToString.)
Top
See Also

Reference

SourceReference Class
Bncs.CSharp Namespace


SourceReference.ToString Method

SourceReferenceToString Method
Returns a string representation of the instance.

Namespace: Bncs.CSharp
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
Class and method names, line and column numbers.
See Also

Reference

SourceReference Class
Bncs.CSharp Namespace


Bncs.Debug Namespace

Bncs.Debug Namespace
This namespace has a CPU performance monitoring WPF window class.
Classes
 | Class | Description
Public class | BNCSTxRxLogDisplayApplication | Class that communicates with a running BNCS Tx / Rx Log Display application instance
Public class | BNCSTxRxLogDisplayWindowsMessages | Class to register system wide Windows messages for communication with the BNCSTxRxLogDisplay application
Public class | OnCPUDelayChangeEventArgs | Event arg class for OnDelayChange event.
Public class | OnCPUPeakEventArgs | Event arg class for OnCPUPeak event.
Public class | PerformanceAnalysisAndControlWindow | A WPF window to present CPU performance data in an application.
Delegates
 | Delegate | Description
Public delegate | OnCPUDelayChangeEventHandler | Delegate for OnDelayChange event.
Public delegate | OnCPUPeakEventHandler | Delegate for OnCPUPeak event.


BNCSTxRxLogDisplayApplication Class

BNCSTxRxLogDisplayApplication Class
Class that communicates with a running BNCS Tx / Rx Log Display application instance
Inheritance Hierarchy
SystemObject
Bncs.DebugBNCSTxRxLogDisplayApplication

Namespace: Bncs.Debug
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BNCSTxRxLogDisplayApplication

The BNCSTxRxLogDisplayApplication type exposes the following members.

Constructors
 | Name | Description
Public method | BNCSTxRxLogDisplayApplication | Initializes a new instance of the BNCSTxRxLogDisplayApplication class
Top
Methods
 | Name | Description
Public method | ClearQueue | Clears the in-memory message queue
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ProcessQueue | Attempts to process the queue
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Public method | Write | Writes a message to the BNCS Tx / Rx Log Display application or to memory if the application is not running
Top
Properties
 | Name | Description
Public property | IsRunning | Returns a flag which if set indicates thet the BNCS Tx / Rx Log Display application is running
Top
See Also

Reference

Bncs.Debug Namespace


BNCSTxRxLogDisplayApplication Constructor

BNCSTxRxLogDisplayApplication Constructor
Initializes a new instance of the BNCSTxRxLogDisplayApplication class

Namespace: Bncs.Debug
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSTxRxLogDisplayApplication()
See Also

Reference

BNCSTxRxLogDisplayApplication Class
Bncs.Debug Namespace


BNCSTxRxLogDisplayApplication Methods

BNCSTxRxLogDisplayApplication Methods

The BNCSTxRxLogDisplayApplication type exposes the following members.

Methods
 | Name | Description
Public method | ClearQueue | Clears the in-memory message queue
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ProcessQueue | Attempts to process the queue
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Public method | Write | Writes a message to the BNCS Tx / Rx Log Display application or to memory if the application is not running
Top
See Also

Reference

BNCSTxRxLogDisplayApplication Class
Bncs.Debug Namespace


BNCSTxRxLogDisplayApplication.ClearQueue Method

BNCSTxRxLogDisplayApplicationClearQueue Method
Clears the in-memory message queue

Namespace: Bncs.Debug
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void ClearQueue()
See Also

Reference

BNCSTxRxLogDisplayApplication Class
Bncs.Debug Namespace


BNCSTxRxLogDisplayApplication.ProcessQueue Method

BNCSTxRxLogDisplayApplicationProcessQueue Method
Attempts to process the queue

Namespace: Bncs.Debug
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool ProcessQueue()

Return Value

Type: Boolean
True if the queue is empty or all messages were sent to the BNCS Tx / Rx Log Display application else false
See Also

Reference

BNCSTxRxLogDisplayApplication Class
Bncs.Debug Namespace


BNCSTxRxLogDisplayApplication.Write Method

BNCSTxRxLogDisplayApplicationWrite Method
Writes a message to the BNCS Tx / Rx Log Display application or to memory if the application is not running

Namespace: Bncs.Debug
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Write(
    OnTxRxDebugEventArgs message_,
    string applicationName_
)

Parameters

message_
Type: Bncs.CommsOnTxRxDebugEventArgs
Message class to write
applicationName_
Type: SystemString
Application name for the BNCS Tx / Rx Log Display application to display

Return Value

Type: Boolean
True if the message was written to the application else false. If false then the message is added to a queue for later processing
See Also

Reference

BNCSTxRxLogDisplayApplication Class
Bncs.Debug Namespace


BNCSTxRxLogDisplayApplication Properties

BNCSTxRxLogDisplayApplication Properties

The BNCSTxRxLogDisplayApplication type exposes the following members.

Properties
 | Name | Description
Public property | IsRunning | Returns a flag which if set indicates thet the BNCS Tx / Rx Log Display application is running
Top
See Also

Reference

BNCSTxRxLogDisplayApplication Class
Bncs.Debug Namespace


BNCSTxRxLogDisplayApplication.IsRunning Property

BNCSTxRxLogDisplayApplicationIsRunning Property
Returns a flag which if set indicates thet the BNCS Tx / Rx Log Display application is running

Namespace: Bncs.Debug
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool IsRunning { get; }

Property Value

Type: Boolean
See Also

Reference

BNCSTxRxLogDisplayApplication Class
Bncs.Debug Namespace


BNCSTxRxLogDisplayWindowsMessages Class

BNCSTxRxLogDisplayWindowsMessages Class
Class to register system wide Windows messages for communication with the BNCSTxRxLogDisplay application
Inheritance Hierarchy
SystemObject
Bncs.DebugBNCSTxRxLogDisplayWindowsMessages

Namespace: Bncs.Debug
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BNCSTxRxLogDisplayWindowsMessages

The BNCSTxRxLogDisplayWindowsMessages type exposes the following members.

Constructors
 | Name | Description
Public method | BNCSTxRxLogDisplayWindowsMessages | Constructor, registers messages if not already registered
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | BncsLogMessageAcknowledgement | Gets the acknowledgement Windows Message
Public property | BncsRxMessage | Gets the Bncs Rx Windows Message
Public property | BncsTxMessage | Gets the Bncs Tx Windows Message
Top
See Also

Reference

Bncs.Debug Namespace


BNCSTxRxLogDisplayWindowsMessages Constructor

BNCSTxRxLogDisplayWindowsMessages Constructor
Constructor, registers messages if not already registered

Namespace: Bncs.Debug
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSTxRxLogDisplayWindowsMessages()
See Also

Reference

BNCSTxRxLogDisplayWindowsMessages Class
Bncs.Debug Namespace


BNCSTxRxLogDisplayWindowsMessages Methods

BNCSTxRxLogDisplayWindowsMessages Methods

The BNCSTxRxLogDisplayWindowsMessages type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

BNCSTxRxLogDisplayWindowsMessages Class
Bncs.Debug Namespace


BNCSTxRxLogDisplayWindowsMessages Properties

BNCSTxRxLogDisplayWindowsMessages Properties

The BNCSTxRxLogDisplayWindowsMessages type exposes the following members.

Properties
 | Name | Description
Public property | BncsLogMessageAcknowledgement | Gets the acknowledgement Windows Message
Public property | BncsRxMessage | Gets the Bncs Rx Windows Message
Public property | BncsTxMessage | Gets the Bncs Tx Windows Message
Top
See Also

Reference

BNCSTxRxLogDisplayWindowsMessages Class
Bncs.Debug Namespace


BNCSTxRxLogDisplayWindowsMessages.BncsLogMessageAcknowledgement Property

BNCSTxRxLogDisplayWindowsMessagesBncsLogMessageAcknowledgement Property
Gets the acknowledgement Windows Message

Namespace: Bncs.Debug
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint BncsLogMessageAcknowledgement { get; }

Property Value

Type: UInt32
See Also

Reference

BNCSTxRxLogDisplayWindowsMessages Class
Bncs.Debug Namespace


BNCSTxRxLogDisplayWindowsMessages.BncsRxMessage Property

BNCSTxRxLogDisplayWindowsMessagesBncsRxMessage Property
Gets the Bncs Rx Windows Message

Namespace: Bncs.Debug
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint BncsRxMessage { get; }

Property Value

Type: UInt32
See Also

Reference

BNCSTxRxLogDisplayWindowsMessages Class
Bncs.Debug Namespace


BNCSTxRxLogDisplayWindowsMessages.BncsTxMessage Property

BNCSTxRxLogDisplayWindowsMessagesBncsTxMessage Property
Gets the Bncs Tx Windows Message

Namespace: Bncs.Debug
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint BncsTxMessage { get; }

Property Value

Type: UInt32
See Also

Reference

BNCSTxRxLogDisplayWindowsMessages Class
Bncs.Debug Namespace


OnCPUDelayChangeEventArgs Class

OnCPUDelayChangeEventArgs Class
Event arg class for OnDelayChange event.
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.DebugOnCPUDelayChangeEventArgs

Namespace: Bncs.Debug
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class OnCPUDelayChangeEventArgs : EventArgs

The OnCPUDelayChangeEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | OnCPUDelayChangeEventArgs | Initializes a new instance of the OnCPUDelayChangeEventArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | Delay | New delay time.
Top
See Also

Reference

Bncs.Debug Namespace


OnCPUDelayChangeEventArgs Constructor

OnCPUDelayChangeEventArgs Constructor
Initializes a new instance of the OnCPUDelayChangeEventArgs class

Namespace: Bncs.Debug
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public OnCPUDelayChangeEventArgs()
See Also

Reference

OnCPUDelayChangeEventArgs Class
Bncs.Debug Namespace


OnCPUDelayChangeEventArgs Fields

OnCPUDelayChangeEventArgs Fields

The OnCPUDelayChangeEventArgs type exposes the following members.

Fields
 | Name | Description
Public field | Delay | New delay time.
Top
See Also

Reference

OnCPUDelayChangeEventArgs Class
Bncs.Debug Namespace


OnCPUDelayChangeEventArgs.Delay Field

OnCPUDelayChangeEventArgsDelay Field
New delay time.

Namespace: Bncs.Debug
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint Delay

Field Value

Type: UInt32
See Also

Reference

OnCPUDelayChangeEventArgs Class
Bncs.Debug Namespace


OnCPUDelayChangeEventArgs Methods

OnCPUDelayChangeEventArgs Methods

The OnCPUDelayChangeEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

OnCPUDelayChangeEventArgs Class
Bncs.Debug Namespace


OnCPUDelayChangeEventHandler Delegate

OnCPUDelayChangeEventHandler Delegate
Delegate for OnDelayChange event.

Namespace: Bncs.Debug
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void OnCPUDelayChangeEventHandler(
    Object sender,
    OnCPUDelayChangeEventArgs e
)

Parameters

sender
Type: SystemObject
Calling object
e
Type: Bncs.DebugOnCPUDelayChangeEventArgs
Parameters
See Also

Reference

Bncs.Debug Namespace


OnCPUPeakEventArgs Class

OnCPUPeakEventArgs Class
Event arg class for OnCPUPeak event.
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.DebugOnCPUPeakEventArgs

Namespace: Bncs.Debug
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class OnCPUPeakEventArgs : EventArgs

The OnCPUPeakEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | OnCPUPeakEventArgs | Initializes a new instance of the OnCPUPeakEventArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | Percentage | CPU percentage.
Top
See Also

Reference

Bncs.Debug Namespace


OnCPUPeakEventArgs Constructor

OnCPUPeakEventArgs Constructor
Initializes a new instance of the OnCPUPeakEventArgs class

Namespace: Bncs.Debug
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public OnCPUPeakEventArgs()
See Also

Reference

OnCPUPeakEventArgs Class
Bncs.Debug Namespace


OnCPUPeakEventArgs Fields

OnCPUPeakEventArgs Fields

The OnCPUPeakEventArgs type exposes the following members.

Fields
 | Name | Description
Public field | Percentage | CPU percentage.
Top
See Also

Reference

OnCPUPeakEventArgs Class
Bncs.Debug Namespace


OnCPUPeakEventArgs.Percentage Field

OnCPUPeakEventArgsPercentage Field
CPU percentage.

Namespace: Bncs.Debug
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint Percentage

Field Value

Type: UInt32
See Also

Reference

OnCPUPeakEventArgs Class
Bncs.Debug Namespace


OnCPUPeakEventArgs Methods

OnCPUPeakEventArgs Methods

The OnCPUPeakEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

OnCPUPeakEventArgs Class
Bncs.Debug Namespace


OnCPUPeakEventHandler Delegate

OnCPUPeakEventHandler Delegate
Delegate for OnCPUPeak event.

Namespace: Bncs.Debug
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void OnCPUPeakEventHandler(
    Object sender,
    OnCPUPeakEventArgs e
)

Parameters

sender
Type: SystemObject
Calling object
e
Type: Bncs.DebugOnCPUPeakEventArgs
Parameters
See Also

Reference

Bncs.Debug Namespace


PerformanceAnalysisAndControlWindow Class

PerformanceAnalysisAndControlWindow Class
A WPF window to present CPU performance data in an application.
PerformanceAnalysisAndControlWindow
Inheritance Hierarchy
SystemObject
System.Windows.ThreadingDispatcherObject
System.WindowsDependencyObject
System.Windows.MediaVisual
System.WindowsUIElement
System.WindowsFrameworkElement
System.Windows.ControlsControl
System.Windows.ControlsContentControl
System.WindowsWindow
Bncs.DebugPerformanceAnalysisAndControlWindow

Namespace: Bncs.Debug
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class PerformanceAnalysisAndControlWindow : Window,
    IComponentConnector

The PerformanceAnalysisAndControlWindow type exposes the following members.

Constructors
 | Name | Description
Public method | PerformanceAnalysisAndControlWindow(String) | Creates a window targeting the supplied process name with no CPU delay controls and a default CPU check frequency of 500ms
Public method | PerformanceAnalysisAndControlWindow(UInt32, String) | Creates a window targeting the supplied process name with no CPU delay controls and a specified CPU check frequency in milliseconds
Public method | PerformanceAnalysisAndControlWindow(UInt32, UInt32, String) | Creates a window targeting the supplied process name, CPU delay controls are shown and initialised and a specified CPU check frequency in milliseconds
Top
Methods
 | Name | Description
Public method | Activate | Attempts to bring the window to the foreground and activates it. (Inherited from Window.)
Public method | AddHandler(RoutedEvent, Delegate) | Adds a routed event handler for a specified routed event, adding the handler to the handler collection on the current element. (Inherited from UIElement.)
Public method | AddHandler(RoutedEvent, Delegate, Boolean) | Adds a routed event handler for a specified routed event, adding the handler to the handler collection on the current element. Specify handledEventsToo as true to have the provided handler be invoked for routed event that had already been marked as handled by another element along the event route. (Inherited from UIElement.)
Public method | AddToEventRoute | Adds handlers to the specified EventRoute for the current UIElement event handler collection. (Inherited from UIElement.)
Public method | ApplyAnimationClock(DependencyProperty, AnimationClock) | Applies an animation to a specified dependency property on this element. Any existing animations are stopped and replaced with the new animation. (Inherited from UIElement.)
Public method | ApplyAnimationClock(DependencyProperty, AnimationClock, HandoffBehavior) | Applies an animation to a specified dependency property on this element, with the ability to specify what happens if the property already has a running animation. (Inherited from UIElement.)
Public method | ApplyTemplate | Builds the current template's visual tree if necessary, and returns a value that indicates whether the visual tree was rebuilt by this call. (Inherited from FrameworkElement.)
Public method | Arrange | Positions child elements and determines a size for a UIElement. Parent elements call this method from their ArrangeCore(Rect) implementation (or a WPF framework-level equivalent) to form a recursive layout update. This method constitutes the second pass of a layout update. (Inherited from UIElement.)
Public method | BeginAnimation(DependencyProperty, AnimationTimeline) | Starts an animation for a specified animated property on this element. (Inherited from UIElement.)
Public method | BeginAnimation(DependencyProperty, AnimationTimeline, HandoffBehavior) | Starts a specific animation for a specified animated property on this element, with the option of specifying what happens if the property already has a running animation. (Inherited from UIElement.)
Public method | BeginInit | Starts the initialization process for this element. (Inherited from FrameworkElement.)
Public method | BeginStoryboard(Storyboard) | Begins the sequence of actions that are contained in the provided storyboard. (Inherited from FrameworkElement.)
Public method | BeginStoryboard(Storyboard, HandoffBehavior) | Begins the sequence of actions contained in the provided storyboard, with options specified for what should happen if the property is already animated. (Inherited from FrameworkElement.)
Public method | BeginStoryboard(Storyboard, HandoffBehavior, Boolean) | Begins the sequence of actions contained in the provided storyboard, with specified state for control of the animation after it is started. (Inherited from FrameworkElement.)
Public method | BringIntoView | Attempts to bring this element into view, within any scrollable regions it is contained within. (Inherited from FrameworkElement.)
Public method | BringIntoView(Rect) | Attempts to bring the provided region size of this element into view, within any scrollable regions it is contained within. (Inherited from FrameworkElement.)
Public method | CaptureMouse | Attempts to force capture of the mouse to this element. (Inherited from UIElement.)
Public method | CaptureStylus | Attempts to force capture of the stylus to this element. (Inherited from UIElement.)
Public method | CaptureTouch | Attempts to force capture of a touch to this element. (Inherited from UIElement.)
Public method | CheckAccess | Determines whether the calling thread has access to this DispatcherObject. (Inherited from DispatcherObject.)
Public method | ClearValue(DependencyProperty) | Clears the local value of a property. The property to be cleared is specified by a DependencyProperty identifier. (Inherited from DependencyObject.)
Public method | ClearValue(DependencyPropertyKey) | Clears the local value of a read-only property. The property to be cleared is specified by a DependencyPropertyKey. (Inherited from DependencyObject.)
Public method | Close | Manually closes a Window. (Inherited from Window.)
Public method | CloseWindow | Method to finally close the window, this method should be called when your main application closes else the window will remain in process
Public method | CoerceValue | Coerces the value of the specified dependency property. This is accomplished by invoking any CoerceValueCallback function specified in property metadata for the dependency property as it exists on the calling DependencyObject. (Inherited from DependencyObject.)
Public method | DragMove | Allows a window to be dragged by a mouse with its left button down over an exposed area of the window's client area. (Inherited from Window.)
Public method | EndInit | Indicates that the initialization process for the element is complete. (Inherited from FrameworkElement.)
Public method | Equals | Determines whether a provided DependencyObject is equivalent to the current DependencyObject. (Inherited from DependencyObject.)
Public method | FindCommonVisualAncestor | Returns the common ancestor of two visual objects. (Inherited from Visual.)
Public method | FindName | Finds an element that has the provided identifier name. (Inherited from FrameworkElement.)
Public method | FindResource | Searches for a resource with the specified key, and throws an exception if the requested resource is not found. (Inherited from FrameworkElement.)
Public method | Focus | Attempts to set focus to this element. (Inherited from UIElement.)
Public method | GetAnimationBaseValue | Returns the base property value for the specified property on this element, disregarding any possible animated value from a running or stopped animation. (Inherited from UIElement.)
Public method | GetBindingExpression | Returns the BindingExpression that represents the binding on the specified property. (Inherited from FrameworkElement.)
Public method | GetHashCode | Gets a hash code for this DependencyObject. (Inherited from DependencyObject.)
Public method | GetLocalValueEnumerator | Creates a specialized enumerator for determining which dependency properties have locally set values on this DependencyObject. (Inherited from DependencyObject.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | GetValue | Returns the current effective value of a dependency property on this instance of a DependencyObject. (Inherited from DependencyObject.)
Public method | Hide | Makes a window invisible. (Inherited from Window.)
Public method | InitializeComponent | InitializeComponent
Public method | InputHitTest | Returns the input element within the current element that is at the specified coordinates, relative to the current element's origin. (Inherited from UIElement.)
Public method | InvalidateArrange | Invalidates the arrange state (layout) for the element. After the invalidation, the element will have its layout updated, which will occur asynchronously unless subsequently forced by UpdateLayout. (Inherited from UIElement.)
Public method | InvalidateMeasure | Invalidates the measurement state (layout) for the element. (Inherited from UIElement.)
Public method | InvalidateProperty | Re-evaluates the effective value for the specified dependency property (Inherited from DependencyObject.)
Public method | InvalidateVisual | Invalidates the rendering of the element, and forces a complete new layout pass. OnRender(DrawingContext) is called after the layout cycle is completed. (Inherited from UIElement.)
Public method | IsAncestorOf | Determines whether the visual object is an ancestor of the descendant visual object. (Inherited from Visual.)
Public method | IsDescendantOf | Determines whether the visual object is a descendant of the ancestor visual object. (Inherited from Visual.)
Public method | Measure | Updates the DesiredSize of a UIElement. Parent elements call this method from their own MeasureCore(Size) implementations to form a recursive layout update. Calling this method constitutes the first pass (the "Measure" pass) of a layout update. (Inherited from UIElement.)
Public method | MoveFocus | Moves the keyboard focus away from this element and to another element in a provided traversal direction. (Inherited from FrameworkElement.)
Public method | OnApplyTemplate | When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate. (Inherited from FrameworkElement.)
Public method | PointFromScreen | Converts a Point in screen coordinates into a Point that represents the current coordinate system of the Visual. (Inherited from Visual.)
Public method | PointToScreen | Converts a Point that represents the current coordinate system of the Visual into a Point in screen coordinates. (Inherited from Visual.)
Public method | PredictFocus | Determines the next element that would receive focus relative to this element for a provided focus movement direction, but does not actually move the focus. (Inherited from FrameworkElement.)
Public method | RaiseEvent | Raises a specific routed event. The RoutedEvent to be raised is identified within the RoutedEventArgs instance that is provided (as the RoutedEvent property of that event data). (Inherited from UIElement.)
Public method | ReadLocalValue | Returns the local value of a dependency property, if it exists. (Inherited from DependencyObject.)
Public method | RegisterName | Provides an accessor that simplifies access to the NameScope registration method. (Inherited from FrameworkElement.)
Public method | ReleaseAllTouchCaptures | Releases all captured touch devices from this element. (Inherited from UIElement.)
Public method | ReleaseMouseCapture | Releases the mouse capture, if this element held the capture. (Inherited from UIElement.)
Public method | ReleaseStylusCapture | Releases the stylus device capture, if this element held the capture. (Inherited from UIElement.)
Public method | ReleaseTouchCapture | Attempts to release the specified touch device from this element. (Inherited from UIElement.)
Public method | RemoveHandler | Removes the specified routed event handler from this element. (Inherited from UIElement.)
Public method | SetBinding(DependencyProperty, BindingBase) | Attaches a binding to this element, based on the provided binding object. (Inherited from FrameworkElement.)
Public method | SetBinding(DependencyProperty, String) | Attaches a binding to this element, based on the provided source property name as a path qualification to the data source. (Inherited from FrameworkElement.)
Public method | SetCurrentValue | Sets the value of a dependency property without changing its value source. (Inherited from DependencyObject.)
Public method | SetResourceReference | Searches for a resource with the specified name and sets up a resource reference to it for the specified property. (Inherited from FrameworkElement.)
Public method | SetValue(DependencyProperty, Object) | Sets the local value of a dependency property, specified by its dependency property identifier. (Inherited from DependencyObject.)
Public method | SetValue(DependencyPropertyKey, Object) | Sets the local value of a read-only dependency property, specified by the DependencyPropertyKey identifier of the dependency property. (Inherited from DependencyObject.)
Public method | ShouldSerializeCommandBindings | Returns whether serialization processes should serialize the contents of the CommandBindings property on instances of this class. (Inherited from UIElement.)
Public method | ShouldSerializeContent | Indicates whether the Content property should be persisted. (Inherited from ContentControl.)
Public method | ShouldSerializeInputBindings | Returns whether serialization processes should serialize the contents of the InputBindings property on instances of this class. (Inherited from UIElement.)
Public method | ShouldSerializeResources | Returns whether serialization processes should serialize the contents of the Resources property. (Inherited from FrameworkElement.)
Public method | ShouldSerializeStyle | Returns whether serialization processes should serialize the contents of the Style property. (Inherited from FrameworkElement.)
Public method | ShouldSerializeTriggers | Returns whether serialization processes should serialize the contents of the Triggers property. (Inherited from FrameworkElement.)
Public method | Show | Opens a window and returns without waiting for the newly opened window to close. (Inherited from Window.)
Public method | ShowDialog | Opens a window and returns only when the newly opened window is closed. (Inherited from Window.)
Public method | ToString | Gets the object as a string (Overrides ControlToString.)
Public method | TransformToAncestor(Visual) | Returns a transform that can be used to transform coordinates from the Visual to the specified Visual ancestor of the visual object. (Inherited from Visual.)
Public method | TransformToAncestor(Visual3D) | Returns a transform that can be used to transform coordinates from the Visual to the specified Visual3D ancestor of the visual object. (Inherited from Visual.)
Public method | TransformToDescendant | Returns a transform that can be used to transform coordinates from the Visual to the specified visual object descendant. (Inherited from Visual.)
Public method | TransformToVisual | Returns a transform that can be used to transform coordinates from the Visual to the specified visual object. (Inherited from Visual.)
Public method | TranslatePoint | Translates a point relative to this element to coordinates that are relative to the specified element. (Inherited from UIElement.)
Public method | TryFindResource | Searches for a resource with the specified key, and returns that resource if found. (Inherited from FrameworkElement.)
Public method | UnregisterName | Simplifies access to the NameScope de-registration method. (Inherited from FrameworkElement.)
Public method | UpdateLayout | Ensures that all visual child elements of this element are properly updated for layout. (Inherited from UIElement.)
Public method | VerifyAccess | Enforces that the calling thread has access to this DispatcherObject. (Inherited from DispatcherObject.)
Top
Properties
 | Name | Description
Public property | ActualHeight | Gets the rendered height of this element. (Inherited from FrameworkElement.)
Public property | ActualWidth | Gets the rendered width of this element. (Inherited from FrameworkElement.)
Public property | AllowDrop | Gets or sets a value indicating whether this element can be used as the target of a drag-and-drop operation. This is a dependency property. (Inherited from UIElement.)
Public property | AllowsTransparency | Gets or sets a value that indicates whether a window's client area supports transparency. (Inherited from Window.)
Public property | AreAnyTouchesCaptured | Gets a value that indicates whether at least one touch is captured to this element. (Inherited from UIElement.)
Public property | AreAnyTouchesCapturedWithin | Gets a value that indicates whether at least one touch is captured to this element or to any child elements in its visual tree. (Inherited from UIElement.)
Public property | AreAnyTouchesDirectlyOver | Gets a value that indicates whether at least one touch is pressed over this element. (Inherited from UIElement.)
Public property | AreAnyTouchesOver | Gets a value that indicates whether at least one touch is pressed over this element or any child elements in its visual tree. (Inherited from UIElement.)
Public property | AverageCpu | Gets the latest average CPU reading
Public property | Background | Gets or sets a brush that describes the background of a control. (Inherited from Control.)
Public property | BindingGroup | Gets or sets the BindingGroup that is used for the element. (Inherited from FrameworkElement.)
Public property | BitmapEffect | Obsolete. Gets or sets a bitmap effect that applies directly to the rendered content for this element. This is a dependency property. (Inherited from UIElement.)
Public property | BitmapEffectInput | Obsolete. Gets or sets an input source for the bitmap effect that applies directly to the rendered content for this element. This is a dependency property. (Inherited from UIElement.)
Public property | BorderBrush | Gets or sets a brush that describes the border background of a control. (Inherited from Control.)
Public property | BorderThickness | Gets or sets the border thickness of a control. (Inherited from Control.)
Public property | CacheMode | Gets or sets a cached representation of the UIElement. (Inherited from UIElement.)
Public property | Clip | Gets or sets the geometry used to define the outline of the contents of an element. This is a dependency property. (Inherited from UIElement.)
Public property | ClipToBounds | Gets or sets a value indicating whether to clip the content of this element (or content coming from the child elements of this element) to fit into the size of the containing element. This is a dependency property. (Inherited from UIElement.)
Public property | CommandBindings | Gets a collection of CommandBinding objects associated with this element. A CommandBinding enables command handling for this element, and declares the linkage between a command, its events, and the handlers attached by this element. (Inherited from UIElement.)
Public property | Content | Gets or sets the content of a ContentControl. (Inherited from ContentControl.)
Public property | ContentStringFormat | Gets or sets a composite string that specifies how to format the Content property if it is displayed as a string. (Inherited from ContentControl.)
Public property | ContentTemplate | Gets or sets the data template used to display the content of the ContentControl. (Inherited from ContentControl.)
Public property | ContentTemplateSelector | Gets or sets a template selector that enables an application writer to provide custom template-selection logic. (Inherited from ContentControl.)
Public property | ContextMenu | Gets or sets the context menu element that should appear whenever the context menu is requested through user interface (UI) from within this element. (Inherited from FrameworkElement.)
Public property | Cursor | Gets or sets the cursor that displays when the mouse pointer is over this element. (Inherited from FrameworkElement.)
Public property | DataContext | Gets or sets the data context for an element when it participates in data binding. (Inherited from FrameworkElement.)
Public property | DependencyObjectType | Gets the DependencyObjectType that wraps the CLR type of this instance. (Inherited from DependencyObject.)
Public property | DesiredSize | Gets the size that this element computed during the measure pass of the layout process. (Inherited from UIElement.)
Public property | DialogResult | Gets or sets the dialog result value, which is the value that is returned from the ShowDialog method. (Inherited from Window.)
Public property | Dispatcher | Gets the Dispatcher this DispatcherObject is associated with. (Inherited from DispatcherObject.)
Public property | Effect | Gets or sets the bitmap effect to apply to the UIElement. This is a dependency property. (Inherited from UIElement.)
Public property | FlowDirection | Gets or sets the direction that text and other user interface (UI) elements flow within any parent element that controls their layout. (Inherited from FrameworkElement.)
Public property | Focusable | Gets or sets a value that indicates whether the element can receive focus. This is a dependency property. (Inherited from UIElement.)
Public property | FocusVisualStyle | Gets or sets a property that enables customization of appearance, effects, or other style characteristics that will apply to this element when it captures keyboard focus. (Inherited from FrameworkElement.)
Public property | FontFamily | Gets or sets the font family of the control. (Inherited from Control.)
Public property | FontSize | Gets or sets the font size. (Inherited from Control.)
Public property | FontStretch | Gets or sets the degree to which a font is condensed or expanded on the screen. (Inherited from Control.)
Public property | FontStyle | Gets or sets the font style. (Inherited from Control.)
Public property | FontWeight | Gets or sets the weight or thickness of the specified font. (Inherited from Control.)
Public property | ForceCursor | Gets or sets a value that indicates whether this FrameworkElement should force the user interface (UI) to render the cursor as declared by the Cursor property. (Inherited from FrameworkElement.)
Public property | Foreground | Gets or sets a brush that describes the foreground color. (Inherited from Control.)
Public property | HasAnimatedProperties | Gets a value indicating whether this element has any animated properties. (Inherited from UIElement.)
Public property | HasContent | Gets a value that indicates whether the ContentControl contains content. (Inherited from ContentControl.)
Public property | Height | Gets or sets the suggested height of the element. (Inherited from FrameworkElement.)
Public property | HorizontalAlignment | Gets or sets the horizontal alignment characteristics applied to this element when it is composed within a parent element, such as a panel or items control. (Inherited from FrameworkElement.)
Public property | HorizontalContentAlignment | Gets or sets the horizontal alignment of the control's content. (Inherited from Control.)
Public property | Icon | Gets or sets a window's icon. (Inherited from Window.)
Public property | InputBindings | Gets the collection of input bindings associated with this element. (Inherited from UIElement.)
Public property | InputScope | Gets or sets the context for input used by this FrameworkElement. (Inherited from FrameworkElement.)
Public property | IsActive | Gets a value that indicates whether the window is active. (Inherited from Window.)
Public property | IsArrangeValid | Gets a value indicating whether the computed size and position of child elements in this element's layout are valid. (Inherited from UIElement.)
Public property | IsEnabled | Gets or sets a value indicating whether this element is enabled in the user interface (UI). This is a dependency property. (Inherited from UIElement.)
Public property | IsFocused | Gets a value that determines whether this element has logical focus. This is a dependency property. (Inherited from UIElement.)
Public property | IsHitTestVisible | Gets or sets a value that declares whether this element can possibly be returned as a hit test result from some portion of its rendered content. This is a dependency property. (Inherited from UIElement.)
Public property | IsInitialized | Gets a value that indicates whether this element has been initialized, either during processing by a XAML processor, or by explicitly having its EndInit method called. (Inherited from FrameworkElement.)
Public property | IsInputMethodEnabled | Gets a value indicating whether an input method system, such as an Input Method Editor (IME), is enabled for processing the input to this element. (Inherited from UIElement.)
Public property | IsKeyboardFocused | Gets a value indicating whether this element has keyboard focus. This is a dependency property. (Inherited from UIElement.)
Public property | IsKeyboardFocusWithin | Gets a value indicating whether keyboard focus is anywhere within the element or its visual tree child elements. This is a dependency property. (Inherited from UIElement.)
Public property | IsLoaded | Gets a value that indicates whether this element has been loaded for presentation. (Inherited from FrameworkElement.)
Public property | IsManipulationEnabled | Gets or sets a value that indicates whether manipulation events are enabled on this UIElement. (Inherited from UIElement.)
Public property | IsMeasureValid | Gets a value indicating whether the current size returned by layout measure is valid. (Inherited from UIElement.)
Public property | IsMouseCaptured | Gets a value indicating whether the mouse is captured to this element. This is a dependency property. (Inherited from UIElement.)
Public property | IsMouseCaptureWithin | Gets a value that determines whether mouse capture is held by this element or by child elements in its visual tree. This is a dependency property. (Inherited from UIElement.)
Public property | IsMouseDirectlyOver | Gets a value that indicates whether the position of the mouse pointer corresponds to hit test results, which take element compositing into account. This is a dependency property. (Inherited from UIElement.)
Public property | IsMouseOver | Gets a value indicating whether the mouse pointer is located over this element (including child elements in the visual tree). This is a dependency property. (Inherited from UIElement.)
Public property | IsSealed | Gets a value that indicates whether this instance is currently sealed (read-only). (Inherited from DependencyObject.)
Public property | IsStylusCaptured | Gets a value indicating whether the stylus is captured by this element. This is a dependency property. (Inherited from UIElement.)
Public property | IsStylusCaptureWithin | Gets a value that determines whether stylus capture is held by this element, or an element within the element bounds and its visual tree. This is a dependency property. (Inherited from UIElement.)
Public property | IsStylusDirectlyOver | Gets a value that indicates whether the stylus position corresponds to hit test results, which take element compositing into account. This is a dependency property. (Inherited from UIElement.)
Public property | IsStylusOver | Gets a value indicating whether the stylus cursor is located over this element (including visual child elements). This is a dependency property. (Inherited from UIElement.)
Public property | IsTabStop | Gets or sets a value that indicates whether a control is included in tab navigation. (Inherited from Control.)
Public property | IsVisible | Gets a value indicating whether this element is visible in the user interface (UI). This is a dependency property. (Inherited from UIElement.)
Public property | Language | Gets or sets localization/globalization language information that applies to an element. (Inherited from FrameworkElement.)
Public property | LayoutTransform | Gets or sets a graphics transformation that should apply to this element when layout is performed. (Inherited from FrameworkElement.)
Public property | Left | Gets or sets the position of the window's left edge, in relation to the desktop. (Inherited from Window.)
Public property | Margin | Gets or sets the outer margin of an element. (Inherited from FrameworkElement.)
Public property | MaxHeight | Gets or sets the maximum height constraint of the element. (Inherited from FrameworkElement.)
Public property | MaxWidth | Gets or sets the maximum width constraint of the element. (Inherited from FrameworkElement.)
Public property | MinHeight | Gets or sets the minimum height constraint of the element. (Inherited from FrameworkElement.)
Public property | MinWidth | Gets or sets the minimum width constraint of the element. (Inherited from FrameworkElement.)
Public property | Name | Gets or sets the identifying name of the element. The name provides a reference so that code-behind, such as event handler code, can refer to a markup element after it is constructed during processing by a XAML processor. (Inherited from FrameworkElement.)
Public property | Opacity | Gets or sets the opacity factor applied to the entire UIElement when it is rendered in the user interface (UI). This is a dependency property. (Inherited from UIElement.)
Public property | OpacityMask | Gets or sets an opacity mask, as a Brush implementation that is applied to any alpha-channel masking for the rendered content of this element. This is a dependency property. (Inherited from UIElement.)
Public property | OverridesDefaultStyle | Gets or sets a value that indicates whether this element incorporates style properties from theme styles. (Inherited from FrameworkElement.)
Public property | OwnedWindows | Gets a collection of windows for which this window is the owner. (Inherited from Window.)
Public property | Owner | Gets or sets the Window that owns this Window. (Inherited from Window.)
Public property | Padding | Gets or sets the padding inside a control. (Inherited from Control.)
Public property | Parent | Gets the logical parent element of this element. (Inherited from FrameworkElement.)
Public property | PeakCpu | Gets the latest peak CPU reading
Public property | PersistId | Obsolete. Gets a value that uniquely identifies this element. (Inherited from UIElement.)
Public property | RenderSize | Gets (or sets, but see Remarks) the final render size of this element. (Inherited from UIElement.)
Public property | RenderTransform | Gets or sets transform information that affects the rendering position of this element. This is a dependency property. (Inherited from UIElement.)
Public property | RenderTransformOrigin | Gets or sets the center point of any possible render transform declared by RenderTransform, relative to the bounds of the element. This is a dependency property. (Inherited from UIElement.)
Public property | ResizeMode | Gets or sets the resize mode. (Inherited from Window.)
Public property | Resources | Gets or sets the locally-defined resource dictionary. (Inherited from FrameworkElement.)
Public property | RestoreBounds | Gets the size and location of a window before being either minimized or maximized. (Inherited from Window.)
Public property | ShowActivated | Gets or sets a value that indicates whether a window is activated when first shown. (Inherited from Window.)
Public property | ShowInTaskbar | Gets or sets a value that indicates whether the window has a task bar button. (Inherited from Window.)
Public property | SizeToContent | Gets or sets a value that indicates whether a window will automatically size itself to fit the size of its content. (Inherited from Window.)
Public property | SnapsToDevicePixels | Gets or sets a value that determines whether rendering for this element should use device-specific pixel settings during rendering. This is a dependency property. (Inherited from UIElement.)
Public property | Style | Gets or sets the style used by this element when it is rendered. (Inherited from FrameworkElement.)
Public property | TabIndex | Gets or sets a value that determines the order in which elements receive focus when the user navigates through controls by using the TAB key. (Inherited from Control.)
Public property | Tag | Gets or sets an arbitrary object value that can be used to store custom information about this element. (Inherited from FrameworkElement.)
Public property | TaskbarItemInfo | Gets or sets the Windows 7 taskbar thumbnail for the Window. (Inherited from Window.)
Public property | Template | Gets or sets a control template. (Inherited from Control.)
Public property | TemplatedParent | Gets a reference to the template parent of this element. This property is not relevant if the element was not created through a template. (Inherited from FrameworkElement.)
Public property | Title | Gets or sets a window's title. (Inherited from Window.)
Public property | ToolTip | Gets or sets the tool-tip object that is displayed for this element in the user interface (UI). (Inherited from FrameworkElement.)
Public property | Top | Gets or sets the position of the window's top edge, in relation to the desktop. (Inherited from Window.)
Public property | Topmost | Gets or sets a value that indicates whether a window appears in the topmost z-order. (Inherited from Window.)
Public property | TouchesCaptured | Gets all touch devices that are captured to this element. (Inherited from UIElement.)
Public property | TouchesCapturedWithin | Gets all touch devices that are captured to this element or any child elements in its visual tree. (Inherited from UIElement.)
Public property | TouchesDirectlyOver | Gets all touch devices that are over this element. (Inherited from UIElement.)
Public property | TouchesOver | Gets all touch devices that are over this element or any child elements in its visual tree. (Inherited from UIElement.)
Public property | Triggers | Gets the collection of triggers established directly on this element, or in child elements. (Inherited from FrameworkElement.)
Public property | Uid | Gets or sets the unique identifier (for localization) for this element. This is a dependency property. (Inherited from UIElement.)
Public property | UseLayoutRounding | Gets or sets a value that indicates whether layout rounding should be applied to this element's size and position during layout. (Inherited from FrameworkElement.)
Public property | VerticalAlignment | Gets or sets the vertical alignment characteristics applied to this element when it is composed within a parent element such as a panel or items control. (Inherited from FrameworkElement.)
Public property | VerticalContentAlignment | Gets or sets the vertical alignment of the control's content. (Inherited from Control.)
Public property | Visibility | Gets or sets the user interface (UI) visibility of this element. This is a dependency property. (Inherited from UIElement.)
Public property | Width | Gets or sets the width of the element. (Inherited from FrameworkElement.)
Public property | WindowStartupLocation | Gets or sets the position of the window when first shown. (Inherited from Window.)
Public property | WindowState | Gets or sets a value that indicates whether a window is restored, minimized, or maximized. (Inherited from Window.)
Public property | WindowStyle | Gets or sets a window's border style. (Inherited from Window.)
Top
Events
 | Name | Description
Public event | Activated | Occurs when a window becomes the foreground window. (Inherited from Window.)
Public event | Closed | Occurs when the window is about to close. (Inherited from Window.)
Public event | Closing | Occurs directly after Close is called, and can be handled to cancel window closure. (Inherited from Window.)
Public event | ContentRendered | Occurs after a window's content has been rendered. (Inherited from Window.)
Public event | ContextMenuClosing | Occurs just before any context menu on the element is closed. (Inherited from FrameworkElement.)
Public event | ContextMenuOpening | Occurs when any context menu on the element is opened. (Inherited from FrameworkElement.)
Public event | DataContextChanged | Occurs when the data context for this element changes. (Inherited from FrameworkElement.)
Public event | Deactivated | Occurs when a window becomes a background window. (Inherited from Window.)
Public event | DragEnter | Occurs when the input system reports an underlying drag event with this element as the drag target. (Inherited from UIElement.)
Public event | DragLeave | Occurs when the input system reports an underlying drag event with this element as the drag origin. (Inherited from UIElement.)
Public event | DragOver | Occurs when the input system reports an underlying drag event with this element as the potential drop target. (Inherited from UIElement.)
Public event | Drop | Occurs when the input system reports an underlying drop event with this element as the drop target. (Inherited from UIElement.)
Public event | FocusableChanged | Occurs when the value of the Focusable property changes. (Inherited from UIElement.)
Public event | GiveFeedback | Occurs when the input system reports an underlying drag-and-drop event that involves this element. (Inherited from UIElement.)
Public event | GotFocus | Occurs when this element gets logical focus. (Inherited from UIElement.)
Public event | GotKeyboardFocus | Occurs when the keyboard is focused on this element. (Inherited from UIElement.)
Public event | GotMouseCapture | Occurs when this element captures the mouse. (Inherited from UIElement.)
Public event | GotStylusCapture | Occurs when this element captures the stylus. (Inherited from UIElement.)
Public event | GotTouchCapture | Occurs when a touch is captured to this element. (Inherited from UIElement.)
Public event | Initialized | Occurs when this FrameworkElement is initialized. This event coincides with cases where the value of the IsInitialized property changes from false (or undefined) to true. (Inherited from FrameworkElement.)
Public event | IsEnabledChanged | Occurs when the value of the IsEnabled property on this element changes. (Inherited from UIElement.)
Public event | IsHitTestVisibleChanged | Occurs when the value of the IsHitTestVisible dependency property changes on this element. (Inherited from UIElement.)
Public event | IsKeyboardFocusedChanged | Occurs when the value of the IsKeyboardFocused property changes on this element. (Inherited from UIElement.)
Public event | IsKeyboardFocusWithinChanged | Occurs when the value of the IsKeyboardFocusWithinChanged property changes on this element. (Inherited from UIElement.)
Public event | IsMouseCapturedChanged | Occurs when the value of the IsMouseCaptured property changes on this element. (Inherited from UIElement.)
Public event | IsMouseCaptureWithinChanged | Occurs when the value of the IsMouseCaptureWithinProperty changes on this element. (Inherited from UIElement.)
Public event | IsMouseDirectlyOverChanged | Occurs when the value of the IsMouseDirectlyOver property changes on this element. (Inherited from UIElement.)
Public event | IsStylusCapturedChanged | Occurs when the value of the IsStylusCaptured property changes on this element. (Inherited from UIElement.)
Public event | IsStylusCaptureWithinChanged | Occurs when the value of the IsStylusCaptureWithin property changes on this element. (Inherited from UIElement.)
Public event | IsStylusDirectlyOverChanged | Occurs when the value of the IsStylusDirectlyOver property changes on this element. (Inherited from UIElement.)
Public event | IsVisibleChanged | Occurs when the value of the IsVisible property changes on this element. (Inherited from UIElement.)
Public event | KeyDown | Occurs when a key is pressed while focus is on this element. (Inherited from UIElement.)
Public event | KeyUp | Occurs when a key is released while focus is on this element. (Inherited from UIElement.)
Public event | LayoutUpdated | Occurs when the layout of the various visual elements associated with the current Dispatcher changes. (Inherited from UIElement.)
Public event | Loaded | Occurs when the element is laid out, rendered, and ready for interaction. (Inherited from FrameworkElement.)
Public event | LocationChanged | Occurs when the window's location changes. (Inherited from Window.)
Public event | LostFocus | Occurs when this element loses logical focus. (Inherited from UIElement.)
Public event | LostKeyboardFocus | Occurs when the keyboard is no longer focused on this element,. (Inherited from UIElement.)
Public event | LostMouseCapture | Occurs when this element loses mouse capture. (Inherited from UIElement.)
Public event | LostStylusCapture | Occurs when this element loses stylus capture. (Inherited from UIElement.)
Public event | LostTouchCapture | Occurs when this element loses a touch capture. (Inherited from UIElement.)
Public event | ManipulationBoundaryFeedback | Occurs when the manipulation encounters a boundary. (Inherited from UIElement.)
Public event | ManipulationCompleted | Occurs when a manipulation and inertia on the UIElement object is complete. (Inherited from UIElement.)
Public event | ManipulationDelta | Occurs when the input device changes position during a manipulation. (Inherited from UIElement.)
Public event | ManipulationInertiaStarting | Occurs when the input device loses contact with the UIElement object during a manipulation and inertia begins. (Inherited from UIElement.)
Public event | ManipulationStarted | Occurs when an input device begins a manipulation on the UIElement object. (Inherited from UIElement.)
Public event | ManipulationStarting | Occurs when the manipulation processor is first created. (Inherited from UIElement.)
Public event | MouseDoubleClick | Occurs when a mouse button is clicked two or more times. (Inherited from Control.)
Public event | MouseDown | Occurs when any mouse button is pressed while the pointer is over this element. (Inherited from UIElement.)
Public event | MouseEnter | Occurs when the mouse pointer enters the bounds of this element. (Inherited from UIElement.)
Public event | MouseLeave | Occurs when the mouse pointer leaves the bounds of this element. (Inherited from UIElement.)
Public event | MouseLeftButtonDown | Occurs when the left mouse button is pressed while the mouse pointer is over this element. (Inherited from UIElement.)
Public event | MouseLeftButtonUp | Occurs when the left mouse button is released while the mouse pointer is over this element. (Inherited from UIElement.)
Public event | MouseMove | Occurs when the mouse pointer moves while over this element. (Inherited from UIElement.)
Public event | MouseRightButtonDown | Occurs when the right mouse button is pressed while the mouse pointer is over this element. (Inherited from UIElement.)
Public event | MouseRightButtonUp | Occurs when the right mouse button is released while the mouse pointer is over this element. (Inherited from UIElement.)
Public event | MouseUp | Occurs when any mouse button is released over this element. (Inherited from UIElement.)
Public event | MouseWheel | Occurs when the user rotates the mouse wheel while the mouse pointer is over this element. (Inherited from UIElement.)
Public event | OnCPUPeak | Fires when the CPU time goes to a new peak.
Public event | OnDelayChange | Fires when the CPU delay is changed via the slider control on the UI.
Public event | PreviewDragEnter | Occurs when the input system reports an underlying drag event with this element as the drag target. (Inherited from UIElement.)
Public event | PreviewDragLeave | Occurs when the input system reports an underlying drag event with this element as the drag origin. (Inherited from UIElement.)
Public event | PreviewDragOver | Occurs when the input system reports an underlying drag event with this element as the potential drop target. (Inherited from UIElement.)
Public event | PreviewDrop | Occurs when the input system reports an underlying drop event with this element as the drop target. (Inherited from UIElement.)
Public event | PreviewGiveFeedback | Occurs when a drag-and-drop operation is started. (Inherited from UIElement.)
Public event | PreviewGotKeyboardFocus | Occurs when the keyboard is focused on this element. (Inherited from UIElement.)
Public event | PreviewKeyDown | Occurs when a key is pressed while focus is on this element. (Inherited from UIElement.)
Public event | PreviewKeyUp | Occurs when a key is released while focus is on this element. (Inherited from UIElement.)
Public event | PreviewLostKeyboardFocus | Occurs when the keyboard is no longer focused on this element. (Inherited from UIElement.)
Public event | PreviewMouseDoubleClick | Occurs when a user clicks the mouse button two or more times. (Inherited from Control.)
Public event | PreviewMouseDown | Occurs when any mouse button is pressed while the pointer is over this element. (Inherited from UIElement.)
Public event | PreviewMouseLeftButtonDown | Occurs when the left mouse button is pressed while the mouse pointer is over this element. (Inherited from UIElement.)
Public event | PreviewMouseLeftButtonUp | Occurs when the left mouse button is released while the mouse pointer is over this element. (Inherited from UIElement.)
Public event | PreviewMouseMove | Occurs when the mouse pointer moves while the mouse pointer is over this element. (Inherited from UIElement.)
Public event | PreviewMouseRightButtonDown | Occurs when the right mouse button is pressed while the mouse pointer is over this element. (Inherited from UIElement.)
Public event | PreviewMouseRightButtonUp | Occurs when the right mouse button is released while the mouse pointer is over this element. (Inherited from UIElement.)
Public event | PreviewMouseUp | Occurs when any mouse button is released while the mouse pointer is over this element. (Inherited from UIElement.)
Public event | PreviewMouseWheel | Occurs when the user rotates the mouse wheel while the mouse pointer is over this element. (Inherited from UIElement.)
Public event | PreviewQueryContinueDrag | Occurs when there is a change in the keyboard or mouse button state during a drag-and-drop operation. (Inherited from UIElement.)
Public event | PreviewStylusButtonDown | Occurs when the stylus button is pressed while the pointer is over this element. (Inherited from UIElement.)
Public event | PreviewStylusButtonUp | Occurs when the stylus button is released while the pointer is over this element. (Inherited from UIElement.)
Public event | PreviewStylusDown | Occurs when the stylus touches the digitizer while it is over this element. (Inherited from UIElement.)
Public event | PreviewStylusInAirMove | Occurs when the stylus moves over an element without actually touching the digitizer. (Inherited from UIElement.)
Public event | PreviewStylusInRange | Occurs when the stylus is close enough to the digitizer to be detected, while over this element. (Inherited from UIElement.)
Public event | PreviewStylusMove | Occurs when the stylus moves while over the element. The stylus must move while being detected by the digitizer to raise this event, otherwise, PreviewStylusInAirMove is raised instead. (Inherited from UIElement.)
Public event | PreviewStylusOutOfRange | Occurs when the stylus is too far from the digitizer to be detected. (Inherited from UIElement.)
Public event | PreviewStylusSystemGesture | Occurs when a user performs one of several stylus gestures. (Inherited from UIElement.)
Public event | PreviewStylusUp | Occurs when the user raises the stylus off the digitizer while the stylus is over this element. (Inherited from UIElement.)
Public event | PreviewTextInput | Occurs when this element gets text in a device-independent manner. (Inherited from UIElement.)
Public event | PreviewTouchDown | Occurs when a finger touches the screen while the finger is over this element. (Inherited from UIElement.)
Public event | PreviewTouchMove | Occurs when a finger moves on the screen while the finger is over this element. (Inherited from UIElement.)
Public event | PreviewTouchUp | Occurs when a finger is raised off of the screen while the finger is over this element. (Inherited from UIElement.)
Public event | QueryContinueDrag | Occurs when there is a change in the keyboard or mouse button state during a drag-and-drop operation. (Inherited from UIElement.)
Public event | QueryCursor | Occurs when the cursor is requested to display. This event is raised on an element each time that the mouse pointer moves to a new location, which means the cursor object might need to be changed based on its new position. (Inherited from UIElement.)
Public event | RequestBringIntoView | Occurs when BringIntoView(Rect) is called on this element. (Inherited from FrameworkElement.)
Public event | SizeChanged | Occurs when either the ActualHeight or the ActualWidth properties change value on this element. (Inherited from FrameworkElement.)
Public event | SourceInitialized | This event is raised to support interoperation with Win32. See HwndSource. (Inherited from Window.)
Public event | SourceUpdated | Occurs when the source value changes for any existing property binding on this element. (Inherited from FrameworkElement.)
Public event | StateChanged | Occurs when the window's WindowState property changes. (Inherited from Window.)
Public event | StylusButtonDown | Occurs when the stylus button is pressed while the pointer is over this element. (Inherited from UIElement.)
Public event | StylusButtonUp | Occurs when the stylus button is released while the pointer is over this element. (Inherited from UIElement.)
Public event | StylusDown | Occurs when the stylus touches the digitizer while the stylus is over this element. (Inherited from UIElement.)
Public event | StylusEnter | Occurs when the stylus enters the bounds of this element. (Inherited from UIElement.)
Public event | StylusInAirMove | Occurs when the stylus moves over an element without actually touching the digitizer. (Inherited from UIElement.)
Public event | StylusInRange | Occurs when the stylus is close enough to the digitizer to be detected, while over this element. (Inherited from UIElement.)
Public event | StylusLeave | Occurs when the stylus leaves the bounds of the element. (Inherited from UIElement.)
Public event | StylusMove | Occurs when the stylus moves over this element. The stylus must move while on the digitizer to raise this event. Otherwise, StylusInAirMove is raised instead. (Inherited from UIElement.)
Public event | StylusOutOfRange | Occurs when the stylus is too far from the digitizer to be detected, while over this element. (Inherited from UIElement.)
Public event | StylusSystemGesture | Occurs when a user performs one of several stylus gestures. (Inherited from UIElement.)
Public event | StylusUp | Occurs when the user raises the stylus off the digitizer while it is over this element. (Inherited from UIElement.)
Public event | TargetUpdated | Occurs when the target value changes for any property binding on this element. (Inherited from FrameworkElement.)
Public event | TextInput | Occurs when this element gets text in a device-independent manner. (Inherited from UIElement.)
Public event | ToolTipClosing | Occurs just before any tooltip on the element is closed. (Inherited from FrameworkElement.)
Public event | ToolTipOpening | Occurs when any tooltip on the element is opened. (Inherited from FrameworkElement.)
Public event | TouchDown | Occurs when a finger touches the screen while the finger is over this element. (Inherited from UIElement.)
Public event | TouchEnter | Occurs when a touch moves from outside to inside the bounds of this element. (Inherited from UIElement.)
Public event | TouchLeave | Occurs when a touch moves from inside to outside the bounds of this element. (Inherited from UIElement.)
Public event | TouchMove | Occurs when a finger moves on the screen while the finger is over this element. (Inherited from UIElement.)
Public event | TouchUp | Occurs when a finger is raised off of the screen while the finger is over this element. (Inherited from UIElement.)
Public event | Unloaded | Occurs when the element is removed from within an element tree of loaded elements. (Inherited from FrameworkElement.)
Top
See Also

Reference

Bncs.Debug Namespace


PerformanceAnalysisAndControlWindow Constructor

PerformanceAnalysisAndControlWindow Constructor
Overload List
 | Name | Description
Public method | PerformanceAnalysisAndControlWindow(String) | Creates a window targeting the supplied process name with no CPU delay controls and a default CPU check frequency of 500ms
Public method | PerformanceAnalysisAndControlWindow(UInt32, String) | Creates a window targeting the supplied process name with no CPU delay controls and a specified CPU check frequency in milliseconds
Public method | PerformanceAnalysisAndControlWindow(UInt32, UInt32, String) | Creates a window targeting the supplied process name, CPU delay controls are shown and initialised and a specified CPU check frequency in milliseconds
Top
See Also

Reference

PerformanceAnalysisAndControlWindow Class
Bncs.Debug Namespace


PerformanceAnalysisAndControlWindow Constructor (String)

PerformanceAnalysisAndControlWindow Constructor (String)
Creates a window targeting the supplied process name with no CPU delay controls and a default CPU check frequency of 500ms

Namespace: Bncs.Debug
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public PerformanceAnalysisAndControlWindow(
    string processName_
)

Parameters

processName_
Type: SystemString
Name of process to monitor
See Also

Reference

PerformanceAnalysisAndControlWindow Class
PerformanceAnalysisAndControlWindow Overload
Bncs.Debug Namespace


PerformanceAnalysisAndControlWindow Constructor (UInt32, String)

PerformanceAnalysisAndControlWindow Constructor (UInt32, String)
Creates a window targeting the supplied process name with no CPU delay controls and a specified CPU check frequency in milliseconds

Namespace: Bncs.Debug
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public PerformanceAnalysisAndControlWindow(
    uint frequency_,
    string processName_
)

Parameters

frequency_
Type: SystemUInt32
CPU check frequency in milliseconds
processName_
Type: SystemString
Name of process to monitor
See Also

Reference

PerformanceAnalysisAndControlWindow Class
PerformanceAnalysisAndControlWindow Overload
Bncs.Debug Namespace


PerformanceAnalysisAndControlWindow Constructor (UInt32, UInt32, String)

PerformanceAnalysisAndControlWindow Constructor (UInt32, UInt32, String)
Creates a window targeting the supplied process name, CPU delay controls are shown and initialised and a specified CPU check frequency in milliseconds

Namespace: Bncs.Debug
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public PerformanceAnalysisAndControlWindow(
    uint initialValue_,
    uint frequency_,
    string processName_
)

Parameters

initialValue_
Type: SystemUInt32
Initial CPU delay value
frequency_
Type: SystemUInt32
CPU check frequency in milliseconds
processName_
Type: SystemString
Name of process to monitor
See Also

Reference

PerformanceAnalysisAndControlWindow Class
PerformanceAnalysisAndControlWindow Overload
Bncs.Debug Namespace


PerformanceAnalysisAndControlWindow Methods

PerformanceAnalysisAndControlWindow Methods

The PerformanceAnalysisAndControlWindow type exposes the following members.

Methods
 | Name | Description
Public method | Activate | Attempts to bring the window to the foreground and activates it. (Inherited from Window.)
Public method | AddHandler(RoutedEvent, Delegate) | Adds a routed event handler for a specified routed event, adding the handler to the handler collection on the current element. (Inherited from UIElement.)
Public method | AddHandler(RoutedEvent, Delegate, Boolean) | Adds a routed event handler for a specified routed event, adding the handler to the handler collection on the current element. Specify handledEventsToo as true to have the provided handler be invoked for routed event that had already been marked as handled by another element along the event route. (Inherited from UIElement.)
Public method | AddToEventRoute | Adds handlers to the specified EventRoute for the current UIElement event handler collection. (Inherited from UIElement.)
Public method | ApplyAnimationClock(DependencyProperty, AnimationClock) | Applies an animation to a specified dependency property on this element. Any existing animations are stopped and replaced with the new animation. (Inherited from UIElement.)
Public method | ApplyAnimationClock(DependencyProperty, AnimationClock, HandoffBehavior) | Applies an animation to a specified dependency property on this element, with the ability to specify what happens if the property already has a running animation. (Inherited from UIElement.)
Public method | ApplyTemplate | Builds the current template's visual tree if necessary, and returns a value that indicates whether the visual tree was rebuilt by this call. (Inherited from FrameworkElement.)
Public method | Arrange | Positions child elements and determines a size for a UIElement. Parent elements call this method from their ArrangeCore(Rect) implementation (or a WPF framework-level equivalent) to form a recursive layout update. This method constitutes the second pass of a layout update. (Inherited from UIElement.)
Public method | BeginAnimation(DependencyProperty, AnimationTimeline) | Starts an animation for a specified animated property on this element. (Inherited from UIElement.)
Public method | BeginAnimation(DependencyProperty, AnimationTimeline, HandoffBehavior) | Starts a specific animation for a specified animated property on this element, with the option of specifying what happens if the property already has a running animation. (Inherited from UIElement.)
Public method | BeginInit | Starts the initialization process for this element. (Inherited from FrameworkElement.)
Public method | BeginStoryboard(Storyboard) | Begins the sequence of actions that are contained in the provided storyboard. (Inherited from FrameworkElement.)
Public method | BeginStoryboard(Storyboard, HandoffBehavior) | Begins the sequence of actions contained in the provided storyboard, with options specified for what should happen if the property is already animated. (Inherited from FrameworkElement.)
Public method | BeginStoryboard(Storyboard, HandoffBehavior, Boolean) | Begins the sequence of actions contained in the provided storyboard, with specified state for control of the animation after it is started. (Inherited from FrameworkElement.)
Public method | BringIntoView | Attempts to bring this element into view, within any scrollable regions it is contained within. (Inherited from FrameworkElement.)
Public method | BringIntoView(Rect) | Attempts to bring the provided region size of this element into view, within any scrollable regions it is contained within. (Inherited from FrameworkElement.)
Public method | CaptureMouse | Attempts to force capture of the mouse to this element. (Inherited from UIElement.)
Public method | CaptureStylus | Attempts to force capture of the stylus to this element. (Inherited from UIElement.)
Public method | CaptureTouch | Attempts to force capture of a touch to this element. (Inherited from UIElement.)
Public method | CheckAccess | Determines whether the calling thread has access to this DispatcherObject. (Inherited from DispatcherObject.)
Public method | ClearValue(DependencyProperty) | Clears the local value of a property. The property to be cleared is specified by a DependencyProperty identifier. (Inherited from DependencyObject.)
Public method | ClearValue(DependencyPropertyKey) | Clears the local value of a read-only property. The property to be cleared is specified by a DependencyPropertyKey. (Inherited from DependencyObject.)
Public method | Close | Manually closes a Window. (Inherited from Window.)
Public method | CloseWindow | Method to finally close the window, this method should be called when your main application closes else the window will remain in process
Public method | CoerceValue | Coerces the value of the specified dependency property. This is accomplished by invoking any CoerceValueCallback function specified in property metadata for the dependency property as it exists on the calling DependencyObject. (Inherited from DependencyObject.)
Public method | DragMove | Allows a window to be dragged by a mouse with its left button down over an exposed area of the window's client area. (Inherited from Window.)
Public method | EndInit | Indicates that the initialization process for the element is complete. (Inherited from FrameworkElement.)
Public method | Equals | Determines whether a provided DependencyObject is equivalent to the current DependencyObject. (Inherited from DependencyObject.)
Public method | FindCommonVisualAncestor | Returns the common ancestor of two visual objects. (Inherited from Visual.)
Public method | FindName | Finds an element that has the provided identifier name. (Inherited from FrameworkElement.)
Public method | FindResource | Searches for a resource with the specified key, and throws an exception if the requested resource is not found. (Inherited from FrameworkElement.)
Public method | Focus | Attempts to set focus to this element. (Inherited from UIElement.)
Public method | GetAnimationBaseValue | Returns the base property value for the specified property on this element, disregarding any possible animated value from a running or stopped animation. (Inherited from UIElement.)
Public method | GetBindingExpression | Returns the BindingExpression that represents the binding on the specified property. (Inherited from FrameworkElement.)
Public method | GetHashCode | Gets a hash code for this DependencyObject. (Inherited from DependencyObject.)
Public method | GetLocalValueEnumerator | Creates a specialized enumerator for determining which dependency properties have locally set values on this DependencyObject. (Inherited from DependencyObject.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | GetValue | Returns the current effective value of a dependency property on this instance of a DependencyObject. (Inherited from DependencyObject.)
Public method | Hide | Makes a window invisible. (Inherited from Window.)
Public method | InitializeComponent | InitializeComponent
Public method | InputHitTest | Returns the input element within the current element that is at the specified coordinates, relative to the current element's origin. (Inherited from UIElement.)
Public method | InvalidateArrange | Invalidates the arrange state (layout) for the element. After the invalidation, the element will have its layout updated, which will occur asynchronously unless subsequently forced by UpdateLayout. (Inherited from UIElement.)
Public method | InvalidateMeasure | Invalidates the measurement state (layout) for the element. (Inherited from UIElement.)
Public method | InvalidateProperty | Re-evaluates the effective value for the specified dependency property (Inherited from DependencyObject.)
Public method | InvalidateVisual | Invalidates the rendering of the element, and forces a complete new layout pass. OnRender(DrawingContext) is called after the layout cycle is completed. (Inherited from UIElement.)
Public method | IsAncestorOf | Determines whether the visual object is an ancestor of the descendant visual object. (Inherited from Visual.)
Public method | IsDescendantOf | Determines whether the visual object is a descendant of the ancestor visual object. (Inherited from Visual.)
Public method | Measure | Updates the DesiredSize of a UIElement. Parent elements call this method from their own MeasureCore(Size) implementations to form a recursive layout update. Calling this method constitutes the first pass (the "Measure" pass) of a layout update. (Inherited from UIElement.)
Public method | MoveFocus | Moves the keyboard focus away from this element and to another element in a provided traversal direction. (Inherited from FrameworkElement.)
Public method | OnApplyTemplate | When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate. (Inherited from FrameworkElement.)
Public method | PointFromScreen | Converts a Point in screen coordinates into a Point that represents the current coordinate system of the Visual. (Inherited from Visual.)
Public method | PointToScreen | Converts a Point that represents the current coordinate system of the Visual into a Point in screen coordinates. (Inherited from Visual.)
Public method | PredictFocus | Determines the next element that would receive focus relative to this element for a provided focus movement direction, but does not actually move the focus. (Inherited from FrameworkElement.)
Public method | RaiseEvent | Raises a specific routed event. The RoutedEvent to be raised is identified within the RoutedEventArgs instance that is provided (as the RoutedEvent property of that event data). (Inherited from UIElement.)
Public method | ReadLocalValue | Returns the local value of a dependency property, if it exists. (Inherited from DependencyObject.)
Public method | RegisterName | Provides an accessor that simplifies access to the NameScope registration method. (Inherited from FrameworkElement.)
Public method | ReleaseAllTouchCaptures | Releases all captured touch devices from this element. (Inherited from UIElement.)
Public method | ReleaseMouseCapture | Releases the mouse capture, if this element held the capture. (Inherited from UIElement.)
Public method | ReleaseStylusCapture | Releases the stylus device capture, if this element held the capture. (Inherited from UIElement.)
Public method | ReleaseTouchCapture | Attempts to release the specified touch device from this element. (Inherited from UIElement.)
Public method | RemoveHandler | Removes the specified routed event handler from this element. (Inherited from UIElement.)
Public method | SetBinding(DependencyProperty, BindingBase) | Attaches a binding to this element, based on the provided binding object. (Inherited from FrameworkElement.)
Public method | SetBinding(DependencyProperty, String) | Attaches a binding to this element, based on the provided source property name as a path qualification to the data source. (Inherited from FrameworkElement.)
Public method | SetCurrentValue | Sets the value of a dependency property without changing its value source. (Inherited from DependencyObject.)
Public method | SetResourceReference | Searches for a resource with the specified name and sets up a resource reference to it for the specified property. (Inherited from FrameworkElement.)
Public method | SetValue(DependencyProperty, Object) | Sets the local value of a dependency property, specified by its dependency property identifier. (Inherited from DependencyObject.)
Public method | SetValue(DependencyPropertyKey, Object) | Sets the local value of a read-only dependency property, specified by the DependencyPropertyKey identifier of the dependency property. (Inherited from DependencyObject.)
Public method | ShouldSerializeCommandBindings | Returns whether serialization processes should serialize the contents of the CommandBindings property on instances of this class. (Inherited from UIElement.)
Public method | ShouldSerializeContent | Indicates whether the Content property should be persisted. (Inherited from ContentControl.)
Public method | ShouldSerializeInputBindings | Returns whether serialization processes should serialize the contents of the InputBindings property on instances of this class. (Inherited from UIElement.)
Public method | ShouldSerializeResources | Returns whether serialization processes should serialize the contents of the Resources property. (Inherited from FrameworkElement.)
Public method | ShouldSerializeStyle | Returns whether serialization processes should serialize the contents of the Style property. (Inherited from FrameworkElement.)
Public method | ShouldSerializeTriggers | Returns whether serialization processes should serialize the contents of the Triggers property. (Inherited from FrameworkElement.)
Public method | Show | Opens a window and returns without waiting for the newly opened window to close. (Inherited from Window.)
Public method | ShowDialog | Opens a window and returns only when the newly opened window is closed. (Inherited from Window.)
Public method | ToString | Gets the object as a string (Overrides ControlToString.)
Public method | TransformToAncestor(Visual) | Returns a transform that can be used to transform coordinates from the Visual to the specified Visual ancestor of the visual object. (Inherited from Visual.)
Public method | TransformToAncestor(Visual3D) | Returns a transform that can be used to transform coordinates from the Visual to the specified Visual3D ancestor of the visual object. (Inherited from Visual.)
Public method | TransformToDescendant | Returns a transform that can be used to transform coordinates from the Visual to the specified visual object descendant. (Inherited from Visual.)
Public method | TransformToVisual | Returns a transform that can be used to transform coordinates from the Visual to the specified visual object. (Inherited from Visual.)
Public method | TranslatePoint | Translates a point relative to this element to coordinates that are relative to the specified element. (Inherited from UIElement.)
Public method | TryFindResource | Searches for a resource with the specified key, and returns that resource if found. (Inherited from FrameworkElement.)
Public method | UnregisterName | Simplifies access to the NameScope de-registration method. (Inherited from FrameworkElement.)
Public method | UpdateLayout | Ensures that all visual child elements of this element are properly updated for layout. (Inherited from UIElement.)
Public method | VerifyAccess | Enforces that the calling thread has access to this DispatcherObject. (Inherited from DispatcherObject.)
Top
See Also

Reference

PerformanceAnalysisAndControlWindow Class
Bncs.Debug Namespace


PerformanceAnalysisAndControlWindow.CloseWindow Method

PerformanceAnalysisAndControlWindowCloseWindow Method
Method to finally close the window, this method should be called when your main application closes else the window will remain in process

Namespace: Bncs.Debug
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void CloseWindow()
See Also

Reference

PerformanceAnalysisAndControlWindow Class
Bncs.Debug Namespace


PerformanceAnalysisAndControlWindow.InitializeComponent Method

PerformanceAnalysisAndControlWindowInitializeComponent Method
InitializeComponent

Namespace: Bncs.Debug
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void InitializeComponent()

Implements

IComponentConnectorInitializeComponent
See Also

Reference

PerformanceAnalysisAndControlWindow Class
Bncs.Debug Namespace


PerformanceAnalysisAndControlWindow.ToString Method

PerformanceAnalysisAndControlWindowToString Method
Gets the object as a string

Namespace: Bncs.Debug
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
The process name
See Also

Reference

PerformanceAnalysisAndControlWindow Class
Bncs.Debug Namespace


PerformanceAnalysisAndControlWindow Properties

PerformanceAnalysisAndControlWindow Properties

The PerformanceAnalysisAndControlWindow type exposes the following members.

Properties
 | Name | Description
Public property | ActualHeight | Gets the rendered height of this element. (Inherited from FrameworkElement.)
Public property | ActualWidth | Gets the rendered width of this element. (Inherited from FrameworkElement.)
Public property | AllowDrop | Gets or sets a value indicating whether this element can be used as the target of a drag-and-drop operation. This is a dependency property. (Inherited from UIElement.)
Public property | AllowsTransparency | Gets or sets a value that indicates whether a window's client area supports transparency. (Inherited from Window.)
Public property | AreAnyTouchesCaptured | Gets a value that indicates whether at least one touch is captured to this element. (Inherited from UIElement.)
Public property | AreAnyTouchesCapturedWithin | Gets a value that indicates whether at least one touch is captured to this element or to any child elements in its visual tree. (Inherited from UIElement.)
Public property | AreAnyTouchesDirectlyOver | Gets a value that indicates whether at least one touch is pressed over this element. (Inherited from UIElement.)
Public property | AreAnyTouchesOver | Gets a value that indicates whether at least one touch is pressed over this element or any child elements in its visual tree. (Inherited from UIElement.)
Public property | AverageCpu | Gets the latest average CPU reading
Public property | Background | Gets or sets a brush that describes the background of a control. (Inherited from Control.)
Public property | BindingGroup | Gets or sets the BindingGroup that is used for the element. (Inherited from FrameworkElement.)
Public property | BitmapEffect | Obsolete. Gets or sets a bitmap effect that applies directly to the rendered content for this element. This is a dependency property. (Inherited from UIElement.)
Public property | BitmapEffectInput | Obsolete. Gets or sets an input source for the bitmap effect that applies directly to the rendered content for this element. This is a dependency property. (Inherited from UIElement.)
Public property | BorderBrush | Gets or sets a brush that describes the border background of a control. (Inherited from Control.)
Public property | BorderThickness | Gets or sets the border thickness of a control. (Inherited from Control.)
Public property | CacheMode | Gets or sets a cached representation of the UIElement. (Inherited from UIElement.)
Public property | Clip | Gets or sets the geometry used to define the outline of the contents of an element. This is a dependency property. (Inherited from UIElement.)
Public property | ClipToBounds | Gets or sets a value indicating whether to clip the content of this element (or content coming from the child elements of this element) to fit into the size of the containing element. This is a dependency property. (Inherited from UIElement.)
Public property | CommandBindings | Gets a collection of CommandBinding objects associated with this element. A CommandBinding enables command handling for this element, and declares the linkage between a command, its events, and the handlers attached by this element. (Inherited from UIElement.)
Public property | Content | Gets or sets the content of a ContentControl. (Inherited from ContentControl.)
Public property | ContentStringFormat | Gets or sets a composite string that specifies how to format the Content property if it is displayed as a string. (Inherited from ContentControl.)
Public property | ContentTemplate | Gets or sets the data template used to display the content of the ContentControl. (Inherited from ContentControl.)
Public property | ContentTemplateSelector | Gets or sets a template selector that enables an application writer to provide custom template-selection logic. (Inherited from ContentControl.)
Public property | ContextMenu | Gets or sets the context menu element that should appear whenever the context menu is requested through user interface (UI) from within this element. (Inherited from FrameworkElement.)
Public property | Cursor | Gets or sets the cursor that displays when the mouse pointer is over this element. (Inherited from FrameworkElement.)
Public property | DataContext | Gets or sets the data context for an element when it participates in data binding. (Inherited from FrameworkElement.)
Public property | DependencyObjectType | Gets the DependencyObjectType that wraps the CLR type of this instance. (Inherited from DependencyObject.)
Public property | DesiredSize | Gets the size that this element computed during the measure pass of the layout process. (Inherited from UIElement.)
Public property | DialogResult | Gets or sets the dialog result value, which is the value that is returned from the ShowDialog method. (Inherited from Window.)
Public property | Dispatcher | Gets the Dispatcher this DispatcherObject is associated with. (Inherited from DispatcherObject.)
Public property | Effect | Gets or sets the bitmap effect to apply to the UIElement. This is a dependency property. (Inherited from UIElement.)
Public property | FlowDirection | Gets or sets the direction that text and other user interface (UI) elements flow within any parent element that controls their layout. (Inherited from FrameworkElement.)
Public property | Focusable | Gets or sets a value that indicates whether the element can receive focus. This is a dependency property. (Inherited from UIElement.)
Public property | FocusVisualStyle | Gets or sets a property that enables customization of appearance, effects, or other style characteristics that will apply to this element when it captures keyboard focus. (Inherited from FrameworkElement.)
Public property | FontFamily | Gets or sets the font family of the control. (Inherited from Control.)
Public property | FontSize | Gets or sets the font size. (Inherited from Control.)
Public property | FontStretch | Gets or sets the degree to which a font is condensed or expanded on the screen. (Inherited from Control.)
Public property | FontStyle | Gets or sets the font style. (Inherited from Control.)
Public property | FontWeight | Gets or sets the weight or thickness of the specified font. (Inherited from Control.)
Public property | ForceCursor | Gets or sets a value that indicates whether this FrameworkElement should force the user interface (UI) to render the cursor as declared by the Cursor property. (Inherited from FrameworkElement.)
Public property | Foreground | Gets or sets a brush that describes the foreground color. (Inherited from Control.)
Public property | HasAnimatedProperties | Gets a value indicating whether this element has any animated properties. (Inherited from UIElement.)
Public property | HasContent | Gets a value that indicates whether the ContentControl contains content. (Inherited from ContentControl.)
Public property | Height | Gets or sets the suggested height of the element. (Inherited from FrameworkElement.)
Public property | HorizontalAlignment | Gets or sets the horizontal alignment characteristics applied to this element when it is composed within a parent element, such as a panel or items control. (Inherited from FrameworkElement.)
Public property | HorizontalContentAlignment | Gets or sets the horizontal alignment of the control's content. (Inherited from Control.)
Public property | Icon | Gets or sets a window's icon. (Inherited from Window.)
Public property | InputBindings | Gets the collection of input bindings associated with this element. (Inherited from UIElement.)
Public property | InputScope | Gets or sets the context for input used by this FrameworkElement. (Inherited from FrameworkElement.)
Public property | IsActive | Gets a value that indicates whether the window is active. (Inherited from Window.)
Public property | IsArrangeValid | Gets a value indicating whether the computed size and position of child elements in this element's layout are valid. (Inherited from UIElement.)
Public property | IsEnabled | Gets or sets a value indicating whether this element is enabled in the user interface (UI). This is a dependency property. (Inherited from UIElement.)
Public property | IsFocused | Gets a value that determines whether this element has logical focus. This is a dependency property. (Inherited from UIElement.)
Public property | IsHitTestVisible | Gets or sets a value that declares whether this element can possibly be returned as a hit test result from some portion of its rendered content. This is a dependency property. (Inherited from UIElement.)
Public property | IsInitialized | Gets a value that indicates whether this element has been initialized, either during processing by a XAML processor, or by explicitly having its EndInit method called. (Inherited from FrameworkElement.)
Public property | IsInputMethodEnabled | Gets a value indicating whether an input method system, such as an Input Method Editor (IME), is enabled for processing the input to this element. (Inherited from UIElement.)
Public property | IsKeyboardFocused | Gets a value indicating whether this element has keyboard focus. This is a dependency property. (Inherited from UIElement.)
Public property | IsKeyboardFocusWithin | Gets a value indicating whether keyboard focus is anywhere within the element or its visual tree child elements. This is a dependency property. (Inherited from UIElement.)
Public property | IsLoaded | Gets a value that indicates whether this element has been loaded for presentation. (Inherited from FrameworkElement.)
Public property | IsManipulationEnabled | Gets or sets a value that indicates whether manipulation events are enabled on this UIElement. (Inherited from UIElement.)
Public property | IsMeasureValid | Gets a value indicating whether the current size returned by layout measure is valid. (Inherited from UIElement.)
Public property | IsMouseCaptured | Gets a value indicating whether the mouse is captured to this element. This is a dependency property. (Inherited from UIElement.)
Public property | IsMouseCaptureWithin | Gets a value that determines whether mouse capture is held by this element or by child elements in its visual tree. This is a dependency property. (Inherited from UIElement.)
Public property | IsMouseDirectlyOver | Gets a value that indicates whether the position of the mouse pointer corresponds to hit test results, which take element compositing into account. This is a dependency property. (Inherited from UIElement.)
Public property | IsMouseOver | Gets a value indicating whether the mouse pointer is located over this element (including child elements in the visual tree). This is a dependency property. (Inherited from UIElement.)
Public property | IsSealed | Gets a value that indicates whether this instance is currently sealed (read-only). (Inherited from DependencyObject.)
Public property | IsStylusCaptured | Gets a value indicating whether the stylus is captured by this element. This is a dependency property. (Inherited from UIElement.)
Public property | IsStylusCaptureWithin | Gets a value that determines whether stylus capture is held by this element, or an element within the element bounds and its visual tree. This is a dependency property. (Inherited from UIElement.)
Public property | IsStylusDirectlyOver | Gets a value that indicates whether the stylus position corresponds to hit test results, which take element compositing into account. This is a dependency property. (Inherited from UIElement.)
Public property | IsStylusOver | Gets a value indicating whether the stylus cursor is located over this element (including visual child elements). This is a dependency property. (Inherited from UIElement.)
Public property | IsTabStop | Gets or sets a value that indicates whether a control is included in tab navigation. (Inherited from Control.)
Public property | IsVisible | Gets a value indicating whether this element is visible in the user interface (UI). This is a dependency property. (Inherited from UIElement.)
Public property | Language | Gets or sets localization/globalization language information that applies to an element. (Inherited from FrameworkElement.)
Public property | LayoutTransform | Gets or sets a graphics transformation that should apply to this element when layout is performed. (Inherited from FrameworkElement.)
Public property | Left | Gets or sets the position of the window's left edge, in relation to the desktop. (Inherited from Window.)
Public property | Margin | Gets or sets the outer margin of an element. (Inherited from FrameworkElement.)
Public property | MaxHeight | Gets or sets the maximum height constraint of the element. (Inherited from FrameworkElement.)
Public property | MaxWidth | Gets or sets the maximum width constraint of the element. (Inherited from FrameworkElement.)
Public property | MinHeight | Gets or sets the minimum height constraint of the element. (Inherited from FrameworkElement.)
Public property | MinWidth | Gets or sets the minimum width constraint of the element. (Inherited from FrameworkElement.)
Public property | Name | Gets or sets the identifying name of the element. The name provides a reference so that code-behind, such as event handler code, can refer to a markup element after it is constructed during processing by a XAML processor. (Inherited from FrameworkElement.)
Public property | Opacity | Gets or sets the opacity factor applied to the entire UIElement when it is rendered in the user interface (UI). This is a dependency property. (Inherited from UIElement.)
Public property | OpacityMask | Gets or sets an opacity mask, as a Brush implementation that is applied to any alpha-channel masking for the rendered content of this element. This is a dependency property. (Inherited from UIElement.)
Public property | OverridesDefaultStyle | Gets or sets a value that indicates whether this element incorporates style properties from theme styles. (Inherited from FrameworkElement.)
Public property | OwnedWindows | Gets a collection of windows for which this window is the owner. (Inherited from Window.)
Public property | Owner | Gets or sets the Window that owns this Window. (Inherited from Window.)
Public property | Padding | Gets or sets the padding inside a control. (Inherited from Control.)
Public property | Parent | Gets the logical parent element of this element. (Inherited from FrameworkElement.)
Public property | PeakCpu | Gets the latest peak CPU reading
Public property | PersistId | Obsolete. Gets a value that uniquely identifies this element. (Inherited from UIElement.)
Public property | RenderSize | Gets (or sets, but see Remarks) the final render size of this element. (Inherited from UIElement.)
Public property | RenderTransform | Gets or sets transform information that affects the rendering position of this element. This is a dependency property. (Inherited from UIElement.)
Public property | RenderTransformOrigin | Gets or sets the center point of any possible render transform declared by RenderTransform, relative to the bounds of the element. This is a dependency property. (Inherited from UIElement.)
Public property | ResizeMode | Gets or sets the resize mode. (Inherited from Window.)
Public property | Resources | Gets or sets the locally-defined resource dictionary. (Inherited from FrameworkElement.)
Public property | RestoreBounds | Gets the size and location of a window before being either minimized or maximized. (Inherited from Window.)
Public property | ShowActivated | Gets or sets a value that indicates whether a window is activated when first shown. (Inherited from Window.)
Public property | ShowInTaskbar | Gets or sets a value that indicates whether the window has a task bar button. (Inherited from Window.)
Public property | SizeToContent | Gets or sets a value that indicates whether a window will automatically size itself to fit the size of its content. (Inherited from Window.)
Public property | SnapsToDevicePixels | Gets or sets a value that determines whether rendering for this element should use device-specific pixel settings during rendering. This is a dependency property. (Inherited from UIElement.)
Public property | Style | Gets or sets the style used by this element when it is rendered. (Inherited from FrameworkElement.)
Public property | TabIndex | Gets or sets a value that determines the order in which elements receive focus when the user navigates through controls by using the TAB key. (Inherited from Control.)
Public property | Tag | Gets or sets an arbitrary object value that can be used to store custom information about this element. (Inherited from FrameworkElement.)
Public property | TaskbarItemInfo | Gets or sets the Windows 7 taskbar thumbnail for the Window. (Inherited from Window.)
Public property | Template | Gets or sets a control template. (Inherited from Control.)
Public property | TemplatedParent | Gets a reference to the template parent of this element. This property is not relevant if the element was not created through a template. (Inherited from FrameworkElement.)
Public property | Title | Gets or sets a window's title. (Inherited from Window.)
Public property | ToolTip | Gets or sets the tool-tip object that is displayed for this element in the user interface (UI). (Inherited from FrameworkElement.)
Public property | Top | Gets or sets the position of the window's top edge, in relation to the desktop. (Inherited from Window.)
Public property | Topmost | Gets or sets a value that indicates whether a window appears in the topmost z-order. (Inherited from Window.)
Public property | TouchesCaptured | Gets all touch devices that are captured to this element. (Inherited from UIElement.)
Public property | TouchesCapturedWithin | Gets all touch devices that are captured to this element or any child elements in its visual tree. (Inherited from UIElement.)
Public property | TouchesDirectlyOver | Gets all touch devices that are over this element. (Inherited from UIElement.)
Public property | TouchesOver | Gets all touch devices that are over this element or any child elements in its visual tree. (Inherited from UIElement.)
Public property | Triggers | Gets the collection of triggers established directly on this element, or in child elements. (Inherited from FrameworkElement.)
Public property | Uid | Gets or sets the unique identifier (for localization) for this element. This is a dependency property. (Inherited from UIElement.)
Public property | UseLayoutRounding | Gets or sets a value that indicates whether layout rounding should be applied to this element's size and position during layout. (Inherited from FrameworkElement.)
Public property | VerticalAlignment | Gets or sets the vertical alignment characteristics applied to this element when it is composed within a parent element such as a panel or items control. (Inherited from FrameworkElement.)
Public property | VerticalContentAlignment | Gets or sets the vertical alignment of the control's content. (Inherited from Control.)
Public property | Visibility | Gets or sets the user interface (UI) visibility of this element. This is a dependency property. (Inherited from UIElement.)
Public property | Width | Gets or sets the width of the element. (Inherited from FrameworkElement.)
Public property | WindowStartupLocation | Gets or sets the position of the window when first shown. (Inherited from Window.)
Public property | WindowState | Gets or sets a value that indicates whether a window is restored, minimized, or maximized. (Inherited from Window.)
Public property | WindowStyle | Gets or sets a window's border style. (Inherited from Window.)
Top
See Also

Reference

PerformanceAnalysisAndControlWindow Class
Bncs.Debug Namespace


PerformanceAnalysisAndControlWindow.AverageCpu Property

PerformanceAnalysisAndControlWindowAverageCpu Property
Gets the latest average CPU reading

Namespace: Bncs.Debug
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint AverageCpu { get; }

Property Value

Type: UInt32
See Also

Reference

PerformanceAnalysisAndControlWindow Class
Bncs.Debug Namespace


PerformanceAnalysisAndControlWindow.PeakCpu Property

PerformanceAnalysisAndControlWindowPeakCpu Property
Gets the latest peak CPU reading

Namespace: Bncs.Debug
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint PeakCpu { get; }

Property Value

Type: UInt32
See Also

Reference

PerformanceAnalysisAndControlWindow Class
Bncs.Debug Namespace


PerformanceAnalysisAndControlWindow Events

PerformanceAnalysisAndControlWindow Events

The PerformanceAnalysisAndControlWindow type exposes the following members.

Events
 | Name | Description
Public event | Activated | Occurs when a window becomes the foreground window. (Inherited from Window.)
Public event | Closed | Occurs when the window is about to close. (Inherited from Window.)
Public event | Closing | Occurs directly after Close is called, and can be handled to cancel window closure. (Inherited from Window.)
Public event | ContentRendered | Occurs after a window's content has been rendered. (Inherited from Window.)
Public event | ContextMenuClosing | Occurs just before any context menu on the element is closed. (Inherited from FrameworkElement.)
Public event | ContextMenuOpening | Occurs when any context menu on the element is opened. (Inherited from FrameworkElement.)
Public event | DataContextChanged | Occurs when the data context for this element changes. (Inherited from FrameworkElement.)
Public event | Deactivated | Occurs when a window becomes a background window. (Inherited from Window.)
Public event | DragEnter | Occurs when the input system reports an underlying drag event with this element as the drag target. (Inherited from UIElement.)
Public event | DragLeave | Occurs when the input system reports an underlying drag event with this element as the drag origin. (Inherited from UIElement.)
Public event | DragOver | Occurs when the input system reports an underlying drag event with this element as the potential drop target. (Inherited from UIElement.)
Public event | Drop | Occurs when the input system reports an underlying drop event with this element as the drop target. (Inherited from UIElement.)
Public event | FocusableChanged | Occurs when the value of the Focusable property changes. (Inherited from UIElement.)
Public event | GiveFeedback | Occurs when the input system reports an underlying drag-and-drop event that involves this element. (Inherited from UIElement.)
Public event | GotFocus | Occurs when this element gets logical focus. (Inherited from UIElement.)
Public event | GotKeyboardFocus | Occurs when the keyboard is focused on this element. (Inherited from UIElement.)
Public event | GotMouseCapture | Occurs when this element captures the mouse. (Inherited from UIElement.)
Public event | GotStylusCapture | Occurs when this element captures the stylus. (Inherited from UIElement.)
Public event | GotTouchCapture | Occurs when a touch is captured to this element. (Inherited from UIElement.)
Public event | Initialized | Occurs when this FrameworkElement is initialized. This event coincides with cases where the value of the IsInitialized property changes from false (or undefined) to true. (Inherited from FrameworkElement.)
Public event | IsEnabledChanged | Occurs when the value of the IsEnabled property on this element changes. (Inherited from UIElement.)
Public event | IsHitTestVisibleChanged | Occurs when the value of the IsHitTestVisible dependency property changes on this element. (Inherited from UIElement.)
Public event | IsKeyboardFocusedChanged | Occurs when the value of the IsKeyboardFocused property changes on this element. (Inherited from UIElement.)
Public event | IsKeyboardFocusWithinChanged | Occurs when the value of the IsKeyboardFocusWithinChanged property changes on this element. (Inherited from UIElement.)
Public event | IsMouseCapturedChanged | Occurs when the value of the IsMouseCaptured property changes on this element. (Inherited from UIElement.)
Public event | IsMouseCaptureWithinChanged | Occurs when the value of the IsMouseCaptureWithinProperty changes on this element. (Inherited from UIElement.)
Public event | IsMouseDirectlyOverChanged | Occurs when the value of the IsMouseDirectlyOver property changes on this element. (Inherited from UIElement.)
Public event | IsStylusCapturedChanged | Occurs when the value of the IsStylusCaptured property changes on this element. (Inherited from UIElement.)
Public event | IsStylusCaptureWithinChanged | Occurs when the value of the IsStylusCaptureWithin property changes on this element. (Inherited from UIElement.)
Public event | IsStylusDirectlyOverChanged | Occurs when the value of the IsStylusDirectlyOver property changes on this element. (Inherited from UIElement.)
Public event | IsVisibleChanged | Occurs when the value of the IsVisible property changes on this element. (Inherited from UIElement.)
Public event | KeyDown | Occurs when a key is pressed while focus is on this element. (Inherited from UIElement.)
Public event | KeyUp | Occurs when a key is released while focus is on this element. (Inherited from UIElement.)
Public event | LayoutUpdated | Occurs when the layout of the various visual elements associated with the current Dispatcher changes. (Inherited from UIElement.)
Public event | Loaded | Occurs when the element is laid out, rendered, and ready for interaction. (Inherited from FrameworkElement.)
Public event | LocationChanged | Occurs when the window's location changes. (Inherited from Window.)
Public event | LostFocus | Occurs when this element loses logical focus. (Inherited from UIElement.)
Public event | LostKeyboardFocus | Occurs when the keyboard is no longer focused on this element,. (Inherited from UIElement.)
Public event | LostMouseCapture | Occurs when this element loses mouse capture. (Inherited from UIElement.)
Public event | LostStylusCapture | Occurs when this element loses stylus capture. (Inherited from UIElement.)
Public event | LostTouchCapture | Occurs when this element loses a touch capture. (Inherited from UIElement.)
Public event | ManipulationBoundaryFeedback | Occurs when the manipulation encounters a boundary. (Inherited from UIElement.)
Public event | ManipulationCompleted | Occurs when a manipulation and inertia on the UIElement object is complete. (Inherited from UIElement.)
Public event | ManipulationDelta | Occurs when the input device changes position during a manipulation. (Inherited from UIElement.)
Public event | ManipulationInertiaStarting | Occurs when the input device loses contact with the UIElement object during a manipulation and inertia begins. (Inherited from UIElement.)
Public event | ManipulationStarted | Occurs when an input device begins a manipulation on the UIElement object. (Inherited from UIElement.)
Public event | ManipulationStarting | Occurs when the manipulation processor is first created. (Inherited from UIElement.)
Public event | MouseDoubleClick | Occurs when a mouse button is clicked two or more times. (Inherited from Control.)
Public event | MouseDown | Occurs when any mouse button is pressed while the pointer is over this element. (Inherited from UIElement.)
Public event | MouseEnter | Occurs when the mouse pointer enters the bounds of this element. (Inherited from UIElement.)
Public event | MouseLeave | Occurs when the mouse pointer leaves the bounds of this element. (Inherited from UIElement.)
Public event | MouseLeftButtonDown | Occurs when the left mouse button is pressed while the mouse pointer is over this element. (Inherited from UIElement.)
Public event | MouseLeftButtonUp | Occurs when the left mouse button is released while the mouse pointer is over this element. (Inherited from UIElement.)
Public event | MouseMove | Occurs when the mouse pointer moves while over this element. (Inherited from UIElement.)
Public event | MouseRightButtonDown | Occurs when the right mouse button is pressed while the mouse pointer is over this element. (Inherited from UIElement.)
Public event | MouseRightButtonUp | Occurs when the right mouse button is released while the mouse pointer is over this element. (Inherited from UIElement.)
Public event | MouseUp | Occurs when any mouse button is released over this element. (Inherited from UIElement.)
Public event | MouseWheel | Occurs when the user rotates the mouse wheel while the mouse pointer is over this element. (Inherited from UIElement.)
Public event | OnCPUPeak | Fires when the CPU time goes to a new peak.
Public event | OnDelayChange | Fires when the CPU delay is changed via the slider control on the UI.
Public event | PreviewDragEnter | Occurs when the input system reports an underlying drag event with this element as the drag target. (Inherited from UIElement.)
Public event | PreviewDragLeave | Occurs when the input system reports an underlying drag event with this element as the drag origin. (Inherited from UIElement.)
Public event | PreviewDragOver | Occurs when the input system reports an underlying drag event with this element as the potential drop target. (Inherited from UIElement.)
Public event | PreviewDrop | Occurs when the input system reports an underlying drop event with this element as the drop target. (Inherited from UIElement.)
Public event | PreviewGiveFeedback | Occurs when a drag-and-drop operation is started. (Inherited from UIElement.)
Public event | PreviewGotKeyboardFocus | Occurs when the keyboard is focused on this element. (Inherited from UIElement.)
Public event | PreviewKeyDown | Occurs when a key is pressed while focus is on this element. (Inherited from UIElement.)
Public event | PreviewKeyUp | Occurs when a key is released while focus is on this element. (Inherited from UIElement.)
Public event | PreviewLostKeyboardFocus | Occurs when the keyboard is no longer focused on this element. (Inherited from UIElement.)
Public event | PreviewMouseDoubleClick | Occurs when a user clicks the mouse button two or more times. (Inherited from Control.)
Public event | PreviewMouseDown | Occurs when any mouse button is pressed while the pointer is over this element. (Inherited from UIElement.)
Public event | PreviewMouseLeftButtonDown | Occurs when the left mouse button is pressed while the mouse pointer is over this element. (Inherited from UIElement.)
Public event | PreviewMouseLeftButtonUp | Occurs when the left mouse button is released while the mouse pointer is over this element. (Inherited from UIElement.)
Public event | PreviewMouseMove | Occurs when the mouse pointer moves while the mouse pointer is over this element. (Inherited from UIElement.)
Public event | PreviewMouseRightButtonDown | Occurs when the right mouse button is pressed while the mouse pointer is over this element. (Inherited from UIElement.)
Public event | PreviewMouseRightButtonUp | Occurs when the right mouse button is released while the mouse pointer is over this element. (Inherited from UIElement.)
Public event | PreviewMouseUp | Occurs when any mouse button is released while the mouse pointer is over this element. (Inherited from UIElement.)
Public event | PreviewMouseWheel | Occurs when the user rotates the mouse wheel while the mouse pointer is over this element. (Inherited from UIElement.)
Public event | PreviewQueryContinueDrag | Occurs when there is a change in the keyboard or mouse button state during a drag-and-drop operation. (Inherited from UIElement.)
Public event | PreviewStylusButtonDown | Occurs when the stylus button is pressed while the pointer is over this element. (Inherited from UIElement.)
Public event | PreviewStylusButtonUp | Occurs when the stylus button is released while the pointer is over this element. (Inherited from UIElement.)
Public event | PreviewStylusDown | Occurs when the stylus touches the digitizer while it is over this element. (Inherited from UIElement.)
Public event | PreviewStylusInAirMove | Occurs when the stylus moves over an element without actually touching the digitizer. (Inherited from UIElement.)
Public event | PreviewStylusInRange | Occurs when the stylus is close enough to the digitizer to be detected, while over this element. (Inherited from UIElement.)
Public event | PreviewStylusMove | Occurs when the stylus moves while over the element. The stylus must move while being detected by the digitizer to raise this event, otherwise, PreviewStylusInAirMove is raised instead. (Inherited from UIElement.)
Public event | PreviewStylusOutOfRange | Occurs when the stylus is too far from the digitizer to be detected. (Inherited from UIElement.)
Public event | PreviewStylusSystemGesture | Occurs when a user performs one of several stylus gestures. (Inherited from UIElement.)
Public event | PreviewStylusUp | Occurs when the user raises the stylus off the digitizer while the stylus is over this element. (Inherited from UIElement.)
Public event | PreviewTextInput | Occurs when this element gets text in a device-independent manner. (Inherited from UIElement.)
Public event | PreviewTouchDown | Occurs when a finger touches the screen while the finger is over this element. (Inherited from UIElement.)
Public event | PreviewTouchMove | Occurs when a finger moves on the screen while the finger is over this element. (Inherited from UIElement.)
Public event | PreviewTouchUp | Occurs when a finger is raised off of the screen while the finger is over this element. (Inherited from UIElement.)
Public event | QueryContinueDrag | Occurs when there is a change in the keyboard or mouse button state during a drag-and-drop operation. (Inherited from UIElement.)
Public event | QueryCursor | Occurs when the cursor is requested to display. This event is raised on an element each time that the mouse pointer moves to a new location, which means the cursor object might need to be changed based on its new position. (Inherited from UIElement.)
Public event | RequestBringIntoView | Occurs when BringIntoView(Rect) is called on this element. (Inherited from FrameworkElement.)
Public event | SizeChanged | Occurs when either the ActualHeight or the ActualWidth properties change value on this element. (Inherited from FrameworkElement.)
Public event | SourceInitialized | This event is raised to support interoperation with Win32. See HwndSource. (Inherited from Window.)
Public event | SourceUpdated | Occurs when the source value changes for any existing property binding on this element. (Inherited from FrameworkElement.)
Public event | StateChanged | Occurs when the window's WindowState property changes. (Inherited from Window.)
Public event | StylusButtonDown | Occurs when the stylus button is pressed while the pointer is over this element. (Inherited from UIElement.)
Public event | StylusButtonUp | Occurs when the stylus button is released while the pointer is over this element. (Inherited from UIElement.)
Public event | StylusDown | Occurs when the stylus touches the digitizer while the stylus is over this element. (Inherited from UIElement.)
Public event | StylusEnter | Occurs when the stylus enters the bounds of this element. (Inherited from UIElement.)
Public event | StylusInAirMove | Occurs when the stylus moves over an element without actually touching the digitizer. (Inherited from UIElement.)
Public event | StylusInRange | Occurs when the stylus is close enough to the digitizer to be detected, while over this element. (Inherited from UIElement.)
Public event | StylusLeave | Occurs when the stylus leaves the bounds of the element. (Inherited from UIElement.)
Public event | StylusMove | Occurs when the stylus moves over this element. The stylus must move while on the digitizer to raise this event. Otherwise, StylusInAirMove is raised instead. (Inherited from UIElement.)
Public event | StylusOutOfRange | Occurs when the stylus is too far from the digitizer to be detected, while over this element. (Inherited from UIElement.)
Public event | StylusSystemGesture | Occurs when a user performs one of several stylus gestures. (Inherited from UIElement.)
Public event | StylusUp | Occurs when the user raises the stylus off the digitizer while it is over this element. (Inherited from UIElement.)
Public event | TargetUpdated | Occurs when the target value changes for any property binding on this element. (Inherited from FrameworkElement.)
Public event | TextInput | Occurs when this element gets text in a device-independent manner. (Inherited from UIElement.)
Public event | ToolTipClosing | Occurs just before any tooltip on the element is closed. (Inherited from FrameworkElement.)
Public event | ToolTipOpening | Occurs when any tooltip on the element is opened. (Inherited from FrameworkElement.)
Public event | TouchDown | Occurs when a finger touches the screen while the finger is over this element. (Inherited from UIElement.)
Public event | TouchEnter | Occurs when a touch moves from outside to inside the bounds of this element. (Inherited from UIElement.)
Public event | TouchLeave | Occurs when a touch moves from inside to outside the bounds of this element. (Inherited from UIElement.)
Public event | TouchMove | Occurs when a finger moves on the screen while the finger is over this element. (Inherited from UIElement.)
Public event | TouchUp | Occurs when a finger is raised off of the screen while the finger is over this element. (Inherited from UIElement.)
Public event | Unloaded | Occurs when the element is removed from within an element tree of loaded elements. (Inherited from FrameworkElement.)
Top
See Also

Reference

PerformanceAnalysisAndControlWindow Class
Bncs.Debug Namespace


PerformanceAnalysisAndControlWindow.OnCPUPeak Event

PerformanceAnalysisAndControlWindowOnCPUPeak Event
Fires when the CPU time goes to a new peak.

Namespace: Bncs.Debug
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnCPUPeakEventHandler OnCPUPeak

Value

Type: Bncs.DebugOnCPUPeakEventHandler
See Also

Reference

PerformanceAnalysisAndControlWindow Class
Bncs.Debug Namespace


PerformanceAnalysisAndControlWindow.OnDelayChange Event

PerformanceAnalysisAndControlWindowOnDelayChange Event
Fires when the CPU delay is changed via the slider control on the UI.

Namespace: Bncs.Debug
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnCPUDelayChangeEventHandler OnDelayChange

Value

Type: Bncs.DebugOnCPUDelayChangeEventHandler
See Also

Reference

PerformanceAnalysisAndControlWindow Class
Bncs.Debug Namespace


Bncs.Execute Namespace

Bncs.Execute Namespace
This namespace has classes and methods for running, monitoring and getting information about processes. There is also a class that will ensure that only a single instance of your application can be run.
Classes
 | Class | Description
Public class | AssociatedFile | A class to run a document with it's associated executable.
Public class | Execute | Static class for process handling and execution tasks including shell execution of a document file.
Public class | ExecuteSHELLEXECUTEINFO | Shell execute information structure.
Public class | ExecuteMonitor | A class that executes and monitors a process and alerts on termination.
Public class | SingleApplicationInstance | A class to ensure that only one instance of an application may be run.
Enumerations
 | Enumeration | Description
Public enumeration | ShellExVerb | Enumeration denoting the verb to use with shell execute operations


AssociatedFile Class

AssociatedFile Class
A class to run a document with it's associated executable.
Inheritance Hierarchy
SystemObject
Bncs.ExecuteAssociatedFile

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class AssociatedFile

The AssociatedFile type exposes the following members.

Constructors
 | Name | Description
Public method | AssociatedFile | Default constructor
 | AssociatedFile(String) | Constructor accepting a data string. This string will be the document file name you wish to execute.
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Run | Runs the document file contained in the Data property either with it's associated executable or with the specified program if also included in the the Data property.
Public method | Run(Boolean) | Runs the document file contained in the Data property either with it's associated executable or with the specified program if also included in the the Data property. This call will block if the wait flag is set.
Public method | Run(Int32) | Runs the document file contained in the Data property either with it's associated executable or with the specified program if also included in the the Data property. This call will block according to the time out supplied. Time out values: -1 = no wait, 0 = wait until process terminates else wait until process terminates or the time out occures.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
Name Description
Public property CanRun
Returns true if the document exists.
Data
Gets or sets the data string. This is a string containing the file path of the document you wish to execute. Optionally this may include the name of an executable to launch the document with delimited by a pipe (|).
Examples
Copy
MyAssociatedFileInstance.Data = "c:\\docs\\myfile.txt|c:\\windows.notepad.exe";
Public property Exists
Returns true if the document exists, if a program name is specified in the Data property then that must exist too to return a true.
Public property Filename
Gets the document name contained in the Data property.
Public property Program
Gets the program name (if included) contained in the Data property.
Top
See Also

Reference

Bncs.Execute Namespace


AssociatedFile Constructor

AssociatedFile Constructor
Overload List
 | Name | Description
Public method | AssociatedFile | Default constructor
 | AssociatedFile(String) | Constructor accepting a data string. This string will be the document file name you wish to execute.
Top
See Also

Reference

AssociatedFile Class
Bncs.Execute Namespace


AssociatedFile Constructor

AssociatedFile Constructor
Default constructor

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public AssociatedFile()
See Also

Reference

AssociatedFile Class
AssociatedFile Overload
Bncs.Execute Namespace


AssociatedFile Constructor (String)

AssociatedFile Constructor (String)
Constructor accepting a data string. This string will be the document file name you wish to execute.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public AssociatedFile(
    string data_
)

Parameters

data_
Type: SystemString
Document plus (optionally) the name of an executable file to launch it with. Use a pipe (|) as a delimiter: document|exe
Examples
This code demonstrates use of the AssociateFile class
Copy
class Program
{
    static void Main()
    {
        // Create an associated file object to run with it's associated application
        AssociatedFile associatedFile = new AssociatedFile(@"C:\Users\fred\Documents\MetaX\MetaX.log");
        if (associatedFile.Run())
            Console.WriteLine("\"" + associatedFile.Filename + "\" running ok with associated program \"" + Execute.FindAssociatedExe(associatedFile.Filename) + "\"");
        else
            Console.WriteLine("Failed to run document");

        Console.ReadKey();

        // Create an associated file object to run with the specified program
        associatedFile = new AssociatedFile(@"C:\Users\fred\Documents\MetaX\MetaX.log|c:\\windows\notepad.exe");
        if (associatedFile.Run())
            Console.WriteLine("\"" + associatedFile.Filename + "\" running ok with specified program \"" + associatedFile.Program);
        else
            Console.WriteLine("Failed to run document");

        Console.ReadKey();
    }
}
See Also

Reference

AssociatedFile Class
AssociatedFile Overload
Bncs.Execute Namespace


AssociatedFile Methods

AssociatedFile Methods

The AssociatedFile type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Run | Runs the document file contained in the Data property either with it's associated executable or with the specified program if also included in the the Data property.
Public method | Run(Boolean) | Runs the document file contained in the Data property either with it's associated executable or with the specified program if also included in the the Data property. This call will block if the wait flag is set.
Public method | Run(Int32) | Runs the document file contained in the Data property either with it's associated executable or with the specified program if also included in the the Data property. This call will block according to the time out supplied. Time out values: -1 = no wait, 0 = wait until process terminates else wait until process terminates or the time out occures.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

AssociatedFile Class
Bncs.Execute Namespace


AssociatedFile.Run Method

AssociatedFileRun Method
Overload List
 | Name | Description
Public method | Run | Runs the document file contained in the Data property either with it's associated executable or with the specified program if also included in the the Data property.
Public method | Run(Boolean) | Runs the document file contained in the Data property either with it's associated executable or with the specified program if also included in the the Data property. This call will block if the wait flag is set.
Public method | Run(Int32) | Runs the document file contained in the Data property either with it's associated executable or with the specified program if also included in the the Data property. This call will block according to the time out supplied. Time out values: -1 = no wait, 0 = wait until process terminates else wait until process terminates or the time out occures.
Top
See Also

Reference

AssociatedFile Class
Bncs.Execute Namespace


AssociatedFile.Run Method

AssociatedFileRun Method
Runs the document file contained in the Data property either with it's associated executable or with the specified program if also included in the the Data property.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Run()

Return Value

Type: Boolean
True on success
See Also

Reference

AssociatedFile Class
Run Overload
Bncs.Execute Namespace


AssociatedFile.Run Method (Boolean)

AssociatedFileRun Method (Boolean)
Runs the document file contained in the Data property either with it's associated executable or with the specified program if also included in the the Data property. This call will block if the wait flag is set.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Run(
    bool wait_
)

Parameters

wait_
Type: SystemBoolean
Blocking flag

Return Value

Type: Boolean
True on success
See Also

Reference

AssociatedFile Class
Run Overload
Bncs.Execute Namespace


AssociatedFile.Run Method (Int32)

AssociatedFileRun Method (Int32)
Runs the document file contained in the Data property either with it's associated executable or with the specified program if also included in the the Data property. This call will block according to the time out supplied. Time out values: -1 = no wait, 0 = wait until process terminates else wait until process terminates or the time out occures.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Run(
    int timeout_
)

Parameters

timeout_
Type: SystemInt32
Time out in milliseconds.

Return Value

Type: Boolean
True on success
See Also

Reference

AssociatedFile Class
Run Overload
Bncs.Execute Namespace


AssociatedFile Properties

AssociatedFile Properties

The AssociatedFile type exposes the following members.

Properties
Name Description
Public property CanRun
Returns true if the document exists.
Data
Gets or sets the data string. This is a string containing the file path of the document you wish to execute. Optionally this may include the name of an executable to launch the document with delimited by a pipe (|).
Examples
Copy
MyAssociatedFileInstance.Data = "c:\\docs\\myfile.txt|c:\\windows.notepad.exe";
Public property Exists
Returns true if the document exists, if a program name is specified in the Data property then that must exist too to return a true.
Public property Filename
Gets the document name contained in the Data property.
Public property Program
Gets the program name (if included) contained in the Data property.
Top
See Also

Reference

AssociatedFile Class
Bncs.Execute Namespace


AssociatedFile.CanRun Property

AssociatedFileCanRun Property
Returns true if the document exists.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool CanRun { get; }

Property Value

Type: Boolean
See Also

Reference

AssociatedFile Class
Bncs.Execute Namespace


AssociatedFile.Data Property

AssociatedFileData Property
Gets or sets the data string. This is a string containing the file path of the document you wish to execute. Optionally this may include the name of an executable to launch the document with delimited by a pipe (|).
Examples
Copy
MyAssociatedFileInstance.Data = "c:\\docs\\myfile.txt|c:\\windows.notepad.exe";

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Data { get; set; }

Property Value

Type: String
See Also

Reference

AssociatedFile Class
Bncs.Execute Namespace


AssociatedFile.Exists Property

AssociatedFileExists Property
Returns true if the document exists, if a program name is specified in the Data property then that must exist too to return a true.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Exists { get; }

Property Value

Type: Boolean
See Also

Reference

AssociatedFile Class
Bncs.Execute Namespace


AssociatedFile.Filename Property

AssociatedFileFilename Property
Gets the document name contained in the Data property.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Filename { get; }

Property Value

Type: String
See Also

Reference

AssociatedFile Class
Bncs.Execute Namespace


AssociatedFile.Program Property

AssociatedFileProgram Property
Gets the program name (if included) contained in the Data property.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Program { get; }

Property Value

Type: String
See Also

Reference

AssociatedFile Class
Bncs.Execute Namespace


Execute Class

Execute Class
Static class for process handling and execution tasks including shell execution of a document file.
Inheritance Hierarchy
SystemObject
Bncs.ExecuteExecute

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static class Execute

The Execute type exposes the following members.

Methods
Name Description
Explore
Runs Explorer (explorer.exe) at the path provided.
FindAssociatedExe
Gets the path for the executable used to run the supplied file name or file name extension
GetFirstHandleByName
Gets the first window handle that matches the supplied process name.
GetFirstProcessByName
Gets the first process that matches the supplied process name.
GetProcessByName
Gets an array of processes that match the supplied name.
GetProcessRunningCount
Gets an instance count of running processes by the supplied process name
IsProcessRunning
Ascertains if the supplied process name is running
Run(String)
Runs the supplied executable file.
Examples
This code demonstrates the use of the Run(String) method.
Copy
class Program
{
    static void Main()
    {
        Execute.Run("c:\\windows\\notepad.exe");
    }
}
Run(String, Boolean)
Runs the supplied executable file, if the wait flag is set this call blocks until the process terminates.
Run(String, Int32)
Runs the supplied executable file and waits until termination or until the supplied time out has occured. Time out values: -1 = no wait, 0 = wait until process terminates else wait until process terminates or the time out occures.
Run(String, String)
Runs the supplied executable file with the supplied parameters.
Run(String, String, Boolean)
Runs the supplied executable file with the supplied parameters, if the wait flag is set this call blocks until the process terminates.
Run(String, String, Int32)
Runs the supplied executable file with the supplied parameters and waits until termination or until the supplied time out has occured. Time out values: -1 = no wait, 0 = wait until process terminates else wait until process terminates or the time out occures.
Run(String, String, Int32, Boolean)
Runs the supplied executable file with the supplied parameters and waits until termination or until the supplied time out has occured. If the admin flag is set the process runs as an administrator. Time out values: -1 = no wait, 0 = wait until process terminates else wait until process terminates or the time out occures.
RunAsAdministrator(String)
Runs the supplied executable with admin priviliges.
RunAsAdministrator(String, Int32)
Runs the supplied executable file as an admin. Time out values: -1 = no wait, 0 = wait until process terminates else wait until process terminates or the time out occures.
RunAsAdministrator(String, String)
Runs the supplied executable with admin priviliges using the arguments supplied.
RunAsAdministrator(String, String, Boolean)
Runs the supplied executable file as an admin with the supplied parameters, if the wait flag is set this call blocks until the process terminates.
RunAsAdministrator(String, String, Int32)
Runs the supplied executable file as an admin with the supplied parameters and waits until termination or until the supplied time out has occured. Time out values: -1 = no wait, 0 = wait until process terminates else wait until process terminates or the time out occures.
RunDOSCommand(String)
Runs the supplied command from the system terminal.
Examples
This code demonstrates the use of the RunDOSCommand(String) method.
Copy
class Program
{
    static void Main()
    {
        Execute.RunDOSCommand("dir c:\\ /S");
    }
}
RunDOSCommand(String, Boolean)
Runs the supplied command from the system terminal. If the wait flag is set the call blocks until the command has completed.
RunGetProcess(String, String, Int32, Boolean)
Runs the supplied executable file with the supplied parameters and waits until termination or until the supplied time out has occured. If the admin flag is set the process runs as an administrator. Time out values: -1 = no wait, 0 = wait until process terminates else wait until process terminates or the time out occures.
RunGetProcess(String, String, Int32, Boolean, Boolean)
If the execute flag is set then it runs the supplied executable file with the supplied parameters and waits until termination or until the supplied time out has occured. If the admin flag is set the process runs as an administrator. If the execute flag is not set then the process is created but not launched. Time out values: -1 = no wait, 0 = wait until process terminates else wait until process terminates or the time out occures.
ShellExecute(String)
Shell executes the file at the supplied location.
Examples
This code demonstrates the use of the ShellExecute(String) method.
Copy
class Program
{
    static void Main()
    {
        Execute.ShellExecute("c:\\bncs_config.ini");
    }
}
///
ShellExecute(String, ShellExVerb)
Shell executes the file at the supplied location with the supplied verb.
ShellExecute(String, ShellExVerb, Process)
Shell executes the file at the supplied location with the supplied verb.
ShellExecuteEx
ShellExecuteEx import.
ShellExecuteProcess
Shell executes the file at the supplied location with the supplied verb.
ShellExecuteWait(String)
Shell executes the supplied file name and waits.
ShellExecuteWait(String, Int32)
Shell executes the supplied file name and waits until termination or until the supplied time out has occured. Time out values: -1 = no wait, 0 = wait until process terminates else wait until process terminates or the time out occures.
Top
See Also

Reference

Bncs.Execute Namespace


Execute Methods

Execute Methods

The Execute type exposes the following members.

Methods
Name Description
Explore
Runs Explorer (explorer.exe) at the path provided.
FindAssociatedExe
Gets the path for the executable used to run the supplied file name or file name extension
GetFirstHandleByName
Gets the first window handle that matches the supplied process name.
GetFirstProcessByName
Gets the first process that matches the supplied process name.
GetProcessByName
Gets an array of processes that match the supplied name.
GetProcessRunningCount
Gets an instance count of running processes by the supplied process name
IsProcessRunning
Ascertains if the supplied process name is running
Run(String)
Runs the supplied executable file.
Examples
This code demonstrates the use of the Run(String) method.
Copy
class Program
{
    static void Main()
    {
        Execute.Run("c:\\windows\\notepad.exe");
    }
}
Run(String, Boolean)
Runs the supplied executable file, if the wait flag is set this call blocks until the process terminates.
Run(String, Int32)
Runs the supplied executable file and waits until termination or until the supplied time out has occured. Time out values: -1 = no wait, 0 = wait until process terminates else wait until process terminates or the time out occures.
Run(String, String)
Runs the supplied executable file with the supplied parameters.
Run(String, String, Boolean)
Runs the supplied executable file with the supplied parameters, if the wait flag is set this call blocks until the process terminates.
Run(String, String, Int32)
Runs the supplied executable file with the supplied parameters and waits until termination or until the supplied time out has occured. Time out values: -1 = no wait, 0 = wait until process terminates else wait until process terminates or the time out occures.
Run(String, String, Int32, Boolean)
Runs the supplied executable file with the supplied parameters and waits until termination or until the supplied time out has occured. If the admin flag is set the process runs as an administrator. Time out values: -1 = no wait, 0 = wait until process terminates else wait until process terminates or the time out occures.
RunAsAdministrator(String)
Runs the supplied executable with admin priviliges.
RunAsAdministrator(String, Int32)
Runs the supplied executable file as an admin. Time out values: -1 = no wait, 0 = wait until process terminates else wait until process terminates or the time out occures.
RunAsAdministrator(String, String)
Runs the supplied executable with admin priviliges using the arguments supplied.
RunAsAdministrator(String, String, Boolean)
Runs the supplied executable file as an admin with the supplied parameters, if the wait flag is set this call blocks until the process terminates.
RunAsAdministrator(String, String, Int32)
Runs the supplied executable file as an admin with the supplied parameters and waits until termination or until the supplied time out has occured. Time out values: -1 = no wait, 0 = wait until process terminates else wait until process terminates or the time out occures.
RunDOSCommand(String)
Runs the supplied command from the system terminal.
Examples
This code demonstrates the use of the RunDOSCommand(String) method.
Copy
class Program
{
    static void Main()
    {
        Execute.RunDOSCommand("dir c:\\ /S");
    }
}
RunDOSCommand(String, Boolean)
Runs the supplied command from the system terminal. If the wait flag is set the call blocks until the command has completed.
RunGetProcess(String, String, Int32, Boolean)
Runs the supplied executable file with the supplied parameters and waits until termination or until the supplied time out has occured. If the admin flag is set the process runs as an administrator. Time out values: -1 = no wait, 0 = wait until process terminates else wait until process terminates or the time out occures.
RunGetProcess(String, String, Int32, Boolean, Boolean)
If the execute flag is set then it runs the supplied executable file with the supplied parameters and waits until termination or until the supplied time out has occured. If the admin flag is set the process runs as an administrator. If the execute flag is not set then the process is created but not launched. Time out values: -1 = no wait, 0 = wait until process terminates else wait until process terminates or the time out occures.
ShellExecute(String)
Shell executes the file at the supplied location.
Examples
This code demonstrates the use of the ShellExecute(String) method.
Copy
class Program
{
    static void Main()
    {
        Execute.ShellExecute("c:\\bncs_config.ini");
    }
}
///
ShellExecute(String, ShellExVerb)
Shell executes the file at the supplied location with the supplied verb.
ShellExecute(String, ShellExVerb, Process)
Shell executes the file at the supplied location with the supplied verb.
ShellExecuteEx
ShellExecuteEx import.
ShellExecuteProcess
Shell executes the file at the supplied location with the supplied verb.
ShellExecuteWait(String)
Shell executes the supplied file name and waits.
ShellExecuteWait(String, Int32)
Shell executes the supplied file name and waits until termination or until the supplied time out has occured. Time out values: -1 = no wait, 0 = wait until process terminates else wait until process terminates or the time out occures.
Top
See Also

Reference

Execute Class
Bncs.Execute Namespace


Execute.Explore Method

ExecuteExplore Method
Runs Explorer (explorer.exe) at the path provided.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Explore(
    string directoryPath_
)

Parameters

directoryPath_
Type: SystemString
Path to open in

Return Value

Type: Boolean
True on success.
See Also

Reference

Execute Class
Bncs.Execute Namespace


Execute.FindAssociatedExe Method

ExecuteFindAssociatedExe Method
Gets the path for the executable used to run the supplied file name or file name extension

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string FindAssociatedExe(
    string filename_
)

Parameters

filename_
Type: SystemString
Full path of an existing file or a file name extension

Return Value

Type: String
The path for the associated executable or an empty string if the executable cannot be established
See Also

Reference

Execute Class
Bncs.Execute Namespace


Execute.GetFirstHandleByName Method

ExecuteGetFirstHandleByName Method
Gets the first window handle that matches the supplied process name.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static IntPtr GetFirstHandleByName(
    string processName_
)

Parameters

processName_
Type: SystemString
Name of process to get

Return Value

Type: IntPtr
The main window handle of the first process matching the supplied name or IntPtr.Zero.
See Also

Reference

Execute Class
Bncs.Execute Namespace


Execute.GetFirstProcessByName Method

ExecuteGetFirstProcessByName Method
Gets the first process that matches the supplied process name.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static Process GetFirstProcessByName(
    string processName_
)

Parameters

processName_
Type: SystemString
Name of process to get

Return Value

Type: Process
The first process matching the supplied name or NULL.
See Also

Reference

Execute Class
Bncs.Execute Namespace


Execute.GetProcessByName Method

ExecuteGetProcessByName Method
Gets an array of processes that match the supplied name.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static Process[] GetProcessByName(
    string processName_
)

Parameters

processName_
Type: SystemString
Name of process to get

Return Value

Type: Process
An array of processes matching the supplied name or NULL.
See Also

Reference

Execute Class
Bncs.Execute Namespace


Execute.GetProcessRunningCount Method

ExecuteGetProcessRunningCount Method
Gets an instance count of running processes by the supplied process name

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static int GetProcessRunningCount(
    string processName_
)

Parameters

processName_
Type: SystemString
Name of process to count

Return Value

Type: Int32
The number of processes running by the supplied name
See Also

Reference

Execute Class
Bncs.Execute Namespace


Execute.IsProcessRunning Method

ExecuteIsProcessRunning Method
Ascertains if the supplied process name is running

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool IsProcessRunning(
    string processName_
)

Parameters

processName_
Type: SystemString
Name of process to querey

Return Value

Type: Boolean
True if the process is running
See Also

Reference

Execute Class
Bncs.Execute Namespace


Execute.Run Method

ExecuteRun Method
Overload List
Name Description
Run(String)
Runs the supplied executable file.
Examples
This code demonstrates the use of the Run(String) method.
Copy
class Program
{
    static void Main()
    {
        Execute.Run("c:\\windows\\notepad.exe");
    }
}
Run(String, Boolean)
Runs the supplied executable file, if the wait flag is set this call blocks until the process terminates.
Run(String, Int32)
Runs the supplied executable file and waits until termination or until the supplied time out has occured. Time out values: -1 = no wait, 0 = wait until process terminates else wait until process terminates or the time out occures.
Run(String, String)
Runs the supplied executable file with the supplied parameters.
Run(String, String, Boolean)
Runs the supplied executable file with the supplied parameters, if the wait flag is set this call blocks until the process terminates.
Run(String, String, Int32)
Runs the supplied executable file with the supplied parameters and waits until termination or until the supplied time out has occured. Time out values: -1 = no wait, 0 = wait until process terminates else wait until process terminates or the time out occures.
Run(String, String, Int32, Boolean)
Runs the supplied executable file with the supplied parameters and waits until termination or until the supplied time out has occured. If the admin flag is set the process runs as an administrator. Time out values: -1 = no wait, 0 = wait until process terminates else wait until process terminates or the time out occures.
Top
See Also

Reference

Execute Class
Bncs.Execute Namespace


Execute.Run Method (String)

ExecuteRun Method (String)
Runs the supplied executable file.
Examples
This code demonstrates the use of the Run(String) method.
Copy
class Program
{
    static void Main()
    {
        Execute.Run("c:\\windows\\notepad.exe");
    }
}

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Run(
    string applicationPath_
)

Parameters

applicationPath_
Type: SystemString
Exe file to run.

Return Value

Type: Boolean
True on success.
See Also

Reference

Execute Class
Run Overload
Bncs.Execute Namespace


Execute.Run Method (String, Boolean)

ExecuteRun Method (String, Boolean)
Runs the supplied executable file, if the wait flag is set this call blocks until the process terminates.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Run(
    string applicationPath_,
    bool wait_
)

Parameters

applicationPath_
Type: SystemString
Exe file to run.
wait_
Type: SystemBoolean
Wait flag

Return Value

Type: Boolean
True on success.
See Also

Reference

Execute Class
Run Overload
Bncs.Execute Namespace


Execute.Run Method (String, Int32)

ExecuteRun Method (String, Int32)
Runs the supplied executable file and waits until termination or until the supplied time out has occured. Time out values: -1 = no wait, 0 = wait until process terminates else wait until process terminates or the time out occures.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Run(
    string applicationPath_,
    int timeout_
)

Parameters

applicationPath_
Type: SystemString
Exe file to run.
timeout_
Type: SystemInt32
Time out in milliseconds.

Return Value

Type: Boolean
True on success
See Also

Reference

Execute Class
Run Overload
Bncs.Execute Namespace


Execute.Run Method (String, String)

ExecuteRun Method (String, String)
Runs the supplied executable file with the supplied parameters.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Run(
    string applicationPath_,
    string parameters_
)

Parameters

applicationPath_
Type: SystemString
Exe file to run.
parameters_
Type: SystemString
Parameters to pass to new process.

Return Value

Type: Boolean
True on success.
See Also

Reference

Execute Class
Run Overload
Bncs.Execute Namespace


Execute.Run Method (String, String, Boolean)

ExecuteRun Method (String, String, Boolean)
Runs the supplied executable file with the supplied parameters, if the wait flag is set this call blocks until the process terminates.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Run(
    string applicationPath_,
    string parameters_,
    bool wait_
)

Parameters

applicationPath_
Type: SystemString
Exe file to run.
parameters_
Type: SystemString
Parameters to pass to new process.
wait_
Type: SystemBoolean
Wait flag

Return Value

Type: Boolean
True on success.
See Also

Reference

Execute Class
Run Overload
Bncs.Execute Namespace


Execute.Run Method (String, String, Int32)

ExecuteRun Method (String, String, Int32)
Runs the supplied executable file with the supplied parameters and waits until termination or until the supplied time out has occured. Time out values: -1 = no wait, 0 = wait until process terminates else wait until process terminates or the time out occures.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Run(
    string applicationPath_,
    string parameters_,
    int timeout_
)

Parameters

applicationPath_
Type: SystemString
Exe file to run.
parameters_
Type: SystemString
Parameters to pass to new process.
timeout_
Type: SystemInt32
Time out in milliseconds

Return Value

Type: Boolean
True on success.
See Also

Reference

Execute Class
Run Overload
Bncs.Execute Namespace


Execute.Run Method (String, String, Int32, Boolean)

ExecuteRun Method (String, String, Int32, Boolean)
Runs the supplied executable file with the supplied parameters and waits until termination or until the supplied time out has occured. If the admin flag is set the process runs as an administrator. Time out values: -1 = no wait, 0 = wait until process terminates else wait until process terminates or the time out occures.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Run(
    string applicationPath_,
    string parameters_,
    int timeout_,
    bool runAsAdmin_
)

Parameters

applicationPath_
Type: SystemString
Exe file to run.
parameters_
Type: SystemString
Parameters to pass to new process.
timeout_
Type: SystemInt32
Time out in milliseconds
runAsAdmin_
Type: SystemBoolean
Admin flag

Return Value

Type: Boolean
True on success.
See Also

Reference

Execute Class
Run Overload
Bncs.Execute Namespace


Execute.RunAsAdministrator Method

ExecuteRunAsAdministrator Method
Overload List
Name | Description
RunAsAdministrator(String) | Runs the supplied executable with admin priviliges.
RunAsAdministrator(String, Int32) | Runs the supplied executable file as an admin. Time out values: -1 = no wait, 0 = wait until process terminates else wait until process terminates or the time out occures.
RunAsAdministrator(String, String) | Runs the supplied executable with admin priviliges using the arguments supplied.
RunAsAdministrator(String, String, Boolean) | Runs the supplied executable file as an admin with the supplied parameters, if the wait flag is set this call blocks until the process terminates.
RunAsAdministrator(String, String, Int32) | Runs the supplied executable file as an admin with the supplied parameters and waits until termination or until the supplied time out has occured. Time out values: -1 = no wait, 0 = wait until process terminates else wait until process terminates or the time out occures.
Top
See Also

Reference

Execute Class
Bncs.Execute Namespace


Execute.RunAsAdministrator Method (String)

ExecuteRunAsAdministrator Method (String)
Runs the supplied executable with admin priviliges.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool RunAsAdministrator(
    string applicationPath_
)

Parameters

applicationPath_
Type: SystemString
Exe file to run

Return Value

Type: Boolean
True on success
See Also

Reference

Execute Class
RunAsAdministrator Overload
Bncs.Execute Namespace


Execute.RunAsAdministrator Method (String, Int32)

ExecuteRunAsAdministrator Method (String, Int32)
Runs the supplied executable file as an admin. Time out values: -1 = no wait, 0 = wait until process terminates else wait until process terminates or the time out occures.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool RunAsAdministrator(
    string applicationPath_,
    int timeout_
)

Parameters

applicationPath_
Type: SystemString
Exe file to run.
timeout_
Type: SystemInt32
Time out in milliseconds

Return Value

Type: Boolean
True on success.
See Also

Reference

Execute Class
RunAsAdministrator Overload
Bncs.Execute Namespace


Execute.RunAsAdministrator Method (String, String)

ExecuteRunAsAdministrator Method (String, String)
Runs the supplied executable with admin priviliges using the arguments supplied.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool RunAsAdministrator(
    string applicationPath_,
    string parameters_
)

Parameters

applicationPath_
Type: SystemString
Exe file to run
parameters_
Type: SystemString
Parameters

Return Value

Type: Boolean
True on success
See Also

Reference

Execute Class
RunAsAdministrator Overload
Bncs.Execute Namespace


Execute.RunAsAdministrator Method (String, String, Boolean)

ExecuteRunAsAdministrator Method (String, String, Boolean)
Runs the supplied executable file as an admin with the supplied parameters, if the wait flag is set this call blocks until the process terminates.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool RunAsAdministrator(
    string applicationPath_,
    string parameters_,
    bool wait_
)

Parameters

applicationPath_
Type: SystemString
Exe file to run.
parameters_
Type: SystemString
Parameters to pass to new process.
wait_
Type: SystemBoolean
Wait flag

Return Value

Type: Boolean
True on success.
See Also

Reference

Execute Class
RunAsAdministrator Overload
Bncs.Execute Namespace


Execute.RunAsAdministrator Method (String, String, Int32)

ExecuteRunAsAdministrator Method (String, String, Int32)
Runs the supplied executable file as an admin with the supplied parameters and waits until termination or until the supplied time out has occured. Time out values: -1 = no wait, 0 = wait until process terminates else wait until process terminates or the time out occures.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool RunAsAdministrator(
    string applicationPath_,
    string parameters_,
    int timeout_
)

Parameters

applicationPath_
Type: SystemString
Exe file to run.
parameters_
Type: SystemString
Parameters to pass to new process.
timeout_
Type: SystemInt32
Time out in milliseconds

Return Value

Type: Boolean
True on success.
See Also

Reference

Execute Class
RunAsAdministrator Overload
Bncs.Execute Namespace


Execute.RunDOSCommand Method

ExecuteRunDOSCommand Method
Overload List
Name Description
RunDOSCommand(String)
Runs the supplied command from the system terminal.
Examples
This code demonstrates the use of the RunDOSCommand(String) method.
Copy
class Program
{
    static void Main()
    {
        Execute.RunDOSCommand("dir c:\\ /S");
    }
}
RunDOSCommand(String, Boolean)
Runs the supplied command from the system terminal. If the wait flag is set the call blocks until the command has completed.
Top
See Also

Reference

Execute Class
Bncs.Execute Namespace


Execute.RunDOSCommand Method (String)

ExecuteRunDOSCommand Method (String)
Runs the supplied command from the system terminal.
Examples
This code demonstrates the use of the RunDOSCommand(String) method.
Copy
class Program
{
    static void Main()
    {
        Execute.RunDOSCommand("dir c:\\ /S");
    }
}

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool RunDOSCommand(
    string command_
)

Parameters

command_
Type: SystemString
Comman to run

Return Value

Type: Boolean
True on success
See Also

Reference

Execute Class
RunDOSCommand Overload
Bncs.Execute Namespace


Execute.RunDOSCommand Method (String, Boolean)

ExecuteRunDOSCommand Method (String, Boolean)
Runs the supplied command from the system terminal. If the wait flag is set the call blocks until the command has completed.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool RunDOSCommand(
    string command_,
    bool wait_
)

Parameters

command_
Type: SystemString
Comman to run
wait_
Type: SystemBoolean
Wait flag

Return Value

Type: Boolean
True on success
See Also

Reference

Execute Class
RunDOSCommand Overload
Bncs.Execute Namespace


Execute.RunGetProcess Method

ExecuteRunGetProcess Method
Overload List
Name | Description
RunGetProcess(String, String, Int32, Boolean) | Runs the supplied executable file with the supplied parameters and waits until termination or until the supplied time out has occured. If the admin flag is set the process runs as an administrator. Time out values: -1 = no wait, 0 = wait until process terminates else wait until process terminates or the time out occures.
RunGetProcess(String, String, Int32, Boolean, Boolean) | If the execute flag is set then it runs the supplied executable file with the supplied parameters and waits until termination or until the supplied time out has occured. If the admin flag is set the process runs as an administrator. If the execute flag is not set then the process is created but not launched. Time out values: -1 = no wait, 0 = wait until process terminates else wait until process terminates or the time out occures.
Top
See Also

Reference

Execute Class
Bncs.Execute Namespace


Execute.RunGetProcess Method (String, String, Int32, Boolean)

ExecuteRunGetProcess Method (String, String, Int32, Boolean)
Runs the supplied executable file with the supplied parameters and waits until termination or until the supplied time out has occured. If the admin flag is set the process runs as an administrator. Time out values: -1 = no wait, 0 = wait until process terminates else wait until process terminates or the time out occures.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static Process RunGetProcess(
    string applicationPath_,
    string parameters_,
    int timeout_,
    bool runAsAdmin_
)

Parameters

applicationPath_
Type: SystemString
Exe file to run.
parameters_
Type: SystemString
Parameters to pass to new process.
timeout_
Type: SystemInt32
Time out in milliseconds
runAsAdmin_
Type: SystemBoolean
Admin flag

Return Value

Type: Process
The process or NULL on failure.
See Also

Reference

Execute Class
RunGetProcess Overload
Bncs.Execute Namespace


Execute.RunGetProcess Method (String, String, Int32, Boolean, Boolean)

ExecuteRunGetProcess Method (String, String, Int32, Boolean, Boolean)
If the execute flag is set then it runs the supplied executable file with the supplied parameters and waits until termination or until the supplied time out has occured. If the admin flag is set the process runs as an administrator. If the execute flag is not set then the process is created but not launched. Time out values: -1 = no wait, 0 = wait until process terminates else wait until process terminates or the time out occures.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static Process RunGetProcess(
    string applicationPath_,
    string parameters_,
    int timeout_,
    bool runAsAdmin_,
    bool execute_
)

Parameters

applicationPath_
Type: SystemString
Exe file to run.
parameters_
Type: SystemString
Parameters to pass to new process.
timeout_
Type: SystemInt32
Time out in milliseconds
runAsAdmin_
Type: SystemBoolean
Admin flag
execute_
Type: SystemBoolean
Execute flag

Return Value

Type: Process
The process or NULL on failure.
See Also

Reference

Execute Class
RunGetProcess Overload
Bncs.Execute Namespace


Execute.ShellExecute Method

ExecuteShellExecute Method
Overload List
Name Description
ShellExecute(String)
Shell executes the file at the supplied location.
Examples
This code demonstrates the use of the ShellExecute(String) method.
Copy
class Program
{
    static void Main()
    {
        Execute.ShellExecute("c:\\bncs_config.ini");
    }
}
///
ShellExecute(String, ShellExVerb)
Shell executes the file at the supplied location with the supplied verb.
ShellExecute(String, ShellExVerb, Process)
Shell executes the file at the supplied location with the supplied verb.
Top
See Also

Reference

Execute Class
Bncs.Execute Namespace


Execute.ShellExecute Method (String)

ExecuteShellExecute Method (String)
Shell executes the file at the supplied location.
Examples
This code demonstrates the use of the ShellExecute(String) method.
Copy
class Program
{
    static void Main()
    {
        Execute.ShellExecute("c:\\bncs_config.ini");
    }
}
///

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool ShellExecute(
    string filepath_
)

Parameters

filepath_
Type: SystemString
File to shellex

Return Value

Type: Boolean
True on success
See Also

Reference

Execute Class
ShellExecute Overload
Bncs.Execute Namespace


Execute.ShellExecute Method (String, ShellExVerb)

ExecuteShellExecute Method (String, ShellExVerb)
Shell executes the file at the supplied location with the supplied verb.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool ShellExecute(
    string filepath_,
    ShellExVerb verb_
)

Parameters

filepath_
Type: SystemString
File to shellex
verb_
Type: Bncs.ExecuteShellExVerb
Verb to use.

Return Value

Type: Boolean
True on success
See Also

Reference

Execute Class
ShellExecute Overload
Bncs.Execute Namespace


Execute.ShellExecute Method (String, ShellExVerb, Process)

ExecuteShellExecute Method (String, ShellExVerb, Process)
Shell executes the file at the supplied location with the supplied verb.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool ShellExecute(
    string filepath_,
    ShellExVerb verb_,
    out Process process_
)

Parameters

filepath_
Type: SystemString
File to shellex
verb_
Type: Bncs.ExecuteShellExVerb
Verb to use.
process_
Type: System.DiagnosticsProcess
Returns the process

Return Value

Type: Boolean
True on success
See Also

Reference

Execute Class
ShellExecute Overload
Bncs.Execute Namespace


Execute.ShellExecuteEx Method

ExecuteShellExecuteEx Method
ShellExecuteEx import.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static int ShellExecuteEx(
    ExecuteSHELLEXECUTEINFO lpExecInfo
)

Parameters

lpExecInfo
Type: Bncs.ExecuteExecuteSHELLEXECUTEINFO
Execution information

Return Value

Type: Int32
Integer
See Also

Reference

Execute Class
Bncs.Execute Namespace


Execute.ShellExecuteProcess Method

ExecuteShellExecuteProcess Method
Shell executes the file at the supplied location with the supplied verb.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static Process ShellExecuteProcess(
    string filepath_,
    ShellExVerb verb_
)

Parameters

filepath_
Type: SystemString
File to shellex
verb_
Type: Bncs.ExecuteShellExVerb
Verb to use.

Return Value

Type: Process
The process on success else NULL.
See Also

Reference

Execute Class
Bncs.Execute Namespace


Execute.ShellExecuteWait Method

ExecuteShellExecuteWait Method
Overload List
Name | Description
ShellExecuteWait(String) | Shell executes the supplied file name and waits.
ShellExecuteWait(String, Int32) | Shell executes the supplied file name and waits until termination or until the supplied time out has occured. Time out values: -1 = no wait, 0 = wait until process terminates else wait until process terminates or the time out occures.
Top
See Also

Reference

Execute Class
Bncs.Execute Namespace


Execute.ShellExecuteWait Method (String)

ExecuteShellExecuteWait Method (String)
Shell executes the supplied file name and waits.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool ShellExecuteWait(
    string filePath_
)

Parameters

filePath_
Type: SystemString
File to shell ex.

Return Value

Type: Boolean
When the operation has terminated, returns true on success
See Also

Reference

Execute Class
ShellExecuteWait Overload
Bncs.Execute Namespace


Execute.ShellExecuteWait Method (String, Int32)

ExecuteShellExecuteWait Method (String, Int32)
Shell executes the supplied file name and waits until termination or until the supplied time out has occured. Time out values: -1 = no wait, 0 = wait until process terminates else wait until process terminates or the time out occures.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool ShellExecuteWait(
    string filePath_,
    int timeout_
)

Parameters

filePath_
Type: SystemString
File to shell ex.
timeout_
Type: SystemInt32
Time out in milliseconds.

Return Value

Type: Boolean
True on success
See Also

Reference

Execute Class
ShellExecuteWait Overload
Bncs.Execute Namespace


Execute.SHELLEXECUTEINFO Class

ExecuteSHELLEXECUTEINFO Class
Shell execute information structure.
Inheritance Hierarchy
SystemObject
Bncs.ExecuteExecuteSHELLEXECUTEINFO

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class SHELLEXECUTEINFO

The ExecuteSHELLEXECUTEINFO type exposes the following members.

Constructors
 | Name | Description
Public method | ExecuteSHELLEXECUTEINFO | Initializes a new instance of the ExecuteSHELLEXECUTEINFO class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | cbSize | Size
Public field | dwHotKey | Hot key
Public field | fMask | Mask
Public field | hIcon | Icon handle
Public field | hInstApp | Instance handle
Public field | hkeyClass | Registry hive key
Public field | hProcess | Process handle
Public field | hwnd | Window
Public field | lpClass | Class name
Public field | lpDirectory | Directory
Public field | lpFile | File name
Public field | lpIDList | ID list
Public field | lpParameters | Parameters
Public field | lpVerb | Action verb
Public field | nShow | Show level
Top
See Also

Reference

Bncs.Execute Namespace


Execute.SHELLEXECUTEINFO Constructor

ExecuteSHELLEXECUTEINFO Constructor
Initializes a new instance of the ExecuteSHELLEXECUTEINFO class

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public SHELLEXECUTEINFO()
See Also

Reference

ExecuteSHELLEXECUTEINFO Class
Bncs.Execute Namespace


SHELLEXECUTEINFO Fields

SHELLEXECUTEINFO Fields

The ExecuteSHELLEXECUTEINFO type exposes the following members.

Fields
 | Name | Description
Public field | cbSize | Size
Public field | dwHotKey | Hot key
Public field | fMask | Mask
Public field | hIcon | Icon handle
Public field | hInstApp | Instance handle
Public field | hkeyClass | Registry hive key
Public field | hProcess | Process handle
Public field | hwnd | Window
Public field | lpClass | Class name
Public field | lpDirectory | Directory
Public field | lpFile | File name
Public field | lpIDList | ID list
Public field | lpParameters | Parameters
Public field | lpVerb | Action verb
Public field | nShow | Show level
Top
See Also

Reference

ExecuteSHELLEXECUTEINFO Class
Bncs.Execute Namespace


Execute.SHELLEXECUTEINFO.cbSize Field

ExecuteSHELLEXECUTEINFOcbSize Field
Size

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int cbSize

Field Value

Type: Int32
See Also

Reference

ExecuteSHELLEXECUTEINFO Class
Bncs.Execute Namespace


Execute.SHELLEXECUTEINFO.dwHotKey Field

ExecuteSHELLEXECUTEINFOdwHotKey Field
Hot key

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int dwHotKey

Field Value

Type: Int32
See Also

Reference

ExecuteSHELLEXECUTEINFO Class
Bncs.Execute Namespace


Execute.SHELLEXECUTEINFO.fMask Field

ExecuteSHELLEXECUTEINFOfMask Field
Mask

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int fMask

Field Value

Type: Int32
See Also

Reference

ExecuteSHELLEXECUTEINFO Class
Bncs.Execute Namespace


Execute.SHELLEXECUTEINFO.hIcon Field

ExecuteSHELLEXECUTEINFOhIcon Field
Icon handle

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int hIcon

Field Value

Type: Int32
See Also

Reference

ExecuteSHELLEXECUTEINFO Class
Bncs.Execute Namespace


Execute.SHELLEXECUTEINFO.hInstApp Field

ExecuteSHELLEXECUTEINFOhInstApp Field
Instance handle

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int hInstApp

Field Value

Type: Int32
See Also

Reference

ExecuteSHELLEXECUTEINFO Class
Bncs.Execute Namespace


Execute.SHELLEXECUTEINFO.hkeyClass Field

ExecuteSHELLEXECUTEINFOhkeyClass Field
Registry hive key

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int hkeyClass

Field Value

Type: Int32
See Also

Reference

ExecuteSHELLEXECUTEINFO Class
Bncs.Execute Namespace


Execute.SHELLEXECUTEINFO.hProcess Field

ExecuteSHELLEXECUTEINFOhProcess Field
Process handle

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int hProcess

Field Value

Type: Int32
See Also

Reference

ExecuteSHELLEXECUTEINFO Class
Bncs.Execute Namespace


Execute.SHELLEXECUTEINFO.hwnd Field

ExecuteSHELLEXECUTEINFOhwnd Field
Window

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int hwnd

Field Value

Type: Int32
See Also

Reference

ExecuteSHELLEXECUTEINFO Class
Bncs.Execute Namespace


Execute.SHELLEXECUTEINFO.lpClass Field

ExecuteSHELLEXECUTEINFOlpClass Field
Class name

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string lpClass

Field Value

Type: String
See Also

Reference

ExecuteSHELLEXECUTEINFO Class
Bncs.Execute Namespace


Execute.SHELLEXECUTEINFO.lpDirectory Field

ExecuteSHELLEXECUTEINFOlpDirectory Field
Directory

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string lpDirectory

Field Value

Type: String
See Also

Reference

ExecuteSHELLEXECUTEINFO Class
Bncs.Execute Namespace


Execute.SHELLEXECUTEINFO.lpFile Field

ExecuteSHELLEXECUTEINFOlpFile Field
File name

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string lpFile

Field Value

Type: String
See Also

Reference

ExecuteSHELLEXECUTEINFO Class
Bncs.Execute Namespace


Execute.SHELLEXECUTEINFO.lpIDList Field

ExecuteSHELLEXECUTEINFOlpIDList Field
ID list

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int lpIDList

Field Value

Type: Int32
See Also

Reference

ExecuteSHELLEXECUTEINFO Class
Bncs.Execute Namespace


Execute.SHELLEXECUTEINFO.lpParameters Field

ExecuteSHELLEXECUTEINFOlpParameters Field
Parameters

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string lpParameters

Field Value

Type: String
See Also

Reference

ExecuteSHELLEXECUTEINFO Class
Bncs.Execute Namespace


Execute.SHELLEXECUTEINFO.lpVerb Field

ExecuteSHELLEXECUTEINFOlpVerb Field
Action verb

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string lpVerb

Field Value

Type: String
See Also

Reference

ExecuteSHELLEXECUTEINFO Class
Bncs.Execute Namespace


Execute.SHELLEXECUTEINFO.nShow Field

ExecuteSHELLEXECUTEINFOnShow Field
Show level

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int nShow

Field Value

Type: Int32
See Also

Reference

ExecuteSHELLEXECUTEINFO Class
Bncs.Execute Namespace


SHELLEXECUTEINFO Methods

SHELLEXECUTEINFO Methods

The ExecuteSHELLEXECUTEINFO type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

ExecuteSHELLEXECUTEINFO Class
Bncs.Execute Namespace


ExecuteMonitor Class

ExecuteMonitor Class
A class that executes and monitors a process and alerts on termination.
Inheritance Hierarchy
SystemObject
Bncs.ExecuteExecuteMonitor

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class ExecuteMonitor

The ExecuteMonitor type exposes the following members.

Constructors
Name Description
Public method ExecuteMonitor(Process)
Constructor accepting an existing process.
ExecuteMonitor(String)
Constructor accepting a fully qualified file name or the name of a running process to monitor.
Examples
This code demonstrates use of the ExecuteMonitor class and the GetFirstProcessByName(String) method.
Copy
class Program
{
    static bool _notepadRunning = false;

    static void Main()
    {
        Process process = Execute.GetFirstProcessByName("notepad");
        if (null != process)
        {
            _notepadRunning = true;
            ExecuteMonitor monitor = new ExecuteMonitor("notepad");
            monitor.OnExit += monitor_OnExit;
            while (_notepadRunning)
            {
                Console.WriteLine("Waiting for Notepad to terminate");
            }
            Console.WriteLine("Notepad process has terminated.");
        }
        else
            Console.WriteLine("No process named \"notepad\" is running.");

        Console.ReadKey();
    }

    static void monitor_OnExit(object sender, EventArgs e)
    {
        _notepadRunning = false;
    }
}
Public method ExecuteMonitor(String, String)
Constructor accepting a fully qualified file name and optional parameters.
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Run | Runs the process if it is not running and starts monitoring the process providing OnExit is assigned.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | ApplicationPath | Gets the application path to the running process.
Public property | IsRunning | Returns true if the process is running.
Public property | Parameters | Gets or sets the start up parameters of the process.
Public property | Process | Gets the process.
Top
Events
 | Name | Description
Public event | OnExit | Event that fires when the monitored process terminates. When dealing with process names (as opposed to executable file paths) the event handler should be assigned after the process has been assigned.
Top
See Also

Reference

Bncs.Execute Namespace


ExecuteMonitor Constructor

ExecuteMonitor Constructor
Overload List
Name Description
Public method ExecuteMonitor(Process)
Constructor accepting an existing process.
ExecuteMonitor(String)
Constructor accepting a fully qualified file name or the name of a running process to monitor.
Examples
This code demonstrates use of the ExecuteMonitor class and the GetFirstProcessByName(String) method.
Copy
class Program
{
    static bool _notepadRunning = false;

    static void Main()
    {
        Process process = Execute.GetFirstProcessByName("notepad");
        if (null != process)
        {
            _notepadRunning = true;
            ExecuteMonitor monitor = new ExecuteMonitor("notepad");
            monitor.OnExit += monitor_OnExit;
            while (_notepadRunning)
            {
                Console.WriteLine("Waiting for Notepad to terminate");
            }
            Console.WriteLine("Notepad process has terminated.");
        }
        else
            Console.WriteLine("No process named \"notepad\" is running.");

        Console.ReadKey();
    }

    static void monitor_OnExit(object sender, EventArgs e)
    {
        _notepadRunning = false;
    }
}
Public method ExecuteMonitor(String, String)
Constructor accepting a fully qualified file name and optional parameters.
Top
See Also

Reference

ExecuteMonitor Class
Bncs.Execute Namespace


ExecuteMonitor Constructor (Process)

ExecuteMonitor Constructor (Process)
Constructor accepting an existing process.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ExecuteMonitor(
    Process existingProcess_
)

Parameters

existingProcess_
Type: System.DiagnosticsProcess
Process to monitor
See Also

Reference

ExecuteMonitor Class
ExecuteMonitor Overload
Bncs.Execute Namespace


ExecuteMonitor Constructor (String)

ExecuteMonitor Constructor (String)
Constructor accepting a fully qualified file name or the name of a running process to monitor.
Examples
This code demonstrates use of the ExecuteMonitor class and the GetFirstProcessByName(String) method.
Copy
class Program
{
    static bool _notepadRunning = false;

    static void Main()
    {
        Process process = Execute.GetFirstProcessByName("notepad");
        if (null != process)
        {
            _notepadRunning = true;
            ExecuteMonitor monitor = new ExecuteMonitor("notepad");
            monitor.OnExit += monitor_OnExit;
            while (_notepadRunning)
            {
                Console.WriteLine("Waiting for Notepad to terminate");
            }
            Console.WriteLine("Notepad process has terminated.");
        }
        else
            Console.WriteLine("No process named \"notepad\" is running.");

        Console.ReadKey();
    }

    static void monitor_OnExit(object sender, EventArgs e)
    {
        _notepadRunning = false;
    }
}

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ExecuteMonitor(
    string applicationPathOrProcessName_
)

Parameters

applicationPathOrProcessName_
Type: SystemString
File or process name
See Also

Reference

ExecuteMonitor Class
ExecuteMonitor Overload
Bncs.Execute Namespace


ExecuteMonitor Constructor (String, String)

ExecuteMonitor Constructor (String, String)
Constructor accepting a fully qualified file name and optional parameters.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ExecuteMonitor(
    string applicationPath_,
    string parameters_
)

Parameters

applicationPath_
Type: SystemString
Executable to run and monitor
parameters_
Type: SystemString
Parameters
See Also

Reference

ExecuteMonitor Class
ExecuteMonitor Overload
Bncs.Execute Namespace


ExecuteMonitor Methods

ExecuteMonitor Methods

The ExecuteMonitor type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Run | Runs the process if it is not running and starts monitoring the process providing OnExit is assigned.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

ExecuteMonitor Class
Bncs.Execute Namespace


ExecuteMonitor.Run Method

ExecuteMonitorRun Method
Runs the process if it is not running and starts monitoring the process providing OnExit is assigned.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Run()

Return Value

Type: Boolean
True on success
See Also

Reference

ExecuteMonitor Class
Bncs.Execute Namespace


ExecuteMonitor Properties

ExecuteMonitor Properties

The ExecuteMonitor type exposes the following members.

Properties
 | Name | Description
Public property | ApplicationPath | Gets the application path to the running process.
Public property | IsRunning | Returns true if the process is running.
Public property | Parameters | Gets or sets the start up parameters of the process.
Public property | Process | Gets the process.
Top
See Also

Reference

ExecuteMonitor Class
Bncs.Execute Namespace


ExecuteMonitor.ApplicationPath Property

ExecuteMonitorApplicationPath Property
Gets the application path to the running process.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string ApplicationPath { get; }

Property Value

Type: String
See Also

Reference

ExecuteMonitor Class
Bncs.Execute Namespace


ExecuteMonitor.IsRunning Property

ExecuteMonitorIsRunning Property
Returns true if the process is running.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool IsRunning { get; }

Property Value

Type: Boolean
See Also

Reference

ExecuteMonitor Class
Bncs.Execute Namespace


ExecuteMonitor.Parameters Property

ExecuteMonitorParameters Property
Gets or sets the start up parameters of the process.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Parameters { get; set; }

Property Value

Type: String
See Also

Reference

ExecuteMonitor Class
Bncs.Execute Namespace


ExecuteMonitor.Process Property

ExecuteMonitorProcess Property
Gets the process.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Process Process { get; }

Property Value

Type: Process
See Also

Reference

ExecuteMonitor Class
Bncs.Execute Namespace


ExecuteMonitor Events

ExecuteMonitor Events

The ExecuteMonitor type exposes the following members.

Events
 | Name | Description
Public event | OnExit | Event that fires when the monitored process terminates. When dealing with process names (as opposed to executable file paths) the event handler should be assigned after the process has been assigned.
Top
See Also

Reference

ExecuteMonitor Class
Bncs.Execute Namespace


ExecuteMonitor.OnExit Event

ExecuteMonitorOnExit Event
Event that fires when the monitored process terminates. When dealing with process names (as opposed to executable file paths) the event handler should be assigned after the process has been assigned.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event EventHandler OnExit

Value

Type: SystemEventHandler
See Also

Reference

ExecuteMonitor Class
Bncs.Execute Namespace


ShellExVerb Enumeration

ShellExVerb Enumeration
Enumeration denoting the verb to use with shell execute operations

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum ShellExVerb
Members
Member name | Value | Description
edit | 0 | Open the document with it's default editor application.
explore | 1 | Display the document in Windows file Explorer.
find | 2 | Find the document.
open | 3 | Open the document with it's default application.
print | 4 | Print the document.
properties | 5 | Show the documents properties.
runas | 6 | Run the document as an Administrator.
See Also

Reference

Bncs.Execute Namespace


SingleApplicationInstance Class

SingleApplicationInstance Class
A class to ensure that only one instance of an application may be run.
Inheritance Hierarchy
SystemObject
Bncs.ExecuteSingleApplicationInstance

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static class SingleApplicationInstance

The SingleApplicationInstance type exposes the following members.

Methods
Name Description
Close
Closes and frees the mutex
IsOnlyInstance
Method that ascertains if an instance of this application is already running
Examples
This code demonstrates how to ensure only a single instance of your application may be run using the SingleApplicationInstance class.
Copy
class Program
{
    static void Main()
    {
        if (SingleApplicationInstance.IsOnlyInstance("6f2803c9-3694-4518-bf1b-c37c0929a844"))
        {
            Console.WriteLine("This is the first (and only instance)");
            Console.WriteLine("Try running another now...");
            Console.ReadKey();
            SingleApplicationInstance.Close();
        }
        else
        {
            Console.WriteLine("This program is already running!");
            Console.ReadKey();
        }
    }
}
Top
Properties
Name | Description
Mutex | Gets the mutex.
Top
See Also

Reference

Bncs.Execute Namespace


SingleApplicationInstance Methods

SingleApplicationInstance Methods

The SingleApplicationInstance type exposes the following members.

Methods
Name Description
Close
Closes and frees the mutex
IsOnlyInstance
Method that ascertains if an instance of this application is already running
Examples
This code demonstrates how to ensure only a single instance of your application may be run using the SingleApplicationInstance class.
Copy
class Program
{
    static void Main()
    {
        if (SingleApplicationInstance.IsOnlyInstance("6f2803c9-3694-4518-bf1b-c37c0929a844"))
        {
            Console.WriteLine("This is the first (and only instance)");
            Console.WriteLine("Try running another now...");
            Console.ReadKey();
            SingleApplicationInstance.Close();
        }
        else
        {
            Console.WriteLine("This program is already running!");
            Console.ReadKey();
        }
    }
}
Top
See Also

Reference

SingleApplicationInstance Class
Bncs.Execute Namespace


SingleApplicationInstance.Close Method

SingleApplicationInstanceClose Method
Closes and frees the mutex

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static void Close()
See Also

Reference

SingleApplicationInstance Class
Bncs.Execute Namespace


SingleApplicationInstance.IsOnlyInstance Method

SingleApplicationInstanceIsOnlyInstance Method
Method that ascertains if an instance of this application is already running
Examples
This code demonstrates how to ensure only a single instance of your application may be run using the SingleApplicationInstance class.
Copy
class Program
{
    static void Main()
    {
        if (SingleApplicationInstance.IsOnlyInstance("6f2803c9-3694-4518-bf1b-c37c0929a844"))
        {
            Console.WriteLine("This is the first (and only instance)");
            Console.WriteLine("Try running another now...");
            Console.ReadKey();
            SingleApplicationInstance.Close();
        }
        else
        {
            Console.WriteLine("This program is already running!");
            Console.ReadKey();
        }
    }
}

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool IsOnlyInstance(
    string guid_
)

Parameters

guid_
Type: SystemString
Unique ID string

Return Value

Type: Boolean
True if no other instance is running else false
See Also

Reference

SingleApplicationInstance Class
Bncs.Execute Namespace


SingleApplicationInstance Properties

SingleApplicationInstance Properties

The SingleApplicationInstance type exposes the following members.

Properties
Name | Description
Mutex | Gets the mutex.
Top
See Also

Reference

SingleApplicationInstance Class
Bncs.Execute Namespace


SingleApplicationInstance.Mutex Property

SingleApplicationInstanceMutex Property
Gets the mutex.

Namespace: Bncs.Execute
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static Mutex Mutex { get; }

Property Value

Type: Mutex
See Also

Reference

SingleApplicationInstance Class
Bncs.Execute Namespace


Bncs.Graphics Namespace

Bncs.Graphics Namespace
This namespace has a Picture class that enables you to conveniently convert different picture types and also icon extraction classes to retrieve icons from binary files and from the Internet.
Classes
Class Description
Public class IconExtractor
A class that extracts an icon from a binary file.
Public class IconExtractorEx
A static class for extracting an icon from a file.
Picture
A class that deals with a picture graphic. The graphic is stored as a byte array and may be opened or saved from or to XML using the Open() and Save() methods. Additionally an image maybe loaded from or saved to an image file using the OpenImage() or SaveImage() methods. The class supports conversion to Bitmap, Image and ImageSource classes and can also be populated from any of these classes via the constructors. Other constructors can also take an array of bytes or an image file name from which the image may be populated.
Examples
This example shows how to create a Picture from an image file, serialise the object to an XML file and then deserialise it and display the result in a WPF Image control..
Copy
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();

        Picture picture = new Picture(@"C:\Users\fred\Pictures\iCloud Photos\My Photo Stream\IMG_0252.JPG");
        if (null != picture)
        {
            if (picture.Save(@"c:\image.xml"))
            {
                MessageBox.Show("Class instance serialised to disk. Press OK to deserialise it.");
                picture = (Picture)Picture.Open(@"c:\image.xml", typeof(Picture));
                if (null != picture)
                    image.Source = picture.ToImageSource;
                else
                    MessageBox.Show("Failed to deserialise the Picture object.");
            }
            else
                MessageBox.Show("Failed to save class instance to disk.");
        }
        else
            MessageBox.Show("Failed to grab a screenshot.");
    }
}
Public class WebIconExtractor
A class that extracts an icon from a web resource.
Enumerations
 | Enumeration | Description
Public enumeration | LibraryType | An enumeration denoting a graphic library type.
Public enumeration | PictureType | Enumeration denoting picture type.


IconExtractor Class

IconExtractor Class
A class that extracts an icon from a binary file.
Inheritance Hierarchy
SystemObject
Bncs.GraphicsIconExtractor

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class IconExtractor : IDisposable

The IconExtractor type exposes the following members.

Constructors
Name Description
IconExtractor
Load the specified executable file or DLL, and get ready to extract the icons.
Examples
This example shows how to extract an icon and display it in a WPF Image control via the Picture class.
Copy
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();

        IconExtractor extractor = new IconExtractor(@"C:\Program Files (x86)\Microsoft Office\Office15\DCF\filecompare.exe");
        if (null != extractor)
        {
            if (extractor.IconCount > 0)
            {
                Picture picture = new Picture(extractor.Icons[0].ToBitmap());
                image.Source = picture.ToImageSource;
            }
        }
        else
            MessageBox.Show("Failed to extract the icon.");
    }
}
Top
Methods
 | Name | Description
Public method | Dispose | Releases all resources used by the IconExtractor
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetIcon | Extract an icon from the loaded executable file, DLL or ICL.
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
 | SplitIcon | Split an Icon consists of multiple icons into an array of Icon each consist of single icons.
Public method | ToString | Returns the class as a string (Overrides ObjectToString.)
Top
Fields
Name | Description
ZeroLengthErrorMessage | Returns the zero length error message.
Top
Properties
 | Name | Description
Public property | Filename | Gets the file name from which the icon was extracted.
Public property | IconCount | Gets the icon count.
Public property | Icons | Gets a list of icons from the resource.
Top
See Also

Reference

Bncs.Graphics Namespace


IconExtractor Constructor

IconExtractor Constructor
Load the specified executable file or DLL, and get ready to extract the icons.
Examples
This example shows how to extract an icon and display it in a WPF Image control via the Picture class.
Copy
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();

        IconExtractor extractor = new IconExtractor(@"C:\Program Files (x86)\Microsoft Office\Office15\DCF\filecompare.exe");
        if (null != extractor)
        {
            if (extractor.IconCount > 0)
            {
                Picture picture = new Picture(extractor.Icons[0].ToBitmap());
                image.Source = picture.ToImageSource;
            }
        }
        else
            MessageBox.Show("Failed to extract the icon.");
    }
}

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public IconExtractor(
    string filename_
)

Parameters

filename_
Type: SystemString
The name of a file from which icons will be extracted.
See Also

Reference

IconExtractor Class
Bncs.Graphics Namespace


IconExtractor Fields

IconExtractor Fields

The IconExtractor type exposes the following members.

Fields
Name | Description
ZeroLengthErrorMessage | Returns the zero length error message.
Top
See Also

Reference

IconExtractor Class
Bncs.Graphics Namespace


IconExtractor.ZeroLengthErrorMessage Field

IconExtractorZeroLengthErrorMessage Field
Returns the zero length error message.

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string ZeroLengthErrorMessage

Field Value

Type: String
See Also

Reference

IconExtractor Class
Bncs.Graphics Namespace


IconExtractor Methods

IconExtractor Methods

The IconExtractor type exposes the following members.

Methods
 | Name | Description
Public method | Dispose |
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetIcon | Extract an icon from the loaded executable file, DLL or ICL.
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
 | SplitIcon | Split an Icon consists of multiple icons into an array of Icon each consist of single icons.
Public method | ToString | Returns the class as a string (Overrides ObjectToString.)
Top
See Also

Reference

IconExtractor Class
Bncs.Graphics Namespace


IconExtractor.Dispose Method

IconExtractorDispose Method
Releases all resources used by the IconExtractor

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Dispose()

Implements

IDisposableDispose
See Also

Reference

IconExtractor Class
Bncs.Graphics Namespace


IconExtractor.GetIcon Method

IconExtractorGetIcon Method
Extract an icon from the loaded executable file, DLL or ICL.

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Icon GetIcon(
    int iconIndex_
)

Parameters

iconIndex_
Type: SystemInt32
The zero-based index of the icon to be extracted.

Return Value

Type: Icon
A System.Drawing.Icon object which may consists of multiple icons.
Remarks
Always returns new copy of the Icon. It should be disposed by the user.
See Also

Reference

IconExtractor Class
Bncs.Graphics Namespace


IconExtractor.SplitIcon Method

IconExtractorSplitIcon Method
Split an Icon consists of multiple icons into an array of Icon each consist of single icons.

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static Icon[] SplitIcon(
    Icon icon_
)

Parameters

icon_
Type: System.DrawingIcon
The System.Drawing.Icon to be split.

Return Value

Type: Icon
An array of System.Drawing.Icon each consist of single icons.
See Also

Reference

IconExtractor Class
Bncs.Graphics Namespace


IconExtractor.ToString Method

IconExtractorToString Method
Returns the class as a string

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
File name and icon count
See Also

Reference

IconExtractor Class
Bncs.Graphics Namespace


IconExtractor Properties

IconExtractor Properties

The IconExtractor type exposes the following members.

Properties
 | Name | Description
Public property | Filename | Gets the file name from which the icon was extracted.
Public property | IconCount | Gets the icon count.
Public property | Icons | Gets a list of icons from the resource.
Top
See Also

Reference

IconExtractor Class
Bncs.Graphics Namespace


IconExtractor.Filename Property

IconExtractorFilename Property
Gets the file name from which the icon was extracted.

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Filename { get; }

Property Value

Type: String
See Also

Reference

IconExtractor Class
Bncs.Graphics Namespace


IconExtractor.IconCount Property

IconExtractorIconCount Property
Gets the icon count.

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int IconCount { get; }

Property Value

Type: Int32
See Also

Reference

IconExtractor Class
Bncs.Graphics Namespace


IconExtractor.Icons Property

IconExtractorIcons Property
Gets a list of icons from the resource.

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<Icon> Icons { get; }

Property Value

Type: List Icon
See Also

Reference

IconExtractor Class
Bncs.Graphics Namespace


IconExtractorEx Class

IconExtractorEx Class
A static class for extracting an icon from a file.
Inheritance Hierarchy
SystemObject
Bncs.GraphicsIconExtractorEx

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static class IconExtractorEx

The IconExtractorEx type exposes the following members.

Methods
Name | Description
ExtractIconFromExe(String, Boolean) | Gets the first icon from the file
ExtractIconFromExe(String, Boolean, Int32) | Gets the specified icon from the file
ExtractIconsFroExe | Gets all the icons, if any, from the supplied file path
Top
See Also

Reference

Bncs.Graphics Namespace


IconExtractorEx Methods

IconExtractorEx Methods

The IconExtractorEx type exposes the following members.

Methods
Name | Description
ExtractIconFromExe(String, Boolean) | Gets the first icon from the file
ExtractIconFromExe(String, Boolean, Int32) | Gets the specified icon from the file
ExtractIconsFroExe | Gets all the icons, if any, from the supplied file path
Top
See Also

Reference

IconExtractorEx Class
Bncs.Graphics Namespace


IconExtractorEx.ExtractIconFromExe Method

IconExtractorExExtractIconFromExe Method
Overload List
Name | Description
ExtractIconFromExe(String, Boolean) | Gets the first icon from the file
ExtractIconFromExe(String, Boolean, Int32) | Gets the specified icon from the file
Top
See Also

Reference

IconExtractorEx Class
Bncs.Graphics Namespace


IconExtractorEx.ExtractIconFromExe Method (String, Boolean)

IconExtractorExExtractIconFromExe Method (String, Boolean)
Gets the first icon from the file

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static Icon ExtractIconFromExe(
    string filename_,
    bool largeIcon_
)

Parameters

filename_
Type: SystemString
File name to extract icon from
largeIcon_
Type: SystemBoolean
Large/regular flag

Return Value

Type: Icon
Returns the first icon or null if none were found
See Also

Reference

IconExtractorEx Class
ExtractIconFromExe Overload
Bncs.Graphics Namespace


IconExtractorEx.ExtractIconFromExe Method (String, Boolean, Int32)

IconExtractorExExtractIconFromExe Method (String, Boolean, Int32)
Gets the specified icon from the file

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static Icon ExtractIconFromExe(
    string filename_,
    bool largeIcon_,
    int iconIndex_
)

Parameters

filename_
Type: SystemString
File name to extract icon from
largeIcon_
Type: SystemBoolean
Large/regular flag
iconIndex_
Type: SystemInt32
Icon index required

Return Value

Type: Icon
Returns the desired icon by index or null if none were found
See Also

Reference

IconExtractorEx Class
ExtractIconFromExe Overload
Bncs.Graphics Namespace


IconExtractorEx.ExtractIconsFroExe Method

IconExtractorExExtractIconsFroExe Method
Gets all the icons, if any, from the supplied file path

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static Icon[] ExtractIconsFroExe(
    string filename_,
    bool largeIcon_
)

Parameters

filename_
Type: SystemString
File name to extract icons from
largeIcon_
Type: SystemBoolean
Large/regular flag

Return Value

Type: Icon
Returns an array of icons or null if none were found
See Also

Reference

IconExtractorEx Class
Bncs.Graphics Namespace


LibraryType Enumeration

LibraryType Enumeration
An enumeration denoting a graphic library type.

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum LibraryType
Members
Member name | Value | Description
Unknown | 0 | Unknown libary type.
ExeDLL | 1 | From a binary file.
ICL | 2 | ICL libary.
See Also

Reference

Bncs.Graphics Namespace


Picture Class

Picture Class
A class that deals with a picture graphic. The graphic is stored as a byte array and may be opened or saved from or to XML using the Open() and Save() methods. Additionally an image maybe loaded from or saved to an image file using the OpenImage() or SaveImage() methods. The class supports conversion to Bitmap, Image and ImageSource classes and can also be populated from any of these classes via the constructors. Other constructors can also take an array of bytes or an image file name from which the image may be populated.
Examples
This example shows how to create a Picture from an image file, serialise the object to an XML file and then deserialise it and display the result in a WPF Image control..
Copy
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();

        Picture picture = new Picture(@"C:\Users\fred\Pictures\iCloud Photos\My Photo Stream\IMG_0252.JPG");
        if (null != picture)
        {
            if (picture.Save(@"c:\image.xml"))
            {
                MessageBox.Show("Class instance serialised to disk. Press OK to deserialise it.");
                picture = (Picture)Picture.Open(@"c:\image.xml", typeof(Picture));
                if (null != picture)
                    image.Source = picture.ToImageSource;
                else
                    MessageBox.Show("Failed to deserialise the Picture object.");
            }
            else
                MessageBox.Show("Failed to save class instance to disk.");
        }
        else
            MessageBox.Show("Failed to grab a screenshot.");
    }
}
Inheritance Hierarchy
SystemObject
Bncs.XMLPersistedXML
Bncs.GraphicsPicture

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class Picture : PersistedXML

The Picture type exposes the following members.

Constructors
Name Description
Public method Picture
Default XML constructor.
Public method Picture(Byte)
C# constructor
Public method Picture(Bitmap)
C# constructor
Public method Picture(Icon)
C# constructor
Public method Picture(Image)
C# constructor
Picture(String)
C# constructor
Examples
This example shows how to load a JPEG from file into a WPF Image control.
Copy
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();

        Picture picture = new Picture(@"C:\Users\fred\Pictures\iCloud Photos\My Photo Stream\IMG_3976.JPG");
        image.Source = picture.ToImageSource;
    }
}
Public method Picture(ImageSource)
C# constructor
Top
Methods
Name Description
Public method Equals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public method GetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
OpenImage
Opens the image from the specified file name
Examples
This example shows how to load a JPEG from file into a WPF Image control using the OpenImage(String) method.
Copy
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();

        Picture picture = new Picture();
        if (picture.OpenImage(@"C:\Users\fred\Pictures\iCloud Photos\My Photo Stream\IMG_3976.JPG"))
            image.Source = picture.ToImageSource;
        else
            MessageBox.Show("Failed to open the image file.");
    }
}
Public method Save
Serializes the repository to a NON-read only XML file providing that the Filename property has been set. Error information is accessable through the SaveErrorInformation property.
(Inherited from PersistedXML.)
Save(String)
Serializes the repository to a NON-read only XML file with no error information.
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}
(Inherited from PersistedXML.)
Public method Save(String, String)
Serializes the repository to a NON-read only XML file with no error information.
(Inherited from PersistedXML.)
Save(String, String)
Serializes the repository to a NON-read only XML file with error information.
Examples
This code demonstrates how to serialise/deserialise objects to and from disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File name to serialise/deserialise to/from
        const string filename = @"c:\MyObject.xml";
        // Our PersistedXML object
        MyObject myObject = null;
        // Debug message variable
        string debug;
        // New instance of object flag
        bool newInstance;

        // Check file exists ...
        if (FileFuncs.Exists(filename))
        {
            // ... it does so deserialise the onject ...
            myObject = ((MyObject)MyObject.Open(filename, typeof(MyObject), out debug, out newInstance));
            if (null == myObject) // we have a problem!
                Console.WriteLine("Deserialisation returned NULL: " + debug);
            else
            {
                // Report instance and data deserialised to user
                Console.WriteLine(newInstance ? "A new instance was initialised." : "Data deserialised from file ok.");
                if (myObject.IsValid)
                {
                    Console.WriteLine("Name: " + myObject.Name);
                    Console.WriteLine("Number: " + myObject.Number.ToString());
                }
                else
                    Console.WriteLine("Object could not be validated.");

                if (debug.Length > 0)
                    Console.WriteLine("Debug from deserialiser reads: \"" + debug + "\"");
            }
        }
        else
        {
            // ... it doesn't so create and then serialise the onject ...
            myObject = new MyObject();
            // set some properties ...
            myObject.Name = "Fred";
            myObject.Number = 13;
            // Report object data to user
            Console.WriteLine("Name: " + myObject.Name);
            Console.WriteLine("Number: " + myObject.Number.ToString());
            // Serialise the object to disk file
            Console.WriteLine("Serialising to disk file...");
            if (myObject.Save(filename, out debug))
                // Alls well
                Console.WriteLine("Rerun this app to deserialise this object from disk file.");
            else
            {
                // Report deserialisation error
                string message = "Error serialising to disk file";
                if (myObject.SaveErrorMessage.Length > 0)
                    message += ": \"" + myObject.SaveErrorMessage + "\"";
                else if (debug.Length > 0)
                    message += ": \"" + debug + "\"";
                Console.WriteLine(message);
            }
        }

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }
}
(Inherited from PersistedXML.)
Public method Save(String, String, Boolean)
Serializes the repository to an XML file with error information.
(Inherited from PersistedXML.)
Public method Save(String, String, String)
Serializes the repository to a NON-read only XML file with error information.
(Inherited from PersistedXML.)
Public method Save(String, String, Boolean, String)
Serializes the repository to an XML file with error information.
(Inherited from PersistedXML.)
Public method Save(String, String, Boolean, Boolean, String)
Serializes the repository to an XML file with error information.
(Inherited from PersistedXML.)
SaveImage
Saves the image to the specified file name in the specified format
Examples
This example shows how to take a screenshot, load it into a WPF Image control and save it as an icon file to disk.
Copy
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();

        Picture picture = Picture.Screenshot;
        if (null != picture)
        {
            image.Source = picture.ToImageSource;
            if (picture.SaveImage(@"c:\image.ico", PictureType.Icon))
                MessageBox.Show("Screenshot saved to disk as an icon.");
            else
                MessageBox.Show("Failed to save screenshot to file.");
        }
        else
            MessageBox.Show("Failed to grab a screenshot.");
    }
}
SaveToBuffer
Serializes the object to a buffer
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}
(Inherited from PersistedXML.)
Public method SaveToBuffer(String)
Serializes the object to a buffer
(Inherited from PersistedXML.)
Public method SaveToBuffer(String, String)
Serializes the object to a buffer
(Inherited from PersistedXML.)
Public method ToString
Returns a string that represents the current object.
(Inherited from Object.)
WindowShot
Top
Properties
Name Description
Public property Filename
Gets or sets the XML file name property.
(Inherited from PersistedXML.)
Public property Image
Gets or sets the image byte array. This array is how the Picture class stores it's graphic and serialises it to XML.
SaveErrorMessage
Gets an error message set if the previous Save() operation failed.
Examples
This code demonstrates how to serialise/deserialise objects to and from disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File name to serialise/deserialise to/from
        const string filename = @"c:\MyObject.xml";
        // Our PersistedXML object
        MyObject myObject = null;
        // Debug message variable
        string debug;
        // New instance of object flag
        bool newInstance;

        // Check file exists ...
        if (FileFuncs.Exists(filename))
        {
            // ... it does so deserialise the onject ...
            myObject = ((MyObject)MyObject.Open(filename, typeof(MyObject), out debug, out newInstance));
            if (null == myObject) // we have a problem!
                Console.WriteLine("Deserialisation returned NULL: " + debug);
            else
            {
                // Report instance and data deserialised to user
                Console.WriteLine(newInstance ? "A new instance was initialised." : "Data deserialised from file ok.");
                if (myObject.IsValid)
                {
                    Console.WriteLine("Name: " + myObject.Name);
                    Console.WriteLine("Number: " + myObject.Number.ToString());
                }
                else
                    Console.WriteLine("Object could not be validated.");

                if (debug.Length > 0)
                    Console.WriteLine("Debug from deserialiser reads: \"" + debug + "\"");
            }
        }
        else
        {
            // ... it doesn't so create and then serialise the onject ...
            myObject = new MyObject();
            // set some properties ...
            myObject.Name = "Fred";
            myObject.Number = 13;
            // Report object data to user
            Console.WriteLine("Name: " + myObject.Name);
            Console.WriteLine("Number: " + myObject.Number.ToString());
            // Serialise the object to disk file
            Console.WriteLine("Serialising to disk file...");
            if (myObject.Save(filename, out debug))
                // Alls well
                Console.WriteLine("Rerun this app to deserialise this object from disk file.");
            else
            {
                // Report deserialisation error
                string message = "Error serialising to disk file";
                if (myObject.SaveErrorMessage.Length > 0)
                    message += ": \"" + myObject.SaveErrorMessage + "\"";
                else if (debug.Length > 0)
                    message += ": \"" + debug + "\"";
                Console.WriteLine(message);
            }
        }

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }
}
(Inherited from PersistedXML.)
Screenshot
Returns a grab of the current screen as a Picture or null on error
Examples
This example shows how to take a screenshot and load it into a WPF Image control.
Copy
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();

        Picture picture = Picture.Screenshot;
        if (null != picture)
            image.Source = picture.ToImageSource;
        else
            MessageBox.Show("Failed to grab a screenshot.");
    }
}
Public property ToBitmap
Gets the Pictures image as a Bitmap object or sets the Image array from a Bitmap object.
ToIcon
Gets the Pictures image as an Icon object or sets the Image array from an Icon object.
Examples
This example shows how to create a Picture from an image file, use it's ToIcon property to return it as an icon and then save it as an ICO file.
Copy
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();

        Picture picture = new Picture(@"C:\Users\fred\Pictures\Clouds.jpeg");
        string targetICOFile = @"C:\Users\fred\Pictures\Clouds.ico";
        using (FileStream fileStream = new FileStream(targetICOFile, FileMode.Create))
            picture.ToIcon.Save(fileStream);
    }
}
Public property ToImage
Gets the Pictures image as an Image object.
ToImageSource
Gets the Pictures image as an ImageSource object.
Examples
This example shows how to create a Picture from an image file, serialise the object to an XML file and then deserialise it and display the result in a WPF Image control..
Copy
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();

        Picture picture = new Picture(@"C:\Users\fred\Pictures\iCloud Photos\My Photo Stream\IMG_0252.JPG");
        if (null != picture)
        {
            if (picture.Save(@"c:\image.xml"))
            {
                MessageBox.Show("Class instance serialised to disk. Press OK to deserialise it.");
                picture = (Picture)Picture.Open(@"c:\image.xml", typeof(Picture));
                if (null != picture)
                    image.Source = picture.ToImageSource;
                else
                    MessageBox.Show("Failed to deserialise the Picture object.");
            }
            else
                MessageBox.Show("Failed to save class instance to disk.");
        }
        else
            MessageBox.Show("Failed to grab a screenshot.");
    }
}
Public property ToStream
Gets the Pictures image as a Stream object or sets the Image array from a Stream object.
Top
See Also

Reference

Bncs.Graphics Namespace


Picture Constructor

Picture Constructor
Overload List
Name Description
Public method Picture
Default XML constructor.
Public method Picture(Byte)
C# constructor
Public method Picture(Bitmap)
C# constructor
Public method Picture(Icon)
C# constructor
Public method Picture(Image)
C# constructor
Picture(String)
C# constructor
Examples
This example shows how to load a JPEG from file into a WPF Image control.
Copy
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();

        Picture picture = new Picture(@"C:\Users\fred\Pictures\iCloud Photos\My Photo Stream\IMG_3976.JPG");
        image.Source = picture.ToImageSource;
    }
}
Public method Picture(ImageSource)
C# constructor
Top
See Also

Reference

Picture Class
Bncs.Graphics Namespace


Picture Constructor

Picture Constructor
Default XML constructor.

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Picture()
See Also

Reference

Picture Class
Picture Overload
Bncs.Graphics Namespace


Picture Constructor (Byte[])

Picture Constructor (Byte)
C# constructor

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Picture(
    byte[] image_
)

Parameters

image_
Type: SystemByte
Array of bytes from which to populate the image
See Also

Reference

Picture Class
Picture Overload
Bncs.Graphics Namespace


Picture Constructor (Bitmap)

Picture Constructor (Bitmap)
C# constructor

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Picture(
    Bitmap bitmap_
)

Parameters

bitmap_
Type: System.DrawingBitmap
Bitmap from which to populate the image
See Also

Reference

Picture Class
Picture Overload
Bncs.Graphics Namespace


Picture Constructor (Icon)

Picture Constructor (Icon)
C# constructor

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Picture(
    Icon icon_
)

Parameters

icon_
Type: System.DrawingIcon
Icon from which to populate the image.
See Also

Reference

Picture Class
Picture Overload
Bncs.Graphics Namespace


Picture Constructor (Image)

Picture Constructor (Image)
C# constructor

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Picture(
    Image image_
)

Parameters

image_
Type: System.DrawingImage
Image from which to populate the image
See Also

Reference

Picture Class
Picture Overload
Bncs.Graphics Namespace


Picture Constructor (String)

Picture Constructor (String)
C# constructor
Examples
This example shows how to load a JPEG from file into a WPF Image control.
Copy
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();

        Picture picture = new Picture(@"C:\Users\fred\Pictures\iCloud Photos\My Photo Stream\IMG_3976.JPG");
        image.Source = picture.ToImageSource;
    }
}

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Picture(
    string filename_
)

Parameters

filename_
Type: SystemString
File name from which to load and populate the image
See Also

Reference

Picture Class
Picture Overload
Bncs.Graphics Namespace


Picture Constructor (ImageSource)

Picture Constructor (ImageSource)
C# constructor

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Picture(
    ImageSource imageSource_
)

Parameters

imageSource_
Type: System.Windows.MediaImageSource
ImageSource from which to populate the image
See Also

Reference

Picture Class
Picture Overload
Bncs.Graphics Namespace


Picture Methods

Picture Methods

The Picture type exposes the following members.

Methods
Name Description
Public method Equals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public method GetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
OpenImage
Opens the image from the specified file name
Examples
This example shows how to load a JPEG from file into a WPF Image control using the OpenImage(String) method.
Copy
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();

        Picture picture = new Picture();
        if (picture.OpenImage(@"C:\Users\fred\Pictures\iCloud Photos\My Photo Stream\IMG_3976.JPG"))
            image.Source = picture.ToImageSource;
        else
            MessageBox.Show("Failed to open the image file.");
    }
}
Public method Save
Serializes the repository to a NON-read only XML file providing that the Filename property has been set. Error information is accessable through the SaveErrorInformation property.
(Inherited from PersistedXML.)
Save(String)
Serializes the repository to a NON-read only XML file with no error information.
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}
(Inherited from PersistedXML.)
Public method Save(String, String)
Serializes the repository to a NON-read only XML file with no error information.
(Inherited from PersistedXML.)
Save(String, String)
Serializes the repository to a NON-read only XML file with error information.
Examples
This code demonstrates how to serialise/deserialise objects to and from disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File name to serialise/deserialise to/from
        const string filename = @"c:\MyObject.xml";
        // Our PersistedXML object
        MyObject myObject = null;
        // Debug message variable
        string debug;
        // New instance of object flag
        bool newInstance;

        // Check file exists ...
        if (FileFuncs.Exists(filename))
        {
            // ... it does so deserialise the onject ...
            myObject = ((MyObject)MyObject.Open(filename, typeof(MyObject), out debug, out newInstance));
            if (null == myObject) // we have a problem!
                Console.WriteLine("Deserialisation returned NULL: " + debug);
            else
            {
                // Report instance and data deserialised to user
                Console.WriteLine(newInstance ? "A new instance was initialised." : "Data deserialised from file ok.");
                if (myObject.IsValid)
                {
                    Console.WriteLine("Name: " + myObject.Name);
                    Console.WriteLine("Number: " + myObject.Number.ToString());
                }
                else
                    Console.WriteLine("Object could not be validated.");

                if (debug.Length > 0)
                    Console.WriteLine("Debug from deserialiser reads: \"" + debug + "\"");
            }
        }
        else
        {
            // ... it doesn't so create and then serialise the onject ...
            myObject = new MyObject();
            // set some properties ...
            myObject.Name = "Fred";
            myObject.Number = 13;
            // Report object data to user
            Console.WriteLine("Name: " + myObject.Name);
            Console.WriteLine("Number: " + myObject.Number.ToString());
            // Serialise the object to disk file
            Console.WriteLine("Serialising to disk file...");
            if (myObject.Save(filename, out debug))
                // Alls well
                Console.WriteLine("Rerun this app to deserialise this object from disk file.");
            else
            {
                // Report deserialisation error
                string message = "Error serialising to disk file";
                if (myObject.SaveErrorMessage.Length > 0)
                    message += ": \"" + myObject.SaveErrorMessage + "\"";
                else if (debug.Length > 0)
                    message += ": \"" + debug + "\"";
                Console.WriteLine(message);
            }
        }

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }
}
(Inherited from PersistedXML.)
Public method Save(String, String, Boolean)
Serializes the repository to an XML file with error information.
(Inherited from PersistedXML.)
Public method Save(String, String, String)
Serializes the repository to a NON-read only XML file with error information.
(Inherited from PersistedXML.)
Public method Save(String, String, Boolean, String)
Serializes the repository to an XML file with error information.
(Inherited from PersistedXML.)
Public method Save(String, String, Boolean, Boolean, String)
Serializes the repository to an XML file with error information.
(Inherited from PersistedXML.)
SaveImage
Saves the image to the specified file name in the specified format
Examples
This example shows how to take a screenshot, load it into a WPF Image control and save it as an icon file to disk.
Copy
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();

        Picture picture = Picture.Screenshot;
        if (null != picture)
        {
            image.Source = picture.ToImageSource;
            if (picture.SaveImage(@"c:\image.ico", PictureType.Icon))
                MessageBox.Show("Screenshot saved to disk as an icon.");
            else
                MessageBox.Show("Failed to save screenshot to file.");
        }
        else
            MessageBox.Show("Failed to grab a screenshot.");
    }
}
SaveToBuffer
Serializes the object to a buffer
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}
(Inherited from PersistedXML.)
Public method SaveToBuffer(String)
Serializes the object to a buffer
(Inherited from PersistedXML.)
Public method SaveToBuffer(String, String)
Serializes the object to a buffer
(Inherited from PersistedXML.)
Public method ToString
Returns a string that represents the current object.
(Inherited from Object.)
WindowShot
Top
See Also

Reference

Picture Class
Bncs.Graphics Namespace


Picture.OpenImage Method

PictureOpenImage Method
Opens the image from the specified file name
Examples
This example shows how to load a JPEG from file into a WPF Image control using the OpenImage(String) method.
Copy
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();

        Picture picture = new Picture();
        if (picture.OpenImage(@"C:\Users\fred\Pictures\iCloud Photos\My Photo Stream\IMG_3976.JPG"))
            image.Source = picture.ToImageSource;
        else
            MessageBox.Show("Failed to open the image file.");
    }
}

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool OpenImage(
    string filename_
)

Parameters

filename_
Type: SystemString
File from which to load the image

Return Value

Type: Boolean
True on success
See Also

Reference

Picture Class
Bncs.Graphics Namespace


Picture.SaveImage Method

PictureSaveImage Method
Saves the image to the specified file name in the specified format
Examples
This example shows how to take a screenshot, load it into a WPF Image control and save it as an icon file to disk.
Copy
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();

        Picture picture = Picture.Screenshot;
        if (null != picture)
        {
            image.Source = picture.ToImageSource;
            if (picture.SaveImage(@"c:\image.ico", PictureType.Icon))
                MessageBox.Show("Screenshot saved to disk as an icon.");
            else
                MessageBox.Show("Failed to save screenshot to file.");
        }
        else
            MessageBox.Show("Failed to grab a screenshot.");
    }
}

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool SaveImage(
    string filename_,
    PictureType type_
)

Parameters

filename_
Type: SystemString
File to which the image will be saved
type_
Type: Bncs.GraphicsPictureType
Type of image to save as

Return Value

Type: Boolean
True on success
See Also

Reference

Picture Class
Bncs.Graphics Namespace


Picture.WindowShot Method

PictureWindowShot Method

[Missing <summary> documentation for "M:Bncs.Graphics.Picture.WindowShot(System.IntPtr)"]

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static Picture WindowShot(
    IntPtr handle_
)

Parameters

handle_
Type: SystemIntPtr

[Missing <param name="handle_"/> documentation for "M:Bncs.Graphics.Picture.WindowShot(System.IntPtr)"]

Return Value

Type: Picture

[Missing <returns> documentation for "M:Bncs.Graphics.Picture.WindowShot(System.IntPtr)"]

See Also

Reference

Picture Class
Bncs.Graphics Namespace


Picture Properties

Picture Properties

The Picture type exposes the following members.

Properties
Name Description
Public property Filename
Gets or sets the XML file name property.
(Inherited from PersistedXML.)
Public property Image
Gets or sets the image byte array. This array is how the Picture class stores it's graphic and serialises it to XML.
SaveErrorMessage
Gets an error message set if the previous Save() operation failed.
Examples
This code demonstrates how to serialise/deserialise objects to and from disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File name to serialise/deserialise to/from
        const string filename = @"c:\MyObject.xml";
        // Our PersistedXML object
        MyObject myObject = null;
        // Debug message variable
        string debug;
        // New instance of object flag
        bool newInstance;

        // Check file exists ...
        if (FileFuncs.Exists(filename))
        {
            // ... it does so deserialise the onject ...
            myObject = ((MyObject)MyObject.Open(filename, typeof(MyObject), out debug, out newInstance));
            if (null == myObject) // we have a problem!
                Console.WriteLine("Deserialisation returned NULL: " + debug);
            else
            {
                // Report instance and data deserialised to user
                Console.WriteLine(newInstance ? "A new instance was initialised." : "Data deserialised from file ok.");
                if (myObject.IsValid)
                {
                    Console.WriteLine("Name: " + myObject.Name);
                    Console.WriteLine("Number: " + myObject.Number.ToString());
                }
                else
                    Console.WriteLine("Object could not be validated.");

                if (debug.Length > 0)
                    Console.WriteLine("Debug from deserialiser reads: \"" + debug + "\"");
            }
        }
        else
        {
            // ... it doesn't so create and then serialise the onject ...
            myObject = new MyObject();
            // set some properties ...
            myObject.Name = "Fred";
            myObject.Number = 13;
            // Report object data to user
            Console.WriteLine("Name: " + myObject.Name);
            Console.WriteLine("Number: " + myObject.Number.ToString());
            // Serialise the object to disk file
            Console.WriteLine("Serialising to disk file...");
            if (myObject.Save(filename, out debug))
                // Alls well
                Console.WriteLine("Rerun this app to deserialise this object from disk file.");
            else
            {
                // Report deserialisation error
                string message = "Error serialising to disk file";
                if (myObject.SaveErrorMessage.Length > 0)
                    message += ": \"" + myObject.SaveErrorMessage + "\"";
                else if (debug.Length > 0)
                    message += ": \"" + debug + "\"";
                Console.WriteLine(message);
            }
        }

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }
}
(Inherited from PersistedXML.)
Screenshot
Returns a grab of the current screen as a Picture or null on error
Examples
This example shows how to take a screenshot and load it into a WPF Image control.
Copy
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();

        Picture picture = Picture.Screenshot;
        if (null != picture)
            image.Source = picture.ToImageSource;
        else
            MessageBox.Show("Failed to grab a screenshot.");
    }
}
Public property ToBitmap
Gets the Pictures image as a Bitmap object or sets the Image array from a Bitmap object.
ToIcon
Gets the Pictures image as an Icon object or sets the Image array from an Icon object.
Examples
This example shows how to create a Picture from an image file, use it's ToIcon property to return it as an icon and then save it as an ICO file.
Copy
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();

        Picture picture = new Picture(@"C:\Users\fred\Pictures\Clouds.jpeg");
        string targetICOFile = @"C:\Users\fred\Pictures\Clouds.ico";
        using (FileStream fileStream = new FileStream(targetICOFile, FileMode.Create))
            picture.ToIcon.Save(fileStream);
    }
}
Public property ToImage
Gets the Pictures image as an Image object.
ToImageSource
Gets the Pictures image as an ImageSource object.
Examples
This example shows how to create a Picture from an image file, serialise the object to an XML file and then deserialise it and display the result in a WPF Image control..
Copy
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();

        Picture picture = new Picture(@"C:\Users\fred\Pictures\iCloud Photos\My Photo Stream\IMG_0252.JPG");
        if (null != picture)
        {
            if (picture.Save(@"c:\image.xml"))
            {
                MessageBox.Show("Class instance serialised to disk. Press OK to deserialise it.");
                picture = (Picture)Picture.Open(@"c:\image.xml", typeof(Picture));
                if (null != picture)
                    image.Source = picture.ToImageSource;
                else
                    MessageBox.Show("Failed to deserialise the Picture object.");
            }
            else
                MessageBox.Show("Failed to save class instance to disk.");
        }
        else
            MessageBox.Show("Failed to grab a screenshot.");
    }
}
Public property ToStream
Gets the Pictures image as a Stream object or sets the Image array from a Stream object.
Top
See Also

Reference

Picture Class
Bncs.Graphics Namespace


Picture.Image Property

PictureImage Property
Gets or sets the image byte array. This array is how the Picture class stores it's graphic and serialises it to XML.

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[] Image { get; set; }

Property Value

Type: Byte
See Also

Reference

Picture Class
Bncs.Graphics Namespace


Picture.Screenshot Property

PictureScreenshot Property
Returns a grab of the current screen as a Picture or null on error
Examples
This example shows how to take a screenshot and load it into a WPF Image control.
Copy
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();

        Picture picture = Picture.Screenshot;
        if (null != picture)
            image.Source = picture.ToImageSource;
        else
            MessageBox.Show("Failed to grab a screenshot.");
    }
}

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static Picture Screenshot { get; }

Property Value

Type: Picture
See Also

Reference

Picture Class
Bncs.Graphics Namespace


Picture.ToBitmap Property

PictureToBitmap Property
Gets the Pictures image as a Bitmap object or sets the Image array from a Bitmap object.

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Bitmap ToBitmap { get; set; }

Property Value

Type: Bitmap
See Also

Reference

Picture Class
Bncs.Graphics Namespace


Picture.ToIcon Property

PictureToIcon Property
Gets the Pictures image as an Icon object or sets the Image array from an Icon object.
Examples
This example shows how to create a Picture from an image file, use it's ToIcon property to return it as an icon and then save it as an ICO file.
Copy
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();

        Picture picture = new Picture(@"C:\Users\fred\Pictures\Clouds.jpeg");
        string targetICOFile = @"C:\Users\fred\Pictures\Clouds.ico";
        using (FileStream fileStream = new FileStream(targetICOFile, FileMode.Create))
            picture.ToIcon.Save(fileStream);
    }
}

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Icon ToIcon { get; set; }

Property Value

Type: Icon
See Also

Reference

Picture Class
Bncs.Graphics Namespace


Picture.ToImage Property

PictureToImage Property
Gets the Pictures image as an Image object.

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Image ToImage { get; }

Property Value

Type: Image
See Also

Reference

Picture Class
Bncs.Graphics Namespace


Picture.ToImageSource Property

PictureToImageSource Property
Gets the Pictures image as an ImageSource object.
Examples
This example shows how to create a Picture from an image file, serialise the object to an XML file and then deserialise it and display the result in a WPF Image control..
Copy
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();

        Picture picture = new Picture(@"C:\Users\fred\Pictures\iCloud Photos\My Photo Stream\IMG_0252.JPG");
        if (null != picture)
        {
            if (picture.Save(@"c:\image.xml"))
            {
                MessageBox.Show("Class instance serialised to disk. Press OK to deserialise it.");
                picture = (Picture)Picture.Open(@"c:\image.xml", typeof(Picture));
                if (null != picture)
                    image.Source = picture.ToImageSource;
                else
                    MessageBox.Show("Failed to deserialise the Picture object.");
            }
            else
                MessageBox.Show("Failed to save class instance to disk.");
        }
        else
            MessageBox.Show("Failed to grab a screenshot.");
    }
}

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ImageSource ToImageSource { get; }

Property Value

Type: ImageSource
See Also

Reference

Picture Class
Bncs.Graphics Namespace


Picture.ToStream Property

PictureToStream Property
Gets the Pictures image as a Stream object or sets the Image array from a Stream object.

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Stream ToStream { get; set; }

Property Value

Type: Stream
See Also

Reference

Picture Class
Bncs.Graphics Namespace


PictureType Enumeration

PictureType Enumeration
Enumeration denoting picture type.

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum PictureType
Members
Member name | Value | Description
ByteArray | 0 | Image is a byte array.
Bmp | 1 | Image is a bitmap.
Emf | 2 | Image is an enhanced meta file.
Exif | 3 | Image is an exchangeable image format.
Gif | 4 | Image is a graphics interchange format.
Icon | 5 | Image is an icon.
Jpeg | 6 | Image is a joint photographic experts group format.
MemoryBmp | 7 | Image is a memory bitmap.
Png | 8 | Image is a portable network graphics format.
Tiff | 9 | Image is a tagged image file format.
Wmf | 10 | Image is a Windows metafile.
See Also

Reference

Bncs.Graphics Namespace


WebIconExtractor Class

WebIconExtractor Class
A class that extracts an icon from a web resource.
Inheritance Hierarchy
SystemObject
Bncs.GraphicsWebIconExtractor

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class WebIconExtractor

The WebIconExtractor type exposes the following members.

Constructors
 | Name | Description
Public method | WebIconExtractor | Constructor
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetIcon | Gets the URL's icon as a bitmap
Public method | GetIcon(String) | Gets the URL's icon and saves it to the supplied file name.
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | IsValidUrl | Gets a value flagging if the URL is valid.
Public property | TryRootlevelOnFailure | Gets or sets a flag determining if the URL root level should be attempted to source the image on failure.
Top
See Also

Reference

Bncs.Graphics Namespace


WebIconExtractor Constructor

WebIconExtractor Constructor
Constructor

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public WebIconExtractor(
    string url_
)

Parameters

url_
Type: SystemString
URL from which to download the icon.
See Also

Reference

WebIconExtractor Class
Bncs.Graphics Namespace


WebIconExtractor Methods

WebIconExtractor Methods

The WebIconExtractor type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetIcon | Gets the URL's icon as a bitmap
Public method | GetIcon(String) | Gets the URL's icon and saves it to the supplied file name.
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

WebIconExtractor Class
Bncs.Graphics Namespace


WebIconExtractor.GetIcon Method

WebIconExtractorGetIcon Method
Overload List
 | Name | Description
Public method | GetIcon | Gets the URL's icon as a bitmap
Public method | GetIcon(String) | Gets the URL's icon and saves it to the supplied file name.
Top
See Also

Reference

WebIconExtractor Class
Bncs.Graphics Namespace


WebIconExtractor.GetIcon Method

WebIconExtractorGetIcon Method
Gets the URL's icon as a bitmap

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Bitmap GetIcon()

Return Value

Type: Bitmap
Icon as a bitmap
See Also

Reference

WebIconExtractor Class
GetIcon Overload
Bncs.Graphics Namespace


WebIconExtractor.GetIcon Method (String)

WebIconExtractorGetIcon Method (String)
Gets the URL's icon and saves it to the supplied file name.

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool GetIcon(
    string filename_
)

Parameters

filename_
Type: SystemString
Target file name

Return Value

Type: Boolean
True on success
See Also

Reference

WebIconExtractor Class
GetIcon Overload
Bncs.Graphics Namespace


WebIconExtractor Properties

WebIconExtractor Properties

The WebIconExtractor type exposes the following members.

Properties
 | Name | Description
Public property | IsValidUrl | Gets a value flagging if the URL is valid.
Public property | TryRootlevelOnFailure | Gets or sets a flag determining if the URL root level should be attempted to source the image on failure.
Top
See Also

Reference

WebIconExtractor Class
Bncs.Graphics Namespace


WebIconExtractor.IsValidUrl Property

WebIconExtractorIsValidUrl Property
Gets a value flagging if the URL is valid.

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool IsValidUrl { get; }

Property Value

Type: Boolean
See Also

Reference

WebIconExtractor Class
Bncs.Graphics Namespace


WebIconExtractor.TryRootlevelOnFailure Property

WebIconExtractorTryRootlevelOnFailure Property
Gets or sets a flag determining if the URL root level should be attempted to source the image on failure.

Namespace: Bncs.Graphics
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool TryRootlevelOnFailure { get; set; }

Property Value

Type: Boolean
See Also

Reference

WebIconExtractor Class
Bncs.Graphics Namespace


Bncs.Protocol Namespace

Bncs.Protocol Namespace
This namespace has the class which should be used as the base class to all BNCS protocols.Simply define the messages in your derived class and the base class will parse them and fire events when particular messages are received.
Classes
Class Description
Public class DatagramEncapsulator
This class is an encapsulator to enable bytes to be escaped in a message if the escaped bytes are the same as the start and end message bytes of a datagram. This class also serves as the base class for DatagramTemplate as it consists of two byte arrays, Som and Eom, start of message and end of message.
Public class DatagramTemplate
DatagramTemplate is the class that GenericProtocolParser derivitives define instances of, they are used by GenericProtocolParser to ascertain if a meaningful datagram or datagrams are in the buffer. The template simply consists of a start of message and an end of message buffer and a name. The name is a string.
Public class GenericDatagram
GenericDatagram class is similar to a DatagramTemplate but additionally holds a payload buffer after parsing a template
Public class GenericProtocol
Base class from which all TxRx, Tx and Rx protocols are derived.
GenericRXProtocol
GenericRXProtocol is the base class for all communication protocol classes that use RX. It cannot be instantiated only derived from. It surfaces the AppendAndParseBuffer() method. As bytes come in to an app over the wire just chuck them in to this method and they will be parsed for you based on the DatagramTemplates you have defined in your child class. When messages deamed meaningful to your subclass are detected they are passed to your subclass' AnalyseData() method. This method is abstract so must be defined in your subclass.
Examples
This example demonstrates how to create a protocol class from GenericRXProtocol, this base class does all the parsing for us.
Copy
// A demo protocol class derived from GenericRXProtocol
public class SomeProtocol : GenericRXProtocol
{
    // Event handler variable for our protocol
    private event OnDatagramEventHandler _onDatagram = null;

    // An example constructor to facilitate instantiating your object from a secondary thread.
    public SomeProtocol(bool runningInSeperateThread_) : base(runningInSeperateThread_)
    {
        // Define templates here with a name, a start of message and end of message values. The base class will handle all the parsing.
        AddTemplate(new DatagramTemplate("RouterNames Reply", "Begin RouterNames\r\n", "End RouterNames"));
        AddTemplate(new DatagramTemplate("SourceNames Reply", "Begin SourceNames - ", "End SourceNames - "));
        AddTemplate(new DatagramTemplate("DestNames Reply", "Begin DestNames - ", "End DestNames - "));
    }

    // An example constructor to facilitate instantiating your object from the main UI thread.
    public SomeProtocol()
    {
        // Define templates here with a name, a start of message and end of message values. The base class will handle all the parsing.
        AddTemplate(new DatagramTemplate("RouterNames Reply", "Begin RouterNames\r\n", "End RouterNames"));
        AddTemplate(new DatagramTemplate("SourceNames Reply", "Begin SourceNames - ", "End SourceNames - "));
        AddTemplate(new DatagramTemplate("DestNames Reply", "Begin DestNames - ", "End DestNames - "));
    }

    // You MUST implement this inherited abstarct method, the base class calls this after it has parsed a valid message based on out templates above
    protected override void AnalyseData(List<GenericDatagram> datagrams_)
    {
        if (null != _onDatagram)
        {
            foreach (GenericDatagram datagram in datagrams_)
            {
                OnDatagramEventArgs args = new OnDatagramEventArgs();
                args.Name = datagram.Name;
                args.Packet = new DataBuffer(datagram.Payload).ToString();
                _onDatagram(this, args);
            }
        }
    }

    // Event handler for our protocol
    public event OnDatagramEventHandler OnDatagram
    {
        add { _onDatagram += value; }
        remove { _onDatagram -= value; }
    }
}

// Event args and delegate for SomeProtocol.OnDatagram event handler.
public class OnDatagramEventArgs
{
    public string Packet = string.Empty;
    public string Name = string.Empty;
}
public delegate void OnDatagramEventHandler(object sender, OnDatagramEventArgs e);

// Main window class
public partial class MainWindow : Window
{
    // Declare our protocol - you could use no argument here or false as shown as we're in the main UI thread. Otherwise use true.
    private SomeProtocol _protocol = new SomeProtocol(false);

    // In constructor we assign our SomeProtocol.OnDatagram event handler
    public MainWindow()
    {
        InitializeComponent();
        _protocol.OnDatagram += _protocol_OnDatagram;
    }

    // Protocol event handler that fires when the protocol class has parsed a valid message
    private void _protocol_OnDatagram(object sender, OnDatagramEventArgs e)
    {
        // Add message to a list box
        listBox.Items.Add(e.Name + " - msg: " + e.Packet);
    }

    // Some method in which data packets turn up - this might be the Receive event handler of the <see cref="E:Bncs.Comms.CommsClient.Receive" /> class for example.
    private void DataIn(byte[] packet_)
    {
        // Append packet to protocol buffer and have it parse it, anything good will come back to us in _protocol_OnDatagram() above
        _protocol.AppendAndParseBuffer(packet_);
    }
}
Enumerations
 | Enumeration | Description
Public enumeration | CaseSensitivity | Enumeration denoting case sensitivity
Public enumeration | TransmissionMode | Enumeration denoting the protocol mode as either TX, RX or both.


CaseSensitivity Enumeration

CaseSensitivity Enumeration
Enumeration denoting case sensitivity

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum CaseSensitivity
Members
Member name | Value | Description
CaseSensitive | 0 |
CaseInsensitive | 1 |
See Also

Reference

Bncs.Protocol Namespace


DatagramEncapsulator Class

DatagramEncapsulator Class
This class is an encapsulator to enable bytes to be escaped in a message if the escaped bytes are the same as the start and end message bytes of a datagram. This class also serves as the base class for DatagramTemplate as it consists of two byte arrays, Som and Eom, start of message and end of message.
Inheritance Hierarchy
SystemObject
Bncs.ProtocolDatagramEncapsulator
Bncs.ProtocolDatagramTemplate

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class DatagramEncapsulator

The DatagramEncapsulator type exposes the following members.

Constructors
 | Name | Description
Public method | DatagramEncapsulator(Byte, Byte) | Constructor accepting start and end of message as a native array of bytes.
Public method | DatagramEncapsulator(String, String) | Constructor accepting start and end of message as strings.
Top
Methods
 | Name | Description
Public method | Equals | Equals override to enable comparison (Overrides ObjectEquals(Object).)
Public method | GetHashCode | Hash code override (Overrides ObjectGetHashCode.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Gets the instance as a string (Overrides ObjectToString.)
Top
Properties
 | Name | Description
Public property | Eom | Gets the end of message or escape encapsulator
Public property | IsValid | Returns true if the Som and Eom byte arrays are populated
Public property | Som | Gets the start of message or escape encapsulator
Top
See Also

Reference

Bncs.Protocol Namespace


DatagramEncapsulator Constructor

DatagramEncapsulator Constructor
Overload List
 | Name | Description
Public method | DatagramEncapsulator(Byte, Byte) | Constructor accepting start and end of message as a native array of bytes.
Public method | DatagramEncapsulator(String, String) | Constructor accepting start and end of message as strings.
Top
See Also

Reference

DatagramEncapsulator Class
Bncs.Protocol Namespace


DatagramEncapsulator Constructor (Byte[], Byte[])

DatagramEncapsulator Constructor (Byte, Byte)
Constructor accepting start and end of message as a native array of bytes.

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public DatagramEncapsulator(
    byte[] som_,
    byte[] eom_
)

Parameters

som_
Type: SystemByte
Start of message
eom_
Type: SystemByte
End of message
See Also

Reference

DatagramEncapsulator Class
DatagramEncapsulator Overload
Bncs.Protocol Namespace


DatagramEncapsulator Constructor (String, String)

DatagramEncapsulator Constructor (String, String)
Constructor accepting start and end of message as strings.

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public DatagramEncapsulator(
    string som_,
    string eom_
)

Parameters

som_
Type: SystemString
Start of message
eom_
Type: SystemString

[Missing <param name="eom_"/> documentation for "M:Bncs.Protocol.DatagramEncapsulator.#ctor(System.String,System.String)"]

See Also

Reference

DatagramEncapsulator Class
DatagramEncapsulator Overload
Bncs.Protocol Namespace


DatagramEncapsulator Methods

DatagramEncapsulator Methods

The DatagramEncapsulator type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Equals override to enable comparison (Overrides ObjectEquals(Object).)
Public method | GetHashCode | Hash code override (Overrides ObjectGetHashCode.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Gets the instance as a string (Overrides ObjectToString.)
Top
See Also

Reference

DatagramEncapsulator Class
Bncs.Protocol Namespace


DatagramEncapsulator.Equals Method

DatagramEncapsulatorEquals Method
Equals override to enable comparison

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override bool Equals(
    Object obj
)

Parameters

obj
Type: SystemObject
Object to compare with

Return Value

Type: Boolean
True if the som and eom are both the same
See Also

Reference

DatagramEncapsulator Class
Bncs.Protocol Namespace


DatagramEncapsulator.GetHashCode Method

DatagramEncapsulatorGetHashCode Method
Hash code override

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override int GetHashCode()

Return Value

Type: Int32
The hash code
See Also

Reference

DatagramEncapsulator Class
Bncs.Protocol Namespace


DatagramEncapsulator.ToString Method

DatagramEncapsulatorToString Method
Gets the instance as a string

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
Returns the Som and Eom as strings
See Also

Reference

DatagramEncapsulator Class
Bncs.Protocol Namespace


DatagramEncapsulator Properties

DatagramEncapsulator Properties

The DatagramEncapsulator type exposes the following members.

Properties
 | Name | Description
Public property | Eom | Gets the end of message or escape encapsulator
Public property | IsValid | Returns true if the Som and Eom byte arrays are populated
Public property | Som | Gets the start of message or escape encapsulator
Top
See Also

Reference

DatagramEncapsulator Class
Bncs.Protocol Namespace


DatagramEncapsulator.Eom Property

DatagramEncapsulatorEom Property
Gets the end of message or escape encapsulator

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[] Eom { get; }

Property Value

Type: Byte
See Also

Reference

DatagramEncapsulator Class
Bncs.Protocol Namespace


DatagramEncapsulator.IsValid Property

DatagramEncapsulatorIsValid Property
Returns true if the Som and Eom byte arrays are populated

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool IsValid { get; }

Property Value

Type: Boolean
See Also

Reference

DatagramEncapsulator Class
Bncs.Protocol Namespace


DatagramEncapsulator.Som Property

DatagramEncapsulatorSom Property
Gets the start of message or escape encapsulator

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[] Som { get; }

Property Value

Type: Byte
See Also

Reference

DatagramEncapsulator Class
Bncs.Protocol Namespace


DatagramTemplate Class

DatagramTemplate Class
DatagramTemplate is the class that GenericProtocolParser derivitives define instances of, they are used by GenericProtocolParser to ascertain if a meaningful datagram or datagrams are in the buffer. The template simply consists of a start of message and an end of message buffer and a name. The name is a string.
Inheritance Hierarchy
SystemObject
Bncs.ProtocolDatagramEncapsulator
Bncs.ProtocolDatagramTemplate

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class DatagramTemplate : DatagramEncapsulator

The DatagramTemplate type exposes the following members.

Constructors
 | Name | Description
Public method | DatagramTemplate(String, Byte, Byte) | Constructor accepting start and end of message as a native array of bytes and a name for the template. If the name is an empty string then the default value of "Anonymous Template" is used.
Public method | DatagramTemplate(String, String, String) | Constructor accepting start and end of message as strings and a name for the template. If the name is an empty string then the default value of "Anonymous Template" is used.
Public method | DatagramTemplate(String, Byte, Byte, DatagramEncapsulator) | Constructor accepting start and end of message as a native array of bytes and a name for the template. If the name is an empty string then the default value of "Anonymous Template" is used. Also accepts escape templates.
Public method | DatagramTemplate(String, String, String, DatagramEncapsulator) | Constructor accepting start and end of message as strings and a name for the template. If the name is an empty string then the default value of "Anonymous Template" is used. Also accepts escape templates.
Top
Methods
 | Name | Description
Public method | Equals | Equals override to enable comparison (Inherited from DatagramEncapsulator.)
Public method | GetHashCode | GetHashCode override, obligitory when overriding Equals() (Overrides DatagramEncapsulatorGetHashCode.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Defines a string representation of the subclass, handy in the debugger (Overrides DatagramEncapsulatorToString.)
Top
Properties
 | Name | Description
Public property | Eom | Gets the end of message or escape encapsulator (Inherited from DatagramEncapsulator.)
Public property | EscapeEncapsulator | Gets or sets the escape encapsulator used for wrapping end of messages for embedding in byte streams.
Public property | IsValid | Returns true if the Som and Eom byte arrays are populated (Inherited from DatagramEncapsulator.)
Public property | Name | Gets the name
Public property | Som | Gets the start of message or escape encapsulator (Inherited from DatagramEncapsulator.)
Top
See Also

Reference

Bncs.Protocol Namespace


DatagramTemplate Constructor

DatagramTemplate Constructor
Overload List
 | Name | Description
Public method | DatagramTemplate(String, Byte, Byte) | Constructor accepting start and end of message as a native array of bytes and a name for the template. If the name is an empty string then the default value of "Anonymous Template" is used.
Public method | DatagramTemplate(String, String, String) | Constructor accepting start and end of message as strings and a name for the template. If the name is an empty string then the default value of "Anonymous Template" is used.
Public method | DatagramTemplate(String, Byte, Byte, DatagramEncapsulator) | Constructor accepting start and end of message as a native array of bytes and a name for the template. If the name is an empty string then the default value of "Anonymous Template" is used. Also accepts escape templates.
Public method | DatagramTemplate(String, String, String, DatagramEncapsulator) | Constructor accepting start and end of message as strings and a name for the template. If the name is an empty string then the default value of "Anonymous Template" is used. Also accepts escape templates.
Top
See Also

Reference

DatagramTemplate Class
Bncs.Protocol Namespace


DatagramTemplate Constructor (String, Byte[], Byte[])

DatagramTemplate Constructor (String, Byte, Byte)
Constructor accepting start and end of message as a native array of bytes and a name for the template. If the name is an empty string then the default value of "Anonymous Template" is used.

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public DatagramTemplate(
    string name_,
    byte[] som_,
    byte[] eom_
)

Parameters

name_
Type: SystemString
Template name
som_
Type: SystemByte
Start of message
eom_
Type: SystemByte
End of message
See Also

Reference

DatagramTemplate Class
DatagramTemplate Overload
Bncs.Protocol Namespace


DatagramTemplate Constructor (String, String, String)

DatagramTemplate Constructor (String, String, String)
Constructor accepting start and end of message as strings and a name for the template. If the name is an empty string then the default value of "Anonymous Template" is used.

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public DatagramTemplate(
    string name_,
    string som_,
    string eom_
)

Parameters

name_
Type: SystemString
Template name
som_
Type: SystemString
Start of message
eom_
Type: SystemString
End of message
See Also

Reference

DatagramTemplate Class
DatagramTemplate Overload
Bncs.Protocol Namespace


DatagramTemplate Constructor (String, Byte[], Byte[], DatagramEncapsulator)

DatagramTemplate Constructor (String, Byte, Byte, DatagramEncapsulator)
Constructor accepting start and end of message as a native array of bytes and a name for the template. If the name is an empty string then the default value of "Anonymous Template" is used. Also accepts escape templates.

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public DatagramTemplate(
    string name_,
    byte[] som_,
    byte[] eom_,
    DatagramEncapsulator escapeEncapsulator_
)

Parameters

name_
Type: SystemString
Template name
som_
Type: SystemByte
Start of message
eom_
Type: SystemByte
End of message
escapeEncapsulator_
Type: Bncs.ProtocolDatagramEncapsulator
Escape encapsulator to support embedding SOM and/or EOM in datagrams
See Also

Reference

DatagramTemplate Class
DatagramTemplate Overload
Bncs.Protocol Namespace


DatagramTemplate Constructor (String, String, String, DatagramEncapsulator)

DatagramTemplate Constructor (String, String, String, DatagramEncapsulator)
Constructor accepting start and end of message as strings and a name for the template. If the name is an empty string then the default value of "Anonymous Template" is used. Also accepts escape templates.

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public DatagramTemplate(
    string name_,
    string som_,
    string eom_,
    DatagramEncapsulator escapeEncapsulator_
)

Parameters

name_
Type: SystemString
Template name
som_
Type: SystemString
Start of message
eom_
Type: SystemString
End of message
escapeEncapsulator_
Type: Bncs.ProtocolDatagramEncapsulator
Escape encapsulator to support embedding SOM and/or EOM in datagrams
See Also

Reference

DatagramTemplate Class
DatagramTemplate Overload
Bncs.Protocol Namespace


DatagramTemplate Methods

DatagramTemplate Methods

The DatagramTemplate type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Equals override to enable comparison (Inherited from DatagramEncapsulator.)
Public method | GetHashCode | GetHashCode override, obligitory when overriding Equals() (Overrides DatagramEncapsulatorGetHashCode.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Defines a string representation of the subclass, handy in the debugger (Overrides DatagramEncapsulatorToString.)
Top
See Also

Reference

DatagramTemplate Class
Bncs.Protocol Namespace


DatagramTemplate.GetHashCode Method

DatagramTemplateGetHashCode Method
GetHashCode override, obligitory when overriding Equals()

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override int GetHashCode()

Return Value

Type: Int32
An int! Don't ask I only work here
See Also

Reference

DatagramTemplate Class
Bncs.Protocol Namespace


DatagramTemplate.ToString Method

DatagramTemplateToString Method
Defines a string representation of the subclass, handy in the debugger

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
The template name
See Also

Reference

DatagramTemplate Class
Bncs.Protocol Namespace


DatagramTemplate Properties

DatagramTemplate Properties

The DatagramTemplate type exposes the following members.

Properties
 | Name | Description
Public property | Eom | Gets the end of message or escape encapsulator (Inherited from DatagramEncapsulator.)
Public property | EscapeEncapsulator | Gets or sets the escape encapsulator used for wrapping end of messages for embedding in byte streams.
Public property | IsValid | Returns true if the Som and Eom byte arrays are populated (Inherited from DatagramEncapsulator.)
Public property | Name | Gets the name
Public property | Som | Gets the start of message or escape encapsulator (Inherited from DatagramEncapsulator.)
Top
See Also

Reference

DatagramTemplate Class
Bncs.Protocol Namespace


DatagramTemplate.EscapeEncapsulator Property

DatagramTemplateEscapeEncapsulator Property
Gets or sets the escape encapsulator used for wrapping end of messages for embedding in byte streams.

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public DatagramEncapsulator EscapeEncapsulator { get; set; }

Property Value

Type: DatagramEncapsulator
See Also

Reference

DatagramTemplate Class
Bncs.Protocol Namespace


DatagramTemplate.Name Property

DatagramTemplateName Property
Gets the name

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Name { get; }

Property Value

Type: String
See Also

Reference

DatagramTemplate Class
Bncs.Protocol Namespace


GenericDatagram Class

GenericDatagram Class
GenericDatagram class is similar to a DatagramTemplate but additionally holds a payload buffer after parsing a template
Inheritance Hierarchy
SystemObject
Bncs.ProtocolGenericDatagram

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class GenericDatagram : IComparable

The GenericDatagram type exposes the following members.

Constructors
 | Name | Description
Public method | GenericDatagram | Constructor, populates som, eom and name from the supplied template. Also takes the payload and the original position from the RX buffer
Top
Methods
 | Name | Description
Public method | CompareTo | IComparable.CompareTo
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Defines a string representation of the subclass, handy in the debugger (Overrides ObjectToString.)
Top
Properties
 | Name | Description
Public property | Buffer | Gets the full message buffer, i.e. returns som + payload (if any) + eom
Public property | DataBuffer | Gets the full message as a DataBuffer
Public property | Eom | Gets the end of message
Public property | Name | Gets or sets the name
Public property | OriginalIndexInRXBuffer | Gets the index from the original RX buffer
Public property | Payload | Gets the payload, could be null
Public property | Som | Gets the start of message
Top
See Also

Reference

Bncs.Protocol Namespace


GenericDatagram Constructor

GenericDatagram Constructor
Constructor, populates som, eom and name from the supplied template. Also takes the payload and the original position from the RX buffer

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public GenericDatagram(
    DatagramTemplate template_,
    byte[] payload_,
    int originalIndexInRXBuffer_
)

Parameters

template_
Type: Bncs.ProtocolDatagramTemplate
Template from which we copy name, som and eom
payload_
Type: SystemByte
The important stuff, the payload
originalIndexInRXBuffer_
Type: SystemInt32
Original index in the RX buffer
See Also

Reference

GenericDatagram Class
Bncs.Protocol Namespace


GenericDatagram Methods

GenericDatagram Methods

The GenericDatagram type exposes the following members.

Methods
 | Name | Description
Public method | CompareTo | IComparable.CompareTo
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Defines a string representation of the subclass, handy in the debugger (Overrides ObjectToString.)
Top
See Also

Reference

GenericDatagram Class
Bncs.Protocol Namespace


GenericDatagram.CompareTo Method

GenericDatagramCompareTo Method
IComparable.CompareTo

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int CompareTo(
    Object obj
)

Parameters

obj
Type: SystemObject
Object to compare, should of course be a GenericDatagram

Return Value

Type: Int32
Less than zero instance precedes obj, zero instance is equal to obj, greater than zero instance follows obj in sort order

Implements

IComparableCompareTo(Object)
See Also

Reference

GenericDatagram Class
Bncs.Protocol Namespace


GenericDatagram.ToString Method

GenericDatagramToString Method
Defines a string representation of the subclass, handy in the debugger

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
The name
See Also

Reference

GenericDatagram Class
Bncs.Protocol Namespace


GenericDatagram Properties

GenericDatagram Properties

The GenericDatagram type exposes the following members.

Properties
 | Name | Description
Public property | Buffer | Gets the full message buffer, i.e. returns som + payload (if any) + eom
Public property | DataBuffer | Gets the full message as a DataBuffer
Public property | Eom | Gets the end of message
Public property | Name | Gets or sets the name
Public property | OriginalIndexInRXBuffer | Gets the index from the original RX buffer
Public property | Payload | Gets the payload, could be null
Public property | Som | Gets the start of message
Top
See Also

Reference

GenericDatagram Class
Bncs.Protocol Namespace


GenericDatagram.Buffer Property

GenericDatagramBuffer Property
Gets the full message buffer, i.e. returns som + payload (if any) + eom

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[] Buffer { get; }

Property Value

Type: Byte
See Also

Reference

GenericDatagram Class
Bncs.Protocol Namespace


GenericDatagram.DataBuffer Property

GenericDatagramDataBuffer Property
Gets the full message as a DataBuffer

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public DataBuffer DataBuffer { get; }

Property Value

Type: DataBuffer
See Also

Reference

GenericDatagram Class
Bncs.Protocol Namespace


GenericDatagram.Eom Property

GenericDatagramEom Property
Gets the end of message

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[] Eom { get; }

Property Value

Type: Byte
See Also

Reference

GenericDatagram Class
Bncs.Protocol Namespace


GenericDatagram.Name Property

GenericDatagramName Property
Gets or sets the name

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Name { get; set; }

Property Value

Type: String
See Also

Reference

GenericDatagram Class
Bncs.Protocol Namespace


GenericDatagram.OriginalIndexInRXBuffer Property

GenericDatagramOriginalIndexInRXBuffer Property
Gets the index from the original RX buffer

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int OriginalIndexInRXBuffer { get; }

Property Value

Type: Int32
See Also

Reference

GenericDatagram Class
Bncs.Protocol Namespace


GenericDatagram.Payload Property

GenericDatagramPayload Property
Gets the payload, could be null

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[] Payload { get; }

Property Value

Type: Byte
See Also

Reference

GenericDatagram Class
Bncs.Protocol Namespace


GenericDatagram.Som Property

GenericDatagramSom Property
Gets the start of message

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[] Som { get; }

Property Value

Type: Byte
See Also

Reference

GenericDatagram Class
Bncs.Protocol Namespace


GenericProtocol Class

GenericProtocol Class
Base class from which all TxRx, Tx and Rx protocols are derived.
Inheritance Hierarchy
SystemObject
Bncs.ProtocolGenericProtocol
Bncs.ProtocolGenericRXProtocol

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public abstract class GenericProtocol

The GenericProtocol type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Defines a string representation of the subclass, handy in the debugger (Overrides ObjectToString.)
Top
Properties
 | Name | Description
Public property | DisplayName | Gets the display name
Public property | TransmissionMode | Gets the transmission mode
Public property | Version | Gets the version
Top
See Also

Reference

Bncs.Protocol Namespace


GenericProtocol Methods

GenericProtocol Methods

The GenericProtocol type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Defines a string representation of the subclass, handy in the debugger (Overrides ObjectToString.)
Top
See Also

Reference

GenericProtocol Class
Bncs.Protocol Namespace


GenericProtocol.ToString Method

GenericProtocolToString Method
Defines a string representation of the subclass, handy in the debugger

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
The display name as defined (hopefully) in the subclass
See Also

Reference

GenericProtocol Class
Bncs.Protocol Namespace


GenericProtocol Properties

GenericProtocol Properties

The GenericProtocol type exposes the following members.

Properties
 | Name | Description
Public property | DisplayName | Gets the display name
Public property | TransmissionMode | Gets the transmission mode
Public property | Version | Gets the version
Top
See Also

Reference

GenericProtocol Class
Bncs.Protocol Namespace


GenericProtocol.DisplayName Property

GenericProtocolDisplayName Property
Gets the display name

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string DisplayName { get; }

Property Value

Type: String
See Also

Reference

GenericProtocol Class
Bncs.Protocol Namespace


GenericProtocol.TransmissionMode Property

GenericProtocolTransmissionMode Property
Gets the transmission mode

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public TransmissionMode TransmissionMode { get; }

Property Value

Type: TransmissionMode
See Also

Reference

GenericProtocol Class
Bncs.Protocol Namespace


GenericProtocol.Version Property

GenericProtocolVersion Property
Gets the version

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Version { get; }

Property Value

Type: String
See Also

Reference

GenericProtocol Class
Bncs.Protocol Namespace


GenericRXProtocol Class

GenericRXProtocol Class
GenericRXProtocol is the base class for all communication protocol classes that use RX. It cannot be instantiated only derived from. It surfaces the AppendAndParseBuffer() method. As bytes come in to an app over the wire just chuck them in to this method and they will be parsed for you based on the DatagramTemplates you have defined in your child class. When messages deamed meaningful to your subclass are detected they are passed to your subclass' AnalyseData() method. This method is abstract so must be defined in your subclass.
Examples
This example demonstrates how to create a protocol class from GenericRXProtocol, this base class does all the parsing for us.
Copy
// A demo protocol class derived from GenericRXProtocol
public class SomeProtocol : GenericRXProtocol
{
    // Event handler variable for our protocol
    private event OnDatagramEventHandler _onDatagram = null;

    // An example constructor to facilitate instantiating your object from a secondary thread.
    public SomeProtocol(bool runningInSeperateThread_) : base(runningInSeperateThread_)
    {
        // Define templates here with a name, a start of message and end of message values. The base class will handle all the parsing.
        AddTemplate(new DatagramTemplate("RouterNames Reply", "Begin RouterNames\r\n", "End RouterNames"));
        AddTemplate(new DatagramTemplate("SourceNames Reply", "Begin SourceNames - ", "End SourceNames - "));
        AddTemplate(new DatagramTemplate("DestNames Reply", "Begin DestNames - ", "End DestNames - "));
    }

    // An example constructor to facilitate instantiating your object from the main UI thread.
    public SomeProtocol()
    {
        // Define templates here with a name, a start of message and end of message values. The base class will handle all the parsing.
        AddTemplate(new DatagramTemplate("RouterNames Reply", "Begin RouterNames\r\n", "End RouterNames"));
        AddTemplate(new DatagramTemplate("SourceNames Reply", "Begin SourceNames - ", "End SourceNames - "));
        AddTemplate(new DatagramTemplate("DestNames Reply", "Begin DestNames - ", "End DestNames - "));
    }

    // You MUST implement this inherited abstarct method, the base class calls this after it has parsed a valid message based on out templates above
    protected override void AnalyseData(List<GenericDatagram> datagrams_)
    {
        if (null != _onDatagram)
        {
            foreach (GenericDatagram datagram in datagrams_)
            {
                OnDatagramEventArgs args = new OnDatagramEventArgs();
                args.Name = datagram.Name;
                args.Packet = new DataBuffer(datagram.Payload).ToString();
                _onDatagram(this, args);
            }
        }
    }

    // Event handler for our protocol
    public event OnDatagramEventHandler OnDatagram
    {
        add { _onDatagram += value; }
        remove { _onDatagram -= value; }
    }
}

// Event args and delegate for SomeProtocol.OnDatagram event handler.
public class OnDatagramEventArgs
{
    public string Packet = string.Empty;
    public string Name = string.Empty;
}
public delegate void OnDatagramEventHandler(object sender, OnDatagramEventArgs e);

// Main window class
public partial class MainWindow : Window
{
    // Declare our protocol - you could use no argument here or false as shown as we're in the main UI thread. Otherwise use true.
    private SomeProtocol _protocol = new SomeProtocol(false);

    // In constructor we assign our SomeProtocol.OnDatagram event handler
    public MainWindow()
    {
        InitializeComponent();
        _protocol.OnDatagram += _protocol_OnDatagram;
    }

    // Protocol event handler that fires when the protocol class has parsed a valid message
    private void _protocol_OnDatagram(object sender, OnDatagramEventArgs e)
    {
        // Add message to a list box
        listBox.Items.Add(e.Name + " - msg: " + e.Packet);
    }

    // Some method in which data packets turn up - this might be the Receive event handler of the <see cref="E:Bncs.Comms.CommsClient.Receive" /> class for example.
    private void DataIn(byte[] packet_)
    {
        // Append packet to protocol buffer and have it parse it, anything good will come back to us in _protocol_OnDatagram() above
        _protocol.AppendAndParseBuffer(packet_);
    }
}
Inheritance Hierarchy
SystemObject
Bncs.ProtocolGenericProtocol
Bncs.ProtocolGenericRXProtocol

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public abstract class GenericRXProtocol : GenericProtocol

The GenericRXProtocol type exposes the following members.

Constructors
 | Name | Description
Public method | GenericRXProtocol | Constructor which initialises the mode to RX.
Public method | GenericRXProtocol(Boolean) | Constructor which initialises the mode to RX and allows indication of whether the object is being instantiated in a thread other than the main UI thread. If so then it is imperative that you use this constructor with a TRUE argument else you will not receive your datagrams.
Public method | GenericRXProtocol(CaseSensitivity) | Constructor which initialises the mode to RX and sets case sensitivity, default sensitivity is TRUE.
Public method | GenericRXProtocol(Boolean, CaseSensitivity) | Constructor which initialises the mode to RX and allows indication of whether the object is being instantiated in a thread other than the main UI thread. If so then it is imperative that you use this constructor with a TRUE argument else you will not receive your datagrams. Also sets case sensitivity, default is TRUE.
Public method | GenericRXProtocol(Boolean, Boolean) | Constructor which initialises the mode to RX, allows indication of whether the object is being instantiated in a thread other than the main UI thread and sets the SomEomIsEquallyEmbeddedInMessage r/o property. If running in a seperate thread then it is imperative that you use this constructor with a TRUE argument else you will not receive your datagrams.
Public method | GenericRXProtocol(Boolean, Boolean, CaseSensitivity) | Constructor which initialises the mode to RX, allows indication of whether the object is being instantiated in a thread other than the main UI thread and sets the SomEomIsEquallyEmbeddedInMessage r/o property. If running in a seperate thread then it is imperative that you use this constructor with a TRUE argument else you will not receive your datagrams. Also sets case sensitivity, default is TRUE.
Top
Methods
 | Name | Description
Public method | AppendAndParseBuffer | Appends the supplied byte buffer to the main buffer, parses it for DatagramTemplates and then calls the child classes AnalyseData() method
 | CalculateChecksum | Generates a check sum byte from the array provided
Public method | ClearBuffer | Allows us to clear the buffer from our program, typically when our program closes
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Defines a string representation of the subclass, handy in the debugger (Inherited from GenericProtocol.)
Top
Properties
 | Name | Description
Public property | BufferSize | Gets the current size of the buffer
Public property | CaseSensitive | Gets the case sensitive flag, default is TRUE.
Public property | DebugFilename | Gets or sets the name of our debug file
Public property | DisplayName | Gets the display name (Inherited from GenericProtocol.)
Public property | TransmissionMode | Gets the transmission mode (Inherited from GenericProtocol.)
Public property | Version | Gets the version (Inherited from GenericProtocol.)
Top
See Also

Reference

Bncs.Protocol Namespace


GenericRXProtocol Constructor

GenericRXProtocol Constructor
Overload List
 | Name | Description
Public method | GenericRXProtocol | Constructor which initialises the mode to RX.
Public method | GenericRXProtocol(Boolean) | Constructor which initialises the mode to RX and allows indication of whether the object is being instantiated in a thread other than the main UI thread. If so then it is imperative that you use this constructor with a TRUE argument else you will not receive your datagrams.
Public method | GenericRXProtocol(CaseSensitivity) | Constructor which initialises the mode to RX and sets case sensitivity, default sensitivity is TRUE.
Public method | GenericRXProtocol(Boolean, CaseSensitivity) | Constructor which initialises the mode to RX and allows indication of whether the object is being instantiated in a thread other than the main UI thread. If so then it is imperative that you use this constructor with a TRUE argument else you will not receive your datagrams. Also sets case sensitivity, default is TRUE.
Public method | GenericRXProtocol(Boolean, Boolean) | Constructor which initialises the mode to RX, allows indication of whether the object is being instantiated in a thread other than the main UI thread and sets the SomEomIsEquallyEmbeddedInMessage r/o property. If running in a seperate thread then it is imperative that you use this constructor with a TRUE argument else you will not receive your datagrams.
Public method | GenericRXProtocol(Boolean, Boolean, CaseSensitivity) | Constructor which initialises the mode to RX, allows indication of whether the object is being instantiated in a thread other than the main UI thread and sets the SomEomIsEquallyEmbeddedInMessage r/o property. If running in a seperate thread then it is imperative that you use this constructor with a TRUE argument else you will not receive your datagrams. Also sets case sensitivity, default is TRUE.
Top
See Also

Reference

GenericRXProtocol Class
Bncs.Protocol Namespace


GenericRXProtocol Constructor

GenericRXProtocol Constructor
Constructor which initialises the mode to RX.

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public GenericRXProtocol()
See Also

Reference

GenericRXProtocol Class
GenericRXProtocol Overload
Bncs.Protocol Namespace


GenericRXProtocol Constructor (Boolean)

GenericRXProtocol Constructor (Boolean)
Constructor which initialises the mode to RX and allows indication of whether the object is being instantiated in a thread other than the main UI thread. If so then it is imperative that you use this constructor with a TRUE argument else you will not receive your datagrams.

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public GenericRXProtocol(
    bool runningInSeperateThread_
)

Parameters

runningInSeperateThread_
Type: SystemBoolean
Non UI thread flag
See Also

Reference

GenericRXProtocol Class
GenericRXProtocol Overload
Bncs.Protocol Namespace


GenericRXProtocol Constructor (CaseSensitivity)

GenericRXProtocol Constructor (CaseSensitivity)
Constructor which initialises the mode to RX and sets case sensitivity, default sensitivity is TRUE.

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public GenericRXProtocol(
    CaseSensitivity caseSensitivety_
)

Parameters

caseSensitivety_
Type: Bncs.ProtocolCaseSensitivity
Case sensitivity value relevent when comparing bytes that represent letters, default is CaseSensitivity.CaseSensitive.
See Also

Reference

GenericRXProtocol Class
GenericRXProtocol Overload
Bncs.Protocol Namespace


GenericRXProtocol Constructor (Boolean, CaseSensitivity)

GenericRXProtocol Constructor (Boolean, CaseSensitivity)
Constructor which initialises the mode to RX and allows indication of whether the object is being instantiated in a thread other than the main UI thread. If so then it is imperative that you use this constructor with a TRUE argument else you will not receive your datagrams. Also sets case sensitivity, default is TRUE.

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public GenericRXProtocol(
    bool runningInSeperateThread_,
    CaseSensitivity caseSensitivety_
)

Parameters

runningInSeperateThread_
Type: SystemBoolean
Non UI thread flag
caseSensitivety_
Type: Bncs.ProtocolCaseSensitivity
Case sensitivity value relevent when comparing bytes that represent letters, default is CaseSensitivity.CaseSensitive.
See Also

Reference

GenericRXProtocol Class
GenericRXProtocol Overload
Bncs.Protocol Namespace


GenericRXProtocol Constructor (Boolean, Boolean)

GenericRXProtocol Constructor (Boolean, Boolean)
Constructor which initialises the mode to RX, allows indication of whether the object is being instantiated in a thread other than the main UI thread and sets the SomEomIsEquallyEmbeddedInMessage r/o property. If running in a seperate thread then it is imperative that you use this constructor with a TRUE argument else you will not receive your datagrams.

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public GenericRXProtocol(
    bool runningInSeperateThread_,
    bool somEomIsEquallyEmbeddedInMessage_
)

Parameters

runningInSeperateThread_
Type: SystemBoolean
Non UI thread flag
somEomIsEquallyEmbeddedInMessage_
Type: SystemBoolean
SOM/EOM equally embedded flag
See Also

Reference

GenericRXProtocol Class
GenericRXProtocol Overload
Bncs.Protocol Namespace


GenericRXProtocol Constructor (Boolean, Boolean, CaseSensitivity)

GenericRXProtocol Constructor (Boolean, Boolean, CaseSensitivity)
Constructor which initialises the mode to RX, allows indication of whether the object is being instantiated in a thread other than the main UI thread and sets the SomEomIsEquallyEmbeddedInMessage r/o property. If running in a seperate thread then it is imperative that you use this constructor with a TRUE argument else you will not receive your datagrams. Also sets case sensitivity, default is TRUE.

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public GenericRXProtocol(
    bool runningInSeperateThread_,
    bool somEomIsEquallyEmbeddedInMessage_,
    CaseSensitivity caseSensitivity_
)

Parameters

runningInSeperateThread_
Type: SystemBoolean
Non UI thread flag
somEomIsEquallyEmbeddedInMessage_
Type: SystemBoolean
SOM/EOM equally embedded flag
caseSensitivity_
Type: Bncs.ProtocolCaseSensitivity
Case sensitivity value relevent when comparing bytes that represent letters, default is CaseSensitivity.CaseSensitive.
See Also

Reference

GenericRXProtocol Class
GenericRXProtocol Overload
Bncs.Protocol Namespace


GenericRXProtocol Methods

GenericRXProtocol Methods

The GenericRXProtocol type exposes the following members.

Methods
 | Name | Description
Public method | AppendAndParseBuffer | Appends the supplied byte buffer to the main buffer, parses it for DatagramTemplates and then calls the child classes AnalyseData() method
 | CalculateChecksum | Generates a check sum byte from the array provided
Public method | ClearBuffer | Allows us to clear the buffer from our program, typically when our program closes
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Defines a string representation of the subclass, handy in the debugger (Inherited from GenericProtocol.)
Top
See Also

Reference

GenericRXProtocol Class
Bncs.Protocol Namespace


GenericRXProtocol.AppendAndParseBuffer Method

GenericRXProtocolAppendAndParseBuffer Method
Appends the supplied byte buffer to the main buffer, parses it for DatagramTemplates and then calls the child classes AnalyseData() method

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int AppendAndParseBuffer(
    byte[] buffer_
)

Parameters

buffer_
Type: SystemByte
Array of bytes to add to the main buffer

Return Value

Type: Int32
The size of the buffer after parsing
See Also

Reference

GenericRXProtocol Class
Bncs.Protocol Namespace


GenericRXProtocol.CalculateChecksum Method

GenericRXProtocolCalculateChecksum Method
Generates a check sum byte from the array provided

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static byte CalculateChecksum(
    string dataToCalculate
)

Parameters

dataToCalculate
Type: SystemString
Array of bytes to check sum

Return Value

Type: Byte
The check sum byte
See Also

Reference

GenericRXProtocol Class
Bncs.Protocol Namespace


GenericRXProtocol.ClearBuffer Method

GenericRXProtocolClearBuffer Method
Allows us to clear the buffer from our program, typically when our program closes

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void ClearBuffer()
See Also

Reference

GenericRXProtocol Class
Bncs.Protocol Namespace


GenericRXProtocol Properties

GenericRXProtocol Properties

The GenericRXProtocol type exposes the following members.

Properties
 | Name | Description
Public property | BufferSize | Gets the current size of the buffer
Public property | CaseSensitive | Gets the case sensitive flag, default is TRUE.
Public property | DebugFilename | Gets or sets the name of our debug file
Public property | DisplayName | Gets the display name (Inherited from GenericProtocol.)
Public property | TransmissionMode | Gets the transmission mode (Inherited from GenericProtocol.)
Public property | Version | Gets the version (Inherited from GenericProtocol.)
Top
See Also

Reference

GenericRXProtocol Class
Bncs.Protocol Namespace


GenericRXProtocol.BufferSize Property

GenericRXProtocolBufferSize Property
Gets the current size of the buffer

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int BufferSize { get; }

Property Value

Type: Int32
See Also

Reference

GenericRXProtocol Class
Bncs.Protocol Namespace


GenericRXProtocol.CaseSensitive Property

GenericRXProtocolCaseSensitive Property
Gets the case sensitive flag, default is TRUE.

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool CaseSensitive { get; }

Property Value

Type: Boolean
See Also

Reference

GenericRXProtocol Class
Bncs.Protocol Namespace


GenericRXProtocol.DebugFilename Property

GenericRXProtocolDebugFilename Property
Gets or sets the name of our debug file

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string DebugFilename { get; set; }

Property Value

Type: String
See Also

Reference

GenericRXProtocol Class
Bncs.Protocol Namespace


TransmissionMode Enumeration

TransmissionMode Enumeration
Enumeration denoting the protocol mode as either TX, RX or both.

Namespace: Bncs.Protocol
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum TransmissionMode
Members
Member name | Value | Description
TxRx | 0 | Transmission mode is send and receive.
Tx | 1 | Transmission mode is send only.
Rx | 2 | Transmission mode is receive only.
See Also

Reference

Bncs.Protocol Namespace


Bncs.Protocol.JSon Namespace

Bncs.Protocol.JSon Namespace
This namespace contains classes for handling the JSon protocol. Simply create an object of type JSonMessage with a string or byte array. Objects therein can be displayed, validated and queried.
Classes
 | Class | Description
Public class | JSonArray | JSon array, a class containing an array of values, these may be any C# object
Public class | JSonBase | Base class for all JSon objects
Public class | JSonIndentedString | Indented string class, stores a string value along with an indent for either text formatting or TreeView levels
Public class | JSonMessage | Main JSonMessage class that parses a JSon message from either a string or an array of bytes
Public class | JSonObject | Base class for all JSon object types that make up a JSon message
Public class | JSonProperty | JSon property, a simple name/value pair where value may be any C# object
Public class | JSonStructure | JSon structure, a class containing child values, these may be any JSonObject derivitive
Enumerations
 | Enumeration | Description
Public enumeration | JSonType | Type enumerator, betrays the type of an object


JSonArray Class

JSonArray Class
JSon array, a class containing an array of values, these may be any C# object
Inheritance Hierarchy
SystemObject
Bncs.Protocol.JSonJSonBase
Bncs.Protocol.JSonJSonObject
Bncs.Protocol.JSonJSonArray

Namespace: Bncs.Protocol.JSon
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class JSonArray : JSonObject

The JSonArray type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Gets the instance as a string (Inherited from JSonBase.)
Top
Properties
 | Name | Description
Public property | Array | Gets the array of members
Public property | ErrorMessage | Gets an error message or an empty string if no error was encountered (Inherited from JSonBase.)
Public property | IsValid | Gets a validity flag, true is valid else false (Inherited from JSonBase.)
Public property | JType | Gets the type as an enumeration (Inherited from JSonObject.)
Public property | Name | Gets the name (Inherited from JSonObject.)
Top
See Also

Reference

Bncs.Protocol.JSon Namespace


JSonArray Methods

JSonArray Methods

The JSonArray type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Gets the instance as a string (Inherited from JSonBase.)
Top
See Also

Reference

JSonArray Class
Bncs.Protocol.JSon Namespace


JSonArray Properties

JSonArray Properties

The JSonArray type exposes the following members.

Properties
 | Name | Description
Public property | Array | Gets the array of members
Public property | ErrorMessage | Gets an error message or an empty string if no error was encountered (Inherited from JSonBase.)
Public property | IsValid | Gets a validity flag, true is valid else false (Inherited from JSonBase.)
Public property | JType | Gets the type as an enumeration (Inherited from JSonObject.)
Public property | Name | Gets the name (Inherited from JSonObject.)
Top
See Also

Reference

JSonArray Class
Bncs.Protocol.JSon Namespace


JSonArray.Array Property

JSonArrayArray Property
Gets the array of members

Namespace: Bncs.Protocol.JSon
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Object[] Array { get; }

Property Value

Type: Object
See Also

Reference

JSonArray Class
Bncs.Protocol.JSon Namespace


JSonBase Class

JSonBase Class
Base class for all JSon objects
Inheritance Hierarchy
SystemObject
Bncs.Protocol.JSonJSonBase
Bncs.Protocol.JSonJSonMessage
Bncs.Protocol.JSonJSonObject

Namespace: Bncs.Protocol.JSon
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class JSonBase

The JSonBase type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Gets the instance as a string (Overrides ObjectToString.)
Top
Properties
 | Name | Description
Public property | ErrorMessage | Gets an error message or an empty string if no error was encountered
Public property | IsValid | Gets a validity flag, true is valid else false
Top
See Also

Reference

Bncs.Protocol.JSon Namespace


JSonBase Methods

JSonBase Methods

The JSonBase type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Gets the instance as a string (Overrides ObjectToString.)
Top
See Also

Reference

JSonBase Class
Bncs.Protocol.JSon Namespace


JSonBase.ToString Method

JSonBaseToString Method
Gets the instance as a string

Namespace: Bncs.Protocol.JSon
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
The original message used to create the object
See Also

Reference

JSonBase Class
Bncs.Protocol.JSon Namespace


JSonBase Properties

JSonBase Properties

The JSonBase type exposes the following members.

Properties
 | Name | Description
Public property | ErrorMessage | Gets an error message or an empty string if no error was encountered
Public property | IsValid | Gets a validity flag, true is valid else false
Top
See Also

Reference

JSonBase Class
Bncs.Protocol.JSon Namespace


JSonBase.ErrorMessage Property

JSonBaseErrorMessage Property
Gets an error message or an empty string if no error was encountered

Namespace: Bncs.Protocol.JSon
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string ErrorMessage { get; }

Property Value

Type: String
See Also

Reference

JSonBase Class
Bncs.Protocol.JSon Namespace


JSonBase.IsValid Property

JSonBaseIsValid Property
Gets a validity flag, true is valid else false

Namespace: Bncs.Protocol.JSon
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool IsValid { get; }

Property Value

Type: Boolean
See Also

Reference

JSonBase Class
Bncs.Protocol.JSon Namespace


JSonIndentedString Class

JSonIndentedString Class
Indented string class, stores a string value along with an indent for either text formatting or TreeView levels
Inheritance Hierarchy
SystemObject
Bncs.Protocol.JSonJSonIndentedString

Namespace: Bncs.Protocol.JSon
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class JSonIndentedString

The JSonIndentedString type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Gets the instance as a string (Overrides ObjectToString.)
Top
Properties
 | Name | Description
Public property | Indent | Gets the indent
Public property | Value | Gets the value
Top
See Also

Reference

Bncs.Protocol.JSon Namespace


JSonIndentedString Methods

JSonIndentedString Methods

The JSonIndentedString type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Gets the instance as a string (Overrides ObjectToString.)
Top
See Also

Reference

JSonIndentedString Class
Bncs.Protocol.JSon Namespace


JSonIndentedString.ToString Method

JSonIndentedStringToString Method
Gets the instance as a string

Namespace: Bncs.Protocol.JSon
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
The indented value
See Also

Reference

JSonIndentedString Class
Bncs.Protocol.JSon Namespace


JSonIndentedString Properties

JSonIndentedString Properties

The JSonIndentedString type exposes the following members.

Properties
 | Name | Description
Public property | Indent | Gets the indent
Public property | Value | Gets the value
Top
See Also

Reference

JSonIndentedString Class
Bncs.Protocol.JSon Namespace


JSonIndentedString.Indent Property

JSonIndentedStringIndent Property
Gets the indent

Namespace: Bncs.Protocol.JSon
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint Indent { get; }

Property Value

Type: UInt32
See Also

Reference

JSonIndentedString Class
Bncs.Protocol.JSon Namespace


JSonIndentedString.Value Property

JSonIndentedStringValue Property
Gets the value

Namespace: Bncs.Protocol.JSon
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Value { get; }

Property Value

Type: String
See Also

Reference

JSonIndentedString Class
Bncs.Protocol.JSon Namespace


JSonMessage Class

JSonMessage Class
Main JSonMessage class that parses a JSon message from either a string or an array of bytes
Inheritance Hierarchy
SystemObject
Bncs.Protocol.JSonJSonBase
Bncs.Protocol.JSonJSonMessage

Namespace: Bncs.Protocol.JSon
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class JSonMessage : JSonBase

The JSonMessage type exposes the following members.

Constructors
 | Name | Description
Public method | JSonMessage(Byte) | Constructs a message from the supplied byte array
Public method | JSonMessage(String) | Constructs a message from the supplied string
Top
Methods
Name Description
AllValuesExist
Checks if the Json message contains all path names supplied
Examples
This example creates a hard coded message and finds a value in the message from the hard codded JSon path
Copy
private void CreateMessageAndCheckValueNames()
{
    // Create a JSonMessageInstance
    JSonMessage message = new JSonMessage("{ \"header\":{\"id\":0}, \"data\":{ \"name\":\"NAME\", \"description\":\"DESCRIPTION\", \"tags\":[\"SRC\",\"DST\",\"NONE\"]} }");
    // If it's valid then proceed
    if (message.IsValid)
    {
        // Find out if values exist for all supplied value names
        if (message.AllValuesExist("data\\ok", "data\\id", "sequenceId"))
            MessageBox.ShowMessage("All values were found", "Success");
        else
            MessageBox.ShowMessage("Not all values were found", "Error");
    }
    else // Show error message
        MessageBox.Show(message.ErrorMessage, "Error");
}
Public method Equals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
FindValue
Looks up a value on the supplied JSon path
Examples
This example creates a hard coded message and finds a value in the message from the hard codded JSon path
Copy
private void CreateMessageAndSeekValue()
{
    // Create a JSonMessageInstance
    JSonMessage message = new JSonMessage("{ \"header\":{\"id\":0}, \"data\":{ \"name\":\"NAME\", \"description\":\"DESCRIPTION\", \"tags\":[\"SRC\",\"DST\",\"NONE\"]} }");
    // If it's valid then proceed
    if (message.IsValid)
    {
        // Try and find the second value in the array named "tags" in the root level object "data"
        object value = message.FindValue("data\\tags[1]");
        if (null == value) // Not found
            MessageBox.Show("Failed to find a value at: data\\tags[1]", "Value Not Found");
        else // found so show the value and it's type, in this case: "DST" of type System.String
            MessageBox.Show("Value:\n\n" + value.ToString() + "\n\nFound at: data\\tags[1]\n\nType: " + value.GetType().ToString() , "Value Found");
    }
    else // Show error message
        MessageBox.Show(message.ErrorMessage, "Error");
}
Public method GetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
ToIndentedStrings
Gets the instance as a list of JSonIndentedStrings
Examples
This example demonstrates how to create and display a JSonMessage in a WPF TreeView control
Copy
private void InterpreteMessageToTreeView(string message_)
{
    // Clear the TreeView we wish to poulate
    tvDebug.Items.Clear();
    // Create a JSonMessage instance from the supplied string
    JSonMessage message = new JSonMessage(message_);

    // If valid we may proceed
    if (message.IsValid)
    {
        TreeViewItem rootItem = null;
        TreeViewItem currentItem = null;
        TreeViewItem newItem = null;
        uint currentLevel = 0;
        uint thisLevel = 0;
        foreach (JSonIndentedString istring in message.ToIndentedStrings())
        {
            thisLevel = istring.Indent;
            if (0 == istring.Indent)
            {
                rootItem = new TreeViewItem();
                rootItem.Header = istring.Value;
                tvDebug.Items.Add(rootItem);
            }
            else if (1 == istring.Indent)
            {
                newItem = new TreeViewItem();
                newItem.Header = istring.Value;
                rootItem.Items.Add(newItem);
            }
            else if (thisLevel > currentLevel)
            {
                currentItem = newItem;
                newItem = new TreeViewItem();
                newItem.Header = istring.Value;
                currentItem.Items.Add(newItem);
            }
            else if (currentLevel > thisLevel)
            {
                for (int loop = 0; loop < currentLevel - thisLevel; ++loop)
                    currentItem = (TreeViewItem)currentItem.Parent;
                newItem = new TreeViewItem();
                newItem.Header = istring.Value;
                currentItem.Items.Add(newItem);
            }
            else
            {
                newItem = new TreeViewItem();
                newItem.Header = istring.Value;
                currentItem.Items.Add(newItem);
            }

            currentLevel = thisLevel;
        }
    }
    else // Handle invalid message by displaying the error
        MessageBox.Show(message.ErrorMessage, "Error");
}
Public method ToString
Gets the instance as a string
(Inherited from JSonBase.)
ToStrings
Gets the instance as an array of strings
Examples
This example demonstartes how to create and display a JSonMessage in a WPF ListBox
Copy
private void InterpreteMessageToListBox(string message_)
{
    // Clear the ListBox we wish to populate
    lbDebug.Items.Clear();
    // Create our JSonMessage instance from the provided string
    JSonMessage message = new JSonMessage(message_);
    // If the message is valid then proceed
    if (message.IsValid)
    {
        // Add original message and an ampty line
        lbDebug.Items.Add(message_ + "\n");

        // Walk the messages ToStrings() and add them to our ListBox
        foreach (string value in message.ToStrings())
            lbDebug.Items.Add(value);
    }
    else // output the error message
        lbDebug.Items.Add(message.ErrorMessage);
}
Top
Properties
 | Name | Description
Public property | Children | Gets the top level child JSonObjects
Public property | ErrorMessage | Gets an error message or an empty string if no error was encountered (Inherited from JSonBase.)
Public property | IsValid | Gets a validity flag, true is valid else false (Inherited from JSonBase.)
Top
See Also

Reference

Bncs.Protocol.JSon Namespace


JSonMessage Constructor

JSonMessage Constructor
Overload List
 | Name | Description
Public method | JSonMessage(Byte) | Constructs a message from the supplied byte array
Public method | JSonMessage(String) | Constructs a message from the supplied string
Top
See Also

Reference

JSonMessage Class
Bncs.Protocol.JSon Namespace


JSonMessage Constructor (Byte[])

JSonMessage Constructor (Byte)
Constructs a message from the supplied byte array

Namespace: Bncs.Protocol.JSon
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public JSonMessage(
    byte[] message_
)

Parameters

message_
Type: SystemByte
Message to parse
See Also

Reference

JSonMessage Class
JSonMessage Overload
Bncs.Protocol.JSon Namespace


JSonMessage Constructor (String)

JSonMessage Constructor (String)
Constructs a message from the supplied string

Namespace: Bncs.Protocol.JSon
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public JSonMessage(
    string message_
)

Parameters

message_
Type: SystemString
Message to parse
See Also

Reference

JSonMessage Class
JSonMessage Overload
Bncs.Protocol.JSon Namespace


JSonMessage Methods

JSonMessage Methods

The JSonMessage type exposes the following members.

Methods
Name Description
AllValuesExist
Checks if the Json message contains all path names supplied
Examples
This example creates a hard coded message and finds a value in the message from the hard codded JSon path
Copy
private void CreateMessageAndCheckValueNames()
{
    // Create a JSonMessageInstance
    JSonMessage message = new JSonMessage("{ \"header\":{\"id\":0}, \"data\":{ \"name\":\"NAME\", \"description\":\"DESCRIPTION\", \"tags\":[\"SRC\",\"DST\",\"NONE\"]} }");
    // If it's valid then proceed
    if (message.IsValid)
    {
        // Find out if values exist for all supplied value names
        if (message.AllValuesExist("data\\ok", "data\\id", "sequenceId"))
            MessageBox.ShowMessage("All values were found", "Success");
        else
            MessageBox.ShowMessage("Not all values were found", "Error");
    }
    else // Show error message
        MessageBox.Show(message.ErrorMessage, "Error");
}
Public method Equals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
FindValue
Looks up a value on the supplied JSon path
Examples
This example creates a hard coded message and finds a value in the message from the hard codded JSon path
Copy
private void CreateMessageAndSeekValue()
{
    // Create a JSonMessageInstance
    JSonMessage message = new JSonMessage("{ \"header\":{\"id\":0}, \"data\":{ \"name\":\"NAME\", \"description\":\"DESCRIPTION\", \"tags\":[\"SRC\",\"DST\",\"NONE\"]} }");
    // If it's valid then proceed
    if (message.IsValid)
    {
        // Try and find the second value in the array named "tags" in the root level object "data"
        object value = message.FindValue("data\\tags[1]");
        if (null == value) // Not found
            MessageBox.Show("Failed to find a value at: data\\tags[1]", "Value Not Found");
        else // found so show the value and it's type, in this case: "DST" of type System.String
            MessageBox.Show("Value:\n\n" + value.ToString() + "\n\nFound at: data\\tags[1]\n\nType: " + value.GetType().ToString() , "Value Found");
    }
    else // Show error message
        MessageBox.Show(message.ErrorMessage, "Error");
}
Public method GetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
ToIndentedStrings
Gets the instance as a list of JSonIndentedStrings
Examples
This example demonstrates how to create and display a JSonMessage in a WPF TreeView control
Copy
private void InterpreteMessageToTreeView(string message_)
{
    // Clear the TreeView we wish to poulate
    tvDebug.Items.Clear();
    // Create a JSonMessage instance from the supplied string
    JSonMessage message = new JSonMessage(message_);

    // If valid we may proceed
    if (message.IsValid)
    {
        TreeViewItem rootItem = null;
        TreeViewItem currentItem = null;
        TreeViewItem newItem = null;
        uint currentLevel = 0;
        uint thisLevel = 0;
        foreach (JSonIndentedString istring in message.ToIndentedStrings())
        {
            thisLevel = istring.Indent;
            if (0 == istring.Indent)
            {
                rootItem = new TreeViewItem();
                rootItem.Header = istring.Value;
                tvDebug.Items.Add(rootItem);
            }
            else if (1 == istring.Indent)
            {
                newItem = new TreeViewItem();
                newItem.Header = istring.Value;
                rootItem.Items.Add(newItem);
            }
            else if (thisLevel > currentLevel)
            {
                currentItem = newItem;
                newItem = new TreeViewItem();
                newItem.Header = istring.Value;
                currentItem.Items.Add(newItem);
            }
            else if (currentLevel > thisLevel)
            {
                for (int loop = 0; loop < currentLevel - thisLevel; ++loop)
                    currentItem = (TreeViewItem)currentItem.Parent;
                newItem = new TreeViewItem();
                newItem.Header = istring.Value;
                currentItem.Items.Add(newItem);
            }
            else
            {
                newItem = new TreeViewItem();
                newItem.Header = istring.Value;
                currentItem.Items.Add(newItem);
            }

            currentLevel = thisLevel;
        }
    }
    else // Handle invalid message by displaying the error
        MessageBox.Show(message.ErrorMessage, "Error");
}
Public method ToString
Gets the instance as a string
(Inherited from JSonBase.)
ToStrings
Gets the instance as an array of strings
Examples
This example demonstartes how to create and display a JSonMessage in a WPF ListBox
Copy
private void InterpreteMessageToListBox(string message_)
{
    // Clear the ListBox we wish to populate
    lbDebug.Items.Clear();
    // Create our JSonMessage instance from the provided string
    JSonMessage message = new JSonMessage(message_);
    // If the message is valid then proceed
    if (message.IsValid)
    {
        // Add original message and an ampty line
        lbDebug.Items.Add(message_ + "\n");

        // Walk the messages ToStrings() and add them to our ListBox
        foreach (string value in message.ToStrings())
            lbDebug.Items.Add(value);
    }
    else // output the error message
        lbDebug.Items.Add(message.ErrorMessage);
}
Top
See Also

Reference

JSonMessage Class
Bncs.Protocol.JSon Namespace


JSonMessage.AllValuesExist Method

JSonMessageAllValuesExist Method
Checks if the Json message contains all path names supplied
Examples
This example creates a hard coded message and finds a value in the message from the hard codded JSon path
Copy
private void CreateMessageAndCheckValueNames()
{
    // Create a JSonMessageInstance
    JSonMessage message = new JSonMessage("{ \"header\":{\"id\":0}, \"data\":{ \"name\":\"NAME\", \"description\":\"DESCRIPTION\", \"tags\":[\"SRC\",\"DST\",\"NONE\"]} }");
    // If it's valid then proceed
    if (message.IsValid)
    {
        // Find out if values exist for all supplied value names
        if (message.AllValuesExist("data\\ok", "data\\id", "sequenceId"))
            MessageBox.ShowMessage("All values were found", "Success");
        else
            MessageBox.ShowMessage("Not all values were found", "Error");
    }
    else // Show error message
        MessageBox.Show(message.ErrorMessage, "Error");
}

Namespace: Bncs.Protocol.JSon
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool AllValuesExist(
    params string[] valuePathNames_
)

Parameters

valuePathNames_
Type: SystemString
A parameterised list of strings, path names

Return Value

Type: Boolean
True if a value exists for all supplied names, else false
See Also

Reference

JSonMessage Class
Bncs.Protocol.JSon Namespace


JSonMessage.FindValue Method

JSonMessageFindValue Method
Looks up a value on the supplied JSon path
Examples
This example creates a hard coded message and finds a value in the message from the hard codded JSon path
Copy
private void CreateMessageAndSeekValue()
{
    // Create a JSonMessageInstance
    JSonMessage message = new JSonMessage("{ \"header\":{\"id\":0}, \"data\":{ \"name\":\"NAME\", \"description\":\"DESCRIPTION\", \"tags\":[\"SRC\",\"DST\",\"NONE\"]} }");
    // If it's valid then proceed
    if (message.IsValid)
    {
        // Try and find the second value in the array named "tags" in the root level object "data"
        object value = message.FindValue("data\\tags[1]");
        if (null == value) // Not found
            MessageBox.Show("Failed to find a value at: data\\tags[1]", "Value Not Found");
        else // found so show the value and it's type, in this case: "DST" of type System.String
            MessageBox.Show("Value:\n\n" + value.ToString() + "\n\nFound at: data\\tags[1]\n\nType: " + value.GetType().ToString() , "Value Found");
    }
    else // Show error message
        MessageBox.Show(message.ErrorMessage, "Error");
}

Namespace: Bncs.Protocol.JSon
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Object FindValue(
    string path_
)

Parameters

path_
Type: SystemString
A string with sub element names delimited by a forward slash

Return Value

Type: Object
The object sought if found else null
See Also

Reference

JSonMessage Class
Bncs.Protocol.JSon Namespace


JSonMessage.ToIndentedStrings Method

JSonMessageToIndentedStrings Method
Gets the instance as a list of JSonIndentedStrings
Examples
This example demonstrates how to create and display a JSonMessage in a WPF TreeView control
Copy
private void InterpreteMessageToTreeView(string message_)
{
    // Clear the TreeView we wish to poulate
    tvDebug.Items.Clear();
    // Create a JSonMessage instance from the supplied string
    JSonMessage message = new JSonMessage(message_);

    // If valid we may proceed
    if (message.IsValid)
    {
        TreeViewItem rootItem = null;
        TreeViewItem currentItem = null;
        TreeViewItem newItem = null;
        uint currentLevel = 0;
        uint thisLevel = 0;
        foreach (JSonIndentedString istring in message.ToIndentedStrings())
        {
            thisLevel = istring.Indent;
            if (0 == istring.Indent)
            {
                rootItem = new TreeViewItem();
                rootItem.Header = istring.Value;
                tvDebug.Items.Add(rootItem);
            }
            else if (1 == istring.Indent)
            {
                newItem = new TreeViewItem();
                newItem.Header = istring.Value;
                rootItem.Items.Add(newItem);
            }
            else if (thisLevel > currentLevel)
            {
                currentItem = newItem;
                newItem = new TreeViewItem();
                newItem.Header = istring.Value;
                currentItem.Items.Add(newItem);
            }
            else if (currentLevel > thisLevel)
            {
                for (int loop = 0; loop < currentLevel - thisLevel; ++loop)
                    currentItem = (TreeViewItem)currentItem.Parent;
                newItem = new TreeViewItem();
                newItem.Header = istring.Value;
                currentItem.Items.Add(newItem);
            }
            else
            {
                newItem = new TreeViewItem();
                newItem.Header = istring.Value;
                currentItem.Items.Add(newItem);
            }

            currentLevel = thisLevel;
        }
    }
    else // Handle invalid message by displaying the error
        MessageBox.Show(message.ErrorMessage, "Error");
}

Namespace: Bncs.Protocol.JSon
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<JSonIndentedString> ToIndentedStrings()

Return Value

Type: List JSonIndentedString
A list of indented strings, handy for displaying in a TreeView
See Also

Reference

JSonMessage Class
Bncs.Protocol.JSon Namespace


JSonMessage.ToStrings Method

JSonMessageToStrings Method
Gets the instance as an array of strings
Examples
This example demonstartes how to create and display a JSonMessage in a WPF ListBox
Copy
private void InterpreteMessageToListBox(string message_)
{
    // Clear the ListBox we wish to populate
    lbDebug.Items.Clear();
    // Create our JSonMessage instance from the provided string
    JSonMessage message = new JSonMessage(message_);
    // If the message is valid then proceed
    if (message.IsValid)
    {
        // Add original message and an ampty line
        lbDebug.Items.Add(message_ + "\n");

        // Walk the messages ToStrings() and add them to our ListBox
        foreach (string value in message.ToStrings())
            lbDebug.Items.Add(value);
    }
    else // output the error message
        lbDebug.Items.Add(message.ErrorMessage);
}

Namespace: Bncs.Protocol.JSon
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string[] ToStrings()

Return Value

Type: String
An array of indented strings
See Also

Reference

JSonMessage Class
Bncs.Protocol.JSon Namespace


JSonMessage Properties

JSonMessage Properties

The JSonMessage type exposes the following members.

Properties
 | Name | Description
Public property | Children | Gets the top level child JSonObjects
Public property | ErrorMessage | Gets an error message or an empty string if no error was encountered (Inherited from JSonBase.)
Public property | IsValid | Gets a validity flag, true is valid else false (Inherited from JSonBase.)
Top
See Also

Reference

JSonMessage Class
Bncs.Protocol.JSon Namespace


JSonMessage.Children Property

JSonMessageChildren Property
Gets the top level child JSonObjects

Namespace: Bncs.Protocol.JSon
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<JSonObject> Children { get; }

Property Value

Type: List JSonObject
See Also

Reference

JSonMessage Class
Bncs.Protocol.JSon Namespace


JSonObject Class

JSonObject Class
Base class for all JSon object types that make up a JSon message
Inheritance Hierarchy
SystemObject
Bncs.Protocol.JSonJSonBase
Bncs.Protocol.JSonJSonObject
Bncs.Protocol.JSonJSonArray
Bncs.Protocol.JSonJSonProperty
Bncs.Protocol.JSonJSonStructure

Namespace: Bncs.Protocol.JSon
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public abstract class JSonObject : JSonBase

The JSonObject type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Gets the instance as a string (Inherited from JSonBase.)
Top
Properties
 | Name | Description
Public property | ErrorMessage | Gets an error message or an empty string if no error was encountered (Inherited from JSonBase.)
Public property | IsValid | Gets a validity flag, true is valid else false (Inherited from JSonBase.)
Public property | JType | Gets the type as an enumeration
Public property | Name | Gets the name
Top
See Also

Reference

Bncs.Protocol.JSon Namespace


JSonObject Methods

JSonObject Methods

The JSonObject type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Gets the instance as a string (Inherited from JSonBase.)
Top
See Also

Reference

JSonObject Class
Bncs.Protocol.JSon Namespace


JSonObject Properties

JSonObject Properties

The JSonObject type exposes the following members.

Properties
 | Name | Description
Public property | ErrorMessage | Gets an error message or an empty string if no error was encountered (Inherited from JSonBase.)
Public property | IsValid | Gets a validity flag, true is valid else false (Inherited from JSonBase.)
Public property | JType | Gets the type as an enumeration
Public property | Name | Gets the name
Top
See Also

Reference

JSonObject Class
Bncs.Protocol.JSon Namespace


JSonObject.JType Property

JSonObjectJType Property
Gets the type as an enumeration

Namespace: Bncs.Protocol.JSon
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public JSonType JType { get; }

Property Value

Type: JSonType
See Also

Reference

JSonObject Class
Bncs.Protocol.JSon Namespace


JSonObject.Name Property

JSonObjectName Property
Gets the name

Namespace: Bncs.Protocol.JSon
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Name { get; }

Property Value

Type: String
See Also

Reference

JSonObject Class
Bncs.Protocol.JSon Namespace


JSonProperty Class

JSonProperty Class
JSon property, a simple name/value pair where value may be any C# object
Inheritance Hierarchy
SystemObject
Bncs.Protocol.JSonJSonBase
Bncs.Protocol.JSonJSonObject
Bncs.Protocol.JSonJSonProperty

Namespace: Bncs.Protocol.JSon
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class JSonProperty : JSonObject

The JSonProperty type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Gets the instance as a string (Inherited from JSonBase.)
Top
Properties
 | Name | Description
Public property | ErrorMessage | Gets an error message or an empty string if no error was encountered (Inherited from JSonBase.)
Public property | IsValid | Gets a validity flag, true is valid else false (Inherited from JSonBase.)
Public property | JType | Gets the type as an enumeration (Inherited from JSonObject.)
Public property | Name | Gets the name (Inherited from JSonObject.)
Public property | Value | Gets the value
Top
See Also

Reference

Bncs.Protocol.JSon Namespace


JSonProperty Methods

JSonProperty Methods

The JSonProperty type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Gets the instance as a string (Inherited from JSonBase.)
Top
See Also

Reference

JSonProperty Class
Bncs.Protocol.JSon Namespace


JSonProperty Properties

JSonProperty Properties

The JSonProperty type exposes the following members.

Properties
 | Name | Description
Public property | ErrorMessage | Gets an error message or an empty string if no error was encountered (Inherited from JSonBase.)
Public property | IsValid | Gets a validity flag, true is valid else false (Inherited from JSonBase.)
Public property | JType | Gets the type as an enumeration (Inherited from JSonObject.)
Public property | Name | Gets the name (Inherited from JSonObject.)
Public property | Value | Gets the value
Top
See Also

Reference

JSonProperty Class
Bncs.Protocol.JSon Namespace


JSonProperty.Value Property

JSonPropertyValue Property
Gets the value

Namespace: Bncs.Protocol.JSon
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Object Value { get; }

Property Value

Type: Object
See Also

Reference

JSonProperty Class
Bncs.Protocol.JSon Namespace


JSonStructure Class

JSonStructure Class
JSon structure, a class containing child values, these may be any JSonObject derivitive
Inheritance Hierarchy
SystemObject
Bncs.Protocol.JSonJSonBase
Bncs.Protocol.JSonJSonObject
Bncs.Protocol.JSonJSonStructure

Namespace: Bncs.Protocol.JSon
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class JSonStructure : JSonObject

The JSonStructure type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Gets the instance as a string (Inherited from JSonBase.)
Top
Properties
 | Name | Description
Public property | ErrorMessage | Gets an error message or an empty string if no error was encountered (Inherited from JSonBase.)
Public property | IsValid | Gets a validity flag, true is valid else false (Inherited from JSonBase.)
Public property | JType | Gets the type as an enumeration (Inherited from JSonObject.)
Public property | Members | Gets the members as a list of JSonObjects
Public property | Name | Gets the name (Inherited from JSonObject.)
Top
See Also

Reference

Bncs.Protocol.JSon Namespace


JSonStructure Methods

JSonStructure Methods

The JSonStructure type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Gets the instance as a string (Inherited from JSonBase.)
Top
See Also

Reference

JSonStructure Class
Bncs.Protocol.JSon Namespace


JSonStructure Properties

JSonStructure Properties

The JSonStructure type exposes the following members.

Properties
 | Name | Description
Public property | ErrorMessage | Gets an error message or an empty string if no error was encountered (Inherited from JSonBase.)
Public property | IsValid | Gets a validity flag, true is valid else false (Inherited from JSonBase.)
Public property | JType | Gets the type as an enumeration (Inherited from JSonObject.)
Public property | Members | Gets the members as a list of JSonObjects
Public property | Name | Gets the name (Inherited from JSonObject.)
Top
See Also

Reference

JSonStructure Class
Bncs.Protocol.JSon Namespace


JSonStructure.Members Property

JSonStructureMembers Property
Gets the members as a list of JSonObjects

Namespace: Bncs.Protocol.JSon
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<JSonObject> Members { get; }

Property Value

Type: List JSonObject
See Also

Reference

JSonStructure Class
Bncs.Protocol.JSon Namespace


JSonType Enumeration

JSonType Enumeration
Type enumerator, betrays the type of an object

Namespace: Bncs.Protocol.JSon
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum JSonType
Members
Member name | Value | Description
Unknown | 0 | Erroneous type
Structure | 1 | Structure of values
Array | 2 | Array of values
Property | 3 | A property, ie a name/value pair
See Also

Reference

Bncs.Protocol.JSon Namespace


Bncs.SysUtils Namespace

Bncs.SysUtils Namespace
This namespace has classes and methods enabling you to manipulate files and directories on your system, easily read the command line of your app, an INI file class, a class enabling you to write to the Windows system log (Event Viewer) and types for extra exception handling.
Classes
Class Description
Public class AmbiguousFileDirFuncs
A class for use with the FileSystemWatcher whereby a system change might be a file or a directory. This class will copy, delete or rename path names regardless of whether the paths provided are file names or directory names.
Public class AppDataDirectory
Manages an application data directory.
Public class Benchmark
A class that is used to wrap code to ascertain the time the code took to execute
Public class CachedTextFile
Class encapsulating a text file
Public class CIString
Class that encapsulates a string and executes a case insensitive compare when evaluating with Equals()
Public class ClassFieldReflector
Class to reflect field names and their values from a specified class type
CommandLine
A static class that returns command line information.
Examples
This code is an example of all CommandLine properties.
Copy
class Program
{
    static void Main()
    {
        Console.WriteLine("Executable: " + CommandLine.Command);
        Console.WriteLine("Full cmd line: " + CommandLine.FullCommandLine);
        Console.WriteLine("Last param: " + CommandLine.LastParameter);
        Console.WriteLine("Param Count: " + CommandLine.ParameterCount.ToString());
        Console.WriteLine("Parameters: " + CommandLine.ParameterLine);
        int index = 0;
        foreach(string parameter in CommandLine.Parameters)
        {
            ++index;
            Console.WriteLine("Parameter #" + index.ToString() + ": " + parameter);
        }

        Console.ReadKey();
    }
}
Public class CString
Manages a string as a "C" style string whereby tabs, new line and return characters are replaced with escape characters.
Public class DataBuffer
A class that manages an array of bytes with methods to enable buffer manipulation and conversion to string.
Public class DirectoryInfoEx
DirectoryInfoEx, surfaces long and short directory name properties for the given directory.
Public class DirFileFuncs
Various file and directory orientated functions.
Public class DirFuncs
Various directory orientated functions.
Public class DriveFuncs
Various disk drive orientated functions.
Public class DriveInfoEx
Gets disk drive information extra to that returned by DriveInfo instances
Public class EnumFuncs
A static class of enumeration related functions.
Public class EpochTime
Class that calculates universal epoch time from the date, dates or time span supplied
Public class FileCopyPairing
A class that keeps a pair of file names
Public class FileCopyParameters
A class that stores the parameters required for file copying using the FileCopyPairing class.
Public class FileFuncs
Various file orientated functions.
Public class FileInfoEx
FileInfoEx, surfaces an underlying FileInfo object and makes all the attributes booleans. Also contains a file compare method.
Public class FileSplitAndJoin
A class to split a file into segments or create a file by joining segments with an option to thread these operations
Public class HwndInfo
Class that encapsulates a Window with properties for handle, class name, caption and process.
Public class HwndMonitor
Class that reports event driven changes pertaining to the active window and window move, resize and caption text change. By default the classes events are fired for any window that calls back into the object. However if the object has at least one window handle added to it's internal windows to monitor list the events will only fire when called from these windows.
Public class INIFile
Class representing an INI file. May be populated from an INI file or an XML file
Public class LinkFile
A class that reads Windows shortcut files (.LNK) and extracts it's data.
Public class MultiFileCopier
A class that executes multiple file copies in a seperate thread
Public class OnCompletedEventArgs
Event arguments for split/join completed
Public class OnFileCopyEventArgs
Argument class for the OnFileCopyEventHandler
Public class OnProgressEventArgs
Event handler and arguments for split/join progress
Public class OnTextFileErrorEventArgs
Event argument class for TextFile class errors
Public class OnWindowUpdateEventArgs
Event args class for WndMonitor events.
Public class Range
Class that stores a range of integers for range checking purposes.
Public class SegmentFile
Class representing a segmented file (i.e. a sub file of a whole file). This class ensures that any such list of this type will be sorted by date/time from the oldest.
Public class SpecialDirectory
A class to get Windows special directory paths and names
Public class StringMask
A class that contains a string with a mask (intended "friendly name")
Public class SystemEventLogWriter
A class that writes log data to the system event log.
Public class TextFile
Class that opens or creates, writes to and closes a text file
Public class TextFileCache
Class encapsulatng a multiple text file cache.
Public class TextFileLine
Class encapsulating a single text file line.
Public class ThreadTimer
A thread safe timer class
Public class WinAPI
Class for importing WinAPI methods
Public class WindowsExit
Class that executes a Windows exit.
Public class WinFuncs
Class that defines a host of handy reusable windows API operations.
Public class WMFuncs
Windows messaging functions
Public class XByte
A class encapsulating a byte with a public interface that supports getting and setting of bits.
Public class Xception
A static class with methods that return messages traversed through the exception stack for a supplied exception.
Structures
 | Structure | Description
Public structure | COPYDATASTRUCT | Copy data structure
Public structure | CWPRETSTRUCT | Defines the message parameters passed to a WH_CALLWNDPROCRET hook procedure, CallWndRetProc.
Public structure | RECT | The RECT structure defines the coordinates of the upper-left and lower-right corners of a rectangle.
Public structure | TokPriv1Luid | Token privilege structure
Public structure | WINDOWPLACEMENT | Contains information about the placement of a window on the screen.
Public structure | WPFMessage | A structure that encapsulates a windows message.
Delegates
 | Delegate | Description
Public delegate | OnCompletedEventHandler | Event handler delegate for split/join completed
Public delegate | OnFileCopyEventHandler | Delegate for the [!:Bncs.SysUtils.MultiFileCopier.OnFileCopy] event
Public delegate | OnProgressEventHandler | Delegate for split/join progress events.
Public delegate | OnTextFileErrorEventHandler | Event handler delegate for TextFile class errors
Public delegate | OnWindowUpdateEventHandler | Event handler delegate for WndMonitor events.
Public delegate | WinAPICBTProc | An application-defined or library-defined callback function used with the SetWindowsHookEx function. The system calls this function before activating, creating, destroying, minimizing, maximizing, moving, or sizing a window; before completing a system command; before removing a mouse or keyboard event from the system message queue; before setting the keyboard focus; or before synchronizing with the system message queue. A computer-based training (CBT) application uses this hook procedure to receive useful notifications from the system.
Public delegate | WinAPIEnumedWindow | EnumWindows callback delegate.
Public delegate | WinAPIEnumWindowProc | EnumWindow callback.
Public delegate | WinAPIHookProc | The HOOKPROC type defines a pointer to this callback function. CallWndRetProc is a placeholder for the application-defined or library-defined function name.
Public delegate | WinAPIWin32Callback | Win32 callback delegate for child windows.
Public delegate | WinAPIWinEventDelegate | An application-defined callback (or hook) function that the system calls in response to events generated by an accessible object. The hook function processes the event notifications as required. Clients install the hook function and request specific types of event notifications by calling SetWinEventHook.
Enumerations
 | Enumeration | Description
Public enumeration | DriveFileSystemType | Enumeration denoting disk drive file system types.
Public enumeration | EpochTimeEndType | Epoch time end types used by the EpochTime class
Public enumeration | EscapeSequenceInterpretationType | An enumerator denoting the escape sequence interpretation.
Public enumeration | FileExistOption | File exists option enumeration for Copy()
Public enumeration | FileJoinResult | Enumeration to indicate the file join result
Public enumeration | FileLocale | File location type enumeration
Public enumeration | FileSplitUnit | Enumeration to indicate the file split unit
Public enumeration | FileTimeType | File time type to indicate file time to change in ReviseFileTime()
Public enumeration | FindFileLocation | Enumeration denoting location of file to find.
Public enumeration | HCBT | CBT values.
Public enumeration | HookType | The type of hook procedure to be installed by SetWindowsHookEx.
Public enumeration | HwndSnapshotResult | The type of result for HwndInfo.Snapshot() method.
Public enumeration | HwndTerminateResult | Result of the HwndInfo.Terminate() method
Public enumeration | IconLoadBehaviour | Enumerator that dictates the behaviour of LinkFile in respect of icons.
Public enumeration | INILineType | Enumeration of INI file line types
Public enumeration | PathLocale | Path location type enumeration
Public enumeration | ShowWindowCommands | Enumeration for ShowWindow()
Public enumeration | ShredOptions | Enumeration denoting the number of overwrites to perform in a file shred operation.
Public enumeration | SpecialDir | Types defining the system special directories
Public enumeration | SpecialDirEx | Extended types defining the system special directories.
Public enumeration | SplitOperation | Enumeration to reflect the operation
Public enumeration | WindowsExitType | An enumeration denoting a particular type of Windows exit.
Public enumeration | WriteMode | Enumeration of write modes
Public enumeration | XBit | Bit enumeration to denote bits in a byte.


AmbiguousFileDirFuncs Class

AmbiguousFileDirFuncs Class
A class for use with the FileSystemWatcher whereby a system change might be a file or a directory. This class will copy, delete or rename path names regardless of whether the paths provided are file names or directory names.
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsAmbiguousFileDirFuncs

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static class AmbiguousFileDirFuncs

The AmbiguousFileDirFuncs type exposes the following members.

Methods
Name | Description
Copy | Copies the supplied source path to the supplied target path. The source path may be a file or a directory. The target path may be a directory in either case but must be a directory if the source is a directory. If the source path is a directory then all sub-directories and files therein are copied also.
Delete | Deletes the supplied path be it a file or a directory. WARNING: If the supplied path is a directory then ALL sub-directories and ALL FILES therein are DELETED too! Use this method with great care.
Exists | Tests if the supplied path exists. The path may be a file name or a directory name.
Top
See Also

Reference

Bncs.SysUtils Namespace


AmbiguousFileDirFuncs Methods

AmbiguousFileDirFuncs Methods

The AmbiguousFileDirFuncs type exposes the following members.

Methods
Name | Description
Copy | Copies the supplied source path to the supplied target path. The source path may be a file or a directory. The target path may be a directory in either case but must be a directory if the source is a directory. If the source path is a directory then all sub-directories and files therein are copied also.
Delete | Deletes the supplied path be it a file or a directory. WARNING: If the supplied path is a directory then ALL sub-directories and ALL FILES therein are DELETED too! Use this method with great care.
Exists | Tests if the supplied path exists. The path may be a file name or a directory name.
Top
See Also

Reference

AmbiguousFileDirFuncs Class
Bncs.SysUtils Namespace


AmbiguousFileDirFuncs.Copy Method

AmbiguousFileDirFuncsCopy Method
Copies the supplied source path to the supplied target path. The source path may be a file or a directory. The target path may be a directory in either case but must be a directory if the source is a directory. If the source path is a directory then all sub-directories and files therein are copied also.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Copy(
    string sourcePath_,
    string targetPath_
)

Parameters

sourcePath_
Type: SystemString
Source path to copy
targetPath_
Type: SystemString
Target path to copy to

Return Value

Type: Boolean
True on success
See Also

Reference

AmbiguousFileDirFuncs Class
Bncs.SysUtils Namespace


AmbiguousFileDirFuncs.Delete Method

AmbiguousFileDirFuncsDelete Method
Deletes the supplied path be it a file or a directory. WARNING: If the supplied path is a directory then ALL sub-directories and ALL FILES therein are DELETED too! Use this method with great care.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Delete(
    string sourcePath_
)

Parameters

sourcePath_
Type: SystemString
File or directory name to delete

Return Value

Type: Boolean

[Missing <returns> documentation for "M:Bncs.SysUtils.AmbiguousFileDirFuncs.Delete(System.String)"]

See Also

Reference

AmbiguousFileDirFuncs Class
Bncs.SysUtils Namespace


AmbiguousFileDirFuncs.Exists Method

AmbiguousFileDirFuncsExists Method
Tests if the supplied path exists. The path may be a file name or a directory name.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Exists(
    string sourcePath_
)

Parameters

sourcePath_
Type: SystemString
Path to test existence of

Return Value

Type: Boolean
True if the file or directory exists
See Also

Reference

AmbiguousFileDirFuncs Class
Bncs.SysUtils Namespace


AppDataDirectory Class

AppDataDirectory Class
Manages an application data directory.
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsAppDataDirectory

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class AppDataDirectory

The AppDataDirectory type exposes the following members.

Constructors
Name Description
Public method AppDataDirectory(String, String)
Constructor that sets the author name and application name, if directory does not exist it is created
AppDataDirectory(String, String, Boolean)
Constructor that sets the author name and application name, if directory does not exist it is optionally created
Examples
This code demonstrates the use of AppDataDirectory to create and retrieve an application data path for for the given company and application title.
Copy
class Program
{
    static void Main()
    {
        // Set up an application data object without creating it
        AppDataDirectory dir = new AppDataDirectory("ACME Apps", "Test App", false);
        Console.WriteLine("The path for ACME Apps test app is: \"" + dir.Path + "\"");
        // Check if it exists
        if (DirFuncs.Exists(dir.Path))
            Console.WriteLine("This path exists");
        else
        {
            Console.WriteLine("This path does not exist and is being created ...");
            // Create the path
            if (dir.Create())
                Console.WriteLine("The path was created successfully");
            else
                Console.WriteLine("Failed to create path");
        }

        Console.ReadKey();
    }
}
Top
Methods
Name Description
Create
Creates the directory if it does not exist
Examples
This code demonstrates the use of AppDataDirectory to create and retrieve an application data path for for the given company and application title.
Copy
class Program
{
    static void Main()
    {
        // Set up an application data object without creating it
        AppDataDirectory dir = new AppDataDirectory("ACME Apps", "Test App", false);
        Console.WriteLine("The path for ACME Apps test app is: \"" + dir.Path + "\"");
        // Check if it exists
        if (DirFuncs.Exists(dir.Path))
            Console.WriteLine("This path exists");
        else
        {
            Console.WriteLine("This path does not exist and is being created ...");
            // Create the path
            if (dir.Create())
                Console.WriteLine("The path was created successfully");
            else
                Console.WriteLine("Failed to create path");
        }

        Console.ReadKey();
    }
}
Public method Equals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public method GetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method ToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
 | Name | Description
Public property | ApplicationTitle | Returns the application title
Public property | Author | Returns the author
Public property | Exists | Returns true if the directory exists
Public property | Path | Returns the full directory name
Top
See Also

Reference

Bncs.SysUtils Namespace


AppDataDirectory Constructor

AppDataDirectory Constructor
Overload List
Name Description
Public method AppDataDirectory(String, String)
Constructor that sets the author name and application name, if directory does not exist it is created
AppDataDirectory(String, String, Boolean)
Constructor that sets the author name and application name, if directory does not exist it is optionally created
Examples
This code demonstrates the use of AppDataDirectory to create and retrieve an application data path for for the given company and application title.
Copy
class Program
{
    static void Main()
    {
        // Set up an application data object without creating it
        AppDataDirectory dir = new AppDataDirectory("ACME Apps", "Test App", false);
        Console.WriteLine("The path for ACME Apps test app is: \"" + dir.Path + "\"");
        // Check if it exists
        if (DirFuncs.Exists(dir.Path))
            Console.WriteLine("This path exists");
        else
        {
            Console.WriteLine("This path does not exist and is being created ...");
            // Create the path
            if (dir.Create())
                Console.WriteLine("The path was created successfully");
            else
                Console.WriteLine("Failed to create path");
        }

        Console.ReadKey();
    }
}
Top
See Also

Reference

AppDataDirectory Class
Bncs.SysUtils Namespace


AppDataDirectory Constructor (String, String)

AppDataDirectory Constructor (String, String)
Constructor that sets the author name and application name, if directory does not exist it is created

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public AppDataDirectory(
    string author_,
    string applicationTitle_
)

Parameters

author_
Type: SystemString
Author directory
applicationTitle_
Type: SystemString
Application title directory
See Also

Reference

AppDataDirectory Class
AppDataDirectory Overload
Bncs.SysUtils Namespace


AppDataDirectory Constructor (String, String, Boolean)

AppDataDirectory Constructor (String, String, Boolean)
Constructor that sets the author name and application name, if directory does not exist it is optionally created
Examples
This code demonstrates the use of AppDataDirectory to create and retrieve an application data path for for the given company and application title.
Copy
class Program
{
    static void Main()
    {
        // Set up an application data object without creating it
        AppDataDirectory dir = new AppDataDirectory("ACME Apps", "Test App", false);
        Console.WriteLine("The path for ACME Apps test app is: \"" + dir.Path + "\"");
        // Check if it exists
        if (DirFuncs.Exists(dir.Path))
            Console.WriteLine("This path exists");
        else
        {
            Console.WriteLine("This path does not exist and is being created ...");
            // Create the path
            if (dir.Create())
                Console.WriteLine("The path was created successfully");
            else
                Console.WriteLine("Failed to create path");
        }

        Console.ReadKey();
    }
}

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public AppDataDirectory(
    string author_,
    string applicationTitle_,
    bool create_
)

Parameters

author_
Type: SystemString
Author directory
applicationTitle_
Type: SystemString
Application title directory
create_
Type: SystemBoolean
Create directory flag
See Also

Reference

AppDataDirectory Class
AppDataDirectory Overload
Bncs.SysUtils Namespace


AppDataDirectory Methods

AppDataDirectory Methods

The AppDataDirectory type exposes the following members.

Methods
Name Description
Create
Creates the directory if it does not exist
Examples
This code demonstrates the use of AppDataDirectory to create and retrieve an application data path for for the given company and application title.
Copy
class Program
{
    static void Main()
    {
        // Set up an application data object without creating it
        AppDataDirectory dir = new AppDataDirectory("ACME Apps", "Test App", false);
        Console.WriteLine("The path for ACME Apps test app is: \"" + dir.Path + "\"");
        // Check if it exists
        if (DirFuncs.Exists(dir.Path))
            Console.WriteLine("This path exists");
        else
        {
            Console.WriteLine("This path does not exist and is being created ...");
            // Create the path
            if (dir.Create())
                Console.WriteLine("The path was created successfully");
            else
                Console.WriteLine("Failed to create path");
        }

        Console.ReadKey();
    }
}
Public method Equals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public method GetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method ToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
See Also

Reference

AppDataDirectory Class
Bncs.SysUtils Namespace


AppDataDirectory.Create Method

AppDataDirectoryCreate Method
Creates the directory if it does not exist
Examples
This code demonstrates the use of AppDataDirectory to create and retrieve an application data path for for the given company and application title.
Copy
class Program
{
    static void Main()
    {
        // Set up an application data object without creating it
        AppDataDirectory dir = new AppDataDirectory("ACME Apps", "Test App", false);
        Console.WriteLine("The path for ACME Apps test app is: \"" + dir.Path + "\"");
        // Check if it exists
        if (DirFuncs.Exists(dir.Path))
            Console.WriteLine("This path exists");
        else
        {
            Console.WriteLine("This path does not exist and is being created ...");
            // Create the path
            if (dir.Create())
                Console.WriteLine("The path was created successfully");
            else
                Console.WriteLine("Failed to create path");
        }

        Console.ReadKey();
    }
}

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Create()

Return Value

Type: Boolean
True if the directory exists
See Also

Reference

AppDataDirectory Class
Bncs.SysUtils Namespace


AppDataDirectory Properties

AppDataDirectory Properties

The AppDataDirectory type exposes the following members.

Properties
 | Name | Description
Public property | ApplicationTitle | Returns the application title
Public property | Author | Returns the author
Public property | Exists | Returns true if the directory exists
Public property | Path | Returns the full directory name
Top
See Also

Reference

AppDataDirectory Class
Bncs.SysUtils Namespace


AppDataDirectory.ApplicationTitle Property

AppDataDirectoryApplicationTitle Property
Returns the application title

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string ApplicationTitle { get; }

Property Value

Type: String
See Also

Reference

AppDataDirectory Class
Bncs.SysUtils Namespace


AppDataDirectory.Author Property

AppDataDirectoryAuthor Property
Returns the author

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Author { get; }

Property Value

Type: String
See Also

Reference

AppDataDirectory Class
Bncs.SysUtils Namespace


AppDataDirectory.Exists Property

AppDataDirectoryExists Property
Returns true if the directory exists

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Exists { get; }

Property Value

Type: Boolean
See Also

Reference

AppDataDirectory Class
Bncs.SysUtils Namespace


AppDataDirectory.Path Property

AppDataDirectoryPath Property
Returns the full directory name

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Path { get; }

Property Value

Type: String
See Also

Reference

AppDataDirectory Class
Bncs.SysUtils Namespace


Benchmark Class

Benchmark Class
A class that is used to wrap code to ascertain the time the code took to execute
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsBenchmark

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class Benchmark : IDisposable

The Benchmark type exposes the following members.

Constructors
Name Description
Benchmark
Default constructor using default "Bench Test" as a name and starts the timer
Examples
This code demonstrates how to bench test code to report how long the process took
Copy
using System;
using System.IO;
using using Bncs.SysUtils;

namespace Test
{
    class Program
    {
        static void Main()
        {
            using (Benchmark benchmark = new Benchmark())
            {
                // Variable to read lines in to
                string line;
                // Open a text file for reading
                TextReader reader = new StreamReader(@"C:\BNCS\Test\logs\driver.log");
                // Read each line and output until EOF
                while (null != (line = reader.ReadLine()))
                    Console.WriteLine(line);
                // Close the file
                reader.Close();
                // Display the result
                Console.WriteLine(benchmark.Stop());
            }

            Console.ReadKey();
        }
    }
}
Benchmark(String)
Constructor that sets the name and starts the timer
Examples
This code demonstrates how to bench test code to report how long the process took
Copy
using System;
using System.IO;
using using Bncs.SysUtils;

namespace Test
{
    class Program
    {
        static void Main()
        {
            using (Benchmark benchmark = new Benchmark("File read test"))
            {
                // Variable to read lines in to
                string line;
                // Open a text file for reading
                TextReader reader = new StreamReader(@"C:\BNCS\Test\logs\driver.log");
                // Read each line and output until EOF
                while (null != (line = reader.ReadLine()))
                    Console.WriteLine(line);
                // Close the file
                reader.Close();
                // Display the result
                Console.WriteLine(benchmark.Stop());
            }

            Console.ReadKey();
        }
    }
}
Top
Methods
Name Description
Dispose
IDisposable method called to ensure that the timer is always stopped
Examples
This code demonstrates how to bench test code to report how long the process took
Copy
using System;
using System.IO;
using using Bncs.SysUtils;

namespace Test
{
    class Program
    {
        static void Main()
        {
            using (Benchmark benchmark = new Benchmark("File read test"))
            {
                // Variable to read lines in to
                string line;
                // Open a text file for reading
                TextReader reader = new StreamReader(@"C:\BNCS\Test\logs\driver.log");
                // Read each line and output until EOF
                while (null != (line = reader.ReadLine()))
                    Console.WriteLine(line);
                // Close the file
                reader.Close();
            } // Dispose() is called here and writes result to console anyway

            Console.ReadKey();
        }
    }
}
Public method Equals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public method GetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Stop
Stops the timer
Examples
This code demonstrates how to bench test code to report how long the process took
Copy
using System;
using System.IO;
using using Bncs.SysUtils;

namespace Test
{
    class Program
    {
        static void Main()
        {
            using (Benchmark benchmark = new Benchmark("File read test"))
            {
                // Variable to read lines in to
                string line;
                // Open a text file for reading
                TextReader reader = new StreamReader(@"C:\BNCS\Test\logs\driver.log");
                // Read each line and output until EOF
                while (null != (line = reader.ReadLine()))
                    Console.WriteLine(line);
                // Close the file
                reader.Close();
                // Display the result
                Console.WriteLine(benchmark.Stop());
            }

            Console.ReadKey();
        }
    }
}
Public method ToString
Gets the instance as a string
(Overrides ObjectToString.)
Top
Properties
Name Description
Public property BenchmarkName
Gets the name
Result
Gets the result as a string
Examples
This code demonstrates how to bench test code to report how long the process took
Copy
using System;
using System.IO;
using using Bncs.SysUtils;

namespace Test
{
    class Program
    {
        static void Main()
        {
            using (Benchmark benchmark = new Benchmark("File read test"))
            {
                // Variable to read lines in to
                string line;
                // Open a text file for reading
                TextReader reader = new StreamReader(@"C:\BNCS\Test\logs\driver.log");
                // Read each line and output until EOF
                while (null != (line = reader.ReadLine()))
                    Console.WriteLine(line);
                // Close the file
                reader.Close();
                benchmark.Stop();
                Console.WriteLine(benchmark.Result);
            }

            Console.ReadKey();
        }
    }
}
Time
Gets the result as a time span
Examples
This code demonstrates how to use Benchmark in a WPF window application to write data out to a ListBox named lbDebug
Copy
using System;
using System.IO;
using System.Windows.Controls;
using using Bncs.SysUtils;

namespace Test
{
    public partial class MainWindow : Window
    {
        private void ButtonClick(object sender, RoutedEventArgs e)
        {
            TimeSpan? span = null;
            using (Benchmark benchmark = new Benchmark("File read test"))
            {
                // Variable to read lines in to
                string line;
                // Open a text file for reading
                TextReader reader = new StreamReader(@"C:\BNCS\Test\logs\driver.log");
                // Read each line and output until EOF
                while (null != (line = reader.ReadLine()))
                    lbDebug.Items.Add(line);
                // Close the file
                reader.Close();
                span = benchmark.Time;
            }

            if (null != span)
                lbDebug.Items.Add(((TimeSpan)span).ToString());
        }
    }
}
Top
See Also

Reference

Bncs.SysUtils Namespace


Benchmark Constructor

Benchmark Constructor
Overload List
Name Description
Benchmark
Default constructor using default "Bench Test" as a name and starts the timer
Examples
This code demonstrates how to bench test code to report how long the process took
Copy
using System;
using System.IO;
using using Bncs.SysUtils;

namespace Test
{
    class Program
    {
        static void Main()
        {
            using (Benchmark benchmark = new Benchmark())
            {
                // Variable to read lines in to
                string line;
                // Open a text file for reading
                TextReader reader = new StreamReader(@"C:\BNCS\Test\logs\driver.log");
                // Read each line and output until EOF
                while (null != (line = reader.ReadLine()))
                    Console.WriteLine(line);
                // Close the file
                reader.Close();
                // Display the result
                Console.WriteLine(benchmark.Stop());
            }

            Console.ReadKey();
        }
    }
}
Benchmark(String)
Constructor that sets the name and starts the timer
Examples
This code demonstrates how to bench test code to report how long the process took
Copy
using System;
using System.IO;
using using Bncs.SysUtils;

namespace Test
{
    class Program
    {
        static void Main()
        {
            using (Benchmark benchmark = new Benchmark("File read test"))
            {
                // Variable to read lines in to
                string line;
                // Open a text file for reading
                TextReader reader = new StreamReader(@"C:\BNCS\Test\logs\driver.log");
                // Read each line and output until EOF
                while (null != (line = reader.ReadLine()))
                    Console.WriteLine(line);
                // Close the file
                reader.Close();
                // Display the result
                Console.WriteLine(benchmark.Stop());
            }

            Console.ReadKey();
        }
    }
}
Top
See Also

Reference

Benchmark Class
Bncs.SysUtils Namespace


Benchmark Constructor

Benchmark Constructor
Default constructor using default "Bench Test" as a name and starts the timer
Examples
This code demonstrates how to bench test code to report how long the process took
Copy
using System;
using System.IO;
using using Bncs.SysUtils;

namespace Test
{
    class Program
    {
        static void Main()
        {
            using (Benchmark benchmark = new Benchmark())
            {
                // Variable to read lines in to
                string line;
                // Open a text file for reading
                TextReader reader = new StreamReader(@"C:\BNCS\Test\logs\driver.log");
                // Read each line and output until EOF
                while (null != (line = reader.ReadLine()))
                    Console.WriteLine(line);
                // Close the file
                reader.Close();
                // Display the result
                Console.WriteLine(benchmark.Stop());
            }

            Console.ReadKey();
        }
    }
}

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Benchmark()
See Also

Reference

Benchmark Class
Benchmark Overload
Bncs.SysUtils Namespace


Benchmark Constructor (String)

Benchmark Constructor (String)
Constructor that sets the name and starts the timer
Examples
This code demonstrates how to bench test code to report how long the process took
Copy
using System;
using System.IO;
using using Bncs.SysUtils;

namespace Test
{
    class Program
    {
        static void Main()
        {
            using (Benchmark benchmark = new Benchmark("File read test"))
            {
                // Variable to read lines in to
                string line;
                // Open a text file for reading
                TextReader reader = new StreamReader(@"C:\BNCS\Test\logs\driver.log");
                // Read each line and output until EOF
                while (null != (line = reader.ReadLine()))
                    Console.WriteLine(line);
                // Close the file
                reader.Close();
                // Display the result
                Console.WriteLine(benchmark.Stop());
            }

            Console.ReadKey();
        }
    }
}

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Benchmark(
    string benchmarkName_
)

Parameters

benchmarkName_
Type: SystemString
Bench test name
See Also

Reference

Benchmark Class
Benchmark Overload
Bncs.SysUtils Namespace


Benchmark Methods

Benchmark Methods

The Benchmark type exposes the following members.

Methods
Name Description
Dispose
IDisposable method called to ensure that the timer is always stopped
Examples
This code demonstrates how to bench test code to report how long the process took
Copy
using System;
using System.IO;
using using Bncs.SysUtils;

namespace Test
{
    class Program
    {
        static void Main()
        {
            using (Benchmark benchmark = new Benchmark("File read test"))
            {
                // Variable to read lines in to
                string line;
                // Open a text file for reading
                TextReader reader = new StreamReader(@"C:\BNCS\Test\logs\driver.log");
                // Read each line and output until EOF
                while (null != (line = reader.ReadLine()))
                    Console.WriteLine(line);
                // Close the file
                reader.Close();
            } // Dispose() is called here and writes result to console anyway

            Console.ReadKey();
        }
    }
}
Public method Equals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public method GetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Stop
Stops the timer
Examples
This code demonstrates how to bench test code to report how long the process took
Copy
using System;
using System.IO;
using using Bncs.SysUtils;

namespace Test
{
    class Program
    {
        static void Main()
        {
            using (Benchmark benchmark = new Benchmark("File read test"))
            {
                // Variable to read lines in to
                string line;
                // Open a text file for reading
                TextReader reader = new StreamReader(@"C:\BNCS\Test\logs\driver.log");
                // Read each line and output until EOF
                while (null != (line = reader.ReadLine()))
                    Console.WriteLine(line);
                // Close the file
                reader.Close();
                // Display the result
                Console.WriteLine(benchmark.Stop());
            }

            Console.ReadKey();
        }
    }
}
Public method ToString
Gets the instance as a string
(Overrides ObjectToString.)
Top
See Also

Reference

Benchmark Class
Bncs.SysUtils Namespace


Benchmark.Dispose Method

BenchmarkDispose Method
IDisposable method called to ensure that the timer is always stopped
Examples
This code demonstrates how to bench test code to report how long the process took
Copy
using System;
using System.IO;
using using Bncs.SysUtils;

namespace Test
{
    class Program
    {
        static void Main()
        {
            using (Benchmark benchmark = new Benchmark("File read test"))
            {
                // Variable to read lines in to
                string line;
                // Open a text file for reading
                TextReader reader = new StreamReader(@"C:\BNCS\Test\logs\driver.log");
                // Read each line and output until EOF
                while (null != (line = reader.ReadLine()))
                    Console.WriteLine(line);
                // Close the file
                reader.Close();
            } // Dispose() is called here and writes result to console anyway

            Console.ReadKey();
        }
    }
}

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Dispose()

Implements

IDisposableDispose
See Also

Reference

Benchmark Class
Bncs.SysUtils Namespace


Benchmark.Stop Method

BenchmarkStop Method
Stops the timer
Examples
This code demonstrates how to bench test code to report how long the process took
Copy
using System;
using System.IO;
using using Bncs.SysUtils;

namespace Test
{
    class Program
    {
        static void Main()
        {
            using (Benchmark benchmark = new Benchmark("File read test"))
            {
                // Variable to read lines in to
                string line;
                // Open a text file for reading
                TextReader reader = new StreamReader(@"C:\BNCS\Test\logs\driver.log");
                // Read each line and output until EOF
                while (null != (line = reader.ReadLine()))
                    Console.WriteLine(line);
                // Close the file
                reader.Close();
                // Display the result
                Console.WriteLine(benchmark.Stop());
            }

            Console.ReadKey();
        }
    }
}

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Stop()

Return Value

Type: String
The name and result
See Also

Reference

Benchmark Class
Bncs.SysUtils Namespace


Benchmark.ToString Method

BenchmarkToString Method
Gets the instance as a string

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
The name and result (if known)
See Also

Reference

Benchmark Class
Bncs.SysUtils Namespace


Benchmark Properties

Benchmark Properties

The Benchmark type exposes the following members.

Properties
Name Description
Public property BenchmarkName
Gets the name
Result
Gets the result as a string
Examples
This code demonstrates how to bench test code to report how long the process took
Copy
using System;
using System.IO;
using using Bncs.SysUtils;

namespace Test
{
    class Program
    {
        static void Main()
        {
            using (Benchmark benchmark = new Benchmark("File read test"))
            {
                // Variable to read lines in to
                string line;
                // Open a text file for reading
                TextReader reader = new StreamReader(@"C:\BNCS\Test\logs\driver.log");
                // Read each line and output until EOF
                while (null != (line = reader.ReadLine()))
                    Console.WriteLine(line);
                // Close the file
                reader.Close();
                benchmark.Stop();
                Console.WriteLine(benchmark.Result);
            }

            Console.ReadKey();
        }
    }
}
Time
Gets the result as a time span
Examples
This code demonstrates how to use Benchmark in a WPF window application to write data out to a ListBox named lbDebug
Copy
using System;
using System.IO;
using System.Windows.Controls;
using using Bncs.SysUtils;

namespace Test
{
    public partial class MainWindow : Window
    {
        private void ButtonClick(object sender, RoutedEventArgs e)
        {
            TimeSpan? span = null;
            using (Benchmark benchmark = new Benchmark("File read test"))
            {
                // Variable to read lines in to
                string line;
                // Open a text file for reading
                TextReader reader = new StreamReader(@"C:\BNCS\Test\logs\driver.log");
                // Read each line and output until EOF
                while (null != (line = reader.ReadLine()))
                    lbDebug.Items.Add(line);
                // Close the file
                reader.Close();
                span = benchmark.Time;
            }

            if (null != span)
                lbDebug.Items.Add(((TimeSpan)span).ToString());
        }
    }
}
Top
See Also

Reference

Benchmark Class
Bncs.SysUtils Namespace


Benchmark.BenchmarkName Property

BenchmarkBenchmarkName Property
Gets the name

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string BenchmarkName { get; }

Property Value

Type: String
See Also

Reference

Benchmark Class
Bncs.SysUtils Namespace


Benchmark.Result Property

BenchmarkResult Property
Gets the result as a string
Examples
This code demonstrates how to bench test code to report how long the process took
Copy
using System;
using System.IO;
using using Bncs.SysUtils;

namespace Test
{
    class Program
    {
        static void Main()
        {
            using (Benchmark benchmark = new Benchmark("File read test"))
            {
                // Variable to read lines in to
                string line;
                // Open a text file for reading
                TextReader reader = new StreamReader(@"C:\BNCS\Test\logs\driver.log");
                // Read each line and output until EOF
                while (null != (line = reader.ReadLine()))
                    Console.WriteLine(line);
                // Close the file
                reader.Close();
                benchmark.Stop();
                Console.WriteLine(benchmark.Result);
            }

            Console.ReadKey();
        }
    }
}

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Result { get; }

Property Value

Type: String
See Also

Reference

Benchmark Class
Bncs.SysUtils Namespace


Benchmark.Time Property

BenchmarkTime Property
Gets the result as a time span
Examples
This code demonstrates how to use Benchmark in a WPF window application to write data out to a ListBox named lbDebug
Copy
using System;
using System.IO;
using System.Windows.Controls;
using using Bncs.SysUtils;

namespace Test
{
    public partial class MainWindow : Window
    {
        private void ButtonClick(object sender, RoutedEventArgs e)
        {
            TimeSpan? span = null;
            using (Benchmark benchmark = new Benchmark("File read test"))
            {
                // Variable to read lines in to
                string line;
                // Open a text file for reading
                TextReader reader = new StreamReader(@"C:\BNCS\Test\logs\driver.log");
                // Read each line and output until EOF
                while (null != (line = reader.ReadLine()))
                    lbDebug.Items.Add(line);
                // Close the file
                reader.Close();
                span = benchmark.Time;
            }

            if (null != span)
                lbDebug.Items.Add(((TimeSpan)span).ToString());
        }
    }
}

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public TimeSpan Time { get; }

Property Value

Type: TimeSpan
See Also

Reference

Benchmark Class
Bncs.SysUtils Namespace


CachedTextFile Class

CachedTextFile Class
Class encapsulating a text file
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsCachedTextFile

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class CachedTextFile

The CachedTextFile type exposes the following members.

Constructors
 | Name | Description
Public method | CachedTextFile | Constructor
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Refresh | Re-reads the file contents from disk.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | Content | Gets the file contents.
Public property | Filename | Gets the file name.
Public property | Id | Gets the unique ID.
Public property | Size | Gets the file size in bytes
Top
See Also

Reference

Bncs.SysUtils Namespace


CachedTextFile Constructor

CachedTextFile Constructor
Constructor

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CachedTextFile(
    string filename_
)

Parameters

filename_
Type: SystemString
Name of the file to load and read
See Also

Reference

CachedTextFile Class
Bncs.SysUtils Namespace


CachedTextFile Methods

CachedTextFile Methods

The CachedTextFile type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Refresh | Re-reads the file contents from disk.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

CachedTextFile Class
Bncs.SysUtils Namespace


CachedTextFile.Refresh Method

CachedTextFileRefresh Method
Re-reads the file contents from disk.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Refresh()

Return Value

Type: Boolean
True on success
See Also

Reference

CachedTextFile Class
Bncs.SysUtils Namespace


CachedTextFile Properties

CachedTextFile Properties

The CachedTextFile type exposes the following members.

Properties
 | Name | Description
Public property | Content | Gets the file contents.
Public property | Filename | Gets the file name.
Public property | Id | Gets the unique ID.
Public property | Size | Gets the file size in bytes
Top
See Also

Reference

CachedTextFile Class
Bncs.SysUtils Namespace


CachedTextFile.Content Property

CachedTextFileContent Property
Gets the file contents.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string[] Content { get; }

Property Value

Type: String
See Also

Reference

CachedTextFile Class
Bncs.SysUtils Namespace


CachedTextFile.Filename Property

CachedTextFileFilename Property
Gets the file name.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Filename { get; }

Property Value

Type: String
See Also

Reference

CachedTextFile Class
Bncs.SysUtils Namespace


CachedTextFile.Id Property

CachedTextFileId Property
Gets the unique ID.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Id { get; }

Property Value

Type: String
See Also

Reference

CachedTextFile Class
Bncs.SysUtils Namespace


CachedTextFile.Size Property

CachedTextFileSize Property
Gets the file size in bytes

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public long Size { get; }

Property Value

Type: Int64
See Also

Reference

CachedTextFile Class
Bncs.SysUtils Namespace


CIString Class

CIString Class
Class that encapsulates a string and executes a case insensitive compare when evaluating with Equals()
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsCIString

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class CIString

The CIString type exposes the following members.

Constructors
 | Name | Description
Public method | CIString | Default constructor
Public method | CIString(String) | Constructor that sets the underlying string value
Top
Methods
 | Name | Description
Public method | Equals | Tests if the underlying string value in lowercase form is equal to the provided object. This object may either be a native C# string or another CIString instance. (Overrides ObjectEquals(Object).)
Public method | GetHashCode | Gets the hash code (Overrides ObjectGetHashCode.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Gets the instance as a string (Overrides ObjectToString.)
Top
Properties
 | Name | Description
Public property | Value | Gets/sets the Value property
Top
See Also

Reference

Bncs.SysUtils Namespace


CIString Constructor

CIString Constructor
Overload List
 | Name | Description
Public method | CIString | Default constructor
Public method | CIString(String) | Constructor that sets the underlying string value
Top
See Also

Reference

CIString Class
Bncs.SysUtils Namespace


CIString Constructor

CIString Constructor
Default constructor

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CIString()
See Also

Reference

CIString Class
CIString Overload
Bncs.SysUtils Namespace


CIString Constructor (String)

CIString Constructor (String)
Constructor that sets the underlying string value

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CIString(
    string value_
)

Parameters

value_
Type: SystemString
Underlying string property value
See Also

Reference

CIString Class
CIString Overload
Bncs.SysUtils Namespace


CIString Methods

CIString Methods

The CIString type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Tests if the underlying string value in lowercase form is equal to the provided object. This object may either be a native C# string or another CIString instance. (Overrides ObjectEquals(Object).)
Public method | GetHashCode | Gets the hash code (Overrides ObjectGetHashCode.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Gets the instance as a string (Overrides ObjectToString.)
Top
See Also

Reference

CIString Class
Bncs.SysUtils Namespace


CIString.Equals Method

CIStringEquals Method
Tests if the underlying string value in lowercase form is equal to the provided object. This object may either be a native C# string or another CIString instance.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override bool Equals(
    Object obj
)

Parameters

obj
Type: SystemObject
Object to case insensitive compare with the underlying string property

Return Value

Type: Boolean
True if the two strings are equal in lowercase form
See Also

Reference

CIString Class
Bncs.SysUtils Namespace


CIString.GetHashCode Method

CIStringGetHashCode Method
Gets the hash code

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override int GetHashCode()

Return Value

Type: Int32
The hash code
See Also

Reference

CIString Class
Bncs.SysUtils Namespace


CIString.ToString Method

CIStringToString Method
Gets the instance as a string

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
The Value property
See Also

Reference

CIString Class
Bncs.SysUtils Namespace


CIString Properties

CIString Properties

The CIString type exposes the following members.

Properties
 | Name | Description
Public property | Value | Gets/sets the Value property
Top
See Also

Reference

CIString Class
Bncs.SysUtils Namespace


CIString.Value Property

CIStringValue Property
Gets/sets the Value property

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Value { get; set; }

Property Value

Type: String
See Also

Reference

CIString Class
Bncs.SysUtils Namespace


ClassFieldReflector Class

ClassFieldReflector Class
Class to reflect field names and their values from a specified class type
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsClassFieldReflector

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static class ClassFieldReflector

The ClassFieldReflector type exposes the following members.

Methods
Name Description
GetAllValues
Returns a dictionary of name/value pairs for all fields of the supplied class
Examples
This code is an example of ClassFieldReflector.GetAllValues() method.
Copy
class Program
{
    static void Main()
    {
        foreach (KeyValuePair<string, object> pair in ClassFieldReflector.GetAllValues(typeof(TestClass)))
            Console.WriteLine(pair.Key + " - " + pair.Value.ToString());
        Console.ReadKey();
    }
}

public static class TestClass
{
    public const uint THIRTEEN = 13;
    public const uint SEVEN = 7;
    public const string NAME = "Fred";
    public const int THREE = 3;
}
GetConstants
Gets all constant names from the supplied class type
GetValue
Gets a value for the specified field name
GetValuesContaining
Returns a dictionary of name/value pairs for field names that contain the supplied field name fragment
GetValuesEndingWith
Returns a dictionary of name/value pairs for field names that end with the supplied field name fragment
GetValuesStartingWith
Returns a dictionary of name/value pairs for field names that start with the supplied field name fragment
Top
See Also

Reference

Bncs.SysUtils Namespace


ClassFieldReflector Methods

ClassFieldReflector Methods

The ClassFieldReflector type exposes the following members.

Methods
Name Description
GetAllValues
Returns a dictionary of name/value pairs for all fields of the supplied class
Examples
This code is an example of ClassFieldReflector.GetAllValues() method.
Copy
class Program
{
    static void Main()
    {
        foreach (KeyValuePair<string, object> pair in ClassFieldReflector.GetAllValues(typeof(TestClass)))
            Console.WriteLine(pair.Key + " - " + pair.Value.ToString());
        Console.ReadKey();
    }
}

public static class TestClass
{
    public const uint THIRTEEN = 13;
    public const uint SEVEN = 7;
    public const string NAME = "Fred";
    public const int THREE = 3;
}
GetConstants
Gets all constant names from the supplied class type
GetValue
Gets a value for the specified field name
GetValuesContaining
Returns a dictionary of name/value pairs for field names that contain the supplied field name fragment
GetValuesEndingWith
Returns a dictionary of name/value pairs for field names that end with the supplied field name fragment
GetValuesStartingWith
Returns a dictionary of name/value pairs for field names that start with the supplied field name fragment
Top
See Also

Reference

ClassFieldReflector Class
Bncs.SysUtils Namespace


ClassFieldReflector.GetAllValues Method

ClassFieldReflectorGetAllValues Method
Returns a dictionary of name/value pairs for all fields of the supplied class
Examples
This code is an example of ClassFieldReflector.GetAllValues() method.
Copy
class Program
{
    static void Main()
    {
        foreach (KeyValuePair<string, object> pair in ClassFieldReflector.GetAllValues(typeof(TestClass)))
            Console.WriteLine(pair.Key + " - " + pair.Value.ToString());
        Console.ReadKey();
    }
}

public static class TestClass
{
    public const uint THIRTEEN = 13;
    public const uint SEVEN = 7;
    public const string NAME = "Fred";
    public const int THREE = 3;
}

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static Dictionary<string, Object> GetAllValues(
    Type class_
)

Parameters

class_
Type: SystemType
Class to reflect

Return Value

Type: Dictionary String, Object
A dictionary of values or null if none found
See Also

Reference

ClassFieldReflector Class
Bncs.SysUtils Namespace


ClassFieldReflector.GetConstants Method

ClassFieldReflectorGetConstants Method
Gets all constant names from the supplied class type

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static List<string> GetConstants(
    Type type_
)

Parameters

type_
Type: SystemType
Type to query

Return Value

Type: List String
A list of constant names
See Also

Reference

ClassFieldReflector Class
Bncs.SysUtils Namespace


ClassFieldReflector.GetValue Method

ClassFieldReflectorGetValue Method
Gets a value for the specified field name

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static Object GetValue(
    Type class_,
    string fieldName_
)

Parameters

class_
Type: SystemType
Class to reflect
fieldName_
Type: SystemString
Field name to return

Return Value

Type: Object
A value or null if the field name was not found
See Also

Reference

ClassFieldReflector Class
Bncs.SysUtils Namespace


ClassFieldReflector.GetValuesContaining Method

ClassFieldReflectorGetValuesContaining Method
Returns a dictionary of name/value pairs for field names that contain the supplied field name fragment

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static Dictionary<string, Object> GetValuesContaining(
    Type class_,
    string fieldNameFragment_
)

Parameters

class_
Type: SystemType
Class to reflect
fieldNameFragment_
Type: SystemString
Field name fragment to return

Return Value

Type: Dictionary String, Object
A dictionary of values or null if none found
See Also

Reference

ClassFieldReflector Class
Bncs.SysUtils Namespace


ClassFieldReflector.GetValuesEndingWith Method

ClassFieldReflectorGetValuesEndingWith Method
Returns a dictionary of name/value pairs for field names that end with the supplied field name fragment

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static Dictionary<string, Object> GetValuesEndingWith(
    Type class_,
    string fieldNameFragment_
)

Parameters

class_
Type: SystemType
Class to reflect
fieldNameFragment_
Type: SystemString
Field name fragment to return

Return Value

Type: Dictionary String, Object
A dictionary of values or null if none found
See Also

Reference

ClassFieldReflector Class
Bncs.SysUtils Namespace


ClassFieldReflector.GetValuesStartingWith Method

ClassFieldReflectorGetValuesStartingWith Method
Returns a dictionary of name/value pairs for field names that start with the supplied field name fragment

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static Dictionary<string, Object> GetValuesStartingWith(
    Type class_,
    string fieldNameFragment_
)

Parameters

class_
Type: SystemType
Class to reflect
fieldNameFragment_
Type: SystemString
Field name fragment to return

Return Value

Type: Dictionary String, Object
A dictionary of values or null if none found
See Also

Reference

ClassFieldReflector Class
Bncs.SysUtils Namespace


CommandLine Class

CommandLine Class
A static class that returns command line information.
Examples
This code is an example of all CommandLine properties.
Copy
class Program
{
    static void Main()
    {
        Console.WriteLine("Executable: " + CommandLine.Command);
        Console.WriteLine("Full cmd line: " + CommandLine.FullCommandLine);
        Console.WriteLine("Last param: " + CommandLine.LastParameter);
        Console.WriteLine("Param Count: " + CommandLine.ParameterCount.ToString());
        Console.WriteLine("Parameters: " + CommandLine.ParameterLine);
        int index = 0;
        foreach(string parameter in CommandLine.Parameters)
        {
            ++index;
            Console.WriteLine("Parameter #" + index.ToString() + ": " + parameter);
        }

        Console.ReadKey();
    }
}
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsCommandLine

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static class CommandLine

The CommandLine type exposes the following members.

Properties
Name | Description
Command | Gets the the first command line argument, this being the path and name of the executable.
FullCommandLine | Gets the entire command line that was used to run the program.
LastParameter | Gets the last parameter passed.
ParameterCount | Gets the parameter count.
ParameterLine | Gets all parameters as a single string.
Parameters | Gets the parameters list.
Top
See Also

Reference

Bncs.SysUtils Namespace


CommandLine Properties

CommandLine Properties

The CommandLine type exposes the following members.

Properties
Name | Description
Command | Gets the the first command line argument, this being the path and name of the executable.
FullCommandLine | Gets the entire command line that was used to run the program.
LastParameter | Gets the last parameter passed.
ParameterCount | Gets the parameter count.
ParameterLine | Gets all parameters as a single string.
Parameters | Gets the parameters list.
Top
See Also

Reference

CommandLine Class
Bncs.SysUtils Namespace


CommandLine.Command Property

CommandLineCommand Property
Gets the the first command line argument, this being the path and name of the executable.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string Command { get; }

Property Value

Type: String
See Also

Reference

CommandLine Class
Bncs.SysUtils Namespace


CommandLine.FullCommandLine Property

CommandLineFullCommandLine Property
Gets the entire command line that was used to run the program.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string FullCommandLine { get; }

Property Value

Type: String
See Also

Reference

CommandLine Class
Bncs.SysUtils Namespace


CommandLine.LastParameter Property

CommandLineLastParameter Property
Gets the last parameter passed.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string LastParameter { get; }

Property Value

Type: String
See Also

Reference

CommandLine Class
Bncs.SysUtils Namespace


CommandLine.ParameterCount Property

CommandLineParameterCount Property
Gets the parameter count.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static int ParameterCount { get; }

Property Value

Type: Int32
See Also

Reference

CommandLine Class
Bncs.SysUtils Namespace


CommandLine.ParameterLine Property

CommandLineParameterLine Property
Gets all parameters as a single string.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string ParameterLine { get; }

Property Value

Type: String
See Also

Reference

CommandLine Class
Bncs.SysUtils Namespace


CommandLine.Parameters Property

CommandLineParameters Property
Gets the parameters list.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static List<string> Parameters { get; }

Property Value

Type: List String
See Also

Reference

CommandLine Class
Bncs.SysUtils Namespace


COPYDATASTRUCT Structure

COPYDATASTRUCT Structure
Copy data structure

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public struct COPYDATASTRUCT

The COPYDATASTRUCT type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Indicates whether this instance and a specified object are equal. (Inherited from ValueType.)
Public method | GetHashCode | Returns the hash code for this instance. (Inherited from ValueType.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns the fully qualified type name of this instance. (Inherited from ValueType.)
Top
Fields
 | Name | Description
Public field | cbData | Data size
Public field | dwData | Data pointer
Public field | lpData | Data string
Top
See Also

Reference

Bncs.SysUtils Namespace


COPYDATASTRUCT Fields

COPYDATASTRUCT Fields

The COPYDATASTRUCT type exposes the following members.

Fields
 | Name | Description
Public field | cbData | Data size
Public field | dwData | Data pointer
Public field | lpData | Data string
Top
See Also

Reference

COPYDATASTRUCT Structure
Bncs.SysUtils Namespace


COPYDATASTRUCT.cbData Field

COPYDATASTRUCTcbData Field
Data size

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int cbData

Field Value

Type: Int32
See Also

Reference

COPYDATASTRUCT Structure
Bncs.SysUtils Namespace


COPYDATASTRUCT.dwData Field

COPYDATASTRUCTdwData Field
Data pointer

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public IntPtr dwData

Field Value

Type: IntPtr
See Also

Reference

COPYDATASTRUCT Structure
Bncs.SysUtils Namespace


COPYDATASTRUCT.lpData Field

COPYDATASTRUCTlpData Field
Data string

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string lpData

Field Value

Type: String
See Also

Reference

COPYDATASTRUCT Structure
Bncs.SysUtils Namespace


COPYDATASTRUCT Methods

COPYDATASTRUCT Methods

The COPYDATASTRUCT type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Indicates whether this instance and a specified object are equal. (Inherited from ValueType.)
Public method | GetHashCode | Returns the hash code for this instance. (Inherited from ValueType.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns the fully qualified type name of this instance. (Inherited from ValueType.)
Top
See Also

Reference

COPYDATASTRUCT Structure
Bncs.SysUtils Namespace


CString Class

CString Class
Manages a string as a "C" style string whereby tabs, new line and return characters are replaced with escape characters.
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsCString

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class CString

The CString type exposes the following members.

Constructors
Name Description
Public method CString
Default constructor.
CString(String)
Constructor takes an initial value.
Examples
This code is an example of the CString class.
Copy
class Program
{
    static void Main()
    {
        CString str = new CString("Hello\\nWorld");
        Console.WriteLine("Actual value: " + str.Value);
        Console.WriteLine("Escaped value: " + str.EscapedValue);

        Console.ReadKey();
    }
}
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToBuffer | Returns the string as an array of bytes.
Public method | ToString | Represents the instance as a string using the Value property. (Overrides ObjectToString.)
Top
Properties
Name Description
EscapedValue
Gets the escaped value.
Examples
This code is an example of the CString class.
Copy
class Program
{
    static void Main()
    {
        CString str = new CString("Hello\\nWorld");
        Console.WriteLine("Actual value: " + str.Value);
        Console.WriteLine("Escaped value: " + str.EscapedValue);

        Console.ReadKey();
    }
}
Public property Length
Gets the length of the string.
Value
Gets or sets the string.
Examples
This code is an example of the CString class.
Copy
class Program
{
    static void Main()
    {
        CString str = new CString("Hello\\nWorld");
        Console.WriteLine("Actual value: " + str.Value);
        Console.WriteLine("Escaped value: " + str.EscapedValue);

        Console.ReadKey();
    }
}
Top
See Also

Reference

Bncs.SysUtils Namespace


CString Constructor

CString Constructor
Overload List
Name Description
Public method CString
Default constructor.
CString(String)
Constructor takes an initial value.
Examples
This code is an example of the CString class.
Copy
class Program
{
    static void Main()
    {
        CString str = new CString("Hello\\nWorld");
        Console.WriteLine("Actual value: " + str.Value);
        Console.WriteLine("Escaped value: " + str.EscapedValue);

        Console.ReadKey();
    }
}
Top
See Also

Reference

CString Class
Bncs.SysUtils Namespace


CString Constructor

CString Constructor
Default constructor.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CString()
See Also

Reference

CString Class
CString Overload
Bncs.SysUtils Namespace


CString Constructor (String)

CString Constructor (String)
Constructor takes an initial value.
Examples
This code is an example of the CString class.
Copy
class Program
{
    static void Main()
    {
        CString str = new CString("Hello\\nWorld");
        Console.WriteLine("Actual value: " + str.Value);
        Console.WriteLine("Escaped value: " + str.EscapedValue);

        Console.ReadKey();
    }
}

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CString(
    string value_
)

Parameters

value_
Type: SystemString
The content of the string.
See Also

Reference

CString Class
CString Overload
Bncs.SysUtils Namespace


CString Methods

CString Methods

The CString type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToBuffer | Returns the string as an array of bytes.
Public method | ToString | Represents the instance as a string using the Value property. (Overrides ObjectToString.)
Top
See Also

Reference

CString Class
Bncs.SysUtils Namespace


CString.ToBuffer Method

CStringToBuffer Method
Returns the string as an array of bytes.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[] ToBuffer()

Return Value

Type: Byte
An array of bytes
See Also

Reference

CString Class
Bncs.SysUtils Namespace


CString.ToString Method

CStringToString Method
Represents the instance as a string using the Value property.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
The Value property
See Also

Reference

CString Class
Bncs.SysUtils Namespace


CString Properties

CString Properties

The CString type exposes the following members.

Properties
Name Description
EscapedValue
Gets the escaped value.
Examples
This code is an example of the CString class.
Copy
class Program
{
    static void Main()
    {
        CString str = new CString("Hello\\nWorld");
        Console.WriteLine("Actual value: " + str.Value);
        Console.WriteLine("Escaped value: " + str.EscapedValue);

        Console.ReadKey();
    }
}
Public property Length
Gets the length of the string.
Value
Gets or sets the string.
Examples
This code is an example of the CString class.
Copy
class Program
{
    static void Main()
    {
        CString str = new CString("Hello\\nWorld");
        Console.WriteLine("Actual value: " + str.Value);
        Console.WriteLine("Escaped value: " + str.EscapedValue);

        Console.ReadKey();
    }
}
Top
See Also

Reference

CString Class
Bncs.SysUtils Namespace


CString.EscapedValue Property

CStringEscapedValue Property
Gets the escaped value.
Examples
This code is an example of the CString class.
Copy
class Program
{
    static void Main()
    {
        CString str = new CString("Hello\\nWorld");
        Console.WriteLine("Actual value: " + str.Value);
        Console.WriteLine("Escaped value: " + str.EscapedValue);

        Console.ReadKey();
    }
}

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string EscapedValue { get; }

Property Value

Type: String
See Also

Reference

CString Class
Bncs.SysUtils Namespace


CString.Length Property

CStringLength Property
Gets the length of the string.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Length { get; }

Property Value

Type: Int32
See Also

Reference

CString Class
Bncs.SysUtils Namespace


CString.Value Property

CStringValue Property
Gets or sets the string.
Examples
This code is an example of the CString class.
Copy
class Program
{
    static void Main()
    {
        CString str = new CString("Hello\\nWorld");
        Console.WriteLine("Actual value: " + str.Value);
        Console.WriteLine("Escaped value: " + str.EscapedValue);

        Console.ReadKey();
    }
}

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Value { get; set; }

Property Value

Type: String
See Also

Reference

CString Class
Bncs.SysUtils Namespace


CWPRETSTRUCT Structure

CWPRETSTRUCT Structure
Defines the message parameters passed to a WH_CALLWNDPROCRET hook procedure, CallWndRetProc.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public struct CWPRETSTRUCT

The CWPRETSTRUCT type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Indicates whether this instance and a specified object are equal. (Inherited from ValueType.)
Public method | GetHashCode | Returns the hash code for this instance. (Inherited from ValueType.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns the fully qualified type name of this instance. (Inherited from ValueType.)
Top
Fields
 | Name | Description
Public field | hWnd | A handle to the window that processed the message specified by the message value.
Public field | lParam | Additional information about the message. The exact meaning depends on the message value.
Public field | lResult | The return value of the window procedure that processed the message specified by the message value.
Public field | message | The message.
Public field | wParam | Additional information about the message. The exact meaning depends on the message value.
Top
See Also

Reference

Bncs.SysUtils Namespace


CWPRETSTRUCT Fields

CWPRETSTRUCT Fields

The CWPRETSTRUCT type exposes the following members.

Fields
 | Name | Description
Public field | hWnd | A handle to the window that processed the message specified by the message value.
Public field | lParam | Additional information about the message. The exact meaning depends on the message value.
Public field | lResult | The return value of the window procedure that processed the message specified by the message value.
Public field | message | The message.
Public field | wParam | Additional information about the message. The exact meaning depends on the message value.
Top
See Also

Reference

CWPRETSTRUCT Structure
Bncs.SysUtils Namespace


CWPRETSTRUCT.hWnd Field

CWPRETSTRUCThWnd Field
A handle to the window that processed the message specified by the message value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public IntPtr hWnd

Field Value

Type: IntPtr
See Also

Reference

CWPRETSTRUCT Structure
Bncs.SysUtils Namespace


CWPRETSTRUCT.lParam Field

CWPRETSTRUCTlParam Field
Additional information about the message. The exact meaning depends on the message value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public IntPtr lParam

Field Value

Type: IntPtr
See Also

Reference

CWPRETSTRUCT Structure
Bncs.SysUtils Namespace


CWPRETSTRUCT.lResult Field

CWPRETSTRUCTlResult Field
The return value of the window procedure that processed the message specified by the message value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public IntPtr lResult

Field Value

Type: IntPtr
See Also

Reference

CWPRETSTRUCT Structure
Bncs.SysUtils Namespace


CWPRETSTRUCT.message Field

CWPRETSTRUCTmessage Field
The message.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint message

Field Value

Type: UInt32
See Also

Reference

CWPRETSTRUCT Structure
Bncs.SysUtils Namespace


CWPRETSTRUCT.wParam Field

CWPRETSTRUCTwParam Field
Additional information about the message. The exact meaning depends on the message value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public IntPtr wParam

Field Value

Type: IntPtr
See Also

Reference

CWPRETSTRUCT Structure
Bncs.SysUtils Namespace


CWPRETSTRUCT Methods

CWPRETSTRUCT Methods

The CWPRETSTRUCT type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Indicates whether this instance and a specified object are equal. (Inherited from ValueType.)
Public method | GetHashCode | Returns the hash code for this instance. (Inherited from ValueType.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns the fully qualified type name of this instance. (Inherited from ValueType.)
Top
See Also

Reference

CWPRETSTRUCT Structure
Bncs.SysUtils Namespace


DataBuffer Class

DataBuffer Class
A class that manages an array of bytes with methods to enable buffer manipulation and conversion to string.
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsDataBuffer

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class DataBuffer

The DataBuffer type exposes the following members.

Constructors
Name Description
Public method DataBuffer(Byte)
Constructor that populates the underlying buffer from the supplied byte.
DataBuffer(Byte)
Constructor that populates the underlying buffer with that supplied.
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}
Public method DataBuffer(Char)
Constructor that populates the underlying buffer from the supplied character.
DataBuffer(String)
Constructor that populates the underlying buffer from the supplied string literally.
Examples
This code is an example of the DataBuffer class demonstrating a string constructor, the Buffer property and the ToString and Replace(Byte, Byte) methods.
Copy
class Program
{
    static void Main()
    {
        DataBuffer buffer = new DataBuffer("Hello Earth how are you?");
        Console.WriteLine("BUFFER: " + buffer.ToString());
        Console.WriteLine("Replace \"Earth\" with \"World\": " +  new DataBuffer(buffer.Replace(new DataBuffer("Earth").Buffer, new DataBuffer("World").Buffer)).ToString());

        Console.ReadKey();
    }
}
Public method DataBuffer(String, EscapeSequenceInterpretationType)
Constructor that populates the underlying buffer from the supplied string, if escapeSequenceInterpretationType_ is none the conversion is literal else escape sequences are interpreted as either C# or ASCII.
Public method DataBuffer(UInt32, Byte)
Constructor that creates a buffer of the supplied length and pads it out with the supplied byte.
Public method DataBuffer(Byte, UInt32, Byte)
Constructor that populates the underlying buffer from the supplied buffer to the specified length. If the fixed length exceeds the length of the supplied buffer then the buffer is padded out with the supplied byte, if the specified length is less than the length of the supplied buffer then the buffer is truncated.
Public method DataBuffer(String, UInt32, Byte)
Constructor that populates the underlying buffer from the supplied string to the specified length. If the fixed length exceeds the length of the supplied string then the buffer is padded out with the supplied byte, if the specified length is less than the length of the supplied string then the buffer is truncated.
Top
Methods
Name | Description
Public method AppendToBuffer(Byte)
Adds the supplied byte to the end of the internal buffer.
Public method AppendToBuffer(Byte)
Adds the supplied buffer to the end of the internal buffer.
Public method AppendToBuffer(String)
Adds the supplied string to the end of the internal buffer.
Public method AppendToBuffer(DataBuffer)
Adds the supplied DataBuffer's buffer to the end of the internal buffer
Public method Contains(Byte)
Ascertains if the supplied buffer is contained within the underlying buffer.
Public method Contains(String)
Ascertains if the supplied string is contained within the underlying buffer.
Public method DeleteFromBuffer(Byte)
Removes all instances of each individual byte supplied from the internal buffer, this method changes the internal buffer.
Public method DeleteFromBuffer(Int32)
Deletes all bytes from the supplied index up to the end of the internal buffer from the internal buffer.
Public method DeleteFromBuffer(Int32, Int32)
/// Deletes all bytes from the supplied index for count_ bytes from the internal buffer.
Public method EndsWith(Byte)
Evaluates if the buffer ends with the supplied buffer.
Public method EndsWith(String)
Evaluates if the buffer ends with the supplied string.
Public method Equals
Ascertains if the supplied object is equal to the instance.
(Overrides ObjectEquals(Object).)
Public method GetHashCode
Gets the hash code
(Overrides ObjectGetHashCode.)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method IndexOf(Byte)
Seeks the index of the supplied sub buffer.
Public method IndexOf(String)
Seeks the index of the supplied string.
Public method IndexOf(Byte, UInt32)
Seeks the index of the nth instance of the supplied sub buffer.
Public method IndexOf(String, UInt32)
Seeks the index of the nth instance of the supplied string.
Public method IndexOfBeyond(Byte, Int32)
Seeks the index of the supplied sub buffer from beyond the specified point.
Public method IndexOfBeyond(Byte, UInt32, Int32)
Seeks the index of the nth instance of the supplied sub buffer from beyond the specified point.
Public method Insert
Inserts the supplied buffer.
Public method InstancesOf(Byte)
Ascertains how many instances of the supplied buffer are contained within the underlying buffer.
Public method InstancesOf(String)
Ascertains how many instances of the supplied string are contained within the underlying buffer.
Public method IsEqual(Byte)
Checks for equality with the supplied buffer.
Public method IsEqual(String)
Checks for equality with the supplied string.
Public method LastIndexOf(Byte)
Seeks the final index of the supplied buffer.
Public method LastIndexOf(String)
Seeks the final index of the supplied buffer.
Public method Remove(Int32)
Removes bytes from the buffer from the supplied index to the end of the buffer.
Public method Remove(Int32, Int32)
Removes bytes from the buffer from the supplied index to the count point.
Public method RemoveAll
Removes all instances of the supplied byte from the buffer
Public method Replace(Byte, Byte)
Replaces all instances of one byte with another.
Replace(Byte, Byte)
Replaces all instances of one byte array with another.
Examples
This code is an example of the DataBuffer class demonstrating a string constructor, the Buffer property and the ToString and Replace(Byte, Byte) methods.
Copy
class Program
{
    static void Main()
    {
        DataBuffer buffer = new DataBuffer("Hello Earth how are you?");
        Console.WriteLine("BUFFER: " + buffer.ToString());
        Console.WriteLine("Replace \"Earth\" with \"World\": " +  new DataBuffer(buffer.Replace(new DataBuffer("Earth").Buffer, new DataBuffer("World").Buffer)).ToString());

        Console.ReadKey();
    }
}
Public method Reverse
Reverses the underlying buffer.
Public method Split(Byte)
Splits the buffer using the supplied byte delimiter.
Public method Split(Byte)
Splits the buffer using the supplied byte array delimiter.
Public method Split(Char)
Splits the buffer using the supplied character delimiter.
Public method Split(String)
Splits the buffer using the supplied string delimiter.
Public method StartsWith(Byte)
Evaluates if the buffer starts with the supplied buffer.
Public method StartsWith(String)
Evaluates if the buffer starts with the supplied string.
Public method SubBuffer(Int32)
Gets a subset of the buffer from the supplied index.
Public method SubBuffer(Int32, Int32)
Gets a subset of the buffer from the supplied index and length.
Public method ToLower
Converts all alphabetical characters to lowercase.
Public method ToPrintableString
Gets a printable string representation of the buffer.
ToString
Returns the instance as a string.
Examples
This code is an example of the DataBuffer class demonstrating a string constructor, the Buffer property and the ToString and Replace(Byte, Byte) methods.
Copy
class Program
{
    static void Main()
    {
        DataBuffer buffer = new DataBuffer("Hello Earth how are you?");
        Console.WriteLine("BUFFER: " + buffer.ToString());
        Console.WriteLine("Replace \"Earth\" with \"World\": " +  new DataBuffer(buffer.Replace(new DataBuffer("Earth").Buffer, new DataBuffer("World").Buffer)).ToString());

        Console.ReadKey();
    }
}
(Overrides ObjectToString.)
Public method | ToStrings
Public method ToUpper
Converts all alphabetical characters to uppercase.
Top
Properties
Name Description
Buffer
Gets a copy of the underlying buffer.
Replaces all instances of one byte array with another.
Examples
This code is an example of the DataBuffer class demonstrating a string constructor, the Buffer property and the ToString and Replace(Byte, Byte) methods.
Copy
class Program
{
    static void Main()
    {
        DataBuffer buffer = new DataBuffer("Hello Earth how are you?");
        Console.WriteLine("BUFFER: " + buffer.ToString());
        Console.WriteLine("Replace \"Earth\" with \"World\": " +  new DataBuffer(buffer.Replace(new DataBuffer("Earth").Buffer, new DataBuffer("World").Buffer)).ToString());

        Console.ReadKey();
    }
}
Byte to remove.Byte to replace

Return Value

Type:
An array of bytes with the replacement made.
Public property CaseSensitive
Gets or sets a flag dictating if bytes that represent letters should be case sensitive, default is true. When a byte to byte compare fails and this property is FALSE then a check occurs to see if both bytes translate to letters (A through Z or a through z). If so one is temporarily flicked from upper to lower (or reverse as applicable) and the compare is made again.
Public property CharArray
Gets a copy of the underlying buffer as a character array.
Public property Hex
Gets a copy of the underlying buffer as a hex string.
Top
See Also

Reference

Bncs.SysUtils Namespace


DataBuffer Constructor

DataBuffer Constructor
Overload List
Name Description
Public method DataBuffer(Byte)
Constructor that populates the underlying buffer from the supplied byte.
DataBuffer(Byte)
Constructor that populates the underlying buffer with that supplied.
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}
Public method DataBuffer(Char)
Constructor that populates the underlying buffer from the supplied character.
DataBuffer(String)
Constructor that populates the underlying buffer from the supplied string literally.
Examples
This code is an example of the DataBuffer class demonstrating a string constructor, the Buffer property and the ToString and Replace(Byte, Byte) methods.
Copy
class Program
{
    static void Main()
    {
        DataBuffer buffer = new DataBuffer("Hello Earth how are you?");
        Console.WriteLine("BUFFER: " + buffer.ToString());
        Console.WriteLine("Replace \"Earth\" with \"World\": " +  new DataBuffer(buffer.Replace(new DataBuffer("Earth").Buffer, new DataBuffer("World").Buffer)).ToString());

        Console.ReadKey();
    }
}
Public method DataBuffer(String, EscapeSequenceInterpretationType)
Constructor that populates the underlying buffer from the supplied string, if escapeSequenceInterpretationType_ is none the conversion is literal else escape sequences are interpreted as either C# or ASCII.
Public method DataBuffer(UInt32, Byte)
Constructor that creates a buffer of the supplied length and pads it out with the supplied byte.
Public method DataBuffer(Byte, UInt32, Byte)
Constructor that populates the underlying buffer from the supplied buffer to the specified length. If the fixed length exceeds the length of the supplied buffer then the buffer is padded out with the supplied byte, if the specified length is less than the length of the supplied buffer then the buffer is truncated.
Public method DataBuffer(String, UInt32, Byte)
Constructor that populates the underlying buffer from the supplied string to the specified length. If the fixed length exceeds the length of the supplied string then the buffer is padded out with the supplied byte, if the specified length is less than the length of the supplied string then the buffer is truncated.
Top
See Also

Reference

DataBuffer Class
Bncs.SysUtils Namespace


DataBuffer Constructor (Byte)

DataBuffer Constructor (Byte)
Constructor that populates the underlying buffer from the supplied byte.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public DataBuffer(
    byte byte_
)

Parameters

byte_
Type: SystemByte
Buffer content
See Also

Reference

DataBuffer Class
DataBuffer Overload
Bncs.SysUtils Namespace


DataBuffer Constructor (Byte[])

DataBuffer Constructor (Byte)
Constructor that populates the underlying buffer with that supplied.
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public DataBuffer(
    byte[] buffer_
)

Parameters

buffer_
Type: SystemByte
Buffer content
See Also

Reference

DataBuffer Class
DataBuffer Overload
Bncs.SysUtils Namespace


DataBuffer Constructor (Char)

DataBuffer Constructor (Char)
Constructor that populates the underlying buffer from the supplied character.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public DataBuffer(
    char character_
)

Parameters

character_
Type: SystemChar
Buffer content
See Also

Reference

DataBuffer Class
DataBuffer Overload
Bncs.SysUtils Namespace


DataBuffer Constructor (String)

DataBuffer Constructor (String)
Constructor that populates the underlying buffer from the supplied string literally.
Examples
This code is an example of the DataBuffer class demonstrating a string constructor, the Buffer property and the ToString and Replace(Byte, Byte) methods.
Copy
class Program
{
    static void Main()
    {
        DataBuffer buffer = new DataBuffer("Hello Earth how are you?");
        Console.WriteLine("BUFFER: " + buffer.ToString());
        Console.WriteLine("Replace \"Earth\" with \"World\": " +  new DataBuffer(buffer.Replace(new DataBuffer("Earth").Buffer, new DataBuffer("World").Buffer)).ToString());

        Console.ReadKey();
    }
}

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public DataBuffer(
    string buffer_
)

Parameters

buffer_
Type: SystemString
Buffer content
See Also

Reference

DataBuffer Class
DataBuffer Overload
Bncs.SysUtils Namespace


DataBuffer Constructor (String, EscapeSequenceInterpretationType)

DataBuffer Constructor (String, EscapeSequenceInterpretationType)
Constructor that populates the underlying buffer from the supplied string, if escapeSequenceInterpretationType_ is none the conversion is literal else escape sequences are interpreted as either C# or ASCII.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public DataBuffer(
    string buffer_,
    EscapeSequenceInterpretationType escapeSequenceInterpretationType_
)

Parameters

buffer_
Type: SystemString
Buffer content
escapeSequenceInterpretationType_
Type: Bncs.SysUtilsEscapeSequenceInterpretationType
Escape sequence interpretation flag
See Also

Reference

DataBuffer Class
DataBuffer Overload
Bncs.SysUtils Namespace


DataBuffer Constructor (UInt32, Byte)

DataBuffer Constructor (UInt32, Byte)
Constructor that creates a buffer of the supplied length and pads it out with the supplied byte.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public DataBuffer(
    uint length_,
    byte pad_
)

Parameters

length_
Type: SystemUInt32
Length to create, if zero is supplied ArgumentException is thrown.
pad_
Type: SystemByte
Padding byte
See Also

Reference

DataBuffer Class
DataBuffer Overload
Bncs.SysUtils Namespace


DataBuffer Constructor (Byte[], UInt32, Byte)

DataBuffer Constructor (Byte, UInt32, Byte)
Constructor that populates the underlying buffer from the supplied buffer to the specified length. If the fixed length exceeds the length of the supplied buffer then the buffer is padded out with the supplied byte, if the specified length is less than the length of the supplied buffer then the buffer is truncated.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public DataBuffer(
    byte[] buffer_,
    uint fixedLength_,
    byte pad_
)

Parameters

buffer_
Type: SystemByte
Buffer content
fixedLength_
Type: SystemUInt32
Fixed length to create, if zero is supplied ArgumentException is thrown.
pad_
Type: SystemByte
Padding byte to use if required
See Also

Reference

DataBuffer Class
DataBuffer Overload
Bncs.SysUtils Namespace


DataBuffer Constructor (String, UInt32, Byte)

DataBuffer Constructor (String, UInt32, Byte)
Constructor that populates the underlying buffer from the supplied string to the specified length. If the fixed length exceeds the length of the supplied string then the buffer is padded out with the supplied byte, if the specified length is less than the length of the supplied string then the buffer is truncated.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public DataBuffer(
    string buffer_,
    uint fixedLength_,
    byte pad_
)

Parameters

buffer_
Type: SystemString
Buffer content
fixedLength_
Type: SystemUInt32
Fixed length to create, if zero is supplied ArgumentException is thrown.
pad_
Type: SystemByte
Padding byte to use if required
See Also

Reference

DataBuffer Class
DataBuffer Overload
Bncs.SysUtils Namespace


DataBuffer Methods

DataBuffer Methods

The DataBuffer type exposes the following members.

Methods
Name | Description
Public method AppendToBuffer(Byte)
Adds the supplied byte to the end of the internal buffer.
Public method AppendToBuffer(Byte)
Adds the supplied buffer to the end of the internal buffer.
Public method AppendToBuffer(String)
Adds the supplied string to the end of the internal buffer.
Public method AppendToBuffer(DataBuffer)
Adds the supplied DataBuffer's buffer to the end of the internal buffer
Public method Contains(Byte)
Ascertains if the supplied buffer is contained within the underlying buffer.
Public method Contains(String)
Ascertains if the supplied string is contained within the underlying buffer.
Public method DeleteFromBuffer(Byte)
Removes all instances of each individual byte supplied from the internal buffer, this method changes the internal buffer.
Public method DeleteFromBuffer(Int32)
Deletes all bytes from the supplied index up to the end of the internal buffer from the internal buffer.
Public method DeleteFromBuffer(Int32, Int32)
/// Deletes all bytes from the supplied index for count_ bytes from the internal buffer.
Public method EndsWith(Byte)
Evaluates if the buffer ends with the supplied buffer.
Public method EndsWith(String)
Evaluates if the buffer ends with the supplied string.
Public method Equals
Ascertains if the supplied object is equal to the instance.
(Overrides ObjectEquals(Object).)
Public method GetHashCode
Gets the hash code
(Overrides ObjectGetHashCode.)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method IndexOf(Byte)
Seeks the index of the supplied sub buffer.
Public method IndexOf(String)
Seeks the index of the supplied string.
Public method IndexOf(Byte, UInt32)
Seeks the index of the nth instance of the supplied sub buffer.
Public method IndexOf(String, UInt32)
Seeks the index of the nth instance of the supplied string.
Public method IndexOfBeyond(Byte, Int32)
Seeks the index of the supplied sub buffer from beyond the specified point.
Public method IndexOfBeyond(Byte, UInt32, Int32)
Seeks the index of the nth instance of the supplied sub buffer from beyond the specified point.
Public method Insert
Inserts the supplied buffer.
Public method InstancesOf(Byte)
Ascertains how many instances of the supplied buffer are contained within the underlying buffer.
Public method InstancesOf(String)
Ascertains how many instances of the supplied string are contained within the underlying buffer.
Public method IsEqual(Byte)
Checks for equality with the supplied buffer.
Public method IsEqual(String)
Checks for equality with the supplied string.
Public method LastIndexOf(Byte)
Seeks the final index of the supplied buffer.
Public method LastIndexOf(String)
Seeks the final index of the supplied buffer.
Public method Remove(Int32)
Removes bytes from the buffer from the supplied index to the end of the buffer.
Public method Remove(Int32, Int32)
Removes bytes from the buffer from the supplied index to the count point.
Public method RemoveAll
Removes all instances of the supplied byte from the buffer
Public method Replace(Byte, Byte)
Replaces all instances of one byte with another.
Replace(Byte, Byte)
Replaces all instances of one byte array with another.
Examples
This code is an example of the DataBuffer class demonstrating a string constructor, the Buffer property and the ToString and Replace(Byte, Byte) methods.
Copy
class Program
{
    static void Main()
    {
        DataBuffer buffer = new DataBuffer("Hello Earth how are you?");
        Console.WriteLine("BUFFER: " + buffer.ToString());
        Console.WriteLine("Replace \"Earth\" with \"World\": " +  new DataBuffer(buffer.Replace(new DataBuffer("Earth").Buffer, new DataBuffer("World").Buffer)).ToString());

        Console.ReadKey();
    }
}
Public method Reverse
Reverses the underlying buffer.
Public method Split(Byte)
Splits the buffer using the supplied byte delimiter.
Public method Split(Byte)
Splits the buffer using the supplied byte array delimiter.
Public method Split(Char)
Splits the buffer using the supplied character delimiter.
Public method Split(String)
Splits the buffer using the supplied string delimiter.
Public method StartsWith(Byte)
Evaluates if the buffer starts with the supplied buffer.
Public method StartsWith(String)
Evaluates if the buffer starts with the supplied string.
Public method SubBuffer(Int32)
Gets a subset of the buffer from the supplied index.
Public method SubBuffer(Int32, Int32)
Gets a subset of the buffer from the supplied index and length.
Public method ToLower
Converts all alphabetical characters to lowercase.
Public method ToPrintableString
Gets a printable string representation of the buffer.
ToString
Returns the instance as a string.
Examples
This code is an example of the DataBuffer class demonstrating a string constructor, the Buffer property and the ToString and Replace(Byte, Byte) methods.
Copy
class Program
{
    static void Main()
    {
        DataBuffer buffer = new DataBuffer("Hello Earth how are you?");
        Console.WriteLine("BUFFER: " + buffer.ToString());
        Console.WriteLine("Replace \"Earth\" with \"World\": " +  new DataBuffer(buffer.Replace(new DataBuffer("Earth").Buffer, new DataBuffer("World").Buffer)).ToString());

        Console.ReadKey();
    }
}
(Overrides ObjectToString.)
Public method | ToStrings
Public method ToUpper
Converts all alphabetical characters to uppercase.
Top
See Also

Reference

DataBuffer Class
Bncs.SysUtils Namespace


DataBuffer.AppendToBuffer Method

DataBufferAppendToBuffer Method
Overload List
 | Name | Description
Public method | AppendToBuffer(Byte) | Adds the supplied byte to the end of the internal buffer.
Public method | AppendToBuffer(Byte) | Adds the supplied buffer to the end of the internal buffer.
Public method | AppendToBuffer(String) | Adds the supplied string to the end of the internal buffer.
Public method | AppendToBuffer(DataBuffer) | Adds the supplied DataBuffer's buffer to the end of the internal buffer
Top
See Also

Reference

DataBuffer Class
Bncs.SysUtils Namespace


DataBuffer.AppendToBuffer Method (Byte)

DataBufferAppendToBuffer Method (Byte)
Adds the supplied byte to the end of the internal buffer.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void AppendToBuffer(
    byte byte_
)

Parameters

byte_
Type: SystemByte
Byte to add
See Also

Reference

DataBuffer Class
AppendToBuffer Overload
Bncs.SysUtils Namespace


DataBuffer.AppendToBuffer Method (Byte[])

DataBufferAppendToBuffer Method (Byte)
Adds the supplied buffer to the end of the internal buffer.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void AppendToBuffer(
    byte[] buffer_
)

Parameters

buffer_
Type: SystemByte
Buffer to add
See Also

Reference

DataBuffer Class
AppendToBuffer Overload
Bncs.SysUtils Namespace


DataBuffer.AppendToBuffer Method (String)

DataBufferAppendToBuffer Method (String)
Adds the supplied string to the end of the internal buffer.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void AppendToBuffer(
    string value_
)

Parameters

value_
Type: SystemString
Buffer as a string to add
See Also

Reference

DataBuffer Class
AppendToBuffer Overload
Bncs.SysUtils Namespace


DataBuffer.AppendToBuffer Method (DataBuffer)

DataBufferAppendToBuffer Method (DataBuffer)
Adds the supplied DataBuffer's buffer to the end of the internal buffer

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void AppendToBuffer(
    DataBuffer buffer_
)

Parameters

buffer_
Type: Bncs.SysUtilsDataBuffer
Buffer to add
See Also

Reference

DataBuffer Class
AppendToBuffer Overload
Bncs.SysUtils Namespace


DataBuffer.Contains Method

DataBufferContains Method
Overload List
 | Name | Description
Public method | Contains(Byte) | Ascertains if the supplied buffer is contained within the underlying buffer.
Public method | Contains(String) | Ascertains if the supplied string is contained within the underlying buffer.
Top
See Also

Reference

DataBuffer Class
Bncs.SysUtils Namespace


DataBuffer.Contains Method (Byte[])

DataBufferContains Method (Byte)
Ascertains if the supplied buffer is contained within the underlying buffer.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Contains(
    byte[] buffer_
)

Parameters

buffer_
Type: SystemByte
Buffer to seek.

Return Value

Type: Boolean
True if the supplied buffer was found.
See Also

Reference

DataBuffer Class
Contains Overload
Bncs.SysUtils Namespace


DataBuffer.Contains Method (String)

DataBufferContains Method (String)
Ascertains if the supplied string is contained within the underlying buffer.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Contains(
    string buffer_
)

Parameters

buffer_
Type: SystemString
String to seek.

Return Value

Type: Boolean
True if the supplied string was found.
See Also

Reference

DataBuffer Class
Contains Overload
Bncs.SysUtils Namespace


DataBuffer.DeleteFromBuffer Method

DataBufferDeleteFromBuffer Method
Overload List
 | Name | Description
Public method | DeleteFromBuffer(Byte) | Removes all instances of each individual byte supplied from the internal buffer, this method changes the internal buffer.
Public method | DeleteFromBuffer(Int32) | Deletes all bytes from the supplied index up to the end of the internal buffer from the internal buffer.
Public method | DeleteFromBuffer(Int32, Int32) | /// Deletes all bytes from the supplied index for count_ bytes from the internal buffer.
Top
See Also

Reference

DataBuffer Class
Bncs.SysUtils Namespace


DataBuffer.DeleteFromBuffer Method (Byte[])

DataBufferDeleteFromBuffer Method (Byte)
Removes all instances of each individual byte supplied from the internal buffer, this method changes the internal buffer.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool DeleteFromBuffer(
    byte[] bytes_
)

Parameters

bytes_
Type: SystemByte
Array of all bytes of which all occurrences are to be removed

Return Value

Type: Boolean
True if a change is made
See Also

Reference

DataBuffer Class
DeleteFromBuffer Overload
Bncs.SysUtils Namespace


DataBuffer.DeleteFromBuffer Method (Int32)

DataBufferDeleteFromBuffer Method (Int32)
Deletes all bytes from the supplied index up to the end of the internal buffer from the internal buffer.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void DeleteFromBuffer(
    int startIndex_
)

Parameters

startIndex_
Type: SystemInt32
Index of first byte to remove
See Also

Reference

DataBuffer Class
DeleteFromBuffer Overload
Bncs.SysUtils Namespace


DataBuffer.DeleteFromBuffer Method (Int32, Int32)

DataBufferDeleteFromBuffer Method (Int32, Int32)
/// Deletes all bytes from the supplied index for count_ bytes from the internal buffer.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void DeleteFromBuffer(
    int startIndex_,
    int count_
)

Parameters

startIndex_
Type: SystemInt32
Index of first byte to remove
count_
Type: SystemInt32
Number of bytes to remove
See Also

Reference

DataBuffer Class
DeleteFromBuffer Overload
Bncs.SysUtils Namespace


DataBuffer.EndsWith Method

DataBufferEndsWith Method
Overload List
 | Name | Description
Public method | EndsWith(Byte) | Evaluates if the buffer ends with the supplied buffer.
Public method | EndsWith(String) | Evaluates if the buffer ends with the supplied string.
Top
See Also

Reference

DataBuffer Class
Bncs.SysUtils Namespace


DataBuffer.EndsWith Method (Byte[])

DataBufferEndsWith Method (Byte)
Evaluates if the buffer ends with the supplied buffer.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool EndsWith(
    byte[] buffer_
)

Parameters

buffer_
Type: SystemByte
Buffer to seek at end.

Return Value

Type: Boolean
True if found at end of underlying buffer.
See Also

Reference

DataBuffer Class
EndsWith Overload
Bncs.SysUtils Namespace


DataBuffer.EndsWith Method (String)

DataBufferEndsWith Method (String)
Evaluates if the buffer ends with the supplied string.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool EndsWith(
    string buffer_
)

Parameters

buffer_
Type: SystemString
Buffer to seek at end.

Return Value

Type: Boolean
True if found at end of underlying buffer.
See Also

Reference

DataBuffer Class
EndsWith Overload
Bncs.SysUtils Namespace


DataBuffer.Equals Method

DataBufferEquals Method
Ascertains if the supplied object is equal to the instance.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override bool Equals(
    Object obj
)

Parameters

obj
Type: SystemObject
Object to compare to instance

Return Value

Type: Boolean
True if equal
See Also

Reference

DataBuffer Class
Bncs.SysUtils Namespace


DataBuffer.GetHashCode Method

DataBufferGetHashCode Method
Gets the hash code

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override int GetHashCode()

Return Value

Type: Int32
Hash code
See Also

Reference

DataBuffer Class
Bncs.SysUtils Namespace


DataBuffer.IndexOf Method

DataBufferIndexOf Method
Overload List
 | Name | Description
Public method | IndexOf(Byte) | Seeks the index of the supplied sub buffer.
Public method | IndexOf(String) | Seeks the index of the supplied string.
Public method | IndexOf(Byte, UInt32) | Seeks the index of the nth instance of the supplied sub buffer.
Public method | IndexOf(String, UInt32) | Seeks the index of the nth instance of the supplied string.
Top
See Also

Reference

DataBuffer Class
Bncs.SysUtils Namespace


DataBuffer.IndexOf Method (Byte[])

DataBufferIndexOf Method (Byte)
Seeks the index of the supplied sub buffer.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int IndexOf(
    byte[] subBuffer_
)

Parameters

subBuffer_
Type: SystemByte
Buffer to seek

Return Value

Type: Int32
The zero based index or -1 if not found
See Also

Reference

DataBuffer Class
IndexOf Overload
Bncs.SysUtils Namespace


DataBuffer.IndexOf Method (String)

DataBufferIndexOf Method (String)
Seeks the index of the supplied string.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int IndexOf(
    string subBuffer_
)

Parameters

subBuffer_
Type: SystemString
String to seek

Return Value

Type: Int32
The zero based index or -1 if not found
See Also

Reference

DataBuffer Class
IndexOf Overload
Bncs.SysUtils Namespace


DataBuffer.IndexOf Method (Byte[], UInt32)

DataBufferIndexOf Method (Byte, UInt32)
Seeks the index of the nth instance of the supplied sub buffer.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int IndexOf(
    byte[] subBuffer_,
    uint instance_
)

Parameters

subBuffer_
Type: SystemByte
Buffer to seek
instance_
Type: SystemUInt32
Instance to find

Return Value

Type: Int32
The zero based index or -1 if not found
See Also

Reference

DataBuffer Class
IndexOf Overload
Bncs.SysUtils Namespace


DataBuffer.IndexOf Method (String, UInt32)

DataBufferIndexOf Method (String, UInt32)
Seeks the index of the nth instance of the supplied string.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int IndexOf(
    string subBuffer_,
    uint instance_
)

Parameters

subBuffer_
Type: SystemString
String to seek
instance_
Type: SystemUInt32
Instance to find

Return Value

Type: Int32
The zero based index or -1 if not found
See Also

Reference

DataBuffer Class
IndexOf Overload
Bncs.SysUtils Namespace


DataBuffer.IndexOfBeyond Method

DataBufferIndexOfBeyond Method
Overload List
 | Name | Description
Public method | IndexOfBeyond(Byte, Int32) | Seeks the index of the supplied sub buffer from beyond the specified point.
Public method | IndexOfBeyond(Byte, UInt32, Int32) | Seeks the index of the nth instance of the supplied sub buffer from beyond the specified point.
Top
See Also

Reference

DataBuffer Class
Bncs.SysUtils Namespace


DataBuffer.IndexOfBeyond Method (Byte[], Int32)

DataBufferIndexOfBeyond Method (Byte, Int32)
Seeks the index of the supplied sub buffer from beyond the specified point.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int IndexOfBeyond(
    byte[] subBuffer_,
    int startIndex_
)

Parameters

subBuffer_
Type: SystemByte
Buffer to seek
startIndex_
Type: SystemInt32
Buffer index after which the scan will begin.

Return Value

Type: Int32
The zero based index or -1 if not found
See Also

Reference

DataBuffer Class
IndexOfBeyond Overload
Bncs.SysUtils Namespace


DataBuffer.IndexOfBeyond Method (Byte[], UInt32, Int32)

DataBufferIndexOfBeyond Method (Byte, UInt32, Int32)
Seeks the index of the nth instance of the supplied sub buffer from beyond the specified point.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int IndexOfBeyond(
    byte[] subBuffer_,
    uint instance_,
    int startIndex_
)

Parameters

subBuffer_
Type: SystemByte
Buffer to seek
instance_
Type: SystemUInt32
Instance to find
startIndex_
Type: SystemInt32
Buffer index after which the scan will begin.

Return Value

Type: Int32
The zero based index or -1 if not found
See Also

Reference

DataBuffer Class
IndexOfBeyond Overload
Bncs.SysUtils Namespace


DataBuffer.Insert Method

DataBufferInsert Method
Inserts the supplied buffer.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[] Insert(
    int index_,
    byte[] buffer_
)

Parameters

index_
Type: SystemInt32
Index of insertion point.
buffer_
Type: SystemByte
Buffer to indert.

Return Value

Type: Byte
An array of bytes consisting of the underlying buffer with the buffer supplied inserted.
See Also

Reference

DataBuffer Class
Bncs.SysUtils Namespace


DataBuffer.InstancesOf Method

DataBufferInstancesOf Method
Overload List
 | Name | Description
Public method | InstancesOf(Byte) | Ascertains how many instances of the supplied buffer are contained within the underlying buffer.
Public method | InstancesOf(String) | Ascertains how many instances of the supplied string are contained within the underlying buffer.
Top
See Also

Reference

DataBuffer Class
Bncs.SysUtils Namespace


DataBuffer.InstancesOf Method (Byte[])

DataBufferInstancesOf Method (Byte)
Ascertains how many instances of the supplied buffer are contained within the underlying buffer.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint InstancesOf(
    byte[] buffer_
)

Parameters

buffer_
Type: SystemByte
Buffer to seek and count.

Return Value

Type: UInt32
The number of supplied buffer instances found.
See Also

Reference

DataBuffer Class
InstancesOf Overload
Bncs.SysUtils Namespace


DataBuffer.InstancesOf Method (String)

DataBufferInstancesOf Method (String)
Ascertains how many instances of the supplied string are contained within the underlying buffer.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint InstancesOf(
    string buffer_
)

Parameters

buffer_
Type: SystemString
String to seek and count.

Return Value

Type: UInt32
The number of supplied string instances found.
See Also

Reference

DataBuffer Class
InstancesOf Overload
Bncs.SysUtils Namespace


DataBuffer.IsEqual Method

DataBufferIsEqual Method
Overload List
 | Name | Description
Public method | IsEqual(Byte) | Checks for equality with the supplied buffer.
Public method | IsEqual(String) | Checks for equality with the supplied string.
Top
See Also

Reference

DataBuffer Class
Bncs.SysUtils Namespace


DataBuffer.IsEqual Method (Byte[])

DataBufferIsEqual Method (Byte)
Checks for equality with the supplied buffer.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool IsEqual(
    byte[] buffer_
)

Parameters

buffer_
Type: SystemByte
Buffer to compare

Return Value

Type: Boolean
True if the two byte arrays are identical.
See Also

Reference

DataBuffer Class
IsEqual Overload
Bncs.SysUtils Namespace


DataBuffer.IsEqual Method (String)

DataBufferIsEqual Method (String)
Checks for equality with the supplied string.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool IsEqual(
    string buffer_
)

Parameters

buffer_
Type: SystemString
Buffer to compare

Return Value

Type: Boolean
True if the two byte arrays are identical.
See Also

Reference

DataBuffer Class
IsEqual Overload
Bncs.SysUtils Namespace


DataBuffer.LastIndexOf Method

DataBufferLastIndexOf Method
Overload List
 | Name | Description
Public method | LastIndexOf(Byte) | Seeks the final index of the supplied buffer.
Public method | LastIndexOf(String) | Seeks the final index of the supplied buffer.
Top
See Also

Reference

DataBuffer Class
Bncs.SysUtils Namespace


DataBuffer.LastIndexOf Method (Byte[])

DataBufferLastIndexOf Method (Byte)
Seeks the final index of the supplied buffer.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int LastIndexOf(
    byte[] buffer_
)

Parameters

buffer_
Type: SystemByte
Buffer to seek.

Return Value

Type: Int32
The zero based index or -1 if not found
See Also

Reference

DataBuffer Class
LastIndexOf Overload
Bncs.SysUtils Namespace


DataBuffer.LastIndexOf Method (String)

DataBufferLastIndexOf Method (String)
Seeks the final index of the supplied buffer.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int LastIndexOf(
    string buffer_
)

Parameters

buffer_
Type: SystemString
String to seek.

Return Value

Type: Int32
The zero based index or -1 if not found
See Also

Reference

DataBuffer Class
LastIndexOf Overload
Bncs.SysUtils Namespace


DataBuffer.Remove Method

DataBufferRemove Method
Overload List
 | Name | Description
Public method | Remove(Int32) | Removes bytes from the buffer from the supplied index to the end of the buffer.
Public method | Remove(Int32, Int32) | Removes bytes from the buffer from the supplied index to the count point.
Top
See Also

Reference

DataBuffer Class
Bncs.SysUtils Namespace


DataBuffer.Remove Method (Int32)

DataBufferRemove Method (Int32)
Removes bytes from the buffer from the supplied index to the end of the buffer.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[] Remove(
    int startIndex_
)

Parameters

startIndex_
Type: SystemInt32
Index of removal point

Return Value

Type: Byte
An array of bytes consisting of the underlying buffer with bytes removed from the start index.
See Also

Reference

DataBuffer Class
Remove Overload
Bncs.SysUtils Namespace


DataBuffer.Remove Method (Int32, Int32)

DataBufferRemove Method (Int32, Int32)
Removes bytes from the buffer from the supplied index to the count point.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[] Remove(
    int startIndex_,
    int count_
)

Parameters

startIndex_
Type: SystemInt32
Index of removal point
count_
Type: SystemInt32
Number of bytes to remove.

Return Value

Type: Byte
An array of bytes consisting of the underlying buffer with bytes removed from the start index for count bytes.
See Also

Reference

DataBuffer Class
Remove Overload
Bncs.SysUtils Namespace


DataBuffer.RemoveAll Method

DataBufferRemoveAll Method
Removes all instances of the supplied byte from the buffer

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[] RemoveAll(
    byte byte_
)

Parameters

byte_
Type: SystemByte
Byte to remove

Return Value

Type: Byte
Null if the byte was not found or an array of bytes representing the current buffer minus all instances of the supplied byte
See Also

Reference

DataBuffer Class
Bncs.SysUtils Namespace


DataBuffer.Replace Method

DataBufferReplace Method
Overload List
Name Description
Public method Replace(Byte, Byte)
Replaces all instances of one byte with another.
Replace(Byte, Byte)
Replaces all instances of one byte array with another.
Examples
This code is an example of the DataBuffer class demonstrating a string constructor, the Buffer property and the ToString and Replace(Byte, Byte) methods.
Copy
class Program
{
    static void Main()
    {
        DataBuffer buffer = new DataBuffer("Hello Earth how are you?");
        Console.WriteLine("BUFFER: " + buffer.ToString());
        Console.WriteLine("Replace \"Earth\" with \"World\": " +  new DataBuffer(buffer.Replace(new DataBuffer("Earth").Buffer, new DataBuffer("World").Buffer)).ToString());

        Console.ReadKey();
    }
}
Top
See Also

Reference

DataBuffer Class
Bncs.SysUtils Namespace


DataBuffer.Replace Method (Byte, Byte)

DataBufferReplace Method (Byte, Byte)
Replaces all instances of one byte with another.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[] Replace(
    byte oldByte_,
    byte newByte_
)

Parameters

oldByte_
Type: SystemByte
Byte to remove.
newByte_
Type: SystemByte
Byte to replace

Return Value

Type: Byte
An array of bytes with the replacement made.
See Also

Reference

DataBuffer Class
Replace Overload
Bncs.SysUtils Namespace


DataBuffer.Replace Method (Byte[], Byte[])

DataBufferReplace Method (Byte, Byte)
Replaces all instances of one byte array with another.
Examples
This code is an example of the DataBuffer class demonstrating a string constructor, the Buffer property and the ToString and Replace(Byte, Byte) methods.
Copy
class Program
{
    static void Main()
    {
        DataBuffer buffer = new DataBuffer("Hello Earth how are you?");
        Console.WriteLine("BUFFER: " + buffer.ToString());
        Console.WriteLine("Replace \"Earth\" with \"World\": " +  new DataBuffer(buffer.Replace(new DataBuffer("Earth").Buffer, new DataBuffer("World").Buffer)).ToString());

        Console.ReadKey();
    }
}

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[] Replace(
    byte[] oldBytes_,
    byte[] newBytes_
)

Parameters

oldBytes_
Type: SystemByte
Byte to remove.
newBytes_
Type: SystemByte
Byte to replace

Return Value

Type: Byte
An array of bytes with the replacement made.
See Also

Reference

DataBuffer Class
Replace Overload
Bncs.SysUtils Namespace


DataBuffer.Reverse Method

DataBufferReverse Method
Reverses the underlying buffer.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[] Reverse()

Return Value

Type: Byte
A copy of the underlying buffer reversed.
See Also

Reference

DataBuffer Class
Bncs.SysUtils Namespace


DataBuffer.Split Method

DataBufferSplit Method
Overload List
 | Name | Description
Public method | Split(Byte) | Splits the buffer using the supplied byte delimiter.
Public method | Split(Byte) | Splits the buffer using the supplied byte array delimiter.
Public method | Split(Char) | Splits the buffer using the supplied character delimiter.
Public method | Split(String) | Splits the buffer using the supplied string delimiter.
Top
See Also

Reference

DataBuffer Class
Bncs.SysUtils Namespace


DataBuffer.Split Method (Byte)

DataBufferSplit Method (Byte)
Splits the buffer using the supplied byte delimiter.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[][] Split(
    byte delimiter_
)

Parameters

delimiter_
Type: SystemByte
Delimiter to denote split points.

Return Value

Type: Byte
An array of byte arrays.
See Also

Reference

DataBuffer Class
Split Overload
Bncs.SysUtils Namespace


DataBuffer.Split Method (Byte[])

DataBufferSplit Method (Byte)
Splits the buffer using the supplied byte array delimiter.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[][] Split(
    byte[] delimiter_
)

Parameters

delimiter_
Type: SystemByte
Delimiter to denote split points.

Return Value

Type: Byte
An array of byte arrays.
See Also

Reference

DataBuffer Class
Split Overload
Bncs.SysUtils Namespace


DataBuffer.Split Method (Char)

DataBufferSplit Method (Char)
Splits the buffer using the supplied character delimiter.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[][] Split(
    char delimiter_
)

Parameters

delimiter_
Type: SystemChar
Delimiter to denote split points.

Return Value

Type: Byte
An array of byte arrays.
See Also

Reference

DataBuffer Class
Split Overload
Bncs.SysUtils Namespace


DataBuffer.Split Method (String)

DataBufferSplit Method (String)
Splits the buffer using the supplied string delimiter.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[][] Split(
    string delimiter_
)

Parameters

delimiter_
Type: SystemString
Delimiter to denote split points.

Return Value

Type: Byte
An array of byte arrays.
See Also

Reference

DataBuffer Class
Split Overload
Bncs.SysUtils Namespace


DataBuffer.StartsWith Method

DataBufferStartsWith Method
Overload List
 | Name | Description
Public method | StartsWith(Byte) | Evaluates if the buffer starts with the supplied buffer.
Public method | StartsWith(String) | Evaluates if the buffer starts with the supplied string.
Top
See Also

Reference

DataBuffer Class
Bncs.SysUtils Namespace


DataBuffer.StartsWith Method (Byte[])

DataBufferStartsWith Method (Byte)
Evaluates if the buffer starts with the supplied buffer.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool StartsWith(
    byte[] buffer_
)

Parameters

buffer_
Type: SystemByte
Buffer to seek at position #0.

Return Value

Type: Boolean
True if found at start of underlying buffer.
See Also

Reference

DataBuffer Class
StartsWith Overload
Bncs.SysUtils Namespace


DataBuffer.StartsWith Method (String)

DataBufferStartsWith Method (String)
Evaluates if the buffer starts with the supplied string.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool StartsWith(
    string buffer_
)

Parameters

buffer_
Type: SystemString
Buffer to seek at position #0.

Return Value

Type: Boolean
True if found at start of underlying buffer.
See Also

Reference

DataBuffer Class
StartsWith Overload
Bncs.SysUtils Namespace


DataBuffer.SubBuffer Method

DataBufferSubBuffer Method
Overload List
 | Name | Description
Public method | SubBuffer(Int32) | Gets a subset of the buffer from the supplied index.
Public method | SubBuffer(Int32, Int32) | Gets a subset of the buffer from the supplied index and length.
Top
See Also

Reference

DataBuffer Class
Bncs.SysUtils Namespace


DataBuffer.SubBuffer Method (Int32)

DataBufferSubBuffer Method (Int32)
Gets a subset of the buffer from the supplied index.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[] SubBuffer(
    int index_
)

Parameters

index_
Type: SystemInt32
Index from where to start copying the result.

Return Value

Type: Byte
An array of bytes from the supplied index to the end of the buffer.
See Also

Reference

DataBuffer Class
SubBuffer Overload
Bncs.SysUtils Namespace


DataBuffer.SubBuffer Method (Int32, Int32)

DataBufferSubBuffer Method (Int32, Int32)
Gets a subset of the buffer from the supplied index and length.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[] SubBuffer(
    int index_,
    int length_
)

Parameters

index_
Type: SystemInt32
Index from where to start copying the result.
length_
Type: SystemInt32
Number of bytes to copy

Return Value

Type: Byte
An array of bytes from the supplied index for length_ bytes.
See Also

Reference

DataBuffer Class
SubBuffer Overload
Bncs.SysUtils Namespace


DataBuffer.ToLower Method

DataBufferToLower Method
Converts all alphabetical characters to lowercase.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[] ToLower()

Return Value

Type: Byte
A byte array with any uppercase letters replaced with lower.
See Also

Reference

DataBuffer Class
Bncs.SysUtils Namespace


DataBuffer.ToPrintableString Method

DataBufferToPrintableString Method
Gets a printable string representation of the buffer.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string ToPrintableString()

Return Value

Type: String
The buffer as a string with all control characters swapped for a hyphen
See Also

Reference

DataBuffer Class
Bncs.SysUtils Namespace


DataBuffer.ToString Method

DataBufferToString Method
Returns the instance as a string.
Examples
This code is an example of the DataBuffer class demonstrating a string constructor, the Buffer property and the ToString and Replace(Byte, Byte) methods.
Copy
class Program
{
    static void Main()
    {
        DataBuffer buffer = new DataBuffer("Hello Earth how are you?");
        Console.WriteLine("BUFFER: " + buffer.ToString());
        Console.WriteLine("Replace \"Earth\" with \"World\": " +  new DataBuffer(buffer.Replace(new DataBuffer("Earth").Buffer, new DataBuffer("World").Buffer)).ToString());

        Console.ReadKey();
    }
}

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
The underlying buffer as a string.
See Also

Reference

DataBuffer Class
Bncs.SysUtils Namespace


DataBuffer.ToStrings Method

DataBufferToStrings Method

[Missing <summary> documentation for "M:Bncs.SysUtils.DataBuffer.ToStrings"]

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<string> ToStrings()

Return Value

Type: List String

[Missing <returns> documentation for "M:Bncs.SysUtils.DataBuffer.ToStrings"]

See Also

Reference

DataBuffer Class
Bncs.SysUtils Namespace


DataBuffer.ToUpper Method

DataBufferToUpper Method
Converts all alphabetical characters to uppercase.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[] ToUpper()

Return Value

Type: Byte
A byte array with any lowercase letters replaced with upper.
See Also

Reference

DataBuffer Class
Bncs.SysUtils Namespace


DataBuffer Properties

DataBuffer Properties

The DataBuffer type exposes the following members.

Properties
Name Description
Buffer
Gets a copy of the underlying buffer.
Replaces all instances of one byte array with another.
Examples
This code is an example of the DataBuffer class demonstrating a string constructor, the Buffer property and the ToString and Replace(Byte, Byte) methods.
Copy
class Program
{
    static void Main()
    {
        DataBuffer buffer = new DataBuffer("Hello Earth how are you?");
        Console.WriteLine("BUFFER: " + buffer.ToString());
        Console.WriteLine("Replace \"Earth\" with \"World\": " +  new DataBuffer(buffer.Replace(new DataBuffer("Earth").Buffer, new DataBuffer("World").Buffer)).ToString());

        Console.ReadKey();
    }
}
Byte to remove.Byte to replace

Return Value

Type:
An array of bytes with the replacement made.
Public property CaseSensitive
Gets or sets a flag dictating if bytes that represent letters should be case sensitive, default is true. When a byte to byte compare fails and this property is FALSE then a check occurs to see if both bytes translate to letters (A through Z or a through z). If so one is temporarily flicked from upper to lower (or reverse as applicable) and the compare is made again.
Public property CharArray
Gets a copy of the underlying buffer as a character array.
Public property Hex
Gets a copy of the underlying buffer as a hex string.
Top
See Also

Reference

DataBuffer Class
Bncs.SysUtils Namespace


DataBuffer.Buffer Property

DataBufferBuffer Property
Gets a copy of the underlying buffer.
Replaces all instances of one byte array with another.
Examples
This code is an example of the DataBuffer class demonstrating a string constructor, the Buffer property and the ToString and Replace(Byte, Byte) methods.
Copy
class Program
{
    static void Main()
    {
        DataBuffer buffer = new DataBuffer("Hello Earth how are you?");
        Console.WriteLine("BUFFER: " + buffer.ToString());
        Console.WriteLine("Replace \"Earth\" with \"World\": " +  new DataBuffer(buffer.Replace(new DataBuffer("Earth").Buffer, new DataBuffer("World").Buffer)).ToString());

        Console.ReadKey();
    }
}
Byte to remove.Byte to replace

Return Value

Type: Byte
An array of bytes with the replacement made.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[] Buffer { get; }

Property Value

Type: Byte
See Also

Reference

DataBuffer Class
Bncs.SysUtils Namespace


DataBuffer.CaseSensitive Property

DataBufferCaseSensitive Property
Gets or sets a flag dictating if bytes that represent letters should be case sensitive, default is true. When a byte to byte compare fails and this property is FALSE then a check occurs to see if both bytes translate to letters (A through Z or a through z). If so one is temporarily flicked from upper to lower (or reverse as applicable) and the compare is made again.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool CaseSensitive { get; set; }

Property Value

Type: Boolean
See Also

Reference

DataBuffer Class
Bncs.SysUtils Namespace


DataBuffer.CharArray Property

DataBufferCharArray Property
Gets a copy of the underlying buffer as a character array.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public char[] CharArray { get; }

Property Value

Type: Char
See Also

Reference

DataBuffer Class
Bncs.SysUtils Namespace


DataBuffer.Hex Property

DataBufferHex Property
Gets a copy of the underlying buffer as a hex string.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Hex { get; }

Property Value

Type: String
See Also

Reference

DataBuffer Class
Bncs.SysUtils Namespace


DirectoryInfoEx Class

DirectoryInfoEx Class
DirectoryInfoEx, surfaces long and short directory name properties for the given directory.
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsDirectoryInfoEx

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class DirectoryInfoEx

The DirectoryInfoEx type exposes the following members.

Constructors
Name Description
DirectoryInfoEx
Constructor setting the directory.
Examples
This code demonstrates some uses of FileFuncs, FileInfoEx, DirFuncs and DirectoryInfoEx.
Copy
class Program
{
    static void Main()
    {
        // Set a new dir name
        string directory = "c:\\This is my directory";
        // If it doesn't exist then create it
        bool exists = DirFuncs.Exists(directory);
        if (!exists)
            exists = DirFuncs.MakeDirectory(directory);

        if (exists)
        {
            // Print out the long and short dir names
            DirectoryInfoEx dirInfo = new DirectoryInfoEx(directory);
            Console.WriteLine("Long Name: " + dirInfo.LongDirectoryName);
            Console.WriteLine("8.3 Name: " + dirInfo.ShortDirectoryName);

            // Create a unique file name, each time you run this code a new file will be created
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "Unique.txt";
            if (FileFuncs.Exists(filename))
                filename = FileFuncs.GenerateUniqueFilename(filename, string.Empty, '_');
            Console.WriteLine("Creating new empty file \"" + filename + "\" ...");
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename);
            writer.Close();

            // Print out the new files Archive attribute
            FileInfoEx fileInfo = new FileInfoEx(filename);
            Console.WriteLine("Archive attribute of \"" + filename + "\" is " + (fileInfo.Archive ? "SET" : " NOT set"));
            Console.WriteLine("Press a key to toggle this attribute");
            Console.ReadKey();
            // Toggle the new files Archive attribute
            fileInfo.Archive = !fileInfo.Archive;
            Console.WriteLine("Archive attribute of \"" + filename + "\" is NOW " + (fileInfo.Archive ? "SET" : " NOT set"));
        }
        else
            Console.WriteLine(directory + " not found and could not be created!");

        Console.ReadKey();
    }
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
Name Description
Public property Information
Gets the underlying DirectoryInfo class.
LongDirectoryName
Gets the long directory name.
Examples
This code demonstrates some uses of FileFuncs, FileInfoEx, DirFuncs and DirectoryInfoEx.
Copy
class Program
{
    static void Main()
    {
        // Set a new dir name
        string directory = "c:\\This is my directory";
        // If it doesn't exist then create it
        bool exists = DirFuncs.Exists(directory);
        if (!exists)
            exists = DirFuncs.MakeDirectory(directory);

        if (exists)
        {
            // Print out the long and short dir names
            DirectoryInfoEx dirInfo = new DirectoryInfoEx(directory);
            Console.WriteLine("Long Name: " + dirInfo.LongDirectoryName);
            Console.WriteLine("8.3 Name: " + dirInfo.ShortDirectoryName);

            // Create a unique file name, each time you run this code a new file will be created
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "Unique.txt";
            if (FileFuncs.Exists(filename))
                filename = FileFuncs.GenerateUniqueFilename(filename, string.Empty, '_');
            Console.WriteLine("Creating new empty file \"" + filename + "\" ...");
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename);
            writer.Close();

            // Print out the new files Archive attribute
            FileInfoEx fileInfo = new FileInfoEx(filename);
            Console.WriteLine("Archive attribute of \"" + filename + "\" is " + (fileInfo.Archive ? "SET" : " NOT set"));
            Console.WriteLine("Press a key to toggle this attribute");
            Console.ReadKey();
            // Toggle the new files Archive attribute
            fileInfo.Archive = !fileInfo.Archive;
            Console.WriteLine("Archive attribute of \"" + filename + "\" is NOW " + (fileInfo.Archive ? "SET" : " NOT set"));
        }
        else
            Console.WriteLine(directory + " not found and could not be created!");

        Console.ReadKey();
    }
ShortDirectoryName
Gets the short (8.3) directory name.
Examples
This code demonstrates some uses of FileFuncs, FileInfoEx, DirFuncs and DirectoryInfoEx.
Copy
class Program
{
    static void Main()
    {
        // Set a new dir name
        string directory = "c:\\This is my directory";
        // If it doesn't exist then create it
        bool exists = DirFuncs.Exists(directory);
        if (!exists)
            exists = DirFuncs.MakeDirectory(directory);

        if (exists)
        {
            // Print out the long and short dir names
            DirectoryInfoEx dirInfo = new DirectoryInfoEx(directory);
            Console.WriteLine("Long Name: " + dirInfo.LongDirectoryName);
            Console.WriteLine("8.3 Name: " + dirInfo.ShortDirectoryName);

            // Create a unique file name, each time you run this code a new file will be created
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "Unique.txt";
            if (FileFuncs.Exists(filename))
                filename = FileFuncs.GenerateUniqueFilename(filename, string.Empty, '_');
            Console.WriteLine("Creating new empty file \"" + filename + "\" ...");
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename);
            writer.Close();

            // Print out the new files Archive attribute
            FileInfoEx fileInfo = new FileInfoEx(filename);
            Console.WriteLine("Archive attribute of \"" + filename + "\" is " + (fileInfo.Archive ? "SET" : " NOT set"));
            Console.WriteLine("Press a key to toggle this attribute");
            Console.ReadKey();
            // Toggle the new files Archive attribute
            fileInfo.Archive = !fileInfo.Archive;
            Console.WriteLine("Archive attribute of \"" + filename + "\" is NOW " + (fileInfo.Archive ? "SET" : " NOT set"));
        }
        else
            Console.WriteLine(directory + " not found and could not be created!");

        Console.ReadKey();
    }
Top
See Also

Reference

Bncs.SysUtils Namespace


DirectoryInfoEx Constructor

DirectoryInfoEx Constructor
Constructor setting the directory.
Examples
This code demonstrates some uses of FileFuncs, FileInfoEx, DirFuncs and DirectoryInfoEx.
Copy
class Program
{
    static void Main()
    {
        // Set a new dir name
        string directory = "c:\\This is my directory";
        // If it doesn't exist then create it
        bool exists = DirFuncs.Exists(directory);
        if (!exists)
            exists = DirFuncs.MakeDirectory(directory);

        if (exists)
        {
            // Print out the long and short dir names
            DirectoryInfoEx dirInfo = new DirectoryInfoEx(directory);
            Console.WriteLine("Long Name: " + dirInfo.LongDirectoryName);
            Console.WriteLine("8.3 Name: " + dirInfo.ShortDirectoryName);

            // Create a unique file name, each time you run this code a new file will be created
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "Unique.txt";
            if (FileFuncs.Exists(filename))
                filename = FileFuncs.GenerateUniqueFilename(filename, string.Empty, '_');
            Console.WriteLine("Creating new empty file \"" + filename + "\" ...");
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename);
            writer.Close();

            // Print out the new files Archive attribute
            FileInfoEx fileInfo = new FileInfoEx(filename);
            Console.WriteLine("Archive attribute of \"" + filename + "\" is " + (fileInfo.Archive ? "SET" : " NOT set"));
            Console.WriteLine("Press a key to toggle this attribute");
            Console.ReadKey();
            // Toggle the new files Archive attribute
            fileInfo.Archive = !fileInfo.Archive;
            Console.WriteLine("Archive attribute of \"" + filename + "\" is NOW " + (fileInfo.Archive ? "SET" : " NOT set"));
        }
        else
            Console.WriteLine(directory + " not found and could not be created!");

        Console.ReadKey();
    }

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public DirectoryInfoEx(
    string directoryName_
)

Parameters

directoryName_
Type: SystemString
Path of the directory
See Also

Reference

DirectoryInfoEx Class
Bncs.SysUtils Namespace


DirectoryInfoEx Methods

DirectoryInfoEx Methods

The DirectoryInfoEx type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

DirectoryInfoEx Class
Bncs.SysUtils Namespace


DirectoryInfoEx Properties

DirectoryInfoEx Properties

The DirectoryInfoEx type exposes the following members.

Properties
Name Description
Public property Information
Gets the underlying DirectoryInfo class.
LongDirectoryName
Gets the long directory name.
Examples
This code demonstrates some uses of FileFuncs, FileInfoEx, DirFuncs and DirectoryInfoEx.
Copy
class Program
{
    static void Main()
    {
        // Set a new dir name
        string directory = "c:\\This is my directory";
        // If it doesn't exist then create it
        bool exists = DirFuncs.Exists(directory);
        if (!exists)
            exists = DirFuncs.MakeDirectory(directory);

        if (exists)
        {
            // Print out the long and short dir names
            DirectoryInfoEx dirInfo = new DirectoryInfoEx(directory);
            Console.WriteLine("Long Name: " + dirInfo.LongDirectoryName);
            Console.WriteLine("8.3 Name: " + dirInfo.ShortDirectoryName);

            // Create a unique file name, each time you run this code a new file will be created
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "Unique.txt";
            if (FileFuncs.Exists(filename))
                filename = FileFuncs.GenerateUniqueFilename(filename, string.Empty, '_');
            Console.WriteLine("Creating new empty file \"" + filename + "\" ...");
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename);
            writer.Close();

            // Print out the new files Archive attribute
            FileInfoEx fileInfo = new FileInfoEx(filename);
            Console.WriteLine("Archive attribute of \"" + filename + "\" is " + (fileInfo.Archive ? "SET" : " NOT set"));
            Console.WriteLine("Press a key to toggle this attribute");
            Console.ReadKey();
            // Toggle the new files Archive attribute
            fileInfo.Archive = !fileInfo.Archive;
            Console.WriteLine("Archive attribute of \"" + filename + "\" is NOW " + (fileInfo.Archive ? "SET" : " NOT set"));
        }
        else
            Console.WriteLine(directory + " not found and could not be created!");

        Console.ReadKey();
    }
ShortDirectoryName
Gets the short (8.3) directory name.
Examples
This code demonstrates some uses of FileFuncs, FileInfoEx, DirFuncs and DirectoryInfoEx.
Copy
class Program
{
    static void Main()
    {
        // Set a new dir name
        string directory = "c:\\This is my directory";
        // If it doesn't exist then create it
        bool exists = DirFuncs.Exists(directory);
        if (!exists)
            exists = DirFuncs.MakeDirectory(directory);

        if (exists)
        {
            // Print out the long and short dir names
            DirectoryInfoEx dirInfo = new DirectoryInfoEx(directory);
            Console.WriteLine("Long Name: " + dirInfo.LongDirectoryName);
            Console.WriteLine("8.3 Name: " + dirInfo.ShortDirectoryName);

            // Create a unique file name, each time you run this code a new file will be created
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "Unique.txt";
            if (FileFuncs.Exists(filename))
                filename = FileFuncs.GenerateUniqueFilename(filename, string.Empty, '_');
            Console.WriteLine("Creating new empty file \"" + filename + "\" ...");
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename);
            writer.Close();

            // Print out the new files Archive attribute
            FileInfoEx fileInfo = new FileInfoEx(filename);
            Console.WriteLine("Archive attribute of \"" + filename + "\" is " + (fileInfo.Archive ? "SET" : " NOT set"));
            Console.WriteLine("Press a key to toggle this attribute");
            Console.ReadKey();
            // Toggle the new files Archive attribute
            fileInfo.Archive = !fileInfo.Archive;
            Console.WriteLine("Archive attribute of \"" + filename + "\" is NOW " + (fileInfo.Archive ? "SET" : " NOT set"));
        }
        else
            Console.WriteLine(directory + " not found and could not be created!");

        Console.ReadKey();
    }
Top
See Also

Reference

DirectoryInfoEx Class
Bncs.SysUtils Namespace


DirectoryInfoEx.Information Property

DirectoryInfoExInformation Property
Gets the underlying DirectoryInfo class.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public DirectoryInfo Information { get; }

Property Value

Type: DirectoryInfo
See Also

Reference

DirectoryInfoEx Class
Bncs.SysUtils Namespace


DirectoryInfoEx.LongDirectoryName Property

DirectoryInfoExLongDirectoryName Property
Gets the long directory name.
Examples
This code demonstrates some uses of FileFuncs, FileInfoEx, DirFuncs and DirectoryInfoEx.
Copy
class Program
{
    static void Main()
    {
        // Set a new dir name
        string directory = "c:\\This is my directory";
        // If it doesn't exist then create it
        bool exists = DirFuncs.Exists(directory);
        if (!exists)
            exists = DirFuncs.MakeDirectory(directory);

        if (exists)
        {
            // Print out the long and short dir names
            DirectoryInfoEx dirInfo = new DirectoryInfoEx(directory);
            Console.WriteLine("Long Name: " + dirInfo.LongDirectoryName);
            Console.WriteLine("8.3 Name: " + dirInfo.ShortDirectoryName);

            // Create a unique file name, each time you run this code a new file will be created
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "Unique.txt";
            if (FileFuncs.Exists(filename))
                filename = FileFuncs.GenerateUniqueFilename(filename, string.Empty, '_');
            Console.WriteLine("Creating new empty file \"" + filename + "\" ...");
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename);
            writer.Close();

            // Print out the new files Archive attribute
            FileInfoEx fileInfo = new FileInfoEx(filename);
            Console.WriteLine("Archive attribute of \"" + filename + "\" is " + (fileInfo.Archive ? "SET" : " NOT set"));
            Console.WriteLine("Press a key to toggle this attribute");
            Console.ReadKey();
            // Toggle the new files Archive attribute
            fileInfo.Archive = !fileInfo.Archive;
            Console.WriteLine("Archive attribute of \"" + filename + "\" is NOW " + (fileInfo.Archive ? "SET" : " NOT set"));
        }
        else
            Console.WriteLine(directory + " not found and could not be created!");

        Console.ReadKey();
    }

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string LongDirectoryName { get; }

Property Value

Type: String
See Also

Reference

DirectoryInfoEx Class
Bncs.SysUtils Namespace


DirectoryInfoEx.ShortDirectoryName Property

DirectoryInfoExShortDirectoryName Property
Gets the short (8.3) directory name.
Examples
This code demonstrates some uses of FileFuncs, FileInfoEx, DirFuncs and DirectoryInfoEx.
Copy
class Program
{
    static void Main()
    {
        // Set a new dir name
        string directory = "c:\\This is my directory";
        // If it doesn't exist then create it
        bool exists = DirFuncs.Exists(directory);
        if (!exists)
            exists = DirFuncs.MakeDirectory(directory);

        if (exists)
        {
            // Print out the long and short dir names
            DirectoryInfoEx dirInfo = new DirectoryInfoEx(directory);
            Console.WriteLine("Long Name: " + dirInfo.LongDirectoryName);
            Console.WriteLine("8.3 Name: " + dirInfo.ShortDirectoryName);

            // Create a unique file name, each time you run this code a new file will be created
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "Unique.txt";
            if (FileFuncs.Exists(filename))
                filename = FileFuncs.GenerateUniqueFilename(filename, string.Empty, '_');
            Console.WriteLine("Creating new empty file \"" + filename + "\" ...");
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename);
            writer.Close();

            // Print out the new files Archive attribute
            FileInfoEx fileInfo = new FileInfoEx(filename);
            Console.WriteLine("Archive attribute of \"" + filename + "\" is " + (fileInfo.Archive ? "SET" : " NOT set"));
            Console.WriteLine("Press a key to toggle this attribute");
            Console.ReadKey();
            // Toggle the new files Archive attribute
            fileInfo.Archive = !fileInfo.Archive;
            Console.WriteLine("Archive attribute of \"" + filename + "\" is NOW " + (fileInfo.Archive ? "SET" : " NOT set"));
        }
        else
            Console.WriteLine(directory + " not found and could not be created!");

        Console.ReadKey();
    }

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string ShortDirectoryName { get; }

Property Value

Type: String
See Also

Reference

DirectoryInfoEx Class
Bncs.SysUtils Namespace


DirFileFuncs Class

DirFileFuncs Class
Various file and directory orientated functions.
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsDirFileFuncs

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static class DirFileFuncs

The DirFileFuncs type exposes the following members.

Methods
Name | Description
Split | Splits the supplied file name into seperate file and directory name strings.
Top
See Also

Reference

Bncs.SysUtils Namespace


DirFileFuncs Methods

DirFileFuncs Methods

The DirFileFuncs type exposes the following members.

Methods
Name | Description
Split | Splits the supplied file name into seperate file and directory name strings.
Top
See Also

Reference

DirFileFuncs Class
Bncs.SysUtils Namespace


DirFileFuncs.Split Method

DirFileFuncsSplit Method
Splits the supplied file name into seperate file and directory name strings.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static Nullable<KeyValuePair<string, string>> Split(
    string fileName_
)

Parameters

fileName_
Type: SystemString
File name to split

Return Value

Type: Nullable KeyValuePair String, String
Null if either the file name or the directory path are invalid else a nullable KeyValuePair, the key of which is the file name and the value is the directory name.
See Also

Reference

DirFileFuncs Class
Bncs.SysUtils Namespace


DirFuncs Class

DirFuncs Class
Various directory orientated functions.
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsDirFuncs

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static class DirFuncs

The DirFuncs type exposes the following members.

Methods
Name Description
Copy(String, String)
Copies the source directory to the target directory.
Copy(String, String, Boolean)
Copies the source directory to the target directory with an option to recurse sub directories.
Delete(String)
Deletes a single empty directory without throwing an exception
Delete(String, Boolean)
Deletes a directory if no files exist. If recursive_ is true then all sub-directories are deleted too providing they are empty
Delete(String, String)
Deletes a single empty directory without throwing an exception
Delete(String, Boolean, Boolean)
Deletes a directory. If recursive_ is true then all sub-directories are deleted too. WARNING: If failIfFilesExist_ is false then all files in the directory and, if recursive_ is true, it's sub-directories are deleted too.
Delete(String, Boolean, String)
Deletes a directory if no files exist. If recursive_ is true then all sub-directories are deleted too providing they are empty
Delete(String, Boolean, Boolean, String)
Deletes a directory. If recursive_ is true then all sub-directories are deleted too. WARNING: If failIfFilesExist_ is false then all files in the directory and, if recursive_ is true, it's sub-directories are deleted too.
ExcludeTrailingBackslash
Ensures the path includes a trailing backslash
Exists
Tests if the supplied directory path exists. This is included for completeness in case System.IO is not used (and doesn't need to be) but Bncs.SysUtils is.
Examples
This code demonstrates some uses of FileFuncs, FileInfoEx, DirFuncs and DirectoryInfoEx.
Copy
class Program
{
    static void Main()
    {
        // Set a new dir name
        string directory = "c:\\This is my directory";
        // If it doesn't exist then create it
        bool exists = DirFuncs.Exists(directory);
        if (!exists)
            exists = DirFuncs.MakeDirectory(directory);

        if (exists)
        {
            // Print out the long and short dir names
            DirectoryInfoEx dirInfo = new DirectoryInfoEx(directory);
            Console.WriteLine("Long Name: " + dirInfo.LongDirectoryName);
            Console.WriteLine("8.3 Name: " + dirInfo.ShortDirectoryName);

            // Create a unique file name, each time you run this code a new file will be created
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "Unique.txt";
            if (FileFuncs.Exists(filename))
                filename = FileFuncs.GenerateUniqueFilename(filename, string.Empty, '_');
            Console.WriteLine("Creating new empty file \"" + filename + "\" ...");
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename);
            writer.Close();

            // Print out the new files Archive attribute
            FileInfoEx fileInfo = new FileInfoEx(filename);
            Console.WriteLine("Archive attribute of \"" + filename + "\" is " + (fileInfo.Archive ? "SET" : " NOT set"));
            Console.WriteLine("Press a key to toggle this attribute");
            Console.ReadKey();
            // Toggle the new files Archive attribute
            fileInfo.Archive = !fileInfo.Archive;
            Console.WriteLine("Archive attribute of \"" + filename + "\" is NOW " + (fileInfo.Archive ? "SET" : " NOT set"));
        }
        else
            Console.WriteLine(directory + " not found and could not be created!");

        Console.ReadKey();
    }
FindFile(String)
Searches for the first instance of the provided file name from every disks route directory on the computer
FindFile(String, FindFileLocation)
Searches for the first instance of the provided file name recursively
FindFile(String, String)
Searches for the first instance of the provided file name recursively from the root directory provided
FindFiles(String)
Searches for the provided file name recursively from every disks route directory on the computer
FindFiles(String, FindFileLocation)
Searches for the provided file name according to location, includes option to return just the first directory found to include the file
FindFiles(String, FindFileLocation, Boolean)
Searches for the provided file name according to location, includes option to return just the first directory found to include the file
FindFiles(String, String, Boolean)
Searches for the provided file name recursively from the root directory provided
GetPathLocale
Attempts to ascertain if the supplied path resides on the local machine or a remote one
IncludeTrailingBackslash
Ensures the path excludes a trailing backslash
Examples
This code demonstrates some uses of FileFuncs, DirFuncs and DriveFuncs.
Copy
class Program
{
    static void Main()
    {
        // Set up a new dir name
        string directory = "c:\\MyNewDir";
        // Create it
        if (DirFuncs.MakeDirectory(directory))
        {
            // Write a new text file to it (append if it exists)
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "MyFile.txt";
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename, true);
            writer.WriteLine("This is my file");
            writer.Close();

            // Set up a sub dir name
            directory = DirFuncs.IncludeTrailingBackslash(directory) + "MySubDir";
            // Create it
            if (DirFuncs.MakeDirectory(directory))
            {
                // Move MyFile.txt into the new sub dir
                if (FileFuncs.Move(filename, directory))
                    Console.WriteLine("MyFile.txt moved to new sub directory");
                else
                    Console.WriteLine("Failed to move MyFile.txt to new sub directory");
            }
            else
                Console.WriteLine("Failed to create new sub directory");
        }
        else
            Console.WriteLine("Failed to create new directory \"" + directory + "\"");

        // List all NTFS disk drives
        foreach (System.IO.DriveInfo info in DriveFuncs.GetDrives(DriveFileSystemType.NTFS))
            Console.WriteLine("Found NTFS drive: " + info.Name);

        Console.ReadKey();
    }
IsRemote
Enquires if the supplied path is known to be on a remote machine
IsValidDirectoryName
Checks for illegal characters (/ \ : * ? " > < |) in a directory name (directory name only, not a path)
IsValidDirectoryPath
IsValidDirectoryPathWithToken
MakeDirectory
Attempts to create the specified directory.
Examples
This code demonstrates some uses of FileFuncs, DirFuncs and DriveFuncs.
Copy
class Program
{
    static void Main()
    {
        // Set up a new dir name
        string directory = "c:\\MyNewDir";
        // Create it
        if (DirFuncs.MakeDirectory(directory))
        {
            // Write a new text file to it (append if it exists)
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "MyFile.txt";
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename, true);
            writer.WriteLine("This is my file");
            writer.Close();

            // Set up a sub dir name
            directory = DirFuncs.IncludeTrailingBackslash(directory) + "MySubDir";
            // Create it
            if (DirFuncs.MakeDirectory(directory))
            {
                // Move MyFile.txt into the new sub dir
                if (FileFuncs.Move(filename, directory))
                    Console.WriteLine("MyFile.txt moved to new sub directory");
                else
                    Console.WriteLine("Failed to move MyFile.txt to new sub directory");
            }
            else
                Console.WriteLine("Failed to create new sub directory");
        }
        else
            Console.WriteLine("Failed to create new directory \"" + directory + "\"");

        // List all NTFS disk drives
        foreach (System.IO.DriveInfo info in DriveFuncs.GetDrives(DriveFileSystemType.NTFS))
            Console.WriteLine("Found NTFS drive: " + info.Name);

        Console.ReadKey();
    }
Move(String, String)
Moves the source directory to the target directory.
Move(String, String, Boolean)
Moves the source directory to the target directory with an option to recurse.
Top
See Also

Reference

Bncs.SysUtils Namespace


DirFuncs Methods

DirFuncs Methods

The DirFuncs type exposes the following members.

Methods
Name Description
Copy(String, String)
Copies the source directory to the target directory.
Copy(String, String, Boolean)
Copies the source directory to the target directory with an option to recurse sub directories.
Delete(String)
Deletes a single empty directory without throwing an exception
Delete(String, Boolean)
Deletes a directory if no files exist. If recursive_ is true then all sub-directories are deleted too providing they are empty
Delete(String, String)
Deletes a single empty directory without throwing an exception
Delete(String, Boolean, Boolean)
Deletes a directory. If recursive_ is true then all sub-directories are deleted too. WARNING: If failIfFilesExist_ is false then all files in the directory and, if recursive_ is true, it's sub-directories are deleted too.
Delete(String, Boolean, String)
Deletes a directory if no files exist. If recursive_ is true then all sub-directories are deleted too providing they are empty
Delete(String, Boolean, Boolean, String)
Deletes a directory. If recursive_ is true then all sub-directories are deleted too. WARNING: If failIfFilesExist_ is false then all files in the directory and, if recursive_ is true, it's sub-directories are deleted too.
ExcludeTrailingBackslash
Ensures the path includes a trailing backslash
Exists
Tests if the supplied directory path exists. This is included for completeness in case System.IO is not used (and doesn't need to be) but Bncs.SysUtils is.
Examples
This code demonstrates some uses of FileFuncs, FileInfoEx, DirFuncs and DirectoryInfoEx.
Copy
class Program
{
    static void Main()
    {
        // Set a new dir name
        string directory = "c:\\This is my directory";
        // If it doesn't exist then create it
        bool exists = DirFuncs.Exists(directory);
        if (!exists)
            exists = DirFuncs.MakeDirectory(directory);

        if (exists)
        {
            // Print out the long and short dir names
            DirectoryInfoEx dirInfo = new DirectoryInfoEx(directory);
            Console.WriteLine("Long Name: " + dirInfo.LongDirectoryName);
            Console.WriteLine("8.3 Name: " + dirInfo.ShortDirectoryName);

            // Create a unique file name, each time you run this code a new file will be created
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "Unique.txt";
            if (FileFuncs.Exists(filename))
                filename = FileFuncs.GenerateUniqueFilename(filename, string.Empty, '_');
            Console.WriteLine("Creating new empty file \"" + filename + "\" ...");
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename);
            writer.Close();

            // Print out the new files Archive attribute
            FileInfoEx fileInfo = new FileInfoEx(filename);
            Console.WriteLine("Archive attribute of \"" + filename + "\" is " + (fileInfo.Archive ? "SET" : " NOT set"));
            Console.WriteLine("Press a key to toggle this attribute");
            Console.ReadKey();
            // Toggle the new files Archive attribute
            fileInfo.Archive = !fileInfo.Archive;
            Console.WriteLine("Archive attribute of \"" + filename + "\" is NOW " + (fileInfo.Archive ? "SET" : " NOT set"));
        }
        else
            Console.WriteLine(directory + " not found and could not be created!");

        Console.ReadKey();
    }
FindFile(String)
Searches for the first instance of the provided file name from every disks route directory on the computer
FindFile(String, FindFileLocation)
Searches for the first instance of the provided file name recursively
FindFile(String, String)
Searches for the first instance of the provided file name recursively from the root directory provided
FindFiles(String)
Searches for the provided file name recursively from every disks route directory on the computer
FindFiles(String, FindFileLocation)
Searches for the provided file name according to location, includes option to return just the first directory found to include the file
FindFiles(String, FindFileLocation, Boolean)
Searches for the provided file name according to location, includes option to return just the first directory found to include the file
FindFiles(String, String, Boolean)
Searches for the provided file name recursively from the root directory provided
GetPathLocale
Attempts to ascertain if the supplied path resides on the local machine or a remote one
IncludeTrailingBackslash
Ensures the path excludes a trailing backslash
Examples
This code demonstrates some uses of FileFuncs, DirFuncs and DriveFuncs.
Copy
class Program
{
    static void Main()
    {
        // Set up a new dir name
        string directory = "c:\\MyNewDir";
        // Create it
        if (DirFuncs.MakeDirectory(directory))
        {
            // Write a new text file to it (append if it exists)
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "MyFile.txt";
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename, true);
            writer.WriteLine("This is my file");
            writer.Close();

            // Set up a sub dir name
            directory = DirFuncs.IncludeTrailingBackslash(directory) + "MySubDir";
            // Create it
            if (DirFuncs.MakeDirectory(directory))
            {
                // Move MyFile.txt into the new sub dir
                if (FileFuncs.Move(filename, directory))
                    Console.WriteLine("MyFile.txt moved to new sub directory");
                else
                    Console.WriteLine("Failed to move MyFile.txt to new sub directory");
            }
            else
                Console.WriteLine("Failed to create new sub directory");
        }
        else
            Console.WriteLine("Failed to create new directory \"" + directory + "\"");

        // List all NTFS disk drives
        foreach (System.IO.DriveInfo info in DriveFuncs.GetDrives(DriveFileSystemType.NTFS))
            Console.WriteLine("Found NTFS drive: " + info.Name);

        Console.ReadKey();
    }
IsRemote
Enquires if the supplied path is known to be on a remote machine
IsValidDirectoryName
Checks for illegal characters (/ \ : * ? " > < |) in a directory name (directory name only, not a path)
IsValidDirectoryPath
IsValidDirectoryPathWithToken
MakeDirectory
Attempts to create the specified directory.
Examples
This code demonstrates some uses of FileFuncs, DirFuncs and DriveFuncs.
Copy
class Program
{
    static void Main()
    {
        // Set up a new dir name
        string directory = "c:\\MyNewDir";
        // Create it
        if (DirFuncs.MakeDirectory(directory))
        {
            // Write a new text file to it (append if it exists)
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "MyFile.txt";
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename, true);
            writer.WriteLine("This is my file");
            writer.Close();

            // Set up a sub dir name
            directory = DirFuncs.IncludeTrailingBackslash(directory) + "MySubDir";
            // Create it
            if (DirFuncs.MakeDirectory(directory))
            {
                // Move MyFile.txt into the new sub dir
                if (FileFuncs.Move(filename, directory))
                    Console.WriteLine("MyFile.txt moved to new sub directory");
                else
                    Console.WriteLine("Failed to move MyFile.txt to new sub directory");
            }
            else
                Console.WriteLine("Failed to create new sub directory");
        }
        else
            Console.WriteLine("Failed to create new directory \"" + directory + "\"");

        // List all NTFS disk drives
        foreach (System.IO.DriveInfo info in DriveFuncs.GetDrives(DriveFileSystemType.NTFS))
            Console.WriteLine("Found NTFS drive: " + info.Name);

        Console.ReadKey();
    }
Move(String, String)
Moves the source directory to the target directory.
Move(String, String, Boolean)
Moves the source directory to the target directory with an option to recurse.
Top
See Also

Reference

DirFuncs Class
Bncs.SysUtils Namespace


DirFuncs.Copy Method

DirFuncsCopy Method
Overload List
Name | Description
Copy(String, String) | Copies the source directory to the target directory.
Copy(String, String, Boolean) | Copies the source directory to the target directory with an option to recurse sub directories.
Top
See Also

Reference

DirFuncs Class
Bncs.SysUtils Namespace


DirFuncs.Copy Method (String, String)

DirFuncsCopy Method (String, String)
Copies the source directory to the target directory.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Copy(
    string sourceDirectory_,
    string targetDirectory_
)

Parameters

sourceDirectory_
Type: SystemString
Directory to copy.
targetDirectory_
Type: SystemString
Directory to copy to.

Return Value

Type: Boolean
True on success
See Also

Reference

DirFuncs Class
Copy Overload
Bncs.SysUtils Namespace


DirFuncs.Copy Method (String, String, Boolean)

DirFuncsCopy Method (String, String, Boolean)
Copies the source directory to the target directory with an option to recurse sub directories.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Copy(
    string sourceDirectory_,
    string targetDirectory_,
    bool recursive_
)

Parameters

sourceDirectory_
Type: SystemString
Directory to copy.
targetDirectory_
Type: SystemString
Directory to copy to.
recursive_
Type: SystemBoolean
Sub directory recursion flag.

Return Value

Type: Boolean
True on success
See Also

Reference

DirFuncs Class
Copy Overload
Bncs.SysUtils Namespace


DirFuncs.Delete Method

DirFuncsDelete Method
Overload List
Name | Description
Delete(String) | Deletes a single empty directory without throwing an exception
Delete(String, Boolean) | Deletes a directory if no files exist. If recursive_ is true then all sub-directories are deleted too providing they are empty
Delete(String, String) | Deletes a single empty directory without throwing an exception
Delete(String, Boolean, Boolean) | Deletes a directory. If recursive_ is true then all sub-directories are deleted too. WARNING: If failIfFilesExist_ is false then all files in the directory and, if recursive_ is true, it's sub-directories are deleted too.
Delete(String, Boolean, String) | Deletes a directory if no files exist. If recursive_ is true then all sub-directories are deleted too providing they are empty
Delete(String, Boolean, Boolean, String) | Deletes a directory. If recursive_ is true then all sub-directories are deleted too. WARNING: If failIfFilesExist_ is false then all files in the directory and, if recursive_ is true, it's sub-directories are deleted too.
Top
See Also

Reference

DirFuncs Class
Bncs.SysUtils Namespace


DirFuncs.Delete Method (String)

DirFuncsDelete Method (String)
Deletes a single empty directory without throwing an exception

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Delete(
    string directoryname_
)

Parameters

directoryname_
Type: SystemString
Directory to delete

Return Value

Type: Boolean
True on success
See Also

Reference

DirFuncs Class
Delete Overload
Bncs.SysUtils Namespace


DirFuncs.Delete Method (String, Boolean)

DirFuncsDelete Method (String, Boolean)
Deletes a directory if no files exist. If recursive_ is true then all sub-directories are deleted too providing they are empty

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Delete(
    string directoryname_,
    bool recursive_
)

Parameters

directoryname_
Type: SystemString
Top level directory to delete
recursive_
Type: SystemBoolean
If true then this action recurses sub-directories

Return Value

Type: Boolean
True on success
See Also

Reference

DirFuncs Class
Delete Overload
Bncs.SysUtils Namespace


DirFuncs.Delete Method (String, String)

DirFuncsDelete Method (String, String)
Deletes a single empty directory without throwing an exception

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Delete(
    string directoryname_,
    out string errorMessage_
)

Parameters

directoryname_
Type: SystemString
Directory to delete
errorMessage_
Type: SystemString
A string which is populated with empty unless an error occurs, then it is populated with an error message.

Return Value

Type: Boolean
True on success
See Also

Reference

DirFuncs Class
Delete Overload
Bncs.SysUtils Namespace


DirFuncs.Delete Method (String, Boolean, Boolean)

DirFuncsDelete Method (String, Boolean, Boolean)
Deletes a directory. If recursive_ is true then all sub-directories are deleted too. WARNING: If failIfFilesExist_ is false then all files in the directory and, if recursive_ is true, it's sub-directories are deleted too.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Delete(
    string directoryname_,
    bool recursive_,
    bool failIfFilesExist_
)

Parameters

directoryname_
Type: SystemString
Top level directory to delete
recursive_
Type: SystemBoolean
If true then this action recurses sub-directories
failIfFilesExist_
Type: SystemBoolean
If false then all files are deleted

Return Value

Type: Boolean
True on success
See Also

Reference

DirFuncs Class
Delete Overload
Bncs.SysUtils Namespace


DirFuncs.Delete Method (String, Boolean, String)

DirFuncsDelete Method (String, Boolean, String)
Deletes a directory if no files exist. If recursive_ is true then all sub-directories are deleted too providing they are empty

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Delete(
    string directoryname_,
    bool recursive_,
    out string errorMessage_
)

Parameters

directoryname_
Type: SystemString
Top level directory to delete
recursive_
Type: SystemBoolean
If true then this action recurses sub-directories
errorMessage_
Type: SystemString
A string which is populated with empty unless an error occurs, then it is populated with an error message.

Return Value

Type: Boolean
True on success
See Also

Reference

DirFuncs Class
Delete Overload
Bncs.SysUtils Namespace


DirFuncs.Delete Method (String, Boolean, Boolean, String)

DirFuncsDelete Method (String, Boolean, Boolean, String)
Deletes a directory. If recursive_ is true then all sub-directories are deleted too. WARNING: If failIfFilesExist_ is false then all files in the directory and, if recursive_ is true, it's sub-directories are deleted too.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Delete(
    string directoryname_,
    bool recursive_,
    bool failIfFilesExist_,
    out string errorMessage_
)

Parameters

directoryname_
Type: SystemString
Top level directory to delete
recursive_
Type: SystemBoolean
If true then this action recurses sub-directories
failIfFilesExist_
Type: SystemBoolean
If false then all files are deleted
errorMessage_
Type: SystemString
A string which is populated with empty unless an error occurs, then it is populated with an error message.

Return Value

Type: Boolean
True on success
See Also

Reference

DirFuncs Class
Delete Overload
Bncs.SysUtils Namespace


DirFuncs.ExcludeTrailingBackslash Method

DirFuncsExcludeTrailingBackslash Method
Ensures the path includes a trailing backslash

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string ExcludeTrailingBackslash(
    string path_
)

Parameters

path_
Type: SystemString
The path to ensure ends with a slash

Return Value

Type: String
The supplied path with trailing backslash.
See Also

Reference

DirFuncs Class
Bncs.SysUtils Namespace


DirFuncs.Exists Method

DirFuncsExists Method
Tests if the supplied directory path exists. This is included for completeness in case System.IO is not used (and doesn't need to be) but Bncs.SysUtils is.
Examples
This code demonstrates some uses of FileFuncs, FileInfoEx, DirFuncs and DirectoryInfoEx.
Copy
class Program
{
    static void Main()
    {
        // Set a new dir name
        string directory = "c:\\This is my directory";
        // If it doesn't exist then create it
        bool exists = DirFuncs.Exists(directory);
        if (!exists)
            exists = DirFuncs.MakeDirectory(directory);

        if (exists)
        {
            // Print out the long and short dir names
            DirectoryInfoEx dirInfo = new DirectoryInfoEx(directory);
            Console.WriteLine("Long Name: " + dirInfo.LongDirectoryName);
            Console.WriteLine("8.3 Name: " + dirInfo.ShortDirectoryName);

            // Create a unique file name, each time you run this code a new file will be created
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "Unique.txt";
            if (FileFuncs.Exists(filename))
                filename = FileFuncs.GenerateUniqueFilename(filename, string.Empty, '_');
            Console.WriteLine("Creating new empty file \"" + filename + "\" ...");
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename);
            writer.Close();

            // Print out the new files Archive attribute
            FileInfoEx fileInfo = new FileInfoEx(filename);
            Console.WriteLine("Archive attribute of \"" + filename + "\" is " + (fileInfo.Archive ? "SET" : " NOT set"));
            Console.WriteLine("Press a key to toggle this attribute");
            Console.ReadKey();
            // Toggle the new files Archive attribute
            fileInfo.Archive = !fileInfo.Archive;
            Console.WriteLine("Archive attribute of \"" + filename + "\" is NOW " + (fileInfo.Archive ? "SET" : " NOT set"));
        }
        else
            Console.WriteLine(directory + " not found and could not be created!");

        Console.ReadKey();
    }

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Exists(
    string directoryName_
)

Parameters

directoryName_
Type: SystemString
Directory name to test

Return Value

Type: Boolean
True if the file exists
See Also

Reference

DirFuncs Class
Bncs.SysUtils Namespace


DirFuncs.FindFile Method

DirFuncsFindFile Method
Overload List
Name | Description
FindFile(String) | Searches for the first instance of the provided file name from every disks route directory on the computer
FindFile(String, FindFileLocation) | Searches for the first instance of the provided file name recursively
FindFile(String, String) | Searches for the first instance of the provided file name recursively from the root directory provided
Top
See Also

Reference

DirFuncs Class
Bncs.SysUtils Namespace


DirFuncs.FindFile Method (String)

DirFuncsFindFile Method (String)
Searches for the first instance of the provided file name from every disks route directory on the computer

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string FindFile(
    string fileName_
)

Parameters

fileName_
Type: SystemString
Name of file to find, this must be a valid file name and not a path but may include the star mask charachter

Return Value

Type: String
A fully qualified path name that includes the file name sought or null if the file name is invalid
See Also

Reference

DirFuncs Class
FindFile Overload
Bncs.SysUtils Namespace


DirFuncs.FindFile Method (String, FindFileLocation)

DirFuncsFindFile Method (String, FindFileLocation)
Searches for the first instance of the provided file name recursively

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string FindFile(
    string fileName_,
    FindFileLocation location_
)

Parameters

fileName_
Type: SystemString
Name of file to find, this must be a valid file name and not a path but may include the star mask charachter
location_
Type: Bncs.SysUtilsFindFileLocation
Location enumerator to indicate where the search is conducted, i.e. drive on which OS is installed, system Path variable directories or all drives on entire computer

Return Value

Type: String
A fully qualified path name that includes the file name sought or null if the file name is invalid
See Also

Reference

DirFuncs Class
FindFile Overload
Bncs.SysUtils Namespace


DirFuncs.FindFile Method (String, String)

DirFuncsFindFile Method (String, String)
Searches for the first instance of the provided file name recursively from the root directory provided

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string FindFile(
    string filename_,
    string rootDirectory_
)

Parameters

filename_
Type: SystemString
Name of file to find, this must be a valid file name and not a path but may include the star mask charachter
rootDirectory_
Type: SystemString
Root directory to start the search

Return Value

Type: String
A fully qualified path name that includes the file name sought or null if the file name is invalid
See Also

Reference

DirFuncs Class
FindFile Overload
Bncs.SysUtils Namespace


DirFuncs.FindFiles Method

DirFuncsFindFiles Method
Overload List
Name | Description
FindFiles(String) | Searches for the provided file name recursively from every disks route directory on the computer
FindFiles(String, FindFileLocation) | Searches for the provided file name according to location, includes option to return just the first directory found to include the file
FindFiles(String, FindFileLocation, Boolean) | Searches for the provided file name according to location, includes option to return just the first directory found to include the file
FindFiles(String, String, Boolean) | Searches for the provided file name recursively from the root directory provided
Top
See Also

Reference

DirFuncs Class
Bncs.SysUtils Namespace


DirFuncs.FindFiles Method (String)

DirFuncsFindFiles Method (String)
Searches for the provided file name recursively from every disks route directory on the computer

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static List<string> FindFiles(
    string fileName_
)

Parameters

fileName_
Type: SystemString
Name of file to find, this must be a valid file name and not a path but may include the star mask charachter

Return Value

Type: List String
A list of fully qualified path names that include the file name sought or null if the file name is invalid
See Also

Reference

DirFuncs Class
FindFiles Overload
Bncs.SysUtils Namespace


DirFuncs.FindFiles Method (String, FindFileLocation)

DirFuncsFindFiles Method (String, FindFileLocation)
Searches for the provided file name according to location, includes option to return just the first directory found to include the file

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static List<string> FindFiles(
    string fileName_,
    FindFileLocation location_
)

Parameters

fileName_
Type: SystemString
Name of file to find, this must be a valid file name and not a path but may include the star mask charachter
location_
Type: Bncs.SysUtilsFindFileLocation
Location enumerator to indicate where the search is conducted, i.e. drive on which OS is installed, system Path variable directories or all drives on entire computer

Return Value

Type: List String
A list of fully qualified path names that include the file name sought or null if the file name is invalid
See Also

Reference

DirFuncs Class
FindFiles Overload
Bncs.SysUtils Namespace


DirFuncs.FindFiles Method (String, FindFileLocation, Boolean)

DirFuncsFindFiles Method (String, FindFileLocation, Boolean)
Searches for the provided file name according to location, includes option to return just the first directory found to include the file

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static List<string> FindFiles(
    string fileName_,
    FindFileLocation location_,
    bool findFirst_
)

Parameters

fileName_
Type: SystemString
Name of file to find, this must be a valid file name and not a path but may include the star mask charachter
location_
Type: Bncs.SysUtilsFindFileLocation
Location enumerator to indicate where the search is conducted, i.e. drive on which OS is installed, system Path variable directories or all drives on entire computer
findFirst_
Type: SystemBoolean
If true then only the first file matching the name found is returned, else multiple files might be returned

Return Value

Type: List String
A list of fully qualified path names that include the file name sought or null if the file name is invalid
See Also

Reference

DirFuncs Class
FindFiles Overload
Bncs.SysUtils Namespace


DirFuncs.FindFiles Method (String, String, Boolean)

DirFuncsFindFiles Method (String, String, Boolean)
Searches for the provided file name recursively from the root directory provided

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static List<string> FindFiles(
    string filename_,
    string rootDirectory_,
    bool findFirst_
)

Parameters

filename_
Type: SystemString
Name of file to find, this must be a valid file name and not a path but may include the star mask charachter
rootDirectory_
Type: SystemString
Root directory to start the search
findFirst_
Type: SystemBoolean
If true then only the first file matching the name found is returned, else multiple files might be returned

Return Value

Type: List String
A list of fully qualified path names that include the file name sought or null if the file name is invalid
See Also

Reference

DirFuncs Class
FindFiles Overload
Bncs.SysUtils Namespace


DirFuncs.GetPathLocale Method

DirFuncsGetPathLocale Method
Attempts to ascertain if the supplied path resides on the local machine or a remote one

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static PathLocale GetPathLocale(
    string path_
)

Parameters

path_
Type: SystemString
Path to query

Return Value

Type: PathLocale
A PathLocale enumeration: Unknown if not known, NotADirectory if the supplied string is a file, Local if the path or share is on the local machine, Remote if the path is a share on a remote machine.
See Also

Reference

DirFuncs Class
Bncs.SysUtils Namespace


DirFuncs.IncludeTrailingBackslash Method

DirFuncsIncludeTrailingBackslash Method
Ensures the path excludes a trailing backslash
Examples
This code demonstrates some uses of FileFuncs, DirFuncs and DriveFuncs.
Copy
class Program
{
    static void Main()
    {
        // Set up a new dir name
        string directory = "c:\\MyNewDir";
        // Create it
        if (DirFuncs.MakeDirectory(directory))
        {
            // Write a new text file to it (append if it exists)
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "MyFile.txt";
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename, true);
            writer.WriteLine("This is my file");
            writer.Close();

            // Set up a sub dir name
            directory = DirFuncs.IncludeTrailingBackslash(directory) + "MySubDir";
            // Create it
            if (DirFuncs.MakeDirectory(directory))
            {
                // Move MyFile.txt into the new sub dir
                if (FileFuncs.Move(filename, directory))
                    Console.WriteLine("MyFile.txt moved to new sub directory");
                else
                    Console.WriteLine("Failed to move MyFile.txt to new sub directory");
            }
            else
                Console.WriteLine("Failed to create new sub directory");
        }
        else
            Console.WriteLine("Failed to create new directory \"" + directory + "\"");

        // List all NTFS disk drives
        foreach (System.IO.DriveInfo info in DriveFuncs.GetDrives(DriveFileSystemType.NTFS))
            Console.WriteLine("Found NTFS drive: " + info.Name);

        Console.ReadKey();
    }

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string IncludeTrailingBackslash(
    string path_
)

Parameters

path_
Type: SystemString
The path to ensure does not end in a slash

Return Value

Type: String
The supplied path without trailing backslash.
See Also

Reference

DirFuncs Class
Bncs.SysUtils Namespace


DirFuncs.IsRemote Method

DirFuncsIsRemote Method
Enquires if the supplied path is known to be on a remote machine

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool IsRemote(
    string path_
)

Parameters

path_
Type: SystemString
Path to query

Return Value

Type: Boolean
True if the path is known for sure to be on a remote computer
See Also

Reference

DirFuncs Class
Bncs.SysUtils Namespace


DirFuncs.IsValidDirectoryName Method

DirFuncsIsValidDirectoryName Method
Checks for illegal characters (/ \ : * ? " > < |) in a directory name (directory name only, not a path)

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool IsValidDirectoryName(
    string directoryName_
)

Parameters

directoryName_
Type: SystemString
Directory name to test

Return Value

Type: Boolean
True if the name is valid
See Also

Reference

DirFuncs Class
Bncs.SysUtils Namespace


DirFuncs.IsValidDirectoryPath Method

DirFuncsIsValidDirectoryPath Method

[Missing <summary> documentation for "M:Bncs.SysUtils.DirFuncs.IsValidDirectoryPath(System.String)"]

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool IsValidDirectoryPath(
    string filepath_
)

Parameters

filepath_
Type: SystemString

[Missing <param name="filepath_"/> documentation for "M:Bncs.SysUtils.DirFuncs.IsValidDirectoryPath(System.String)"]

Return Value

Type: Boolean

[Missing <returns> documentation for "M:Bncs.SysUtils.DirFuncs.IsValidDirectoryPath(System.String)"]

See Also

Reference

DirFuncs Class
Bncs.SysUtils Namespace


DirFuncs.IsValidDirectoryPathWithToken Method

DirFuncsIsValidDirectoryPathWithToken Method

[Missing <summary> documentation for "M:Bncs.SysUtils.DirFuncs.IsValidDirectoryPathWithToken(System.String)"]

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool IsValidDirectoryPathWithToken(
    string directoryPath_
)

Parameters

directoryPath_
Type: SystemString

[Missing <param name="directoryPath_"/> documentation for "M:Bncs.SysUtils.DirFuncs.IsValidDirectoryPathWithToken(System.String)"]

Return Value

Type: Boolean

[Missing <returns> documentation for "M:Bncs.SysUtils.DirFuncs.IsValidDirectoryPathWithToken(System.String)"]

See Also

Reference

DirFuncs Class
Bncs.SysUtils Namespace


DirFuncs.MakeDirectory Method

DirFuncsMakeDirectory Method
Attempts to create the specified directory.
Examples
This code demonstrates some uses of FileFuncs, DirFuncs and DriveFuncs.
Copy
class Program
{
    static void Main()
    {
        // Set up a new dir name
        string directory = "c:\\MyNewDir";
        // Create it
        if (DirFuncs.MakeDirectory(directory))
        {
            // Write a new text file to it (append if it exists)
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "MyFile.txt";
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename, true);
            writer.WriteLine("This is my file");
            writer.Close();

            // Set up a sub dir name
            directory = DirFuncs.IncludeTrailingBackslash(directory) + "MySubDir";
            // Create it
            if (DirFuncs.MakeDirectory(directory))
            {
                // Move MyFile.txt into the new sub dir
                if (FileFuncs.Move(filename, directory))
                    Console.WriteLine("MyFile.txt moved to new sub directory");
                else
                    Console.WriteLine("Failed to move MyFile.txt to new sub directory");
            }
            else
                Console.WriteLine("Failed to create new sub directory");
        }
        else
            Console.WriteLine("Failed to create new directory \"" + directory + "\"");

        // List all NTFS disk drives
        foreach (System.IO.DriveInfo info in DriveFuncs.GetDrives(DriveFileSystemType.NTFS))
            Console.WriteLine("Found NTFS drive: " + info.Name);

        Console.ReadKey();
    }

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool MakeDirectory(
    string directory_
)

Parameters

directory_
Type: SystemString
Directory to create.

Return Value

Type: Boolean
True if the directory already already existed or was created.
See Also

Reference

DirFuncs Class
Bncs.SysUtils Namespace


DirFuncs.Move Method

DirFuncsMove Method
Overload List
Name | Description
Move(String, String) | Moves the source directory to the target directory.
Move(String, String, Boolean) | Moves the source directory to the target directory with an option to recurse.
Top
See Also

Reference

DirFuncs Class
Bncs.SysUtils Namespace


DirFuncs.Move Method (String, String)

DirFuncsMove Method (String, String)
Moves the source directory to the target directory.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Move(
    string sourceDirectory_,
    string targetDirectory_
)

Parameters

sourceDirectory_
Type: SystemString
Source dir
targetDirectory_
Type: SystemString
Target dir

Return Value

Type: Boolean
True on success
See Also

Reference

DirFuncs Class
Move Overload
Bncs.SysUtils Namespace


DirFuncs.Move Method (String, String, Boolean)

DirFuncsMove Method (String, String, Boolean)
Moves the source directory to the target directory with an option to recurse.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Move(
    string sourceDirectory_,
    string targetDirectory_,
    bool recursive_
)

Parameters

sourceDirectory_
Type: SystemString
Source dir
targetDirectory_
Type: SystemString
Target dir
recursive_
Type: SystemBoolean
Sub directory recursive flag.

Return Value

Type: Boolean
True on success
See Also

Reference

DirFuncs Class
Move Overload
Bncs.SysUtils Namespace


DriveFileSystemType Enumeration

DriveFileSystemType Enumeration
Enumeration denoting disk drive file system types.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum DriveFileSystemType
Members
Member name | Value | Description
FAT | 0 | Drive is formatted with the File Allocation Table format.
FAT32 | 1 | Drive is formatted with the 32 bit File Allocation Table format.
NTFS | 2 | Drive is formatted with the New Technology File System format.
Other | 3 | Drive format is unknown.
See Also

Reference

Bncs.SysUtils Namespace


DriveFuncs Class

DriveFuncs Class
Various disk drive orientated functions.
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsDriveFuncs

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static class DriveFuncs

The DriveFuncs type exposes the following members.

Methods
Name Description
Exists
Checks if the supplied drive letter is a valid disk drive.
GetDrives
Lists all drives
GetDrives(DriveFileSystemType)
Lists all drives that conform to the specified type.
Examples
This code demonstrates some uses of FileFuncs, DirFuncs and DriveFuncs.
Copy
class Program
{
    static void Main()
    {
        // Set up a new dir name
        string directory = "c:\\MyNewDir";
        // Create it
        if (DirFuncs.MakeDirectory(directory))
        {
            // Write a new text file to it (append if it exists)
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "MyFile.txt";
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename, true);
            writer.WriteLine("This is my file");
            writer.Close();

            // Set up a sub dir name
            directory = DirFuncs.IncludeTrailingBackslash(directory) + "MySubDir";
            // Create it
            if (DirFuncs.MakeDirectory(directory))
            {
                // Move MyFile.txt into the new sub dir
                if (FileFuncs.Move(filename, directory))
                    Console.WriteLine("MyFile.txt moved to new sub directory");
                else
                    Console.WriteLine("Failed to move MyFile.txt to new sub directory");
            }
            else
                Console.WriteLine("Failed to create new sub directory");
        }
        else
            Console.WriteLine("Failed to create new directory \"" + directory + "\"");

        // List all NTFS disk drives
        foreach (System.IO.DriveInfo info in DriveFuncs.GetDrives(DriveFileSystemType.NTFS))
            Console.WriteLine("Found NTFS drive: " + info.Name);

        Console.ReadKey();
    }
Top
See Also

Reference

Bncs.SysUtils Namespace


DriveFuncs Methods

DriveFuncs Methods

The DriveFuncs type exposes the following members.

Methods
Name Description
Exists
Checks if the supplied drive letter is a valid disk drive.
GetDrives
Lists all drives
GetDrives(DriveFileSystemType)
Lists all drives that conform to the specified type.
Examples
This code demonstrates some uses of FileFuncs, DirFuncs and DriveFuncs.
Copy
class Program
{
    static void Main()
    {
        // Set up a new dir name
        string directory = "c:\\MyNewDir";
        // Create it
        if (DirFuncs.MakeDirectory(directory))
        {
            // Write a new text file to it (append if it exists)
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "MyFile.txt";
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename, true);
            writer.WriteLine("This is my file");
            writer.Close();

            // Set up a sub dir name
            directory = DirFuncs.IncludeTrailingBackslash(directory) + "MySubDir";
            // Create it
            if (DirFuncs.MakeDirectory(directory))
            {
                // Move MyFile.txt into the new sub dir
                if (FileFuncs.Move(filename, directory))
                    Console.WriteLine("MyFile.txt moved to new sub directory");
                else
                    Console.WriteLine("Failed to move MyFile.txt to new sub directory");
            }
            else
                Console.WriteLine("Failed to create new sub directory");
        }
        else
            Console.WriteLine("Failed to create new directory \"" + directory + "\"");

        // List all NTFS disk drives
        foreach (System.IO.DriveInfo info in DriveFuncs.GetDrives(DriveFileSystemType.NTFS))
            Console.WriteLine("Found NTFS drive: " + info.Name);

        Console.ReadKey();
    }
Top
See Also

Reference

DriveFuncs Class
Bncs.SysUtils Namespace


DriveFuncs.Exists Method

DriveFuncsExists Method
Checks if the supplied drive letter is a valid disk drive.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Exists(
    char driveLetter_
)

Parameters

driveLetter_
Type: SystemChar
Drive letter to test.

Return Value

Type: Boolean
True if the drive exists.
See Also

Reference

DriveFuncs Class
Bncs.SysUtils Namespace


DriveFuncs.GetDrives Method

DriveFuncsGetDrives Method
Overload List
Name Description
GetDrives
Lists all drives
GetDrives(DriveFileSystemType)
Lists all drives that conform to the specified type.
Examples
This code demonstrates some uses of FileFuncs, DirFuncs and DriveFuncs.
Copy
class Program
{
    static void Main()
    {
        // Set up a new dir name
        string directory = "c:\\MyNewDir";
        // Create it
        if (DirFuncs.MakeDirectory(directory))
        {
            // Write a new text file to it (append if it exists)
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "MyFile.txt";
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename, true);
            writer.WriteLine("This is my file");
            writer.Close();

            // Set up a sub dir name
            directory = DirFuncs.IncludeTrailingBackslash(directory) + "MySubDir";
            // Create it
            if (DirFuncs.MakeDirectory(directory))
            {
                // Move MyFile.txt into the new sub dir
                if (FileFuncs.Move(filename, directory))
                    Console.WriteLine("MyFile.txt moved to new sub directory");
                else
                    Console.WriteLine("Failed to move MyFile.txt to new sub directory");
            }
            else
                Console.WriteLine("Failed to create new sub directory");
        }
        else
            Console.WriteLine("Failed to create new directory \"" + directory + "\"");

        // List all NTFS disk drives
        foreach (System.IO.DriveInfo info in DriveFuncs.GetDrives(DriveFileSystemType.NTFS))
            Console.WriteLine("Found NTFS drive: " + info.Name);

        Console.ReadKey();
    }
Top
See Also

Reference

DriveFuncs Class
Bncs.SysUtils Namespace


DriveFuncs.GetDrives Method

DriveFuncsGetDrives Method
Lists all drives

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static List<DriveInfo> GetDrives()

Return Value

Type: List DriveInfo
A list of DriveInfo
See Also

Reference

DriveFuncs Class
GetDrives Overload
Bncs.SysUtils Namespace


DriveFuncs.GetDrives Method (DriveFileSystemType)

DriveFuncsGetDrives Method (DriveFileSystemType)
Lists all drives that conform to the specified type.
Examples
This code demonstrates some uses of FileFuncs, DirFuncs and DriveFuncs.
Copy
class Program
{
    static void Main()
    {
        // Set up a new dir name
        string directory = "c:\\MyNewDir";
        // Create it
        if (DirFuncs.MakeDirectory(directory))
        {
            // Write a new text file to it (append if it exists)
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "MyFile.txt";
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename, true);
            writer.WriteLine("This is my file");
            writer.Close();

            // Set up a sub dir name
            directory = DirFuncs.IncludeTrailingBackslash(directory) + "MySubDir";
            // Create it
            if (DirFuncs.MakeDirectory(directory))
            {
                // Move MyFile.txt into the new sub dir
                if (FileFuncs.Move(filename, directory))
                    Console.WriteLine("MyFile.txt moved to new sub directory");
                else
                    Console.WriteLine("Failed to move MyFile.txt to new sub directory");
            }
            else
                Console.WriteLine("Failed to create new sub directory");
        }
        else
            Console.WriteLine("Failed to create new directory \"" + directory + "\"");

        // List all NTFS disk drives
        foreach (System.IO.DriveInfo info in DriveFuncs.GetDrives(DriveFileSystemType.NTFS))
            Console.WriteLine("Found NTFS drive: " + info.Name);

        Console.ReadKey();
    }

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static List<DriveInfo> GetDrives(
    DriveFileSystemType type_
)

Parameters

type_
Type: Bncs.SysUtilsDriveFileSystemType
Drive type to list.

Return Value

Type: List DriveInfo
A list of DriveInfo
See Also

Reference

DriveFuncs Class
GetDrives Overload
Bncs.SysUtils Namespace


DriveInfoEx Class

DriveInfoEx Class
Gets disk drive information extra to that returned by DriveInfo instances
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsDriveInfoEx

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class DriveInfoEx

The DriveInfoEx type exposes the following members.

Constructors
 | Name | Description
Public method | DriveInfoEx(Char) | Constructor that initialises from a single drive letter
Public method | DriveInfoEx(DriveInfo) | Constructor that initialises from a DriveInfo object
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns the instance as a string (Overrides ObjectToString.)
Top
Properties
 | Name | Description
Public property | Exists | Gets a flag betraying if the drive exists
Public property | FileSystemFlags | Gets the file system flags
Public property | FileSystemFlagsAsHex | Gets the file system flags as a hexadecimal string
Public property | FileSystemName | Gets the file system name
Public property | Information | Gets the DriveInfo object for this drive, this is null if an invalid drive letter is input
Public property | MaxComponentLength | Gets the maximum component length
Public property | SerialNumber | Gets the volume serial number
Public property | VolumeName | Gets the volume name
Top
See Also

Reference

Bncs.SysUtils Namespace


DriveInfoEx Constructor

DriveInfoEx Constructor
Overload List
 | Name | Description
Public method | DriveInfoEx(Char) | Constructor that initialises from a single drive letter
Public method | DriveInfoEx(DriveInfo) | Constructor that initialises from a DriveInfo object
Top
See Also

Reference

DriveInfoEx Class
Bncs.SysUtils Namespace


DriveInfoEx Constructor (Char)

DriveInfoEx Constructor (Char)
Constructor that initialises from a single drive letter

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public DriveInfoEx(
    char driveLetter_
)

Parameters

driveLetter_
Type: SystemChar
Drive letter of the drive
See Also

Reference

DriveInfoEx Class
DriveInfoEx Overload
Bncs.SysUtils Namespace


DriveInfoEx Constructor (DriveInfo)

DriveInfoEx Constructor (DriveInfo)
Constructor that initialises from a DriveInfo object

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public DriveInfoEx(
    DriveInfo info_
)

Parameters

info_
Type: System.IODriveInfo
DriveInfo object from which to initialise
See Also

Reference

DriveInfoEx Class
DriveInfoEx Overload
Bncs.SysUtils Namespace


DriveInfoEx Methods

DriveInfoEx Methods

The DriveInfoEx type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns the instance as a string (Overrides ObjectToString.)
Top
See Also

Reference

DriveInfoEx Class
Bncs.SysUtils Namespace


DriveInfoEx.ToString Method

DriveInfoExToString Method
Returns the instance as a string

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
If valid the root directory is returned else Invalid Drive
See Also

Reference

DriveInfoEx Class
Bncs.SysUtils Namespace


DriveInfoEx Properties

DriveInfoEx Properties

The DriveInfoEx type exposes the following members.

Properties
 | Name | Description
Public property | Exists | Gets a flag betraying if the drive exists
Public property | FileSystemFlags | Gets the file system flags
Public property | FileSystemFlagsAsHex | Gets the file system flags as a hexadecimal string
Public property | FileSystemName | Gets the file system name
Public property | Information | Gets the DriveInfo object for this drive, this is null if an invalid drive letter is input
Public property | MaxComponentLength | Gets the maximum component length
Public property | SerialNumber | Gets the volume serial number
Public property | VolumeName | Gets the volume name
Top
See Also

Reference

DriveInfoEx Class
Bncs.SysUtils Namespace


DriveInfoEx.Exists Property

DriveInfoExExists Property
Gets a flag betraying if the drive exists

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Exists { get; }

Property Value

Type: Boolean
See Also

Reference

DriveInfoEx Class
Bncs.SysUtils Namespace


DriveInfoEx.FileSystemFlags Property

DriveInfoExFileSystemFlags Property
Gets the file system flags

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint FileSystemFlags { get; }

Property Value

Type: UInt32
See Also

Reference

DriveInfoEx Class
Bncs.SysUtils Namespace


DriveInfoEx.FileSystemFlagsAsHex Property

DriveInfoExFileSystemFlagsAsHex Property
Gets the file system flags as a hexadecimal string

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string FileSystemFlagsAsHex { get; }

Property Value

Type: String
See Also

Reference

DriveInfoEx Class
Bncs.SysUtils Namespace


DriveInfoEx.FileSystemName Property

DriveInfoExFileSystemName Property
Gets the file system name

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string FileSystemName { get; }

Property Value

Type: String
See Also

Reference

DriveInfoEx Class
Bncs.SysUtils Namespace


DriveInfoEx.Information Property

DriveInfoExInformation Property
Gets the DriveInfo object for this drive, this is null if an invalid drive letter is input

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public DriveInfo Information { get; }

Property Value

Type: DriveInfo
See Also

Reference

DriveInfoEx Class
Bncs.SysUtils Namespace


DriveInfoEx.MaxComponentLength Property

DriveInfoExMaxComponentLength Property
Gets the maximum component length

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint MaxComponentLength { get; }

Property Value

Type: UInt32
See Also

Reference

DriveInfoEx Class
Bncs.SysUtils Namespace


DriveInfoEx.SerialNumber Property

DriveInfoExSerialNumber Property
Gets the volume serial number

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint SerialNumber { get; }

Property Value

Type: UInt32
See Also

Reference

DriveInfoEx Class
Bncs.SysUtils Namespace


DriveInfoEx.VolumeName Property

DriveInfoExVolumeName Property
Gets the volume name

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string VolumeName { get; }

Property Value

Type: String
See Also

Reference

DriveInfoEx Class
Bncs.SysUtils Namespace


EnumFuncs Class

EnumFuncs Class
A static class of enumeration related functions.
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsEnumFuncs

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static class EnumFuncs

The EnumFuncs type exposes the following members.

Methods
Name | Description
GetEnumDescription | Gets the enum description.
Top
See Also

Reference

Bncs.SysUtils Namespace


EnumFuncs Methods

EnumFuncs Methods

The EnumFuncs type exposes the following members.

Methods
Name | Description
GetEnumDescription | Gets the enum description.
Top
See Also

Reference

EnumFuncs Class
Bncs.SysUtils Namespace


EnumFuncs.GetEnumDescription Method

EnumFuncsGetEnumDescription Method
Gets the enum description.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string GetEnumDescription(
    Enum value_
)

Parameters

value_
Type: SystemEnum
Enum type to return a description for.

Return Value

Type: String
The description from the supplied enums description attribute or the enum as a string if no descriptor exists.
See Also

Reference

EnumFuncs Class
Bncs.SysUtils Namespace


EpochTime Class

EpochTime Class
Class that calculates universal epoch time from the date, dates or time span supplied
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsEpochTime

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class EpochTime

The EpochTime type exposes the following members.

Constructors
 | Name | Description
Public method | EpochTime | Default constructor creates a start value of now and an end value 1 year in the future
Public method | EpochTime(DateTime) | Constructor creating a start time only
Public method | EpochTime(TimeSpan) | Constructor creating Start and End from now to now plus the supplied time span
Public method | EpochTime(EpochTimeEndType) | Constructor creating a start value of now and an end value according to the supplied end type
Public method | EpochTime(DateTime, DateTime) | Constructor creating a start and end time
Public method | EpochTime(TimeSpan, Boolean) | Constructor creating Start and End from now to now plus or minus the supplied time apan depending on the isFuture_ flag
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | End | Gets the end time in seconds calculated according to choice of constructor employed. Returns null if end was not generated by the chosen constructor.
Public property | Start | Gets the start time in seconds calculated from Now or a supplied start time
Top
See Also

Reference

Bncs.SysUtils Namespace


EpochTime Constructor

EpochTime Constructor
Overload List
 | Name | Description
Public method | EpochTime | Default constructor creates a start value of now and an end value 1 year in the future
Public method | EpochTime(DateTime) | Constructor creating a start time only
Public method | EpochTime(TimeSpan) | Constructor creating Start and End from now to now plus the supplied time span
Public method | EpochTime(EpochTimeEndType) | Constructor creating a start value of now and an end value according to the supplied end type
Public method | EpochTime(DateTime, DateTime) | Constructor creating a start and end time
Public method | EpochTime(TimeSpan, Boolean) | Constructor creating Start and End from now to now plus or minus the supplied time apan depending on the isFuture_ flag
Top
See Also

Reference

EpochTime Class
Bncs.SysUtils Namespace


EpochTime Constructor

EpochTime Constructor
Default constructor creates a start value of now and an end value 1 year in the future

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public EpochTime()
See Also

Reference

EpochTime Class
EpochTime Overload
Bncs.SysUtils Namespace


EpochTime Constructor (DateTime)

EpochTime Constructor (DateTime)
Constructor creating a start time only

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public EpochTime(
    DateTime startTime_
)

Parameters

startTime_
Type: SystemDateTime
Time to apply epoch to Start for
See Also

Reference

EpochTime Class
EpochTime Overload
Bncs.SysUtils Namespace


EpochTime Constructor (TimeSpan)

EpochTime Constructor (TimeSpan)
Constructor creating Start and End from now to now plus the supplied time span

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public EpochTime(
    TimeSpan timeFromNow_
)

Parameters

timeFromNow_
Type: SystemTimeSpan
Time in the future to end
See Also

Reference

EpochTime Class
EpochTime Overload
Bncs.SysUtils Namespace


EpochTime Constructor (EpochTimeEndType)

EpochTime Constructor (EpochTimeEndType)
Constructor creating a start value of now and an end value according to the supplied end type

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public EpochTime(
    EpochTimeEndType endType_
)

Parameters

endType_
Type: Bncs.SysUtilsEpochTimeEndType
Type of end value to set
See Also

Reference

EpochTime Class
EpochTime Overload
Bncs.SysUtils Namespace


EpochTime Constructor (DateTime, DateTime)

EpochTime Constructor (DateTime, DateTime)
Constructor creating a start and end time

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public EpochTime(
    DateTime startTime_,
    DateTime endTime_
)

Parameters

startTime_
Type: SystemDateTime
Time to apply epoch to Start for
endTime_
Type: SystemDateTime
Time to apply epoch to End
See Also

Reference

EpochTime Class
EpochTime Overload
Bncs.SysUtils Namespace


EpochTime Constructor (TimeSpan, Boolean)

EpochTime Constructor (TimeSpan, Boolean)
Constructor creating Start and End from now to now plus or minus the supplied time apan depending on the isFuture_ flag

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public EpochTime(
    TimeSpan timeFromNow_,
    bool isFuture_
)

Parameters

timeFromNow_
Type: SystemTimeSpan
Time in the future or past to end
isFuture_
Type: SystemBoolean
Is future when set else past
See Also

Reference

EpochTime Class
EpochTime Overload
Bncs.SysUtils Namespace


EpochTime Methods

EpochTime Methods

The EpochTime type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

EpochTime Class
Bncs.SysUtils Namespace


EpochTime Properties

EpochTime Properties

The EpochTime type exposes the following members.

Properties
 | Name | Description
Public property | End | Gets the end time in seconds calculated according to choice of constructor employed. Returns null if end was not generated by the chosen constructor.
Public property | Start | Gets the start time in seconds calculated from Now or a supplied start time
Top
See Also

Reference

EpochTime Class
Bncs.SysUtils Namespace


EpochTime.End Property

EpochTimeEnd Property
Gets the end time in seconds calculated according to choice of constructor employed. Returns null if end was not generated by the chosen constructor.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string End { get; }

Property Value

Type: String
See Also

Reference

EpochTime Class
Bncs.SysUtils Namespace


EpochTime.Start Property

EpochTimeStart Property
Gets the start time in seconds calculated from Now or a supplied start time

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Start { get; }

Property Value

Type: String
See Also

Reference

EpochTime Class
Bncs.SysUtils Namespace


EpochTimeEndType Enumeration

EpochTimeEndType Enumeration
Epoch time end types used by the EpochTime class

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum EpochTimeEndType
Members
Member name | Value | Description
UnixEpochEnd | 0 | Sets end time to Unix epoch end (2147483647)
VideoIPathInfinite | 1 | Sets end time to the VideoIPath preferred value for infinite (8999999999999)
See Also

Reference

Bncs.SysUtils Namespace


EscapeSequenceInterpretationType Enumeration

EscapeSequenceInterpretationType Enumeration
An enumerator denoting the escape sequence interpretation.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum EscapeSequenceInterpretationType
Members
Member name | Value | Description
None | 0 | No escape sequences included.
Cs | 1 | Use C# type escape sequence.
Ascii | 2 | Use ASCII type escape sequence.
See Also

Reference

Bncs.SysUtils Namespace


FileCopyPairing Class

FileCopyPairing Class
A class that keeps a pair of file names
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsFileCopyPairing

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class FileCopyPairing

The FileCopyPairing type exposes the following members.

Constructors
 | Name | Description
Public method | FileCopyPairing | Constructor
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | Reference | Returns the optional reference number, if not set then this defaults to -1
Public property | Source | Returns the source file path
Public property | Target | Returns the target file path
Public property | TargetFileExists | If this flag returns true then the target file already exists.
Public property | UseFragmentedCopy | Returns a flag which, if true, causes the file to be copied in 1024 byte intervals otherwise it is copied in a single blocked call to File.Copy()
Public property | Valid | Returns true if the pairing consists of valid data
Top
See Also

Reference

Bncs.SysUtils Namespace


FileCopyPairing Constructor

FileCopyPairing Constructor
Constructor

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public FileCopyPairing(
    FileCopyParameters parameters_
)

Parameters

parameters_
Type: Bncs.SysUtilsFileCopyParameters
Copy operation parameters
See Also

Reference

FileCopyPairing Class
Bncs.SysUtils Namespace


FileCopyPairing Methods

FileCopyPairing Methods

The FileCopyPairing type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

FileCopyPairing Class
Bncs.SysUtils Namespace


FileCopyPairing Properties

FileCopyPairing Properties

The FileCopyPairing type exposes the following members.

Properties
 | Name | Description
Public property | Reference | Returns the optional reference number, if not set then this defaults to -1
Public property | Source | Returns the source file path
Public property | Target | Returns the target file path
Public property | TargetFileExists | If this flag returns true then the target file already exists.
Public property | UseFragmentedCopy | Returns a flag which, if true, causes the file to be copied in 1024 byte intervals otherwise it is copied in a single blocked call to File.Copy()
Public property | Valid | Returns true if the pairing consists of valid data
Top
See Also

Reference

FileCopyPairing Class
Bncs.SysUtils Namespace


FileCopyPairing.Reference Property

FileCopyPairingReference Property
Returns the optional reference number, if not set then this defaults to -1

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Reference { get; }

Property Value

Type: Int32
See Also

Reference

FileCopyPairing Class
Bncs.SysUtils Namespace


FileCopyPairing.Source Property

FileCopyPairingSource Property
Returns the source file path

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Source { get; }

Property Value

Type: String
See Also

Reference

FileCopyPairing Class
Bncs.SysUtils Namespace


FileCopyPairing.Target Property

FileCopyPairingTarget Property
Returns the target file path

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Target { get; set; }

Property Value

Type: String
See Also

Reference

FileCopyPairing Class
Bncs.SysUtils Namespace


FileCopyPairing.TargetFileExists Property

FileCopyPairingTargetFileExists Property
If this flag returns true then the target file already exists.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool TargetFileExists { get; }

Property Value

Type: Boolean
See Also

Reference

FileCopyPairing Class
Bncs.SysUtils Namespace


FileCopyPairing.UseFragmentedCopy Property

FileCopyPairingUseFragmentedCopy Property
Returns a flag which, if true, causes the file to be copied in 1024 byte intervals otherwise it is copied in a single blocked call to File.Copy()

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool UseFragmentedCopy { get; }

Property Value

Type: Boolean
See Also

Reference

FileCopyPairing Class
Bncs.SysUtils Namespace


FileCopyPairing.Valid Property

FileCopyPairingValid Property
Returns true if the pairing consists of valid data

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Valid { get; }

Property Value

Type: Boolean
See Also

Reference

FileCopyPairing Class
Bncs.SysUtils Namespace


FileCopyParameters Class

FileCopyParameters Class
A class that stores the parameters required for file copying using the FileCopyPairing class.
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsFileCopyParameters

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class FileCopyParameters

The FileCopyParameters type exposes the following members.

Constructors
 | Name | Description
Public method | FileCopyParameters | Initializes a new instance of the FileCopyParameters class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | Reference | Gets/sets the reference.
Public field | Source | Gets/sets the source file name.
Public field | Target | Gets/sets the target file name.
Public field | TargetIsDirectory | Gets/sets the target directory flag.
Public field | UseFragmentedCopy | Gets/sets the use fragmented copy flag.
Public field | UseReference | Gets/sets the use reference.
Top
See Also

Reference

Bncs.SysUtils Namespace


FileCopyParameters Constructor

FileCopyParameters Constructor
Initializes a new instance of the FileCopyParameters class

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public FileCopyParameters()
See Also

Reference

FileCopyParameters Class
Bncs.SysUtils Namespace


FileCopyParameters Fields

FileCopyParameters Fields

The FileCopyParameters type exposes the following members.

Fields
 | Name | Description
Public field | Reference | Gets/sets the reference.
Public field | Source | Gets/sets the source file name.
Public field | Target | Gets/sets the target file name.
Public field | TargetIsDirectory | Gets/sets the target directory flag.
Public field | UseFragmentedCopy | Gets/sets the use fragmented copy flag.
Public field | UseReference | Gets/sets the use reference.
Top
See Also

Reference

FileCopyParameters Class
Bncs.SysUtils Namespace


FileCopyParameters.Reference Field

FileCopyParametersReference Field
Gets/sets the reference.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Reference

Field Value

Type: Int32
See Also

Reference

FileCopyParameters Class
Bncs.SysUtils Namespace


FileCopyParameters.Source Field

FileCopyParametersSource Field
Gets/sets the source file name.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Source

Field Value

Type: String
See Also

Reference

FileCopyParameters Class
Bncs.SysUtils Namespace


FileCopyParameters.Target Field

FileCopyParametersTarget Field
Gets/sets the target file name.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Target

Field Value

Type: String
See Also

Reference

FileCopyParameters Class
Bncs.SysUtils Namespace


FileCopyParameters.TargetIsDirectory Field

FileCopyParametersTargetIsDirectory Field
Gets/sets the target directory flag.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool TargetIsDirectory

Field Value

Type: Boolean
See Also

Reference

FileCopyParameters Class
Bncs.SysUtils Namespace


FileCopyParameters.UseFragmentedCopy Field

FileCopyParametersUseFragmentedCopy Field
Gets/sets the use fragmented copy flag.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool UseFragmentedCopy

Field Value

Type: Boolean
See Also

Reference

FileCopyParameters Class
Bncs.SysUtils Namespace


FileCopyParameters.UseReference Field

FileCopyParametersUseReference Field
Gets/sets the use reference.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool UseReference

Field Value

Type: Boolean
See Also

Reference

FileCopyParameters Class
Bncs.SysUtils Namespace


FileCopyParameters Methods

FileCopyParameters Methods

The FileCopyParameters type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

FileCopyParameters Class
Bncs.SysUtils Namespace


FileExistOption Enumeration

FileExistOption Enumeration
File exists option enumeration for Copy()

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum FileExistOption
Members
Member name | Value | Description
Overwrite | 0 | If the file already exists then overwrite the original.
Fail | 1 | If the file already exists then let the copy operation fail.
RenameTarget | 2 | If the file already exists then rename the original.
RenameSource | 3 | If the file already exists then save the current file to a new file name.
See Also

Reference

Bncs.SysUtils Namespace


FileFuncs Class

FileFuncs Class
Various file orientated functions.
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsFileFuncs

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static class FileFuncs

The FileFuncs type exposes the following members.

Methods
Name Description
ChangeFileExtension
Returns the supplied file name with the extension supplied
CompareUniversalWriteTimes
Compares the universal write times of two files
Copy(String, String)
Copies the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to copy it. If the target file exists it is overwritten, any exceptions are surpressed, archive flags are not removed.
Copy(String, String, Boolean)
Copies the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to copy it. If the target file exists it is overwritten, any exceptions are surpressed.
Copy(String, String, Boolean, Boolean)
Copies the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to copy it. If the target file exists it is overwritten.
Copy(String, String, Boolean, Boolean, FileExistOption)
Copies the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to copy it.
Copy(String, String, Boolean, Boolean, Boolean)
Copies the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to copy it.
Copy(String, String, Boolean, Boolean, FileExistOption)
Copies the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to copy it. The target file name is a referance so that if the file is copied and renamed the name copied to is returned.
Copy(String, String, Boolean, Boolean, FileExistOption, String)
Copies the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to copy it.
Copy(String, String, Boolean, Boolean, FileExistOption, String)
Copies the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to copy it. The target file name is a referance so that if the file is copied and renamed the name copied to is returned.
Delete(String)
Deletes a file but first removes r/o attribute if set
Delete(String, String)
Deletes a file but first removes r/o attribute if set
ExistingFileWithinString
Parses the supplied string in search of the first existing file name therein.
Exists
Tests if the supplied file path exists. This is included for completeness in case System.IO is not used (and doesn't need to be) but Bncs.SysUtils is.
Examples
This code demonstrates some uses of FileFuncs, FileInfoEx, DirFuncs and DirectoryInfoEx.
Copy
class Program
{
    static void Main()
    {
        // Set a new dir name
        string directory = "c:\\This is my directory";
        // If it doesn't exist then create it
        bool exists = DirFuncs.Exists(directory);
        if (!exists)
            exists = DirFuncs.MakeDirectory(directory);

        if (exists)
        {
            // Print out the long and short dir names
            DirectoryInfoEx dirInfo = new DirectoryInfoEx(directory);
            Console.WriteLine("Long Name: " + dirInfo.LongDirectoryName);
            Console.WriteLine("8.3 Name: " + dirInfo.ShortDirectoryName);

            // Create a unique file name, each time you run this code a new file will be created
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "Unique.txt";
            if (FileFuncs.Exists(filename))
                filename = FileFuncs.GenerateUniqueFilename(filename, string.Empty, '_');
            Console.WriteLine("Creating new empty file \"" + filename + "\" ...");
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename);
            writer.Close();

            // Print out the new files Archive attribute
            FileInfoEx fileInfo = new FileInfoEx(filename);
            Console.WriteLine("Archive attribute of \"" + filename + "\" is " + (fileInfo.Archive ? "SET" : " NOT set"));
            Console.WriteLine("Press a key to toggle this attribute");
            Console.ReadKey();
            // Toggle the new files Archive attribute
            fileInfo.Archive = !fileInfo.Archive;
            Console.WriteLine("Archive attribute of \"" + filename + "\" is NOW " + (fileInfo.Archive ? "SET" : " NOT set"));
        }
        else
            Console.WriteLine(directory + " not found and could not be created!");

        Console.ReadKey();
    }
FileByteSizeToString
Converts a byte count into a human readable string as either bytes, kilobytes, megabytes or gigabytes.
FileVersionCompare
Compares two file version numbers, the numbers may only consist of numeric values between 0 and 65,535, minor, major, build numbers etc may be delimited with a period.
GenerateUniqueFilename(String)
Generates a unique file name based on the file name supplied.
GenerateUniqueFilename(String, String)
Generates a unique file name based on the file name supplied.
GenerateUniqueFilename(String, String, Char)
Generates a unique file name based on the file name supplied.
Examples
This code demonstrates some uses of FileFuncs, FileInfoEx, DirFuncs and DirectoryInfoEx.
Copy
class Program
{
    static void Main()
    {
        // Set a new dir name
        string directory = "c:\\This is my directory";
        // If it doesn't exist then create it
        bool exists = DirFuncs.Exists(directory);
        if (!exists)
            exists = DirFuncs.MakeDirectory(directory);

        if (exists)
        {
            // Print out the long and short dir names
            DirectoryInfoEx dirInfo = new DirectoryInfoEx(directory);
            Console.WriteLine("Long Name: " + dirInfo.LongDirectoryName);
            Console.WriteLine("8.3 Name: " + dirInfo.ShortDirectoryName);

            // Create a unique file name, each time you run this code a new file will be created
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "Unique.txt";
            if (FileFuncs.Exists(filename))
                filename = FileFuncs.GenerateUniqueFilename(filename, string.Empty, '_');
            Console.WriteLine("Creating new empty file \"" + filename + "\" ...");
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename);
            writer.Close();

            // Print out the new files Archive attribute
            FileInfoEx fileInfo = new FileInfoEx(filename);
            Console.WriteLine("Archive attribute of \"" + filename + "\" is " + (fileInfo.Archive ? "SET" : " NOT set"));
            Console.WriteLine("Press a key to toggle this attribute");
            Console.ReadKey();
            // Toggle the new files Archive attribute
            fileInfo.Archive = !fileInfo.Archive;
            Console.WriteLine("Archive attribute of \"" + filename + "\" is NOW " + (fileInfo.Archive ? "SET" : " NOT set"));
        }
        else
            Console.WriteLine(directory + " not found and could not be created!");

        Console.ReadKey();
    }
GetCRC32
Gets a files CRC value
GetFileLocale
Attempts to ascertain if the supplied file name resides on the local machine or a remote one
GetFileSize
Gets the size in bytes of the supplied file name.
GetMimeFromRegistry
Returns the mime type from the registry for the supplied file extension or file
IsRemote
Enquires if the supplied file name is known to be on a remote machine
IsValidFilename
Checks for illegal characters (/ \ : * ? " > < |) in a file name (file name only, not the path)
IsValidFilenameWithStarAllowed
Checks for illegal characters (/ \ : ? " > < |) in a file name (file name only, not the path), however illegal character * is permitted
IsValidFilePath
Checks for illegal characters (/ * ? " > < |) in a file path and that the format is valid, i.e. the colon must be at index #1, there must be no further colons, the backslash must be at index #2 and no further backslashes should appear consecutively.
IsValidFilePathWithToken
As with IsValidFilePath() checks for illegal characters (/ * ? " > < |) in a file path and that the format is valid, i.e. the colon must be at index #1, there must be no further colons, the backslash must be at index #2 and no further backslashes should appear consecutively. However the supplied string can start with a Special Directory token, i.e. one of the strings in the array below enclosed in angular brackets. The token must be at the start of the string.
Move(String, String)
Moves the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to move it. If the target file exists it is overwritten, all exceptions are surpressed and the archive attribute is not cleared.
Examples
This code demonstrates some uses of FileFuncs, DirFuncs and DriveFuncs.
Copy
class Program
{
    static void Main()
    {
        // Set up a new dir name
        string directory = "c:\\MyNewDir";
        // Create it
        if (DirFuncs.MakeDirectory(directory))
        {
            // Write a new text file to it (append if it exists)
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "MyFile.txt";
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename, true);
            writer.WriteLine("This is my file");
            writer.Close();

            // Set up a sub dir name
            directory = DirFuncs.IncludeTrailingBackslash(directory) + "MySubDir";
            // Create it
            if (DirFuncs.MakeDirectory(directory))
            {
                // Move MyFile.txt into the new sub dir
                if (FileFuncs.Move(filename, directory))
                    Console.WriteLine("MyFile.txt moved to new sub directory");
                else
                    Console.WriteLine("Failed to move MyFile.txt to new sub directory");
            }
            else
                Console.WriteLine("Failed to create new sub directory");
        }
        else
            Console.WriteLine("Failed to create new directory \"" + directory + "\"");

        // List all NTFS disk drives
        foreach (System.IO.DriveInfo info in DriveFuncs.GetDrives(DriveFileSystemType.NTFS))
            Console.WriteLine("Found NTFS drive: " + info.Name);

        Console.ReadKey();
    }
Move(String, String, Boolean)
Moves the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to move it. If the target file exists it is overwritten, all exceptions are surpressed.
Move(String, String, Boolean, Boolean)
Moves the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to move it. If the target file exists it is overwritten.
Move(String, String, Boolean, Boolean, Boolean)
Moves the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to move it.
PendFileName
Returns the supplied file name prepended or appended by the supplied text.
Rename
Renames the supplied file name to the new name provided
ReviseFileTime
Changes a files last write and/or creation and/or access time to the date specified logic or not.
Shred(String)
Shreds the supplied file by overwriting it first with 0x00's, then 0x01's, then random bytes and finally 0x00's again before deletion.
Shred(String, String)
Shreds the supplied file by overwriting it first with 0x00's, then 0x01's, then random bytes and finally 0x00's again before deletion. On failure the error message is populated.
Shred(String, String, ShredOptions)
Shreds the supplied file by overwriting it first according to the supplied shred option before deletion. On failure the error message is populated.
StringToValidFileName
Strips the invalid file name characters from the supplied string to produce a valid file name (not path) from the supplied string.
UniversalReadFile
Reads any type of file
Top
See Also

Reference

Bncs.SysUtils Namespace


FileFuncs Methods

FileFuncs Methods

The FileFuncs type exposes the following members.

Methods
Name Description
ChangeFileExtension
Returns the supplied file name with the extension supplied
CompareUniversalWriteTimes
Compares the universal write times of two files
Copy(String, String)
Copies the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to copy it. If the target file exists it is overwritten, any exceptions are surpressed, archive flags are not removed.
Copy(String, String, Boolean)
Copies the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to copy it. If the target file exists it is overwritten, any exceptions are surpressed.
Copy(String, String, Boolean, Boolean)
Copies the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to copy it. If the target file exists it is overwritten.
Copy(String, String, Boolean, Boolean, FileExistOption)
Copies the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to copy it.
Copy(String, String, Boolean, Boolean, Boolean)
Copies the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to copy it.
Copy(String, String, Boolean, Boolean, FileExistOption)
Copies the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to copy it. The target file name is a referance so that if the file is copied and renamed the name copied to is returned.
Copy(String, String, Boolean, Boolean, FileExistOption, String)
Copies the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to copy it.
Copy(String, String, Boolean, Boolean, FileExistOption, String)
Copies the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to copy it. The target file name is a referance so that if the file is copied and renamed the name copied to is returned.
Delete(String)
Deletes a file but first removes r/o attribute if set
Delete(String, String)
Deletes a file but first removes r/o attribute if set
ExistingFileWithinString
Parses the supplied string in search of the first existing file name therein.
Exists
Tests if the supplied file path exists. This is included for completeness in case System.IO is not used (and doesn't need to be) but Bncs.SysUtils is.
Examples
This code demonstrates some uses of FileFuncs, FileInfoEx, DirFuncs and DirectoryInfoEx.
Copy
class Program
{
    static void Main()
    {
        // Set a new dir name
        string directory = "c:\\This is my directory";
        // If it doesn't exist then create it
        bool exists = DirFuncs.Exists(directory);
        if (!exists)
            exists = DirFuncs.MakeDirectory(directory);

        if (exists)
        {
            // Print out the long and short dir names
            DirectoryInfoEx dirInfo = new DirectoryInfoEx(directory);
            Console.WriteLine("Long Name: " + dirInfo.LongDirectoryName);
            Console.WriteLine("8.3 Name: " + dirInfo.ShortDirectoryName);

            // Create a unique file name, each time you run this code a new file will be created
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "Unique.txt";
            if (FileFuncs.Exists(filename))
                filename = FileFuncs.GenerateUniqueFilename(filename, string.Empty, '_');
            Console.WriteLine("Creating new empty file \"" + filename + "\" ...");
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename);
            writer.Close();

            // Print out the new files Archive attribute
            FileInfoEx fileInfo = new FileInfoEx(filename);
            Console.WriteLine("Archive attribute of \"" + filename + "\" is " + (fileInfo.Archive ? "SET" : " NOT set"));
            Console.WriteLine("Press a key to toggle this attribute");
            Console.ReadKey();
            // Toggle the new files Archive attribute
            fileInfo.Archive = !fileInfo.Archive;
            Console.WriteLine("Archive attribute of \"" + filename + "\" is NOW " + (fileInfo.Archive ? "SET" : " NOT set"));
        }
        else
            Console.WriteLine(directory + " not found and could not be created!");

        Console.ReadKey();
    }
FileByteSizeToString
Converts a byte count into a human readable string as either bytes, kilobytes, megabytes or gigabytes.
FileVersionCompare
Compares two file version numbers, the numbers may only consist of numeric values between 0 and 65,535, minor, major, build numbers etc may be delimited with a period.
GenerateUniqueFilename(String)
Generates a unique file name based on the file name supplied.
GenerateUniqueFilename(String, String)
Generates a unique file name based on the file name supplied.
GenerateUniqueFilename(String, String, Char)
Generates a unique file name based on the file name supplied.
Examples
This code demonstrates some uses of FileFuncs, FileInfoEx, DirFuncs and DirectoryInfoEx.
Copy
class Program
{
    static void Main()
    {
        // Set a new dir name
        string directory = "c:\\This is my directory";
        // If it doesn't exist then create it
        bool exists = DirFuncs.Exists(directory);
        if (!exists)
            exists = DirFuncs.MakeDirectory(directory);

        if (exists)
        {
            // Print out the long and short dir names
            DirectoryInfoEx dirInfo = new DirectoryInfoEx(directory);
            Console.WriteLine("Long Name: " + dirInfo.LongDirectoryName);
            Console.WriteLine("8.3 Name: " + dirInfo.ShortDirectoryName);

            // Create a unique file name, each time you run this code a new file will be created
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "Unique.txt";
            if (FileFuncs.Exists(filename))
                filename = FileFuncs.GenerateUniqueFilename(filename, string.Empty, '_');
            Console.WriteLine("Creating new empty file \"" + filename + "\" ...");
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename);
            writer.Close();

            // Print out the new files Archive attribute
            FileInfoEx fileInfo = new FileInfoEx(filename);
            Console.WriteLine("Archive attribute of \"" + filename + "\" is " + (fileInfo.Archive ? "SET" : " NOT set"));
            Console.WriteLine("Press a key to toggle this attribute");
            Console.ReadKey();
            // Toggle the new files Archive attribute
            fileInfo.Archive = !fileInfo.Archive;
            Console.WriteLine("Archive attribute of \"" + filename + "\" is NOW " + (fileInfo.Archive ? "SET" : " NOT set"));
        }
        else
            Console.WriteLine(directory + " not found and could not be created!");

        Console.ReadKey();
    }
GetCRC32
Gets a files CRC value
GetFileLocale
Attempts to ascertain if the supplied file name resides on the local machine or a remote one
GetFileSize
Gets the size in bytes of the supplied file name.
GetMimeFromRegistry
Returns the mime type from the registry for the supplied file extension or file
IsRemote
Enquires if the supplied file name is known to be on a remote machine
IsValidFilename
Checks for illegal characters (/ \ : * ? " > < |) in a file name (file name only, not the path)
IsValidFilenameWithStarAllowed
Checks for illegal characters (/ \ : ? " > < |) in a file name (file name only, not the path), however illegal character * is permitted
IsValidFilePath
Checks for illegal characters (/ * ? " > < |) in a file path and that the format is valid, i.e. the colon must be at index #1, there must be no further colons, the backslash must be at index #2 and no further backslashes should appear consecutively.
IsValidFilePathWithToken
As with IsValidFilePath() checks for illegal characters (/ * ? " > < |) in a file path and that the format is valid, i.e. the colon must be at index #1, there must be no further colons, the backslash must be at index #2 and no further backslashes should appear consecutively. However the supplied string can start with a Special Directory token, i.e. one of the strings in the array below enclosed in angular brackets. The token must be at the start of the string.
Move(String, String)
Moves the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to move it. If the target file exists it is overwritten, all exceptions are surpressed and the archive attribute is not cleared.
Examples
This code demonstrates some uses of FileFuncs, DirFuncs and DriveFuncs.
Copy
class Program
{
    static void Main()
    {
        // Set up a new dir name
        string directory = "c:\\MyNewDir";
        // Create it
        if (DirFuncs.MakeDirectory(directory))
        {
            // Write a new text file to it (append if it exists)
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "MyFile.txt";
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename, true);
            writer.WriteLine("This is my file");
            writer.Close();

            // Set up a sub dir name
            directory = DirFuncs.IncludeTrailingBackslash(directory) + "MySubDir";
            // Create it
            if (DirFuncs.MakeDirectory(directory))
            {
                // Move MyFile.txt into the new sub dir
                if (FileFuncs.Move(filename, directory))
                    Console.WriteLine("MyFile.txt moved to new sub directory");
                else
                    Console.WriteLine("Failed to move MyFile.txt to new sub directory");
            }
            else
                Console.WriteLine("Failed to create new sub directory");
        }
        else
            Console.WriteLine("Failed to create new directory \"" + directory + "\"");

        // List all NTFS disk drives
        foreach (System.IO.DriveInfo info in DriveFuncs.GetDrives(DriveFileSystemType.NTFS))
            Console.WriteLine("Found NTFS drive: " + info.Name);

        Console.ReadKey();
    }
Move(String, String, Boolean)
Moves the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to move it. If the target file exists it is overwritten, all exceptions are surpressed.
Move(String, String, Boolean, Boolean)
Moves the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to move it. If the target file exists it is overwritten.
Move(String, String, Boolean, Boolean, Boolean)
Moves the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to move it.
PendFileName
Returns the supplied file name prepended or appended by the supplied text.
Rename
Renames the supplied file name to the new name provided
ReviseFileTime
Changes a files last write and/or creation and/or access time to the date specified logic or not.
Shred(String)
Shreds the supplied file by overwriting it first with 0x00's, then 0x01's, then random bytes and finally 0x00's again before deletion.
Shred(String, String)
Shreds the supplied file by overwriting it first with 0x00's, then 0x01's, then random bytes and finally 0x00's again before deletion. On failure the error message is populated.
Shred(String, String, ShredOptions)
Shreds the supplied file by overwriting it first according to the supplied shred option before deletion. On failure the error message is populated.
StringToValidFileName
Strips the invalid file name characters from the supplied string to produce a valid file name (not path) from the supplied string.
UniversalReadFile
Reads any type of file
Top
See Also

Reference

FileFuncs Class
Bncs.SysUtils Namespace


FileFuncs.ChangeFileExtension Method

FileFuncsChangeFileExtension Method
Returns the supplied file name with the extension supplied

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string ChangeFileExtension(
    string filename_,
    string extension_
)

Parameters

filename_
Type: SystemString
File name who's extension is to be changed
extension_
Type: SystemString
New file extension

Return Value

Type: String
The file name with the new extension
See Also

Reference

FileFuncs Class
Bncs.SysUtils Namespace


FileFuncs.CompareUniversalWriteTimes Method

FileFuncsCompareUniversalWriteTimes Method
Compares the universal write times of two files

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool CompareUniversalWriteTimes(
    string filename1_,
    string filename2_,
    int daylightSavingDelta_
)

Parameters

filename1_
Type: SystemString
First file to compare
filename2_
Type: SystemString
Second file to compare
daylightSavingDelta_
Type: SystemInt32
Daylight saving delta, i.e. 1 = 1 hour

Return Value

Type: Boolean
True if the file times are the same
See Also

Reference

FileFuncs Class
Bncs.SysUtils Namespace


FileFuncs.Copy Method

FileFuncsCopy Method
Overload List
Name | Description
Copy(String, String) | Copies the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to copy it. If the target file exists it is overwritten, any exceptions are surpressed, archive flags are not removed.
Copy(String, String, Boolean) | Copies the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to copy it. If the target file exists it is overwritten, any exceptions are surpressed.
Copy(String, String, Boolean, Boolean) | Copies the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to copy it. If the target file exists it is overwritten.
Copy(String, String, Boolean, Boolean, FileExistOption) | Copies the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to copy it.
Copy(String, String, Boolean, Boolean, Boolean) | Copies the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to copy it.
Copy(String, String, Boolean, Boolean, FileExistOption) | Copies the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to copy it. The target file name is a referance so that if the file is copied and renamed the name copied to is returned.
Copy(String, String, Boolean, Boolean, FileExistOption, String) | Copies the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to copy it.
Copy(String, String, Boolean, Boolean, FileExistOption, String) | Copies the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to copy it. The target file name is a referance so that if the file is copied and renamed the name copied to is returned.
Top
See Also

Reference

FileFuncs Class
Bncs.SysUtils Namespace


FileFuncs.Copy Method (String, String)

FileFuncsCopy Method (String, String)
Copies the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to copy it. If the target file exists it is overwritten, any exceptions are surpressed, archive flags are not removed.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Copy(
    string sourceFilename_,
    string targetFilename_
)

Parameters

sourceFilename_
Type: SystemString
Name of the file to copy
targetFilename_
Type: SystemString
Name of the file or directory to copy to

Return Value

Type: Boolean
True on success
See Also

Reference

FileFuncs Class
Copy Overload
Bncs.SysUtils Namespace


FileFuncs.Copy Method (String, String, Boolean)

FileFuncsCopy Method (String, String, Boolean)
Copies the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to copy it. If the target file exists it is overwritten, any exceptions are surpressed.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Copy(
    string sourceFilename_,
    string targetFilename_,
    bool removeArchiveFlags_
)

Parameters

sourceFilename_
Type: SystemString
Name of the file to copy
targetFilename_
Type: SystemString
Name of the file or directory to copy to
removeArchiveFlags_
Type: SystemBoolean
If true the archive flags are removed on both copies

Return Value

Type: Boolean
True on success
See Also

Reference

FileFuncs Class
Copy Overload
Bncs.SysUtils Namespace


FileFuncs.Copy Method (String, String, Boolean, Boolean)

FileFuncsCopy Method (String, String, Boolean, Boolean)
Copies the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to copy it. If the target file exists it is overwritten.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Copy(
    string sourceFilename_,
    string targetFilename_,
    bool removeArchiveFlags_,
    bool allowExceptions_
)

Parameters

sourceFilename_
Type: SystemString
Name of the file to copy
targetFilename_
Type: SystemString
Name of the file or directory to copy to
removeArchiveFlags_
Type: SystemBoolean
If true the archive flags are removed on both copies
allowExceptions_
Type: SystemBoolean
If true exceptions are not surpressed

Return Value

Type: Boolean
True on success
See Also

Reference

FileFuncs Class
Copy Overload
Bncs.SysUtils Namespace


FileFuncs.Copy Method (String, String, Boolean, Boolean, FileExistOption)

FileFuncsCopy Method (String, String, Boolean, Boolean, FileExistOption)
Copies the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to copy it.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Copy(
    string sourceFilename_,
    string targetFilename_,
    bool removeArchiveFlags_,
    bool allowExceptions_,
    FileExistOption existOption_
)

Parameters

sourceFilename_
Type: SystemString
Name of the file to copy
targetFilename_
Type: SystemString
Name of the file or directory to copy to
removeArchiveFlags_
Type: SystemBoolean
If true the archive flags are removed on both copies
allowExceptions_
Type: SystemBoolean
If true exceptions are not surpressed
existOption_
Type: Bncs.SysUtilsFileExistOption
Options for when the target file name exists

Return Value

Type: Boolean
True on success
See Also

Reference

FileFuncs Class
Copy Overload
Bncs.SysUtils Namespace


FileFuncs.Copy Method (String, String, Boolean, Boolean, Boolean)

FileFuncsCopy Method (String, String, Boolean, Boolean, Boolean)
Copies the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to copy it.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Copy(
    string sourceFilename_,
    string targetFilename_,
    bool removeArchiveFlags_,
    bool allowExceptions_,
    bool failIfTargetExists_
)

Parameters

sourceFilename_
Type: SystemString
Name of the file to copy
targetFilename_
Type: SystemString
Name of the file or directory to copy to
removeArchiveFlags_
Type: SystemBoolean
If true the archive flags are removed on both copies
allowExceptions_
Type: SystemBoolean
If true exceptions are not surpressed
failIfTargetExists_
Type: SystemBoolean
If true the operation fails if the target file name exists

Return Value

Type: Boolean
True on success
See Also

Reference

FileFuncs Class
Copy Overload
Bncs.SysUtils Namespace


FileFuncs.Copy Method (String, String, Boolean, Boolean, FileExistOption)

FileFuncsCopy Method (String, String, Boolean, Boolean, FileExistOption)
Copies the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to copy it. The target file name is a referance so that if the file is copied and renamed the name copied to is returned.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Copy(
    string sourceFilename_,
    ref string targetFilename_,
    bool removeArchiveFlags_,
    bool allowExceptions_,
    FileExistOption existOption_
)

Parameters

sourceFilename_
Type: SystemString
Name of the file to copy
targetFilename_
Type: SystemString
Name of the file or directory to copy to
removeArchiveFlags_
Type: SystemBoolean
If true the archive flags are removed on both copies
allowExceptions_
Type: SystemBoolean
If true exceptions are not surpressed
existOption_
Type: Bncs.SysUtilsFileExistOption
Options for when the target file name exists

Return Value

Type: Boolean
True on success
See Also

Reference

FileFuncs Class
Copy Overload
Bncs.SysUtils Namespace


FileFuncs.Copy Method (String, String, Boolean, Boolean, FileExistOption, String)

FileFuncsCopy Method (String, String, Boolean, Boolean, FileExistOption, String)
Copies the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to copy it.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Copy(
    string sourceFilename_,
    string targetFilename_,
    bool removeArchiveFlags_,
    bool allowExceptions_,
    FileExistOption existOption_,
    out string errorMessage_
)

Parameters

sourceFilename_
Type: SystemString
Name of the file to copy
targetFilename_
Type: SystemString
Name of the file or directory to copy to
removeArchiveFlags_
Type: SystemBoolean
If true the archive flags are removed on both copies
allowExceptions_
Type: SystemBoolean
If true exceptions are not surpressed
existOption_
Type: Bncs.SysUtilsFileExistOption
Options for when the target file name exists
errorMessage_
Type: SystemString
Returns an error message on failure

Return Value

Type: Boolean
True on success
See Also

Reference

FileFuncs Class
Copy Overload
Bncs.SysUtils Namespace


FileFuncs.Copy Method (String, String, Boolean, Boolean, FileExistOption, String)

FileFuncsCopy Method (String, String, Boolean, Boolean, FileExistOption, String)
Copies the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to copy it. The target file name is a referance so that if the file is copied and renamed the name copied to is returned.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Copy(
    string sourceFilename_,
    ref string targetFilename_,
    bool removeArchiveFlags_,
    bool allowExceptions_,
    FileExistOption existOption_,
    out string errorMessage_
)

Parameters

sourceFilename_
Type: SystemString
Name of the file to copy
targetFilename_
Type: SystemString
Name of the file or directory to copy to
removeArchiveFlags_
Type: SystemBoolean
If true the archive flags are removed on both copies
allowExceptions_
Type: SystemBoolean
If true exceptions are not surpressed
existOption_
Type: Bncs.SysUtilsFileExistOption
Options for when the target file name exists
errorMessage_
Type: SystemString
Returns an error message on failure

Return Value

Type: Boolean
True on success
See Also

Reference

FileFuncs Class
Copy Overload
Bncs.SysUtils Namespace


FileFuncs.Delete Method

FileFuncsDelete Method
Overload List
Name | Description
Delete(String) | Deletes a file but first removes r/o attribute if set
Delete(String, String) | Deletes a file but first removes r/o attribute if set
Top
See Also

Reference

FileFuncs Class
Bncs.SysUtils Namespace


FileFuncs.Delete Method (String)

FileFuncsDelete Method (String)
Deletes a file but first removes r/o attribute if set

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Delete(
    string filename_
)

Parameters

filename_
Type: SystemString
File to delete

Return Value

Type: Boolean
True on success
See Also

Reference

FileFuncs Class
Delete Overload
Bncs.SysUtils Namespace


FileFuncs.Delete Method (String, String)

FileFuncsDelete Method (String, String)
Deletes a file but first removes r/o attribute if set

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Delete(
    string filename_,
    out string errorMessage_
)

Parameters

filename_
Type: SystemString
File to delete
errorMessage_
Type: SystemString
Error message

Return Value

Type: Boolean
True on success
See Also

Reference

FileFuncs Class
Delete Overload
Bncs.SysUtils Namespace


FileFuncs.ExistingFileWithinString Method

FileFuncsExistingFileWithinString Method
Parses the supplied string in search of the first existing file name therein.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string ExistingFileWithinString(
    string string_
)

Parameters

string_
Type: SystemString
String to parse

Return Value

Type: String
The full path of the exiating file or an empty string if no file was discovered.
See Also

Reference

FileFuncs Class
Bncs.SysUtils Namespace


FileFuncs.Exists Method

FileFuncsExists Method
Tests if the supplied file path exists. This is included for completeness in case System.IO is not used (and doesn't need to be) but Bncs.SysUtils is.
Examples
This code demonstrates some uses of FileFuncs, FileInfoEx, DirFuncs and DirectoryInfoEx.
Copy
class Program
{
    static void Main()
    {
        // Set a new dir name
        string directory = "c:\\This is my directory";
        // If it doesn't exist then create it
        bool exists = DirFuncs.Exists(directory);
        if (!exists)
            exists = DirFuncs.MakeDirectory(directory);

        if (exists)
        {
            // Print out the long and short dir names
            DirectoryInfoEx dirInfo = new DirectoryInfoEx(directory);
            Console.WriteLine("Long Name: " + dirInfo.LongDirectoryName);
            Console.WriteLine("8.3 Name: " + dirInfo.ShortDirectoryName);

            // Create a unique file name, each time you run this code a new file will be created
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "Unique.txt";
            if (FileFuncs.Exists(filename))
                filename = FileFuncs.GenerateUniqueFilename(filename, string.Empty, '_');
            Console.WriteLine("Creating new empty file \"" + filename + "\" ...");
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename);
            writer.Close();

            // Print out the new files Archive attribute
            FileInfoEx fileInfo = new FileInfoEx(filename);
            Console.WriteLine("Archive attribute of \"" + filename + "\" is " + (fileInfo.Archive ? "SET" : " NOT set"));
            Console.WriteLine("Press a key to toggle this attribute");
            Console.ReadKey();
            // Toggle the new files Archive attribute
            fileInfo.Archive = !fileInfo.Archive;
            Console.WriteLine("Archive attribute of \"" + filename + "\" is NOW " + (fileInfo.Archive ? "SET" : " NOT set"));
        }
        else
            Console.WriteLine(directory + " not found and could not be created!");

        Console.ReadKey();
    }

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Exists(
    string filename_
)

Parameters

filename_
Type: SystemString
File name to test

Return Value

Type: Boolean
True if the file exists
See Also

Reference

FileFuncs Class
Bncs.SysUtils Namespace


FileFuncs.FileByteSizeToString Method

FileFuncsFileByteSizeToString Method
Converts a byte count into a human readable string as either bytes, kilobytes, megabytes or gigabytes.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string FileByteSizeToString(
    long bytes_
)

Parameters

bytes_
Type: SystemInt64
Number of bytes to format.

Return Value

Type: String
A formatted string showing the amount as bytes, kb, mb or gb.
See Also

Reference

FileFuncs Class
Bncs.SysUtils Namespace


FileFuncs.FileVersionCompare Method

FileFuncsFileVersionCompare Method
Compares two file version numbers, the numbers may only consist of numeric values between 0 and 65,535, minor, major, build numbers etc may be delimited with a period.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static Nullable<int> FileVersionCompare(
    string firstVersion_,
    string secondVersion_
)

Parameters

firstVersion_
Type: SystemString
First version number to compare
secondVersion_
Type: SystemString
Second version number to compare

Return Value

Type: Nullable Int32
Null if either sting is empty, null or consists of non numeric characters (apart from the period delimiter). Returns zero if the versions are equal, one if the first is greater than the second and minus one if the first is less than the second.
See Also

Reference

FileFuncs Class
Bncs.SysUtils Namespace


FileFuncs.GenerateUniqueFilename Method

FileFuncsGenerateUniqueFilename Method
Overload List
Name Description
GenerateUniqueFilename(String)
Generates a unique file name based on the file name supplied.
GenerateUniqueFilename(String, String)
Generates a unique file name based on the file name supplied.
GenerateUniqueFilename(String, String, Char)
Generates a unique file name based on the file name supplied.
Examples
This code demonstrates some uses of FileFuncs, FileInfoEx, DirFuncs and DirectoryInfoEx.
Copy
class Program
{
    static void Main()
    {
        // Set a new dir name
        string directory = "c:\\This is my directory";
        // If it doesn't exist then create it
        bool exists = DirFuncs.Exists(directory);
        if (!exists)
            exists = DirFuncs.MakeDirectory(directory);

        if (exists)
        {
            // Print out the long and short dir names
            DirectoryInfoEx dirInfo = new DirectoryInfoEx(directory);
            Console.WriteLine("Long Name: " + dirInfo.LongDirectoryName);
            Console.WriteLine("8.3 Name: " + dirInfo.ShortDirectoryName);

            // Create a unique file name, each time you run this code a new file will be created
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "Unique.txt";
            if (FileFuncs.Exists(filename))
                filename = FileFuncs.GenerateUniqueFilename(filename, string.Empty, '_');
            Console.WriteLine("Creating new empty file \"" + filename + "\" ...");
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename);
            writer.Close();

            // Print out the new files Archive attribute
            FileInfoEx fileInfo = new FileInfoEx(filename);
            Console.WriteLine("Archive attribute of \"" + filename + "\" is " + (fileInfo.Archive ? "SET" : " NOT set"));
            Console.WriteLine("Press a key to toggle this attribute");
            Console.ReadKey();
            // Toggle the new files Archive attribute
            fileInfo.Archive = !fileInfo.Archive;
            Console.WriteLine("Archive attribute of \"" + filename + "\" is NOW " + (fileInfo.Archive ? "SET" : " NOT set"));
        }
        else
            Console.WriteLine(directory + " not found and could not be created!");

        Console.ReadKey();
    }
Top
See Also

Reference

FileFuncs Class
Bncs.SysUtils Namespace


FileFuncs.GenerateUniqueFilename Method (String)

FileFuncsGenerateUniqueFilename Method (String)
Generates a unique file name based on the file name supplied.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string GenerateUniqueFilename(
    string filename_
)

Parameters

filename_
Type: SystemString
File name base of new name.

Return Value

Type: String
A unique file name, ie one that does not exist.
See Also

Reference

FileFuncs Class
GenerateUniqueFilename Overload
Bncs.SysUtils Namespace


FileFuncs.GenerateUniqueFilename Method (String, String)

FileFuncsGenerateUniqueFilename Method (String, String)
Generates a unique file name based on the file name supplied.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string GenerateUniqueFilename(
    string filename_,
    string newExtension_
)

Parameters

filename_
Type: SystemString
File name base of new name.
newExtension_
Type: SystemString
New file extension to use.

Return Value

Type: String
A unique file name, ie one that does not exist.
See Also

Reference

FileFuncs Class
GenerateUniqueFilename Overload
Bncs.SysUtils Namespace


FileFuncs.GenerateUniqueFilename Method (String, String, Char)

FileFuncsGenerateUniqueFilename Method (String, String, Char)
Generates a unique file name based on the file name supplied.
Examples
This code demonstrates some uses of FileFuncs, FileInfoEx, DirFuncs and DirectoryInfoEx.
Copy
class Program
{
    static void Main()
    {
        // Set a new dir name
        string directory = "c:\\This is my directory";
        // If it doesn't exist then create it
        bool exists = DirFuncs.Exists(directory);
        if (!exists)
            exists = DirFuncs.MakeDirectory(directory);

        if (exists)
        {
            // Print out the long and short dir names
            DirectoryInfoEx dirInfo = new DirectoryInfoEx(directory);
            Console.WriteLine("Long Name: " + dirInfo.LongDirectoryName);
            Console.WriteLine("8.3 Name: " + dirInfo.ShortDirectoryName);

            // Create a unique file name, each time you run this code a new file will be created
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "Unique.txt";
            if (FileFuncs.Exists(filename))
                filename = FileFuncs.GenerateUniqueFilename(filename, string.Empty, '_');
            Console.WriteLine("Creating new empty file \"" + filename + "\" ...");
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename);
            writer.Close();

            // Print out the new files Archive attribute
            FileInfoEx fileInfo = new FileInfoEx(filename);
            Console.WriteLine("Archive attribute of \"" + filename + "\" is " + (fileInfo.Archive ? "SET" : " NOT set"));
            Console.WriteLine("Press a key to toggle this attribute");
            Console.ReadKey();
            // Toggle the new files Archive attribute
            fileInfo.Archive = !fileInfo.Archive;
            Console.WriteLine("Archive attribute of \"" + filename + "\" is NOW " + (fileInfo.Archive ? "SET" : " NOT set"));
        }
        else
            Console.WriteLine(directory + " not found and could not be created!");

        Console.ReadKey();
    }

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string GenerateUniqueFilename(
    string filename_,
    string newExtension_,
    char duplicationDelimiter_
)

Parameters

filename_
Type: SystemString
File name base of new name.
newExtension_
Type: SystemString
New file extension to use.
duplicationDelimiter_
Type: SystemChar
Duplication delimiter.

Return Value

Type: String
A unique file name, ie one that does not exist.
See Also

Reference

FileFuncs Class
GenerateUniqueFilename Overload
Bncs.SysUtils Namespace


FileFuncs.GetCRC32 Method

FileFuncsGetCRC32 Method
Gets a files CRC value

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string GetCRC32(
    string fileName_
)

Parameters

fileName_
Type: SystemString
File to get the CRC for

Return Value

Type: String
File CRC string
See Also

Reference

FileFuncs Class
Bncs.SysUtils Namespace


FileFuncs.GetFileLocale Method

FileFuncsGetFileLocale Method
Attempts to ascertain if the supplied file name resides on the local machine or a remote one

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static FileLocale GetFileLocale(
    string filename_
)

Parameters

filename_
Type: SystemString
File to query

Return Value

Type: FileLocale
A FileLocale enumeration: Unknown if not known, NotAFile if the supplied string is a directory, Local if the file is on the local machine, Remote if the file is a share on a remote machine.
See Also

Reference

FileFuncs Class
Bncs.SysUtils Namespace


FileFuncs.GetFileSize Method

FileFuncsGetFileSize Method
Gets the size in bytes of the supplied file name.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static long GetFileSize(
    string filename_
)

Parameters

filename_
Type: SystemString
File name to get the size of

Return Value

Type: Int64
Returns the size in bytes of the file or -1 (file not found), -2 (file not accessible)
See Also

Reference

FileFuncs Class
Bncs.SysUtils Namespace


FileFuncs.GetMimeFromRegistry Method

FileFuncsGetMimeFromRegistry Method
Returns the mime type from the registry for the supplied file extension or file

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string GetMimeFromRegistry(
    string extension_
)

Parameters

extension_
Type: SystemString
Extension with or without a leading period, this may also be the name of an existing file

Return Value

Type: String
Mime type string
See Also

Reference

FileFuncs Class
Bncs.SysUtils Namespace


FileFuncs.IsRemote Method

FileFuncsIsRemote Method
Enquires if the supplied file name is known to be on a remote machine

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool IsRemote(
    string filename_
)

Parameters

filename_
Type: SystemString
File to query

Return Value

Type: Boolean
True if the file is known for sure to be on a remote computer
See Also

Reference

FileFuncs Class
Bncs.SysUtils Namespace


FileFuncs.IsValidFilename Method

FileFuncsIsValidFilename Method
Checks for illegal characters (/ \ : * ? " > < |) in a file name (file name only, not the path)

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool IsValidFilename(
    string filename_
)

Parameters

filename_
Type: SystemString
File name to test

Return Value

Type: Boolean
True if the name is valid
See Also

Reference

FileFuncs Class
Bncs.SysUtils Namespace


FileFuncs.IsValidFilenameWithStarAllowed Method

FileFuncsIsValidFilenameWithStarAllowed Method
Checks for illegal characters (/ \ : ? " > < |) in a file name (file name only, not the path), however illegal character * is permitted

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool IsValidFilenameWithStarAllowed(
    string filename_
)

Parameters

filename_
Type: SystemString
File name to test

Return Value

Type: Boolean
True if the name is valid
See Also

Reference

FileFuncs Class
Bncs.SysUtils Namespace


FileFuncs.IsValidFilePath Method

FileFuncsIsValidFilePath Method
Checks for illegal characters (/ * ? " > < |) in a file path and that the format is valid, i.e. the colon must be at index #1, there must be no further colons, the backslash must be at index #2 and no further backslashes should appear consecutively.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool IsValidFilePath(
    string filepath_
)

Parameters

filepath_
Type: SystemString
File path to test

Return Value

Type: Boolean
True if the path is valid
See Also

Reference

FileFuncs Class
Bncs.SysUtils Namespace


FileFuncs.IsValidFilePathWithToken Method

FileFuncsIsValidFilePathWithToken Method
As with IsValidFilePath() checks for illegal characters (/ * ? " > < |) in a file path and that the format is valid, i.e. the colon must be at index #1, there must be no further colons, the backslash must be at index #2 and no further backslashes should appear consecutively. However the supplied string can start with a Special Directory token, i.e. one of the strings in the array below enclosed in angular brackets. The token must be at the start of the string.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool IsValidFilePathWithToken(
    string filepath_
)

Parameters

filepath_
Type: SystemString
File path to test

Return Value

Type: Boolean
True if the path is valid
See Also

Reference

FileFuncs Class
Bncs.SysUtils Namespace


FileFuncs.Move Method

FileFuncsMove Method
Overload List
Name Description
Move(String, String)
Moves the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to move it. If the target file exists it is overwritten, all exceptions are surpressed and the archive attribute is not cleared.
Examples
This code demonstrates some uses of FileFuncs, DirFuncs and DriveFuncs.
Copy
class Program
{
    static void Main()
    {
        // Set up a new dir name
        string directory = "c:\\MyNewDir";
        // Create it
        if (DirFuncs.MakeDirectory(directory))
        {
            // Write a new text file to it (append if it exists)
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "MyFile.txt";
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename, true);
            writer.WriteLine("This is my file");
            writer.Close();

            // Set up a sub dir name
            directory = DirFuncs.IncludeTrailingBackslash(directory) + "MySubDir";
            // Create it
            if (DirFuncs.MakeDirectory(directory))
            {
                // Move MyFile.txt into the new sub dir
                if (FileFuncs.Move(filename, directory))
                    Console.WriteLine("MyFile.txt moved to new sub directory");
                else
                    Console.WriteLine("Failed to move MyFile.txt to new sub directory");
            }
            else
                Console.WriteLine("Failed to create new sub directory");
        }
        else
            Console.WriteLine("Failed to create new directory \"" + directory + "\"");

        // List all NTFS disk drives
        foreach (System.IO.DriveInfo info in DriveFuncs.GetDrives(DriveFileSystemType.NTFS))
            Console.WriteLine("Found NTFS drive: " + info.Name);

        Console.ReadKey();
    }
Move(String, String, Boolean)
Moves the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to move it. If the target file exists it is overwritten, all exceptions are surpressed.
Move(String, String, Boolean, Boolean)
Moves the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to move it. If the target file exists it is overwritten.
Move(String, String, Boolean, Boolean, Boolean)
Moves the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to move it.
Top
See Also

Reference

FileFuncs Class
Bncs.SysUtils Namespace


FileFuncs.Move Method (String, String)

FileFuncsMove Method (String, String)
Moves the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to move it. If the target file exists it is overwritten, all exceptions are surpressed and the archive attribute is not cleared.
Examples
This code demonstrates some uses of FileFuncs, DirFuncs and DriveFuncs.
Copy
class Program
{
    static void Main()
    {
        // Set up a new dir name
        string directory = "c:\\MyNewDir";
        // Create it
        if (DirFuncs.MakeDirectory(directory))
        {
            // Write a new text file to it (append if it exists)
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "MyFile.txt";
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename, true);
            writer.WriteLine("This is my file");
            writer.Close();

            // Set up a sub dir name
            directory = DirFuncs.IncludeTrailingBackslash(directory) + "MySubDir";
            // Create it
            if (DirFuncs.MakeDirectory(directory))
            {
                // Move MyFile.txt into the new sub dir
                if (FileFuncs.Move(filename, directory))
                    Console.WriteLine("MyFile.txt moved to new sub directory");
                else
                    Console.WriteLine("Failed to move MyFile.txt to new sub directory");
            }
            else
                Console.WriteLine("Failed to create new sub directory");
        }
        else
            Console.WriteLine("Failed to create new directory \"" + directory + "\"");

        // List all NTFS disk drives
        foreach (System.IO.DriveInfo info in DriveFuncs.GetDrives(DriveFileSystemType.NTFS))
            Console.WriteLine("Found NTFS drive: " + info.Name);

        Console.ReadKey();
    }

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Move(
    string sourceFilename_,
    string targetFilename_
)

Parameters

sourceFilename_
Type: SystemString
Name of the file to move
targetFilename_
Type: SystemString
Name of the file or directory to move to

Return Value

Type: Boolean
True on success
See Also

Reference

FileFuncs Class
Move Overload
Bncs.SysUtils Namespace


FileFuncs.Move Method (String, String, Boolean)

FileFuncsMove Method (String, String, Boolean)
Moves the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to move it. If the target file exists it is overwritten, all exceptions are surpressed.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Move(
    string sourceFilename_,
    string targetFilename_,
    bool removeArchiveFlag_
)

Parameters

sourceFilename_
Type: SystemString
Name of the file to move
targetFilename_
Type: SystemString
Name of the file or directory to move to
removeArchiveFlag_
Type: SystemBoolean
If true the archive flag is removed on the target file

Return Value

Type: Boolean
True on success
See Also

Reference

FileFuncs Class
Move Overload
Bncs.SysUtils Namespace


FileFuncs.Move Method (String, String, Boolean, Boolean)

FileFuncsMove Method (String, String, Boolean, Boolean)
Moves the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to move it. If the target file exists it is overwritten.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Move(
    string sourceFilename_,
    string targetFilename_,
    bool removeArchiveFlag_,
    bool allowExceptions_
)

Parameters

sourceFilename_
Type: SystemString
Name of the file to move
targetFilename_
Type: SystemString
Name of the file or directory to move to
removeArchiveFlag_
Type: SystemBoolean
If true the archive flag is removed on the target file
allowExceptions_
Type: SystemBoolean
If true exceptions are not surpressed

Return Value

Type: Boolean
True on success
See Also

Reference

FileFuncs Class
Move Overload
Bncs.SysUtils Namespace


FileFuncs.Move Method (String, String, Boolean, Boolean, Boolean)

FileFuncsMove Method (String, String, Boolean, Boolean, Boolean)
Moves the source file name to the target file location, the location may either be a fully qualified file name or the directory into which you wish to move it.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Move(
    string sourceFilename_,
    string targetFilename_,
    bool removeArchiveFlag_,
    bool allowExceptions_,
    bool failIfTargetExists_
)

Parameters

sourceFilename_
Type: SystemString
Name of the file to move
targetFilename_
Type: SystemString
Name of the file or directory to move to
removeArchiveFlag_
Type: SystemBoolean
If true the archive flag is removed on the target file
allowExceptions_
Type: SystemBoolean
If true exceptions are not surpressed
failIfTargetExists_
Type: SystemBoolean
If true the operation fails if the target file name exists

Return Value

Type: Boolean
True on success
See Also

Reference

FileFuncs Class
Move Overload
Bncs.SysUtils Namespace


FileFuncs.PendFileName Method

FileFuncsPendFileName Method
Returns the supplied file name prepended or appended by the supplied text.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string PendFileName(
    string filename_,
    string text_,
    bool prepend_
)

Parameters

filename_
Type: SystemString
File to prepend or append to
text_
Type: SystemString
Text to prepend or append
prepend_
Type: SystemBoolean
If true text is prepended else it is appended

Return Value

Type: String
The full path and file name with the pend text
See Also

Reference

FileFuncs Class
Bncs.SysUtils Namespace


FileFuncs.Rename Method

FileFuncsRename Method
Renames the supplied file name to the new name provided

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Rename(
    string filename_,
    string newFilename_
)

Parameters

filename_
Type: SystemString
File to rename
newFilename_
Type: SystemString
New name of the file, this can be either a full path or just a file name. If the latter then the file remains in the same directory as the original file.

Return Value

Type: Boolean
True on success
See Also

Reference

FileFuncs Class
Bncs.SysUtils Namespace


FileFuncs.ReviseFileTime Method

FileFuncsReviseFileTime Method
Changes a files last write and/or creation and/or access time to the date specified logic or not.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool ReviseFileTime(
    string filename_,
    DateTime revisedTime_,
    List<FileTimeType> types_
)

Parameters

filename_
Type: SystemString
Name of the file whose time is to be changed
revisedTime_
Type: SystemDateTime
New time to apply
types_
Type: System.Collections.GenericList FileTimeType
The time types to change, any combination or Creation, LastWrite or Access

Return Value

Type: Boolean
True on success
See Also

Reference

FileFuncs Class
Bncs.SysUtils Namespace


FileFuncs.Shred Method

FileFuncsShred Method
Overload List
Name | Description
Shred(String) | Shreds the supplied file by overwriting it first with 0x00's, then 0x01's, then random bytes and finally 0x00's again before deletion.
Shred(String, String) | Shreds the supplied file by overwriting it first with 0x00's, then 0x01's, then random bytes and finally 0x00's again before deletion. On failure the error message is populated.
Shred(String, String, ShredOptions) | Shreds the supplied file by overwriting it first according to the supplied shred option before deletion. On failure the error message is populated.
Top
See Also

Reference

FileFuncs Class
Bncs.SysUtils Namespace


FileFuncs.Shred Method (String)

FileFuncsShred Method (String)
Shreds the supplied file by overwriting it first with 0x00's, then 0x01's, then random bytes and finally 0x00's again before deletion.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Shred(
    string filename_
)

Parameters

filename_
Type: SystemString
File to shred

Return Value

Type: Boolean
True on success
See Also

Reference

FileFuncs Class
Shred Overload
Bncs.SysUtils Namespace


FileFuncs.Shred Method (String, String)

FileFuncsShred Method (String, String)
Shreds the supplied file by overwriting it first with 0x00's, then 0x01's, then random bytes and finally 0x00's again before deletion. On failure the error message is populated.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Shred(
    string filename_,
    out string errorMessage_
)

Parameters

filename_
Type: SystemString
File to shred
errorMessage_
Type: SystemString
Error message

Return Value

Type: Boolean
True on success
See Also

Reference

FileFuncs Class
Shred Overload
Bncs.SysUtils Namespace


FileFuncs.Shred Method (String, String, ShredOptions)

FileFuncsShred Method (String, String, ShredOptions)
Shreds the supplied file by overwriting it first according to the supplied shred option before deletion. On failure the error message is populated.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Shred(
    string filename_,
    out string errorMessage_,
    ShredOptions option_
)

Parameters

filename_
Type: SystemString
File to shred
errorMessage_
Type: SystemString
Error message
option_
Type: Bncs.SysUtilsShredOptions
Shred level option

Return Value

Type: Boolean
True on success
See Also

Reference

FileFuncs Class
Shred Overload
Bncs.SysUtils Namespace


FileFuncs.StringToValidFileName Method

FileFuncsStringToValidFileName Method
Strips the invalid file name characters from the supplied string to produce a valid file name (not path) from the supplied string.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string StringToValidFileName(
    string text_
)

Parameters

text_
Type: SystemString
String to parse

Return Value

Type: String
The supplied string minus any illegal file name characters. For example "hello*world" returns "helloworld" while "\\/*|" returns an empty string.
See Also

Reference

FileFuncs Class
Bncs.SysUtils Namespace


FileFuncs.UniversalReadFile Method

FileFuncsUniversalReadFile Method
Reads any type of file

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static byte[] UniversalReadFile(
    string filename_
)

Parameters

filename_
Type: SystemString
Name of the file to read

Return Value

Type: Byte
File contents as an array of bytes
See Also

Reference

FileFuncs Class
Bncs.SysUtils Namespace


FileInfoEx Class

FileInfoEx Class
FileInfoEx, surfaces an underlying FileInfo object and makes all the attributes booleans. Also contains a file compare method.
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsFileInfoEx

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class FileInfoEx

The FileInfoEx type exposes the following members.

Constructors
Name Description
FileInfoEx
Constructor
Examples
This code demonstrates some uses of FileFuncs, FileInfoEx, DirFuncs and DirectoryInfoEx.
Copy
class Program
{
    static void Main()
    {
        // Set a new dir name
        string directory = "c:\\This is my directory";
        // If it doesn't exist then create it
        bool exists = DirFuncs.Exists(directory);
        if (!exists)
            exists = DirFuncs.MakeDirectory(directory);

        if (exists)
        {
            // Print out the long and short dir names
            DirectoryInfoEx dirInfo = new DirectoryInfoEx(directory);
            Console.WriteLine("Long Name: " + dirInfo.LongDirectoryName);
            Console.WriteLine("8.3 Name: " + dirInfo.ShortDirectoryName);

            // Create a unique file name, each time you run this code a new file will be created
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "Unique.txt";
            if (FileFuncs.Exists(filename))
                filename = FileFuncs.GenerateUniqueFilename(filename, string.Empty, '_');
            Console.WriteLine("Creating new empty file \"" + filename + "\" ...");
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename);
            writer.Close();

            // Print out the new files Archive attribute
            FileInfoEx fileInfo = new FileInfoEx(filename);
            Console.WriteLine("Archive attribute of \"" + filename + "\" is " + (fileInfo.Archive ? "SET" : " NOT set"));
            Console.WriteLine("Press a key to toggle this attribute");
            Console.ReadKey();
            // Toggle the new files Archive attribute
            fileInfo.Archive = !fileInfo.Archive;
            Console.WriteLine("Archive attribute of \"" + filename + "\" is NOW " + (fileInfo.Archive ? "SET" : " NOT set"));
        }
        else
            Console.WriteLine(directory + " not found and could not be created!");

        Console.ReadKey();
    }
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | ExtensionMatches | Tests to see if the file extension matches the supplied extension or extensions. Multiple extensions maybe passed by delimiting the string with a semi-colon. Each extension may or may not contain a leading period.
Public method | FileCompare | Compares the file with that supplied
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
Name Description
Archive
Gets/sets the system archive flag.
Examples
This code demonstrates some uses of FileFuncs, FileInfoEx, DirFuncs and DirectoryInfoEx.
Copy
class Program
{
    static void Main()
    {
        // Set a new dir name
        string directory = "c:\\This is my directory";
        // If it doesn't exist then create it
        bool exists = DirFuncs.Exists(directory);
        if (!exists)
            exists = DirFuncs.MakeDirectory(directory);

        if (exists)
        {
            // Print out the long and short dir names
            DirectoryInfoEx dirInfo = new DirectoryInfoEx(directory);
            Console.WriteLine("Long Name: " + dirInfo.LongDirectoryName);
            Console.WriteLine("8.3 Name: " + dirInfo.ShortDirectoryName);

            // Create a unique file name, each time you run this code a new file will be created
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "Unique.txt";
            if (FileFuncs.Exists(filename))
                filename = FileFuncs.GenerateUniqueFilename(filename, string.Empty, '_');
            Console.WriteLine("Creating new empty file \"" + filename + "\" ...");
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename);
            writer.Close();

            // Print out the new files Archive attribute
            FileInfoEx fileInfo = new FileInfoEx(filename);
            Console.WriteLine("Archive attribute of \"" + filename + "\" is " + (fileInfo.Archive ? "SET" : " NOT set"));
            Console.WriteLine("Press a key to toggle this attribute");
            Console.ReadKey();
            // Toggle the new files Archive attribute
            fileInfo.Archive = !fileInfo.Archive;
            Console.WriteLine("Archive attribute of \"" + filename + "\" is NOW " + (fileInfo.Archive ? "SET" : " NOT set"));
        }
        else
            Console.WriteLine(directory + " not found and could not be created!");

        Console.ReadKey();
    }
Public property Compressed
Gets/sets the system compressed flag.
Public property Device
Gets/sets the system device flag.
Public property Directory
Gets/sets the system directory flag.
Public property Encrypted
Gets/sets the system encryption flag.
Public property ErrorMessage
Gets the last error message.
Public property FilenameWithoutExtension
Gets the file name only minus the file name extension.
Public property Hidden
Gets/sets the system hidden flag.
Public property Information
Gets the [!:System.IO.FileInfo] instance.
Public property LongFilename
Gets the long file name of the file.
Public property Normal
Gets/sets the system normal flag.
Public property NotContentIndexed
Gets/sets the system not content indexed flag.
Public property Offline
Gets/sets the system offline flag.
Public property ReadOnly
Gets/sets the system r/o flag.
Public property ReparsePoint
Gets/sets the system reparse point flag.
Public property ShortFilename
Gets the short file name of the file.
Public property Size
Returns the size in bytes of the file or -1 (file not found), -2 (file not accessible)
Public property SparseFile
Gets/sets the system sparse file flag.
Public property System
Gets/sets the system system flag.
Public property Temporary
Gets/sets the system temp flag.
Top
See Also

Reference

Bncs.SysUtils Namespace


FileInfoEx Constructor

FileInfoEx Constructor
Constructor
Examples
This code demonstrates some uses of FileFuncs, FileInfoEx, DirFuncs and DirectoryInfoEx.
Copy
class Program
{
    static void Main()
    {
        // Set a new dir name
        string directory = "c:\\This is my directory";
        // If it doesn't exist then create it
        bool exists = DirFuncs.Exists(directory);
        if (!exists)
            exists = DirFuncs.MakeDirectory(directory);

        if (exists)
        {
            // Print out the long and short dir names
            DirectoryInfoEx dirInfo = new DirectoryInfoEx(directory);
            Console.WriteLine("Long Name: " + dirInfo.LongDirectoryName);
            Console.WriteLine("8.3 Name: " + dirInfo.ShortDirectoryName);

            // Create a unique file name, each time you run this code a new file will be created
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "Unique.txt";
            if (FileFuncs.Exists(filename))
                filename = FileFuncs.GenerateUniqueFilename(filename, string.Empty, '_');
            Console.WriteLine("Creating new empty file \"" + filename + "\" ...");
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename);
            writer.Close();

            // Print out the new files Archive attribute
            FileInfoEx fileInfo = new FileInfoEx(filename);
            Console.WriteLine("Archive attribute of \"" + filename + "\" is " + (fileInfo.Archive ? "SET" : " NOT set"));
            Console.WriteLine("Press a key to toggle this attribute");
            Console.ReadKey();
            // Toggle the new files Archive attribute
            fileInfo.Archive = !fileInfo.Archive;
            Console.WriteLine("Archive attribute of \"" + filename + "\" is NOW " + (fileInfo.Archive ? "SET" : " NOT set"));
        }
        else
            Console.WriteLine(directory + " not found and could not be created!");

        Console.ReadKey();
    }

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public FileInfoEx(
    string filename_
)

Parameters

filename_
Type: SystemString
File to work with
See Also

Reference

FileInfoEx Class
Bncs.SysUtils Namespace


FileInfoEx Methods

FileInfoEx Methods

The FileInfoEx type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | ExtensionMatches | Tests to see if the file extension matches the supplied extension or extensions. Multiple extensions maybe passed by delimiting the string with a semi-colon. Each extension may or may not contain a leading period.
Public method | FileCompare | Compares the file with that supplied
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

FileInfoEx Class
Bncs.SysUtils Namespace


FileInfoEx.ExtensionMatches Method

FileInfoExExtensionMatches Method
Tests to see if the file extension matches the supplied extension or extensions. Multiple extensions maybe passed by delimiting the string with a semi-colon. Each extension may or may not contain a leading period.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool ExtensionMatches(
    string fileExtensions_
)

Parameters

fileExtensions_
Type: SystemString
Semi colon delimited liust of extensions

Return Value

Type: Boolean
True if any of the extensions supplied matches
See Also

Reference

FileInfoEx Class
Bncs.SysUtils Namespace


FileInfoEx.FileCompare Method

FileInfoExFileCompare Method
Compares the file with that supplied

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool FileCompare(
    string archivedCopy_
)

Parameters

archivedCopy_
Type: SystemString
File to compare with

Return Value

Type: Boolean
True if the files are identical
See Also

Reference

FileInfoEx Class
Bncs.SysUtils Namespace


FileInfoEx Properties

FileInfoEx Properties

The FileInfoEx type exposes the following members.

Properties
Name Description
Archive
Gets/sets the system archive flag.
Examples
This code demonstrates some uses of FileFuncs, FileInfoEx, DirFuncs and DirectoryInfoEx.
Copy
class Program
{
    static void Main()
    {
        // Set a new dir name
        string directory = "c:\\This is my directory";
        // If it doesn't exist then create it
        bool exists = DirFuncs.Exists(directory);
        if (!exists)
            exists = DirFuncs.MakeDirectory(directory);

        if (exists)
        {
            // Print out the long and short dir names
            DirectoryInfoEx dirInfo = new DirectoryInfoEx(directory);
            Console.WriteLine("Long Name: " + dirInfo.LongDirectoryName);
            Console.WriteLine("8.3 Name: " + dirInfo.ShortDirectoryName);

            // Create a unique file name, each time you run this code a new file will be created
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "Unique.txt";
            if (FileFuncs.Exists(filename))
                filename = FileFuncs.GenerateUniqueFilename(filename, string.Empty, '_');
            Console.WriteLine("Creating new empty file \"" + filename + "\" ...");
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename);
            writer.Close();

            // Print out the new files Archive attribute
            FileInfoEx fileInfo = new FileInfoEx(filename);
            Console.WriteLine("Archive attribute of \"" + filename + "\" is " + (fileInfo.Archive ? "SET" : " NOT set"));
            Console.WriteLine("Press a key to toggle this attribute");
            Console.ReadKey();
            // Toggle the new files Archive attribute
            fileInfo.Archive = !fileInfo.Archive;
            Console.WriteLine("Archive attribute of \"" + filename + "\" is NOW " + (fileInfo.Archive ? "SET" : " NOT set"));
        }
        else
            Console.WriteLine(directory + " not found and could not be created!");

        Console.ReadKey();
    }
Public property Compressed
Gets/sets the system compressed flag.
Public property Device
Gets/sets the system device flag.
Public property Directory
Gets/sets the system directory flag.
Public property Encrypted
Gets/sets the system encryption flag.
Public property ErrorMessage
Gets the last error message.
Public property FilenameWithoutExtension
Gets the file name only minus the file name extension.
Public property Hidden
Gets/sets the system hidden flag.
Public property Information
Gets the [!:System.IO.FileInfo] instance.
Public property LongFilename
Gets the long file name of the file.
Public property Normal
Gets/sets the system normal flag.
Public property NotContentIndexed
Gets/sets the system not content indexed flag.
Public property Offline
Gets/sets the system offline flag.
Public property ReadOnly
Gets/sets the system r/o flag.
Public property ReparsePoint
Gets/sets the system reparse point flag.
Public property ShortFilename
Gets the short file name of the file.
Public property Size
Returns the size in bytes of the file or -1 (file not found), -2 (file not accessible)
Public property SparseFile
Gets/sets the system sparse file flag.
Public property System
Gets/sets the system system flag.
Public property Temporary
Gets/sets the system temp flag.
Top
See Also

Reference

FileInfoEx Class
Bncs.SysUtils Namespace


FileInfoEx.Archive Property

FileInfoExArchive Property
Gets/sets the system archive flag.
Examples
This code demonstrates some uses of FileFuncs, FileInfoEx, DirFuncs and DirectoryInfoEx.
Copy
class Program
{
    static void Main()
    {
        // Set a new dir name
        string directory = "c:\\This is my directory";
        // If it doesn't exist then create it
        bool exists = DirFuncs.Exists(directory);
        if (!exists)
            exists = DirFuncs.MakeDirectory(directory);

        if (exists)
        {
            // Print out the long and short dir names
            DirectoryInfoEx dirInfo = new DirectoryInfoEx(directory);
            Console.WriteLine("Long Name: " + dirInfo.LongDirectoryName);
            Console.WriteLine("8.3 Name: " + dirInfo.ShortDirectoryName);

            // Create a unique file name, each time you run this code a new file will be created
            string filename = DirFuncs.IncludeTrailingBackslash(directory) + "Unique.txt";
            if (FileFuncs.Exists(filename))
                filename = FileFuncs.GenerateUniqueFilename(filename, string.Empty, '_');
            Console.WriteLine("Creating new empty file \"" + filename + "\" ...");
            System.IO.TextWriter writer = new System.IO.StreamWriter(filename);
            writer.Close();

            // Print out the new files Archive attribute
            FileInfoEx fileInfo = new FileInfoEx(filename);
            Console.WriteLine("Archive attribute of \"" + filename + "\" is " + (fileInfo.Archive ? "SET" : " NOT set"));
            Console.WriteLine("Press a key to toggle this attribute");
            Console.ReadKey();
            // Toggle the new files Archive attribute
            fileInfo.Archive = !fileInfo.Archive;
            Console.WriteLine("Archive attribute of \"" + filename + "\" is NOW " + (fileInfo.Archive ? "SET" : " NOT set"));
        }
        else
            Console.WriteLine(directory + " not found and could not be created!");

        Console.ReadKey();
    }

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Archive { get; set; }

Property Value

Type: Boolean
See Also

Reference

FileInfoEx Class
Bncs.SysUtils Namespace


FileInfoEx.Compressed Property

FileInfoExCompressed Property
Gets/sets the system compressed flag.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Compressed { get; set; }

Property Value

Type: Boolean
See Also

Reference

FileInfoEx Class
Bncs.SysUtils Namespace


FileInfoEx.Device Property

FileInfoExDevice Property
Gets/sets the system device flag.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Device { get; set; }

Property Value

Type: Boolean
See Also

Reference

FileInfoEx Class
Bncs.SysUtils Namespace


FileInfoEx.Directory Property

FileInfoExDirectory Property
Gets/sets the system directory flag.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Directory { get; set; }

Property Value

Type: Boolean
See Also

Reference

FileInfoEx Class
Bncs.SysUtils Namespace


FileInfoEx.Encrypted Property

FileInfoExEncrypted Property
Gets/sets the system encryption flag.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Encrypted { get; set; }

Property Value

Type: Boolean
See Also

Reference

FileInfoEx Class
Bncs.SysUtils Namespace


FileInfoEx.ErrorMessage Property

FileInfoExErrorMessage Property
Gets the last error message.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string ErrorMessage { get; }

Property Value

Type: String
See Also

Reference

FileInfoEx Class
Bncs.SysUtils Namespace


FileInfoEx.FilenameWithoutExtension Property

FileInfoExFilenameWithoutExtension Property
Gets the file name only minus the file name extension.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string FilenameWithoutExtension { get; }

Property Value

Type: String
See Also

Reference

FileInfoEx Class
Bncs.SysUtils Namespace


FileInfoEx.Hidden Property

FileInfoExHidden Property
Gets/sets the system hidden flag.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Hidden { get; set; }

Property Value

Type: Boolean
See Also

Reference

FileInfoEx Class
Bncs.SysUtils Namespace


FileInfoEx.Information Property

FileInfoExInformation Property
Gets the [!:System.IO.FileInfo] instance.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public FileInfo Information { get; }

Property Value

Type: FileInfo
See Also

Reference

FileInfoEx Class
Bncs.SysUtils Namespace


FileInfoEx.LongFilename Property

FileInfoExLongFilename Property
Gets the long file name of the file.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string LongFilename { get; }

Property Value

Type: String
See Also

Reference

FileInfoEx Class
Bncs.SysUtils Namespace


FileInfoEx.Normal Property

FileInfoExNormal Property
Gets/sets the system normal flag.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Normal { get; set; }

Property Value

Type: Boolean
See Also

Reference

FileInfoEx Class
Bncs.SysUtils Namespace


FileInfoEx.NotContentIndexed Property

FileInfoExNotContentIndexed Property
Gets/sets the system not content indexed flag.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool NotContentIndexed { get; set; }

Property Value

Type: Boolean
See Also

Reference

FileInfoEx Class
Bncs.SysUtils Namespace


FileInfoEx.Offline Property

FileInfoExOffline Property
Gets/sets the system offline flag.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Offline { get; set; }

Property Value

Type: Boolean
See Also

Reference

FileInfoEx Class
Bncs.SysUtils Namespace


FileInfoEx.ReadOnly Property

FileInfoExReadOnly Property
Gets/sets the system r/o flag.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool ReadOnly { get; set; }

Property Value

Type: Boolean
See Also

Reference

FileInfoEx Class
Bncs.SysUtils Namespace


FileInfoEx.ReparsePoint Property

FileInfoExReparsePoint Property
Gets/sets the system reparse point flag.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool ReparsePoint { get; set; }

Property Value

Type: Boolean
See Also

Reference

FileInfoEx Class
Bncs.SysUtils Namespace


FileInfoEx.ShortFilename Property

FileInfoExShortFilename Property
Gets the short file name of the file.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string ShortFilename { get; }

Property Value

Type: String
See Also

Reference

FileInfoEx Class
Bncs.SysUtils Namespace


FileInfoEx.Size Property

FileInfoExSize Property
Returns the size in bytes of the file or -1 (file not found), -2 (file not accessible)

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public long Size { get; }

Property Value

Type: Int64
See Also

Reference

FileInfoEx Class
Bncs.SysUtils Namespace


FileInfoEx.SparseFile Property

FileInfoExSparseFile Property
Gets/sets the system sparse file flag.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool SparseFile { get; set; }

Property Value

Type: Boolean
See Also

Reference

FileInfoEx Class
Bncs.SysUtils Namespace


FileInfoEx.System Property

FileInfoExSystem Property
Gets/sets the system system flag.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool System { get; set; }

Property Value

Type: Boolean
See Also

Reference

FileInfoEx Class
Bncs.SysUtils Namespace


FileInfoEx.Temporary Property

FileInfoExTemporary Property
Gets/sets the system temp flag.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Temporary { get; set; }

Property Value

Type: Boolean
See Also

Reference

FileInfoEx Class
Bncs.SysUtils Namespace


FileJoinResult Enumeration

FileJoinResult Enumeration
Enumeration to indicate the file join result

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum FileJoinResult
Members
Member name | Value | Description
Success | 0 | Files joined successfuly.
Working | 1 | Operation still in progress.
Fail | 2 | Operation failed.
TargetSizeExceedsFat32Limit | 3 | Target file size exceeds the limit for a file size on a FAT32 drive.
NoTargetFilenameSpecified | 4 | The target name was not specified.
LessThanTwoJoinFilesSpecified | 5 | Only a single file has been specified for a file join operation.
See Also

Reference

Bncs.SysUtils Namespace


FileLocale Enumeration

FileLocale Enumeration
File location type enumeration

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum FileLocale
Members
Member name | Value | Description
Unknown | 0 | The file locale cannot be determined.
NotAFile | 1 | The "file" is not actually a physical disk file.
Local | 2 | The file resides on the local machine.
Remote | 3 | The file resides on another machine.
See Also

Reference

Bncs.SysUtils Namespace


FileSplitAndJoin Class

FileSplitAndJoin Class
A class to split a file into segments or create a file by joining segments with an option to thread these operations
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsFileSplitAndJoin

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class FileSplitAndJoin

The FileSplitAndJoin type exposes the following members.

Constructors
 | Name | Description
Public method | FileSplitAndJoin | Default constructor
Public method | FileSplitAndJoin(String) | Constructor with file name
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Join | Joins the supplied list of segmented files into the supplied file name
Public method | Split | Splits the assigned file name into segments
Public method | Split(String) | Splits the supplied file name into segments
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | Cancel | When set to true the current join or split operation will abort
Public property | DeleteSegmentsOnSuccess | If true then the segment files are deleted after a successfull join operation
Public property | DeleteSourceFileOnSuccess | If true then the source file is deleted after a successfull split operation
Public property | Filename | Gets or sets the file name to either split or join to
Public property | FullSpeed | If true and threaded the thread will not sleep
Public property | Threaded | If true then split and join operations are run in a seperate thread
Public property | Unit | Gets or sets the unit we are dealing in
Public property | UnitSize | Gets or sets the unit size, i.e. the amount of bytes, kb, mb or gb to segment to
Top
Events
 | Name | Description
Public event | OnCompleted | OnCompleted event handler
Public event | OnProgress | OnProgress event handler
Top
See Also

Reference

Bncs.SysUtils Namespace


FileSplitAndJoin Constructor

FileSplitAndJoin Constructor
Overload List
 | Name | Description
Public method | FileSplitAndJoin | Default constructor
Public method | FileSplitAndJoin(String) | Constructor with file name
Top
See Also

Reference

FileSplitAndJoin Class
Bncs.SysUtils Namespace


FileSplitAndJoin Constructor

FileSplitAndJoin Constructor
Default constructor

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public FileSplitAndJoin()
See Also

Reference

FileSplitAndJoin Class
FileSplitAndJoin Overload
Bncs.SysUtils Namespace


FileSplitAndJoin Constructor (String)

FileSplitAndJoin Constructor (String)
Constructor with file name

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public FileSplitAndJoin(
    string filename_
)

Parameters

filename_
Type: SystemString
The name of the file to split or join to
See Also

Reference

FileSplitAndJoin Class
FileSplitAndJoin Overload
Bncs.SysUtils Namespace


FileSplitAndJoin Methods

FileSplitAndJoin Methods

The FileSplitAndJoin type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Join | Joins the supplied list of segmented files into the supplied file name
Public method | Split | Splits the assigned file name into segments
Public method | Split(String) | Splits the supplied file name into segments
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

FileSplitAndJoin Class
Bncs.SysUtils Namespace


FileSplitAndJoin.Join Method

FileSplitAndJoinJoin Method
Joins the supplied list of segmented files into the supplied file name

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public FileJoinResult Join(
    string filename_,
    List<string> filenames_
)

Parameters

filename_
Type: SystemString
Output file name.
filenames_
Type: System.Collections.GenericList String
Input file names.

Return Value

Type: FileJoinResult
A file join result.
See Also

Reference

FileSplitAndJoin Class
Bncs.SysUtils Namespace


FileSplitAndJoin.Split Method

FileSplitAndJoinSplit Method
Overload List
 | Name | Description
Public method | Split | Splits the assigned file name into segments
Public method | Split(String) | Splits the supplied file name into segments
Top
See Also

Reference

FileSplitAndJoin Class
Bncs.SysUtils Namespace


FileSplitAndJoin.Split Method

FileSplitAndJoinSplit Method
Splits the assigned file name into segments

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Split()

Return Value

Type: Int32
The number of output files generated or -1 if threaded
See Also

Reference

FileSplitAndJoin Class
Split Overload
Bncs.SysUtils Namespace


FileSplitAndJoin.Split Method (String)

FileSplitAndJoinSplit Method (String)
Splits the supplied file name into segments

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Split(
    string filename_
)

Parameters

filename_
Type: SystemString
File to split

Return Value

Type: Int32
The number of output files generated or -1 if threaded
See Also

Reference

FileSplitAndJoin Class
Split Overload
Bncs.SysUtils Namespace


FileSplitAndJoin Properties

FileSplitAndJoin Properties

The FileSplitAndJoin type exposes the following members.

Properties
 | Name | Description
Public property | Cancel | When set to true the current join or split operation will abort
Public property | DeleteSegmentsOnSuccess | If true then the segment files are deleted after a successfull join operation
Public property | DeleteSourceFileOnSuccess | If true then the source file is deleted after a successfull split operation
Public property | Filename | Gets or sets the file name to either split or join to
Public property | FullSpeed | If true and threaded the thread will not sleep
Public property | Threaded | If true then split and join operations are run in a seperate thread
Public property | Unit | Gets or sets the unit we are dealing in
Public property | UnitSize | Gets or sets the unit size, i.e. the amount of bytes, kb, mb or gb to segment to
Top
See Also

Reference

FileSplitAndJoin Class
Bncs.SysUtils Namespace


FileSplitAndJoin.Cancel Property

FileSplitAndJoinCancel Property
When set to true the current join or split operation will abort

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Cancel { get; set; }

Property Value

Type: Boolean
See Also

Reference

FileSplitAndJoin Class
Bncs.SysUtils Namespace


FileSplitAndJoin.DeleteSegmentsOnSuccess Property

FileSplitAndJoinDeleteSegmentsOnSuccess Property
If true then the segment files are deleted after a successfull join operation

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool DeleteSegmentsOnSuccess { get; set; }

Property Value

Type: Boolean
See Also

Reference

FileSplitAndJoin Class
Bncs.SysUtils Namespace


FileSplitAndJoin.DeleteSourceFileOnSuccess Property

FileSplitAndJoinDeleteSourceFileOnSuccess Property
If true then the source file is deleted after a successfull split operation

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool DeleteSourceFileOnSuccess { get; set; }

Property Value

Type: Boolean
See Also

Reference

FileSplitAndJoin Class
Bncs.SysUtils Namespace


FileSplitAndJoin.Filename Property

FileSplitAndJoinFilename Property
Gets or sets the file name to either split or join to

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Filename { get; set; }

Property Value

Type: String
See Also

Reference

FileSplitAndJoin Class
Bncs.SysUtils Namespace


FileSplitAndJoin.FullSpeed Property

FileSplitAndJoinFullSpeed Property
If true and threaded the thread will not sleep

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool FullSpeed { get; set; }

Property Value

Type: Boolean
See Also

Reference

FileSplitAndJoin Class
Bncs.SysUtils Namespace


FileSplitAndJoin.Threaded Property

FileSplitAndJoinThreaded Property
If true then split and join operations are run in a seperate thread

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Threaded { get; set; }

Property Value

Type: Boolean
See Also

Reference

FileSplitAndJoin Class
Bncs.SysUtils Namespace


FileSplitAndJoin.Unit Property

FileSplitAndJoinUnit Property
Gets or sets the unit we are dealing in

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public FileSplitUnit Unit { get; set; }

Property Value

Type: FileSplitUnit
See Also

Reference

FileSplitAndJoin Class
Bncs.SysUtils Namespace


FileSplitAndJoin.UnitSize Property

FileSplitAndJoinUnitSize Property
Gets or sets the unit size, i.e. the amount of bytes, kb, mb or gb to segment to

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public long UnitSize { get; set; }

Property Value

Type: Int64
See Also

Reference

FileSplitAndJoin Class
Bncs.SysUtils Namespace


FileSplitAndJoin Events

FileSplitAndJoin Events

The FileSplitAndJoin type exposes the following members.

Events
 | Name | Description
Public event | OnCompleted | OnCompleted event handler
Public event | OnProgress | OnProgress event handler
Top
See Also

Reference

FileSplitAndJoin Class
Bncs.SysUtils Namespace


FileSplitAndJoin.OnCompleted Event

FileSplitAndJoinOnCompleted Event
OnCompleted event handler

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnCompletedEventHandler OnCompleted

Value

Type: Bncs.SysUtilsOnCompletedEventHandler
See Also

Reference

FileSplitAndJoin Class
Bncs.SysUtils Namespace


FileSplitAndJoin.OnProgress Event

FileSplitAndJoinOnProgress Event
OnProgress event handler

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnProgressEventHandler OnProgress

Value

Type: Bncs.SysUtilsOnProgressEventHandler
See Also

Reference

FileSplitAndJoin Class
Bncs.SysUtils Namespace


FileSplitUnit Enumeration

FileSplitUnit Enumeration
Enumeration to indicate the file split unit

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum FileSplitUnit
Members
Member name | Value | Description
Kilobytes | 0 | Show in kilobytes.
Megabytes | 1 | Show in megabytes.
Gigabytes | 2 | Show in gigabytes.
See Also

Reference

Bncs.SysUtils Namespace


FileTimeType Enumeration

FileTimeType Enumeration
File time type to indicate file time to change in ReviseFileTime()

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum FileTimeType
Members
Member name | Value | Description
Creation | 0 | Use the time at which the file was originally created.
LastWrite | 1 | Use the time at which the file was last written too (edited).
Access | 2 | Use the time at which the file was last accessed (opened).
See Also

Reference

Bncs.SysUtils Namespace


FindFileLocation Enumeration

FindFileLocation Enumeration
Enumeration denoting location of file to find.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum FindFileLocation
Members
Member name | Value | Description
Computer | 0 | Search all disk drives for the file.
OSDrive | 1 | Search for the file in the Operating System directory root.
Path | 2 | Search for the file on the system path.
See Also

Reference

Bncs.SysUtils Namespace


HCBT Enumeration

HCBT Enumeration
CBT values.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum HCBT
Members
Member name | Value | Description
MoveSize | 0 | Move or resize
MinMax | 1 | Minimum / maximum
QueueSync | 2 | Queue sync
CreateWnd | 3 | Create window
DestroyWnd | 4 | Destroy window
Activate | 5 | Activate
ClickSkipped | 6 | Click skipped
KeySkipped | 7 | Key skipped
SysCommand | 8 | System command
SetFocus | 9 | Set focus
See Also

Reference

Bncs.SysUtils Namespace


HookType Enumeration

HookType Enumeration
The type of hook procedure to be installed by SetWindowsHookEx.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum HookType
Members
Member name | Value | Description
WH_JOURNALRECORD | 0 | Installs a hook procedure that records input messages posted to the system message queue. This hook is useful for recording macros. For more information, see the JournalRecordProc hook procedure.
WH_JOURNALPLAYBACK | 1 | Installs a hook procedure that posts messages previously recorded by a WH_JOURNALRECORD hook procedure. For more information, see the JournalPlaybackProc hook procedure.
WH_KEYBOARD | 2 | Installs a hook procedure that monitors keystroke messages. For more information, see the KeyboardProc hook procedure.
WH_GETMESSAGE | 3 | Installs a hook procedure that monitors messages posted to a message queue. For more information, see the GetMsgProc hook procedure.
WH_CALLWNDPROC | 4 | Installs a hook procedure that monitors messages before the system sends them to the destination window procedure. For more information, see the CallWndProc hook procedure.
WH_CBT | 5 | Installs a hook procedure that receives notifications useful to a CBT application. For more information, see the CBTProc hook procedure.
WH_SYSMSGFILTER | 6 | Installs a hook procedure that monitors messages generated as a result of an input event in a dialog box, message box, menu, or scroll bar. The hook procedure monitors these messages for all applications in the same desktop as the calling thread. For more information, see the SysMsgProc hook procedure.
WH_MOUSE | 7 | Installs a hook procedure that monitors mouse messages. For more information, see the MouseProc hook procedure.
WH_HARDWARE | 8 |
WH_DEBUG | 9 | Installs a hook procedure useful for debugging other hook procedures. For more information, see the DebugProc hook procedure.
WH_SHELL | 10 | Installs a hook procedure that monitors messages generated as a result of an input event in a dialog box, message box, menu, or scroll bar. The hook procedure monitors these messages for all applications in the same desktop as the calling thread. For more information, see the SysMsgProc hook procedure.
WH_FOREGROUNDIDLE | 11 | Installs a hook procedure that will be called when the application's foreground thread is about to become idle. This hook is useful for performing low priority tasks during idle time. For more information, see the ForegroundIdleProc hook procedure.
WH_CALLWNDPROCRET | 12 | Installs a hook procedure that monitors messages after they have been processed by the destination window procedure. For more information, see the CallWndRetProc hook procedure.
WH_KEYBOARD_LL | 13 | Installs a hook procedure that monitors low-level keyboard input events. For more information, see the LowLevelKeyboardProc hook procedure.
WH_MOUSE_LL | 14 | Installs a hook procedure that monitors low-level mouse input events. For more information, see the LowLevelMouseProc hook procedure.
See Also

Reference

Bncs.SysUtils Namespace


HwndInfo Class

HwndInfo Class
Class that encapsulates a Window with properties for handle, class name, caption and process.
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsHwndInfo

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class HwndInfo

The HwndInfo type exposes the following members.

Constructors
 | Name | Description
Public method | HwndInfo(Process) | Constructor whereby the process is known.
Public method | HwndInfo(IntPtr) | Constructor whereby the class name is unknown and the process is required.
Public method | HwndInfo(IntPtr, Boolean) | Constructor whereby the class name is unknown and the process is requirement is optional.
Public method | HwndInfo(IntPtr, String) | Constructor whereby the class name is known and the process is required.
Public method | HwndInfo(IntPtr, String, Boolean) | Constructor whereby the class name is known and the process is requirement is optional.
Top
Methods
 | Name | Description
Public method | Close | Terminates the process associated with the window instance.
Public method | Close(Int32, Boolean) | Terminates the process associated with the window instance, a time out may passed along with a kill option.
Public method | Equals | Ascertains if the supplied object is equal to THIS. (Overrides ObjectEquals(Object).)
Public method | GetHashCode | Gets the hash code (Overrides ObjectGetHashCode.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Kill | Kills the process ungracefully.
Public method | Maximise | Maximises the window to full screen.
Public method | Minimise | Minimises the window by sending it to the task bar.
Public method | Restore | Restores the window to it's former size and position.
Public method | Snapshot | Takes a snapshot of the window providing it is visible on the desktop.
Public method | Snapshot(HwndSnapshotResult) | Takes a snapshot of the window providing it is visible on the desktop.
Public method | ToString | Gets the instance as a string. (Overrides ObjectToString.)
Top
Properties
 | Name | Description
Public property | AllChildCount | Gets the total number of all children
Public property | AncestorIcon | Traverses up the ancestoral tree to get an icon.
Public property | AppropriateName | Gets an approriate display name for the window, ideally the caption else the class name.
Public property | Caption | Gets the window title bar text.
Public property | Children | Gets the child windows
Public property | Classname | Gets the class name.
Public property | HexHandle | Gets the window handle as a hex string.
Public property | Hwnd | Gets the window handle as an IntPtr.
Public property | Icon | Gets the window icon.
Public property | IsTopLevelWindow | Gets a flag betraying if this window is a top level window or not.
Public property | IsVisible | Returns true if the window is visible on screen.
Public property | Parent | Gets this windows parent window, top level windows will always return null
Public property | Process | Gets the process.
Public property | ShowState | Gets the current show state of the window.
Public property | TopLevelChildCount | Gets the number of top level children
Public property | UintHandle | Gets the window handle as a uint.
Top
Events
 | Name | Description
Public event | OnExit | Fires when the process exits.
Top
See Also

Reference

Bncs.SysUtils Namespace


HwndInfo Constructor

HwndInfo Constructor
Overload List
 | Name | Description
Public method | HwndInfo(Process) | Constructor whereby the process is known.
Public method | HwndInfo(IntPtr) | Constructor whereby the class name is unknown and the process is required.
Public method | HwndInfo(IntPtr, Boolean) | Constructor whereby the class name is unknown and the process is requirement is optional.
Public method | HwndInfo(IntPtr, String) | Constructor whereby the class name is known and the process is required.
Public method | HwndInfo(IntPtr, String, Boolean) | Constructor whereby the class name is known and the process is requirement is optional.
Top
See Also

Reference

HwndInfo Class
Bncs.SysUtils Namespace


HwndInfo Constructor (Process)

HwndInfo Constructor (Process)
Constructor whereby the process is known.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public HwndInfo(
    Process process_
)

Parameters

process_
Type: System.DiagnosticsProcess
Process from which to get the window handle.
See Also

Reference

HwndInfo Class
HwndInfo Overload
Bncs.SysUtils Namespace


HwndInfo Constructor (IntPtr)

HwndInfo Constructor (IntPtr)
Constructor whereby the class name is unknown and the process is required.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public HwndInfo(
    IntPtr hwnd_
)

Parameters

hwnd_
Type: SystemIntPtr
Window handle
See Also

Reference

HwndInfo Class
HwndInfo Overload
Bncs.SysUtils Namespace


HwndInfo Constructor (IntPtr, Boolean)

HwndInfo Constructor (IntPtr, Boolean)
Constructor whereby the class name is unknown and the process is requirement is optional.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public HwndInfo(
    IntPtr hwnd_,
    bool getProcess_
)

Parameters

hwnd_
Type: SystemIntPtr
Window handle
getProcess_
Type: SystemBoolean
Find process flag
See Also

Reference

HwndInfo Class
HwndInfo Overload
Bncs.SysUtils Namespace


HwndInfo Constructor (IntPtr, String)

HwndInfo Constructor (IntPtr, String)
Constructor whereby the class name is known and the process is required.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public HwndInfo(
    IntPtr hwnd_,
    string className_
)

Parameters

hwnd_
Type: SystemIntPtr
Window handle
className_
Type: SystemString
Class name
See Also

Reference

HwndInfo Class
HwndInfo Overload
Bncs.SysUtils Namespace


HwndInfo Constructor (IntPtr, String, Boolean)

HwndInfo Constructor (IntPtr, String, Boolean)
Constructor whereby the class name is known and the process is requirement is optional.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public HwndInfo(
    IntPtr hwnd_,
    string className_,
    bool getProcess_
)

Parameters

hwnd_
Type: SystemIntPtr
Window handle
className_
Type: SystemString
Class name
getProcess_
Type: SystemBoolean
Find process flag
See Also

Reference

HwndInfo Class
HwndInfo Overload
Bncs.SysUtils Namespace


HwndInfo Methods

HwndInfo Methods

The HwndInfo type exposes the following members.

Methods
 | Name | Description
Public method | Close | Terminates the process associated with the window instance.
Public method | Close(Int32, Boolean) | Terminates the process associated with the window instance, a time out may passed along with a kill option.
Public method | Equals | Ascertains if the supplied object is equal to THIS. (Overrides ObjectEquals(Object).)
Public method | GetHashCode | Gets the hash code (Overrides ObjectGetHashCode.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Kill | Kills the process ungracefully.
Public method | Maximise | Maximises the window to full screen.
Public method | Minimise | Minimises the window by sending it to the task bar.
Public method | Restore | Restores the window to it's former size and position.
Public method | Snapshot | Takes a snapshot of the window providing it is visible on the desktop.
Public method | Snapshot(HwndSnapshotResult) | Takes a snapshot of the window providing it is visible on the desktop.
Public method | ToString | Gets the instance as a string. (Overrides ObjectToString.)
Top
See Also

Reference

HwndInfo Class
Bncs.SysUtils Namespace


HwndInfo.Close Method

HwndInfoClose Method
Overload List
 | Name | Description
Public method | Close | Terminates the process associated with the window instance.
Public method | Close(Int32, Boolean) | Terminates the process associated with the window instance, a time out may passed along with a kill option.
Top
See Also

Reference

HwndInfo Class
Bncs.SysUtils Namespace


HwndInfo.Close Method

HwndInfoClose Method
Terminates the process associated with the window instance.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public HwndTerminateResult Close()

Return Value

Type: HwndTerminateResult
A value indicating success, failure, not running, null or error
See Also

Reference

HwndInfo Class
Close Overload
Bncs.SysUtils Namespace


HwndInfo.Close Method (Int32, Boolean)

HwndInfoClose Method (Int32, Boolean)
Terminates the process associated with the window instance, a time out may passed along with a kill option.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public HwndTerminateResult Close(
    int timeOutMilliseconds_,
    bool killOnFailure_
)

Parameters

timeOutMilliseconds_
Type: SystemInt32
Time out in milliseconds, if less than 1 this value is ignored.
killOnFailure_
Type: SystemBoolean
If true and the process fails to close then the process is killed.

Return Value

Type: HwndTerminateResult
A value indicating success, failure, killed, not running, null or error
See Also

Reference

HwndInfo Class
Close Overload
Bncs.SysUtils Namespace


HwndInfo.Equals Method

HwndInfoEquals Method
Ascertains if the supplied object is equal to THIS.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override bool Equals(
    Object obj
)

Parameters

obj
Type: SystemObject
Object to compare

Return Value

Type: Boolean
True if obj is of type HwndInfo and it's Hwnd property is equal to this instances Hwnd property.
See Also

Reference

HwndInfo Class
Bncs.SysUtils Namespace


HwndInfo.GetHashCode Method

HwndInfoGetHashCode Method
Gets the hash code

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override int GetHashCode()

Return Value

Type: Int32
The hash code
See Also

Reference

HwndInfo Class
Bncs.SysUtils Namespace


HwndInfo.Kill Method

HwndInfoKill Method
Kills the process ungracefully.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public HwndTerminateResult Kill()

Return Value

Type: HwndTerminateResult
A value indicating killed, not running, null or error
See Also

Reference

HwndInfo Class
Bncs.SysUtils Namespace


HwndInfo.Maximise Method

HwndInfoMaximise Method
Maximises the window to full screen.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Maximise()
See Also

Reference

HwndInfo Class
Bncs.SysUtils Namespace


HwndInfo.Minimise Method

HwndInfoMinimise Method
Minimises the window by sending it to the task bar.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Minimise()
See Also

Reference

HwndInfo Class
Bncs.SysUtils Namespace


HwndInfo.Restore Method

HwndInfoRestore Method
Restores the window to it's former size and position.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Restore()
See Also

Reference

HwndInfo Class
Bncs.SysUtils Namespace


HwndInfo.Snapshot Method

HwndInfoSnapshot Method
Overload List
 | Name | Description
Public method | Snapshot | Takes a snapshot of the window providing it is visible on the desktop.
Public method | Snapshot(HwndSnapshotResult) | Takes a snapshot of the window providing it is visible on the desktop.
Top
See Also

Reference

HwndInfo Class
Bncs.SysUtils Namespace


HwndInfo.Snapshot Method

HwndInfoSnapshot Method
Takes a snapshot of the window providing it is visible on the desktop.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Picture Snapshot()

Return Value

Type: Picture
A Picture object on success or null on failure.
See Also

Reference

HwndInfo Class
Snapshot Overload
Bncs.SysUtils Namespace


HwndInfo.Snapshot Method (HwndSnapshotResult)

HwndInfoSnapshot Method (HwndSnapshotResult)
Takes a snapshot of the window providing it is visible on the desktop.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Picture Snapshot(
    out HwndSnapshotResult errorLevel_
)

Parameters

errorLevel_
Type: Bncs.SysUtilsHwndSnapshotResult
An error level value pertinent on failure only.

Return Value

Type: Picture
A Picture object on success or null on failure.
See Also

Reference

HwndInfo Class
Snapshot Overload
Bncs.SysUtils Namespace


HwndInfo.ToString Method

HwndInfoToString Method
Gets the instance as a string.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
Hex handle, int handle, class name, caption and , if known, the process ID.
See Also

Reference

HwndInfo Class
Bncs.SysUtils Namespace


HwndInfo Properties

HwndInfo Properties

The HwndInfo type exposes the following members.

Properties
 | Name | Description
Public property | AllChildCount | Gets the total number of all children
Public property | AncestorIcon | Traverses up the ancestoral tree to get an icon.
Public property | AppropriateName | Gets an approriate display name for the window, ideally the caption else the class name.
Public property | Caption | Gets the window title bar text.
Public property | Children | Gets the child windows
Public property | Classname | Gets the class name.
Public property | HexHandle | Gets the window handle as a hex string.
Public property | Hwnd | Gets the window handle as an IntPtr.
Public property | Icon | Gets the window icon.
Public property | IsTopLevelWindow | Gets a flag betraying if this window is a top level window or not.
Public property | IsVisible | Returns true if the window is visible on screen.
Public property | Parent | Gets this windows parent window, top level windows will always return null
Public property | Process | Gets the process.
Public property | ShowState | Gets the current show state of the window.
Public property | TopLevelChildCount | Gets the number of top level children
Public property | UintHandle | Gets the window handle as a uint.
Top
See Also

Reference

HwndInfo Class
Bncs.SysUtils Namespace


HwndInfo.AllChildCount Property

HwndInfoAllChildCount Property
Gets the total number of all children

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int AllChildCount { get; }

Property Value

Type: Int32
See Also

Reference

HwndInfo Class
Bncs.SysUtils Namespace


HwndInfo.AncestorIcon Property

HwndInfoAncestorIcon Property
Traverses up the ancestoral tree to get an icon.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Icon AncestorIcon { get; }

Property Value

Type: Icon
See Also

Reference

HwndInfo Class
Bncs.SysUtils Namespace


HwndInfo.AppropriateName Property

HwndInfoAppropriateName Property
Gets an approriate display name for the window, ideally the caption else the class name.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string AppropriateName { get; }

Property Value

Type: String
See Also

Reference

HwndInfo Class
Bncs.SysUtils Namespace


HwndInfo.Caption Property

HwndInfoCaption Property
Gets the window title bar text.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Caption { get; }

Property Value

Type: String
See Also

Reference

HwndInfo Class
Bncs.SysUtils Namespace


HwndInfo.Children Property

HwndInfoChildren Property
Gets the child windows

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<HwndInfo> Children { get; }

Property Value

Type: List HwndInfo
See Also

Reference

HwndInfo Class
Bncs.SysUtils Namespace


HwndInfo.Classname Property

HwndInfoClassname Property
Gets the class name.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Classname { get; }

Property Value

Type: String
See Also

Reference

HwndInfo Class
Bncs.SysUtils Namespace


HwndInfo.HexHandle Property

HwndInfoHexHandle Property
Gets the window handle as a hex string.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string HexHandle { get; }

Property Value

Type: String
See Also

Reference

HwndInfo Class
Bncs.SysUtils Namespace


HwndInfo.Hwnd Property

HwndInfoHwnd Property
Gets the window handle as an IntPtr.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public IntPtr Hwnd { get; }

Property Value

Type: IntPtr
See Also

Reference

HwndInfo Class
Bncs.SysUtils Namespace


HwndInfo.Icon Property

HwndInfoIcon Property
Gets the window icon.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Icon Icon { get; }

Property Value

Type: Icon
See Also

Reference

HwndInfo Class
Bncs.SysUtils Namespace


HwndInfo.IsTopLevelWindow Property

HwndInfoIsTopLevelWindow Property
Gets a flag betraying if this window is a top level window or not.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool IsTopLevelWindow { get; }

Property Value

Type: Boolean
See Also

Reference

HwndInfo Class
Bncs.SysUtils Namespace


HwndInfo.IsVisible Property

HwndInfoIsVisible Property
Returns true if the window is visible on screen.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool IsVisible { get; }

Property Value

Type: Boolean
See Also

Reference

HwndInfo Class
Bncs.SysUtils Namespace


HwndInfo.Parent Property

HwndInfoParent Property
Gets this windows parent window, top level windows will always return null

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public HwndInfo Parent { get; }

Property Value

Type: HwndInfo
See Also

Reference

HwndInfo Class
Bncs.SysUtils Namespace


HwndInfo.Process Property

HwndInfoProcess Property
Gets the process.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Process Process { get; }

Property Value

Type: Process
See Also

Reference

HwndInfo Class
Bncs.SysUtils Namespace


HwndInfo.ShowState Property

HwndInfoShowState Property
Gets the current show state of the window.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ShowWindowCommands ShowState { get; }

Property Value

Type: ShowWindowCommands
See Also

Reference

HwndInfo Class
Bncs.SysUtils Namespace


HwndInfo.TopLevelChildCount Property

HwndInfoTopLevelChildCount Property
Gets the number of top level children

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int TopLevelChildCount { get; }

Property Value

Type: Int32
See Also

Reference

HwndInfo Class
Bncs.SysUtils Namespace


HwndInfo.UintHandle Property

HwndInfoUintHandle Property
Gets the window handle as a uint.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint UintHandle { get; }

Property Value

Type: UInt32
See Also

Reference

HwndInfo Class
Bncs.SysUtils Namespace


HwndInfo Events

HwndInfo Events

The HwndInfo type exposes the following members.

Events
 | Name | Description
Public event | OnExit | Fires when the process exits.
Top
See Also

Reference

HwndInfo Class
Bncs.SysUtils Namespace


HwndInfo.OnExit Event

HwndInfoOnExit Event
Fires when the process exits.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event EventHandler OnExit

Value

Type: SystemEventHandler
See Also

Reference

HwndInfo Class
Bncs.SysUtils Namespace


HwndMonitor Class

HwndMonitor Class
Class that reports event driven changes pertaining to the active window and window move, resize and caption text change. By default the classes events are fired for any window that calls back into the object. However if the object has at least one window handle added to it's internal windows to monitor list the events will only fire when called from these windows.
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsHwndMonitor

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class HwndMonitor

The HwndMonitor type exposes the following members.

Constructors
 | Name | Description
Public method | HwndMonitor | Initializes a new instance of the HwndMonitor class
Top
Methods
 | Name | Description
Public method | AddWindowInstanceToMonitor | Adds a specific window instance to the list of windows to monitor, only windows raising events on this list will cause the objects event handlers to fire. If none are added then they will fire for any calling window.
Public method | ClearWindowsToMonitor | Clears the internal list of windows to monitor; hence enabling any window calling in to this object to fire events.
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Events
 | Name | Description
Public event | OnActiveWindowChange | Event handler that fires when the active window changes.
Public event | OnWindowMoveResizeChange | Event handler that fires when a window is moved or resized.
Public event | OnWindowNameChanged | Event handler that fires when a windows main caption text changes.
Top
See Also

Reference

Bncs.SysUtils Namespace


HwndMonitor Constructor

HwndMonitor Constructor
Initializes a new instance of the HwndMonitor class

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public HwndMonitor()
See Also

Reference

HwndMonitor Class
Bncs.SysUtils Namespace


HwndMonitor Methods

HwndMonitor Methods

The HwndMonitor type exposes the following members.

Methods
 | Name | Description
Public method | AddWindowInstanceToMonitor | Adds a specific window instance to the list of windows to monitor, only windows raising events on this list will cause the objects event handlers to fire. If none are added then they will fire for any calling window.
Public method | ClearWindowsToMonitor | Clears the internal list of windows to monitor; hence enabling any window calling in to this object to fire events.
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

HwndMonitor Class
Bncs.SysUtils Namespace


HwndMonitor.AddWindowInstanceToMonitor Method

HwndMonitorAddWindowInstanceToMonitor Method
Adds a specific window instance to the list of windows to monitor, only windows raising events on this list will cause the objects event handlers to fire. If none are added then they will fire for any calling window.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool AddWindowInstanceToMonitor(
    IntPtr hwnd_
)

Parameters

hwnd_
Type: SystemIntPtr
Window to monitor

Return Value

Type: Boolean

[Missing <returns> documentation for "M:Bncs.SysUtils.HwndMonitor.AddWindowInstanceToMonitor(System.IntPtr)"]

See Also

Reference

HwndMonitor Class
Bncs.SysUtils Namespace


HwndMonitor.ClearWindowsToMonitor Method

HwndMonitorClearWindowsToMonitor Method
Clears the internal list of windows to monitor; hence enabling any window calling in to this object to fire events.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void ClearWindowsToMonitor()
See Also

Reference

HwndMonitor Class
Bncs.SysUtils Namespace


HwndMonitor Events

HwndMonitor Events

The HwndMonitor type exposes the following members.

Events
 | Name | Description
Public event | OnActiveWindowChange | Event handler that fires when the active window changes.
Public event | OnWindowMoveResizeChange | Event handler that fires when a window is moved or resized.
Public event | OnWindowNameChanged | Event handler that fires when a windows main caption text changes.
Top
See Also

Reference

HwndMonitor Class
Bncs.SysUtils Namespace


HwndMonitor.OnActiveWindowChange Event

HwndMonitorOnActiveWindowChange Event
Event handler that fires when the active window changes.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnWindowUpdateEventHandler OnActiveWindowChange

Value

Type: Bncs.SysUtilsOnWindowUpdateEventHandler
See Also

Reference

HwndMonitor Class
Bncs.SysUtils Namespace


HwndMonitor.OnWindowMoveResizeChange Event

HwndMonitorOnWindowMoveResizeChange Event
Event handler that fires when a window is moved or resized.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnWindowUpdateEventHandler OnWindowMoveResizeChange

Value

Type: Bncs.SysUtilsOnWindowUpdateEventHandler
See Also

Reference

HwndMonitor Class
Bncs.SysUtils Namespace


HwndMonitor.OnWindowNameChanged Event

HwndMonitorOnWindowNameChanged Event
Event handler that fires when a windows main caption text changes.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnWindowUpdateEventHandler OnWindowNameChanged

Value

Type: Bncs.SysUtilsOnWindowUpdateEventHandler
See Also

Reference

HwndMonitor Class
Bncs.SysUtils Namespace


HwndSnapshotResult Enumeration

HwndSnapshotResult Enumeration
The type of result for HwndInfo.Snapshot() method.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum HwndSnapshotResult
Members
Member name | Value | Description
Success | 0 | The operation succeeded
Failure | 1 | The operation failed
WindowNotVisible | 2 | The operation failed because the target window was not visible on the desktop.
See Also

Reference

Bncs.SysUtils Namespace


HwndTerminateResult Enumeration

HwndTerminateResult Enumeration
Result of the HwndInfo.Terminate() method

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum HwndTerminateResult
Members
Member name | Value | Description
Success | 0 | The process closed gracefully
Killed | 1 | The process had to be killed
Failure | 2 | The process failed to close.
NotRunning | 3 | The process is not running.
Null | 4 | The process is null.
Error | 5 | An error occured.
See Also

Reference

Bncs.SysUtils Namespace


IconLoadBehaviour Enumeration

IconLoadBehaviour Enumeration
Enumerator that dictates the behaviour of LinkFile in respect of icons.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum IconLoadBehaviour
Members
Member name | Value | Description
IgnoreExternalICOFile | 0 | Any external file, ie LinkFileName.ICO is ignored.
SecondaryExternalIconFile | 1 | If the embedded icon is null the LinkFile will seek LinkFileName.ICO and attempt to load an icon.
PrimaryExternalIconFile | 2 | LinkFile will seek LinkFileName.ico and attempt to load an icon, if not found or null it will then resort to the embedded icon.
See Also

Reference

Bncs.SysUtils Namespace


INIFile Class

INIFile Class
Class representing an INI file. May be populated from an INI file or an XML file
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsINIFile

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class INIFile

The INIFile type exposes the following members.

Constructors
Name Description
INIFile(String)
Constructor with file name (can be INI or XML). WriteMode is Memory, section names and keys are case insensitive and text is not formatted if WriteMode is changed to Disk.
Examples
This code demonstrates the objects most commonly used constructor.
Copy
class Program
{
    static void Main()
    {
        INIFile iniFile = new INIFile(@"c:\test.ini");
    }
}
Public method INIFile(XDocument)
Constructor with XML document. WriteMode is Memory, section names and keys are case insensitive and text is not formatted if WriteMode is changed to Disk.
Public method INIFile(String, WriteMode)
Constructor with file name (can be INI or XML). WriteMode is set by argument, section names and keys are case insensitive and text is not formatted if WriteMode is Disk. formatted if WriteMode is changed to Disk.
Public method INIFile(String, Boolean)
Constructor with file name (can be INI or XML). Section names and keys are case (in)sensitive according to case sensitive argument, WriteMode is Memory and text is not formatted if WriteMode is changed to Disk.
Public method INIFile(XDocument, WriteMode)
Constructor with XML document. WriteMode is set by argument, section names and keys are case insensitive and text is not formatted if WriteMode is Disk. formatted if WriteMode is changed to Disk.
Public method INIFile(XDocument, Boolean)
Constructor with XML document. Section names and keys are case (in)sensitive according to case sensitive argument, WriteMode is Memory and text is not formatted if WriteMode is changed to Disk.
Public method INIFile(String, Boolean, WriteMode)
Constructor with file name (can be INI or XML). Section names and keys are case (in)sensitive according to case sensitive argument, WriteMode is set by argument and and text is not formatted if WriteMode is Disk.
Public method INIFile(String, Boolean, Boolean)
Constructor with file name (can be INI or XML). Section names and keys are case (in)sensitive according to case sensitive argument, text is formatted or not according to argument if WriteMode is changed to Disk and WriteMode is Memory
Public method INIFile(XDocument, Boolean, WriteMode)
Constructor with XML documente. Section names and keys are case (in)sensitive according to case sensitive argument, WriteMode is set by argument and and text is not formatted if WriteMode is Disk.
Public method INIFile(XDocument, Boolean, Boolean)
Constructor with XML document. Section names and keys are case (in)sensitive according to case sensitive argument,text is formatted or not according to argument if WriteMode is changed to Disk and WriteMode is Memory
Public method INIFile(String, Boolean, Boolean, WriteMode)
Constructor with file name (can be INI or XML). Section names and keys are case (in)sensitive according to case sensitive argument, WriteMode is set by argument as is case sensitivity and formatted text when WriteMode is Disk.
Public method INIFile(XDocument, Boolean, Boolean, WriteMode)
Constructor with XML document. Section names and keys are case (in)sensitive according to case sensitive argument, WriteMode is set by argument as is case sensitivity and formatted text when WriteMode is Disk.
Top
Methods
Name Description
Public method ConvertToXmlDocument
Generates an XML document version of the INI file.
Public method Equals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public method EraseSection
Deletes the entire section specified.
Public method EraseSetting
Deletes the setting specified by section and key.
Public method GetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public method GetSectionNames
Reads all section names in the INI file.
Public method GetSectionNames(Boolean)
Reads all section names in the INI file.
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
ReadBool
Reads a boolean value from the INI file. Valid boolean true values are "1", "true" or any value that can convert to an integer bar "0". Valid boolean false values are "0" or "false"
Examples
This code is an example of writing to and reading from an INIFile object.
Copy
class Program
{
    static void Main()
    {
        Console.WriteLine("Writing INI file, press any key to read");
        WriteINI();
        Console.ReadKey();
        ReadINI();
        Console.ReadKey();
    }

    static void WriteINI()
    {
        // Create an INI file
        INIFile iniFile = new INIFile(@"c:\test.ini");
        // Write some boolean, string and integral values to it
        iniFile.WriteBool("FLAGS", "active", true);
        iniFile.WriteBool("FLAGS", "monitor", false);
        iniFile.WriteString("DATA", "department", "Sales");
        iniFile.WriteInt("DATA", "employees", 13);

        // Set up a phoney employee database
        string[] employee1 = { "Rod", "M", "28" };
        string[] employee2 = { "Jane", "F", "21" };
        string[] employee3 = { "Freddie", "M", "31" };
        string[][] employees = new string[3][];
        employees[0] = employee1;
        employees[1] = employee2;
        employees[2] = employee3;

        // Write employee data out to the INI file.
        int index = -1;
        foreach (string[] employee in employees)
        {
            iniFile.WriteString("EMPLOYEES", "emp#" + ((int)(++index)).ToString(), employee[0]);
            iniFile.WriteString("EMPLOYEES", "gen#" + ((int)(index)).ToString(), employee[1]);
            iniFile.WriteInt("EMPLOYEES", "age#" + ((int)(index)).ToString(), Int32.Parse(employee[2]));
        }

        // Save the INI file
        iniFile.Save();
    }

    static void ReadINI()
    {
        // Check the file exists
        if (FileFuncs.Exists(@"c:\test.ini"))
        {
            // Create the INI file
            INIFile iniFile = new INIFile(@"c:\test.ini");
            // Write some boolean, string and integral values from it to the console
            Console.WriteLine(iniFile.ReadBool("FLAGS", "active", false) ? "Active is ON" : "Active is OFF");
            Console.WriteLine(iniFile.ReadBool("FLAGS", "monitor", false) ? "Monitor is ON" : "Monitor is OFF");
            Console.WriteLine("Department is " + iniFile.ReadString("DATA", "department", "unknown"));
            Console.WriteLine("Employee count is " + iniFile.ReadInt("DATA", "employees", 0).ToString());

            // See how many entries there are in the "EMPLOYEES" section.
            int count = iniFile.ReadSection("EMPLOYEES").Count;
            int index = 0;
            // Loop until we've printed all data from the INI file onto the console.
            while (index < count / 3)
            {
                Console.WriteLine("Name: " + iniFile.ReadString("EMPLOYEES", "emp#" + index.ToString(), "anonymous"));
                Console.WriteLine("Gender: " + iniFile.ReadString("EMPLOYEES", "gen#" + index.ToString(), "?"));
                Console.WriteLine("Age: " + iniFile.ReadInt("EMPLOYEES", "age#" + index.ToString(), 0).ToString());
                ++index;
            }
        }
        else
            Console.WriteLine(@"c:\test.ini file not found.");
    }
}
Public method ReadDouble
Reads a double value from the INI file
ReadInt
Reads an integer value from the INI file
Examples
This code is an example of writing to and reading from an INIFile object.
Copy
class Program
{
    static void Main()
    {
        Console.WriteLine("Writing INI file, press any key to read");
        WriteINI();
        Console.ReadKey();
        ReadINI();
        Console.ReadKey();
    }

    static void WriteINI()
    {
        // Create an INI file
        INIFile iniFile = new INIFile(@"c:\test.ini");
        // Write some boolean, string and integral values to it
        iniFile.WriteBool("FLAGS", "active", true);
        iniFile.WriteBool("FLAGS", "monitor", false);
        iniFile.WriteString("DATA", "department", "Sales");
        iniFile.WriteInt("DATA", "employees", 13);

        // Set up a phoney employee database
        string[] employee1 = { "Rod", "M", "28" };
        string[] employee2 = { "Jane", "F", "21" };
        string[] employee3 = { "Freddie", "M", "31" };
        string[][] employees = new string[3][];
        employees[0] = employee1;
        employees[1] = employee2;
        employees[2] = employee3;

        // Write employee data out to the INI file.
        int index = -1;
        foreach (string[] employee in employees)
        {
            iniFile.WriteString("EMPLOYEES", "emp#" + ((int)(++index)).ToString(), employee[0]);
            iniFile.WriteString("EMPLOYEES", "gen#" + ((int)(index)).ToString(), employee[1]);
            iniFile.WriteInt("EMPLOYEES", "age#" + ((int)(index)).ToString(), Int32.Parse(employee[2]));
        }

        // Save the INI file
        iniFile.Save();
    }

    static void ReadINI()
    {
        // Check the file exists
        if (FileFuncs.Exists(@"c:\test.ini"))
        {
            // Create the INI file
            INIFile iniFile = new INIFile(@"c:\test.ini");
            // Write some boolean, string and integral values from it to the console
            Console.WriteLine(iniFile.ReadBool("FLAGS", "active", false) ? "Active is ON" : "Active is OFF");
            Console.WriteLine(iniFile.ReadBool("FLAGS", "monitor", false) ? "Monitor is ON" : "Monitor is OFF");
            Console.WriteLine("Department is " + iniFile.ReadString("DATA", "department", "unknown"));
            Console.WriteLine("Employee count is " + iniFile.ReadInt("DATA", "employees", 0).ToString());

            // See how many entries there are in the "EMPLOYEES" section.
            int count = iniFile.ReadSection("EMPLOYEES").Count;
            int index = 0;
            // Loop until we've printed all data from the INI file onto the console.
            while (index < count / 3)
            {
                Console.WriteLine("Name: " + iniFile.ReadString("EMPLOYEES", "emp#" + index.ToString(), "anonymous"));
                Console.WriteLine("Gender: " + iniFile.ReadString("EMPLOYEES", "gen#" + index.ToString(), "?"));
                Console.WriteLine("Age: " + iniFile.ReadInt("EMPLOYEES", "age#" + index.ToString(), 0).ToString());
                ++index;
            }
        }
        else
            Console.WriteLine(@"c:\test.ini file not found.");
    }
}
ReadSection
Reads all values from the supplied Section
Examples
This code is an example of writing to and reading from an INIFile object.
Copy
class Program
{
    static void Main()
    {
        Console.WriteLine("Writing INI file, press any key to read");
        WriteINI();
        Console.ReadKey();
        ReadINI();
        Console.ReadKey();
    }

    static void WriteINI()
    {
        // Create an INI file
        INIFile iniFile = new INIFile(@"c:\test.ini");
        // Write some boolean, string and integral values to it
        iniFile.WriteBool("FLAGS", "active", true);
        iniFile.WriteBool("FLAGS", "monitor", false);
        iniFile.WriteString("DATA", "department", "Sales");
        iniFile.WriteInt("DATA", "employees", 13);

        // Set up a phoney employee database
        string[] employee1 = { "Rod", "M", "28" };
        string[] employee2 = { "Jane", "F", "21" };
        string[] employee3 = { "Freddie", "M", "31" };
        string[][] employees = new string[3][];
        employees[0] = employee1;
        employees[1] = employee2;
        employees[2] = employee3;

        // Write employee data out to the INI file.
        int index = -1;
        foreach (string[] employee in employees)
        {
            iniFile.WriteString("EMPLOYEES", "emp#" + ((int)(++index)).ToString(), employee[0]);
            iniFile.WriteString("EMPLOYEES", "gen#" + ((int)(index)).ToString(), employee[1]);
            iniFile.WriteInt("EMPLOYEES", "age#" + ((int)(index)).ToString(), Int32.Parse(employee[2]));
        }

        // Save the INI file
        iniFile.Save();
    }

    static void ReadINI()
    {
        // Check the file exists
        if (FileFuncs.Exists(@"c:\test.ini"))
        {
            // Create the INI file
            INIFile iniFile = new INIFile(@"c:\test.ini");
            // Write some boolean, string and integral values from it to the console
            Console.WriteLine(iniFile.ReadBool("FLAGS", "active", false) ? "Active is ON" : "Active is OFF");
            Console.WriteLine(iniFile.ReadBool("FLAGS", "monitor", false) ? "Monitor is ON" : "Monitor is OFF");
            Console.WriteLine("Department is " + iniFile.ReadString("DATA", "department", "unknown"));
            Console.WriteLine("Employee count is " + iniFile.ReadInt("DATA", "employees", 0).ToString());

            // See how many entries there are in the "EMPLOYEES" section.
            int count = iniFile.ReadSection("EMPLOYEES").Count;
            int index = 0;
            // Loop until we've printed all data from the INI file onto the console.
            while (index < count / 3)
            {
                Console.WriteLine("Name: " + iniFile.ReadString("EMPLOYEES", "emp#" + index.ToString(), "anonymous"));
                Console.WriteLine("Gender: " + iniFile.ReadString("EMPLOYEES", "gen#" + index.ToString(), "?"));
                Console.WriteLine("Age: " + iniFile.ReadInt("EMPLOYEES", "age#" + index.ToString(), 0).ToString());
                ++index;
            }
        }
        else
            Console.WriteLine(@"c:\test.ini file not found.");
    }
}
Public method ReadSectionKeys
Reads all key names from the supplied Section
Public method ReadSectionText
Reads all text from the the supplied Section
ReadString
Reads a string value from the INI file
Examples
This code is an example of writing to and reading from an INIFile object.
Copy
class Program
{
    static void Main()
    {
        Console.WriteLine("Writing INI file, press any key to read");
        WriteINI();
        Console.ReadKey();
        ReadINI();
        Console.ReadKey();
    }

    static void WriteINI()
    {
        // Create an INI file
        INIFile iniFile = new INIFile(@"c:\test.ini");
        // Write some boolean, string and integral values to it
        iniFile.WriteBool("FLAGS", "active", true);
        iniFile.WriteBool("FLAGS", "monitor", false);
        iniFile.WriteString("DATA", "department", "Sales");
        iniFile.WriteInt("DATA", "employees", 13);

        // Set up a phoney employee database
        string[] employee1 = { "Rod", "M", "28" };
        string[] employee2 = { "Jane", "F", "21" };
        string[] employee3 = { "Freddie", "M", "31" };
        string[][] employees = new string[3][];
        employees[0] = employee1;
        employees[1] = employee2;
        employees[2] = employee3;

        // Write employee data out to the INI file.
        int index = -1;
        foreach (string[] employee in employees)
        {
            iniFile.WriteString("EMPLOYEES", "emp#" + ((int)(++index)).ToString(), employee[0]);
            iniFile.WriteString("EMPLOYEES", "gen#" + ((int)(index)).ToString(), employee[1]);
            iniFile.WriteInt("EMPLOYEES", "age#" + ((int)(index)).ToString(), Int32.Parse(employee[2]));
        }

        // Save the INI file
        iniFile.Save();
    }

    static void ReadINI()
    {
        // Check the file exists
        if (FileFuncs.Exists(@"c:\test.ini"))
        {
            // Create the INI file
            INIFile iniFile = new INIFile(@"c:\test.ini");
            // Write some boolean, string and integral values from it to the console
            Console.WriteLine(iniFile.ReadBool("FLAGS", "active", false) ? "Active is ON" : "Active is OFF");
            Console.WriteLine(iniFile.ReadBool("FLAGS", "monitor", false) ? "Monitor is ON" : "Monitor is OFF");
            Console.WriteLine("Department is " + iniFile.ReadString("DATA", "department", "unknown"));
            Console.WriteLine("Employee count is " + iniFile.ReadInt("DATA", "employees", 0).ToString());

            // See how many entries there are in the "EMPLOYEES" section.
            int count = iniFile.ReadSection("EMPLOYEES").Count;
            int index = 0;
            // Loop until we've printed all data from the INI file onto the console.
            while (index < count / 3)
            {
                Console.WriteLine("Name: " + iniFile.ReadString("EMPLOYEES", "emp#" + index.ToString(), "anonymous"));
                Console.WriteLine("Gender: " + iniFile.ReadString("EMPLOYEES", "gen#" + index.ToString(), "?"));
                Console.WriteLine("Age: " + iniFile.ReadInt("EMPLOYEES", "age#" + index.ToString(), 0).ToString());
                ++index;
            }
        }
        else
            Console.WriteLine(@"c:\test.ini file not found.");
    }
}
Public method Save
Saves the INI file to disk overwriting any existing file
Public method SaveAs
Changes the file name to that supplied and saves the INI file to disk overwriting any existing file
Public method SaveFormatted
Saves the INI file to disk overwriting any existing file but formats the text to exclude blank lines but insert blank lines between sections
Public method SaveFormattedAs
Changes the file name to that supplied and saves the INI file to disk overwriting any existing file but formats the text to exclude blank lines but insert blank lines between sections
Public method ToString
Returns a string representation of the object.
(Overrides ObjectToString.)
WriteBool
Writes a boolean value to the INI file, 1=true and 0=false, to the section and key supplied. If the section and/or key do not exist they are created.
Examples
This code is an example of writing to and reading from an INIFile object.
Copy
class Program
{
    static void Main()
    {
        Console.WriteLine("Writing INI file, press any key to read");
        WriteINI();
        Console.ReadKey();
        ReadINI();
        Console.ReadKey();
    }

    static void WriteINI()
    {
        // Create an INI file
        INIFile iniFile = new INIFile(@"c:\test.ini");
        // Write some boolean, string and integral values to it
        iniFile.WriteBool("FLAGS", "active", true);
        iniFile.WriteBool("FLAGS", "monitor", false);
        iniFile.WriteString("DATA", "department", "Sales");
        iniFile.WriteInt("DATA", "employees", 13);

        // Set up a phoney employee database
        string[] employee1 = { "Rod", "M", "28" };
        string[] employee2 = { "Jane", "F", "21" };
        string[] employee3 = { "Freddie", "M", "31" };
        string[][] employees = new string[3][];
        employees[0] = employee1;
        employees[1] = employee2;
        employees[2] = employee3;

        // Write employee data out to the INI file.
        int index = -1;
        foreach (string[] employee in employees)
        {
            iniFile.WriteString("EMPLOYEES", "emp#" + ((int)(++index)).ToString(), employee[0]);
            iniFile.WriteString("EMPLOYEES", "gen#" + ((int)(index)).ToString(), employee[1]);
            iniFile.WriteInt("EMPLOYEES", "age#" + ((int)(index)).ToString(), Int32.Parse(employee[2]));
        }

        // Save the INI file
        iniFile.Save();
    }

    static void ReadINI()
    {
        // Check the file exists
        if (FileFuncs.Exists(@"c:\test.ini"))
        {
            // Create the INI file
            INIFile iniFile = new INIFile(@"c:\test.ini");
            // Write some boolean, string and integral values from it to the console
            Console.WriteLine(iniFile.ReadBool("FLAGS", "active", false) ? "Active is ON" : "Active is OFF");
            Console.WriteLine(iniFile.ReadBool("FLAGS", "monitor", false) ? "Monitor is ON" : "Monitor is OFF");
            Console.WriteLine("Department is " + iniFile.ReadString("DATA", "department", "unknown"));
            Console.WriteLine("Employee count is " + iniFile.ReadInt("DATA", "employees", 0).ToString());

            // See how many entries there are in the "EMPLOYEES" section.
            int count = iniFile.ReadSection("EMPLOYEES").Count;
            int index = 0;
            // Loop until we've printed all data from the INI file onto the console.
            while (index < count / 3)
            {
                Console.WriteLine("Name: " + iniFile.ReadString("EMPLOYEES", "emp#" + index.ToString(), "anonymous"));
                Console.WriteLine("Gender: " + iniFile.ReadString("EMPLOYEES", "gen#" + index.ToString(), "?"));
                Console.WriteLine("Age: " + iniFile.ReadInt("EMPLOYEES", "age#" + index.ToString(), 0).ToString());
                ++index;
            }
        }
        else
            Console.WriteLine(@"c:\test.ini file not found.");
    }
}
Public method WriteBoolAsText
Writes a boolean as text to the INI file. If the section or key do not exist then they are created.
Public method WriteDouble
Writes a double value to the INI file to the section and key supplied. If the section and/or key do not exist they are created.
WriteInt
Writes an integer value to the INI file to the section and key supplied. If the section and/or key do not exist they are created.
Examples
This code is an example of writing to and reading from an INIFile object.
Copy
class Program
{
    static void Main()
    {
        Console.WriteLine("Writing INI file, press any key to read");
        WriteINI();
        Console.ReadKey();
        ReadINI();
        Console.ReadKey();
    }

    static void WriteINI()
    {
        // Create an INI file
        INIFile iniFile = new INIFile(@"c:\test.ini");
        // Write some boolean, string and integral values to it
        iniFile.WriteBool("FLAGS", "active", true);
        iniFile.WriteBool("FLAGS", "monitor", false);
        iniFile.WriteString("DATA", "department", "Sales");
        iniFile.WriteInt("DATA", "employees", 13);

        // Set up a phoney employee database
        string[] employee1 = { "Rod", "M", "28" };
        string[] employee2 = { "Jane", "F", "21" };
        string[] employee3 = { "Freddie", "M", "31" };
        string[][] employees = new string[3][];
        employees[0] = employee1;
        employees[1] = employee2;
        employees[2] = employee3;

        // Write employee data out to the INI file.
        int index = -1;
        foreach (string[] employee in employees)
        {
            iniFile.WriteString("EMPLOYEES", "emp#" + ((int)(++index)).ToString(), employee[0]);
            iniFile.WriteString("EMPLOYEES", "gen#" + ((int)(index)).ToString(), employee[1]);
            iniFile.WriteInt("EMPLOYEES", "age#" + ((int)(index)).ToString(), Int32.Parse(employee[2]));
        }

        // Save the INI file
        iniFile.Save();
    }

    static void ReadINI()
    {
        // Check the file exists
        if (FileFuncs.Exists(@"c:\test.ini"))
        {
            // Create the INI file
            INIFile iniFile = new INIFile(@"c:\test.ini");
            // Write some boolean, string and integral values from it to the console
            Console.WriteLine(iniFile.ReadBool("FLAGS", "active", false) ? "Active is ON" : "Active is OFF");
            Console.WriteLine(iniFile.ReadBool("FLAGS", "monitor", false) ? "Monitor is ON" : "Monitor is OFF");
            Console.WriteLine("Department is " + iniFile.ReadString("DATA", "department", "unknown"));
            Console.WriteLine("Employee count is " + iniFile.ReadInt("DATA", "employees", 0).ToString());

            // See how many entries there are in the "EMPLOYEES" section.
            int count = iniFile.ReadSection("EMPLOYEES").Count;
            int index = 0;
            // Loop until we've printed all data from the INI file onto the console.
            while (index < count / 3)
            {
                Console.WriteLine("Name: " + iniFile.ReadString("EMPLOYEES", "emp#" + index.ToString(), "anonymous"));
                Console.WriteLine("Gender: " + iniFile.ReadString("EMPLOYEES", "gen#" + index.ToString(), "?"));
                Console.WriteLine("Age: " + iniFile.ReadInt("EMPLOYEES", "age#" + index.ToString(), 0).ToString());
                ++index;
            }
        }
        else
            Console.WriteLine(@"c:\test.ini file not found.");
    }
}
WriteString
Writes a string value to the INI file to the section and key supplied. If the section and/or key do not exist they are created.
Examples
This code is an example of writing to and reading from an INIFile object.
Copy
class Program
{
    static void Main()
    {
        Console.WriteLine("Writing INI file, press any key to read");
        WriteINI();
        Console.ReadKey();
        ReadINI();
        Console.ReadKey();
    }

    static void WriteINI()
    {
        // Create an INI file
        INIFile iniFile = new INIFile(@"c:\test.ini");
        // Write some boolean, string and integral values to it
        iniFile.WriteBool("FLAGS", "active", true);
        iniFile.WriteBool("FLAGS", "monitor", false);
        iniFile.WriteString("DATA", "department", "Sales");
        iniFile.WriteInt("DATA", "employees", 13);

        // Set up a phoney employee database
        string[] employee1 = { "Rod", "M", "28" };
        string[] employee2 = { "Jane", "F", "21" };
        string[] employee3 = { "Freddie", "M", "31" };
        string[][] employees = new string[3][];
        employees[0] = employee1;
        employees[1] = employee2;
        employees[2] = employee3;

        // Write employee data out to the INI file.
        int index = -1;
        foreach (string[] employee in employees)
        {
            iniFile.WriteString("EMPLOYEES", "emp#" + ((int)(++index)).ToString(), employee[0]);
            iniFile.WriteString("EMPLOYEES", "gen#" + ((int)(index)).ToString(), employee[1]);
            iniFile.WriteInt("EMPLOYEES", "age#" + ((int)(index)).ToString(), Int32.Parse(employee[2]));
        }

        // Save the INI file
        iniFile.Save();
    }

    static void ReadINI()
    {
        // Check the file exists
        if (FileFuncs.Exists(@"c:\test.ini"))
        {
            // Create the INI file
            INIFile iniFile = new INIFile(@"c:\test.ini");
            // Write some boolean, string and integral values from it to the console
            Console.WriteLine(iniFile.ReadBool("FLAGS", "active", false) ? "Active is ON" : "Active is OFF");
            Console.WriteLine(iniFile.ReadBool("FLAGS", "monitor", false) ? "Monitor is ON" : "Monitor is OFF");
            Console.WriteLine("Department is " + iniFile.ReadString("DATA", "department", "unknown"));
            Console.WriteLine("Employee count is " + iniFile.ReadInt("DATA", "employees", 0).ToString());

            // See how many entries there are in the "EMPLOYEES" section.
            int count = iniFile.ReadSection("EMPLOYEES").Count;
            int index = 0;
            // Loop until we've printed all data from the INI file onto the console.
            while (index < count / 3)
            {
                Console.WriteLine("Name: " + iniFile.ReadString("EMPLOYEES", "emp#" + index.ToString(), "anonymous"));
                Console.WriteLine("Gender: " + iniFile.ReadString("EMPLOYEES", "gen#" + index.ToString(), "?"));
                Console.WriteLine("Age: " + iniFile.ReadInt("EMPLOYEES", "age#" + index.ToString(), 0).ToString());
                ++index;
            }
        }
        else
            Console.WriteLine(@"c:\test.ini file not found.");
    }
}
Top
Properties
 | Name | Description
Public property | Edited | Gets a value that betrays whether the file has been edited since it's last save.
Public property | Filename | Gets the file name of the INI file
Public property | ToText | Gets the full text listing of the INI file
Public property | WriteDefaultsToFileWhenReturned | Gets or sets a flag that when set ensures entries are written to disk when a default value is returned from any of the read methods. The default for this value is FALSE.
Public property | WriteMode | Gets or sets the write mode. This effects the behaviour of methods WriteString(), WriteInt(), WriteBool() and WriteBoolAsText(). When WriteMode is set to Disk the written value is saved to file else it only exists in memory until the Save() method is called.
Top
See Also

Reference

Bncs.SysUtils Namespace


INIFile Constructor

INIFile Constructor
Overload List
Name Description
INIFile(String)
Constructor with file name (can be INI or XML). WriteMode is Memory, section names and keys are case insensitive and text is not formatted if WriteMode is changed to Disk.
Examples
This code demonstrates the objects most commonly used constructor.
Copy
class Program
{
    static void Main()
    {
        INIFile iniFile = new INIFile(@"c:\test.ini");
    }
}
Public method INIFile(XDocument)
Constructor with XML document. WriteMode is Memory, section names and keys are case insensitive and text is not formatted if WriteMode is changed to Disk.
Public method INIFile(String, WriteMode)
Constructor with file name (can be INI or XML). WriteMode is set by argument, section names and keys are case insensitive and text is not formatted if WriteMode is Disk. formatted if WriteMode is changed to Disk.
Public method INIFile(String, Boolean)
Constructor with file name (can be INI or XML). Section names and keys are case (in)sensitive according to case sensitive argument, WriteMode is Memory and text is not formatted if WriteMode is changed to Disk.
Public method INIFile(XDocument, WriteMode)
Constructor with XML document. WriteMode is set by argument, section names and keys are case insensitive and text is not formatted if WriteMode is Disk. formatted if WriteMode is changed to Disk.
Public method INIFile(XDocument, Boolean)
Constructor with XML document. Section names and keys are case (in)sensitive according to case sensitive argument, WriteMode is Memory and text is not formatted if WriteMode is changed to Disk.
Public method INIFile(String, Boolean, WriteMode)
Constructor with file name (can be INI or XML). Section names and keys are case (in)sensitive according to case sensitive argument, WriteMode is set by argument and and text is not formatted if WriteMode is Disk.
Public method INIFile(String, Boolean, Boolean)
Constructor with file name (can be INI or XML). Section names and keys are case (in)sensitive according to case sensitive argument, text is formatted or not according to argument if WriteMode is changed to Disk and WriteMode is Memory
Public method INIFile(XDocument, Boolean, WriteMode)
Constructor with XML documente. Section names and keys are case (in)sensitive according to case sensitive argument, WriteMode is set by argument and and text is not formatted if WriteMode is Disk.
Public method INIFile(XDocument, Boolean, Boolean)
Constructor with XML document. Section names and keys are case (in)sensitive according to case sensitive argument,text is formatted or not according to argument if WriteMode is changed to Disk and WriteMode is Memory
Public method INIFile(String, Boolean, Boolean, WriteMode)
Constructor with file name (can be INI or XML). Section names and keys are case (in)sensitive according to case sensitive argument, WriteMode is set by argument as is case sensitivity and formatted text when WriteMode is Disk.
Public method INIFile(XDocument, Boolean, Boolean, WriteMode)
Constructor with XML document. Section names and keys are case (in)sensitive according to case sensitive argument, WriteMode is set by argument as is case sensitivity and formatted text when WriteMode is Disk.
Top
See Also

Reference

INIFile Class
Bncs.SysUtils Namespace


INIFile Constructor (String)

INIFile Constructor (String)
Constructor with file name (can be INI or XML). WriteMode is Memory, section names and keys are case insensitive and text is not formatted if WriteMode is changed to Disk.
Examples
This code demonstrates the objects most commonly used constructor.
Copy
class Program
{
    static void Main()
    {
        INIFile iniFile = new INIFile(@"c:\test.ini");
    }
}

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public INIFile(
    string filename_
)

Parameters

filename_
Type: SystemString
Full path to INI file on disk
See Also

Reference

INIFile Class
INIFile Overload
Bncs.SysUtils Namespace


INIFile Constructor (XDocument)

INIFile Constructor (XDocument)
Constructor with XML document. WriteMode is Memory, section names and keys are case insensitive and text is not formatted if WriteMode is changed to Disk.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public INIFile(
    XDocument document_
)

Parameters

document_
Type: System.Xml.LinqXDocument
XML document
See Also

Reference

INIFile Class
INIFile Overload
Bncs.SysUtils Namespace


INIFile Constructor (String, WriteMode)

INIFile Constructor (String, WriteMode)
Constructor with file name (can be INI or XML). WriteMode is set by argument, section names and keys are case insensitive and text is not formatted if WriteMode is Disk. formatted if WriteMode is changed to Disk.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public INIFile(
    string filename_,
    WriteMode writeMode_
)

Parameters

filename_
Type: SystemString
Full path to INI file on disk
writeMode_
Type: Bncs.SysUtilsWriteMode

[Missing <param name="writeMode_"/> documentation for "M:Bncs.SysUtils.INIFile.#ctor(System.String,Bncs.SysUtils.WriteMode)"]

See Also

Reference

INIFile Class
INIFile Overload
Bncs.SysUtils Namespace


INIFile Constructor (String, Boolean)

INIFile Constructor (String, Boolean)
Constructor with file name (can be INI or XML). Section names and keys are case (in)sensitive according to case sensitive argument, WriteMode is Memory and text is not formatted if WriteMode is changed to Disk.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public INIFile(
    string filename_,
    bool caseSensitiveKeys_
)

Parameters

filename_
Type: SystemString
Full path to INI file on disk
caseSensitiveKeys_
Type: SystemBoolean
If true section names and keys are case sensitive else they are not
See Also

Reference

INIFile Class
INIFile Overload
Bncs.SysUtils Namespace


INIFile Constructor (XDocument, WriteMode)

INIFile Constructor (XDocument, WriteMode)
Constructor with XML document. WriteMode is set by argument, section names and keys are case insensitive and text is not formatted if WriteMode is Disk. formatted if WriteMode is changed to Disk.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public INIFile(
    XDocument document_,
    WriteMode writeMode_
)

Parameters

document_
Type: System.Xml.LinqXDocument
XML document
writeMode_
Type: Bncs.SysUtilsWriteMode

[Missing <param name="writeMode_"/> documentation for "M:Bncs.SysUtils.INIFile.#ctor(System.Xml.Linq.XDocument,Bncs.SysUtils.WriteMode)"]

See Also

Reference

INIFile Class
INIFile Overload
Bncs.SysUtils Namespace


INIFile Constructor (XDocument, Boolean)

INIFile Constructor (XDocument, Boolean)
Constructor with XML document. Section names and keys are case (in)sensitive according to case sensitive argument, WriteMode is Memory and text is not formatted if WriteMode is changed to Disk.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public INIFile(
    XDocument document_,
    bool caseSensitiveKeys_
)

Parameters

document_
Type: System.Xml.LinqXDocument
XML document
caseSensitiveKeys_
Type: SystemBoolean
If true section names and keys are case sensitive else they are not
See Also

Reference

INIFile Class
INIFile Overload
Bncs.SysUtils Namespace


INIFile Constructor (String, Boolean, WriteMode)

INIFile Constructor (String, Boolean, WriteMode)
Constructor with file name (can be INI or XML). Section names and keys are case (in)sensitive according to case sensitive argument, WriteMode is set by argument and and text is not formatted if WriteMode is Disk.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public INIFile(
    string filename_,
    bool caseSensitiveKeys_,
    WriteMode writeMode_
)

Parameters

filename_
Type: SystemString
Full path to INI file on disk
caseSensitiveKeys_
Type: SystemBoolean
If true section names and keys are case sensitive else they are not
writeMode_
Type: Bncs.SysUtilsWriteMode
If Memory all Write...() methods make changes to memory only, if Disk then the file is written to disk
See Also

Reference

INIFile Class
INIFile Overload
Bncs.SysUtils Namespace


INIFile Constructor (String, Boolean, Boolean)

INIFile Constructor (String, Boolean, Boolean)
Constructor with file name (can be INI or XML). Section names and keys are case (in)sensitive according to case sensitive argument, text is formatted or not according to argument if WriteMode is changed to Disk and WriteMode is Memory

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public INIFile(
    string filename_,
    bool caseSensitiveKeys_,
    bool keepTextFormatted_
)

Parameters

filename_
Type: SystemString
Full path to INI file on disk
caseSensitiveKeys_
Type: SystemBoolean
If true section names and keys are case sensitive else they are not
keepTextFormatted_
Type: SystemBoolean
If true and WriteMode is changed to Disk then text is formatted to ignore blanks but seperate sections with blanks
See Also

Reference

INIFile Class
INIFile Overload
Bncs.SysUtils Namespace


INIFile Constructor (XDocument, Boolean, WriteMode)

INIFile Constructor (XDocument, Boolean, WriteMode)
Constructor with XML documente. Section names and keys are case (in)sensitive according to case sensitive argument, WriteMode is set by argument and and text is not formatted if WriteMode is Disk.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public INIFile(
    XDocument document_,
    bool caseSensitiveKeys_,
    WriteMode writeMode_
)

Parameters

document_
Type: System.Xml.LinqXDocument
XML document
caseSensitiveKeys_
Type: SystemBoolean
If true section names and keys are case sensitive else they are not
writeMode_
Type: Bncs.SysUtilsWriteMode
If Memory all Write...() methods make changes to memory only, if Disk then the file is written to disk
See Also

Reference

INIFile Class
INIFile Overload
Bncs.SysUtils Namespace


INIFile Constructor (XDocument, Boolean, Boolean)

INIFile Constructor (XDocument, Boolean, Boolean)
Constructor with XML document. Section names and keys are case (in)sensitive according to case sensitive argument,text is formatted or not according to argument if WriteMode is changed to Disk and WriteMode is Memory

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public INIFile(
    XDocument document_,
    bool caseSensitiveKeys_,
    bool keepTextFormatted_
)

Parameters

document_
Type: System.Xml.LinqXDocument
XML document
caseSensitiveKeys_
Type: SystemBoolean
If true section names and keys are case sensitive else they are not
keepTextFormatted_
Type: SystemBoolean
If true and WriteMode is changed to Disk then text is formatted to ignore blanks but seperate sections with blanks
See Also

Reference

INIFile Class
INIFile Overload
Bncs.SysUtils Namespace


INIFile Constructor (String, Boolean, Boolean, WriteMode)

INIFile Constructor (String, Boolean, Boolean, WriteMode)
Constructor with file name (can be INI or XML). Section names and keys are case (in)sensitive according to case sensitive argument, WriteMode is set by argument as is case sensitivity and formatted text when WriteMode is Disk.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public INIFile(
    string filename_,
    bool caseSensitiveKeys_,
    bool keepTextFormatted_,
    WriteMode writeMode_
)

Parameters

filename_
Type: SystemString
Full path to INI file on disk
caseSensitiveKeys_
Type: SystemBoolean
If true section names and keys are case sensitive else they are not
keepTextFormatted_
Type: SystemBoolean
If true and WriteMode is changed to Disk then text is formatted to ignore blanks but seperate sections with blanks
writeMode_
Type: Bncs.SysUtilsWriteMode
If Memory all Write...() methods make changes to memory only, if Disk then the file is written to disk
See Also

Reference

INIFile Class
INIFile Overload
Bncs.SysUtils Namespace


INIFile Constructor (XDocument, Boolean, Boolean, WriteMode)

INIFile Constructor (XDocument, Boolean, Boolean, WriteMode)
Constructor with XML document. Section names and keys are case (in)sensitive according to case sensitive argument, WriteMode is set by argument as is case sensitivity and formatted text when WriteMode is Disk.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public INIFile(
    XDocument document_,
    bool caseSensitiveKeys_,
    bool keepTextFormatted_,
    WriteMode writeMode_
)

Parameters

document_
Type: System.Xml.LinqXDocument
XML document
caseSensitiveKeys_
Type: SystemBoolean
If true section names and keys are case sensitive else they are not
keepTextFormatted_
Type: SystemBoolean
If true and WriteMode is changed to Disk then text is formatted to ignore blanks but seperate sections with blanks
writeMode_
Type: Bncs.SysUtilsWriteMode
If Memory all Write...() methods make changes to memory only, if Disk then the file is written to disk
See Also

Reference

INIFile Class
INIFile Overload
Bncs.SysUtils Namespace


INIFile Methods

INIFile Methods

The INIFile type exposes the following members.

Methods
Name Description
Public method ConvertToXmlDocument
Generates an XML document version of the INI file.
Public method Equals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public method EraseSection
Deletes the entire section specified.
Public method EraseSetting
Deletes the setting specified by section and key.
Public method GetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public method GetSectionNames
Reads all section names in the INI file.
Public method GetSectionNames(Boolean)
Reads all section names in the INI file.
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
ReadBool
Reads a boolean value from the INI file. Valid boolean true values are "1", "true" or any value that can convert to an integer bar "0". Valid boolean false values are "0" or "false"
Examples
This code is an example of writing to and reading from an INIFile object.
Copy
class Program
{
    static void Main()
    {
        Console.WriteLine("Writing INI file, press any key to read");
        WriteINI();
        Console.ReadKey();
        ReadINI();
        Console.ReadKey();
    }

    static void WriteINI()
    {
        // Create an INI file
        INIFile iniFile = new INIFile(@"c:\test.ini");
        // Write some boolean, string and integral values to it
        iniFile.WriteBool("FLAGS", "active", true);
        iniFile.WriteBool("FLAGS", "monitor", false);
        iniFile.WriteString("DATA", "department", "Sales");
        iniFile.WriteInt("DATA", "employees", 13);

        // Set up a phoney employee database
        string[] employee1 = { "Rod", "M", "28" };
        string[] employee2 = { "Jane", "F", "21" };
        string[] employee3 = { "Freddie", "M", "31" };
        string[][] employees = new string[3][];
        employees[0] = employee1;
        employees[1] = employee2;
        employees[2] = employee3;

        // Write employee data out to the INI file.
        int index = -1;
        foreach (string[] employee in employees)
        {
            iniFile.WriteString("EMPLOYEES", "emp#" + ((int)(++index)).ToString(), employee[0]);
            iniFile.WriteString("EMPLOYEES", "gen#" + ((int)(index)).ToString(), employee[1]);
            iniFile.WriteInt("EMPLOYEES", "age#" + ((int)(index)).ToString(), Int32.Parse(employee[2]));
        }

        // Save the INI file
        iniFile.Save();
    }

    static void ReadINI()
    {
        // Check the file exists
        if (FileFuncs.Exists(@"c:\test.ini"))
        {
            // Create the INI file
            INIFile iniFile = new INIFile(@"c:\test.ini");
            // Write some boolean, string and integral values from it to the console
            Console.WriteLine(iniFile.ReadBool("FLAGS", "active", false) ? "Active is ON" : "Active is OFF");
            Console.WriteLine(iniFile.ReadBool("FLAGS", "monitor", false) ? "Monitor is ON" : "Monitor is OFF");
            Console.WriteLine("Department is " + iniFile.ReadString("DATA", "department", "unknown"));
            Console.WriteLine("Employee count is " + iniFile.ReadInt("DATA", "employees", 0).ToString());

            // See how many entries there are in the "EMPLOYEES" section.
            int count = iniFile.ReadSection("EMPLOYEES").Count;
            int index = 0;
            // Loop until we've printed all data from the INI file onto the console.
            while (index < count / 3)
            {
                Console.WriteLine("Name: " + iniFile.ReadString("EMPLOYEES", "emp#" + index.ToString(), "anonymous"));
                Console.WriteLine("Gender: " + iniFile.ReadString("EMPLOYEES", "gen#" + index.ToString(), "?"));
                Console.WriteLine("Age: " + iniFile.ReadInt("EMPLOYEES", "age#" + index.ToString(), 0).ToString());
                ++index;
            }
        }
        else
            Console.WriteLine(@"c:\test.ini file not found.");
    }
}
Public method ReadDouble
Reads a double value from the INI file
ReadInt
Reads an integer value from the INI file
Examples
This code is an example of writing to and reading from an INIFile object.
Copy
class Program
{
    static void Main()
    {
        Console.WriteLine("Writing INI file, press any key to read");
        WriteINI();
        Console.ReadKey();
        ReadINI();
        Console.ReadKey();
    }

    static void WriteINI()
    {
        // Create an INI file
        INIFile iniFile = new INIFile(@"c:\test.ini");
        // Write some boolean, string and integral values to it
        iniFile.WriteBool("FLAGS", "active", true);
        iniFile.WriteBool("FLAGS", "monitor", false);
        iniFile.WriteString("DATA", "department", "Sales");
        iniFile.WriteInt("DATA", "employees", 13);

        // Set up a phoney employee database
        string[] employee1 = { "Rod", "M", "28" };
        string[] employee2 = { "Jane", "F", "21" };
        string[] employee3 = { "Freddie", "M", "31" };
        string[][] employees = new string[3][];
        employees[0] = employee1;
        employees[1] = employee2;
        employees[2] = employee3;

        // Write employee data out to the INI file.
        int index = -1;
        foreach (string[] employee in employees)
        {
            iniFile.WriteString("EMPLOYEES", "emp#" + ((int)(++index)).ToString(), employee[0]);
            iniFile.WriteString("EMPLOYEES", "gen#" + ((int)(index)).ToString(), employee[1]);
            iniFile.WriteInt("EMPLOYEES", "age#" + ((int)(index)).ToString(), Int32.Parse(employee[2]));
        }

        // Save the INI file
        iniFile.Save();
    }

    static void ReadINI()
    {
        // Check the file exists
        if (FileFuncs.Exists(@"c:\test.ini"))
        {
            // Create the INI file
            INIFile iniFile = new INIFile(@"c:\test.ini");
            // Write some boolean, string and integral values from it to the console
            Console.WriteLine(iniFile.ReadBool("FLAGS", "active", false) ? "Active is ON" : "Active is OFF");
            Console.WriteLine(iniFile.ReadBool("FLAGS", "monitor", false) ? "Monitor is ON" : "Monitor is OFF");
            Console.WriteLine("Department is " + iniFile.ReadString("DATA", "department", "unknown"));
            Console.WriteLine("Employee count is " + iniFile.ReadInt("DATA", "employees", 0).ToString());

            // See how many entries there are in the "EMPLOYEES" section.
            int count = iniFile.ReadSection("EMPLOYEES").Count;
            int index = 0;
            // Loop until we've printed all data from the INI file onto the console.
            while (index < count / 3)
            {
                Console.WriteLine("Name: " + iniFile.ReadString("EMPLOYEES", "emp#" + index.ToString(), "anonymous"));
                Console.WriteLine("Gender: " + iniFile.ReadString("EMPLOYEES", "gen#" + index.ToString(), "?"));
                Console.WriteLine("Age: " + iniFile.ReadInt("EMPLOYEES", "age#" + index.ToString(), 0).ToString());
                ++index;
            }
        }
        else
            Console.WriteLine(@"c:\test.ini file not found.");
    }
}
ReadSection
Reads all values from the supplied Section
Examples
This code is an example of writing to and reading from an INIFile object.
Copy
class Program
{
    static void Main()
    {
        Console.WriteLine("Writing INI file, press any key to read");
        WriteINI();
        Console.ReadKey();
        ReadINI();
        Console.ReadKey();
    }

    static void WriteINI()
    {
        // Create an INI file
        INIFile iniFile = new INIFile(@"c:\test.ini");
        // Write some boolean, string and integral values to it
        iniFile.WriteBool("FLAGS", "active", true);
        iniFile.WriteBool("FLAGS", "monitor", false);
        iniFile.WriteString("DATA", "department", "Sales");
        iniFile.WriteInt("DATA", "employees", 13);

        // Set up a phoney employee database
        string[] employee1 = { "Rod", "M", "28" };
        string[] employee2 = { "Jane", "F", "21" };
        string[] employee3 = { "Freddie", "M", "31" };
        string[][] employees = new string[3][];
        employees[0] = employee1;
        employees[1] = employee2;
        employees[2] = employee3;

        // Write employee data out to the INI file.
        int index = -1;
        foreach (string[] employee in employees)
        {
            iniFile.WriteString("EMPLOYEES", "emp#" + ((int)(++index)).ToString(), employee[0]);
            iniFile.WriteString("EMPLOYEES", "gen#" + ((int)(index)).ToString(), employee[1]);
            iniFile.WriteInt("EMPLOYEES", "age#" + ((int)(index)).ToString(), Int32.Parse(employee[2]));
        }

        // Save the INI file
        iniFile.Save();
    }

    static void ReadINI()
    {
        // Check the file exists
        if (FileFuncs.Exists(@"c:\test.ini"))
        {
            // Create the INI file
            INIFile iniFile = new INIFile(@"c:\test.ini");
            // Write some boolean, string and integral values from it to the console
            Console.WriteLine(iniFile.ReadBool("FLAGS", "active", false) ? "Active is ON" : "Active is OFF");
            Console.WriteLine(iniFile.ReadBool("FLAGS", "monitor", false) ? "Monitor is ON" : "Monitor is OFF");
            Console.WriteLine("Department is " + iniFile.ReadString("DATA", "department", "unknown"));
            Console.WriteLine("Employee count is " + iniFile.ReadInt("DATA", "employees", 0).ToString());

            // See how many entries there are in the "EMPLOYEES" section.
            int count = iniFile.ReadSection("EMPLOYEES").Count;
            int index = 0;
            // Loop until we've printed all data from the INI file onto the console.
            while (index < count / 3)
            {
                Console.WriteLine("Name: " + iniFile.ReadString("EMPLOYEES", "emp#" + index.ToString(), "anonymous"));
                Console.WriteLine("Gender: " + iniFile.ReadString("EMPLOYEES", "gen#" + index.ToString(), "?"));
                Console.WriteLine("Age: " + iniFile.ReadInt("EMPLOYEES", "age#" + index.ToString(), 0).ToString());
                ++index;
            }
        }
        else
            Console.WriteLine(@"c:\test.ini file not found.");
    }
}
Public method ReadSectionKeys
Reads all key names from the supplied Section
Public method ReadSectionText
Reads all text from the the supplied Section
ReadString
Reads a string value from the INI file
Examples
This code is an example of writing to and reading from an INIFile object.
Copy
class Program
{
    static void Main()
    {
        Console.WriteLine("Writing INI file, press any key to read");
        WriteINI();
        Console.ReadKey();
        ReadINI();
        Console.ReadKey();
    }

    static void WriteINI()
    {
        // Create an INI file
        INIFile iniFile = new INIFile(@"c:\test.ini");
        // Write some boolean, string and integral values to it
        iniFile.WriteBool("FLAGS", "active", true);
        iniFile.WriteBool("FLAGS", "monitor", false);
        iniFile.WriteString("DATA", "department", "Sales");
        iniFile.WriteInt("DATA", "employees", 13);

        // Set up a phoney employee database
        string[] employee1 = { "Rod", "M", "28" };
        string[] employee2 = { "Jane", "F", "21" };
        string[] employee3 = { "Freddie", "M", "31" };
        string[][] employees = new string[3][];
        employees[0] = employee1;
        employees[1] = employee2;
        employees[2] = employee3;

        // Write employee data out to the INI file.
        int index = -1;
        foreach (string[] employee in employees)
        {
            iniFile.WriteString("EMPLOYEES", "emp#" + ((int)(++index)).ToString(), employee[0]);
            iniFile.WriteString("EMPLOYEES", "gen#" + ((int)(index)).ToString(), employee[1]);
            iniFile.WriteInt("EMPLOYEES", "age#" + ((int)(index)).ToString(), Int32.Parse(employee[2]));
        }

        // Save the INI file
        iniFile.Save();
    }

    static void ReadINI()
    {
        // Check the file exists
        if (FileFuncs.Exists(@"c:\test.ini"))
        {
            // Create the INI file
            INIFile iniFile = new INIFile(@"c:\test.ini");
            // Write some boolean, string and integral values from it to the console
            Console.WriteLine(iniFile.ReadBool("FLAGS", "active", false) ? "Active is ON" : "Active is OFF");
            Console.WriteLine(iniFile.ReadBool("FLAGS", "monitor", false) ? "Monitor is ON" : "Monitor is OFF");
            Console.WriteLine("Department is " + iniFile.ReadString("DATA", "department", "unknown"));
            Console.WriteLine("Employee count is " + iniFile.ReadInt("DATA", "employees", 0).ToString());

            // See how many entries there are in the "EMPLOYEES" section.
            int count = iniFile.ReadSection("EMPLOYEES").Count;
            int index = 0;
            // Loop until we've printed all data from the INI file onto the console.
            while (index < count / 3)
            {
                Console.WriteLine("Name: " + iniFile.ReadString("EMPLOYEES", "emp#" + index.ToString(), "anonymous"));
                Console.WriteLine("Gender: " + iniFile.ReadString("EMPLOYEES", "gen#" + index.ToString(), "?"));
                Console.WriteLine("Age: " + iniFile.ReadInt("EMPLOYEES", "age#" + index.ToString(), 0).ToString());
                ++index;
            }
        }
        else
            Console.WriteLine(@"c:\test.ini file not found.");
    }
}
Public method Save
Saves the INI file to disk overwriting any existing file
Public method SaveAs
Changes the file name to that supplied and saves the INI file to disk overwriting any existing file
Public method SaveFormatted
Saves the INI file to disk overwriting any existing file but formats the text to exclude blank lines but insert blank lines between sections
Public method SaveFormattedAs
Changes the file name to that supplied and saves the INI file to disk overwriting any existing file but formats the text to exclude blank lines but insert blank lines between sections
Public method ToString
Returns a string representation of the object.
(Overrides ObjectToString.)
WriteBool
Writes a boolean value to the INI file, 1=true and 0=false, to the section and key supplied. If the section and/or key do not exist they are created.
Examples
This code is an example of writing to and reading from an INIFile object.
Copy
class Program
{
    static void Main()
    {
        Console.WriteLine("Writing INI file, press any key to read");
        WriteINI();
        Console.ReadKey();
        ReadINI();
        Console.ReadKey();
    }

    static void WriteINI()
    {
        // Create an INI file
        INIFile iniFile = new INIFile(@"c:\test.ini");
        // Write some boolean, string and integral values to it
        iniFile.WriteBool("FLAGS", "active", true);
        iniFile.WriteBool("FLAGS", "monitor", false);
        iniFile.WriteString("DATA", "department", "Sales");
        iniFile.WriteInt("DATA", "employees", 13);

        // Set up a phoney employee database
        string[] employee1 = { "Rod", "M", "28" };
        string[] employee2 = { "Jane", "F", "21" };
        string[] employee3 = { "Freddie", "M", "31" };
        string[][] employees = new string[3][];
        employees[0] = employee1;
        employees[1] = employee2;
        employees[2] = employee3;

        // Write employee data out to the INI file.
        int index = -1;
        foreach (string[] employee in employees)
        {
            iniFile.WriteString("EMPLOYEES", "emp#" + ((int)(++index)).ToString(), employee[0]);
            iniFile.WriteString("EMPLOYEES", "gen#" + ((int)(index)).ToString(), employee[1]);
            iniFile.WriteInt("EMPLOYEES", "age#" + ((int)(index)).ToString(), Int32.Parse(employee[2]));
        }

        // Save the INI file
        iniFile.Save();
    }

    static void ReadINI()
    {
        // Check the file exists
        if (FileFuncs.Exists(@"c:\test.ini"))
        {
            // Create the INI file
            INIFile iniFile = new INIFile(@"c:\test.ini");
            // Write some boolean, string and integral values from it to the console
            Console.WriteLine(iniFile.ReadBool("FLAGS", "active", false) ? "Active is ON" : "Active is OFF");
            Console.WriteLine(iniFile.ReadBool("FLAGS", "monitor", false) ? "Monitor is ON" : "Monitor is OFF");
            Console.WriteLine("Department is " + iniFile.ReadString("DATA", "department", "unknown"));
            Console.WriteLine("Employee count is " + iniFile.ReadInt("DATA", "employees", 0).ToString());

            // See how many entries there are in the "EMPLOYEES" section.
            int count = iniFile.ReadSection("EMPLOYEES").Count;
            int index = 0;
            // Loop until we've printed all data from the INI file onto the console.
            while (index < count / 3)
            {
                Console.WriteLine("Name: " + iniFile.ReadString("EMPLOYEES", "emp#" + index.ToString(), "anonymous"));
                Console.WriteLine("Gender: " + iniFile.ReadString("EMPLOYEES", "gen#" + index.ToString(), "?"));
                Console.WriteLine("Age: " + iniFile.ReadInt("EMPLOYEES", "age#" + index.ToString(), 0).ToString());
                ++index;
            }
        }
        else
            Console.WriteLine(@"c:\test.ini file not found.");
    }
}
Public method WriteBoolAsText
Writes a boolean as text to the INI file. If the section or key do not exist then they are created.
Public method WriteDouble
Writes a double value to the INI file to the section and key supplied. If the section and/or key do not exist they are created.
WriteInt
Writes an integer value to the INI file to the section and key supplied. If the section and/or key do not exist they are created.
Examples
This code is an example of writing to and reading from an INIFile object.
Copy
class Program
{
    static void Main()
    {
        Console.WriteLine("Writing INI file, press any key to read");
        WriteINI();
        Console.ReadKey();
        ReadINI();
        Console.ReadKey();
    }

    static void WriteINI()
    {
        // Create an INI file
        INIFile iniFile = new INIFile(@"c:\test.ini");
        // Write some boolean, string and integral values to it
        iniFile.WriteBool("FLAGS", "active", true);
        iniFile.WriteBool("FLAGS", "monitor", false);
        iniFile.WriteString("DATA", "department", "Sales");
        iniFile.WriteInt("DATA", "employees", 13);

        // Set up a phoney employee database
        string[] employee1 = { "Rod", "M", "28" };
        string[] employee2 = { "Jane", "F", "21" };
        string[] employee3 = { "Freddie", "M", "31" };
        string[][] employees = new string[3][];
        employees[0] = employee1;
        employees[1] = employee2;
        employees[2] = employee3;

        // Write employee data out to the INI file.
        int index = -1;
        foreach (string[] employee in employees)
        {
            iniFile.WriteString("EMPLOYEES", "emp#" + ((int)(++index)).ToString(), employee[0]);
            iniFile.WriteString("EMPLOYEES", "gen#" + ((int)(index)).ToString(), employee[1]);
            iniFile.WriteInt("EMPLOYEES", "age#" + ((int)(index)).ToString(), Int32.Parse(employee[2]));
        }

        // Save the INI file
        iniFile.Save();
    }

    static void ReadINI()
    {
        // Check the file exists
        if (FileFuncs.Exists(@"c:\test.ini"))
        {
            // Create the INI file
            INIFile iniFile = new INIFile(@"c:\test.ini");
            // Write some boolean, string and integral values from it to the console
            Console.WriteLine(iniFile.ReadBool("FLAGS", "active", false) ? "Active is ON" : "Active is OFF");
            Console.WriteLine(iniFile.ReadBool("FLAGS", "monitor", false) ? "Monitor is ON" : "Monitor is OFF");
            Console.WriteLine("Department is " + iniFile.ReadString("DATA", "department", "unknown"));
            Console.WriteLine("Employee count is " + iniFile.ReadInt("DATA", "employees", 0).ToString());

            // See how many entries there are in the "EMPLOYEES" section.
            int count = iniFile.ReadSection("EMPLOYEES").Count;
            int index = 0;
            // Loop until we've printed all data from the INI file onto the console.
            while (index < count / 3)
            {
                Console.WriteLine("Name: " + iniFile.ReadString("EMPLOYEES", "emp#" + index.ToString(), "anonymous"));
                Console.WriteLine("Gender: " + iniFile.ReadString("EMPLOYEES", "gen#" + index.ToString(), "?"));
                Console.WriteLine("Age: " + iniFile.ReadInt("EMPLOYEES", "age#" + index.ToString(), 0).ToString());
                ++index;
            }
        }
        else
            Console.WriteLine(@"c:\test.ini file not found.");
    }
}
WriteString
Writes a string value to the INI file to the section and key supplied. If the section and/or key do not exist they are created.
Examples
This code is an example of writing to and reading from an INIFile object.
Copy
class Program
{
    static void Main()
    {
        Console.WriteLine("Writing INI file, press any key to read");
        WriteINI();
        Console.ReadKey();
        ReadINI();
        Console.ReadKey();
    }

    static void WriteINI()
    {
        // Create an INI file
        INIFile iniFile = new INIFile(@"c:\test.ini");
        // Write some boolean, string and integral values to it
        iniFile.WriteBool("FLAGS", "active", true);
        iniFile.WriteBool("FLAGS", "monitor", false);
        iniFile.WriteString("DATA", "department", "Sales");
        iniFile.WriteInt("DATA", "employees", 13);

        // Set up a phoney employee database
        string[] employee1 = { "Rod", "M", "28" };
        string[] employee2 = { "Jane", "F", "21" };
        string[] employee3 = { "Freddie", "M", "31" };
        string[][] employees = new string[3][];
        employees[0] = employee1;
        employees[1] = employee2;
        employees[2] = employee3;

        // Write employee data out to the INI file.
        int index = -1;
        foreach (string[] employee in employees)
        {
            iniFile.WriteString("EMPLOYEES", "emp#" + ((int)(++index)).ToString(), employee[0]);
            iniFile.WriteString("EMPLOYEES", "gen#" + ((int)(index)).ToString(), employee[1]);
            iniFile.WriteInt("EMPLOYEES", "age#" + ((int)(index)).ToString(), Int32.Parse(employee[2]));
        }

        // Save the INI file
        iniFile.Save();
    }

    static void ReadINI()
    {
        // Check the file exists
        if (FileFuncs.Exists(@"c:\test.ini"))
        {
            // Create the INI file
            INIFile iniFile = new INIFile(@"c:\test.ini");
            // Write some boolean, string and integral values from it to the console
            Console.WriteLine(iniFile.ReadBool("FLAGS", "active", false) ? "Active is ON" : "Active is OFF");
            Console.WriteLine(iniFile.ReadBool("FLAGS", "monitor", false) ? "Monitor is ON" : "Monitor is OFF");
            Console.WriteLine("Department is " + iniFile.ReadString("DATA", "department", "unknown"));
            Console.WriteLine("Employee count is " + iniFile.ReadInt("DATA", "employees", 0).ToString());

            // See how many entries there are in the "EMPLOYEES" section.
            int count = iniFile.ReadSection("EMPLOYEES").Count;
            int index = 0;
            // Loop until we've printed all data from the INI file onto the console.
            while (index < count / 3)
            {
                Console.WriteLine("Name: " + iniFile.ReadString("EMPLOYEES", "emp#" + index.ToString(), "anonymous"));
                Console.WriteLine("Gender: " + iniFile.ReadString("EMPLOYEES", "gen#" + index.ToString(), "?"));
                Console.WriteLine("Age: " + iniFile.ReadInt("EMPLOYEES", "age#" + index.ToString(), 0).ToString());
                ++index;
            }
        }
        else
            Console.WriteLine(@"c:\test.ini file not found.");
    }
}
Top
See Also

Reference

INIFile Class
Bncs.SysUtils Namespace


INIFile.ConvertToXmlDocument Method

INIFileConvertToXmlDocument Method
Generates an XML document version of the INI file.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public XDocument ConvertToXmlDocument()

Return Value

Type: XDocument
Returns an XDocument containing the INI file, the file is not created nor saved. Use XDocument's Save() method to save to disk
See Also

Reference

INIFile Class
Bncs.SysUtils Namespace


INIFile.EraseSection Method

INIFileEraseSection Method
Deletes the entire section specified.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool EraseSection(
    string section_
)

Parameters

section_
Type: SystemString
Section to remove.

Return Value

Type: Boolean
True on success.
See Also

Reference

INIFile Class
Bncs.SysUtils Namespace


INIFile.EraseSetting Method

INIFileEraseSetting Method
Deletes the setting specified by section and key.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool EraseSetting(
    string section_,
    string key_
)

Parameters

section_
Type: SystemString
Section containing the setting to remove.
key_
Type: SystemString
Setting to remove.

Return Value

Type: Boolean
True on success.
See Also

Reference

INIFile Class
Bncs.SysUtils Namespace


INIFile.GetSectionNames Method

INIFileGetSectionNames Method
Overload List
 | Name | Description
Public method | GetSectionNames | Reads all section names in the INI file.
Public method | GetSectionNames(Boolean) | Reads all section names in the INI file.
Top
See Also

Reference

INIFile Class
Bncs.SysUtils Namespace


INIFile.GetSectionNames Method

INIFileGetSectionNames Method
Reads all section names in the INI file.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<string> GetSectionNames()

Return Value

Type: List String
A list of strings containing the names of all sections excluding parenthesis.
See Also

Reference

INIFile Class
GetSectionNames Overload
Bncs.SysUtils Namespace


INIFile.GetSectionNames Method (Boolean)

INIFileGetSectionNames Method (Boolean)
Reads all section names in the INI file.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<string> GetSectionNames(
    bool returnParenthesis_
)

Parameters

returnParenthesis_
Type: SystemBoolean
Parenthesis inclusion flag.

Return Value

Type: List String
A list of strings containing the names of all sections including or excluding parenthesis.
See Also

Reference

INIFile Class
GetSectionNames Overload
Bncs.SysUtils Namespace


INIFile.ReadBool Method

INIFileReadBool Method
Reads a boolean value from the INI file. Valid boolean true values are "1", "true" or any value that can convert to an integer bar "0". Valid boolean false values are "0" or "false"
Examples
This code is an example of writing to and reading from an INIFile object.
Copy
class Program
{
    static void Main()
    {
        Console.WriteLine("Writing INI file, press any key to read");
        WriteINI();
        Console.ReadKey();
        ReadINI();
        Console.ReadKey();
    }

    static void WriteINI()
    {
        // Create an INI file
        INIFile iniFile = new INIFile(@"c:\test.ini");
        // Write some boolean, string and integral values to it
        iniFile.WriteBool("FLAGS", "active", true);
        iniFile.WriteBool("FLAGS", "monitor", false);
        iniFile.WriteString("DATA", "department", "Sales");
        iniFile.WriteInt("DATA", "employees", 13);

        // Set up a phoney employee database
        string[] employee1 = { "Rod", "M", "28" };
        string[] employee2 = { "Jane", "F", "21" };
        string[] employee3 = { "Freddie", "M", "31" };
        string[][] employees = new string[3][];
        employees[0] = employee1;
        employees[1] = employee2;
        employees[2] = employee3;

        // Write employee data out to the INI file.
        int index = -1;
        foreach (string[] employee in employees)
        {
            iniFile.WriteString("EMPLOYEES", "emp#" + ((int)(++index)).ToString(), employee[0]);
            iniFile.WriteString("EMPLOYEES", "gen#" + ((int)(index)).ToString(), employee[1]);
            iniFile.WriteInt("EMPLOYEES", "age#" + ((int)(index)).ToString(), Int32.Parse(employee[2]));
        }

        // Save the INI file
        iniFile.Save();
    }

    static void ReadINI()
    {
        // Check the file exists
        if (FileFuncs.Exists(@"c:\test.ini"))
        {
            // Create the INI file
            INIFile iniFile = new INIFile(@"c:\test.ini");
            // Write some boolean, string and integral values from it to the console
            Console.WriteLine(iniFile.ReadBool("FLAGS", "active", false) ? "Active is ON" : "Active is OFF");
            Console.WriteLine(iniFile.ReadBool("FLAGS", "monitor", false) ? "Monitor is ON" : "Monitor is OFF");
            Console.WriteLine("Department is " + iniFile.ReadString("DATA", "department", "unknown"));
            Console.WriteLine("Employee count is " + iniFile.ReadInt("DATA", "employees", 0).ToString());

            // See how many entries there are in the "EMPLOYEES" section.
            int count = iniFile.ReadSection("EMPLOYEES").Count;
            int index = 0;
            // Loop until we've printed all data from the INI file onto the console.
            while (index < count / 3)
            {
                Console.WriteLine("Name: " + iniFile.ReadString("EMPLOYEES", "emp#" + index.ToString(), "anonymous"));
                Console.WriteLine("Gender: " + iniFile.ReadString("EMPLOYEES", "gen#" + index.ToString(), "?"));
                Console.WriteLine("Age: " + iniFile.ReadInt("EMPLOYEES", "age#" + index.ToString(), 0).ToString());
                ++index;
            }
        }
        else
            Console.WriteLine(@"c:\test.ini file not found.");
    }
}

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool ReadBool(
    string section_,
    string key_,
    bool default_
)

Parameters

section_
Type: SystemString
Section to read from
key_
Type: SystemString
Key to read
default_
Type: SystemBoolean
Default value to return if the section or key are not found

Return Value

Type: Boolean
Returns the boolean value read or the default value specified if the section or key were not found
See Also

Reference

INIFile Class
Bncs.SysUtils Namespace


INIFile.ReadDouble Method

INIFileReadDouble Method
Reads a double value from the INI file

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public double ReadDouble(
    string section_,
    string key_,
    double default_
)

Parameters

section_
Type: SystemString
Section to read from
key_
Type: SystemString
Key to read
default_
Type: SystemDouble
Default value to return if the section or key are not found

Return Value

Type: Double
Returns the double value read or the default value specified if the section or key were not found
See Also

Reference

INIFile Class
Bncs.SysUtils Namespace


INIFile.ReadInt Method

INIFileReadInt Method
Reads an integer value from the INI file
Examples
This code is an example of writing to and reading from an INIFile object.
Copy
class Program
{
    static void Main()
    {
        Console.WriteLine("Writing INI file, press any key to read");
        WriteINI();
        Console.ReadKey();
        ReadINI();
        Console.ReadKey();
    }

    static void WriteINI()
    {
        // Create an INI file
        INIFile iniFile = new INIFile(@"c:\test.ini");
        // Write some boolean, string and integral values to it
        iniFile.WriteBool("FLAGS", "active", true);
        iniFile.WriteBool("FLAGS", "monitor", false);
        iniFile.WriteString("DATA", "department", "Sales");
        iniFile.WriteInt("DATA", "employees", 13);

        // Set up a phoney employee database
        string[] employee1 = { "Rod", "M", "28" };
        string[] employee2 = { "Jane", "F", "21" };
        string[] employee3 = { "Freddie", "M", "31" };
        string[][] employees = new string[3][];
        employees[0] = employee1;
        employees[1] = employee2;
        employees[2] = employee3;

        // Write employee data out to the INI file.
        int index = -1;
        foreach (string[] employee in employees)
        {
            iniFile.WriteString("EMPLOYEES", "emp#" + ((int)(++index)).ToString(), employee[0]);
            iniFile.WriteString("EMPLOYEES", "gen#" + ((int)(index)).ToString(), employee[1]);
            iniFile.WriteInt("EMPLOYEES", "age#" + ((int)(index)).ToString(), Int32.Parse(employee[2]));
        }

        // Save the INI file
        iniFile.Save();
    }

    static void ReadINI()
    {
        // Check the file exists
        if (FileFuncs.Exists(@"c:\test.ini"))
        {
            // Create the INI file
            INIFile iniFile = new INIFile(@"c:\test.ini");
            // Write some boolean, string and integral values from it to the console
            Console.WriteLine(iniFile.ReadBool("FLAGS", "active", false) ? "Active is ON" : "Active is OFF");
            Console.WriteLine(iniFile.ReadBool("FLAGS", "monitor", false) ? "Monitor is ON" : "Monitor is OFF");
            Console.WriteLine("Department is " + iniFile.ReadString("DATA", "department", "unknown"));
            Console.WriteLine("Employee count is " + iniFile.ReadInt("DATA", "employees", 0).ToString());

            // See how many entries there are in the "EMPLOYEES" section.
            int count = iniFile.ReadSection("EMPLOYEES").Count;
            int index = 0;
            // Loop until we've printed all data from the INI file onto the console.
            while (index < count / 3)
            {
                Console.WriteLine("Name: " + iniFile.ReadString("EMPLOYEES", "emp#" + index.ToString(), "anonymous"));
                Console.WriteLine("Gender: " + iniFile.ReadString("EMPLOYEES", "gen#" + index.ToString(), "?"));
                Console.WriteLine("Age: " + iniFile.ReadInt("EMPLOYEES", "age#" + index.ToString(), 0).ToString());
                ++index;
            }
        }
        else
            Console.WriteLine(@"c:\test.ini file not found.");
    }
}

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int ReadInt(
    string section_,
    string key_,
    int default_
)

Parameters

section_
Type: SystemString
Section to read from
key_
Type: SystemString
Key to read
default_
Type: SystemInt32
Default value to return if the section or key are not found

Return Value

Type: Int32
Returns the integer value read or the default value specified if the section or key were not found
See Also

Reference

INIFile Class
Bncs.SysUtils Namespace


INIFile.ReadSection Method

INIFileReadSection Method
Reads all values from the supplied Section
Examples
This code is an example of writing to and reading from an INIFile object.
Copy
class Program
{
    static void Main()
    {
        Console.WriteLine("Writing INI file, press any key to read");
        WriteINI();
        Console.ReadKey();
        ReadINI();
        Console.ReadKey();
    }

    static void WriteINI()
    {
        // Create an INI file
        INIFile iniFile = new INIFile(@"c:\test.ini");
        // Write some boolean, string and integral values to it
        iniFile.WriteBool("FLAGS", "active", true);
        iniFile.WriteBool("FLAGS", "monitor", false);
        iniFile.WriteString("DATA", "department", "Sales");
        iniFile.WriteInt("DATA", "employees", 13);

        // Set up a phoney employee database
        string[] employee1 = { "Rod", "M", "28" };
        string[] employee2 = { "Jane", "F", "21" };
        string[] employee3 = { "Freddie", "M", "31" };
        string[][] employees = new string[3][];
        employees[0] = employee1;
        employees[1] = employee2;
        employees[2] = employee3;

        // Write employee data out to the INI file.
        int index = -1;
        foreach (string[] employee in employees)
        {
            iniFile.WriteString("EMPLOYEES", "emp#" + ((int)(++index)).ToString(), employee[0]);
            iniFile.WriteString("EMPLOYEES", "gen#" + ((int)(index)).ToString(), employee[1]);
            iniFile.WriteInt("EMPLOYEES", "age#" + ((int)(index)).ToString(), Int32.Parse(employee[2]));
        }

        // Save the INI file
        iniFile.Save();
    }

    static void ReadINI()
    {
        // Check the file exists
        if (FileFuncs.Exists(@"c:\test.ini"))
        {
            // Create the INI file
            INIFile iniFile = new INIFile(@"c:\test.ini");
            // Write some boolean, string and integral values from it to the console
            Console.WriteLine(iniFile.ReadBool("FLAGS", "active", false) ? "Active is ON" : "Active is OFF");
            Console.WriteLine(iniFile.ReadBool("FLAGS", "monitor", false) ? "Monitor is ON" : "Monitor is OFF");
            Console.WriteLine("Department is " + iniFile.ReadString("DATA", "department", "unknown"));
            Console.WriteLine("Employee count is " + iniFile.ReadInt("DATA", "employees", 0).ToString());

            // See how many entries there are in the "EMPLOYEES" section.
            int count = iniFile.ReadSection("EMPLOYEES").Count;
            int index = 0;
            // Loop until we've printed all data from the INI file onto the console.
            while (index < count / 3)
            {
                Console.WriteLine("Name: " + iniFile.ReadString("EMPLOYEES", "emp#" + index.ToString(), "anonymous"));
                Console.WriteLine("Gender: " + iniFile.ReadString("EMPLOYEES", "gen#" + index.ToString(), "?"));
                Console.WriteLine("Age: " + iniFile.ReadInt("EMPLOYEES", "age#" + index.ToString(), 0).ToString());
                ++index;
            }
        }
        else
            Console.WriteLine(@"c:\test.ini file not found.");
    }
}

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<string> ReadSection(
    string section_
)

Parameters

section_
Type: SystemString
Section name from which to return values

Return Value

Type: List String
A list of all values as strings or null if the section does not exist
See Also

Reference

INIFile Class
Bncs.SysUtils Namespace


INIFile.ReadSectionKeys Method

INIFileReadSectionKeys Method
Reads all key names from the supplied Section

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<string> ReadSectionKeys(
    string section_
)

Parameters

section_
Type: SystemString
Section name from which to return key names

Return Value

Type: List String
A list of all key names or null if the section does not exist
See Also

Reference

INIFile Class
Bncs.SysUtils Namespace


INIFile.ReadSectionText Method

INIFileReadSectionText Method
Reads all text from the the supplied Section

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<string> ReadSectionText(
    string section_
)

Parameters

section_
Type: SystemString
Section name from which to return the text

Return Value

Type: List String
All text for the supplied section name including the section header ([]), returns null if the section was not found
See Also

Reference

INIFile Class
Bncs.SysUtils Namespace


INIFile.ReadString Method

INIFileReadString Method
Reads a string value from the INI file
Examples
This code is an example of writing to and reading from an INIFile object.
Copy
class Program
{
    static void Main()
    {
        Console.WriteLine("Writing INI file, press any key to read");
        WriteINI();
        Console.ReadKey();
        ReadINI();
        Console.ReadKey();
    }

    static void WriteINI()
    {
        // Create an INI file
        INIFile iniFile = new INIFile(@"c:\test.ini");
        // Write some boolean, string and integral values to it
        iniFile.WriteBool("FLAGS", "active", true);
        iniFile.WriteBool("FLAGS", "monitor", false);
        iniFile.WriteString("DATA", "department", "Sales");
        iniFile.WriteInt("DATA", "employees", 13);

        // Set up a phoney employee database
        string[] employee1 = { "Rod", "M", "28" };
        string[] employee2 = { "Jane", "F", "21" };
        string[] employee3 = { "Freddie", "M", "31" };
        string[][] employees = new string[3][];
        employees[0] = employee1;
        employees[1] = employee2;
        employees[2] = employee3;

        // Write employee data out to the INI file.
        int index = -1;
        foreach (string[] employee in employees)
        {
            iniFile.WriteString("EMPLOYEES", "emp#" + ((int)(++index)).ToString(), employee[0]);
            iniFile.WriteString("EMPLOYEES", "gen#" + ((int)(index)).ToString(), employee[1]);
            iniFile.WriteInt("EMPLOYEES", "age#" + ((int)(index)).ToString(), Int32.Parse(employee[2]));
        }

        // Save the INI file
        iniFile.Save();
    }

    static void ReadINI()
    {
        // Check the file exists
        if (FileFuncs.Exists(@"c:\test.ini"))
        {
            // Create the INI file
            INIFile iniFile = new INIFile(@"c:\test.ini");
            // Write some boolean, string and integral values from it to the console
            Console.WriteLine(iniFile.ReadBool("FLAGS", "active", false) ? "Active is ON" : "Active is OFF");
            Console.WriteLine(iniFile.ReadBool("FLAGS", "monitor", false) ? "Monitor is ON" : "Monitor is OFF");
            Console.WriteLine("Department is " + iniFile.ReadString("DATA", "department", "unknown"));
            Console.WriteLine("Employee count is " + iniFile.ReadInt("DATA", "employees", 0).ToString());

            // See how many entries there are in the "EMPLOYEES" section.
            int count = iniFile.ReadSection("EMPLOYEES").Count;
            int index = 0;
            // Loop until we've printed all data from the INI file onto the console.
            while (index < count / 3)
            {
                Console.WriteLine("Name: " + iniFile.ReadString("EMPLOYEES", "emp#" + index.ToString(), "anonymous"));
                Console.WriteLine("Gender: " + iniFile.ReadString("EMPLOYEES", "gen#" + index.ToString(), "?"));
                Console.WriteLine("Age: " + iniFile.ReadInt("EMPLOYEES", "age#" + index.ToString(), 0).ToString());
                ++index;
            }
        }
        else
            Console.WriteLine(@"c:\test.ini file not found.");
    }
}

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string ReadString(
    string section_,
    string key_,
    string default_
)

Parameters

section_
Type: SystemString
Section to read from
key_
Type: SystemString
Key to read
default_
Type: SystemString
Default value to return if the section or key are not found

Return Value

Type: String
Returns the string value read or the default value specified if the section or key were not found
See Also

Reference

INIFile Class
Bncs.SysUtils Namespace


INIFile.Save Method

INIFileSave Method
Saves the INI file to disk overwriting any existing file

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Save()

Return Value

Type: Boolean
True on success
See Also

Reference

INIFile Class
Bncs.SysUtils Namespace


INIFile.SaveAs Method

INIFileSaveAs Method
Changes the file name to that supplied and saves the INI file to disk overwriting any existing file

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool SaveAs(
    string filename_
)

Parameters

filename_
Type: SystemString
New file name

Return Value

Type: Boolean
True on success
See Also

Reference

INIFile Class
Bncs.SysUtils Namespace


INIFile.SaveFormatted Method

INIFileSaveFormatted Method
Saves the INI file to disk overwriting any existing file but formats the text to exclude blank lines but insert blank lines between sections

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool SaveFormatted()

Return Value

Type: Boolean
True on success
See Also

Reference

INIFile Class
Bncs.SysUtils Namespace


INIFile.SaveFormattedAs Method

INIFileSaveFormattedAs Method
Changes the file name to that supplied and saves the INI file to disk overwriting any existing file but formats the text to exclude blank lines but insert blank lines between sections

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool SaveFormattedAs(
    string filename_
)

Parameters

filename_
Type: SystemString
New file name

Return Value

Type: Boolean
True on success
See Also

Reference

INIFile Class
Bncs.SysUtils Namespace


INIFile.ToString Method

INIFileToString Method
Returns a string representation of the object.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
The file name.
See Also

Reference

INIFile Class
Bncs.SysUtils Namespace


INIFile.WriteBool Method

INIFileWriteBool Method
Writes a boolean value to the INI file, 1=true and 0=false, to the section and key supplied. If the section and/or key do not exist they are created.
Examples
This code is an example of writing to and reading from an INIFile object.
Copy
class Program
{
    static void Main()
    {
        Console.WriteLine("Writing INI file, press any key to read");
        WriteINI();
        Console.ReadKey();
        ReadINI();
        Console.ReadKey();
    }

    static void WriteINI()
    {
        // Create an INI file
        INIFile iniFile = new INIFile(@"c:\test.ini");
        // Write some boolean, string and integral values to it
        iniFile.WriteBool("FLAGS", "active", true);
        iniFile.WriteBool("FLAGS", "monitor", false);
        iniFile.WriteString("DATA", "department", "Sales");
        iniFile.WriteInt("DATA", "employees", 13);

        // Set up a phoney employee database
        string[] employee1 = { "Rod", "M", "28" };
        string[] employee2 = { "Jane", "F", "21" };
        string[] employee3 = { "Freddie", "M", "31" };
        string[][] employees = new string[3][];
        employees[0] = employee1;
        employees[1] = employee2;
        employees[2] = employee3;

        // Write employee data out to the INI file.
        int index = -1;
        foreach (string[] employee in employees)
        {
            iniFile.WriteString("EMPLOYEES", "emp#" + ((int)(++index)).ToString(), employee[0]);
            iniFile.WriteString("EMPLOYEES", "gen#" + ((int)(index)).ToString(), employee[1]);
            iniFile.WriteInt("EMPLOYEES", "age#" + ((int)(index)).ToString(), Int32.Parse(employee[2]));
        }

        // Save the INI file
        iniFile.Save();
    }

    static void ReadINI()
    {
        // Check the file exists
        if (FileFuncs.Exists(@"c:\test.ini"))
        {
            // Create the INI file
            INIFile iniFile = new INIFile(@"c:\test.ini");
            // Write some boolean, string and integral values from it to the console
            Console.WriteLine(iniFile.ReadBool("FLAGS", "active", false) ? "Active is ON" : "Active is OFF");
            Console.WriteLine(iniFile.ReadBool("FLAGS", "monitor", false) ? "Monitor is ON" : "Monitor is OFF");
            Console.WriteLine("Department is " + iniFile.ReadString("DATA", "department", "unknown"));
            Console.WriteLine("Employee count is " + iniFile.ReadInt("DATA", "employees", 0).ToString());

            // See how many entries there are in the "EMPLOYEES" section.
            int count = iniFile.ReadSection("EMPLOYEES").Count;
            int index = 0;
            // Loop until we've printed all data from the INI file onto the console.
            while (index < count / 3)
            {
                Console.WriteLine("Name: " + iniFile.ReadString("EMPLOYEES", "emp#" + index.ToString(), "anonymous"));
                Console.WriteLine("Gender: " + iniFile.ReadString("EMPLOYEES", "gen#" + index.ToString(), "?"));
                Console.WriteLine("Age: " + iniFile.ReadInt("EMPLOYEES", "age#" + index.ToString(), 0).ToString());
                ++index;
            }
        }
        else
            Console.WriteLine(@"c:\test.ini file not found.");
    }
}

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool WriteBool(
    string section_,
    string key_,
    bool value_
)

Parameters

section_
Type: SystemString
Name of section to write to
key_
Type: SystemString
Name of key to write to
value_
Type: SystemBoolean
Value to write>

Return Value

Type: Boolean
True on success
See Also

Reference

INIFile Class
Bncs.SysUtils Namespace


INIFile.WriteBoolAsText Method

INIFileWriteBoolAsText Method
Writes a boolean as text to the INI file. If the section or key do not exist then they are created.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool WriteBoolAsText(
    string section_,
    string key_,
    bool value_
)

Parameters

section_
Type: SystemString
Name of section to write to
key_
Type: SystemString
Name of key to write to
value_
Type: SystemBoolean
Value to write

Return Value

Type: Boolean
True on success
See Also

Reference

INIFile Class
Bncs.SysUtils Namespace


INIFile.WriteDouble Method

INIFileWriteDouble Method
Writes a double value to the INI file to the section and key supplied. If the section and/or key do not exist they are created.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool WriteDouble(
    string section_,
    string key_,
    double value_
)

Parameters

section_
Type: SystemString
Name of section to write to
key_
Type: SystemString
Name of key to write to
value_
Type: SystemDouble
Value to write>

Return Value

Type: Boolean
True on success
See Also

Reference

INIFile Class
Bncs.SysUtils Namespace


INIFile.WriteInt Method

INIFileWriteInt Method
Writes an integer value to the INI file to the section and key supplied. If the section and/or key do not exist they are created.
Examples
This code is an example of writing to and reading from an INIFile object.
Copy
class Program
{
    static void Main()
    {
        Console.WriteLine("Writing INI file, press any key to read");
        WriteINI();
        Console.ReadKey();
        ReadINI();
        Console.ReadKey();
    }

    static void WriteINI()
    {
        // Create an INI file
        INIFile iniFile = new INIFile(@"c:\test.ini");
        // Write some boolean, string and integral values to it
        iniFile.WriteBool("FLAGS", "active", true);
        iniFile.WriteBool("FLAGS", "monitor", false);
        iniFile.WriteString("DATA", "department", "Sales");
        iniFile.WriteInt("DATA", "employees", 13);

        // Set up a phoney employee database
        string[] employee1 = { "Rod", "M", "28" };
        string[] employee2 = { "Jane", "F", "21" };
        string[] employee3 = { "Freddie", "M", "31" };
        string[][] employees = new string[3][];
        employees[0] = employee1;
        employees[1] = employee2;
        employees[2] = employee3;

        // Write employee data out to the INI file.
        int index = -1;
        foreach (string[] employee in employees)
        {
            iniFile.WriteString("EMPLOYEES", "emp#" + ((int)(++index)).ToString(), employee[0]);
            iniFile.WriteString("EMPLOYEES", "gen#" + ((int)(index)).ToString(), employee[1]);
            iniFile.WriteInt("EMPLOYEES", "age#" + ((int)(index)).ToString(), Int32.Parse(employee[2]));
        }

        // Save the INI file
        iniFile.Save();
    }

    static void ReadINI()
    {
        // Check the file exists
        if (FileFuncs.Exists(@"c:\test.ini"))
        {
            // Create the INI file
            INIFile iniFile = new INIFile(@"c:\test.ini");
            // Write some boolean, string and integral values from it to the console
            Console.WriteLine(iniFile.ReadBool("FLAGS", "active", false) ? "Active is ON" : "Active is OFF");
            Console.WriteLine(iniFile.ReadBool("FLAGS", "monitor", false) ? "Monitor is ON" : "Monitor is OFF");
            Console.WriteLine("Department is " + iniFile.ReadString("DATA", "department", "unknown"));
            Console.WriteLine("Employee count is " + iniFile.ReadInt("DATA", "employees", 0).ToString());

            // See how many entries there are in the "EMPLOYEES" section.
            int count = iniFile.ReadSection("EMPLOYEES").Count;
            int index = 0;
            // Loop until we've printed all data from the INI file onto the console.
            while (index < count / 3)
            {
                Console.WriteLine("Name: " + iniFile.ReadString("EMPLOYEES", "emp#" + index.ToString(), "anonymous"));
                Console.WriteLine("Gender: " + iniFile.ReadString("EMPLOYEES", "gen#" + index.ToString(), "?"));
                Console.WriteLine("Age: " + iniFile.ReadInt("EMPLOYEES", "age#" + index.ToString(), 0).ToString());
                ++index;
            }
        }
        else
            Console.WriteLine(@"c:\test.ini file not found.");
    }
}

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool WriteInt(
    string section_,
    string key_,
    int value_
)

Parameters

section_
Type: SystemString
Name of section to write to
key_
Type: SystemString
Name of key to write to
value_
Type: SystemInt32
Value to write>

Return Value

Type: Boolean
True on success
See Also

Reference

INIFile Class
Bncs.SysUtils Namespace


INIFile.WriteString Method

INIFileWriteString Method
Writes a string value to the INI file to the section and key supplied. If the section and/or key do not exist they are created.
Examples
This code is an example of writing to and reading from an INIFile object.
Copy
class Program
{
    static void Main()
    {
        Console.WriteLine("Writing INI file, press any key to read");
        WriteINI();
        Console.ReadKey();
        ReadINI();
        Console.ReadKey();
    }

    static void WriteINI()
    {
        // Create an INI file
        INIFile iniFile = new INIFile(@"c:\test.ini");
        // Write some boolean, string and integral values to it
        iniFile.WriteBool("FLAGS", "active", true);
        iniFile.WriteBool("FLAGS", "monitor", false);
        iniFile.WriteString("DATA", "department", "Sales");
        iniFile.WriteInt("DATA", "employees", 13);

        // Set up a phoney employee database
        string[] employee1 = { "Rod", "M", "28" };
        string[] employee2 = { "Jane", "F", "21" };
        string[] employee3 = { "Freddie", "M", "31" };
        string[][] employees = new string[3][];
        employees[0] = employee1;
        employees[1] = employee2;
        employees[2] = employee3;

        // Write employee data out to the INI file.
        int index = -1;
        foreach (string[] employee in employees)
        {
            iniFile.WriteString("EMPLOYEES", "emp#" + ((int)(++index)).ToString(), employee[0]);
            iniFile.WriteString("EMPLOYEES", "gen#" + ((int)(index)).ToString(), employee[1]);
            iniFile.WriteInt("EMPLOYEES", "age#" + ((int)(index)).ToString(), Int32.Parse(employee[2]));
        }

        // Save the INI file
        iniFile.Save();
    }

    static void ReadINI()
    {
        // Check the file exists
        if (FileFuncs.Exists(@"c:\test.ini"))
        {
            // Create the INI file
            INIFile iniFile = new INIFile(@"c:\test.ini");
            // Write some boolean, string and integral values from it to the console
            Console.WriteLine(iniFile.ReadBool("FLAGS", "active", false) ? "Active is ON" : "Active is OFF");
            Console.WriteLine(iniFile.ReadBool("FLAGS", "monitor", false) ? "Monitor is ON" : "Monitor is OFF");
            Console.WriteLine("Department is " + iniFile.ReadString("DATA", "department", "unknown"));
            Console.WriteLine("Employee count is " + iniFile.ReadInt("DATA", "employees", 0).ToString());

            // See how many entries there are in the "EMPLOYEES" section.
            int count = iniFile.ReadSection("EMPLOYEES").Count;
            int index = 0;
            // Loop until we've printed all data from the INI file onto the console.
            while (index < count / 3)
            {
                Console.WriteLine("Name: " + iniFile.ReadString("EMPLOYEES", "emp#" + index.ToString(), "anonymous"));
                Console.WriteLine("Gender: " + iniFile.ReadString("EMPLOYEES", "gen#" + index.ToString(), "?"));
                Console.WriteLine("Age: " + iniFile.ReadInt("EMPLOYEES", "age#" + index.ToString(), 0).ToString());
                ++index;
            }
        }
        else
            Console.WriteLine(@"c:\test.ini file not found.");
    }
}

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool WriteString(
    string section_,
    string key_,
    string value_
)

Parameters

section_
Type: SystemString
Name of section to write to
key_
Type: SystemString
Name of key to write to
value_
Type: SystemString
Value to write>

Return Value

Type: Boolean
True on success
See Also

Reference

INIFile Class
Bncs.SysUtils Namespace


INIFile Properties

INIFile Properties

The INIFile type exposes the following members.

Properties
 | Name | Description
Public property | Edited | Gets a value that betrays whether the file has been edited since it's last save.
Public property | Filename | Gets the file name of the INI file
Public property | ToText | Gets the full text listing of the INI file
Public property | WriteDefaultsToFileWhenReturned | Gets or sets a flag that when set ensures entries are written to disk when a default value is returned from any of the read methods. The default for this value is FALSE.
Public property | WriteMode | Gets or sets the write mode. This effects the behaviour of methods WriteString(), WriteInt(), WriteBool() and WriteBoolAsText(). When WriteMode is set to Disk the written value is saved to file else it only exists in memory until the Save() method is called.
Top
See Also

Reference

INIFile Class
Bncs.SysUtils Namespace


INIFile.Edited Property

INIFileEdited Property
Gets a value that betrays whether the file has been edited since it's last save.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Edited { get; }

Property Value

Type: Boolean
See Also

Reference

INIFile Class
Bncs.SysUtils Namespace


INIFile.Filename Property

INIFileFilename Property
Gets the file name of the INI file

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Filename { get; set; }

Property Value

Type: String
See Also

Reference

INIFile Class
Bncs.SysUtils Namespace


INIFile.ToText Property

INIFileToText Property
Gets the full text listing of the INI file

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<string> ToText { get; }

Property Value

Type: List String
See Also

Reference

INIFile Class
Bncs.SysUtils Namespace


INIFile.WriteDefaultsToFileWhenReturned Property

INIFileWriteDefaultsToFileWhenReturned Property
Gets or sets a flag that when set ensures entries are written to disk when a default value is returned from any of the read methods. The default for this value is FALSE.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool WriteDefaultsToFileWhenReturned { get; set; }

Property Value

Type: Boolean
See Also

Reference

INIFile Class
Bncs.SysUtils Namespace


INIFile.WriteMode Property

INIFileWriteMode Property
Gets or sets the write mode. This effects the behaviour of methods WriteString(), WriteInt(), WriteBool() and WriteBoolAsText(). When WriteMode is set to Disk the written value is saved to file else it only exists in memory until the Save() method is called.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public WriteMode WriteMode { get; set; }

Property Value

Type: WriteMode
See Also

Reference

INIFile Class
Bncs.SysUtils Namespace


INILineType Enumeration

INILineType Enumeration
Enumeration of INI file line types

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum INILineType
Members
Member name | Value | Description
Unknown | 0 | Line type is unknown
Section | 1 | Line is a section header
Setting | 2 | Line is a setting
Blank | 3 | Line is blank
Comment | 4 | Line is a comment
See Also

Reference

Bncs.SysUtils Namespace


LinkFile Class

LinkFile Class
A class that reads Windows shortcut files (.LNK) and extracts it's data.
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsLinkFile

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class LinkFile

The LinkFile type exposes the following members.

Constructors
Name Description
Public method LinkFile(String)
Constructor that accepts a link file name and extracts it's data and ignores an external similarly named ico file should it exist.
LinkFile(String, IconLoadBehaviour)
Constructor that accepts a link file name and icon behaviour and then extracts it's data.
Examples
This example demonstrates how to read a link file and do something with it.
Copy
using Bncs.SysUtils;
using Bncs.Graphics;
using Bncs.Execute;

private bool AddToMenu()
{
    // Create a link file object from a path to a link, if the link has no icon but a "Notepad.ico" exists then this icon will be loaded.
    LinkFile link = new LinkFile(@"c:\shortcuts\Notepad.lnk", IconLoadBehaviour.SecondaryExternalIconFile);
    if (null != link.Target) // Must have a target
    {
        // Create a menu item using the links display name
        MenuItem item = new MenuItem();
        item.Header = link.DisplayName;
        // Attach the link file to the menu
        item.Tag = link;
        if (null != link.Image) // If we have an image then show it on the menu ...
        {
            // Create and size appropriatley
            System.Windows.Controls.Image image = new System.Windows.Controls.Image();
            image.Height = _useSmallIcons ? 16 : 32;
            image.Width = image.Height;
            // Set the image source from the link files image
            image.Source = new Picture(link.Image).ToImageSource;
            // Attach the image to the menu items icon property
            item.Icon = image;
        }
        // Assign a generic click handler
        item.Click += ItemClick;
        // Add item to parent menu
        mainMenu.Items.Add(item);
        return true;
    }
    else
        MessageBox.Show("The selected link has no target file.", "Error");
    return false;
}

private void ItemClick(object sender, RoutedEventArgs e)
{
    // Get the link file from the menu items Tag property
    LinkFile link = (LinkFile)(((MenuItem)sender).Tag);
    if (null != link && File.Exists(link.Target))
    {
        // Run the target
        if (!Execute.Run(link.Target))
            MessageBox.Show("An error occured.", "Error");
    }
}
Public method LinkFile(String, String)
Constructor that sets the target file and display name.
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the instance. (Overrides ObjectToString.)
Top
Properties
 | Name | Description
Public property | Arguments | Gets the argument value.
Public property | Description | Gets the display name
Public property | DisplayName | Gets the display name value.
Public property | Filename | Gets the link file name value.
Public property | IconBehaviour | Gets the icon behaviour value. This can only be set through one of the constructors, default is IconLoadBehaviour.IgnoreExternalICOFile.
Public property | Image | Gets or sets the icon image.
Public property | Process | Gets or sets the process.
Public property | Target | Gets the target value.
Public property | Uid | Gets the UID value.
Top
See Also

Reference

Bncs.SysUtils Namespace


LinkFile Constructor

LinkFile Constructor
Overload List
Name Description
Public method LinkFile(String)
Constructor that accepts a link file name and extracts it's data and ignores an external similarly named ico file should it exist.
LinkFile(String, IconLoadBehaviour)
Constructor that accepts a link file name and icon behaviour and then extracts it's data.
Examples
This example demonstrates how to read a link file and do something with it.
Copy
using Bncs.SysUtils;
using Bncs.Graphics;
using Bncs.Execute;

private bool AddToMenu()
{
    // Create a link file object from a path to a link, if the link has no icon but a "Notepad.ico" exists then this icon will be loaded.
    LinkFile link = new LinkFile(@"c:\shortcuts\Notepad.lnk", IconLoadBehaviour.SecondaryExternalIconFile);
    if (null != link.Target) // Must have a target
    {
        // Create a menu item using the links display name
        MenuItem item = new MenuItem();
        item.Header = link.DisplayName;
        // Attach the link file to the menu
        item.Tag = link;
        if (null != link.Image) // If we have an image then show it on the menu ...
        {
            // Create and size appropriatley
            System.Windows.Controls.Image image = new System.Windows.Controls.Image();
            image.Height = _useSmallIcons ? 16 : 32;
            image.Width = image.Height;
            // Set the image source from the link files image
            image.Source = new Picture(link.Image).ToImageSource;
            // Attach the image to the menu items icon property
            item.Icon = image;
        }
        // Assign a generic click handler
        item.Click += ItemClick;
        // Add item to parent menu
        mainMenu.Items.Add(item);
        return true;
    }
    else
        MessageBox.Show("The selected link has no target file.", "Error");
    return false;
}

private void ItemClick(object sender, RoutedEventArgs e)
{
    // Get the link file from the menu items Tag property
    LinkFile link = (LinkFile)(((MenuItem)sender).Tag);
    if (null != link && File.Exists(link.Target))
    {
        // Run the target
        if (!Execute.Run(link.Target))
            MessageBox.Show("An error occured.", "Error");
    }
}
Public method LinkFile(String, String)
Constructor that sets the target file and display name.
Top
See Also

Reference

LinkFile Class
Bncs.SysUtils Namespace


LinkFile Constructor (String)

LinkFile Constructor (String)
Constructor that accepts a link file name and extracts it's data and ignores an external similarly named ico file should it exist.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public LinkFile(
    string filename_
)

Parameters

filename_
Type: SystemString
Windows shortcut (.lnk file) to read.
See Also

Reference

LinkFile Class
LinkFile Overload
Bncs.SysUtils Namespace


LinkFile Constructor (String, IconLoadBehaviour)

LinkFile Constructor (String, IconLoadBehaviour)
Constructor that accepts a link file name and icon behaviour and then extracts it's data.
Examples
This example demonstrates how to read a link file and do something with it.
Copy
using Bncs.SysUtils;
using Bncs.Graphics;
using Bncs.Execute;

private bool AddToMenu()
{
    // Create a link file object from a path to a link, if the link has no icon but a "Notepad.ico" exists then this icon will be loaded.
    LinkFile link = new LinkFile(@"c:\shortcuts\Notepad.lnk", IconLoadBehaviour.SecondaryExternalIconFile);
    if (null != link.Target) // Must have a target
    {
        // Create a menu item using the links display name
        MenuItem item = new MenuItem();
        item.Header = link.DisplayName;
        // Attach the link file to the menu
        item.Tag = link;
        if (null != link.Image) // If we have an image then show it on the menu ...
        {
            // Create and size appropriatley
            System.Windows.Controls.Image image = new System.Windows.Controls.Image();
            image.Height = _useSmallIcons ? 16 : 32;
            image.Width = image.Height;
            // Set the image source from the link files image
            image.Source = new Picture(link.Image).ToImageSource;
            // Attach the image to the menu items icon property
            item.Icon = image;
        }
        // Assign a generic click handler
        item.Click += ItemClick;
        // Add item to parent menu
        mainMenu.Items.Add(item);
        return true;
    }
    else
        MessageBox.Show("The selected link has no target file.", "Error");
    return false;
}

private void ItemClick(object sender, RoutedEventArgs e)
{
    // Get the link file from the menu items Tag property
    LinkFile link = (LinkFile)(((MenuItem)sender).Tag);
    if (null != link && File.Exists(link.Target))
    {
        // Run the target
        if (!Execute.Run(link.Target))
            MessageBox.Show("An error occured.", "Error");
    }
}

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public LinkFile(
    string filename_,
    IconLoadBehaviour iconBehaviour_
)

Parameters

filename_
Type: SystemString
Windows shortcut (.lnk file) to read.
iconBehaviour_
Type: Bncs.SysUtilsIconLoadBehaviour
Sets the icon behaviour.
See Also

Reference

LinkFile Class
LinkFile Overload
Bncs.SysUtils Namespace


LinkFile Constructor (String, String)

LinkFile Constructor (String, String)
Constructor that sets the target file and display name.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public LinkFile(
    string target_,
    string displayName_
)

Parameters

target_
Type: SystemString
Target file
displayName_
Type: SystemString
Display name
See Also

Reference

LinkFile Class
LinkFile Overload
Bncs.SysUtils Namespace


LinkFile Methods

LinkFile Methods

The LinkFile type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string representation of the instance. (Overrides ObjectToString.)
Top
See Also

Reference

LinkFile Class
Bncs.SysUtils Namespace


LinkFile.ToString Method

LinkFileToString Method
Returns a string representation of the instance.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
Returns the instance as a string.
See Also

Reference

LinkFile Class
Bncs.SysUtils Namespace


LinkFile Properties

LinkFile Properties

The LinkFile type exposes the following members.

Properties
 | Name | Description
Public property | Arguments | Gets the argument value.
Public property | Description | Gets the display name
Public property | DisplayName | Gets the display name value.
Public property | Filename | Gets the link file name value.
Public property | IconBehaviour | Gets the icon behaviour value. This can only be set through one of the constructors, default is IconLoadBehaviour.IgnoreExternalICOFile.
Public property | Image | Gets or sets the icon image.
Public property | Process | Gets or sets the process.
Public property | Target | Gets the target value.
Public property | Uid | Gets the UID value.
Top
See Also

Reference

LinkFile Class
Bncs.SysUtils Namespace


LinkFile.Arguments Property

LinkFileArguments Property
Gets the argument value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Arguments { get; }

Property Value

Type: String
See Also

Reference

LinkFile Class
Bncs.SysUtils Namespace


LinkFile.Description Property

LinkFileDescription Property
Gets the display name

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Description { get; }

Property Value

Type: String
See Also

Reference

LinkFile Class
Bncs.SysUtils Namespace


LinkFile.DisplayName Property

LinkFileDisplayName Property
Gets the display name value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string DisplayName { get; }

Property Value

Type: String
See Also

Reference

LinkFile Class
Bncs.SysUtils Namespace


LinkFile.Filename Property

LinkFileFilename Property
Gets the link file name value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Filename { get; }

Property Value

Type: String
See Also

Reference

LinkFile Class
Bncs.SysUtils Namespace


LinkFile.IconBehaviour Property

LinkFileIconBehaviour Property
Gets the icon behaviour value. This can only be set through one of the constructors, default is IconLoadBehaviour.IgnoreExternalICOFile.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public IconLoadBehaviour IconBehaviour { get; }

Property Value

Type: IconLoadBehaviour
See Also

Reference

LinkFile Class
Bncs.SysUtils Namespace


LinkFile.Image Property

LinkFileImage Property
Gets or sets the icon image.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Image Image { get; set; }

Property Value

Type: Image
See Also

Reference

LinkFile Class
Bncs.SysUtils Namespace


LinkFile.Process Property

LinkFileProcess Property
Gets or sets the process.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Process Process { get; set; }

Property Value

Type: Process
See Also

Reference

LinkFile Class
Bncs.SysUtils Namespace


LinkFile.Target Property

LinkFileTarget Property
Gets the target value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Target { get; }

Property Value

Type: String
See Also

Reference

LinkFile Class
Bncs.SysUtils Namespace


LinkFile.Uid Property

LinkFileUid Property
Gets the UID value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Uid { get; }

Property Value

Type: String
See Also

Reference

LinkFile Class
Bncs.SysUtils Namespace


MultiFileCopier Class

MultiFileCopier Class
A class that executes multiple file copies in a seperate thread
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsMultiFileCopier

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class MultiFileCopier

The MultiFileCopier type exposes the following members.

Constructors
 | Name | Description
Public method | MultiFileCopier | Default constructor
Public method | MultiFileCopier(Boolean) | Constructor that sets the _ignoreCopyIfFileExists flag.
Top
Methods
 | Name | Description
Public method | Add | Adds a pairing to the list
Public method | Copy | Start the copy asynchronously
Public method | Copy(Boolean) | Start the copy asynchronously or synchronously
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Terminate | Aborts the copy operation.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | Copying | Gets the copying flag.
Public property | Count | Gets the file count.
Public property | FilesCopied | Gets a list of copied files.
Top
Events
 | Name | Description
Public event | OnCopy | Event that fires on each copy completion.
Top
See Also

Reference

Bncs.SysUtils Namespace


MultiFileCopier Constructor

MultiFileCopier Constructor
Overload List
 | Name | Description
Public method | MultiFileCopier | Default constructor
Public method | MultiFileCopier(Boolean) | Constructor that sets the _ignoreCopyIfFileExists flag.
Top
See Also

Reference

MultiFileCopier Class
Bncs.SysUtils Namespace


MultiFileCopier Constructor

MultiFileCopier Constructor
Default constructor

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public MultiFileCopier()
See Also

Reference

MultiFileCopier Class
MultiFileCopier Overload
Bncs.SysUtils Namespace


MultiFileCopier Constructor (Boolean)

MultiFileCopier Constructor (Boolean)
Constructor that sets the _ignoreCopyIfFileExists flag.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public MultiFileCopier(
    bool ignoreCopyIfFileExists_
)

Parameters

ignoreCopyIfFileExists_
Type: SystemBoolean
Flag for skipping a copy when the target exists.
See Also

Reference

MultiFileCopier Class
MultiFileCopier Overload
Bncs.SysUtils Namespace


MultiFileCopier Methods

MultiFileCopier Methods

The MultiFileCopier type exposes the following members.

Methods
 | Name | Description
Public method | Add | Adds a pairing to the list
Public method | Copy | Start the copy asynchronously
Public method | Copy(Boolean) | Start the copy asynchronously or synchronously
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Terminate | Aborts the copy operation.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

MultiFileCopier Class
Bncs.SysUtils Namespace


MultiFileCopier.Add Method

MultiFileCopierAdd Method
Adds a pairing to the list

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Add(
    FileCopyPairing pairing_
)

Parameters

pairing_
Type: Bncs.SysUtilsFileCopyPairing
Pairing to add

Return Value

Type: Boolean
True on success
See Also

Reference

MultiFileCopier Class
Bncs.SysUtils Namespace


MultiFileCopier.Copy Method

MultiFileCopierCopy Method
Overload List
 | Name | Description
Public method | Copy | Start the copy asynchronously
Public method | Copy(Boolean) | Start the copy asynchronously or synchronously
Top
See Also

Reference

MultiFileCopier Class
Bncs.SysUtils Namespace


MultiFileCopier.Copy Method

MultiFileCopierCopy Method
Start the copy asynchronously

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Copy()

Return Value

Type: Boolean
True if the copy is in progress
See Also

Reference

MultiFileCopier Class
Copy Overload
Bncs.SysUtils Namespace


MultiFileCopier.Copy Method (Boolean)

MultiFileCopierCopy Method (Boolean)
Start the copy asynchronously or synchronously

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Copy(
    bool wait_
)

Parameters

wait_
Type: SystemBoolean
If true run synchronously

Return Value

Type: Boolean
True if copying is underway
See Also

Reference

MultiFileCopier Class
Copy Overload
Bncs.SysUtils Namespace


MultiFileCopier.Terminate Method

MultiFileCopierTerminate Method
Aborts the copy operation.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Terminate(
    int timeout_
)

Parameters

timeout_
Type: SystemInt32
Timeout in milliseconds. If greater than zero this method will not return until the thread terminates or until the timeout passes
See Also

Reference

MultiFileCopier Class
Bncs.SysUtils Namespace


MultiFileCopier Properties

MultiFileCopier Properties

The MultiFileCopier type exposes the following members.

Properties
 | Name | Description
Public property | Copying | Gets the copying flag.
Public property | Count | Gets the file count.
Public property | FilesCopied | Gets a list of copied files.
Top
See Also

Reference

MultiFileCopier Class
Bncs.SysUtils Namespace


MultiFileCopier.Copying Property

MultiFileCopierCopying Property
Gets the copying flag.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Copying { get; }

Property Value

Type: Boolean
See Also

Reference

MultiFileCopier Class
Bncs.SysUtils Namespace


MultiFileCopier.Count Property

MultiFileCopierCount Property
Gets the file count.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Count { get; }

Property Value

Type: Boolean
See Also

Reference

MultiFileCopier Class
Bncs.SysUtils Namespace


MultiFileCopier.FilesCopied Property

MultiFileCopierFilesCopied Property
Gets a list of copied files.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<string> FilesCopied { get; }

Property Value

Type: List String
See Also

Reference

MultiFileCopier Class
Bncs.SysUtils Namespace


MultiFileCopier Events

MultiFileCopier Events

The MultiFileCopier type exposes the following members.

Events
 | Name | Description
Public event | OnCopy | Event that fires on each copy completion.
Top
See Also

Reference

MultiFileCopier Class
Bncs.SysUtils Namespace


MultiFileCopier.OnCopy Event

MultiFileCopierOnCopy Event
Event that fires on each copy completion.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnFileCopyEventHandler OnCopy

Value

Type: Bncs.SysUtilsOnFileCopyEventHandler
See Also

Reference

MultiFileCopier Class
Bncs.SysUtils Namespace


OnCompletedEventArgs Class

OnCompletedEventArgs Class
Event arguments for split/join completed
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.SysUtilsOnCompletedEventArgs

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class OnCompletedEventArgs : EventArgs

The OnCompletedEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | OnCompletedEventArgs | Initializes a new instance of the OnCompletedEventArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | Operation | Operation indicator
Public field | OriginalFilename | The original file name
Public field | SegmentedFilenames | The segmented file name
Public field | Success | Success flag
Top
See Also

Reference

Bncs.SysUtils Namespace


OnCompletedEventArgs Constructor

OnCompletedEventArgs Constructor
Initializes a new instance of the OnCompletedEventArgs class

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public OnCompletedEventArgs()
See Also

Reference

OnCompletedEventArgs Class
Bncs.SysUtils Namespace


OnCompletedEventArgs Fields

OnCompletedEventArgs Fields

The OnCompletedEventArgs type exposes the following members.

Fields
 | Name | Description
Public field | Operation | Operation indicator
Public field | OriginalFilename | The original file name
Public field | SegmentedFilenames | The segmented file name
Public field | Success | Success flag
Top
See Also

Reference

OnCompletedEventArgs Class
Bncs.SysUtils Namespace


OnCompletedEventArgs.Operation Field

OnCompletedEventArgsOperation Field
Operation indicator

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public SplitOperation Operation

Field Value

Type: SplitOperation
See Also

Reference

OnCompletedEventArgs Class
Bncs.SysUtils Namespace


OnCompletedEventArgs.OriginalFilename Field

OnCompletedEventArgsOriginalFilename Field
The original file name

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string OriginalFilename

Field Value

Type: String
See Also

Reference

OnCompletedEventArgs Class
Bncs.SysUtils Namespace


OnCompletedEventArgs.SegmentedFilenames Field

OnCompletedEventArgsSegmentedFilenames Field
The segmented file name

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<string> SegmentedFilenames

Field Value

Type: List String
See Also

Reference

OnCompletedEventArgs Class
Bncs.SysUtils Namespace


OnCompletedEventArgs.Success Field

OnCompletedEventArgsSuccess Field
Success flag

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Success

Field Value

Type: Boolean
See Also

Reference

OnCompletedEventArgs Class
Bncs.SysUtils Namespace


OnCompletedEventArgs Methods

OnCompletedEventArgs Methods

The OnCompletedEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

OnCompletedEventArgs Class
Bncs.SysUtils Namespace


OnCompletedEventHandler Delegate

OnCompletedEventHandler Delegate
Event handler delegate for split/join completed

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void OnCompletedEventHandler(
    Object sender,
    OnCompletedEventArgs e
)

Parameters

sender
Type: SystemObject
Calling object
e
Type: Bncs.SysUtilsOnCompletedEventArgs
Parameters
See Also

Reference

Bncs.SysUtils Namespace


OnFileCopyEventArgs Class

OnFileCopyEventArgs Class
Argument class for the OnFileCopyEventHandler
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.SysUtilsOnFileCopyEventArgs

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class OnFileCopyEventArgs : EventArgs

The OnFileCopyEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | OnFileCopyEventArgs | Initializes a new instance of the OnFileCopyEventArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | AmountComplete | Amount of bytes completed.
Public field | Complete | Completed flag.
Public field | Reference | Reference
Public field | Source | Source file name.
Public field | Success | Success flag.
Public field | Target | Target file name.
Top
See Also

Reference

Bncs.SysUtils Namespace


OnFileCopyEventArgs Constructor

OnFileCopyEventArgs Constructor
Initializes a new instance of the OnFileCopyEventArgs class

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public OnFileCopyEventArgs()
See Also

Reference

OnFileCopyEventArgs Class
Bncs.SysUtils Namespace


OnFileCopyEventArgs Fields

OnFileCopyEventArgs Fields

The OnFileCopyEventArgs type exposes the following members.

Fields
 | Name | Description
Public field | AmountComplete | Amount of bytes completed.
Public field | Complete | Completed flag.
Public field | Reference | Reference
Public field | Source | Source file name.
Public field | Success | Success flag.
Public field | Target | Target file name.
Top
See Also

Reference

OnFileCopyEventArgs Class
Bncs.SysUtils Namespace


OnFileCopyEventArgs.AmountComplete Field

OnFileCopyEventArgsAmountComplete Field
Amount of bytes completed.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int AmountComplete

Field Value

Type: Int32
See Also

Reference

OnFileCopyEventArgs Class
Bncs.SysUtils Namespace


OnFileCopyEventArgs.Complete Field

OnFileCopyEventArgsComplete Field
Completed flag.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Complete

Field Value

Type: Boolean
See Also

Reference

OnFileCopyEventArgs Class
Bncs.SysUtils Namespace


OnFileCopyEventArgs.Reference Field

OnFileCopyEventArgsReference Field
Reference

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Reference

Field Value

Type: Int32
See Also

Reference

OnFileCopyEventArgs Class
Bncs.SysUtils Namespace


OnFileCopyEventArgs.Source Field

OnFileCopyEventArgsSource Field
Source file name.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Source

Field Value

Type: String
See Also

Reference

OnFileCopyEventArgs Class
Bncs.SysUtils Namespace


OnFileCopyEventArgs.Success Field

OnFileCopyEventArgsSuccess Field
Success flag.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Success

Field Value

Type: Boolean
See Also

Reference

OnFileCopyEventArgs Class
Bncs.SysUtils Namespace


OnFileCopyEventArgs.Target Field

OnFileCopyEventArgsTarget Field
Target file name.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Target

Field Value

Type: String
See Also

Reference

OnFileCopyEventArgs Class
Bncs.SysUtils Namespace


OnFileCopyEventArgs Methods

OnFileCopyEventArgs Methods

The OnFileCopyEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

OnFileCopyEventArgs Class
Bncs.SysUtils Namespace


OnFileCopyEventHandler Delegate

OnFileCopyEventHandler Delegate
Delegate for the [!:Bncs.SysUtils.MultiFileCopier.OnFileCopy] event

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void OnFileCopyEventHandler(
    Object sender,
    OnFileCopyEventArgs args
)

Parameters

sender
Type: SystemObject
Calling object.
args
Type: Bncs.SysUtilsOnFileCopyEventArgs
Parameters.
See Also

Reference

Bncs.SysUtils Namespace


OnProgressEventArgs Class

OnProgressEventArgs Class
Event handler and arguments for split/join progress
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.SysUtilsOnProgressEventArgs

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class OnProgressEventArgs : EventArgs

The OnProgressEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | OnProgressEventArgs | Initializes a new instance of the OnProgressEventArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | CurrentFilename | Gets or sets the current file name.
Public field | Operation | Gets or sets the operation.
Public field | OriginalFilename | Gets or sets the original file name.
Public field | Percentage | Gets or sets the percentage.
Top
See Also

Reference

Bncs.SysUtils Namespace


OnProgressEventArgs Constructor

OnProgressEventArgs Constructor
Initializes a new instance of the OnProgressEventArgs class

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public OnProgressEventArgs()
See Also

Reference

OnProgressEventArgs Class
Bncs.SysUtils Namespace


OnProgressEventArgs Fields

OnProgressEventArgs Fields

The OnProgressEventArgs type exposes the following members.

Fields
 | Name | Description
Public field | CurrentFilename | Gets or sets the current file name.
Public field | Operation | Gets or sets the operation.
Public field | OriginalFilename | Gets or sets the original file name.
Public field | Percentage | Gets or sets the percentage.
Top
See Also

Reference

OnProgressEventArgs Class
Bncs.SysUtils Namespace


OnProgressEventArgs.CurrentFilename Field

OnProgressEventArgsCurrentFilename Field
Gets or sets the current file name.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string CurrentFilename

Field Value

Type: String
See Also

Reference

OnProgressEventArgs Class
Bncs.SysUtils Namespace


OnProgressEventArgs.Operation Field

OnProgressEventArgsOperation Field
Gets or sets the operation.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public SplitOperation Operation

Field Value

Type: SplitOperation
See Also

Reference

OnProgressEventArgs Class
Bncs.SysUtils Namespace


OnProgressEventArgs.OriginalFilename Field

OnProgressEventArgsOriginalFilename Field
Gets or sets the original file name.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string OriginalFilename

Field Value

Type: String
See Also

Reference

OnProgressEventArgs Class
Bncs.SysUtils Namespace


OnProgressEventArgs.Percentage Field

OnProgressEventArgsPercentage Field
Gets or sets the percentage.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Percentage

Field Value

Type: Int32
See Also

Reference

OnProgressEventArgs Class
Bncs.SysUtils Namespace


OnProgressEventArgs Methods

OnProgressEventArgs Methods

The OnProgressEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

OnProgressEventArgs Class
Bncs.SysUtils Namespace


OnProgressEventHandler Delegate

OnProgressEventHandler Delegate
Delegate for split/join progress events.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void OnProgressEventHandler(
    Object sender,
    OnProgressEventArgs e
)

Parameters

sender
Type: SystemObject
Calling object
e
Type: Bncs.SysUtilsOnProgressEventArgs
Parameters
See Also

Reference

Bncs.SysUtils Namespace


OnTextFileErrorEventArgs Class

OnTextFileErrorEventArgs Class
Event argument class for TextFile class errors
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsOnTextFileErrorEventArgs

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class OnTextFileErrorEventArgs

The OnTextFileErrorEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | OnTextFileErrorEventArgs | Initializes a new instance of the OnTextFileErrorEventArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | ErrorMessage | Contains the last error message
Public field | Method | Name of the method in which the error occured
Top
See Also

Reference

Bncs.SysUtils Namespace


OnTextFileErrorEventArgs Constructor

OnTextFileErrorEventArgs Constructor
Initializes a new instance of the OnTextFileErrorEventArgs class

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public OnTextFileErrorEventArgs()
See Also

Reference

OnTextFileErrorEventArgs Class
Bncs.SysUtils Namespace


OnTextFileErrorEventArgs Fields

OnTextFileErrorEventArgs Fields

The OnTextFileErrorEventArgs type exposes the following members.

Fields
 | Name | Description
Public field | ErrorMessage | Contains the last error message
Public field | Method | Name of the method in which the error occured
Top
See Also

Reference

OnTextFileErrorEventArgs Class
Bncs.SysUtils Namespace


OnTextFileErrorEventArgs.ErrorMessage Field

OnTextFileErrorEventArgsErrorMessage Field
Contains the last error message

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string ErrorMessage

Field Value

Type: String
See Also

Reference

OnTextFileErrorEventArgs Class
Bncs.SysUtils Namespace


OnTextFileErrorEventArgs.Method Field

OnTextFileErrorEventArgsMethod Field
Name of the method in which the error occured

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Method

Field Value

Type: String
See Also

Reference

OnTextFileErrorEventArgs Class
Bncs.SysUtils Namespace


OnTextFileErrorEventArgs Methods

OnTextFileErrorEventArgs Methods

The OnTextFileErrorEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

OnTextFileErrorEventArgs Class
Bncs.SysUtils Namespace


OnTextFileErrorEventHandler Delegate

OnTextFileErrorEventHandler Delegate
Event handler delegate for TextFile class errors

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void OnTextFileErrorEventHandler(
    Object sender,
    OnTextFileErrorEventArgs e
)

Parameters

sender
Type: SystemObject
Calling object
e
Type: Bncs.SysUtilsOnTextFileErrorEventArgs
Parameters
See Also

Reference

Bncs.SysUtils Namespace


OnWindowUpdateEventArgs Class

OnWindowUpdateEventArgs Class
Event args class for WndMonitor events.
Inheritance Hierarchy
SystemObject
SystemEventArgs
Bncs.SysUtilsOnWindowUpdateEventArgs

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class OnWindowUpdateEventArgs : EventArgs

The OnWindowUpdateEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | OnWindowUpdateEventArgs | Initializes a new instance of the OnWindowUpdateEventArgs class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Fields
 | Name | Description
Public field | Window |
Top
See Also

Reference

Bncs.SysUtils Namespace


OnWindowUpdateEventArgs Constructor

OnWindowUpdateEventArgs Constructor
Initializes a new instance of the OnWindowUpdateEventArgs class

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public OnWindowUpdateEventArgs()
See Also

Reference

OnWindowUpdateEventArgs Class
Bncs.SysUtils Namespace


OnWindowUpdateEventArgs Fields

OnWindowUpdateEventArgs Fields

The OnWindowUpdateEventArgs type exposes the following members.

Fields
 | Name | Description
Public field | Window |
Top
See Also

Reference

OnWindowUpdateEventArgs Class
Bncs.SysUtils Namespace


OnWindowUpdateEventArgs.Window Field

OnWindowUpdateEventArgsWindow Field

[Missing <summary> documentation for "F:Bncs.SysUtils.OnWindowUpdateEventArgs.Window"]

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public HwndInfo Window

Field Value

Type: HwndInfo
See Also

Reference

OnWindowUpdateEventArgs Class
Bncs.SysUtils Namespace


OnWindowUpdateEventArgs Methods

OnWindowUpdateEventArgs Methods

The OnWindowUpdateEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

OnWindowUpdateEventArgs Class
Bncs.SysUtils Namespace


OnWindowUpdateEventHandler Delegate

OnWindowUpdateEventHandler Delegate
Event handler delegate for WndMonitor events.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void OnWindowUpdateEventHandler(
    Object sender,
    OnWindowUpdateEventArgs e
)

Parameters

sender
Type: SystemObject
Calling object
e
Type: Bncs.SysUtilsOnWindowUpdateEventArgs
Arguments
See Also

Reference

Bncs.SysUtils Namespace


PathLocale Enumeration

PathLocale Enumeration
Path location type enumeration

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum PathLocale
Members
Member name | Value | Description
Unknown | 0 | The directory locale cannot be determined.
NotADirectory | 1 | The "directory" is not actually a disk directory.
Local | 2 | The directory resides on the local computer.
Remote | 3 | The directory exists on a remote computer.
See Also

Reference

Bncs.SysUtils Namespace


Range Class

Range Class
Class that stores a range of integers for range checking purposes.
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsRange

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class Range

The Range type exposes the following members.

Constructors
 | Name | Description
Public method | Range | Constructor that sets the upper and lower ranges.
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | IsInRange | Ascertains if a given number is within the range.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | IsValid | Returns true if the instance is valid, i.e. the upper is greater than or equal to the lower.
Public property | Lower | Gets the low end of the range.
Public property | Upper | Gets the upper end of the range.
Top
See Also

Reference

Bncs.SysUtils Namespace


Range Constructor

Range Constructor
Constructor that sets the upper and lower ranges.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Range(
    int lower_,
    int upper_
)

Parameters

lower_
Type: SystemInt32
Bottom of range
upper_
Type: SystemInt32
Top of range
See Also

Reference

Range Class
Bncs.SysUtils Namespace


Range Methods

Range Methods

The Range type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | IsInRange | Ascertains if a given number is within the range.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

Range Class
Bncs.SysUtils Namespace


Range.IsInRange Method

RangeIsInRange Method
Ascertains if a given number is within the range.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool IsInRange(
    int number_
)

Parameters

number_
Type: SystemInt32
Number to check.

Return Value

Type: Boolean
True if the supplied number is in range.
See Also

Reference

Range Class
Bncs.SysUtils Namespace


Range Properties

Range Properties

The Range type exposes the following members.

Properties
 | Name | Description
Public property | IsValid | Returns true if the instance is valid, i.e. the upper is greater than or equal to the lower.
Public property | Lower | Gets the low end of the range.
Public property | Upper | Gets the upper end of the range.
Top
See Also

Reference

Range Class
Bncs.SysUtils Namespace


Range.IsValid Property

RangeIsValid Property
Returns true if the instance is valid, i.e. the upper is greater than or equal to the lower.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool IsValid { get; }

Property Value

Type: Boolean
See Also

Reference

Range Class
Bncs.SysUtils Namespace


Range.Lower Property

RangeLower Property
Gets the low end of the range.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Lower { get; }

Property Value

Type: Int32
See Also

Reference

Range Class
Bncs.SysUtils Namespace


Range.Upper Property

RangeUpper Property
Gets the upper end of the range.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Upper { get; }

Property Value

Type: Int32
See Also

Reference

Range Class
Bncs.SysUtils Namespace


RECT Structure

RECT Structure
The RECT structure defines the coordinates of the upper-left and lower-right corners of a rectangle.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public struct RECT

The RECT type exposes the following members.

Constructors
 | Name | Description
Public method | RECT(Rectangle) | Creates a rectangle from the supplied System.Drawing.Rectangle
Public method | RECT(Int32, Int32, Int32, Int32) | Creates a rectangle from the supplied co-ordinates
Top
Methods
 | Name | Description
Public method | Equals(Object) | Tests for equality between THIS instance and that supplied (Overrides ValueTypeEquals(Object).)
Public method | Equals(RECT) | Tests if THIS instance is equal to that supplied
Public method | EqualsRectangle | Tests if THIS instance is equal to the supplied System.Drawing.Rectangle
Public method | GetHashCode | Gets the hash code (Overrides ValueTypeGetHashCode.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Gets a string representation of the instance (Overrides ValueTypeToString.)
Top
Operators
Name | Description
Equality | Overloads the equality operator
(Rectangle to RECT) | Allows casting from a System.Drawing.Rectangle object
(RECT to Rectangle) | Allows casting to a System.Drawing.Rectangle object
Inequality | Overloads the not equal operator
Top
Fields
 | Name | Description
Public field | Bottom | Gets/sets the Bottom parameter
Public field | Left | Gets/sets the Left parameter
Public field | Right | Gets/sets the Right parameter
Public field | Top | Gets/sets the Top parameter
Top
Properties
 | Name | Description
Public property | Height | Gets/sets the Height
Public property | Location | Gets/sets the Location
Public property | Size | Gets/sets the Size
Public property | Width | Gets/sets the Width
Public property | X | Gets/sets the X co-ordinate
Public property | Y | Gets/sets the Y co-ordinate
Top
See Also

Reference

Bncs.SysUtils Namespace


RECT Constructor

RECT Constructor
Overload List
 | Name | Description
Public method | RECT(Rectangle) | Creates a rectangle from the supplied System.Drawing.Rectangle
Public method | RECT(Int32, Int32, Int32, Int32) | Creates a rectangle from the supplied co-ordinates
Top
See Also

Reference

RECT Structure
Bncs.SysUtils Namespace


RECT Constructor (Rectangle)

RECT Constructor (Rectangle)
Creates a rectangle from the supplied System.Drawing.Rectangle

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public RECT(
    Rectangle r
)

Parameters

r
Type: System.DrawingRectangle
Rectangle from which co-ordinates are read
See Also

Reference

RECT Structure
RECT Overload
Bncs.SysUtils Namespace


RECT Constructor (Int32, Int32, Int32, Int32)

RECT Constructor (Int32, Int32, Int32, Int32)
Creates a rectangle from the supplied co-ordinates

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public RECT(
    int left,
    int top,
    int right,
    int bottom
)

Parameters

left
Type: SystemInt32
Left position
top
Type: SystemInt32
Top position
right
Type: SystemInt32
Right position
bottom
Type: SystemInt32
Bottom position
See Also

Reference

RECT Structure
RECT Overload
Bncs.SysUtils Namespace


RECT Fields

RECT Fields

The RECT type exposes the following members.

Fields
 | Name | Description
Public field | Bottom | Gets/sets the Bottom parameter
Public field | Left | Gets/sets the Left parameter
Public field | Right | Gets/sets the Right parameter
Public field | Top | Gets/sets the Top parameter
Top
See Also

Reference

RECT Structure
Bncs.SysUtils Namespace


RECT.Bottom Field

RECTBottom Field
Gets/sets the Bottom parameter

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Bottom

Field Value

Type: Int32
See Also

Reference

RECT Structure
Bncs.SysUtils Namespace


RECT.Left Field

RECTLeft Field
Gets/sets the Left parameter

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Left

Field Value

Type: Int32
See Also

Reference

RECT Structure
Bncs.SysUtils Namespace


RECT.Right Field

RECTRight Field
Gets/sets the Right parameter

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Right

Field Value

Type: Int32
See Also

Reference

RECT Structure
Bncs.SysUtils Namespace


RECT.Top Field

RECTTop Field
Gets/sets the Top parameter

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Top

Field Value

Type: Int32
See Also

Reference

RECT Structure
Bncs.SysUtils Namespace


RECT Methods

RECT Methods

The RECT type exposes the following members.

Methods
 | Name | Description
Public method | Equals(Object) | Tests for equality between THIS instance and that supplied (Overrides ValueTypeEquals(Object).)
Public method | Equals(RECT) | Tests if THIS instance is equal to that supplied
Public method | EqualsRectangle | Tests if THIS instance is equal to the supplied System.Drawing.Rectangle
Public method | GetHashCode | Gets the hash code (Overrides ValueTypeGetHashCode.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Gets a string representation of the instance (Overrides ValueTypeToString.)
Top
See Also

Reference

RECT Structure
Bncs.SysUtils Namespace


RECT.Equals Method

RECTEquals Method
Overload List
 | Name | Description
Public method | Equals(Object) | Tests for equality between THIS instance and that supplied (Overrides ValueTypeEquals(Object).)
Public method | Equals(RECT) | Tests if THIS instance is equal to that supplied
Top
See Also

Reference

RECT Structure
Bncs.SysUtils Namespace


RECT.Equals Method (Object)

RECTEquals Method (Object)
Tests for equality between THIS instance and that supplied

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override bool Equals(
    Object obj
)

Parameters

obj
Type: SystemObject
Object to compare

Return Value

Type: Boolean
True if the supplied object is RECT or Rectangle and they are equal
See Also

Reference

RECT Structure
Equals Overload
Bncs.SysUtils Namespace


RECT.Equals Method (RECT)

RECTEquals Method (RECT)
Tests if THIS instance is equal to that supplied

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Equals(
    RECT r
)

Parameters

r
Type: Bncs.SysUtilsRECT
RECT to compare with THIS

Return Value

Type: Boolean
True if this RECT and that supplied are equal
See Also

Reference

RECT Structure
Equals Overload
Bncs.SysUtils Namespace


RECT.EqualsRectangle Method

RECTEqualsRectangle Method
Tests if THIS instance is equal to the supplied System.Drawing.Rectangle

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool EqualsRectangle(
    Rectangle r
)

Parameters

r
Type: System.DrawingRectangle
System.Drawing.Rectangle to compare with THIS

Return Value

Type: Boolean
True if this RECT and the supplied Rectangle are equal
See Also

Reference

RECT Structure
Bncs.SysUtils Namespace


RECT.GetHashCode Method

RECTGetHashCode Method
Gets the hash code

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override int GetHashCode()

Return Value

Type: Int32
Integer
See Also

Reference

RECT Structure
Bncs.SysUtils Namespace


RECT.ToString Method

RECTToString Method
Gets a string representation of the instance

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
This instance as a string
See Also

Reference

RECT Structure
Bncs.SysUtils Namespace


RECT Operators and Type Conversions

RECT Operators and Type Conversions

The RECT type exposes the following members.

Operators
Name | Description
Equality | Overloads the equality operator
(Rectangle to RECT) | Allows casting from a System.Drawing.Rectangle object
(RECT to Rectangle) | Allows casting to a System.Drawing.Rectangle object
Inequality | Overloads the not equal operator
Top
See Also

Reference

RECT Structure
Bncs.SysUtils Namespace


RECT.Equality Operator

RECTEquality Operator
Overloads the equality operator

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool operator ==(
    RECT r1,
    RECT r2
)

Parameters

r1
Type: Bncs.SysUtilsRECT
First RECT to compare
r2
Type: Bncs.SysUtilsRECT
Second RECT to compare

Return Value

Type: Boolean
True if the supplied RECT's are equal
See Also

Reference

RECT Structure
Bncs.SysUtils Namespace


RECT Implicit Conversion Operators

RECT Conversion Operators
Overload List
Name | Description
(Rectangle to RECT) | Allows casting from a System.Drawing.Rectangle object
(RECT to Rectangle) | Allows casting to a System.Drawing.Rectangle object
Top
See Also

Reference

RECT Structure
Bncs.SysUtils Namespace


RECT Implicit Conversion (Rectangle to RECT)

RECT Conversion (Rectangle to RECT)
Allows casting from a System.Drawing.Rectangle object

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static implicit operator RECT (
    Rectangle r
)

Parameters

r
Type: System.DrawingRectangle
System.Drawing.Rectangle to cast

Return Value

Type: RECT
The supplied System.Drawing.Rectangle as a RECT
See Also

Reference

RECT Structure
Overload
Bncs.SysUtils Namespace


RECT Implicit Conversion (RECT to Rectangle)

RECT Conversion (RECT to Rectangle)
Allows casting to a System.Drawing.Rectangle object

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static implicit operator Rectangle (
    RECT r
)

Parameters

r
Type: Bncs.SysUtilsRECT
RECT to cast

Return Value

Type: Rectangle
The supplied RECT as a System.Drawing.Rectangle
See Also

Reference

RECT Structure
Overload
Bncs.SysUtils Namespace


RECT.Inequality Operator

RECTInequality Operator
Overloads the not equal operator

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool operator !=(
    RECT r1,
    RECT r2
)

Parameters

r1
Type: Bncs.SysUtilsRECT
First RECT to compare
r2
Type: Bncs.SysUtilsRECT
Second RECT to compare

Return Value

Type: Boolean
True if the supplied RECT's are NOT equal
See Also

Reference

RECT Structure
Bncs.SysUtils Namespace


RECT Properties

RECT Properties

The RECT type exposes the following members.

Properties
 | Name | Description
Public property | Height | Gets/sets the Height
Public property | Location | Gets/sets the Location
Public property | Size | Gets/sets the Size
Public property | Width | Gets/sets the Width
Public property | X | Gets/sets the X co-ordinate
Public property | Y | Gets/sets the Y co-ordinate
Top
See Also

Reference

RECT Structure
Bncs.SysUtils Namespace


RECT.Height Property

RECTHeight Property
Gets/sets the Height

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Height { get; set; }

Property Value

Type: Int32
See Also

Reference

RECT Structure
Bncs.SysUtils Namespace


RECT.Location Property

RECTLocation Property
Gets/sets the Location

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Point Location { get; set; }

Property Value

Type: Point
See Also

Reference

RECT Structure
Bncs.SysUtils Namespace


RECT.Size Property

RECTSize Property
Gets/sets the Size

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Size Size { get; set; }

Property Value

Type: Size
See Also

Reference

RECT Structure
Bncs.SysUtils Namespace


RECT.Width Property

RECTWidth Property
Gets/sets the Width

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Width { get; set; }

Property Value

Type: Int32
See Also

Reference

RECT Structure
Bncs.SysUtils Namespace


RECT.X Property

RECTX Property
Gets/sets the X co-ordinate

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int X { get; set; }

Property Value

Type: Int32
See Also

Reference

RECT Structure
Bncs.SysUtils Namespace


RECT.Y Property

RECTY Property
Gets/sets the Y co-ordinate

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Y { get; set; }

Property Value

Type: Int32
See Also

Reference

RECT Structure
Bncs.SysUtils Namespace


SegmentFile Class

SegmentFile Class
Class representing a segmented file (i.e. a sub file of a whole file). This class ensures that any such list of this type will be sorted by date/time from the oldest.
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsSegmentFile

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class SegmentFile : IComparable

The SegmentFile type exposes the following members.

Constructors
 | Name | Description
Public method | SegmentFile | Constructor
Top
Methods
 | Name | Description
Public method | CompareTo | Compare method
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | ToString() override (Overrides ObjectToString.)
Top
Properties
 | Name | Description
Public property | Filename | Gets or sets the file to split or join to
Public property | Time | Gets the last write time of the file
Top
See Also

Reference

Bncs.SysUtils Namespace


SegmentFile Constructor

SegmentFile Constructor
Constructor

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public SegmentFile(
    string filename_
)

Parameters

filename_
Type: SystemString
Name of the file to split or join to
See Also

Reference

SegmentFile Class
Bncs.SysUtils Namespace


SegmentFile Methods

SegmentFile Methods

The SegmentFile type exposes the following members.

Methods
 | Name | Description
Public method | CompareTo | Compare method
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | ToString() override (Overrides ObjectToString.)
Top
See Also

Reference

SegmentFile Class
Bncs.SysUtils Namespace


SegmentFile.CompareTo Method

SegmentFileCompareTo Method
Compare method

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int CompareTo(
    Object obj
)

Parameters

obj
Type: SystemObject
Property to compare against

Return Value

Type: Int32
Less than zero instance preceeds obj in the sort order, zero is equality and greater than zero instance follows obj in the sort order

Implements

IComparableCompareTo(Object)
See Also

Reference

SegmentFile Class
Bncs.SysUtils Namespace


SegmentFile.ToString Method

SegmentFileToString Method
ToString() override

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
Returns the file name
See Also

Reference

SegmentFile Class
Bncs.SysUtils Namespace


SegmentFile Properties

SegmentFile Properties

The SegmentFile type exposes the following members.

Properties
 | Name | Description
Public property | Filename | Gets or sets the file to split or join to
Public property | Time | Gets the last write time of the file
Top
See Also

Reference

SegmentFile Class
Bncs.SysUtils Namespace


SegmentFile.Filename Property

SegmentFileFilename Property
Gets or sets the file to split or join to

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Filename { get; set; }

Property Value

Type: String
See Also

Reference

SegmentFile Class
Bncs.SysUtils Namespace


SegmentFile.Time Property

SegmentFileTime Property
Gets the last write time of the file

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public DateTime Time { get; }

Property Value

Type: DateTime
See Also

Reference

SegmentFile Class
Bncs.SysUtils Namespace


ShowWindowCommands Enumeration

ShowWindowCommands Enumeration
Enumeration for ShowWindow()

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum ShowWindowCommands
Members
Member name | Value | Description
Hide | 0 | Hides the window and activates another window.
Normal | 1 | Activates and displays a window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when displaying the window for the first time.
ShowMinimized | 2 | Activates the window and displays it as a minimized window.
Maximize | 3 | Maximizes the specified window.
ShowMaximized | 3 | Activates the window and displays it as a maximized window.
ShowNoActivate | 4 | Displays a window in its most recent size and position. This value is similar to [!:Win32.ShowWindowCommand.Normal], except the window is not activated.
Show | 5 | Activates the window and displays it in its current size and position.
Minimize | 6 | Minimizes the specified window and activates the next top-level window in the Z order.
ShowMinNoActive | 7 | Displays the window as a minimized window. This value is similar to [!:Win32.ShowWindowCommand.ShowMinimized], except the window is not activated.
ShowNA | 8 | Displays the window in its current size and position. This value is similar to [!:Win32.ShowWindowCommand.Show], except the window is not activated.
Restore | 9 | Activates and displays the window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when restoring a minimized window.
ShowDefault | 10 | Sets the show state based on the SW_* value specified in the STARTUPINFO structure passed to the CreateProcess function by the program that started the application.
ForceMinimize | 11 | Windows 2000/XP: Minimizes a window, even if the thread that owns the window is not responding. This flag should only be used when minimizing windows from a different thread.
Null | 12 | Indicates that the target window was null.
See Also

Reference

Bncs.SysUtils Namespace


ShredOptions Enumeration

ShredOptions Enumeration
Enumeration denoting the number of overwrites to perform in a file shred operation.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum ShredOptions
Members
Member name | Value | Description
SingleOverwrite | 1 | File is overwritten once with 0x00's.
DoubleOverwrite | 2 | File is overwritten twice with 0x00's followed by 0x01's.
TripleOverwrite | 3 | File is overwritten three times with 0x00's followed by 0x01's followed by random bytes.
StandardQuadOverwrite | 4 | File is overwritten four times with 0x00's followed by 0x01's followed by random bytes followed by 0x00's. This is the default operation when no shred option is supplied.
See Also

Reference

Bncs.SysUtils Namespace


SpecialDir Enumeration

SpecialDir Enumeration
Types defining the system special directories

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum SpecialDir
Members
Member name | Value | Description
ApplicationData | 0 | The directory where Windows stores application data.
CommonApplicationData | 1 | The directory where Windows stores common application data.
CommonProgramFiles | 2 | The directory where Windows stores common program files.
Cookies | 3 | The directory where Windows stores cookies.
Desktop | 4 | The directory that is the Windows desktop.
DesktopDirectory | 5 | The directory where Windows stores desktop icons.
Favorites | 6 | The directory where Windows stores favourites.
History | 7 | The directory where Windows stores history.
InternetCache | 8 | The directory where Windows stores the internet cache.
LocalApplicationData | 9 | The directory where Windows stores local application data.
MyComputer | 10 | The directory where Windows My Computer.
MyDocuments | 11 | The directory where Windows stores user documents.
MyMusic | 12 | The directory where Windows stores a users music.
MyPictures | 13 | The directory where Windows stores a users graphic files.
Personal | 14 | The directory where Windows stores user personal data.
ProgramFiles | 15 | The directory where Windows stores installed program files.
Programs | 16 | The directory where Windows stores programs.
Recent | 17 | The directory where Windows stores recent data.
SendTo | 18 | The directory where Windows stores send to application links.
StartMenu | 19 | The directory where Windows stores the start menu.
Startup | 20 | The directory where Windows start up directory.
System | 21 | The Windows System 32 directory.
Temp | 22 | The directory where Windows stores temporary files.
Templates | 23 | The directory where Windows stores templates.
Windows | 24 | The top level directory where the Windows OS files reside.
See Also

Reference

Bncs.SysUtils Namespace


SpecialDirectory Class

SpecialDirectory Class
A class to get Windows special directory paths and names
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsSpecialDirectory

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static class SpecialDirectory

The SpecialDirectory type exposes the following members.

Methods
Name Description
Get
Gets the current application directory
Examples
This code demonstrates the use of SpecialDirectory to retrieve some file paths.
Copy
class Program
{
    static void Main()
    {
        // Print the full current working directory
        Console.WriteLine(SpecialDirectory.Get());
        // Print the full users directory path
        Console.WriteLine(SpecialDirectory.Get(SpecialDir.Personal));
        // Print the full users directory path with a trailing backslash
        Console.WriteLine(SpecialDirectory.GetWithTrailingBackslash(SpecialDir.Personal));
        // Print the full users directory path
        Console.WriteLine(SpecialDirectory.Get(SpecialDir.Windows));
        // Print the full system32 directory path
        Console.WriteLine(SpecialDirectory.Get(SpecialDir.System));

        Console.ReadKey();
    }
}
Get(SpecialDir)
Gets the path for the supplied special directory
Examples
This code demonstrates the use of SpecialDirectory to retrieve some file paths.
Copy
class Program
{
    static void Main()
    {
        // Print the full current working directory
        Console.WriteLine(SpecialDirectory.Get());
        // Print the full users directory path
        Console.WriteLine(SpecialDirectory.Get(SpecialDir.Personal));
        // Print the full users directory path with a trailing backslash
        Console.WriteLine(SpecialDirectory.GetWithTrailingBackslash(SpecialDir.Personal));
        // Print the full users directory path
        Console.WriteLine(SpecialDirectory.Get(SpecialDir.Windows));
        // Print the full system32 directory path
        Console.WriteLine(SpecialDirectory.Get(SpecialDir.System));

        Console.ReadKey();
    }
}
GetName(SpecialDir)
Gets the friendly name of the special directory supplied
GetName(SpecialDirEx)
Gets the friendly name (token) of the special directory ex supplied
GetNames
Gets the friendly names of all special directories
GetSpecial
Converts the supplied token directory name to a SpecialDirEx enumeration.
GetTokenNames
Gets all friendly names (tokens).
GetWithTrailingBackslash
Gets the current application directory with trailing backslash
GetWithTrailingBackslash(SpecialDir)
Gets the path for the supplied special directory with a trailing backslash
Examples
This code demonstrates the use of SpecialDirectory to retrieve some file paths.
Copy
class Program
{
    static void Main()
    {
        // Print the full current working directory
        Console.WriteLine(SpecialDirectory.Get());
        // Print the full users directory path
        Console.WriteLine(SpecialDirectory.Get(SpecialDir.Personal));
        // Print the full users directory path with a trailing backslash
        Console.WriteLine(SpecialDirectory.GetWithTrailingBackslash(SpecialDir.Personal));
        // Print the full users directory path
        Console.WriteLine(SpecialDirectory.Get(SpecialDir.Windows));
        // Print the full system32 directory path
        Console.WriteLine(SpecialDirectory.Get(SpecialDir.System));

        Console.ReadKey();
    }
}
SpecialDirExToSpecialDir
Converts a SpecialDirEx enumeration to a SpecialDir type.
Top
See Also

Reference

Bncs.SysUtils Namespace


SpecialDirectory Methods

SpecialDirectory Methods

The SpecialDirectory type exposes the following members.

Methods
Name Description
Get
Gets the current application directory
Examples
This code demonstrates the use of SpecialDirectory to retrieve some file paths.
Copy
class Program
{
    static void Main()
    {
        // Print the full current working directory
        Console.WriteLine(SpecialDirectory.Get());
        // Print the full users directory path
        Console.WriteLine(SpecialDirectory.Get(SpecialDir.Personal));
        // Print the full users directory path with a trailing backslash
        Console.WriteLine(SpecialDirectory.GetWithTrailingBackslash(SpecialDir.Personal));
        // Print the full users directory path
        Console.WriteLine(SpecialDirectory.Get(SpecialDir.Windows));
        // Print the full system32 directory path
        Console.WriteLine(SpecialDirectory.Get(SpecialDir.System));

        Console.ReadKey();
    }
}
Get(SpecialDir)
Gets the path for the supplied special directory
Examples
This code demonstrates the use of SpecialDirectory to retrieve some file paths.
Copy
class Program
{
    static void Main()
    {
        // Print the full current working directory
        Console.WriteLine(SpecialDirectory.Get());
        // Print the full users directory path
        Console.WriteLine(SpecialDirectory.Get(SpecialDir.Personal));
        // Print the full users directory path with a trailing backslash
        Console.WriteLine(SpecialDirectory.GetWithTrailingBackslash(SpecialDir.Personal));
        // Print the full users directory path
        Console.WriteLine(SpecialDirectory.Get(SpecialDir.Windows));
        // Print the full system32 directory path
        Console.WriteLine(SpecialDirectory.Get(SpecialDir.System));

        Console.ReadKey();
    }
}
GetName(SpecialDir)
Gets the friendly name of the special directory supplied
GetName(SpecialDirEx)
Gets the friendly name (token) of the special directory ex supplied
GetNames
Gets the friendly names of all special directories
GetSpecial
Converts the supplied token directory name to a SpecialDirEx enumeration.
GetTokenNames
Gets all friendly names (tokens).
GetWithTrailingBackslash
Gets the current application directory with trailing backslash
GetWithTrailingBackslash(SpecialDir)
Gets the path for the supplied special directory with a trailing backslash
Examples
This code demonstrates the use of SpecialDirectory to retrieve some file paths.
Copy
class Program
{
    static void Main()
    {
        // Print the full current working directory
        Console.WriteLine(SpecialDirectory.Get());
        // Print the full users directory path
        Console.WriteLine(SpecialDirectory.Get(SpecialDir.Personal));
        // Print the full users directory path with a trailing backslash
        Console.WriteLine(SpecialDirectory.GetWithTrailingBackslash(SpecialDir.Personal));
        // Print the full users directory path
        Console.WriteLine(SpecialDirectory.Get(SpecialDir.Windows));
        // Print the full system32 directory path
        Console.WriteLine(SpecialDirectory.Get(SpecialDir.System));

        Console.ReadKey();
    }
}
SpecialDirExToSpecialDir
Converts a SpecialDirEx enumeration to a SpecialDir type.
Top
See Also

Reference

SpecialDirectory Class
Bncs.SysUtils Namespace


SpecialDirectory.Get Method

SpecialDirectoryGet Method
Overload List
Name Description
Get
Gets the current application directory
Examples
This code demonstrates the use of SpecialDirectory to retrieve some file paths.
Copy
class Program
{
    static void Main()
    {
        // Print the full current working directory
        Console.WriteLine(SpecialDirectory.Get());
        // Print the full users directory path
        Console.WriteLine(SpecialDirectory.Get(SpecialDir.Personal));
        // Print the full users directory path with a trailing backslash
        Console.WriteLine(SpecialDirectory.GetWithTrailingBackslash(SpecialDir.Personal));
        // Print the full users directory path
        Console.WriteLine(SpecialDirectory.Get(SpecialDir.Windows));
        // Print the full system32 directory path
        Console.WriteLine(SpecialDirectory.Get(SpecialDir.System));

        Console.ReadKey();
    }
}
Get(SpecialDir)
Gets the path for the supplied special directory
Examples
This code demonstrates the use of SpecialDirectory to retrieve some file paths.
Copy
class Program
{
    static void Main()
    {
        // Print the full current working directory
        Console.WriteLine(SpecialDirectory.Get());
        // Print the full users directory path
        Console.WriteLine(SpecialDirectory.Get(SpecialDir.Personal));
        // Print the full users directory path with a trailing backslash
        Console.WriteLine(SpecialDirectory.GetWithTrailingBackslash(SpecialDir.Personal));
        // Print the full users directory path
        Console.WriteLine(SpecialDirectory.Get(SpecialDir.Windows));
        // Print the full system32 directory path
        Console.WriteLine(SpecialDirectory.Get(SpecialDir.System));

        Console.ReadKey();
    }
}
Top
See Also

Reference

SpecialDirectory Class
Bncs.SysUtils Namespace


SpecialDirectory.Get Method

SpecialDirectoryGet Method
Gets the current application directory
Examples
This code demonstrates the use of SpecialDirectory to retrieve some file paths.
Copy
class Program
{
    static void Main()
    {
        // Print the full current working directory
        Console.WriteLine(SpecialDirectory.Get());
        // Print the full users directory path
        Console.WriteLine(SpecialDirectory.Get(SpecialDir.Personal));
        // Print the full users directory path with a trailing backslash
        Console.WriteLine(SpecialDirectory.GetWithTrailingBackslash(SpecialDir.Personal));
        // Print the full users directory path
        Console.WriteLine(SpecialDirectory.Get(SpecialDir.Windows));
        // Print the full system32 directory path
        Console.WriteLine(SpecialDirectory.Get(SpecialDir.System));

        Console.ReadKey();
    }
}

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string Get()

Return Value

Type: String
Current application directory
See Also

Reference

SpecialDirectory Class
Get Overload
Bncs.SysUtils Namespace


SpecialDirectory.Get Method (SpecialDir)

SpecialDirectoryGet Method (SpecialDir)
Gets the path for the supplied special directory
Examples
This code demonstrates the use of SpecialDirectory to retrieve some file paths.
Copy
class Program
{
    static void Main()
    {
        // Print the full current working directory
        Console.WriteLine(SpecialDirectory.Get());
        // Print the full users directory path
        Console.WriteLine(SpecialDirectory.Get(SpecialDir.Personal));
        // Print the full users directory path with a trailing backslash
        Console.WriteLine(SpecialDirectory.GetWithTrailingBackslash(SpecialDir.Personal));
        // Print the full users directory path
        Console.WriteLine(SpecialDirectory.Get(SpecialDir.Windows));
        // Print the full system32 directory path
        Console.WriteLine(SpecialDirectory.Get(SpecialDir.System));

        Console.ReadKey();
    }
}

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string Get(
    SpecialDir specialDirectory_
)

Parameters

specialDirectory_
Type: Bncs.SysUtilsSpecialDir
Special directory to get

Return Value

Type: String
Full path of the special directory
See Also

Reference

SpecialDirectory Class
Get Overload
Bncs.SysUtils Namespace


SpecialDirectory.GetName Method

SpecialDirectoryGetName Method
Overload List
Name | Description
GetName(SpecialDir) | Gets the friendly name of the special directory supplied
GetName(SpecialDirEx) | Gets the friendly name (token) of the special directory ex supplied
Top
See Also

Reference

SpecialDirectory Class
Bncs.SysUtils Namespace


SpecialDirectory.GetName Method (SpecialDir)

SpecialDirectoryGetName Method (SpecialDir)
Gets the friendly name of the special directory supplied

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string GetName(
    SpecialDir specialDir_
)

Parameters

specialDir_
Type: Bncs.SysUtilsSpecialDir
Special directory to get the friendly name for

Return Value

Type: String
The friendly name of the supplied special directory
See Also

Reference

SpecialDirectory Class
GetName Overload
Bncs.SysUtils Namespace


SpecialDirectory.GetName Method (SpecialDirEx)

SpecialDirectoryGetName Method (SpecialDirEx)
Gets the friendly name (token) of the special directory ex supplied

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string GetName(
    SpecialDirEx specialDirEx_
)

Parameters

specialDirEx_
Type: Bncs.SysUtilsSpecialDirEx
Special directory ex to get the friendly (token) name for

Return Value

Type: String
The friendly name or token of the supplied special directory
See Also

Reference

SpecialDirectory Class
GetName Overload
Bncs.SysUtils Namespace


SpecialDirectory.GetNames Method

SpecialDirectoryGetNames Method
Gets the friendly names of all special directories

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static List<string> GetNames()

Return Value

Type: List String
A list of friendly names
See Also

Reference

SpecialDirectory Class
Bncs.SysUtils Namespace


SpecialDirectory.GetSpecial Method

SpecialDirectoryGetSpecial Method
Converts the supplied token directory name to a SpecialDirEx enumeration.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static SpecialDirEx GetSpecial(
    string token_
)

Parameters

token_
Type: SystemString
Directory name enclosed in {} to convert.

Return Value

Type: SpecialDirEx
The special dir ex enumeration that relates to the token else Null
See Also

Reference

SpecialDirectory Class
Bncs.SysUtils Namespace


SpecialDirectory.GetTokenNames Method

SpecialDirectoryGetTokenNames Method
Gets all friendly names (tokens).

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static List<string> GetTokenNames()

Return Value

Type: List String
A list of the names.
See Also

Reference

SpecialDirectory Class
Bncs.SysUtils Namespace


SpecialDirectory.GetWithTrailingBackslash Method

SpecialDirectoryGetWithTrailingBackslash Method
Overload List
Name Description
GetWithTrailingBackslash
Gets the current application directory with trailing backslash
GetWithTrailingBackslash(SpecialDir)
Gets the path for the supplied special directory with a trailing backslash
Examples
This code demonstrates the use of SpecialDirectory to retrieve some file paths.
Copy
class Program
{
    static void Main()
    {
        // Print the full current working directory
        Console.WriteLine(SpecialDirectory.Get());
        // Print the full users directory path
        Console.WriteLine(SpecialDirectory.Get(SpecialDir.Personal));
        // Print the full users directory path with a trailing backslash
        Console.WriteLine(SpecialDirectory.GetWithTrailingBackslash(SpecialDir.Personal));
        // Print the full users directory path
        Console.WriteLine(SpecialDirectory.Get(SpecialDir.Windows));
        // Print the full system32 directory path
        Console.WriteLine(SpecialDirectory.Get(SpecialDir.System));

        Console.ReadKey();
    }
}
Top
See Also

Reference

SpecialDirectory Class
Bncs.SysUtils Namespace


SpecialDirectory.GetWithTrailingBackslash Method

SpecialDirectoryGetWithTrailingBackslash Method
Gets the current application directory with trailing backslash

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string GetWithTrailingBackslash()

Return Value

Type: String
Current application directory with trailing backslash
See Also

Reference

SpecialDirectory Class
GetWithTrailingBackslash Overload
Bncs.SysUtils Namespace


SpecialDirectory.GetWithTrailingBackslash Method (SpecialDir)

SpecialDirectoryGetWithTrailingBackslash Method (SpecialDir)
Gets the path for the supplied special directory with a trailing backslash
Examples
This code demonstrates the use of SpecialDirectory to retrieve some file paths.
Copy
class Program
{
    static void Main()
    {
        // Print the full current working directory
        Console.WriteLine(SpecialDirectory.Get());
        // Print the full users directory path
        Console.WriteLine(SpecialDirectory.Get(SpecialDir.Personal));
        // Print the full users directory path with a trailing backslash
        Console.WriteLine(SpecialDirectory.GetWithTrailingBackslash(SpecialDir.Personal));
        // Print the full users directory path
        Console.WriteLine(SpecialDirectory.Get(SpecialDir.Windows));
        // Print the full system32 directory path
        Console.WriteLine(SpecialDirectory.Get(SpecialDir.System));

        Console.ReadKey();
    }
}

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string GetWithTrailingBackslash(
    SpecialDir specialDirectory_
)

Parameters

specialDirectory_
Type: Bncs.SysUtilsSpecialDir
Special directory to get

Return Value

Type: String
Full path of the special directory
See Also

Reference

SpecialDirectory Class
GetWithTrailingBackslash Overload
Bncs.SysUtils Namespace


SpecialDirectory.SpecialDirExToSpecialDir Method

SpecialDirectorySpecialDirExToSpecialDir Method
Converts a SpecialDirEx enumeration to a SpecialDir type.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static SpecialDir SpecialDirExToSpecialDir(
    SpecialDirEx special_
)

Parameters

special_
Type: Bncs.SysUtilsSpecialDirEx
Enum to convert.

Return Value

Type: SpecialDir
The SpecialDir equivilent or throws an exception for unconvertable values.
See Also

Reference

SpecialDirectory Class
Bncs.SysUtils Namespace


SpecialDirEx Enumeration

SpecialDirEx Enumeration
Extended types defining the system special directories.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum SpecialDirEx
Members
Member name | Value | Description
ApplicationData | 0 | The directory where Windows stores application data.
CommonApplicationData | 1 | The directory where Windows stores common application data.
CommonProgramFiles | 2 | The directory where Windows stores common program files.
Cookies | 3 | The directory where Windows stores cookies.
Desktop | 4 | The directory that is the Windows desktop.
DesktopDirectory | 5 | The directory where Windows stores desktop icons.
Favorites | 6 | The directory where Windows stores favourites.
History | 7 | The directory where Windows stores history.
Install | 8 | The directory where Windows stores the internet cache.
InternetCache | 9 | The directory where Windows stores installations.
LocalApplicationData | 10 | The directory where Windows stores local application data.
MyComputer | 11 | The directory where Windows My Computer.
MyDocuments | 12 | The directory where Windows stores user documents.
MyMusic | 13 | The directory where Windows stores a users music.
MyPictures | 14 | The directory where Windows stores a users graphic files.
Personal | 15 | The directory where Windows stores user personal data.
ProgramFiles | 16 | The directory where Windows stores installed program files.
Programs | 17 | The directory where Windows stores programs.
Recent | 18 | The directory where Windows stores recent data.
SendTo | 19 | The directory where Windows stores send to application links.
StartMenu | 20 | The directory where Windows stores the start menu.
Startup | 21 | The directory where Windows start up directory.
System | 22 | The Windows System 32 directory.
Temp | 23 | The directory where Windows stores temporary files.
Templates | 24 | The directory where Windows stores templates.
Windows | 25 | The top level directory where the Windows OS files reside.
Custom | 26 | CUSTOM ????????????????????? WTF
Null | 27 | The value returned by the GetSpecial(String) method when the supplied string does not equate to a valid enumeration member.
See Also

Reference

Bncs.SysUtils Namespace


SplitOperation Enumeration

SplitOperation Enumeration
Enumeration to reflect the operation

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum SplitOperation
Members
Member name | Value | Description
Split | 0 | Split the files.
Join | 1 | Join the files.
See Also

Reference

Bncs.SysUtils Namespace


StringMask Class

StringMask Class
A class that contains a string with a mask (intended "friendly name")
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsStringMask

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class StringMask : IComparable

The StringMask type exposes the following members.

Constructors
 | Name | Description
Public method | StringMask(String) | Constructor that sets the mask and string value from a single delimited string.
Public method | StringMask(String, String) | Constructor that sets the mask and string value.
Top
Methods
 | Name | Description
Public method | CompareTo | Compare method
Public method | Equals | Overrides Equals() operator. (Overrides ObjectEquals(Object).)
Public method | GetHashCode | Gets the hash code (Overrides ObjectGetHashCode.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns the instance as a string. (Overrides ObjectToString.)
Top
Properties
 | Name | Description
Public property | Formatted | Gets the formatted string
Public property | Mask | Gets the mask
Public property | String | Gets the string value
Top
See Also

Reference

Bncs.SysUtils Namespace


StringMask Constructor

StringMask Constructor
Overload List
 | Name | Description
Public method | StringMask(String) | Constructor that sets the mask and string value from a single delimited string.
Public method | StringMask(String, String) | Constructor that sets the mask and string value.
Top
See Also

Reference

StringMask Class
Bncs.SysUtils Namespace


StringMask Constructor (String)

StringMask Constructor (String)
Constructor that sets the mask and string value from a single delimited string.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public StringMask(
    string maskedString_
)

Parameters

maskedString_
Type: SystemString
Delimited string
See Also

Reference

StringMask Class
StringMask Overload
Bncs.SysUtils Namespace


StringMask Constructor (String, String)

StringMask Constructor (String, String)
Constructor that sets the mask and string value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public StringMask(
    string mask_,
    string string_
)

Parameters

mask_
Type: SystemString
Mask
string_
Type: SystemString
String value
See Also

Reference

StringMask Class
StringMask Overload
Bncs.SysUtils Namespace


StringMask Methods

StringMask Methods

The StringMask type exposes the following members.

Methods
 | Name | Description
Public method | CompareTo | Compare method
Public method | Equals | Overrides Equals() operator. (Overrides ObjectEquals(Object).)
Public method | GetHashCode | Gets the hash code (Overrides ObjectGetHashCode.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns the instance as a string. (Overrides ObjectToString.)
Top
See Also

Reference

StringMask Class
Bncs.SysUtils Namespace


StringMask.CompareTo Method

StringMaskCompareTo Method
Compare method

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int CompareTo(
    Object object_
)

Parameters

object_
Type: SystemObject
Object to compare with THIS instance.

Return Value

Type: Int32
0 if equal.

Implements

IComparableCompareTo(Object)
See Also

Reference

StringMask Class
Bncs.SysUtils Namespace


StringMask.Equals Method

StringMaskEquals Method
Overrides Equals() operator.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override bool Equals(
    Object obj
)

Parameters

obj
Type: SystemObject
Object to compare with THIS instance.

Return Value

Type: Boolean
True if the objects are equal
See Also

Reference

StringMask Class
Bncs.SysUtils Namespace


StringMask.GetHashCode Method

StringMaskGetHashCode Method
Gets the hash code

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override int GetHashCode()

Return Value

Type: Int32
The hash code
See Also

Reference

StringMask Class
Bncs.SysUtils Namespace


StringMask.ToString Method

StringMaskToString Method
Returns the instance as a string.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
The mask or "EMPTY STRING"
See Also

Reference

StringMask Class
Bncs.SysUtils Namespace


StringMask Properties

StringMask Properties

The StringMask type exposes the following members.

Properties
 | Name | Description
Public property | Formatted | Gets the formatted string
Public property | Mask | Gets the mask
Public property | String | Gets the string value
Top
See Also

Reference

StringMask Class
Bncs.SysUtils Namespace


StringMask.Formatted Property

StringMaskFormatted Property
Gets the formatted string

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Formatted { get; }

Property Value

Type: String
See Also

Reference

StringMask Class
Bncs.SysUtils Namespace


StringMask.Mask Property

StringMaskMask Property
Gets the mask

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Mask { get; }

Property Value

Type: String
See Also

Reference

StringMask Class
Bncs.SysUtils Namespace


StringMask.String Property

StringMaskString Property
Gets the string value

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string String { get; }

Property Value

Type: String
See Also

Reference

StringMask Class
Bncs.SysUtils Namespace


SystemEventLogWriter Class

SystemEventLogWriter Class
A class that writes log data to the system event log.
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsSystemEventLogWriter

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class SystemEventLogWriter

The SystemEventLogWriter type exposes the following members.

Constructors
Name Description
SystemEventLogWriter
Constructor that creates event source from the supplied source and log name data.
Examples
This code demonstrates how to create a SystemEventLogWriter and then send a message to the system event log.
Copy
s Program
{
    static void Main()
    {
        // Create a log object
        SystemEventLogWriter logger = new SystemEventLogWriter("Test App", "ACME");
        // Write something to the Windows event log
        logger.Write("This is a message from Test App for the system event logger.");

        Console.ReadKey();
    }
}
Top
Methods
Name Description
Public method Equals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public method GetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method ToString
Returns a string that represents the current object.
(Inherited from Object.)
Write
Writes the supplied event text to the system log.
Examples
This code demonstrates how to create a SystemEventLogWriter and then send a message to the system event log.
Copy
s Program
{
    static void Main()
    {
        // Create a log object
        SystemEventLogWriter logger = new SystemEventLogWriter("Test App", "ACME");
        // Write something to the Windows event log
        logger.Write("This is a message from Test App for the system event logger.");

        Console.ReadKey();
    }
}
Top
Properties
 | Name | Description
Public property | ErrorInformation | Gets the error information.
Public property | SourceExists | Returns true if the source exists.
Top
See Also

Reference

Bncs.SysUtils Namespace


SystemEventLogWriter Constructor

SystemEventLogWriter Constructor
Constructor that creates event source from the supplied source and log name data.
Examples
This code demonstrates how to create a SystemEventLogWriter and then send a message to the system event log.
Copy
s Program
{
    static void Main()
    {
        // Create a log object
        SystemEventLogWriter logger = new SystemEventLogWriter("Test App", "ACME");
        // Write something to the Windows event log
        logger.Write("This is a message from Test App for the system event logger.");

        Console.ReadKey();
    }
}

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public SystemEventLogWriter(
    string source_,
    string logName_
)

Parameters

source_
Type: SystemString
Source name
logName_
Type: SystemString
Target log
See Also

Reference

SystemEventLogWriter Class
Bncs.SysUtils Namespace


SystemEventLogWriter Methods

SystemEventLogWriter Methods

The SystemEventLogWriter type exposes the following members.

Methods
Name Description
Public method Equals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public method GetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method ToString
Returns a string that represents the current object.
(Inherited from Object.)
Write
Writes the supplied event text to the system log.
Examples
This code demonstrates how to create a SystemEventLogWriter and then send a message to the system event log.
Copy
s Program
{
    static void Main()
    {
        // Create a log object
        SystemEventLogWriter logger = new SystemEventLogWriter("Test App", "ACME");
        // Write something to the Windows event log
        logger.Write("This is a message from Test App for the system event logger.");

        Console.ReadKey();
    }
}
Top
See Also

Reference

SystemEventLogWriter Class
Bncs.SysUtils Namespace


SystemEventLogWriter.Write Method

SystemEventLogWriterWrite Method
Writes the supplied event text to the system log.
Examples
This code demonstrates how to create a SystemEventLogWriter and then send a message to the system event log.
Copy
s Program
{
    static void Main()
    {
        // Create a log object
        SystemEventLogWriter logger = new SystemEventLogWriter("Test App", "ACME");
        // Write something to the Windows event log
        logger.Write("This is a message from Test App for the system event logger.");

        Console.ReadKey();
    }
}

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Write(
    string event_
)

Parameters

event_
Type: SystemString
String to log.

Return Value

Type: Boolean
True on success.
See Also

Reference

SystemEventLogWriter Class
Bncs.SysUtils Namespace


SystemEventLogWriter Properties

SystemEventLogWriter Properties

The SystemEventLogWriter type exposes the following members.

Properties
 | Name | Description
Public property | ErrorInformation | Gets the error information.
Public property | SourceExists | Returns true if the source exists.
Top
See Also

Reference

SystemEventLogWriter Class
Bncs.SysUtils Namespace


SystemEventLogWriter.ErrorInformation Property

SystemEventLogWriterErrorInformation Property
Gets the error information.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string ErrorInformation { get; }

Property Value

Type: String
See Also

Reference

SystemEventLogWriter Class
Bncs.SysUtils Namespace


SystemEventLogWriter.SourceExists Property

SystemEventLogWriterSourceExists Property
Returns true if the source exists.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool SourceExists { get; }

Property Value

Type: Boolean
See Also

Reference

SystemEventLogWriter Class
Bncs.SysUtils Namespace


TextFile Class

TextFile Class
Class that opens or creates, writes to and closes a text file
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsTextFile

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class TextFile : IDisposable

The TextFile type exposes the following members.

Constructors
 | Name | Description
Public method | TextFile | Constructor
Top
Methods
 | Name | Description
Public method | Clear | Closes the file handle if open, recreates the file as a new empty file and clears the in memory FileContent list.
Public method | Close | Closes the file handle if open
Public method | Dispose | Public implementation of the dispose pattern callable by consumers, which ensures that the file handle is closed
Public method | EditLine | Edits a line by changing the content at the supplied index with the new content supplied
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetLine | Gets a file line by index
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | RemoveAt | Removes the line at the supplied index
Public method | ToString | Returns the instance as a string containing the full file path (Overrides ObjectToString.)
Public method | WriteBool | Opens the file if not already open and writes the supplied boolean value to it, the value is controlled by the convertToInt_ argument. Closes the file if not configured otherwise in the constructor
Public method | WriteInt | Opens the file if not already open and writes the supplied integer value to it. Closes the file if not configured otherwise in the constructor
Public method | WriteLine | Opens the file if not already open and writes the supplied line to it. Closes the file if not configured otherwise in the constructor
Public method | WriteLines(ListString, NullableInt32) | Opens the file if not already open and writes the supplied lines to it. Closes the file if not configured otherwise in the constructor
Public method | WriteLines(String, NullableInt32) | Opens the file if not already open and writes the supplied lines to it. Closes the file if not configured otherwise in the constructor
Top
Properties
 | Name | Description
Public property | FileContent | Gets the file content into an array of strings
Public property | FileExists | Returns true if the file exists
Public property | HasError | Returns true if the instance is currently in error state, check the LastError property to get the error message
Public property | IsFileOpen | Returns true if the file handle is open
Public property | LastError | Gets then clears the last error message.After the OnError event handler is assigned then this always returns an empty string.
Public property | LineCount | Gets the number of lines in the file, this property is preferable to calling FileContent.Length as no array has to be constructed.
Top
Events
 | Name | Description
Public event | OnError | Event handler that when assigned reports any errors that occur
Top
See Also

Reference

Bncs.SysUtils Namespace


TextFile Constructor

TextFile Constructor
Constructor

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public TextFile(
    string filename_,
    bool overwriteExistingFile_,
    bool keepFileOpen_
)

Parameters

filename_
Type: SystemString
Full path to a file to open, the file does not need to exist
overwriteExistingFile_
Type: SystemBoolean
A flag which when set and the file exists will cause the existing file content to be overwritten
keepFileOpen_
Type: SystemBoolean
A flag which when set causes the file handle to remain open between writes. When done with the object instance you must call either Close() or Dispose()
See Also

Reference

TextFile Class
Bncs.SysUtils Namespace


TextFile Methods

TextFile Methods

The TextFile type exposes the following members.

Methods
 | Name | Description
Public method | Clear | Closes the file handle if open, recreates the file as a new empty file and clears the in memory FileContent list.
Public method | Close | Closes the file handle if open
Public method | Dispose | Public implementation of the dispose pattern callable by consumers, which ensures that the file handle is closed
Public method | EditLine | Edits a line by changing the content at the supplied index with the new content supplied
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetLine | Gets a file line by index
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | RemoveAt | Removes the line at the supplied index
Public method | ToString | Returns the instance as a string containing the full file path (Overrides ObjectToString.)
Public method | WriteBool | Opens the file if not already open and writes the supplied boolean value to it, the value is controlled by the convertToInt_ argument. Closes the file if not configured otherwise in the constructor
Public method | WriteInt | Opens the file if not already open and writes the supplied integer value to it. Closes the file if not configured otherwise in the constructor
Public method | WriteLine | Opens the file if not already open and writes the supplied line to it. Closes the file if not configured otherwise in the constructor
Public method | WriteLines(ListString, NullableInt32) | Opens the file if not already open and writes the supplied lines to it. Closes the file if not configured otherwise in the constructor
Public method | WriteLines(String, NullableInt32) | Opens the file if not already open and writes the supplied lines to it. Closes the file if not configured otherwise in the constructor
Top
See Also

Reference

TextFile Class
Bncs.SysUtils Namespace


TextFile.Clear Method

TextFileClear Method
Closes the file handle if open, recreates the file as a new empty file and clears the in memory FileContent list.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Clear()

Return Value

Type: Boolean
True on success, on failure check the LastError property if not subscribed to the OnError event handler
See Also

Reference

TextFile Class
Bncs.SysUtils Namespace


TextFile.Close Method

TextFileClose Method
Closes the file handle if open

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Close()
See Also

Reference

TextFile Class
Bncs.SysUtils Namespace


TextFile.Dispose Method

TextFileDispose Method
Public implementation of the dispose pattern callable by consumers, which ensures that the file handle is closed

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Dispose()

Implements

IDisposableDispose
See Also

Reference

TextFile Class
Bncs.SysUtils Namespace


TextFile.EditLine Method

TextFileEditLine Method
Edits a line by changing the content at the supplied index with the new content supplied

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool EditLine(
    string newLineContent_,
    int index_
)

Parameters

newLineContent_
Type: SystemString
New value of line content
index_
Type: SystemInt32
Index of line to edit

Return Value

Type: Boolean
True on success, on failure check the LastError property if not subscribed to the OnError event handler
See Also

Reference

TextFile Class
Bncs.SysUtils Namespace


TextFile.GetLine Method

TextFileGetLine Method
Gets a file line by index

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string GetLine(
    int index_
)

Parameters

index_
Type: SystemInt32
Index of line to retrieve

Return Value

Type: String
The file line at the supplied index or null if out of range
See Also

Reference

TextFile Class
Bncs.SysUtils Namespace


TextFile.RemoveAt Method

TextFileRemoveAt Method
Removes the line at the supplied index

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool RemoveAt(
    int index_
)

Parameters

index_
Type: SystemInt32
Index of line to remove

Return Value

Type: Boolean
True on success, on failure check the LastError property if not subscribed to the OnError event handler
See Also

Reference

TextFile Class
Bncs.SysUtils Namespace


TextFile.ToString Method

TextFileToString Method
Returns the instance as a string containing the full file path

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
The full file path
See Also

Reference

TextFile Class
Bncs.SysUtils Namespace


TextFile.WriteBool Method

TextFileWriteBool Method
Opens the file if not already open and writes the supplied boolean value to it, the value is controlled by the convertToInt_ argument. Closes the file if not configured otherwise in the constructor

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool WriteBool(
    bool value_,
    bool convertToInt_ = false,
    Nullable<int> index_ = null
)

Parameters

value_
Type: SystemBoolean
Boolean to write
convertToInt_ (Optional)
Type: SystemBoolean
If set then the true or false value is written as 1 or 0, else "True" or "False". This parameter is optional, if ommitted it defaults to false
index_ (Optional)
Type: SystemNullable Int32
Line index to which boolean will be inserted, this argument is optional and defaults to NULL, when null the boolean is appended to the file

Return Value

Type: Boolean
True on success, on failure check the LastError property if not subscribed to the OnError event handler
See Also

Reference

TextFile Class
Bncs.SysUtils Namespace


TextFile.WriteInt Method

TextFileWriteInt Method
Opens the file if not already open and writes the supplied integer value to it. Closes the file if not configured otherwise in the constructor

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool WriteInt(
    int value_,
    Nullable<int> index_ = null
)

Parameters

value_
Type: SystemInt32
Integer to write
index_ (Optional)
Type: SystemNullable Int32
Line index to which integer will be inserted, this argument is optional and defaults to NULL, when null the integer is appended to the file

Return Value

Type: Boolean
True on success, on failure check the LastError property if not subscribed to the OnError event handler
See Also

Reference

TextFile Class
Bncs.SysUtils Namespace


TextFile.WriteLine Method

TextFileWriteLine Method
Opens the file if not already open and writes the supplied line to it. Closes the file if not configured otherwise in the constructor

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool WriteLine(
    string line_,
    Nullable<int> index_ = null
)

Parameters

line_
Type: SystemString
Line to write
index_ (Optional)
Type: SystemNullable Int32
Line index to which line will be inserted, this argument is optional and defaults to NULL, when null the line is appended to the file

Return Value

Type: Boolean
True on success, on failure check the LastError property if not subscribed to the OnError event handler
See Also

Reference

TextFile Class
Bncs.SysUtils Namespace


TextFile.WriteLines Method

TextFileWriteLines Method
Overload List
 | Name | Description
Public method | WriteLines(ListString, NullableInt32) | Opens the file if not already open and writes the supplied lines to it. Closes the file if not configured otherwise in the constructor
Public method | WriteLines(String, NullableInt32) | Opens the file if not already open and writes the supplied lines to it. Closes the file if not configured otherwise in the constructor
Top
See Also

Reference

TextFile Class
Bncs.SysUtils Namespace


TextFile.WriteLines Method (List(String), Nullable(Int32))

TextFileWriteLines Method (ListString, NullableInt32)
Opens the file if not already open and writes the supplied lines to it. Closes the file if not configured otherwise in the constructor

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool WriteLines(
    List<string> lines_,
    Nullable<int> index_ = null
)

Parameters

lines_
Type: System.Collections.GenericList String
Lines to write
index_ (Optional)
Type: SystemNullable Int32
Line index to which lines will be inserted, this argument is optional and defaults to NULL, when null the lines are appended to the file

Return Value

Type: Boolean
True on success, on failure check the LastError property if not subscribed to the OnError event handler
See Also

Reference

TextFile Class
WriteLines Overload
Bncs.SysUtils Namespace


TextFile.WriteLines Method (String[], Nullable(Int32))

TextFileWriteLines Method (String, NullableInt32)
Opens the file if not already open and writes the supplied lines to it. Closes the file if not configured otherwise in the constructor

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool WriteLines(
    string[] lines_,
    Nullable<int> index_ = null
)

Parameters

lines_
Type: SystemString
Lines to write
index_ (Optional)
Type: SystemNullable Int32
Line index to which lines will be inserted, this argument is optional and defaults to NULL, when null the lines are appended to the file

Return Value

Type: Boolean
True on success, on failure check the LastError property if not subscribed to the OnError event handler
See Also

Reference

TextFile Class
WriteLines Overload
Bncs.SysUtils Namespace


TextFile Properties

TextFile Properties

The TextFile type exposes the following members.

Properties
 | Name | Description
Public property | FileContent | Gets the file content into an array of strings
Public property | FileExists | Returns true if the file exists
Public property | HasError | Returns true if the instance is currently in error state, check the LastError property to get the error message
Public property | IsFileOpen | Returns true if the file handle is open
Public property | LastError | Gets then clears the last error message.After the OnError event handler is assigned then this always returns an empty string.
Public property | LineCount | Gets the number of lines in the file, this property is preferable to calling FileContent.Length as no array has to be constructed.
Top
See Also

Reference

TextFile Class
Bncs.SysUtils Namespace


TextFile.FileContent Property

TextFileFileContent Property
Gets the file content into an array of strings

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string[] FileContent { get; }

Property Value

Type: String
See Also

Reference

TextFile Class
Bncs.SysUtils Namespace


TextFile.FileExists Property

TextFileFileExists Property
Returns true if the file exists

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool FileExists { get; }

Property Value

Type: Boolean
See Also

Reference

TextFile Class
Bncs.SysUtils Namespace


TextFile.HasError Property

TextFileHasError Property
Returns true if the instance is currently in error state, check the LastError property to get the error message

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool HasError { get; }

Property Value

Type: Boolean
See Also

Reference

TextFile Class
Bncs.SysUtils Namespace


TextFile.IsFileOpen Property

TextFileIsFileOpen Property
Returns true if the file handle is open

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool IsFileOpen { get; }

Property Value

Type: Boolean
See Also

Reference

TextFile Class
Bncs.SysUtils Namespace


TextFile.LastError Property

TextFileLastError Property
Gets then clears the last error message.After the OnError event handler is assigned then this always returns an empty string.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string LastError { get; }

Property Value

Type: String
See Also

Reference

TextFile Class
Bncs.SysUtils Namespace


TextFile.LineCount Property

TextFileLineCount Property
Gets the number of lines in the file, this property is preferable to calling FileContent.Length as no array has to be constructed.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int LineCount { get; }

Property Value

Type: Int32
See Also

Reference

TextFile Class
Bncs.SysUtils Namespace


TextFile Events

TextFile Events

The TextFile type exposes the following members.

Events
 | Name | Description
Public event | OnError | Event handler that when assigned reports any errors that occur
Top
See Also

Reference

TextFile Class
Bncs.SysUtils Namespace


TextFile.OnError Event

TextFileOnError Event
Event handler that when assigned reports any errors that occur

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnTextFileErrorEventHandler OnError

Value

Type: Bncs.SysUtilsOnTextFileErrorEventHandler
See Also

Reference

TextFile Class
Bncs.SysUtils Namespace


TextFileCache Class

TextFileCache Class
Class encapsulatng a multiple text file cache.
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsTextFileCache

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class TextFileCache

The TextFileCache type exposes the following members.

Constructors
 | Name | Description
Public method | TextFileCache | Default constructor
Public method | TextFileCache(Boolean) | Constructor that sets the date order property.
Public method | TextFileCache(UInt32) | Constructor that sets the maximum size of the cache.
Public method | TextFileCache(UInt32, Boolean) | Constructor that sets the maximum size of the cache and date order flag.
Top
Methods
 | Name | Description
Public method | Add(KeyValuePairString, String) | Adds a file to the cache in the form of a key value pair.
Public method | Add(ListString) | Adds multiple files to the cache.
Public method | Add(NullableKeyValuePairString, String) | Adds a file to the cache in the form of a key value pair.
Public method | Add(String) | Adds a file to the cache.
Public method | ClearAll | Clears all data including the KeepInDateOrder and Max properties.
Public method | ClearData | Clears data only.
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | Find | Seeks the supplied file name.
Public method | GetContent | Gets the content for the supplied file.
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Remove | Removes the supplied file from the cache.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | Content | Gets a list of all cached content.
Public property | Count | Gets the number of files on cache.
Public property | FilesList | Gets the list of files on the cache.
Public property | KeepInDateOrder | Gets or sets the KeepInDateOrder property, when set files are cached chronologically from oldest to newest.
Public property | MaxSize | Gets or sets the MaxSize property. The default value is zero meaning no limit. When a limit is imposed and breached then the oldest file on cache is removed.
Public property | Size | Gets the total size in bytes of all cached files.
Top
See Also

Reference

Bncs.SysUtils Namespace


TextFileCache Constructor

TextFileCache Constructor
Overload List
 | Name | Description
Public method | TextFileCache | Default constructor
Public method | TextFileCache(Boolean) | Constructor that sets the date order property.
Public method | TextFileCache(UInt32) | Constructor that sets the maximum size of the cache.
Public method | TextFileCache(UInt32, Boolean) | Constructor that sets the maximum size of the cache and date order flag.
Top
See Also

Reference

TextFileCache Class
Bncs.SysUtils Namespace


TextFileCache Constructor

TextFileCache Constructor
Default constructor

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public TextFileCache()
See Also

Reference

TextFileCache Class
TextFileCache Overload
Bncs.SysUtils Namespace


TextFileCache Constructor (Boolean)

TextFileCache Constructor (Boolean)
Constructor that sets the date order property.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public TextFileCache(
    bool keepInDateOrder_
)

Parameters

keepInDateOrder_
Type: SystemBoolean
Chrono flag
See Also

Reference

TextFileCache Class
TextFileCache Overload
Bncs.SysUtils Namespace


TextFileCache Constructor (UInt32)

TextFileCache Constructor (UInt32)
Constructor that sets the maximum size of the cache.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public TextFileCache(
    uint maxSize_
)

Parameters

maxSize_
Type: SystemUInt32
Cache size
See Also

Reference

TextFileCache Class
TextFileCache Overload
Bncs.SysUtils Namespace


TextFileCache Constructor (UInt32, Boolean)

TextFileCache Constructor (UInt32, Boolean)
Constructor that sets the maximum size of the cache and date order flag.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public TextFileCache(
    uint maxSize_,
    bool keepInDateOrder_
)

Parameters

maxSize_
Type: SystemUInt32
Cache size
keepInDateOrder_
Type: SystemBoolean
Chrono flag
See Also

Reference

TextFileCache Class
TextFileCache Overload
Bncs.SysUtils Namespace


TextFileCache Methods

TextFileCache Methods

The TextFileCache type exposes the following members.

Methods
 | Name | Description
Public method | Add(KeyValuePairString, String) | Adds a file to the cache in the form of a key value pair.
Public method | Add(ListString) | Adds multiple files to the cache.
Public method | Add(NullableKeyValuePairString, String) | Adds a file to the cache in the form of a key value pair.
Public method | Add(String) | Adds a file to the cache.
Public method | ClearAll | Clears all data including the KeepInDateOrder and Max properties.
Public method | ClearData | Clears data only.
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | Find | Seeks the supplied file name.
Public method | GetContent | Gets the content for the supplied file.
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Remove | Removes the supplied file from the cache.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

TextFileCache Class
Bncs.SysUtils Namespace


TextFileCache.Add Method

TextFileCacheAdd Method
Overload List
 | Name | Description
Public method | Add(KeyValuePairString, String) | Adds a file to the cache in the form of a key value pair.
Public method | Add(ListString) | Adds multiple files to the cache.
Public method | Add(NullableKeyValuePairString, String) | Adds a file to the cache in the form of a key value pair.
Public method | Add(String) | Adds a file to the cache.
Top
See Also

Reference

TextFileCache Class
Bncs.SysUtils Namespace


TextFileCache.Add Method (KeyValuePair(String, String[]))

TextFileCacheAdd Method (KeyValuePairString, String)
Adds a file to the cache in the form of a key value pair.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Add(
    KeyValuePair<string, string[]> pair_
)

Parameters

pair_
Type: System.Collections.GenericKeyValuePair String, String
File name/data to add
See Also

Reference

TextFileCache Class
Add Overload
Bncs.SysUtils Namespace


TextFileCache.Add Method (List(String))

TextFileCacheAdd Method (ListString)
Adds multiple files to the cache.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Add(
    List<string> filenames_
)

Parameters

filenames_
Type: System.Collections.GenericList String
List of file names to add.

Return Value

Type: Int32
The number of files sucessfully added.
See Also

Reference

TextFileCache Class
Add Overload
Bncs.SysUtils Namespace


TextFileCache.Add Method (Nullable(KeyValuePair(String, String[])))

TextFileCacheAdd Method (NullableKeyValuePairString, String)
Adds a file to the cache in the form of a key value pair.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Add(
    Nullable<KeyValuePair<string, string[]>> pair_
)

Parameters

pair_
Type: SystemNullable KeyValuePair String, String
File name/data to add
See Also

Reference

TextFileCache Class
Add Overload
Bncs.SysUtils Namespace


TextFileCache.Add Method (String)

TextFileCacheAdd Method (String)
Adds a file to the cache.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Add(
    string filename_
)

Parameters

filename_
Type: SystemString
Name and full path of file to add.

Return Value

Type: Boolean
True on success
See Also

Reference

TextFileCache Class
Add Overload
Bncs.SysUtils Namespace


TextFileCache.ClearAll Method

TextFileCacheClearAll Method
Clears all data including the KeepInDateOrder and Max properties.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void ClearAll()
See Also

Reference

TextFileCache Class
Bncs.SysUtils Namespace


TextFileCache.ClearData Method

TextFileCacheClearData Method
Clears data only.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void ClearData()
See Also

Reference

TextFileCache Class
Bncs.SysUtils Namespace


TextFileCache.Find Method

TextFileCacheFind Method
Seeks the supplied file name.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Nullable<KeyValuePair<string, string[]>> Find(
    string filename_
)

Parameters

filename_
Type: SystemString
File to find

Return Value

Type: Nullable KeyValuePair String, String
A key value pair consisting of the file name and content
See Also

Reference

TextFileCache Class
Bncs.SysUtils Namespace


TextFileCache.GetContent Method

TextFileCacheGetContent Method
Gets the content for the supplied file.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string[] GetContent(
    string filename_
)

Parameters

filename_
Type: SystemString
Name of disk file

Return Value

Type: String
An array of file cntents.
See Also

Reference

TextFileCache Class
Bncs.SysUtils Namespace


TextFileCache.Remove Method

TextFileCacheRemove Method
Removes the supplied file from the cache.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Remove(
    string filename_
)

Parameters

filename_
Type: SystemString
File to remove.

Return Value

Type: Boolean
True on success.
See Also

Reference

TextFileCache Class
Bncs.SysUtils Namespace


TextFileCache Properties

TextFileCache Properties

The TextFileCache type exposes the following members.

Properties
 | Name | Description
Public property | Content | Gets a list of all cached content.
Public property | Count | Gets the number of files on cache.
Public property | FilesList | Gets the list of files on the cache.
Public property | KeepInDateOrder | Gets or sets the KeepInDateOrder property, when set files are cached chronologically from oldest to newest.
Public property | MaxSize | Gets or sets the MaxSize property. The default value is zero meaning no limit. When a limit is imposed and breached then the oldest file on cache is removed.
Public property | Size | Gets the total size in bytes of all cached files.
Top
See Also

Reference

TextFileCache Class
Bncs.SysUtils Namespace


TextFileCache.Content Property

TextFileCacheContent Property
Gets a list of all cached content.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public TextFileLine[] Content { get; }

Property Value

Type: TextFileLine
See Also

Reference

TextFileCache Class
Bncs.SysUtils Namespace


TextFileCache.Count Property

TextFileCacheCount Property
Gets the number of files on cache.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Count { get; }

Property Value

Type: Int32
See Also

Reference

TextFileCache Class
Bncs.SysUtils Namespace


TextFileCache.FilesList Property

TextFileCacheFilesList Property
Gets the list of files on the cache.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string[] FilesList { get; }

Property Value

Type: String
See Also

Reference

TextFileCache Class
Bncs.SysUtils Namespace


TextFileCache.KeepInDateOrder Property

TextFileCacheKeepInDateOrder Property
Gets or sets the KeepInDateOrder property, when set files are cached chronologically from oldest to newest.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool KeepInDateOrder { get; set; }

Property Value

Type: Boolean
See Also

Reference

TextFileCache Class
Bncs.SysUtils Namespace


TextFileCache.MaxSize Property

TextFileCacheMaxSize Property
Gets or sets the MaxSize property. The default value is zero meaning no limit. When a limit is imposed and breached then the oldest file on cache is removed.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint MaxSize { get; set; }

Property Value

Type: UInt32
See Also

Reference

TextFileCache Class
Bncs.SysUtils Namespace


TextFileCache.Size Property

TextFileCacheSize Property
Gets the total size in bytes of all cached files.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public long Size { get; }

Property Value

Type: Int64
See Also

Reference

TextFileCache Class
Bncs.SysUtils Namespace


TextFileLine Class

TextFileLine Class
Class encapsulating a single text file line.
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsTextFileLine

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class TextFileLine

The TextFileLine type exposes the following members.

Constructors
 | Name | Description
Public method | TextFileLine | Constructor that sets the text and file reference.
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | FileReference | Gets the file reference (index).
Public property | Text | Gets the line text.
Top
See Also

Reference

Bncs.SysUtils Namespace


TextFileLine Constructor

TextFileLine Constructor
Constructor that sets the text and file reference.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public TextFileLine(
    string text_,
    uint fileReference_
)

Parameters

text_
Type: SystemString
Line text
fileReference_
Type: SystemUInt32
File index
See Also

Reference

TextFileLine Class
Bncs.SysUtils Namespace


TextFileLine Methods

TextFileLine Methods

The TextFileLine type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

TextFileLine Class
Bncs.SysUtils Namespace


TextFileLine Properties

TextFileLine Properties

The TextFileLine type exposes the following members.

Properties
 | Name | Description
Public property | FileReference | Gets the file reference (index).
Public property | Text | Gets the line text.
Top
See Also

Reference

TextFileLine Class
Bncs.SysUtils Namespace


TextFileLine.FileReference Property

TextFileLineFileReference Property
Gets the file reference (index).

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint FileReference { get; }

Property Value

Type: UInt32
See Also

Reference

TextFileLine Class
Bncs.SysUtils Namespace


TextFileLine.Text Property

TextFileLineText Property
Gets the line text.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Text { get; }

Property Value

Type: String
See Also

Reference

TextFileLine Class
Bncs.SysUtils Namespace


ThreadTimer Class

ThreadTimer Class
A thread safe timer class
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsThreadTimer

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class ThreadTimer

The ThreadTimer type exposes the following members.

Constructors
 | Name | Description
Public method | ThreadTimer | Initializes a new instance of the ThreadTimer class
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Start | Starts the timer if not yet running.
Public method | Stop | Stops the timer if running.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | Interval | Gets or sets the timer interval in milliseconds, minimum value is 1, default is 1000.
Public property | IsRunning | Gets a flag betraying if the timer is running
Top
Events
 | Name | Description
Public event | Tick | Fires when the timer expires.
Top
See Also

Reference

Bncs.SysUtils Namespace


ThreadTimer Constructor

ThreadTimer Constructor
Initializes a new instance of the ThreadTimer class

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ThreadTimer()
See Also

Reference

ThreadTimer Class
Bncs.SysUtils Namespace


ThreadTimer Methods

ThreadTimer Methods

The ThreadTimer type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Start | Starts the timer if not yet running.
Public method | Stop | Stops the timer if running.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

ThreadTimer Class
Bncs.SysUtils Namespace


ThreadTimer.Start Method

ThreadTimerStart Method
Starts the timer if not yet running.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Start()
See Also

Reference

ThreadTimer Class
Bncs.SysUtils Namespace


ThreadTimer.Stop Method

ThreadTimerStop Method
Stops the timer if running.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Stop()
See Also

Reference

ThreadTimer Class
Bncs.SysUtils Namespace


ThreadTimer Properties

ThreadTimer Properties

The ThreadTimer type exposes the following members.

Properties
 | Name | Description
Public property | Interval | Gets or sets the timer interval in milliseconds, minimum value is 1, default is 1000.
Public property | IsRunning | Gets a flag betraying if the timer is running
Top
See Also

Reference

ThreadTimer Class
Bncs.SysUtils Namespace


ThreadTimer.Interval Property

ThreadTimerInterval Property
Gets or sets the timer interval in milliseconds, minimum value is 1, default is 1000.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint Interval { get; set; }

Property Value

Type: UInt32
See Also

Reference

ThreadTimer Class
Bncs.SysUtils Namespace


ThreadTimer.IsRunning Property

ThreadTimerIsRunning Property
Gets a flag betraying if the timer is running

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool IsRunning { get; }

Property Value

Type: Boolean
See Also

Reference

ThreadTimer Class
Bncs.SysUtils Namespace


ThreadTimer Events

ThreadTimer Events

The ThreadTimer type exposes the following members.

Events
 | Name | Description
Public event | Tick | Fires when the timer expires.
Top
See Also

Reference

ThreadTimer Class
Bncs.SysUtils Namespace


ThreadTimer.Tick Event

ThreadTimerTick Event
Fires when the timer expires.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event EventHandler Tick

Value

Type: SystemEventHandler
See Also

Reference

ThreadTimer Class
Bncs.SysUtils Namespace


TokPriv1Luid Structure

TokPriv1Luid Structure
Token privilege structure

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public struct TokPriv1Luid

The TokPriv1Luid type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Indicates whether this instance and a specified object are equal. (Inherited from ValueType.)
Public method | GetHashCode | Returns the hash code for this instance. (Inherited from ValueType.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns the fully qualified type name of this instance. (Inherited from ValueType.)
Top
Fields
 | Name | Description
Public field | Attr | Attributes
Public field | Count | Count
Public field | Luid | UID
Top
See Also

Reference

Bncs.SysUtils Namespace


TokPriv1Luid Fields

TokPriv1Luid Fields

The TokPriv1Luid type exposes the following members.

Fields
 | Name | Description
Public field | Attr | Attributes
Public field | Count | Count
Public field | Luid | UID
Top
See Also

Reference

TokPriv1Luid Structure
Bncs.SysUtils Namespace


TokPriv1Luid.Attr Field

TokPriv1LuidAttr Field
Attributes

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Attr

Field Value

Type: Int32
See Also

Reference

TokPriv1Luid Structure
Bncs.SysUtils Namespace


TokPriv1Luid.Count Field

TokPriv1LuidCount Field
Count

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Count

Field Value

Type: Int32
See Also

Reference

TokPriv1Luid Structure
Bncs.SysUtils Namespace


TokPriv1Luid.Luid Field

TokPriv1LuidLuid Field
UID

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public long Luid

Field Value

Type: Int64
See Also

Reference

TokPriv1Luid Structure
Bncs.SysUtils Namespace


TokPriv1Luid Methods

TokPriv1Luid Methods

The TokPriv1Luid type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Indicates whether this instance and a specified object are equal. (Inherited from ValueType.)
Public method | GetHashCode | Returns the hash code for this instance. (Inherited from ValueType.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns the fully qualified type name of this instance. (Inherited from ValueType.)
Top
See Also

Reference

TokPriv1Luid Structure
Bncs.SysUtils Namespace


WinAPI Class

WinAPI Class
Class for importing WinAPI methods
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsWinAPI

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static class WinAPI

The WinAPI type exposes the following members.

Methods
Name Description
AdjustTokenPrivileges
Adjusts a token privilege
BringWindowToTop(IntPtr)
Brings the supplied window to the front.
BringWindowToTop(HandleRef)
Brings the supplied window to the front.
CallNextHookEx
Passes the hook information to the next hook procedure in the current hook chain. A hook procedure can call this function either before or after processing the hook information.
CallWndRetProc
An application-defined or library-defined callback function used with the SetWindowsHookEx function. The system calls this function after the SendMessage function is called. The hook procedure can examine the message; it cannot modify it.
DestroyWindow
The DestroyWindow function destroys the specified window. The function sends WM_DESTROY and WM_NCDESTROY messages to the window to deactivate it and remove the keyboard focus from it. The function also destroys the window's menu, flushes the thread message queue, destroys timers, removes clipboard ownership, and breaks the clipboard viewer chain (if the window is at the top of the viewer chain)
EnumChildWindows(IntPtr, WinAPIEnumWindowProc, IntPtr)
Enumerates all child windows.
EnumChildWindows(IntPtr, WinAPIWin32Callback, IntPtr)
Enumerates all child windows.
EnumWindows
Enumerates all top level windows into an ArrayList.
ExitWindowsEx
Exits the Windows OS
FindExecutableA
FindExecutable import.
FindWindow
The FindWindow function retrieves a handle to the top-level window whose class name and window name match the specified strings. This function does not search child windows. This function does not perform a case-sensitive search. To search child windows, beginning with a specified child window, use the FindWindowEx function.
FindWindowEx
Searches a child window, beginning with a specified child window
GetClassLongPtr32
Gets a 32 bit class pointer
GetClassLongPtr64
Gets a 64 bit class pointer
GetClassName
Gets the class name of a window.
GetCurrentProcess
Gets the current process
GetCurrentThreadId
Gets the thread ID of the current process.
GetLastError
Retrieves the calling thread's last-error code value.
GetLongPathName
Gets the long path name for the supplied path
GetModuleHandle
Gets the module handle
GetParent
Retrieves a handle to the specified window's parent or owner.
GetProcAddress
Gets a procedure address from a DLL.
GetShortPathName
Gets the short 8.3 path name of the supplied path.
GetWindowPlacement
Populates a WINDOWPLACEMENT structure with pertinent data about the supplied window.
GetWindowRect
Retrieves the dimensions of the bounding rectangle of the specified window. The dimensions are given in screen coordinates that are relative to the upper-left corner of the screen.
GetWindowText
Gets the the text from a window caption.
IsNetworkAlive
Ascertains if a network cable is physically plugged in.
IsWindowVisible
Returns true if the window is visible.
LoadLibrary
Loads a DLL.
LookupPrivilegeValue
Looks up a privilege value.
OpenProcessToken
Opens a process token.
PostMessage
Posts a message to a window, ie does not wait.
RegisterWindowMessage
Registers a windows message or retrieves it if another process has already registered it.
Examples
This example demonstrates use of the WPFMessageHandler class, how to trap message, how to send a string to another window and how to create a unique window message.
Copy
// Create a unique window message
private uint WM_MESSAGE = WinAPI.RegisterWindowMessage("5e98d834-83f2-4cea-b7c7-7eb2e060f47a");

// WPF app loaded event handler, create a WPFMessageHandler and assign it's OnMessage event handler.
private void AppLoaded(object sender, RoutedEventArgs e)
{
    WPFMessageHandler handler = new WPFMessageHandler(this);
    handler.OnMessage += HandlerOnMessage;
}

// Method that sends the supplied string to the supplied window
private void SendStringToWindow(IntPtr targetWindow_, string message_)
{
    WMFuncs.SendWindowsStringMessage(targetWindow_.ToInt32(), 0, message_);
}

// WPFMessageHandler's OnMessage event handler adds the received string to a ListBox
private IntPtr HandlerOnMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
    handled = msg == WinAPI.WM_COPYDATA;
    if (handled)
    {
        string message = string.Empty;
        try
        {
            message = WMFuncs.ParamsCopyDataToString(hwnd, msg, wParam, lParam);
        }
        catch (Exception exception)
        {
            message = null;
            Dispatcher.BeginInvoke(new Action(() => lbIn.Items.Add(exception.Message + " - " + exception.GetType().ToString())));
        }
        if (null == message)
            message = "An error occured";
        Dispatcher.BeginInvoke(new Action(() => lbIn.Items.Add(message)));
    }
    return hwnd;
}
SendMessage(Int32, Int32, Int32, COPYDATASTRUCT)
Sends a COPYDATASTRUCT structure to a window.
SendMessage(Int32, Int32, Int32, Int32)
Sends a message to a window
SendMessage(IntPtr, Int32, Int32, Int32)
Sends a message to a window
SendMessage(IntPtr, UInt32, IntPtr, IntPtr)
Sends a message to a window
SendMessage(IntPtr, UInt32, IntPtr, StringBuilder)
Sends a message to a window
SetWindowsHookEx
Installs an application-defined hook procedure into a hook chain. You would install a hook procedure to monitor the system for certain types of events. These events are associated either with a specific thread or with all threads in the same desktop as the calling thread.
SetWinEventHook
Sets an event hook function for a range of events.
ShowWindow
Shows or hides a window.
Sleep
Stop processing (sleep process) for specified number of miliseconds.
UnhookWindowsHookEx
Removes a hook procedure installed in a hook chain by the SetWindowsHookEx function.
UnhookWinEvent
Removes an event hook function created by a previous call to SetWinEventHook.
WaitForSingleObject
Waits until the specified object is in the signaled state or the time-out interval elapses.
Top
Fields
Name Description
EVENT_AIA_END
Gets the AIA end value.
EVENT_AIA_START
Gets the AIA start value.
EVENT_CONSOLE_CARET
Gets the console caret value.
EVENT_CONSOLE_END
Gets the console end value.
EVENT_CONSOLE_END_APPLICATION
Gets the console end application value.
EVENT_CONSOLE_LAYOUT
Gets the console layout value.
EVENT_CONSOLE_START_APPLICATION
Gets the console start application value.
EVENT_CONSOLE_UPDATE_REGION
Gets the console update region value.
EVENT_CONSOLE_UPDATE_SCROLL
Gets the console update scroll value.
EVENT_CONSOLE_UPDATE_SIMPLE
Gets the console update simple value.
EVENT_MAX
Gets the max value.
EVENT_MIN
Events are SYNC, this causes your dll to be injected into every process
EVENT_OBJECT_ACCELERATORCHANGE
hwnd ID idChild is item w/ def action change
EVENT_OBJECT_CONTENTSCROLLED
Gets the content scrolled value.
EVENT_OBJECT_CREATE
Gets the object create value.
EVENT_OBJECT_DEFACTIONCHANGE
hwnd ID idChild is item w/ help change
EVENT_OBJECT_DESCRIPTIONCHANGE
hwnd ID idChild is item w/ name change
EVENT_OBJECT_DESTROY
hwnd ID idChild is created item
EVENT_OBJECT_END
Gets the object end value.
EVENT_OBJECT_FOCUS
hwnd ID idChild is parent of zordering children
EVENT_OBJECT_HELPCHANGE
hwnd ID idChild is item w/ new parent
EVENT_OBJECT_HIDE
hwnd ID idChild is shown item
EVENT_OBJECT_INVOKED
hwnd ID idChild is item w/ keybd accel change
EVENT_OBJECT_LOCATIONCHANGE
hwnd ID idChild is item w/ state change
EVENT_OBJECT_NAMECHANGE
hwnd ID idChild is moved/sized item
EVENT_OBJECT_PARENTCHANGE
hwnd ID idChild is item w/ value change
EVENT_OBJECT_REORDER
hwnd ID idChild is hidden item
EVENT_OBJECT_SELECTION
hwnd ID idChild is focused item
EVENT_OBJECT_SELECTIONADD
hwnd ID idChild is selected item (if only one), or idChild is OBJID_WINDOW if complex
EVENT_OBJECT_SELECTIONREMOVE
hwnd ID idChild is item added
EVENT_OBJECT_SELECTIONWITHIN
hwnd ID idChild is item removed
EVENT_OBJECT_SHOW
hwnd ID idChild is destroyed item
EVENT_OBJECT_STATECHANGE
hwnd ID idChild is parent of changed selected items
EVENT_OBJECT_TEXTSELECTIONCHANGED
hwnd ID idChild is item invoked
EVENT_OBJECT_VALUECHANGE
hwnd ID idChild is item w/ desc change
EVENT_OEM_DEFINED_END
Gets the OEM defined end value.
EVENT_OEM_DEFINED_START
Gets the OEM defined start value.
EVENT_SYSTEM_ALERT
Gets the system sound value.
EVENT_SYSTEM_ARRANGMENTPREVIEW
Gets the arrangement preview value.
EVENT_SYSTEM_CAPTUREEND
Gets the system capture end value.
EVENT_SYSTEM_CAPTURESTART
Gets the system capture start value.
EVENT_SYSTEM_CONTEXTHELPEND
Gets the system context help end value.
EVENT_SYSTEM_CONTEXTHELPSTART
Gets the system context help start value.
EVENT_SYSTEM_DESKTOPSWITCH
Gets the system desktop switch value.
EVENT_SYSTEM_DIALOGEND
Gets the system dialog end value.
EVENT_SYSTEM_DIALOGSTART
Gets the system dialog start value.
EVENT_SYSTEM_DRAGDROPEND
Gets the system drag n drop end value.
EVENT_SYSTEM_DRAGDROPSTART
Gets the system drag n drop start value.
EVENT_SYSTEM_END
Gets the system end value.
EVENT_SYSTEM_FOREGROUND
Gets the system alert value.
EVENT_SYSTEM_MENUEND
Gets the system menu end value.
EVENT_SYSTEM_MENUPOPUPEND
Gets the system menu popup end value.
EVENT_SYSTEM_MENUPOPUPSTART
Gets the system menu popup start value.
EVENT_SYSTEM_MENUSTART
Gets the system menu start value.
EVENT_SYSTEM_MINIMIZEEND
Gets the system minimise end value.
EVENT_SYSTEM_MINIMIZESTART
Gets the system minimise start value.
EVENT_SYSTEM_MOVESIZEEND
Gets the system move size end value.
EVENT_SYSTEM_MOVESIZESTART
Gets the system move sisze start value.
EVENT_SYSTEM_SCROLLINGEND
Gets the system scrolling end value.
EVENT_SYSTEM_SCROLLINGSTART
Gets the system scrolling start value.
EVENT_SYSTEM_SOUND
Gets the max value.
EVENT_SYSTEM_SWITCHEND
Gets the system switch end value.
EVENT_SYSTEM_SWITCHSTART
Gets the system switch start value.
EVENT_UIA_EVENTID_END
Gets the UIA event id end value.
EVENT_UIA_EVENTID_START
Gets the UIA event id start value.
EVENT_UIA_PROPID_END
Gets the UIA property ID end value.
EVENT_UIA_PROPID_START
Gets the UIA property ID start value.
EWX_FORCE
Windows Force action flag
EWX_FORCEIFHUNG
Windows Force if hung flag
EWX_LOGOFF
Windows Log off command
EWX_POWEROFF
Windows Power off command
EWX_REBOOT
Windows Reboot command
EWX_SHUTDOWN
Windows Shutdown command
GCL_HICON
Gets the graphic system icon pointer value.
GCL_HICONSM
Gets the graphic system icon pointer value.
HC_ACTION
Gets the action value.
HWND_BROADCAST
Flag for PostMessage() function, when used in place of a target window handle the message is posted to all top level windows, not child windows though.
ICON_BIG
Gets the big icon value.
ICON_SMALL
Gets the small icon value.
ICON_SMALL2
Gets the small icon value.
SE_PRIVILEGE_ENABLED
Privilege enabled
SE_SHUTDOWN_NAME
Shutdown name
TOKEN_ADJUST_PRIVILEGES
Token adjust privileges
TOKEN_QUERY
Token query
WAIT_ABANDONED
The specified object is a mutex object that was not released by the thread that owned the mutex object before the owning thread terminated. Ownership of the mutex object is granted to the calling thread and the mutex state is set to nonsignaled. see=Bncs.SysUtils.WinAPI.WaitForSingleObject/
WAIT_FAILED
The function has failed. To get extended error information, call GetLastError. see=Bncs.SysUtils.WinAPI.WaitForSingleObject/
WAIT_OBJECT_0
The state of the specified object is signaled. see=Bncs.SysUtils.WinAPI.WaitForSingleObject/
WAIT_TIMEOUT
The time-out interval elapsed, and the object's state is nonsignaled. see=Bncs.SysUtils.WinAPI.WaitForSingleObject/
WINEVENT_INCONTEXT
Don't call back for events on installer's process
WINEVENT_OUTOFCONTEXT
Gets the out of context value.
WINEVENT_SKIPOWNPROCESS
Don't call back for events on installer's thread
WINEVENT_SKIPOWNTHREAD
Events are ASYNC
WM_COPYDATA
Copy data window message
Examples
This example demonstrates use of the WPFMessageHandler class, how to trap message, how to send a string to another window and how to create a unique window message.
Copy
// Create a unique window message
private uint WM_MESSAGE = WinAPI.RegisterWindowMessage("5e98d834-83f2-4cea-b7c7-7eb2e060f47a");

// WPF app loaded event handler, create a WPFMessageHandler and assign it's OnMessage event handler.
private void AppLoaded(object sender, RoutedEventArgs e)
{
    WPFMessageHandler handler = new WPFMessageHandler(this);
    handler.OnMessage += HandlerOnMessage;
}

// Method that sends the supplied string to the supplied window
private void SendStringToWindow(IntPtr targetWindow_, string message_)
{
    WMFuncs.SendWindowsStringMessage(targetWindow_.ToInt32(), 0, message_);
}

// WPFMessageHandler's OnMessage event handler adds the received string to a ListBox
private IntPtr HandlerOnMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
    handled = msg == WinAPI.WM_COPYDATA;
    if (handled)
    {
        string message = string.Empty;
        try
        {
            message = WMFuncs.ParamsCopyDataToString(hwnd, msg, wParam, lParam);
        }
        catch (Exception exception)
        {
            message = null;
            Dispatcher.BeginInvoke(new Action(() => lbIn.Items.Add(exception.Message + " - " + exception.GetType().ToString())));
        }
        if (null == message)
            message = "An error occured";
        Dispatcher.BeginInvoke(new Action(() => lbIn.Items.Add(message)));
    }
    return hwnd;
}
WM_GETICON
Gets the window icon value.
WM_GETTEXT
Get text value.
WM_GETTEXTLENGTH
Get text length value.
WM_WINDOWPOSCHANGED
Gets window change notification.
Top
See Also

Reference

Bncs.SysUtils Namespace


WinAPI Fields

WinAPI Fields

The WinAPI type exposes the following members.

Fields
Name Description
EVENT_AIA_END
Gets the AIA end value.
EVENT_AIA_START
Gets the AIA start value.
EVENT_CONSOLE_CARET
Gets the console caret value.
EVENT_CONSOLE_END
Gets the console end value.
EVENT_CONSOLE_END_APPLICATION
Gets the console end application value.
EVENT_CONSOLE_LAYOUT
Gets the console layout value.
EVENT_CONSOLE_START_APPLICATION
Gets the console start application value.
EVENT_CONSOLE_UPDATE_REGION
Gets the console update region value.
EVENT_CONSOLE_UPDATE_SCROLL
Gets the console update scroll value.
EVENT_CONSOLE_UPDATE_SIMPLE
Gets the console update simple value.
EVENT_MAX
Gets the max value.
EVENT_MIN
Events are SYNC, this causes your dll to be injected into every process
EVENT_OBJECT_ACCELERATORCHANGE
hwnd ID idChild is item w/ def action change
EVENT_OBJECT_CONTENTSCROLLED
Gets the content scrolled value.
EVENT_OBJECT_CREATE
Gets the object create value.
EVENT_OBJECT_DEFACTIONCHANGE
hwnd ID idChild is item w/ help change
EVENT_OBJECT_DESCRIPTIONCHANGE
hwnd ID idChild is item w/ name change
EVENT_OBJECT_DESTROY
hwnd ID idChild is created item
EVENT_OBJECT_END
Gets the object end value.
EVENT_OBJECT_FOCUS
hwnd ID idChild is parent of zordering children
EVENT_OBJECT_HELPCHANGE
hwnd ID idChild is item w/ new parent
EVENT_OBJECT_HIDE
hwnd ID idChild is shown item
EVENT_OBJECT_INVOKED
hwnd ID idChild is item w/ keybd accel change
EVENT_OBJECT_LOCATIONCHANGE
hwnd ID idChild is item w/ state change
EVENT_OBJECT_NAMECHANGE
hwnd ID idChild is moved/sized item
EVENT_OBJECT_PARENTCHANGE
hwnd ID idChild is item w/ value change
EVENT_OBJECT_REORDER
hwnd ID idChild is hidden item
EVENT_OBJECT_SELECTION
hwnd ID idChild is focused item
EVENT_OBJECT_SELECTIONADD
hwnd ID idChild is selected item (if only one), or idChild is OBJID_WINDOW if complex
EVENT_OBJECT_SELECTIONREMOVE
hwnd ID idChild is item added
EVENT_OBJECT_SELECTIONWITHIN
hwnd ID idChild is item removed
EVENT_OBJECT_SHOW
hwnd ID idChild is destroyed item
EVENT_OBJECT_STATECHANGE
hwnd ID idChild is parent of changed selected items
EVENT_OBJECT_TEXTSELECTIONCHANGED
hwnd ID idChild is item invoked
EVENT_OBJECT_VALUECHANGE
hwnd ID idChild is item w/ desc change
EVENT_OEM_DEFINED_END
Gets the OEM defined end value.
EVENT_OEM_DEFINED_START
Gets the OEM defined start value.
EVENT_SYSTEM_ALERT
Gets the system sound value.
EVENT_SYSTEM_ARRANGMENTPREVIEW
Gets the arrangement preview value.
EVENT_SYSTEM_CAPTUREEND
Gets the system capture end value.
EVENT_SYSTEM_CAPTURESTART
Gets the system capture start value.
EVENT_SYSTEM_CONTEXTHELPEND
Gets the system context help end value.
EVENT_SYSTEM_CONTEXTHELPSTART
Gets the system context help start value.
EVENT_SYSTEM_DESKTOPSWITCH
Gets the system desktop switch value.
EVENT_SYSTEM_DIALOGEND
Gets the system dialog end value.
EVENT_SYSTEM_DIALOGSTART
Gets the system dialog start value.
EVENT_SYSTEM_DRAGDROPEND
Gets the system drag n drop end value.
EVENT_SYSTEM_DRAGDROPSTART
Gets the system drag n drop start value.
EVENT_SYSTEM_END
Gets the system end value.
EVENT_SYSTEM_FOREGROUND
Gets the system alert value.
EVENT_SYSTEM_MENUEND
Gets the system menu end value.
EVENT_SYSTEM_MENUPOPUPEND
Gets the system menu popup end value.
EVENT_SYSTEM_MENUPOPUPSTART
Gets the system menu popup start value.
EVENT_SYSTEM_MENUSTART
Gets the system menu start value.
EVENT_SYSTEM_MINIMIZEEND
Gets the system minimise end value.
EVENT_SYSTEM_MINIMIZESTART
Gets the system minimise start value.
EVENT_SYSTEM_MOVESIZEEND
Gets the system move size end value.
EVENT_SYSTEM_MOVESIZESTART
Gets the system move sisze start value.
EVENT_SYSTEM_SCROLLINGEND
Gets the system scrolling end value.
EVENT_SYSTEM_SCROLLINGSTART
Gets the system scrolling start value.
EVENT_SYSTEM_SOUND
Gets the max value.
EVENT_SYSTEM_SWITCHEND
Gets the system switch end value.
EVENT_SYSTEM_SWITCHSTART
Gets the system switch start value.
EVENT_UIA_EVENTID_END
Gets the UIA event id end value.
EVENT_UIA_EVENTID_START
Gets the UIA event id start value.
EVENT_UIA_PROPID_END
Gets the UIA property ID end value.
EVENT_UIA_PROPID_START
Gets the UIA property ID start value.
EWX_FORCE
Windows Force action flag
EWX_FORCEIFHUNG
Windows Force if hung flag
EWX_LOGOFF
Windows Log off command
EWX_POWEROFF
Windows Power off command
EWX_REBOOT
Windows Reboot command
EWX_SHUTDOWN
Windows Shutdown command
GCL_HICON
Gets the graphic system icon pointer value.
GCL_HICONSM
Gets the graphic system icon pointer value.
HC_ACTION
Gets the action value.
HWND_BROADCAST
Flag for PostMessage() function, when used in place of a target window handle the message is posted to all top level windows, not child windows though.
ICON_BIG
Gets the big icon value.
ICON_SMALL
Gets the small icon value.
ICON_SMALL2
Gets the small icon value.
SE_PRIVILEGE_ENABLED
Privilege enabled
SE_SHUTDOWN_NAME
Shutdown name
TOKEN_ADJUST_PRIVILEGES
Token adjust privileges
TOKEN_QUERY
Token query
WAIT_ABANDONED
The specified object is a mutex object that was not released by the thread that owned the mutex object before the owning thread terminated. Ownership of the mutex object is granted to the calling thread and the mutex state is set to nonsignaled. see=Bncs.SysUtils.WinAPI.WaitForSingleObject/
WAIT_FAILED
The function has failed. To get extended error information, call GetLastError. see=Bncs.SysUtils.WinAPI.WaitForSingleObject/
WAIT_OBJECT_0
The state of the specified object is signaled. see=Bncs.SysUtils.WinAPI.WaitForSingleObject/
WAIT_TIMEOUT
The time-out interval elapsed, and the object's state is nonsignaled. see=Bncs.SysUtils.WinAPI.WaitForSingleObject/
WINEVENT_INCONTEXT
Don't call back for events on installer's process
WINEVENT_OUTOFCONTEXT
Gets the out of context value.
WINEVENT_SKIPOWNPROCESS
Don't call back for events on installer's thread
WINEVENT_SKIPOWNTHREAD
Events are ASYNC
WM_COPYDATA
Copy data window message
Examples
This example demonstrates use of the WPFMessageHandler class, how to trap message, how to send a string to another window and how to create a unique window message.
Copy
// Create a unique window message
private uint WM_MESSAGE = WinAPI.RegisterWindowMessage("5e98d834-83f2-4cea-b7c7-7eb2e060f47a");

// WPF app loaded event handler, create a WPFMessageHandler and assign it's OnMessage event handler.
private void AppLoaded(object sender, RoutedEventArgs e)
{
    WPFMessageHandler handler = new WPFMessageHandler(this);
    handler.OnMessage += HandlerOnMessage;
}

// Method that sends the supplied string to the supplied window
private void SendStringToWindow(IntPtr targetWindow_, string message_)
{
    WMFuncs.SendWindowsStringMessage(targetWindow_.ToInt32(), 0, message_);
}

// WPFMessageHandler's OnMessage event handler adds the received string to a ListBox
private IntPtr HandlerOnMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
    handled = msg == WinAPI.WM_COPYDATA;
    if (handled)
    {
        string message = string.Empty;
        try
        {
            message = WMFuncs.ParamsCopyDataToString(hwnd, msg, wParam, lParam);
        }
        catch (Exception exception)
        {
            message = null;
            Dispatcher.BeginInvoke(new Action(() => lbIn.Items.Add(exception.Message + " - " + exception.GetType().ToString())));
        }
        if (null == message)
            message = "An error occured";
        Dispatcher.BeginInvoke(new Action(() => lbIn.Items.Add(message)));
    }
    return hwnd;
}
WM_GETICON
Gets the window icon value.
WM_GETTEXT
Get text value.
WM_GETTEXTLENGTH
Get text length value.
WM_WINDOWPOSCHANGED
Gets window change notification.
Top
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_AIA_END Field

WinAPIEVENT_AIA_END Field
Gets the AIA end value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_AIA_END

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_AIA_START Field

WinAPIEVENT_AIA_START Field
Gets the AIA start value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_AIA_START

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_CONSOLE_CARET Field

WinAPIEVENT_CONSOLE_CARET Field
Gets the console caret value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_CONSOLE_CARET

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_CONSOLE_END Field

WinAPIEVENT_CONSOLE_END Field
Gets the console end value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_CONSOLE_END

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_CONSOLE_END_APPLICATION Field

WinAPIEVENT_CONSOLE_END_APPLICATION Field
Gets the console end application value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_CONSOLE_END_APPLICATION

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_CONSOLE_LAYOUT Field

WinAPIEVENT_CONSOLE_LAYOUT Field
Gets the console layout value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_CONSOLE_LAYOUT

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_CONSOLE_START_APPLICATION Field

WinAPIEVENT_CONSOLE_START_APPLICATION Field
Gets the console start application value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_CONSOLE_START_APPLICATION

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_CONSOLE_UPDATE_REGION Field

WinAPIEVENT_CONSOLE_UPDATE_REGION Field
Gets the console update region value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_CONSOLE_UPDATE_REGION

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_CONSOLE_UPDATE_SCROLL Field

WinAPIEVENT_CONSOLE_UPDATE_SCROLL Field
Gets the console update scroll value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_CONSOLE_UPDATE_SCROLL

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_CONSOLE_UPDATE_SIMPLE Field

WinAPIEVENT_CONSOLE_UPDATE_SIMPLE Field
Gets the console update simple value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_CONSOLE_UPDATE_SIMPLE

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_MAX Field

WinAPIEVENT_MAX Field
Gets the max value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_MAX

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_MIN Field

WinAPIEVENT_MIN Field
Events are SYNC, this causes your dll to be injected into every process

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_MIN

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_OBJECT_ACCELERATORCHANGE Field

WinAPIEVENT_OBJECT_ACCELERATORCHANGE Field
hwnd ID idChild is item w/ def action change

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_OBJECT_ACCELERATORCHANGE

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_OBJECT_CONTENTSCROLLED Field

WinAPIEVENT_OBJECT_CONTENTSCROLLED Field
Gets the content scrolled value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_OBJECT_CONTENTSCROLLED

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_OBJECT_CREATE Field

WinAPIEVENT_OBJECT_CREATE Field
Gets the object create value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_OBJECT_CREATE

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_OBJECT_DEFACTIONCHANGE Field

WinAPIEVENT_OBJECT_DEFACTIONCHANGE Field
hwnd ID idChild is item w/ help change

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_OBJECT_DEFACTIONCHANGE

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_OBJECT_DESCRIPTIONCHANGE Field

WinAPIEVENT_OBJECT_DESCRIPTIONCHANGE Field
hwnd ID idChild is item w/ name change

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_OBJECT_DESCRIPTIONCHANGE

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_OBJECT_DESTROY Field

WinAPIEVENT_OBJECT_DESTROY Field
hwnd ID idChild is created item

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_OBJECT_DESTROY

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_OBJECT_END Field

WinAPIEVENT_OBJECT_END Field
Gets the object end value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_OBJECT_END

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_OBJECT_FOCUS Field

WinAPIEVENT_OBJECT_FOCUS Field
hwnd ID idChild is parent of zordering children

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_OBJECT_FOCUS

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_OBJECT_HELPCHANGE Field

WinAPIEVENT_OBJECT_HELPCHANGE Field
hwnd ID idChild is item w/ new parent

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_OBJECT_HELPCHANGE

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_OBJECT_HIDE Field

WinAPIEVENT_OBJECT_HIDE Field
hwnd ID idChild is shown item

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_OBJECT_HIDE

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_OBJECT_INVOKED Field

WinAPIEVENT_OBJECT_INVOKED Field
hwnd ID idChild is item w/ keybd accel change

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_OBJECT_INVOKED

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_OBJECT_LOCATIONCHANGE Field

WinAPIEVENT_OBJECT_LOCATIONCHANGE Field
hwnd ID idChild is item w/ state change

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_OBJECT_LOCATIONCHANGE

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_OBJECT_NAMECHANGE Field

WinAPIEVENT_OBJECT_NAMECHANGE Field
hwnd ID idChild is moved/sized item

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_OBJECT_NAMECHANGE

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_OBJECT_PARENTCHANGE Field

WinAPIEVENT_OBJECT_PARENTCHANGE Field
hwnd ID idChild is item w/ value change

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_OBJECT_PARENTCHANGE

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_OBJECT_REORDER Field

WinAPIEVENT_OBJECT_REORDER Field
hwnd ID idChild is hidden item

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_OBJECT_REORDER

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_OBJECT_SELECTION Field

WinAPIEVENT_OBJECT_SELECTION Field
hwnd ID idChild is focused item

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_OBJECT_SELECTION

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_OBJECT_SELECTIONADD Field

WinAPIEVENT_OBJECT_SELECTIONADD Field
hwnd ID idChild is selected item (if only one), or idChild is OBJID_WINDOW if complex

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_OBJECT_SELECTIONADD

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_OBJECT_SELECTIONREMOVE Field

WinAPIEVENT_OBJECT_SELECTIONREMOVE Field
hwnd ID idChild is item added

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_OBJECT_SELECTIONREMOVE

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_OBJECT_SELECTIONWITHIN Field

WinAPIEVENT_OBJECT_SELECTIONWITHIN Field
hwnd ID idChild is item removed

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_OBJECT_SELECTIONWITHIN

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_OBJECT_SHOW Field

WinAPIEVENT_OBJECT_SHOW Field
hwnd ID idChild is destroyed item

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_OBJECT_SHOW

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_OBJECT_STATECHANGE Field

WinAPIEVENT_OBJECT_STATECHANGE Field
hwnd ID idChild is parent of changed selected items

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_OBJECT_STATECHANGE

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_OBJECT_TEXTSELECTIONCHANGED Field

WinAPIEVENT_OBJECT_TEXTSELECTIONCHANGED Field
hwnd ID idChild is item invoked

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_OBJECT_TEXTSELECTIONCHANGED

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_OBJECT_VALUECHANGE Field

WinAPIEVENT_OBJECT_VALUECHANGE Field
hwnd ID idChild is item w/ desc change

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_OBJECT_VALUECHANGE

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_OEM_DEFINED_END Field

WinAPIEVENT_OEM_DEFINED_END Field
Gets the OEM defined end value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_OEM_DEFINED_END

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_OEM_DEFINED_START Field

WinAPIEVENT_OEM_DEFINED_START Field
Gets the OEM defined start value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_OEM_DEFINED_START

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_SYSTEM_ALERT Field

WinAPIEVENT_SYSTEM_ALERT Field
Gets the system sound value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_SYSTEM_ALERT

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_SYSTEM_ARRANGMENTPREVIEW Field

WinAPIEVENT_SYSTEM_ARRANGMENTPREVIEW Field
Gets the arrangement preview value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_SYSTEM_ARRANGMENTPREVIEW

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_SYSTEM_CAPTUREEND Field

WinAPIEVENT_SYSTEM_CAPTUREEND Field
Gets the system capture end value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_SYSTEM_CAPTUREEND

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_SYSTEM_CAPTURESTART Field

WinAPIEVENT_SYSTEM_CAPTURESTART Field
Gets the system capture start value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_SYSTEM_CAPTURESTART

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_SYSTEM_CONTEXTHELPEND Field

WinAPIEVENT_SYSTEM_CONTEXTHELPEND Field
Gets the system context help end value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_SYSTEM_CONTEXTHELPEND

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_SYSTEM_CONTEXTHELPSTART Field

WinAPIEVENT_SYSTEM_CONTEXTHELPSTART Field
Gets the system context help start value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_SYSTEM_CONTEXTHELPSTART

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_SYSTEM_DESKTOPSWITCH Field

WinAPIEVENT_SYSTEM_DESKTOPSWITCH Field
Gets the system desktop switch value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_SYSTEM_DESKTOPSWITCH

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_SYSTEM_DIALOGEND Field

WinAPIEVENT_SYSTEM_DIALOGEND Field
Gets the system dialog end value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_SYSTEM_DIALOGEND

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_SYSTEM_DIALOGSTART Field

WinAPIEVENT_SYSTEM_DIALOGSTART Field
Gets the system dialog start value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_SYSTEM_DIALOGSTART

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_SYSTEM_DRAGDROPEND Field

WinAPIEVENT_SYSTEM_DRAGDROPEND Field
Gets the system drag n drop end value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_SYSTEM_DRAGDROPEND

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_SYSTEM_DRAGDROPSTART Field

WinAPIEVENT_SYSTEM_DRAGDROPSTART Field
Gets the system drag n drop start value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_SYSTEM_DRAGDROPSTART

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_SYSTEM_END Field

WinAPIEVENT_SYSTEM_END Field
Gets the system end value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_SYSTEM_END

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_SYSTEM_FOREGROUND Field

WinAPIEVENT_SYSTEM_FOREGROUND Field
Gets the system alert value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_SYSTEM_FOREGROUND

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_SYSTEM_MENUEND Field

WinAPIEVENT_SYSTEM_MENUEND Field
Gets the system menu end value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_SYSTEM_MENUEND

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_SYSTEM_MENUPOPUPEND Field

WinAPIEVENT_SYSTEM_MENUPOPUPEND Field
Gets the system menu popup end value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_SYSTEM_MENUPOPUPEND

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_SYSTEM_MENUPOPUPSTART Field

WinAPIEVENT_SYSTEM_MENUPOPUPSTART Field
Gets the system menu popup start value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_SYSTEM_MENUPOPUPSTART

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_SYSTEM_MENUSTART Field

WinAPIEVENT_SYSTEM_MENUSTART Field
Gets the system menu start value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_SYSTEM_MENUSTART

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_SYSTEM_MINIMIZEEND Field

WinAPIEVENT_SYSTEM_MINIMIZEEND Field
Gets the system minimise end value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_SYSTEM_MINIMIZEEND

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_SYSTEM_MINIMIZESTART Field

WinAPIEVENT_SYSTEM_MINIMIZESTART Field
Gets the system minimise start value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_SYSTEM_MINIMIZESTART

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_SYSTEM_MOVESIZEEND Field

WinAPIEVENT_SYSTEM_MOVESIZEEND Field
Gets the system move size end value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_SYSTEM_MOVESIZEEND

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_SYSTEM_MOVESIZESTART Field

WinAPIEVENT_SYSTEM_MOVESIZESTART Field
Gets the system move sisze start value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_SYSTEM_MOVESIZESTART

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_SYSTEM_SCROLLINGEND Field

WinAPIEVENT_SYSTEM_SCROLLINGEND Field
Gets the system scrolling end value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_SYSTEM_SCROLLINGEND

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_SYSTEM_SCROLLINGSTART Field

WinAPIEVENT_SYSTEM_SCROLLINGSTART Field
Gets the system scrolling start value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_SYSTEM_SCROLLINGSTART

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_SYSTEM_SOUND Field

WinAPIEVENT_SYSTEM_SOUND Field
Gets the max value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_SYSTEM_SOUND

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_SYSTEM_SWITCHEND Field

WinAPIEVENT_SYSTEM_SWITCHEND Field
Gets the system switch end value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_SYSTEM_SWITCHEND

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_SYSTEM_SWITCHSTART Field

WinAPIEVENT_SYSTEM_SWITCHSTART Field
Gets the system switch start value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_SYSTEM_SWITCHSTART

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_UIA_EVENTID_END Field

WinAPIEVENT_UIA_EVENTID_END Field
Gets the UIA event id end value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_UIA_EVENTID_END

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_UIA_EVENTID_START Field

WinAPIEVENT_UIA_EVENTID_START Field
Gets the UIA event id start value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_UIA_EVENTID_START

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_UIA_PROPID_END Field

WinAPIEVENT_UIA_PROPID_END Field
Gets the UIA property ID end value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_UIA_PROPID_END

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EVENT_UIA_PROPID_START Field

WinAPIEVENT_UIA_PROPID_START Field
Gets the UIA property ID start value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint EVENT_UIA_PROPID_START

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EWX_FORCE Field

WinAPIEWX_FORCE Field
Windows Force action flag

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const int EWX_FORCE

Field Value

Type: Int32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EWX_FORCEIFHUNG Field

WinAPIEWX_FORCEIFHUNG Field
Windows Force if hung flag

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const int EWX_FORCEIFHUNG

Field Value

Type: Int32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EWX_LOGOFF Field

WinAPIEWX_LOGOFF Field
Windows Log off command

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const int EWX_LOGOFF

Field Value

Type: Int32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EWX_POWEROFF Field

WinAPIEWX_POWEROFF Field
Windows Power off command

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const int EWX_POWEROFF

Field Value

Type: Int32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EWX_REBOOT Field

WinAPIEWX_REBOOT Field
Windows Reboot command

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const int EWX_REBOOT

Field Value

Type: Int32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EWX_SHUTDOWN Field

WinAPIEWX_SHUTDOWN Field
Windows Shutdown command

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const int EWX_SHUTDOWN

Field Value

Type: Int32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.GCL_HICON Field

WinAPIGCL_HICON Field
Gets the graphic system icon pointer value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const int GCL_HICON

Field Value

Type: Int32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.GCL_HICONSM Field

WinAPIGCL_HICONSM Field
Gets the graphic system icon pointer value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const int GCL_HICONSM

Field Value

Type: Int32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.HC_ACTION Field

WinAPIHC_ACTION Field
Gets the action value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const int HC_ACTION

Field Value

Type: Int32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.HWND_BROADCAST Field

WinAPIHWND_BROADCAST Field
Flag for PostMessage() function, when used in place of a target window handle the message is posted to all top level windows, not child windows though.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const int HWND_BROADCAST

Field Value

Type: Int32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.ICON_BIG Field

WinAPIICON_BIG Field
Gets the big icon value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const int ICON_BIG

Field Value

Type: Int32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.ICON_SMALL Field

WinAPIICON_SMALL Field
Gets the small icon value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const int ICON_SMALL

Field Value

Type: Int32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.ICON_SMALL2 Field

WinAPIICON_SMALL2 Field
Gets the small icon value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const int ICON_SMALL2

Field Value

Type: Int32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.SE_PRIVILEGE_ENABLED Field

WinAPISE_PRIVILEGE_ENABLED Field
Privilege enabled

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const int SE_PRIVILEGE_ENABLED

Field Value

Type: Int32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.SE_SHUTDOWN_NAME Field

WinAPISE_SHUTDOWN_NAME Field
Shutdown name

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const string SE_SHUTDOWN_NAME

Field Value

Type: String
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.TOKEN_ADJUST_PRIVILEGES Field

WinAPITOKEN_ADJUST_PRIVILEGES Field
Token adjust privileges

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const int TOKEN_ADJUST_PRIVILEGES

Field Value

Type: Int32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.TOKEN_QUERY Field

WinAPITOKEN_QUERY Field
Token query

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const int TOKEN_QUERY

Field Value

Type: Int32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.WAIT_ABANDONED Field

WinAPIWAIT_ABANDONED Field
The specified object is a mutex object that was not released by the thread that owned the mutex object before the owning thread terminated. Ownership of the mutex object is granted to the calling thread and the mutex state is set to nonsignaled. see=Bncs.SysUtils.WinAPI.WaitForSingleObject/

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const long WAIT_ABANDONED

Field Value

Type: Int64
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.WAIT_FAILED Field

WinAPIWAIT_FAILED Field
The function has failed. To get extended error information, call GetLastError. see=Bncs.SysUtils.WinAPI.WaitForSingleObject/

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint WAIT_FAILED

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.WAIT_OBJECT_0 Field

WinAPIWAIT_OBJECT_0 Field
The state of the specified object is signaled. see=Bncs.SysUtils.WinAPI.WaitForSingleObject/

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const long WAIT_OBJECT_0

Field Value

Type: Int64
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.WAIT_TIMEOUT Field

WinAPIWAIT_TIMEOUT Field
The time-out interval elapsed, and the object's state is nonsignaled. see=Bncs.SysUtils.WinAPI.WaitForSingleObject/

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const long WAIT_TIMEOUT

Field Value

Type: Int64
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.WINEVENT_INCONTEXT Field

WinAPIWINEVENT_INCONTEXT Field
Don't call back for events on installer's process

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint WINEVENT_INCONTEXT

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.WINEVENT_OUTOFCONTEXT Field

WinAPIWINEVENT_OUTOFCONTEXT Field
Gets the out of context value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint WINEVENT_OUTOFCONTEXT

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.WINEVENT_SKIPOWNPROCESS Field

WinAPIWINEVENT_SKIPOWNPROCESS Field
Don't call back for events on installer's thread

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint WINEVENT_SKIPOWNPROCESS

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.WINEVENT_SKIPOWNTHREAD Field

WinAPIWINEVENT_SKIPOWNTHREAD Field
Events are ASYNC

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint WINEVENT_SKIPOWNTHREAD

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.WM_COPYDATA Field

WinAPIWM_COPYDATA Field
Copy data window message
Examples
This example demonstrates use of the WPFMessageHandler class, how to trap message, how to send a string to another window and how to create a unique window message.
Copy
// Create a unique window message
private uint WM_MESSAGE = WinAPI.RegisterWindowMessage("5e98d834-83f2-4cea-b7c7-7eb2e060f47a");

// WPF app loaded event handler, create a WPFMessageHandler and assign it's OnMessage event handler.
private void AppLoaded(object sender, RoutedEventArgs e)
{
    WPFMessageHandler handler = new WPFMessageHandler(this);
    handler.OnMessage += HandlerOnMessage;
}

// Method that sends the supplied string to the supplied window
private void SendStringToWindow(IntPtr targetWindow_, string message_)
{
    WMFuncs.SendWindowsStringMessage(targetWindow_.ToInt32(), 0, message_);
}

// WPFMessageHandler's OnMessage event handler adds the received string to a ListBox
private IntPtr HandlerOnMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
    handled = msg == WinAPI.WM_COPYDATA;
    if (handled)
    {
        string message = string.Empty;
        try
        {
            message = WMFuncs.ParamsCopyDataToString(hwnd, msg, wParam, lParam);
        }
        catch (Exception exception)
        {
            message = null;
            Dispatcher.BeginInvoke(new Action(() => lbIn.Items.Add(exception.Message + " - " + exception.GetType().ToString())));
        }
        if (null == message)
            message = "An error occured";
        Dispatcher.BeginInvoke(new Action(() => lbIn.Items.Add(message)));
    }
    return hwnd;
}

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const int WM_COPYDATA

Field Value

Type: Int32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.WM_GETICON Field

WinAPIWM_GETICON Field
Gets the window icon value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const int WM_GETICON

Field Value

Type: Int32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.WM_GETTEXT Field

WinAPIWM_GETTEXT Field
Get text value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint WM_GETTEXT

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.WM_GETTEXTLENGTH Field

WinAPIWM_GETTEXTLENGTH Field
Get text length value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const uint WM_GETTEXTLENGTH

Field Value

Type: UInt32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.WM_WINDOWPOSCHANGED Field

WinAPIWM_WINDOWPOSCHANGED Field
Gets window change notification.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public const int WM_WINDOWPOSCHANGED

Field Value

Type: Int32
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI Methods

WinAPI Methods

The WinAPI type exposes the following members.

Methods
Name Description
AdjustTokenPrivileges
Adjusts a token privilege
BringWindowToTop(IntPtr)
Brings the supplied window to the front.
BringWindowToTop(HandleRef)
Brings the supplied window to the front.
CallNextHookEx
Passes the hook information to the next hook procedure in the current hook chain. A hook procedure can call this function either before or after processing the hook information.
CallWndRetProc
An application-defined or library-defined callback function used with the SetWindowsHookEx function. The system calls this function after the SendMessage function is called. The hook procedure can examine the message; it cannot modify it.
DestroyWindow
The DestroyWindow function destroys the specified window. The function sends WM_DESTROY and WM_NCDESTROY messages to the window to deactivate it and remove the keyboard focus from it. The function also destroys the window's menu, flushes the thread message queue, destroys timers, removes clipboard ownership, and breaks the clipboard viewer chain (if the window is at the top of the viewer chain)
EnumChildWindows(IntPtr, WinAPIEnumWindowProc, IntPtr)
Enumerates all child windows.
EnumChildWindows(IntPtr, WinAPIWin32Callback, IntPtr)
Enumerates all child windows.
EnumWindows
Enumerates all top level windows into an ArrayList.
ExitWindowsEx
Exits the Windows OS
FindExecutableA
FindExecutable import.
FindWindow
The FindWindow function retrieves a handle to the top-level window whose class name and window name match the specified strings. This function does not search child windows. This function does not perform a case-sensitive search. To search child windows, beginning with a specified child window, use the FindWindowEx function.
FindWindowEx
Searches a child window, beginning with a specified child window
GetClassLongPtr32
Gets a 32 bit class pointer
GetClassLongPtr64
Gets a 64 bit class pointer
GetClassName
Gets the class name of a window.
GetCurrentProcess
Gets the current process
GetCurrentThreadId
Gets the thread ID of the current process.
GetLastError
Retrieves the calling thread's last-error code value.
GetLongPathName
Gets the long path name for the supplied path
GetModuleHandle
Gets the module handle
GetParent
Retrieves a handle to the specified window's parent or owner.
GetProcAddress
Gets a procedure address from a DLL.
GetShortPathName
Gets the short 8.3 path name of the supplied path.
GetWindowPlacement
Populates a WINDOWPLACEMENT structure with pertinent data about the supplied window.
GetWindowRect
Retrieves the dimensions of the bounding rectangle of the specified window. The dimensions are given in screen coordinates that are relative to the upper-left corner of the screen.
GetWindowText
Gets the the text from a window caption.
IsNetworkAlive
Ascertains if a network cable is physically plugged in.
IsWindowVisible
Returns true if the window is visible.
LoadLibrary
Loads a DLL.
LookupPrivilegeValue
Looks up a privilege value.
OpenProcessToken
Opens a process token.
PostMessage
Posts a message to a window, ie does not wait.
RegisterWindowMessage
Registers a windows message or retrieves it if another process has already registered it.
Examples
This example demonstrates use of the WPFMessageHandler class, how to trap message, how to send a string to another window and how to create a unique window message.
Copy
// Create a unique window message
private uint WM_MESSAGE = WinAPI.RegisterWindowMessage("5e98d834-83f2-4cea-b7c7-7eb2e060f47a");

// WPF app loaded event handler, create a WPFMessageHandler and assign it's OnMessage event handler.
private void AppLoaded(object sender, RoutedEventArgs e)
{
    WPFMessageHandler handler = new WPFMessageHandler(this);
    handler.OnMessage += HandlerOnMessage;
}

// Method that sends the supplied string to the supplied window
private void SendStringToWindow(IntPtr targetWindow_, string message_)
{
    WMFuncs.SendWindowsStringMessage(targetWindow_.ToInt32(), 0, message_);
}

// WPFMessageHandler's OnMessage event handler adds the received string to a ListBox
private IntPtr HandlerOnMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
    handled = msg == WinAPI.WM_COPYDATA;
    if (handled)
    {
        string message = string.Empty;
        try
        {
            message = WMFuncs.ParamsCopyDataToString(hwnd, msg, wParam, lParam);
        }
        catch (Exception exception)
        {
            message = null;
            Dispatcher.BeginInvoke(new Action(() => lbIn.Items.Add(exception.Message + " - " + exception.GetType().ToString())));
        }
        if (null == message)
            message = "An error occured";
        Dispatcher.BeginInvoke(new Action(() => lbIn.Items.Add(message)));
    }
    return hwnd;
}
SendMessage(Int32, Int32, Int32, COPYDATASTRUCT)
Sends a COPYDATASTRUCT structure to a window.
SendMessage(Int32, Int32, Int32, Int32)
Sends a message to a window
SendMessage(IntPtr, Int32, Int32, Int32)
Sends a message to a window
SendMessage(IntPtr, UInt32, IntPtr, IntPtr)
Sends a message to a window
SendMessage(IntPtr, UInt32, IntPtr, StringBuilder)
Sends a message to a window
SetWindowsHookEx
Installs an application-defined hook procedure into a hook chain. You would install a hook procedure to monitor the system for certain types of events. These events are associated either with a specific thread or with all threads in the same desktop as the calling thread.
SetWinEventHook
Sets an event hook function for a range of events.
ShowWindow
Shows or hides a window.
Sleep
Stop processing (sleep process) for specified number of miliseconds.
UnhookWindowsHookEx
Removes a hook procedure installed in a hook chain by the SetWindowsHookEx function.
UnhookWinEvent
Removes an event hook function created by a previous call to SetWinEventHook.
WaitForSingleObject
Waits until the specified object is in the signaled state or the time-out interval elapses.
Top
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.AdjustTokenPrivileges Method

WinAPIAdjustTokenPrivileges Method
Adjusts a token privilege

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool AdjustTokenPrivileges(
    IntPtr htok,
    bool disall,
    ref TokPriv1Luid newst,
    int len,
    IntPtr prev,
    IntPtr relen
)

Parameters

htok
Type: SystemIntPtr
Pointer to token
disall
Type: SystemBoolean
Display all flag
newst
Type: Bncs.SysUtilsTokPriv1Luid
Privilege
len
Type: SystemInt32
Length
prev
Type: SystemIntPtr
Previous
relen
Type: SystemIntPtr
Relentless

Return Value

Type: Boolean
True on success
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.BringWindowToTop Method

WinAPIBringWindowToTop Method
Overload List
Name | Description
BringWindowToTop(IntPtr) | Brings the supplied window to the front.
BringWindowToTop(HandleRef) | Brings the supplied window to the front.
Top
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.BringWindowToTop Method (IntPtr)

WinAPIBringWindowToTop Method (IntPtr)
Brings the supplied window to the front.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool BringWindowToTop(
    IntPtr hWnd
)

Parameters

hWnd
Type: SystemIntPtr
Window to bring to front

Return Value

Type: Boolean
True on success
See Also

Reference

WinAPI Class
BringWindowToTop Overload
Bncs.SysUtils Namespace


WinAPI.BringWindowToTop Method (HandleRef)

WinAPIBringWindowToTop Method (HandleRef)
Brings the supplied window to the front.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool BringWindowToTop(
    HandleRef hWnd
)

Parameters

hWnd
Type: System.Runtime.InteropServicesHandleRef
Window to bring to front

Return Value

Type: Boolean
True on success
See Also

Reference

WinAPI Class
BringWindowToTop Overload
Bncs.SysUtils Namespace


WinAPI.CallNextHookEx Method

WinAPICallNextHookEx Method
Passes the hook information to the next hook procedure in the current hook chain. A hook procedure can call this function either before or after processing the hook information.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static int CallNextHookEx(
    IntPtr hhk,
    int nCode,
    IntPtr wParam,
    IntPtr lParam
)

Parameters

hhk
Type: SystemIntPtr
This parameter is ignored.
nCode
Type: SystemInt32
The hook code passed to the current hook procedure. The next hook procedure uses this code to determine how to process the hook information.
wParam
Type: SystemIntPtr
The wParam value passed to the current hook procedure. The meaning of this parameter depends on the type of hook associated with the current hook chain.
lParam
Type: SystemIntPtr
The lParam value passed to the current hook procedure. The meaning of this parameter depends on the type of hook associated with the current hook chain.

Return Value

Type: Int32
This value is returned by the next hook procedure in the chain. The current hook procedure must also return this value. The meaning of the return value depends on the hook type. For more information, see the descriptions of the individual hook procedures.
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.CallWndRetProc Method

WinAPICallWndRetProc Method
An application-defined or library-defined callback function used with the SetWindowsHookEx function. The system calls this function after the SendMessage function is called. The hook procedure can examine the message; it cannot modify it.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static long CallWndRetProc(
    int nCode,
    int wParam,
    int lParam
)

Parameters

nCode
Type: SystemInt32
Specifies whether the hook procedure must process the message. If nCode is HC_ACTION, the hook procedure must process the message. If nCode is less than zero, the hook procedure must pass the message to the CallNextHookEx function without further processing and should return the value returned by CallNextHookEx.
wParam
Type: SystemInt32
Specifies whether the message is sent by the current process. If the message is sent by the current process, it is nonzero; otherwise, it is NULL.
lParam
Type: SystemInt32
A pointer to a CWPRETSTRUCT structure that contains details about the message.

Return Value

Type: Int64
If nCode is less than zero, the hook procedure must return the value returned by CallNextHookEx. If nCode is greater than or equal to zero, it is highly recommended that you call CallNextHookEx and return the value it returns; otherwise, other applications that have installed WH_CALLWNDPROCRET hooks will not receive hook notifications and may behave incorrectly as a result. If the hook procedure does not call CallNextHookEx, the return value should be zero.
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.DestroyWindow Method

WinAPIDestroyWindow Method
The DestroyWindow function destroys the specified window. The function sends WM_DESTROY and WM_NCDESTROY messages to the window to deactivate it and remove the keyboard focus from it. The function also destroys the window's menu, flushes the thread message queue, destroys timers, removes clipboard ownership, and breaks the clipboard viewer chain (if the window is at the top of the viewer chain)

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool DestroyWindow(
    IntPtr hwnd
)

Parameters

hwnd
Type: SystemIntPtr
A handle to the window to destroy

Return Value

Type: Boolean
If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EnumChildWindows Method

WinAPIEnumChildWindows Method
Overload List
Name | Description
EnumChildWindows(IntPtr, WinAPIEnumWindowProc, IntPtr) | Enumerates all child windows.
EnumChildWindows(IntPtr, WinAPIWin32Callback, IntPtr) | Enumerates all child windows.
Top
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.EnumChildWindows Method (IntPtr, WinAPI.EnumWindowProc, IntPtr)

WinAPIEnumChildWindows Method (IntPtr, WinAPIEnumWindowProc, IntPtr)
Enumerates all child windows.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool EnumChildWindows(
    IntPtr hwndParent,
    WinAPIEnumWindowProc lpEnumFunc,
    IntPtr lParam
)

Parameters

hwndParent
Type: SystemIntPtr
Parent window
lpEnumFunc
Type: Bncs.SysUtilsWinAPIEnumWindowProc
Callback procedure
lParam
Type: SystemIntPtr
LParam

Return Value

Type: Boolean
True on success
See Also

Reference

WinAPI Class
EnumChildWindows Overload
Bncs.SysUtils Namespace


WinAPI.EnumChildWindows Method (IntPtr, WinAPI.Win32Callback, IntPtr)

WinAPIEnumChildWindows Method (IntPtr, WinAPIWin32Callback, IntPtr)
Enumerates all child windows.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool EnumChildWindows(
    IntPtr parentHandle,
    WinAPIWin32Callback callback,
    IntPtr lParam
)

Parameters

parentHandle
Type: SystemIntPtr
Parent window
callback
Type: Bncs.SysUtilsWinAPIWin32Callback
Callback procedure
lParam
Type: SystemIntPtr
LParam

Return Value

Type: Boolean
True on success
See Also

Reference

WinAPI Class
EnumChildWindows Overload
Bncs.SysUtils Namespace


WinAPI.EnumWindows Method

WinAPIEnumWindows Method
Enumerates all top level windows into an ArrayList.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool EnumWindows(
    WinAPIEnumedWindow lpEnumFunc,
    ArrayList lParam
)

Parameters

lpEnumFunc
Type: Bncs.SysUtilsWinAPIEnumedWindow
Callback function
lParam
Type: System.CollectionsArrayList
Array List

Return Value

Type: Boolean
True on success
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.ExitWindowsEx Method

WinAPIExitWindowsEx Method
Exits the Windows OS

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool ExitWindowsEx(
    int flg,
    int rea
)

Parameters

flg
Type: SystemInt32
Flags
rea
Type: SystemInt32
Reason

Return Value

Type: Boolean
True on success
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.FindExecutableA Method

WinAPIFindExecutableA Method
FindExecutable import.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static long FindExecutableA(
    string lpFile,
    string lpDirectory,
    StringBuilder lpResult
)

Parameters

lpFile
Type: SystemString
File name
lpDirectory
Type: SystemString
Directory
lpResult
Type: System.TextStringBuilder
Result

Return Value

Type: Int64
Long
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.FindWindow Method

WinAPIFindWindow Method
The FindWindow function retrieves a handle to the top-level window whose class name and window name match the specified strings. This function does not search child windows. This function does not perform a case-sensitive search. To search child windows, beginning with a specified child window, use the FindWindowEx function.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static IntPtr FindWindow(
    string lpClassName,
    string lpWindowName
)

Parameters

lpClassName
Type: SystemString
Class name
lpWindowName
Type: SystemString
Window title

Return Value

Type: IntPtr
IntPtr
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.FindWindowEx Method

WinAPIFindWindowEx Method
Searches a child window, beginning with a specified child window

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static IntPtr FindWindowEx(
    IntPtr hwndParent,
    IntPtr hwndChildAfter,
    string lpszClass,
    string lpszWindow
)

Parameters

hwndParent
Type: SystemIntPtr
Parent window
hwndChildAfter
Type: SystemIntPtr
Child window
lpszClass
Type: SystemString
Class name
lpszWindow
Type: SystemString
Window title

Return Value

Type: IntPtr
IntPtr
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.GetClassLongPtr32 Method

WinAPIGetClassLongPtr32 Method
Gets a 32 bit class pointer

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static uint GetClassLongPtr32(
    IntPtr hWnd,
    int nIndex
)

Parameters

hWnd
Type: SystemIntPtr
Window handle
nIndex
Type: SystemInt32
Index

Return Value

Type: UInt32
Unsigned int
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.GetClassLongPtr64 Method

WinAPIGetClassLongPtr64 Method
Gets a 64 bit class pointer

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static IntPtr GetClassLongPtr64(
    IntPtr hWnd,
    int nIndex
)

Parameters

hWnd
Type: SystemIntPtr
Window handle
nIndex
Type: SystemInt32
Index

Return Value

Type: IntPtr
IntPtr
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.GetClassName Method

WinAPIGetClassName Method
Gets the class name of a window.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static int GetClassName(
    IntPtr hWnd,
    StringBuilder lpClassName,
    int nMaxCount
)

Parameters

hWnd
Type: SystemIntPtr
Target window
lpClassName
Type: System.TextStringBuilder
StringBuilder into which the class name is copied
nMaxCount
Type: SystemInt32
Maximum character count.

Return Value

Type: Int32
Non zero on success
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.GetCurrentProcess Method

WinAPIGetCurrentProcess Method
Gets the current process

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static IntPtr GetCurrentProcess()

Return Value

Type: IntPtr
Pointer to the current process
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.GetCurrentThreadId Method

WinAPIGetCurrentThreadId Method
Gets the thread ID of the current process.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static uint GetCurrentThreadId()

Return Value

Type: UInt32
The thread ID of the current process
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.GetLastError Method

WinAPIGetLastError Method
Retrieves the calling thread's last-error code value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static uint GetLastError()

Return Value

Type: UInt32
Error code
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.GetLongPathName Method

WinAPIGetLongPathName Method
Gets the long path name for the supplied path

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static int GetLongPathName(
    string path,
    StringBuilder longPath,
    int longPathLength
)

Parameters

path
Type: SystemString
Path for which to return the long name
longPath
Type: System.TextStringBuilder
The long path
longPathLength
Type: SystemInt32
Long path length

Return Value

Type: Int32
Integer
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.GetModuleHandle Method

WinAPIGetModuleHandle Method
Gets the module handle

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static IntPtr GetModuleHandle(
    string lpModuleName
)

Parameters

lpModuleName
Type: SystemString
Module name

Return Value

Type: IntPtr
Handle
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.GetParent Method

WinAPIGetParent Method
Retrieves a handle to the specified window's parent or owner.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static IntPtr GetParent(
    IntPtr hWnd
)

Parameters

hWnd
Type: SystemIntPtr
A handle to the window whose parent window handle is to be retrieved.

Return Value

Type: IntPtr
If the window is a child window, the return value is a handle to the parent window. If the window is a top-level window with the WS_POPUP style, the return value is a handle to the owner window. If the function fails, the return value is NULL. To get extended error information, call GetLastError.
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.GetProcAddress Method

WinAPIGetProcAddress Method
Gets a procedure address from a DLL.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static IntPtr GetProcAddress(
    IntPtr hModule,
    string procName
)

Parameters

hModule
Type: SystemIntPtr
Pointer to a module returned from LoadLibrary()
procName
Type: SystemString
Name of the method

Return Value

Type: IntPtr
A ponter to the procedure or IntPtr.Zero on failure
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.GetShortPathName Method

WinAPIGetShortPathName Method
Gets the short 8.3 path name of the supplied path.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static int GetShortPathName(
    string path,
    StringBuilder shortPath,
    int shortPathLength
)

Parameters

path
Type: SystemString
Path for which to return the short name
shortPath
Type: System.TextStringBuilder
The short path
shortPathLength
Type: SystemInt32
Short path length

Return Value

Type: Int32
Integer
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.GetWindowPlacement Method

WinAPIGetWindowPlacement Method
Populates a WINDOWPLACEMENT structure with pertinent data about the supplied window.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool GetWindowPlacement(
    IntPtr hWnd,
    ref WINDOWPLACEMENT lpwndpl
)

Parameters

hWnd
Type: SystemIntPtr
Target window
lpwndpl
Type: Bncs.SysUtilsWINDOWPLACEMENT
WINDOWPLACEMENT object to be populated.

Return Value

Type: Boolean
True on success.
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.GetWindowRect Method

WinAPIGetWindowRect Method
Retrieves the dimensions of the bounding rectangle of the specified window. The dimensions are given in screen coordinates that are relative to the upper-left corner of the screen.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool GetWindowRect(
    IntPtr hwnd,
    out RECT lpRect
)

Parameters

hwnd
Type: SystemIntPtr
A handle to the window.
lpRect
Type: Bncs.SysUtilsRECT
A pointer to a RECT structure that receives the screen coordinates of the upper-left and lower-right corners of the window.

Return Value

Type: Boolean
If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.GetWindowText Method

WinAPIGetWindowText Method
Gets the the text from a window caption.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static int GetWindowText(
    IntPtr hWnd,
    StringBuilder lpString,
    int nMaxCount
)

Parameters

hWnd
Type: SystemIntPtr
Target window
lpString
Type: System.TextStringBuilder
StringBuilder into which the text is copied
nMaxCount
Type: SystemInt32
Maximum character count.

Return Value

Type: Int32
Non zero on success
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.IsNetworkAlive Method

WinAPIIsNetworkAlive Method
Ascertains if a network cable is physically plugged in.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool IsNetworkAlive(
    out int flags
)

Parameters

flags
Type: SystemInt32
Flags

Return Value

Type: Boolean
Returns false if the network cable was unplugged
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.IsWindowVisible Method

WinAPIIsWindowVisible Method
Returns true if the window is visible.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool IsWindowVisible(
    IntPtr hWnd
)

Parameters

hWnd
Type: SystemIntPtr
Target window

Return Value

Type: Boolean
True if the window or any ancestor is visible.
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.LoadLibrary Method

WinAPILoadLibrary Method
Loads a DLL.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static IntPtr LoadLibrary(
    string lpFileName
)

Parameters

lpFileName
Type: SystemString
DLL to load

Return Value

Type: IntPtr
A ponter to the DLL or IntPtr.Zero on failure
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.LookupPrivilegeValue Method

WinAPILookupPrivilegeValue Method
Looks up a privilege value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool LookupPrivilegeValue(
    string host,
    string name,
    ref long pluid
)

Parameters

host
Type: SystemString
Host
name
Type: SystemString
Name
pluid
Type: SystemInt64
UID

Return Value

Type: Boolean
True on success
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.OpenProcessToken Method

WinAPIOpenProcessToken Method
Opens a process token.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool OpenProcessToken(
    IntPtr h,
    int acc,
    ref IntPtr phtok
)

Parameters

h
Type: SystemIntPtr
Pointer
acc
Type: SystemInt32
Integer
phtok
Type: SystemIntPtr
Pointer

Return Value

Type: Boolean
True on success
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.PostMessage Method

WinAPIPostMessage Method
Posts a message to a window, ie does not wait.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool PostMessage(
    HandleRef hWnd,
    uint Msg,
    IntPtr wParam,
    IntPtr lParam
)

Parameters

hWnd
Type: System.Runtime.InteropServicesHandleRef
Handle, or cause see="Bncs.SysUtils.WinAPI.HWND_BROADCAST"/
Msg
Type: SystemUInt32
Message
wParam
Type: SystemIntPtr
WParam
lParam
Type: SystemIntPtr
LParam

Return Value

Type: Boolean
True on success
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.RegisterWindowMessage Method

WinAPIRegisterWindowMessage Method
Registers a windows message or retrieves it if another process has already registered it.
Examples
This example demonstrates use of the WPFMessageHandler class, how to trap message, how to send a string to another window and how to create a unique window message.
Copy
// Create a unique window message
private uint WM_MESSAGE = WinAPI.RegisterWindowMessage("5e98d834-83f2-4cea-b7c7-7eb2e060f47a");

// WPF app loaded event handler, create a WPFMessageHandler and assign it's OnMessage event handler.
private void AppLoaded(object sender, RoutedEventArgs e)
{
    WPFMessageHandler handler = new WPFMessageHandler(this);
    handler.OnMessage += HandlerOnMessage;
}

// Method that sends the supplied string to the supplied window
private void SendStringToWindow(IntPtr targetWindow_, string message_)
{
    WMFuncs.SendWindowsStringMessage(targetWindow_.ToInt32(), 0, message_);
}

// WPFMessageHandler's OnMessage event handler adds the received string to a ListBox
private IntPtr HandlerOnMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
    handled = msg == WinAPI.WM_COPYDATA;
    if (handled)
    {
        string message = string.Empty;
        try
        {
            message = WMFuncs.ParamsCopyDataToString(hwnd, msg, wParam, lParam);
        }
        catch (Exception exception)
        {
            message = null;
            Dispatcher.BeginInvoke(new Action(() => lbIn.Items.Add(exception.Message + " - " + exception.GetType().ToString())));
        }
        if (null == message)
            message = "An error occured";
        Dispatcher.BeginInvoke(new Action(() => lbIn.Items.Add(message)));
    }
    return hwnd;
}

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static uint RegisterWindowMessage(
    string lpString
)

Parameters

lpString
Type: SystemString
Unique string

Return Value

Type: UInt32
Uint
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.SendMessage Method

WinAPISendMessage Method
Overload List
Name | Description
SendMessage(Int32, Int32, Int32, COPYDATASTRUCT) | Sends a COPYDATASTRUCT structure to a window.
SendMessage(Int32, Int32, Int32, Int32) | Sends a message to a window
SendMessage(IntPtr, Int32, Int32, Int32) | Sends a message to a window
SendMessage(IntPtr, UInt32, IntPtr, IntPtr) | Sends a message to a window
SendMessage(IntPtr, UInt32, IntPtr, StringBuilder) | Sends a message to a window
Top
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.SendMessage Method (Int32, Int32, Int32, COPYDATASTRUCT)

WinAPISendMessage Method (Int32, Int32, Int32, COPYDATASTRUCT)
Sends a COPYDATASTRUCT structure to a window.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static int SendMessage(
    int hWnd,
    int Msg,
    int wParam,
    ref COPYDATASTRUCT lParam
)

Parameters

hWnd
Type: SystemInt32
Target window
Msg
Type: SystemInt32
Message
wParam
Type: SystemInt32
WParam
lParam
Type: Bncs.SysUtilsCOPYDATASTRUCT
COPYDATASTRUCT to send

Return Value

Type: Int32
Integer
See Also

Reference

WinAPI Class
SendMessage Overload
Bncs.SysUtils Namespace


WinAPI.SendMessage Method (Int32, Int32, Int32, Int32)

WinAPISendMessage Method (Int32, Int32, Int32, Int32)
Sends a message to a window

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static int SendMessage(
    int _WindowHandler,
    int _WM_User,
    int _wParam,
    int _lParam
)

Parameters

_WindowHandler
Type: SystemInt32
Handle
_WM_User
Type: SystemInt32
Message
_wParam
Type: SystemInt32
WParam
_lParam
Type: SystemInt32
LParam

Return Value

Type: Int32
Integer
See Also

Reference

WinAPI Class
SendMessage Overload
Bncs.SysUtils Namespace


WinAPI.SendMessage Method (IntPtr, Int32, Int32, Int32)

WinAPISendMessage Method (IntPtr, Int32, Int32, Int32)
Sends a message to a window

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static IntPtr SendMessage(
    IntPtr hWnd,
    int Msg,
    int wParam,
    int lParam
)

Parameters

hWnd
Type: SystemIntPtr
Target window
Msg
Type: SystemInt32
Message
wParam
Type: SystemInt32
WParam
lParam
Type: SystemInt32
StringBuilder

Return Value

Type: IntPtr
IntPtr
See Also

Reference

WinAPI Class
SendMessage Overload
Bncs.SysUtils Namespace


WinAPI.SendMessage Method (IntPtr, UInt32, IntPtr, IntPtr)

WinAPISendMessage Method (IntPtr, UInt32, IntPtr, IntPtr)
Sends a message to a window

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static IntPtr SendMessage(
    IntPtr hWnd,
    uint Msg,
    IntPtr wParam,
    IntPtr lParam
)

Parameters

hWnd
Type: SystemIntPtr
Target window
Msg
Type: SystemUInt32
Message
wParam
Type: SystemIntPtr
wParam
lParam
Type: SystemIntPtr
lParam

Return Value

Type: IntPtr
IntPtr
See Also

Reference

WinAPI Class
SendMessage Overload
Bncs.SysUtils Namespace


WinAPI.SendMessage Method (IntPtr, UInt32, IntPtr, StringBuilder)

WinAPISendMessage Method (IntPtr, UInt32, IntPtr, StringBuilder)
Sends a message to a window

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static IntPtr SendMessage(
    IntPtr hWnd,
    uint Msg,
    IntPtr wParam,
    StringBuilder lParam
)

Parameters

hWnd
Type: SystemIntPtr
Target window
Msg
Type: SystemUInt32
Message
wParam
Type: SystemIntPtr
WParam
lParam
Type: System.TextStringBuilder
StringBuilder

Return Value

Type: IntPtr
IntPtr
See Also

Reference

WinAPI Class
SendMessage Overload
Bncs.SysUtils Namespace


WinAPI.SetWindowsHookEx Method

WinAPISetWindowsHookEx Method
Installs an application-defined hook procedure into a hook chain. You would install a hook procedure to monitor the system for certain types of events. These events are associated either with a specific thread or with all threads in the same desktop as the calling thread.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static IntPtr SetWindowsHookEx(
    HookType hookType,
    WinAPIHookProc lpfn,
    IntPtr hMod,
    uint dwThreadId
)

Parameters

hookType
Type: Bncs.SysUtilsHookType
The type of hook procedure to be installed. This parameter can be one of the values in the HookType enumerator.
lpfn
Type: Bncs.SysUtilsWinAPIHookProc
A pointer to the hook procedure. If the dwThreadId parameter is zero or specifies the identifier of a thread created by a different process, the lpfn parameter must point to a hook procedure in a DLL. Otherwise, lpfn can point to a hook procedure in the code associated with the current process.
hMod
Type: SystemIntPtr
A handle to the DLL containing the hook procedure pointed to by the lpfn parameter. The hMod parameter must be set to NULL if the dwThreadId parameter specifies a thread created by the current process and if the hook procedure is within the code associated with the current process.
dwThreadId
Type: SystemUInt32
The identifier of the thread with which the hook procedure is to be associated. For desktop apps, if this parameter is zero, the hook procedure is associated with all existing threads running in the same desktop as the calling thread. For Windows Store apps, see the Remarks section.

Return Value

Type: IntPtr
If the function succeeds, the return value is the handle to the hook procedure. If the function fails, the return value is NULL. To get extended error information, call GetLastError.
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.SetWinEventHook Method

WinAPISetWinEventHook Method
Sets an event hook function for a range of events.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static IntPtr SetWinEventHook(
    uint eventMin,
    uint eventMax,
    IntPtr hmodWinEventProc,
    WinAPIWinEventDelegate lpfnWinEventProc,
    uint idProcess,
    uint idThread,
    uint dwFlags
)

Parameters

eventMin
Type: SystemUInt32
Specifies the event constant for the lowest event value in the range of events that are handled by the hook function. This parameter can be set to EVENT_MIN to indicate the lowest possible event value.
eventMax
Type: SystemUInt32
Specifies the event constant for the highest event value in the range of events that are handled by the hook function. This parameter can be set to EVENT_MAX to indicate the highest possible event value.
hmodWinEventProc
Type: SystemIntPtr
Handle to the DLL that contains the hook function at lpfnWinEventProc, if the WINEVENT_INCONTEXT flag is specified in the dwFlags parameter. If the hook function is not located in a DLL, or if the WINEVENT_OUTOFCONTEXT flag is specified, this parameter is NULL.
lpfnWinEventProc
Type: Bncs.SysUtilsWinAPIWinEventDelegate
Pointer to the event hook function. For more information about this function, see WinEventProc.
idProcess
Type: SystemUInt32
Specifies the ID of the process from which the hook function receives events. Specify zero (0) to receive events from all processes on the current desktop.
idThread
Type: SystemUInt32
Specifies the ID of the thread from which the hook function receives events. If this parameter is zero, the hook function is associated with all existing threads on the current desktop.
dwFlags
Type: SystemUInt32
Flag values that specify the location of the hook function and of the events to be skipped. The following flags are valid: WINEVENT_INCONTEXT, WINEVENT_OUTOFCONTEXT, WINEVENT_SKIPOWNPROCESS and WINEVENT_SKIPOWNTHREAD

Return Value

Type: IntPtr
If successful, returns an HWINEVENTHOOK value that identifies this event hook instance. Applications save this return value to use it with the UnhookWinEvent function. If unsuccessful, returns zero.
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.ShowWindow Method

WinAPIShowWindow Method
Shows or hides a window.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool ShowWindow(
    IntPtr hWnd,
    ShowWindowCommands nCmdShow
)

Parameters

hWnd
Type: SystemIntPtr
Target window
nCmdShow
Type: Bncs.SysUtilsShowWindowCommands
Operation to perform.

Return Value

Type: Boolean
True on success
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.Sleep Method

WinAPISleep Method
Stop processing (sleep process) for specified number of miliseconds.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static void Sleep(
    uint dwMilliseconds
)

Parameters

dwMilliseconds
Type: SystemUInt32
Number of milliseconds to sleep
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.UnhookWindowsHookEx Method

WinAPIUnhookWindowsHookEx Method
Removes a hook procedure installed in a hook chain by the SetWindowsHookEx function.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool UnhookWindowsHookEx(
    IntPtr hhk
)

Parameters

hhk
Type: SystemIntPtr
A handle to the hook to be removed. This parameter is a hook handle obtained by a previous call to SetWindowsHookEx.

Return Value

Type: Boolean
If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.UnhookWinEvent Method

WinAPIUnhookWinEvent Method
Removes an event hook function created by a previous call to SetWinEventHook.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool UnhookWinEvent(
    IntPtr hWinEventHook
)

Parameters

hWinEventHook
Type: SystemIntPtr
Handle to the event hook returned in the previous call to SetWinEventHook.

Return Value

Type: Boolean
True on success
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.WaitForSingleObject Method

WinAPIWaitForSingleObject Method
Waits until the specified object is in the signaled state or the time-out interval elapses.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static uint WaitForSingleObject(
    IntPtr hHandle,
    uint dwMilliseconds
)

Parameters

hHandle
Type: SystemIntPtr
Object (process, thread etc) to wait for
dwMilliseconds
Type: SystemUInt32
Number of milliseconds to wait.

Return Value

Type: UInt32
WAIT_OBJECT_0, WAIT_TIMEOUT, WAIT_FAILED or WAIT_ABANDONED
See Also

Reference

WinAPI Class
Bncs.SysUtils Namespace


WinAPI.CBTProc Delegate

WinAPICBTProc Delegate
An application-defined or library-defined callback function used with the SetWindowsHookEx function. The system calls this function before activating, creating, destroying, minimizing, maximizing, moving, or sizing a window; before completing a system command; before removing a mouse or keyboard event from the system message queue; before setting the keyboard focus; or before synchronizing with the system message queue. A computer-based training (CBT) application uses this hook procedure to receive useful notifications from the system.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate IntPtr CBTProc(
    HCBT nCode,
    IntPtr wParam,
    IntPtr lParam
)

Parameters

nCode
Type: Bncs.SysUtilsHCBT
The code that the hook procedure uses to determine how to process the message. If nCode is less than zero, the hook procedure must pass the message to the CallNextHookEx function without further processing and should return the value returned by CallNextHookEx.
wParam
Type: SystemIntPtr
Depends on the nCode parameter.
lParam
Type: SystemIntPtr
Depends on the nCode parameter.

Return Value

Type: IntPtr
The value returned by the hook procedure determines whether the system allows or prevents one of these operations. For operations corresponding to the following CBT hook codes, the return value must be 0 to allow the operation, or 1 to prevent it. HCBT_ACTIVATE, HCBT_CREATEWND, HCBT_DESTROYWND, HCBT_MINMAX, HCBT_MOVESIZE, HCBT_SETFOCUS, HCBT_SYSCOMMAND
See Also

Reference

Bncs.SysUtils Namespace


WinAPI.EnumedWindow Delegate

WinAPIEnumedWindow Delegate
EnumWindows callback delegate.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate bool EnumedWindow(
    IntPtr handleWindow,
    ArrayList handles
)

Parameters

handleWindow
Type: SystemIntPtr
Window handle
handles
Type: System.CollectionsArrayList
Array list

Return Value

Type: Boolean
See Also

Reference

Bncs.SysUtils Namespace


WinAPI.EnumWindowProc Delegate

WinAPIEnumWindowProc Delegate
EnumWindow callback.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate bool EnumWindowProc(
    IntPtr hWnd,
    IntPtr parameter
)

Parameters

hWnd
Type: SystemIntPtr
Target window
parameter
Type: SystemIntPtr
Parameter

Return Value

Type: Boolean
True on success
See Also

Reference

Bncs.SysUtils Namespace


WinAPI.HookProc Delegate

WinAPIHookProc Delegate
The HOOKPROC type defines a pointer to this callback function. CallWndRetProc is a placeholder for the application-defined or library-defined function name.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate int HookProc(
    int code,
    IntPtr wParam,
    IntPtr lParam
)

Parameters

code
Type: SystemInt32
wParam
Type: SystemIntPtr
Specifies whether the message is sent by the current process. If the message is sent by the current process, it is nonzero; otherwise, it is NULL.
lParam
Type: SystemIntPtr
A pointer to a CWPRETSTRUCT structure that contains details about the message.

Return Value

Type: Int32
If nCode is less than zero, the hook procedure must return the value returned by CallNextHookEx. If nCode is greater than or equal to zero, it is highly recommended that you call CallNextHookEx and return the value it returns; otherwise, other applications that have installed WH_CALLWNDPROCRET hooks will not receive hook notifications and may behave incorrectly as a result. If the hook procedure does not call CallNextHookEx, the return value should be zero.
See Also

Reference

Bncs.SysUtils Namespace


WinAPI.Win32Callback Delegate

WinAPIWin32Callback Delegate
Win32 callback delegate for child windows.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate bool Win32Callback(
    IntPtr hwnd,
    IntPtr lParam
)

Parameters

hwnd
Type: SystemIntPtr
Target window
lParam
Type: SystemIntPtr
LParam

Return Value

Type: Boolean
True on success
See Also

Reference

Bncs.SysUtils Namespace


WinAPI.WinEventDelegate Delegate

WinAPIWinEventDelegate Delegate
An application-defined callback (or hook) function that the system calls in response to events generated by an accessible object. The hook function processes the event notifications as required. Clients install the hook function and request specific types of event notifications by calling SetWinEventHook.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void WinEventDelegate(
    IntPtr hWinEventHook,
    uint eventType,
    IntPtr hwnd,
    int idObject,
    int idChild,
    uint dwEventThread,
    uint dwmsEventTime
)

Parameters

hWinEventHook
Type: SystemIntPtr
Handle to an event hook function. This value is returned by SetWinEventHook when the hook function is installed and is specific to each instance of the hook function.
eventType
Type: SystemUInt32
Specifies the event that occurred. This value is one of the event constants.
hwnd
Type: SystemIntPtr
Handle to the window that generates the event, or NULL if no window is associated with the event. For example, the mouse pointer is not associated with a window.
idObject
Type: SystemInt32
Identifies the object associated with the event. This is one of the object identifiers or a custom object ID.
idChild
Type: SystemInt32
Identifies whether the event was triggered by an object or a child element of the object. If this value is CHILDID_SELF, the event was triggered by the object; otherwise, this value is the child ID of the element that triggered the event.
dwEventThread
Type: SystemUInt32
Identifies the thread that generated the event, or the thread that owns the current window.
dwmsEventTime
Type: SystemUInt32
Specifies the time, in milliseconds, that the event was generated.
See Also

Reference

Bncs.SysUtils Namespace


WINDOWPLACEMENT Structure

WINDOWPLACEMENT Structure
Contains information about the placement of a window on the screen.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
[SerializableAttribute]
public struct WINDOWPLACEMENT

The WINDOWPLACEMENT type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Indicates whether this instance and a specified object are equal. (Inherited from ValueType.)
Public method | GetHashCode | Returns the hash code for this instance. (Inherited from ValueType.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns the fully qualified type name of this instance. (Inherited from ValueType.)
Top
Fields
 | Name | Description
Public field | Flags | Specifies flags that control the position of the minimized window and the method by which the window is restored.
Public field | Length | The length of the structure, in bytes. Before calling the GetWindowPlacement or SetWindowPlacement functions, set this member to sizeof(WINDOWPLACEMENT). GetWindowPlacement and SetWindowPlacement fail if this member is not set correctly.
Public field | MaxPosition | The coordinates of the window's upper-left corner when the window is maximized.
Public field | MinPosition | The coordinates of the window's upper-left corner when the window is minimized.
Public field | NormalPosition | The window's coordinates when the window is in the restored position.
Public field | ShowCmd | The current show state of the window.
Top
Properties
Name | Description
Default | Gets the default (empty) value.
Top
See Also

Reference

Bncs.SysUtils Namespace


WINDOWPLACEMENT Fields

WINDOWPLACEMENT Fields

The WINDOWPLACEMENT type exposes the following members.

Fields
 | Name | Description
Public field | Flags | Specifies flags that control the position of the minimized window and the method by which the window is restored.
Public field | Length | The length of the structure, in bytes. Before calling the GetWindowPlacement or SetWindowPlacement functions, set this member to sizeof(WINDOWPLACEMENT). GetWindowPlacement and SetWindowPlacement fail if this member is not set correctly.
Public field | MaxPosition | The coordinates of the window's upper-left corner when the window is maximized.
Public field | MinPosition | The coordinates of the window's upper-left corner when the window is minimized.
Public field | NormalPosition | The window's coordinates when the window is in the restored position.
Public field | ShowCmd | The current show state of the window.
Top
See Also

Reference

WINDOWPLACEMENT Structure
Bncs.SysUtils Namespace


WINDOWPLACEMENT.Flags Field

WINDOWPLACEMENTFlags Field
Specifies flags that control the position of the minimized window and the method by which the window is restored.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Flags

Field Value

Type: Int32
See Also

Reference

WINDOWPLACEMENT Structure
Bncs.SysUtils Namespace


WINDOWPLACEMENT.Length Field

WINDOWPLACEMENTLength Field
The length of the structure, in bytes. Before calling the GetWindowPlacement or SetWindowPlacement functions, set this member to sizeof(WINDOWPLACEMENT).

GetWindowPlacement and SetWindowPlacement fail if this member is not set correctly.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Length

Field Value

Type: Int32
See Also

Reference

WINDOWPLACEMENT Structure
Bncs.SysUtils Namespace


WINDOWPLACEMENT.MaxPosition Field

WINDOWPLACEMENTMaxPosition Field
The coordinates of the window's upper-left corner when the window is maximized.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Point MaxPosition

Field Value

Type: Point
See Also

Reference

WINDOWPLACEMENT Structure
Bncs.SysUtils Namespace


WINDOWPLACEMENT.MinPosition Field

WINDOWPLACEMENTMinPosition Field
The coordinates of the window's upper-left corner when the window is minimized.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Point MinPosition

Field Value

Type: Point
See Also

Reference

WINDOWPLACEMENT Structure
Bncs.SysUtils Namespace


WINDOWPLACEMENT.NormalPosition Field

WINDOWPLACEMENTNormalPosition Field
The window's coordinates when the window is in the restored position.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Rectangle NormalPosition

Field Value

Type: Rectangle
See Also

Reference

WINDOWPLACEMENT Structure
Bncs.SysUtils Namespace


WINDOWPLACEMENT.ShowCmd Field

WINDOWPLACEMENTShowCmd Field
The current show state of the window.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ShowWindowCommands ShowCmd

Field Value

Type: ShowWindowCommands
See Also

Reference

WINDOWPLACEMENT Structure
Bncs.SysUtils Namespace


WINDOWPLACEMENT Methods

WINDOWPLACEMENT Methods

The WINDOWPLACEMENT type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Indicates whether this instance and a specified object are equal. (Inherited from ValueType.)
Public method | GetHashCode | Returns the hash code for this instance. (Inherited from ValueType.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns the fully qualified type name of this instance. (Inherited from ValueType.)
Top
See Also

Reference

WINDOWPLACEMENT Structure
Bncs.SysUtils Namespace


WINDOWPLACEMENT Properties

WINDOWPLACEMENT Properties

The WINDOWPLACEMENT type exposes the following members.

Properties
Name | Description
Default | Gets the default (empty) value.
Top
See Also

Reference

WINDOWPLACEMENT Structure
Bncs.SysUtils Namespace


WINDOWPLACEMENT.Default Property

WINDOWPLACEMENTDefault Property
Gets the default (empty) value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static WINDOWPLACEMENT Default { get; }

Property Value

Type: WINDOWPLACEMENT
See Also

Reference

WINDOWPLACEMENT Structure
Bncs.SysUtils Namespace


WindowsExit Class

WindowsExit Class
Class that executes a Windows exit.
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsWindowsExit

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static class WindowsExit
Methods
Name | Description
Exit(WindowsExitType) | Executes the Windows exit using the supplied type, exit is never forced by this method.
Exit(WindowsExitType, Boolean) | Executes the Windows exit using the supplied type and force flag.
Top
See Also

Reference

Bncs.SysUtils Namespace


WindowsExit Methods

WindowsExit Methods
Methods
Name | Description
Exit(WindowsExitType) | Executes the Windows exit using the supplied type, exit is never forced by this method.
Exit(WindowsExitType, Boolean) | Executes the Windows exit using the supplied type and force flag.
Top
See Also

Reference

WindowsExit Class
Bncs.SysUtils Namespace


WindowsExit.Exit Method

WindowsExitExit Method
Overload List
Name | Description
Exit(WindowsExitType) | Executes the Windows exit using the supplied type, exit is never forced by this method.
Exit(WindowsExitType, Boolean) | Executes the Windows exit using the supplied type and force flag.
Top
See Also

Reference

WindowsExit Class
Bncs.SysUtils Namespace


WindowsExit.Exit Method (WindowsExitType)

WindowsExitExit Method (WindowsExitType)
Executes the Windows exit using the supplied type, exit is never forced by this method.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Exit(
    WindowsExitType windowsExitType_
)

Parameters

windowsExitType_
Type: Bncs.SysUtilsWindowsExitType
Type of Windows exit.

Return Value

Type: Boolean
True on success.
See Also

Reference

WindowsExit Class
Exit Overload
Bncs.SysUtils Namespace


WindowsExit.Exit Method (WindowsExitType, Boolean)

WindowsExitExit Method (WindowsExitType, Boolean)
Executes the Windows exit using the supplied type and force flag.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool Exit(
    WindowsExitType windowsExitType_,
    bool force_
)

Parameters

windowsExitType_
Type: Bncs.SysUtilsWindowsExitType
Type of Windows exit.
force_
Type: SystemBoolean
If true the action will be forced.

Return Value

Type: Boolean
True on success.
See Also

Reference

WindowsExit Class
Exit Overload
Bncs.SysUtils Namespace


WindowsExitType Enumeration

WindowsExitType Enumeration
An enumeration denoting a particular type of Windows exit.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum WindowsExitType
Members
Member name | Value | Description
Shutdown | 0 | Shutsdown Windows.
Reboot | 1 | Shutsdown Windows and then reboots.
Logoff | 2 | Logs the current user out of Windows.
Poweroff | 3 | Powers off the machine.
See Also

Reference

Bncs.SysUtils Namespace


WinFuncs Class

WinFuncs Class
Class that defines a host of handy reusable windows API operations.
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsWinFuncs

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static class WinFuncs

The WinFuncs type exposes the following members.

Methods
Name Description
GetChildWindows
Gets a list of child windows of the supplied window.
GetInfo(ListIntPtr)
Converts a list of window handles to a list of window information. The results will attempt to get the process too.
GetInfo(Process)
Converts the supplied processes to a list of HwndInfo.
GetInfo(ListIntPtr, Boolean)
Converts a list of window handles to a list of window information. The process for each result is optional.
GetInfo(ListIntPtr, String)
Converts a list of window handles for whom the class name is already known to a list of window information. This method is preffered to the version without a supplied class name when the class name has already been established as it saves duplicate processing. The results will attempt to get the process too.
GetInfo(ListIntPtr, String, Boolean)
Converts a list of window handles for whom the class name is already known to a list of window information. This method is preffered to the version without a supplied when the class name has already been established as it saves duplicate processing. Getting the process is optional.
GetWindow
Converts the supplied process to an HwndInfo.
GetWindows
Gets a list of all top level windows.
GetWindows(String)
Gets a list of all top level windows whose class name matches that supplied or is contained in that supplied if the supplied is a semi colon delimited list.
Examples
This example searches for all windows that are CSI32, InfoDriver32 and GRD32 windows and uses each one to generate an HwndInfo object and adds the object to a list.
Copy
List<HwndInfo> bncsApps = new  List<HwndInfo>();
foreach (IntPtr ptr in WinFuncs.GetWindows("CSI32;InfoDriver32;GRD32"))
{
   HwndInfo hwnd = new HwndInfo(ptr, true);
   if (null != hwnd.Process)
        bncsApps.Add(hwnd);
}
GetWindows(String, String)
Gets a list of all top level windows whose class name and caption matches that supplied or is contained in that supplied if the supplied class name is a semi colon delimited list.
GetWindowShowCommand
Gets the window command state for the supplied window.
IntPtrToHex
Converts an IntPtr to a string representing the pointers hexadecimal value.
Top
See Also

Reference

Bncs.SysUtils Namespace


WinFuncs Methods

WinFuncs Methods

The WinFuncs type exposes the following members.

Methods
Name Description
GetChildWindows
Gets a list of child windows of the supplied window.
GetInfo(ListIntPtr)
Converts a list of window handles to a list of window information. The results will attempt to get the process too.
GetInfo(Process)
Converts the supplied processes to a list of HwndInfo.
GetInfo(ListIntPtr, Boolean)
Converts a list of window handles to a list of window information. The process for each result is optional.
GetInfo(ListIntPtr, String)
Converts a list of window handles for whom the class name is already known to a list of window information. This method is preffered to the version without a supplied class name when the class name has already been established as it saves duplicate processing. The results will attempt to get the process too.
GetInfo(ListIntPtr, String, Boolean)
Converts a list of window handles for whom the class name is already known to a list of window information. This method is preffered to the version without a supplied when the class name has already been established as it saves duplicate processing. Getting the process is optional.
GetWindow
Converts the supplied process to an HwndInfo.
GetWindows
Gets a list of all top level windows.
GetWindows(String)
Gets a list of all top level windows whose class name matches that supplied or is contained in that supplied if the supplied is a semi colon delimited list.
Examples
This example searches for all windows that are CSI32, InfoDriver32 and GRD32 windows and uses each one to generate an HwndInfo object and adds the object to a list.
Copy
List<HwndInfo> bncsApps = new  List<HwndInfo>();
foreach (IntPtr ptr in WinFuncs.GetWindows("CSI32;InfoDriver32;GRD32"))
{
   HwndInfo hwnd = new HwndInfo(ptr, true);
   if (null != hwnd.Process)
        bncsApps.Add(hwnd);
}
GetWindows(String, String)
Gets a list of all top level windows whose class name and caption matches that supplied or is contained in that supplied if the supplied class name is a semi colon delimited list.
GetWindowShowCommand
Gets the window command state for the supplied window.
IntPtrToHex
Converts an IntPtr to a string representing the pointers hexadecimal value.
Top
See Also

Reference

WinFuncs Class
Bncs.SysUtils Namespace


WinFuncs.GetChildWindows Method

WinFuncsGetChildWindows Method
Gets a list of child windows of the supplied window.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static List<IntPtr> GetChildWindows(
    IntPtr parent_
)

Parameters

parent_
Type: SystemIntPtr
Window whose children you wish to gather.

Return Value

Type: List IntPtr
A list of IntPtr's
See Also

Reference

WinFuncs Class
Bncs.SysUtils Namespace


WinFuncs.GetInfo Method

WinFuncsGetInfo Method
Overload List
Name | Description
GetInfo(ListIntPtr) | Converts a list of window handles to a list of window information. The results will attempt to get the process too.
GetInfo(Process) | Converts the supplied processes to a list of HwndInfo.
GetInfo(ListIntPtr, Boolean) | Converts a list of window handles to a list of window information. The process for each result is optional.
GetInfo(ListIntPtr, String) | Converts a list of window handles for whom the class name is already known to a list of window information. This method is preffered to the version without a supplied class name when the class name has already been established as it saves duplicate processing. The results will attempt to get the process too.
GetInfo(ListIntPtr, String, Boolean) | Converts a list of window handles for whom the class name is already known to a list of window information. This method is preffered to the version without a supplied when the class name has already been established as it saves duplicate processing. Getting the process is optional.
Top
See Also

Reference

WinFuncs Class
Bncs.SysUtils Namespace


WinFuncs.GetInfo Method (List(IntPtr))

WinFuncsGetInfo Method (ListIntPtr)
Converts a list of window handles to a list of window information. The results will attempt to get the process too.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static List<HwndInfo> GetInfo(
    List<IntPtr> hwnds_
)

Parameters

hwnds_
Type: System.Collections.GenericList IntPtr
List of window handles to convert.

Return Value

Type: List HwndInfo
A list of HwndInfos
See Also

Reference

WinFuncs Class
GetInfo Overload
Bncs.SysUtils Namespace


WinFuncs.GetInfo Method (Process[])

WinFuncsGetInfo Method (Process)
Converts the supplied processes to a list of HwndInfo.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static List<HwndInfo> GetInfo(
    Process[] processes_
)

Parameters

processes_
Type: System.DiagnosticsProcess
Processes from which to extract the HwndInfo.

Return Value

Type: List HwndInfo
A list of HwndInfos
See Also

Reference

WinFuncs Class
GetInfo Overload
Bncs.SysUtils Namespace


WinFuncs.GetInfo Method (List(IntPtr), Boolean)

WinFuncsGetInfo Method (ListIntPtr, Boolean)
Converts a list of window handles to a list of window information. The process for each result is optional.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static List<HwndInfo> GetInfo(
    List<IntPtr> hwnds_,
    bool getProcess_
)

Parameters

hwnds_
Type: System.Collections.GenericList IntPtr
List of window handles to convert.
getProcess_
Type: SystemBoolean
Get process flag.

Return Value

Type: List HwndInfo
A list of HwndInfos
See Also

Reference

WinFuncs Class
GetInfo Overload
Bncs.SysUtils Namespace


WinFuncs.GetInfo Method (List(IntPtr), String)

WinFuncsGetInfo Method (ListIntPtr, String)
Converts a list of window handles for whom the class name is already known to a list of window information. This method is preffered to the version without a supplied class name when the class name has already been established as it saves duplicate processing. The results will attempt to get the process too.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static List<HwndInfo> GetInfo(
    List<IntPtr> hwnds_,
    string className_
)

Parameters

hwnds_
Type: System.Collections.GenericList IntPtr
List of window handles to convert.
className_
Type: SystemString
The class name for which to return windo info.

Return Value

Type: List HwndInfo
A list of HwndInfos
See Also

Reference

WinFuncs Class
GetInfo Overload
Bncs.SysUtils Namespace


WinFuncs.GetInfo Method (List(IntPtr), String, Boolean)

WinFuncsGetInfo Method (ListIntPtr, String, Boolean)
Converts a list of window handles for whom the class name is already known to a list of window information. This method is preffered to the version without a supplied when the class name has already been established as it saves duplicate processing. Getting the process is optional.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static List<HwndInfo> GetInfo(
    List<IntPtr> hwnds_,
    string className_,
    bool getProcess_
)

Parameters

hwnds_
Type: System.Collections.GenericList IntPtr
List of window handles to convert.
className_
Type: SystemString
The class name for which to return windo info.
getProcess_
Type: SystemBoolean
Get process flag

Return Value

Type: List HwndInfo
A list of HwndInfos
See Also

Reference

WinFuncs Class
GetInfo Overload
Bncs.SysUtils Namespace


WinFuncs.GetWindow Method

WinFuncsGetWindow Method
Converts the supplied process to an HwndInfo.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static HwndInfo GetWindow(
    Process process_
)

Parameters

process_
Type: System.DiagnosticsProcess
Process from which to extract the HwndInfo.

Return Value

Type: HwndInfo
An HwndInfo
See Also

Reference

WinFuncs Class
Bncs.SysUtils Namespace


WinFuncs.GetWindows Method

WinFuncsGetWindows Method
Overload List
Name Description
GetWindows
Gets a list of all top level windows.
GetWindows(String)
Gets a list of all top level windows whose class name matches that supplied or is contained in that supplied if the supplied is a semi colon delimited list.
Examples
This example searches for all windows that are CSI32, InfoDriver32 and GRD32 windows and uses each one to generate an HwndInfo object and adds the object to a list.
Copy
List<HwndInfo> bncsApps = new  List<HwndInfo>();
foreach (IntPtr ptr in WinFuncs.GetWindows("CSI32;InfoDriver32;GRD32"))
{
   HwndInfo hwnd = new HwndInfo(ptr, true);
   if (null != hwnd.Process)
        bncsApps.Add(hwnd);
}
GetWindows(String, String)
Gets a list of all top level windows whose class name and caption matches that supplied or is contained in that supplied if the supplied class name is a semi colon delimited list.
Top
See Also

Reference

WinFuncs Class
Bncs.SysUtils Namespace


WinFuncs.GetWindows Method

WinFuncsGetWindows Method
Gets a list of all top level windows.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static List<IntPtr> GetWindows()

Return Value

Type: List IntPtr
A list of IntPtrs
See Also

Reference

WinFuncs Class
GetWindows Overload
Bncs.SysUtils Namespace


WinFuncs.GetWindows Method (String)

WinFuncsGetWindows Method (String)
Gets a list of all top level windows whose class name matches that supplied or is contained in that supplied if the supplied is a semi colon delimited list.
Examples
This example searches for all windows that are CSI32, InfoDriver32 and GRD32 windows and uses each one to generate an HwndInfo object and adds the object to a list.
Copy
List<HwndInfo> bncsApps = new  List<HwndInfo>();
foreach (IntPtr ptr in WinFuncs.GetWindows("CSI32;InfoDriver32;GRD32"))
{
   HwndInfo hwnd = new HwndInfo(ptr, true);
   if (null != hwnd.Process)
        bncsApps.Add(hwnd);
}

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static List<IntPtr> GetWindows(
    string className_
)

Parameters

className_
Type: SystemString
Class name to match or semi colon delimited list.

Return Value

Type: List IntPtr
A list of IntPtrs to windows whose class name matches that supplied.
See Also

Reference

WinFuncs Class
GetWindows Overload
Bncs.SysUtils Namespace


WinFuncs.GetWindows Method (String, String)

WinFuncsGetWindows Method (String, String)
Gets a list of all top level windows whose class name and caption matches that supplied or is contained in that supplied if the supplied class name is a semi colon delimited list.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static List<IntPtr> GetWindows(
    string className_,
    string caption_
)

Parameters

className_
Type: SystemString
Class name to match or semi colon delimited list.
caption_
Type: SystemString
Caption to match

Return Value

Type: List IntPtr
A list of IntPtrs to windows whose class name and caption matches that supplied.
See Also

Reference

WinFuncs Class
GetWindows Overload
Bncs.SysUtils Namespace


WinFuncs.GetWindowShowCommand Method

WinFuncsGetWindowShowCommand Method
Gets the window command state for the supplied window.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static ShowWindowCommands GetWindowShowCommand(
    IntPtr hwnd_
)

Parameters

hwnd_
Type: SystemIntPtr
Target window

Return Value

Type: ShowWindowCommands
A ShowWindowCommands value.
See Also

Reference

WinFuncs Class
Bncs.SysUtils Namespace


WinFuncs.IntPtrToHex Method

WinFuncsIntPtrToHex Method
Converts an IntPtr to a string representing the pointers hexadecimal value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string IntPtrToHex(
    IntPtr hwnd_
)

Parameters

hwnd_
Type: SystemIntPtr
Window handle

Return Value

Type: String
A hex string representation of the handle.
See Also

Reference

WinFuncs Class
Bncs.SysUtils Namespace


WMFuncs Class

WMFuncs Class
Windows messaging functions
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsWMFuncs

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static class WMFuncs

The WMFuncs type exposes the following members.

Methods
Name Description
ParamsCopyDataToString
Converts parameters to a windows message, extracts copy data from the LParam and returns the string.
Examples
This example demonstrates use of the WPFMessageHandler class, how to trap message, how to send a string to another window and how to create a unique window message.
Copy
// Create a unique window message
private uint WM_MESSAGE = WinAPI.RegisterWindowMessage("5e98d834-83f2-4cea-b7c7-7eb2e060f47a");

// WPF app loaded event handler, create a WPFMessageHandler and assign it's OnMessage event handler.
private void AppLoaded(object sender, RoutedEventArgs e)
{
    WPFMessageHandler handler = new WPFMessageHandler(this);
    handler.OnMessage += HandlerOnMessage;
}

// Method that sends the supplied string to the supplied window
private void SendStringToWindow(IntPtr targetWindow_, string message_)
{
    WMFuncs.SendWindowsStringMessage(targetWindow_.ToInt32(), 0, message_);
}

// WPFMessageHandler's OnMessage event handler adds the received string to a ListBox
private IntPtr HandlerOnMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
    handled = msg == WinAPI.WM_COPYDATA;
    if (handled)
    {
        string message = string.Empty;
        try
        {
            message = WMFuncs.ParamsCopyDataToString(hwnd, msg, wParam, lParam);
        }
        catch (Exception exception)
        {
            message = null;
            Dispatcher.BeginInvoke(new Action(() => lbIn.Items.Add(exception.Message + " - " + exception.GetType().ToString())));
        }
        if (null == message)
            message = "An error occured";
        Dispatcher.BeginInvoke(new Action(() => lbIn.Items.Add(message)));
    }
    return hwnd;
}
ParamsToWindowsMessage
Converts the supplied parameters to a WinForms message.
ParamsToWPFMessage
Converts the supplied parameters to a WPF message.
SendWindowsStringMessage
Sends a string to a window using the WinAPI.SendMessage() method.
Examples
This example demonstrates use of the WPFMessageHandler class, how to trap message, how to send a string to another window and how to create a unique window message.
Copy
// Create a unique window message
private uint WM_MESSAGE = WinAPI.RegisterWindowMessage("5e98d834-83f2-4cea-b7c7-7eb2e060f47a");

// WPF app loaded event handler, create a WPFMessageHandler and assign it's OnMessage event handler.
private void AppLoaded(object sender, RoutedEventArgs e)
{
    WPFMessageHandler handler = new WPFMessageHandler(this);
    handler.OnMessage += HandlerOnMessage;
}

// Method that sends the supplied string to the supplied window
private void SendStringToWindow(IntPtr targetWindow_, string message_)
{
    WMFuncs.SendWindowsStringMessage(targetWindow_.ToInt32(), 0, message_);
}

// WPFMessageHandler's OnMessage event handler adds the received string to a ListBox
private IntPtr HandlerOnMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
    handled = msg == WinAPI.WM_COPYDATA;
    if (handled)
    {
        string message = string.Empty;
        try
        {
            message = WMFuncs.ParamsCopyDataToString(hwnd, msg, wParam, lParam);
        }
        catch (Exception exception)
        {
            message = null;
            Dispatcher.BeginInvoke(new Action(() => lbIn.Items.Add(exception.Message + " - " + exception.GetType().ToString())));
        }
        if (null == message)
            message = "An error occured";
        Dispatcher.BeginInvoke(new Action(() => lbIn.Items.Add(message)));
    }
    return hwnd;
}
WindowsMessageToWPFMessage
Converts the supplied WinForms message to a WPFMessage.
WPFMessageToWindowsMessage
Converts the supplied WPFMessage to a WinForms message.
Top
See Also

Reference

Bncs.SysUtils Namespace


WMFuncs Methods

WMFuncs Methods

The WMFuncs type exposes the following members.

Methods
Name Description
ParamsCopyDataToString
Converts parameters to a windows message, extracts copy data from the LParam and returns the string.
Examples
This example demonstrates use of the WPFMessageHandler class, how to trap message, how to send a string to another window and how to create a unique window message.
Copy
// Create a unique window message
private uint WM_MESSAGE = WinAPI.RegisterWindowMessage("5e98d834-83f2-4cea-b7c7-7eb2e060f47a");

// WPF app loaded event handler, create a WPFMessageHandler and assign it's OnMessage event handler.
private void AppLoaded(object sender, RoutedEventArgs e)
{
    WPFMessageHandler handler = new WPFMessageHandler(this);
    handler.OnMessage += HandlerOnMessage;
}

// Method that sends the supplied string to the supplied window
private void SendStringToWindow(IntPtr targetWindow_, string message_)
{
    WMFuncs.SendWindowsStringMessage(targetWindow_.ToInt32(), 0, message_);
}

// WPFMessageHandler's OnMessage event handler adds the received string to a ListBox
private IntPtr HandlerOnMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
    handled = msg == WinAPI.WM_COPYDATA;
    if (handled)
    {
        string message = string.Empty;
        try
        {
            message = WMFuncs.ParamsCopyDataToString(hwnd, msg, wParam, lParam);
        }
        catch (Exception exception)
        {
            message = null;
            Dispatcher.BeginInvoke(new Action(() => lbIn.Items.Add(exception.Message + " - " + exception.GetType().ToString())));
        }
        if (null == message)
            message = "An error occured";
        Dispatcher.BeginInvoke(new Action(() => lbIn.Items.Add(message)));
    }
    return hwnd;
}
ParamsToWindowsMessage
Converts the supplied parameters to a WinForms message.
ParamsToWPFMessage
Converts the supplied parameters to a WPF message.
SendWindowsStringMessage
Sends a string to a window using the WinAPI.SendMessage() method.
Examples
This example demonstrates use of the WPFMessageHandler class, how to trap message, how to send a string to another window and how to create a unique window message.
Copy
// Create a unique window message
private uint WM_MESSAGE = WinAPI.RegisterWindowMessage("5e98d834-83f2-4cea-b7c7-7eb2e060f47a");

// WPF app loaded event handler, create a WPFMessageHandler and assign it's OnMessage event handler.
private void AppLoaded(object sender, RoutedEventArgs e)
{
    WPFMessageHandler handler = new WPFMessageHandler(this);
    handler.OnMessage += HandlerOnMessage;
}

// Method that sends the supplied string to the supplied window
private void SendStringToWindow(IntPtr targetWindow_, string message_)
{
    WMFuncs.SendWindowsStringMessage(targetWindow_.ToInt32(), 0, message_);
}

// WPFMessageHandler's OnMessage event handler adds the received string to a ListBox
private IntPtr HandlerOnMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
    handled = msg == WinAPI.WM_COPYDATA;
    if (handled)
    {
        string message = string.Empty;
        try
        {
            message = WMFuncs.ParamsCopyDataToString(hwnd, msg, wParam, lParam);
        }
        catch (Exception exception)
        {
            message = null;
            Dispatcher.BeginInvoke(new Action(() => lbIn.Items.Add(exception.Message + " - " + exception.GetType().ToString())));
        }
        if (null == message)
            message = "An error occured";
        Dispatcher.BeginInvoke(new Action(() => lbIn.Items.Add(message)));
    }
    return hwnd;
}
WindowsMessageToWPFMessage
Converts the supplied WinForms message to a WPFMessage.
WPFMessageToWindowsMessage
Converts the supplied WPFMessage to a WinForms message.
Top
See Also

Reference

WMFuncs Class
Bncs.SysUtils Namespace


WMFuncs.ParamsCopyDataToString Method

WMFuncsParamsCopyDataToString Method
Converts parameters to a windows message, extracts copy data from the LParam and returns the string.
Examples
This example demonstrates use of the WPFMessageHandler class, how to trap message, how to send a string to another window and how to create a unique window message.
Copy
// Create a unique window message
private uint WM_MESSAGE = WinAPI.RegisterWindowMessage("5e98d834-83f2-4cea-b7c7-7eb2e060f47a");

// WPF app loaded event handler, create a WPFMessageHandler and assign it's OnMessage event handler.
private void AppLoaded(object sender, RoutedEventArgs e)
{
    WPFMessageHandler handler = new WPFMessageHandler(this);
    handler.OnMessage += HandlerOnMessage;
}

// Method that sends the supplied string to the supplied window
private void SendStringToWindow(IntPtr targetWindow_, string message_)
{
    WMFuncs.SendWindowsStringMessage(targetWindow_.ToInt32(), 0, message_);
}

// WPFMessageHandler's OnMessage event handler adds the received string to a ListBox
private IntPtr HandlerOnMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
    handled = msg == WinAPI.WM_COPYDATA;
    if (handled)
    {
        string message = string.Empty;
        try
        {
            message = WMFuncs.ParamsCopyDataToString(hwnd, msg, wParam, lParam);
        }
        catch (Exception exception)
        {
            message = null;
            Dispatcher.BeginInvoke(new Action(() => lbIn.Items.Add(exception.Message + " - " + exception.GetType().ToString())));
        }
        if (null == message)
            message = "An error occured";
        Dispatcher.BeginInvoke(new Action(() => lbIn.Items.Add(message)));
    }
    return hwnd;
}

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string ParamsCopyDataToString(
    IntPtr hwnd_,
    int msg_,
    IntPtr wParam_,
    IntPtr lParam_
)

Parameters

hwnd_
Type: SystemIntPtr
Calling window
msg_
Type: SystemInt32
Message, expects WM_COPYDATA
wParam_
Type: SystemIntPtr
WParam
lParam_
Type: SystemIntPtr
LParam, expects a pointer to a COPYDATASTRUCT

Return Value

Type: String
A decoded string on success else an InvalidOperationException when the msg_ parameter is not WM_COPYDATA
See Also

Reference

WMFuncs Class
Bncs.SysUtils Namespace


WMFuncs.ParamsToWindowsMessage Method

WMFuncsParamsToWindowsMessage Method
Converts the supplied parameters to a WinForms message.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static Message ParamsToWindowsMessage(
    IntPtr hwnd_,
    int msg_,
    IntPtr wParam_,
    IntPtr lParam_
)

Parameters

hwnd_
Type: SystemIntPtr
Calling or target window
msg_
Type: SystemInt32
Message
wParam_
Type: SystemIntPtr
W Param
lParam_
Type: SystemIntPtr
L Param

Return Value

Type: Message
The supplied parameters as a Windows Message.
See Also

Reference

WMFuncs Class
Bncs.SysUtils Namespace


WMFuncs.ParamsToWPFMessage Method

WMFuncsParamsToWPFMessage Method
Converts the supplied parameters to a WPF message.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static WPFMessage ParamsToWPFMessage(
    IntPtr hwnd_,
    int msg_,
    IntPtr wParam_,
    IntPtr lParam_
)

Parameters

hwnd_
Type: SystemIntPtr
Calling or target window
msg_
Type: SystemInt32
Message
wParam_
Type: SystemIntPtr
W Param
lParam_
Type: SystemIntPtr
L Param

Return Value

Type: WPFMessage
Parameters as a WPFMessage
See Also

Reference

WMFuncs Class
Bncs.SysUtils Namespace


WMFuncs.SendWindowsStringMessage Method

WMFuncsSendWindowsStringMessage Method
Sends a string to a window using the WinAPI.SendMessage() method.
Examples
This example demonstrates use of the WPFMessageHandler class, how to trap message, how to send a string to another window and how to create a unique window message.
Copy
// Create a unique window message
private uint WM_MESSAGE = WinAPI.RegisterWindowMessage("5e98d834-83f2-4cea-b7c7-7eb2e060f47a");

// WPF app loaded event handler, create a WPFMessageHandler and assign it's OnMessage event handler.
private void AppLoaded(object sender, RoutedEventArgs e)
{
    WPFMessageHandler handler = new WPFMessageHandler(this);
    handler.OnMessage += HandlerOnMessage;
}

// Method that sends the supplied string to the supplied window
private void SendStringToWindow(IntPtr targetWindow_, string message_)
{
    WMFuncs.SendWindowsStringMessage(targetWindow_.ToInt32(), 0, message_);
}

// WPFMessageHandler's OnMessage event handler adds the received string to a ListBox
private IntPtr HandlerOnMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
{
    handled = msg == WinAPI.WM_COPYDATA;
    if (handled)
    {
        string message = string.Empty;
        try
        {
            message = WMFuncs.ParamsCopyDataToString(hwnd, msg, wParam, lParam);
        }
        catch (Exception exception)
        {
            message = null;
            Dispatcher.BeginInvoke(new Action(() => lbIn.Items.Add(exception.Message + " - " + exception.GetType().ToString())));
        }
        if (null == message)
            message = "An error occured";
        Dispatcher.BeginInvoke(new Action(() => lbIn.Items.Add(message)));
    }
    return hwnd;
}

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static int SendWindowsStringMessage(
    int hWnd_,
    int wParam_,
    string message_
)

Parameters

hWnd_
Type: SystemInt32
Target window
wParam_
Type: SystemInt32
WParam
message_
Type: SystemString
Message string to send (sent as LParam)

Return Value

Type: Int32
Integer
See Also

Reference

WMFuncs Class
Bncs.SysUtils Namespace


WMFuncs.WindowsMessageToWPFMessage Method

WMFuncsWindowsMessageToWPFMessage Method
Converts the supplied WinForms message to a WPFMessage.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static WPFMessage WindowsMessageToWPFMessage(
    Message message_
)

Parameters

message_
Type: System.Windows.FormsMessage
WinForms message to convert

Return Value

Type: WPFMessage
Message as a WPFMessage
See Also

Reference

WMFuncs Class
Bncs.SysUtils Namespace


WMFuncs.WPFMessageToWindowsMessage Method

WMFuncsWPFMessageToWindowsMessage Method
Converts the supplied WPFMessage to a WinForms message.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static Message WPFMessageToWindowsMessage(
    WPFMessage message_
)

Parameters

message_
Type: Bncs.SysUtilsWPFMessage
WPFMessage

Return Value

Type: Message
The supplied WPFMessage as a WinForms message
See Also

Reference

WMFuncs Class
Bncs.SysUtils Namespace


WPFMessage Structure

WPFMessage Structure
A structure that encapsulates a windows message.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public struct WPFMessage

The WPFMessage type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Indicates whether this instance and a specified object are equal. (Inherited from ValueType.)
Public method | GetHashCode | Returns the hash code for this instance. (Inherited from ValueType.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns the fully qualified type name of this instance. (Inherited from ValueType.)
Top
Fields
 | Name | Description
Public field | Hwnd | Window pointer
Public field | LParam | LParam
Public field | Msg | Message
Public field | WParam | WParam
Top
See Also

Reference

Bncs.SysUtils Namespace


WPFMessage Fields

WPFMessage Fields

The WPFMessage type exposes the following members.

Fields
 | Name | Description
Public field | Hwnd | Window pointer
Public field | LParam | LParam
Public field | Msg | Message
Public field | WParam | WParam
Top
See Also

Reference

WPFMessage Structure
Bncs.SysUtils Namespace


WPFMessage.Hwnd Field

WPFMessageHwnd Field
Window pointer

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public IntPtr Hwnd

Field Value

Type: IntPtr
See Also

Reference

WPFMessage Structure
Bncs.SysUtils Namespace


WPFMessage.LParam Field

WPFMessageLParam Field
LParam

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public IntPtr LParam

Field Value

Type: IntPtr
See Also

Reference

WPFMessage Structure
Bncs.SysUtils Namespace


WPFMessage.Msg Field

WPFMessageMsg Field
Message

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Msg

Field Value

Type: Int32
See Also

Reference

WPFMessage Structure
Bncs.SysUtils Namespace


WPFMessage.WParam Field

WPFMessageWParam Field
WParam

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public IntPtr WParam

Field Value

Type: IntPtr
See Also

Reference

WPFMessage Structure
Bncs.SysUtils Namespace


WPFMessage Methods

WPFMessage Methods

The WPFMessage type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Indicates whether this instance and a specified object are equal. (Inherited from ValueType.)
Public method | GetHashCode | Returns the hash code for this instance. (Inherited from ValueType.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns the fully qualified type name of this instance. (Inherited from ValueType.)
Top
See Also

Reference

WPFMessage Structure
Bncs.SysUtils Namespace


WriteMode Enumeration

WriteMode Enumeration
Enumeration of write modes

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum WriteMode
Members
Member name | Value | Description
Memory | 0 | Tells an INIFile write operation to effect the change in memory only (default).
Disk | 1 | Tells an INIFile write operation to commit the change immediatley to disk.
See Also

Reference

Bncs.SysUtils Namespace


XBit Enumeration

XBit Enumeration
Bit enumeration to denote bits in a byte.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum XBit
Members
Member name | Value | Description
Lsb | 0 | Least significant bit.
Bit1 | 1 | Next bit
Bit2 | 2 | Next bit
Bit3 | 3 | Next bit
Bit4 | 4 | Next bit
Bit5 | 5 | Next bit
Bit6 | 6 | Next bit
Msb | 7 | Most significant bit.
See Also

Reference

Bncs.SysUtils Namespace


XByte Class

XByte Class
A class encapsulating a byte with a public interface that supports getting and setting of bits.
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsXByte

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class XByte

The XByte type exposes the following members.

Constructors
 | Name | Description
Public method | XByte | Default constructor
Public method | XByte(Byte) | Constructor that initialises the underlying byte value.
Public method | XByte(BitArray) | Constructor that initialises the underlying byte from a BitArray. If the supplied array exceeds 8 bits then an exception is thrown.
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | IsBitSet | Returns true if the supplied bit enumerator represents a bit set in the underlying value.
Public method | SetBit | Sets or unsets the bit denoted by the supplied bit enumerator to the supplied value.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | Bitmap | Gets the instance as a BitArray object
Public property | ToArray | Gets the instance as a single byte array
Public property | Value | Gets or sets the the value.
Top
See Also

Reference

Bncs.SysUtils Namespace


XByte Constructor

XByte Constructor
Overload List
 | Name | Description
Public method | XByte | Default constructor
Public method | XByte(Byte) | Constructor that initialises the underlying byte value.
Public method | XByte(BitArray) | Constructor that initialises the underlying byte from a BitArray. If the supplied array exceeds 8 bits then an exception is thrown.
Top
See Also

Reference

XByte Class
Bncs.SysUtils Namespace


XByte Constructor

XByte Constructor
Default constructor

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public XByte()
See Also

Reference

XByte Class
XByte Overload
Bncs.SysUtils Namespace


XByte Constructor (Byte)

XByte Constructor (Byte)
Constructor that initialises the underlying byte value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public XByte(
    byte value_
)

Parameters

value_
Type: SystemByte
Initial value
See Also

Reference

XByte Class
XByte Overload
Bncs.SysUtils Namespace


XByte Constructor (BitArray)

XByte Constructor (BitArray)
Constructor that initialises the underlying byte from a BitArray. If the supplied array exceeds 8 bits then an exception is thrown.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public XByte(
    BitArray bitmap_
)

Parameters

bitmap_
Type: System.CollectionsBitArray
Bit array from which to initialise the underlying byte value
See Also

Reference

XByte Class
XByte Overload
Bncs.SysUtils Namespace


XByte Methods

XByte Methods

The XByte type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | IsBitSet | Returns true if the supplied bit enumerator represents a bit set in the underlying value.
Public method | SetBit | Sets or unsets the bit denoted by the supplied bit enumerator to the supplied value.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

XByte Class
Bncs.SysUtils Namespace


XByte.IsBitSet Method

XByteIsBitSet Method
Returns true if the supplied bit enumerator represents a bit set in the underlying value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool IsBitSet(
    XBit bit_
)

Parameters

bit_
Type: Bncs.SysUtilsXBit
Bit denoter

Return Value

Type: Boolean
True if the bit is set.
See Also

Reference

XByte Class
Bncs.SysUtils Namespace


XByte.SetBit Method

XByteSetBit Method
Sets or unsets the bit denoted by the supplied bit enumerator to the supplied value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void SetBit(
    XBit bit_,
    bool value_
)

Parameters

bit_
Type: Bncs.SysUtilsXBit
Bit to set
value_
Type: SystemBoolean
Value
See Also

Reference

XByte Class
Bncs.SysUtils Namespace


XByte Properties

XByte Properties

The XByte type exposes the following members.

Properties
 | Name | Description
Public property | Bitmap | Gets the instance as a BitArray object
Public property | ToArray | Gets the instance as a single byte array
Public property | Value | Gets or sets the the value.
Top
See Also

Reference

XByte Class
Bncs.SysUtils Namespace


XByte.Bitmap Property

XByteBitmap Property
Gets the instance as a BitArray object

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BitArray Bitmap { get; }

Property Value

Type: BitArray
See Also

Reference

XByte Class
Bncs.SysUtils Namespace


XByte.ToArray Property

XByteToArray Property
Gets the instance as a single byte array

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[] ToArray { get; }

Property Value

Type: Byte
See Also

Reference

XByte Class
Bncs.SysUtils Namespace


XByte.Value Property

XByteValue Property
Gets or sets the the value.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte Value { get; set; }

Property Value

Type: Byte
See Also

Reference

XByte Class
Bncs.SysUtils Namespace


Xception Class

Xception Class
A static class with methods that return messages traversed through the exception stack for a supplied exception.
Inheritance Hierarchy
SystemObject
Bncs.SysUtilsXception

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static class Xception
Methods
Name Description
Traverse(Exception)
Traverses the supplied exception.
Traverse(Exception, Boolean)
Traverses the supplied exception.
Traverse(Exception, Char)
Traverses the supplied exception.
Examples
This code demonstrates how to report an exception with Traverse(Exception, Char).
Copy
class Program
{
    static void Main()
    {
        // References
        object o = null;
        string s = string.Empty;

        try
        {
            // Assign to string having not instanciated o
            s = o.ToString();
        }
        catch (Exception exception)
        {
            // Exception handler prints out the messages and exception types of all exceptions in the exception stack.
            Console.WriteLine(Xception.Traverse(exception, true));
        }

        Console.ReadKey();
    }
}
Traverse(Exception, Char, Boolean)
Traverses the supplied exception.
Top
See Also

Reference

Bncs.SysUtils Namespace


Xception Methods

Xception Methods
Methods
Name Description
Traverse(Exception)
Traverses the supplied exception.
Traverse(Exception, Boolean)
Traverses the supplied exception.
Traverse(Exception, Char)
Traverses the supplied exception.
Examples
This code demonstrates how to report an exception with Traverse(Exception, Char).
Copy
class Program
{
    static void Main()
    {
        // References
        object o = null;
        string s = string.Empty;

        try
        {
            // Assign to string having not instanciated o
            s = o.ToString();
        }
        catch (Exception exception)
        {
            // Exception handler prints out the messages and exception types of all exceptions in the exception stack.
            Console.WriteLine(Xception.Traverse(exception, true));
        }

        Console.ReadKey();
    }
}
Traverse(Exception, Char, Boolean)
Traverses the supplied exception.
Top
See Also

Reference

Xception Class
Bncs.SysUtils Namespace


Xception.Traverse Method

XceptionTraverse Method
Overload List
Name Description
Traverse(Exception)
Traverses the supplied exception.
Traverse(Exception, Boolean)
Traverses the supplied exception.
Traverse(Exception, Char)
Traverses the supplied exception.
Examples
This code demonstrates how to report an exception with Traverse(Exception, Char).
Copy
class Program
{
    static void Main()
    {
        // References
        object o = null;
        string s = string.Empty;

        try
        {
            // Assign to string having not instanciated o
            s = o.ToString();
        }
        catch (Exception exception)
        {
            // Exception handler prints out the messages and exception types of all exceptions in the exception stack.
            Console.WriteLine(Xception.Traverse(exception, true));
        }

        Console.ReadKey();
    }
}
Traverse(Exception, Char, Boolean)
Traverses the supplied exception.
Top
See Also

Reference

Xception Class
Bncs.SysUtils Namespace


Xception.Traverse Method (Exception)

XceptionTraverse Method (Exception)
Traverses the supplied exception.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string Traverse(
    Exception exception_
)

Parameters

exception_
Type: SystemException
Exception to traverse.

Return Value

Type: String
A string representing not only the exception message but also those of its' inner exceptions.
See Also

Reference

Xception Class
Traverse Overload
Bncs.SysUtils Namespace


Xception.Traverse Method (Exception, Boolean)

XceptionTraverse Method (Exception, Boolean)
Traverses the supplied exception.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string Traverse(
    Exception exception_,
    bool returnExceptionTypes_
)

Parameters

exception_
Type: SystemException
Exception to traverse.
returnExceptionTypes_
Type: SystemBoolean
If true then the exception types for each exception in the stack are included in the returned message.

Return Value

Type: String
A string representing not only the exception message but also those of its' inner exceptions.
See Also

Reference

Xception Class
Traverse Overload
Bncs.SysUtils Namespace


Xception.Traverse Method (Exception, Char)

XceptionTraverse Method (Exception, Char)
Traverses the supplied exception.
Examples
This code demonstrates how to report an exception with Traverse(Exception, Char).
Copy
class Program
{
    static void Main()
    {
        // References
        object o = null;
        string s = string.Empty;

        try
        {
            // Assign to string having not instanciated o
            s = o.ToString();
        }
        catch (Exception exception)
        {
            // Exception handler prints out the messages and exception types of all exceptions in the exception stack.
            Console.WriteLine(Xception.Traverse(exception, true));
        }

        Console.ReadKey();
    }
}

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string Traverse(
    Exception exception_,
    char delimiter_
)

Parameters

exception_
Type: SystemException
Exception to traverse.
delimiter_
Type: SystemChar
Delimiter charachter to seperate the exception messages.

Return Value

Type: String
A string representing not only the exception message but also those of its' inner exceptions.
See Also

Reference

Xception Class
Traverse Overload
Bncs.SysUtils Namespace


Xception.Traverse Method (Exception, Char, Boolean)

XceptionTraverse Method (Exception, Char, Boolean)
Traverses the supplied exception.

Namespace: Bncs.SysUtils
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string Traverse(
    Exception exception_,
    char delimiter_,
    bool returnExceptionTypes_
)

Parameters

exception_
Type: SystemException
Exception to traverse.
delimiter_
Type: SystemChar
Delimiter charachter to seperate the exception messages.
returnExceptionTypes_
Type: SystemBoolean
If true then the exception types for each exception in the stack are included in the returned message.

Return Value

Type: String
A string representing not only the exception message but also those of its' inner exceptions.
See Also

Reference

Xception Class
Traverse Overload
Bncs.SysUtils Namespace


Bncs.WPF Namespace

Bncs.WPF Namespace
This namespace has classes for easy retreval of data from your WPF program and a Windows messagie handling class for trapping system messages.
Classes
 | Class | Description
Public class | WPFApplication | A Application derivitive that adds a number of handy information features for a WPF application.
Public class | WPFMessageHandler | A wrapper class to simplify system message handling to a WPF window.
Public class | WPFMessageHandlerException | An exception class for the WPFMessageHandler class.
Delegates
 | Delegate | Description
Public delegate | OnMessageEventHandler | Event delegate for the WPFMessageHandler class.


OnMessageEventHandler Delegate

OnMessageEventHandler Delegate
Event delegate for the WPFMessageHandler class.

Namespace: Bncs.WPF
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate IntPtr OnMessageEventHandler(
    IntPtr hwnd,
    int msg,
    IntPtr wParam,
    IntPtr lParam,
    ref bool handled
)

Parameters

hwnd
Type: SystemIntPtr
Handle
msg
Type: SystemInt32
Message
wParam
Type: SystemIntPtr
WParam
lParam
Type: SystemIntPtr
LParam
handled
Type: SystemBoolean
Handled flag

Return Value

Type: IntPtr
A Windows handle.
See Also

Reference

Bncs.WPF Namespace


WPFApplication Class

WPFApplication Class
A Application derivitive that adds a number of handy information features for a WPF application.
Inheritance Hierarchy
SystemObject
System.Windows.ThreadingDispatcherObject
System.WindowsApplication
Bncs.WPFWPFApplication

Namespace: Bncs.WPF
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class WPFApplication : Application

The WPFApplication type exposes the following members.

Constructors
 | Name | Description
Public method | WPFApplication | Initializes a new instance of the WPFApplication class
Top
Methods
Name Description
AboutBox(String)
WPF applcation About box displaying the driver title
Examples
This code demonstrates how to show an About box with application version number using a driver name.
Copy
static void Main()
{
    About("My BNCS Driver");
}
AboutBox(String, Int32)
WPF applcation About box displaying the driver title and copyright information
Examples
This code demonstrates how to show an About box with application version number using a driver name and copyright.
Copy
static void Main()
{
    About("My BNCS Driver", 2007);
}
AboutBox(String, String, Int32)
WPF applcation About box displaying the driver title, copyright information and BNCS Library DLL version
Examples
This code demonstrates how to show an About box with application and library DLL version numbers using a driver name, path to DLL and copyright.
Copy
static void Main()
{
    About("My BNCS Driver", @"c:\bncs\windows\lib\bncslib.dll", 2007);
}
AboutBox(String, String, String, Int32)
WPF applcation About box displaying the driver title, copyright information, BNCS control and BNCS Library DLL versions
Examples
This code demonstrates how to show an About box with application and library and visual control library DLL version numbers using a driver name, path to DLL and copyright.
Copy
static void Main()
{
    About("My BNCS Driver", @"c:\bncs\windows\lib\bncslib.dll", @"c:\bncs\windows\lib\bncscontrollib.dll", 2007);
}
AboutBox(String, String, String, Int32, DictionaryString, String)
WPF applcation About box displaying the driver title, copyright information, BNCS control and BNCS Library DLL versions
Examples
This code demonstrates how to show an About box with application and library and visual control library DLL version numbers using a driver name, path to DLL and copyright.
Copy
static void Main()
{
    About("My BNCS Driver", @"c:\bncs\windows\lib\bncslib.dll", @"c:\bncs\windows\lib\bncscontrollib.dll", 2007);
}
Public method CheckAccess
Determines whether the calling thread has access to this DispatcherObject.
(Inherited from DispatcherObject.)
CheckDLLVersion
Checks a loaded DLL's version number against a minimum required version.
Examples
This code demonstrates how to check a DLL version against a known minimum requirement.
Copy
static void Main()
{
    string minimumRequiredVersion = "6.5";
    if (CheckDLLVersion(@"c:\bncs\lib\bncslib.dll", minimumRequiredVersion)
        Console.WriteLine("The DLL loaded is compatable");
    else
        Console.WriteLine("The DLL loaded is not compatable, you need a minimum DLL version of " + minimumRequiredVersion);
}
DoEvents
Forces a UI update
Examples
This code demonstrates how to report various data elements pertaining to the current WPF application to a list box.
Copy
public partial class MainWindow : Window
{
    // In constructor add some data about this application to the list box
    public MainWindow()
    {
        InitializeComponent();

        // Common application data path
        listBox.Items.Add(WPFApplication.CommonAppDataPath);
        // Curent applications start up URI
        listBox.Items.Add(WPFApplication.Current.StartupUri);
        // Executable name
        listBox.Items.Add(WPFApplication.ExecutableName);
        // Executable path
        listBox.Items.Add(WPFApplication.ExecutablePath);
        // Product name
        listBox.Items.Add(WPFApplication.ProductName);
        // Product version
        listBox.Items.Add(WPFApplication.ProductVersion);
        // Start up path
        listBox.Items.Add(WPFApplication.StartupPath);

        // Force an update
        WPFApplication.DoEvents();
    }
}
Public method Equals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public method FindResource
Searches for a user interface (UI) resource, such as a Style or Brush, with the specified key, and throws an exception if the requested resource is not found (see Resources Overview).
(Inherited from Application.)
Public method GetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method Run
Starts a Windows Presentation Foundation (WPF) application.
(Inherited from Application.)
Public method Run(Window)
Starts a Windows Presentation Foundation (WPF) application and opens the specified window.
(Inherited from Application.)
Public method Shutdown
Shuts down an application.
(Inherited from Application.)
Public method Shutdown(Int32)
Shuts down an application that returns the specified exit code to the operating system.
(Inherited from Application.)
Public method ToString
Returns a string that represents the current object.
(Inherited from Object.)
Public method TryFindResource
Searches for the specified resource.
(Inherited from Application.)
Public method VerifyAccess
Enforces that the calling thread has access to this DispatcherObject.
(Inherited from DispatcherObject.)
Top
Properties
Name Description
CommonAppDataPath
Gets the path for the application data that is shared among all users
Examples
This code demonstrates how to report various data elements pertaining to the current WPF application to a list box.
Copy
public partial class MainWindow : Window
{
    // In constructor add some data about this application to the list box
    public MainWindow()
    {
        InitializeComponent();

        // Common application data path
        listBox.Items.Add(WPFApplication.CommonAppDataPath);
        // Curent applications start up URI
        listBox.Items.Add(WPFApplication.Current.StartupUri);
        // Executable name
        listBox.Items.Add(WPFApplication.ExecutableName);
        // Executable path
        listBox.Items.Add(WPFApplication.ExecutablePath);
        // Product name
        listBox.Items.Add(WPFApplication.ProductName);
        // Product version
        listBox.Items.Add(WPFApplication.ProductVersion);
        // Start up path
        listBox.Items.Add(WPFApplication.StartupPath);

        // Force an update
        WPFApplication.DoEvents();
    }
}
CommonAppDataRegistry
Gets the registry key for the application data that is shared among all users
CompanyName
Gets the company name associated with this application
Public property Dispatcher
Gets the Dispatcher this DispatcherObject is associated with.
(Inherited from DispatcherObject.)
ExecutableName
Gets the executable file name that started the application, NOT including the path
Examples
This code demonstrates how to report various data elements pertaining to the current WPF application to a list box.
Copy
public partial class MainWindow : Window
{
    // In constructor add some data about this application to the list box
    public MainWindow()
    {
        InitializeComponent();

        // Common application data path
        listBox.Items.Add(WPFApplication.CommonAppDataPath);
        // Curent applications start up URI
        listBox.Items.Add(WPFApplication.Current.StartupUri);
        // Executable name
        listBox.Items.Add(WPFApplication.ExecutableName);
        // Executable path
        listBox.Items.Add(WPFApplication.ExecutablePath);
        // Product name
        listBox.Items.Add(WPFApplication.ProductName);
        // Product version
        listBox.Items.Add(WPFApplication.ProductVersion);
        // Start up path
        listBox.Items.Add(WPFApplication.StartupPath);

        // Force an update
        WPFApplication.DoEvents();
    }
}
ExecutablePath
Gets the executable file that started the application, including the executable name
Examples
This code demonstrates how to report various data elements pertaining to the current WPF application to a list box.
Copy
public partial class MainWindow : Window
{
    // In constructor add some data about this application to the list box
    public MainWindow()
    {
        InitializeComponent();

        // Common application data path
        listBox.Items.Add(WPFApplication.CommonAppDataPath);
        // Curent applications start up URI
        listBox.Items.Add(WPFApplication.Current.StartupUri);
        // Executable name
        listBox.Items.Add(WPFApplication.ExecutableName);
        // Executable path
        listBox.Items.Add(WPFApplication.ExecutablePath);
        // Product name
        listBox.Items.Add(WPFApplication.ProductName);
        // Product version
        listBox.Items.Add(WPFApplication.ProductVersion);
        // Start up path
        listBox.Items.Add(WPFApplication.StartupPath);

        // Force an update
        WPFApplication.DoEvents();
    }
}
Handle
Gets the main window handle of the application.
Public property MainWindow
Gets or sets the main window of the application.
(Inherited from Application.)
ProductName
Gets the product name associated with this application
Examples
This code demonstrates how to report various data elements pertaining to the current WPF application to a list box.
Copy
public partial class MainWindow : Window
{
    // In constructor add some data about this application to the list box
    public MainWindow()
    {
        InitializeComponent();

        // Common application data path
        listBox.Items.Add(WPFApplication.CommonAppDataPath);
        // Curent applications start up URI
        listBox.Items.Add(WPFApplication.Current.StartupUri);
        // Executable name
        listBox.Items.Add(WPFApplication.ExecutableName);
        // Executable path
        listBox.Items.Add(WPFApplication.ExecutablePath);
        // Product name
        listBox.Items.Add(WPFApplication.ProductName);
        // Product version
        listBox.Items.Add(WPFApplication.ProductVersion);
        // Start up path
        listBox.Items.Add(WPFApplication.StartupPath);

        // Force an update
        WPFApplication.DoEvents();
    }
}
ProductVersion
Gets the product version associated with this application
Examples
This code demonstrates how to report various data elements pertaining to the current WPF application to a list box.
Copy
public partial class MainWindow : Window
{
    // In constructor add some data about this application to the list box
    public MainWindow()
    {
        InitializeComponent();

        // Common application data path
        listBox.Items.Add(WPFApplication.CommonAppDataPath);
        // Curent applications start up URI
        listBox.Items.Add(WPFApplication.Current.StartupUri);
        // Executable name
        listBox.Items.Add(WPFApplication.ExecutableName);
        // Executable path
        listBox.Items.Add(WPFApplication.ExecutablePath);
        // Product name
        listBox.Items.Add(WPFApplication.ProductName);
        // Product version
        listBox.Items.Add(WPFApplication.ProductVersion);
        // Start up path
        listBox.Items.Add(WPFApplication.StartupPath);

        // Force an update
        WPFApplication.DoEvents();
    }
}
Public property Properties
Gets a collection of application-scope properties.
(Inherited from Application.)
Public property Resources
Gets or sets a collection of application-scope resources, such as styles and brushes.
(Inherited from Application.)
Public property ShutdownMode
Gets or sets the condition that causes the Shutdown method to be called.
(Inherited from Application.)
StartupPath
Gets the path for the executable file that started the application, NOT including the executable name
Examples
This code demonstrates how to report various data elements pertaining to the current WPF application to a list box.
Copy
public partial class MainWindow : Window
{
    // In constructor add some data about this application to the list box
    public MainWindow()
    {
        InitializeComponent();

        // Common application data path
        listBox.Items.Add(WPFApplication.CommonAppDataPath);
        // Curent applications start up URI
        listBox.Items.Add(WPFApplication.Current.StartupUri);
        // Executable name
        listBox.Items.Add(WPFApplication.ExecutableName);
        // Executable path
        listBox.Items.Add(WPFApplication.ExecutablePath);
        // Product name
        listBox.Items.Add(WPFApplication.ProductName);
        // Product version
        listBox.Items.Add(WPFApplication.ProductVersion);
        // Start up path
        listBox.Items.Add(WPFApplication.StartupPath);

        // Force an update
        WPFApplication.DoEvents();
    }
}
Public property StartupUri
Gets or sets a UI that is automatically shown when an application starts.
(Inherited from Application.)
ThreadID
Gets the current thread ID.
UserAppDataPath
Gets the path for the application data of a user
UserAppDataRegistry
Gets the registry key for the application data of a user
Public property Windows
Gets the instantiated windows in an application.
(Inherited from Application.)
Top
Events
 | Name | Description
Public event | Activated | Occurs when an application becomes the foreground application. (Inherited from Application.)
Public event | Deactivated | Occurs when an application stops being the foreground application. (Inherited from Application.)
Public event | DispatcherUnhandledException | Occurs when an exception is thrown by an application but not handled. (Inherited from Application.)
Public event | Exit | Occurs just before an application shuts down, and cannot be canceled. (Inherited from Application.)
Public event | FragmentNavigation | Occurs when a navigator in the application begins navigation to a content fragment, Navigation occurs immediately if the desired fragment is in the current content, or after the source XAML content has been loaded if the desired fragment is in different content. (Inherited from Application.)
Public event | LoadCompleted | Occurs when content that was navigated to by a navigator in the application has been loaded, parsed, and has begun rendering. (Inherited from Application.)
Public event | Navigated | Occurs when the content that is being navigated to by a navigator in the application has been found, although it may not have completed loading. (Inherited from Application.)
Public event | Navigating | Occurs when a new navigation is requested by a navigator in the application. (Inherited from Application.)
Public event | NavigationFailed | Occurs when an error occurs while a navigator in the application is navigating to the requested content. (Inherited from Application.)
Public event | NavigationProgress | Occurs periodically during a download that is being managed by a navigator in the application to provide navigation progress information. (Inherited from Application.)
Public event | NavigationStopped | Occurs when the StopLoading method of a navigator in the application is called, or when a new navigation is requested by a navigator while a current navigation is in progress. (Inherited from Application.)
Public event | SessionEnding | Occurs when the user ends the Windows session by logging off or shutting down the operating system. (Inherited from Application.)
Public event | Startup | Occurs when the Run method of the Application object is called. (Inherited from Application.)
Top
See Also

Reference

Bncs.WPF Namespace


WPFApplication Constructor

WPFApplication Constructor
Initializes a new instance of the WPFApplication class

Namespace: Bncs.WPF
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public WPFApplication()
See Also

Reference

WPFApplication Class
Bncs.WPF Namespace


WPFApplication Methods

WPFApplication Methods

The WPFApplication type exposes the following members.

Methods
Name Description
AboutBox(String)
WPF applcation About box displaying the driver title
Examples
This code demonstrates how to show an About box with application version number using a driver name.
Copy
static void Main()
{
    About("My BNCS Driver");
}
AboutBox(String, Int32)
WPF applcation About box displaying the driver title and copyright information
Examples
This code demonstrates how to show an About box with application version number using a driver name and copyright.
Copy
static void Main()
{
    About("My BNCS Driver", 2007);
}
AboutBox(String, String, Int32)
WPF applcation About box displaying the driver title, copyright information and BNCS Library DLL version
Examples
This code demonstrates how to show an About box with application and library DLL version numbers using a driver name, path to DLL and copyright.
Copy
static void Main()
{
    About("My BNCS Driver", @"c:\bncs\windows\lib\bncslib.dll", 2007);
}
AboutBox(String, String, String, Int32)
WPF applcation About box displaying the driver title, copyright information, BNCS control and BNCS Library DLL versions
Examples
This code demonstrates how to show an About box with application and library and visual control library DLL version numbers using a driver name, path to DLL and copyright.
Copy
static void Main()
{
    About("My BNCS Driver", @"c:\bncs\windows\lib\bncslib.dll", @"c:\bncs\windows\lib\bncscontrollib.dll", 2007);
}
AboutBox(String, String, String, Int32, DictionaryString, String)
WPF applcation About box displaying the driver title, copyright information, BNCS control and BNCS Library DLL versions
Examples
This code demonstrates how to show an About box with application and library and visual control library DLL version numbers using a driver name, path to DLL and copyright.
Copy
static void Main()
{
    About("My BNCS Driver", @"c:\bncs\windows\lib\bncslib.dll", @"c:\bncs\windows\lib\bncscontrollib.dll", 2007);
}
Public method CheckAccess
Determines whether the calling thread has access to this DispatcherObject.
(Inherited from DispatcherObject.)
CheckDLLVersion
Checks a loaded DLL's version number against a minimum required version.
Examples
This code demonstrates how to check a DLL version against a known minimum requirement.
Copy
static void Main()
{
    string minimumRequiredVersion = "6.5";
    if (CheckDLLVersion(@"c:\bncs\lib\bncslib.dll", minimumRequiredVersion)
        Console.WriteLine("The DLL loaded is compatable");
    else
        Console.WriteLine("The DLL loaded is not compatable, you need a minimum DLL version of " + minimumRequiredVersion);
}
DoEvents
Forces a UI update
Examples
This code demonstrates how to report various data elements pertaining to the current WPF application to a list box.
Copy
public partial class MainWindow : Window
{
    // In constructor add some data about this application to the list box
    public MainWindow()
    {
        InitializeComponent();

        // Common application data path
        listBox.Items.Add(WPFApplication.CommonAppDataPath);
        // Curent applications start up URI
        listBox.Items.Add(WPFApplication.Current.StartupUri);
        // Executable name
        listBox.Items.Add(WPFApplication.ExecutableName);
        // Executable path
        listBox.Items.Add(WPFApplication.ExecutablePath);
        // Product name
        listBox.Items.Add(WPFApplication.ProductName);
        // Product version
        listBox.Items.Add(WPFApplication.ProductVersion);
        // Start up path
        listBox.Items.Add(WPFApplication.StartupPath);

        // Force an update
        WPFApplication.DoEvents();
    }
}
Public method Equals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public method FindResource
Searches for a user interface (UI) resource, such as a Style or Brush, with the specified key, and throws an exception if the requested resource is not found (see Resources Overview).
(Inherited from Application.)
Public method GetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method Run
Starts a Windows Presentation Foundation (WPF) application.
(Inherited from Application.)
Public method Run(Window)
Starts a Windows Presentation Foundation (WPF) application and opens the specified window.
(Inherited from Application.)
Public method Shutdown
Shuts down an application.
(Inherited from Application.)
Public method Shutdown(Int32)
Shuts down an application that returns the specified exit code to the operating system.
(Inherited from Application.)
Public method ToString
Returns a string that represents the current object.
(Inherited from Object.)
Public method TryFindResource
Searches for the specified resource.
(Inherited from Application.)
Public method VerifyAccess
Enforces that the calling thread has access to this DispatcherObject.
(Inherited from DispatcherObject.)
Top
See Also

Reference

WPFApplication Class
Bncs.WPF Namespace


WPFApplication.AboutBox Method

WPFApplicationAboutBox Method
Overload List
Name Description
AboutBox(String)
WPF applcation About box displaying the driver title
Examples
This code demonstrates how to show an About box with application version number using a driver name.
Copy
static void Main()
{
    About("My BNCS Driver");
}
AboutBox(String, Int32)
WPF applcation About box displaying the driver title and copyright information
Examples
This code demonstrates how to show an About box with application version number using a driver name and copyright.
Copy
static void Main()
{
    About("My BNCS Driver", 2007);
}
AboutBox(String, String, Int32)
WPF applcation About box displaying the driver title, copyright information and BNCS Library DLL version
Examples
This code demonstrates how to show an About box with application and library DLL version numbers using a driver name, path to DLL and copyright.
Copy
static void Main()
{
    About("My BNCS Driver", @"c:\bncs\windows\lib\bncslib.dll", 2007);
}
AboutBox(String, String, String, Int32)
WPF applcation About box displaying the driver title, copyright information, BNCS control and BNCS Library DLL versions
Examples
This code demonstrates how to show an About box with application and library and visual control library DLL version numbers using a driver name, path to DLL and copyright.
Copy
static void Main()
{
    About("My BNCS Driver", @"c:\bncs\windows\lib\bncslib.dll", @"c:\bncs\windows\lib\bncscontrollib.dll", 2007);
}
AboutBox(String, String, String, Int32, DictionaryString, String)
WPF applcation About box displaying the driver title, copyright information, BNCS control and BNCS Library DLL versions
Examples
This code demonstrates how to show an About box with application and library and visual control library DLL version numbers using a driver name, path to DLL and copyright.
Copy
static void Main()
{
    About("My BNCS Driver", @"c:\bncs\windows\lib\bncslib.dll", @"c:\bncs\windows\lib\bncscontrollib.dll", 2007);
}
Top
See Also

Reference

WPFApplication Class
Bncs.WPF Namespace


WPFApplication.AboutBox Method (String)

WPFApplicationAboutBox Method (String)
WPF applcation About box displaying the driver title
Examples
This code demonstrates how to show an About box with application version number using a driver name.
Copy
static void Main()
{
    About("My BNCS Driver");
}

Namespace: Bncs.WPF
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void AboutBox(
    string driverTitle_
)

Parameters

driverTitle_
Type: SystemString
Driver title
See Also

Reference

WPFApplication Class
AboutBox Overload
Bncs.WPF Namespace


WPFApplication.AboutBox Method (String, Int32)

WPFApplicationAboutBox Method (String, Int32)
WPF applcation About box displaying the driver title and copyright information
Examples
This code demonstrates how to show an About box with application version number using a driver name and copyright.
Copy
static void Main()
{
    About("My BNCS Driver", 2007);
}

Namespace: Bncs.WPF
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static void AboutBox(
    string driverTitle_,
    int originalCopyrightYear_
)

Parameters

driverTitle_
Type: SystemString
Driver title
originalCopyrightYear_
Type: SystemInt32
Original copyright year
See Also

Reference

WPFApplication Class
AboutBox Overload
Bncs.WPF Namespace


WPFApplication.AboutBox Method (String, String, Int32)

WPFApplicationAboutBox Method (String, String, Int32)
WPF applcation About box displaying the driver title, copyright information and BNCS Library DLL version
Examples
This code demonstrates how to show an About box with application and library DLL version numbers using a driver name, path to DLL and copyright.
Copy
static void Main()
{
    About("My BNCS Driver", @"c:\bncs\windows\lib\bncslib.dll", 2007);
}

Namespace: Bncs.WPF
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static void AboutBox(
    string driverTitle_,
    string bncsLibDLL_,
    int originalCopyrightYear_
)

Parameters

driverTitle_
Type: SystemString
Driver title
bncsLibDLL_
Type: SystemString
Path to BNCSLib.dll
originalCopyrightYear_
Type: SystemInt32
Original copyright year
See Also

Reference

WPFApplication Class
AboutBox Overload
Bncs.WPF Namespace


WPFApplication.AboutBox Method (String, String, String, Int32)

WPFApplicationAboutBox Method (String, String, String, Int32)
WPF applcation About box displaying the driver title, copyright information, BNCS control and BNCS Library DLL versions
Examples
This code demonstrates how to show an About box with application and library and visual control library DLL version numbers using a driver name, path to DLL and copyright.
Copy
static void Main()
{
    About("My BNCS Driver", @"c:\bncs\windows\lib\bncslib.dll", @"c:\bncs\windows\lib\bncscontrollib.dll", 2007);
}

Namespace: Bncs.WPF
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static void AboutBox(
    string driverTitle_,
    string bncsLibDLL_,
    string bncsControlLibDLL_,
    int originalCopyrightYear_
)

Parameters

driverTitle_
Type: SystemString
Driver title
bncsLibDLL_
Type: SystemString
Path to BNCSLib.dll
bncsControlLibDLL_
Type: SystemString
Path to BncsCtrlLib.dll
originalCopyrightYear_
Type: SystemInt32
Original copyright year
See Also

Reference

WPFApplication Class
AboutBox Overload
Bncs.WPF Namespace


WPFApplication.AboutBox Method (String, String, String, Int32, Dictionary(String, String))

WPFApplicationAboutBox Method (String, String, String, Int32, DictionaryString, String)
WPF applcation About box displaying the driver title, copyright information, BNCS control and BNCS Library DLL versions
Examples
This code demonstrates how to show an About box with application and library and visual control library DLL version numbers using a driver name, path to DLL and copyright.
Copy
static void Main()
{
    About("My BNCS Driver", @"c:\bncs\windows\lib\bncslib.dll", @"c:\bncs\windows\lib\bncscontrollib.dll", 2007);
}

Namespace: Bncs.WPF
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static void AboutBox(
    string driverTitle_,
    string bncsLibDLL_,
    string bncsControlLibDLL_,
    int originalCopyrightYear_,
    Dictionary<string, string> extraInfo_
)

Parameters

driverTitle_
Type: SystemString
Driver title
bncsLibDLL_
Type: SystemString
Path to BNCSLib.dll
bncsControlLibDLL_
Type: SystemString
Path to BncsCtrlLib.dll
originalCopyrightYear_
Type: SystemInt32
Original copyright year
extraInfo_
Type: System.Collections.GenericDictionary String, String
Extra information required for display, keys of zero length are ignored
See Also

Reference

WPFApplication Class
AboutBox Overload
Bncs.WPF Namespace


WPFApplication.CheckDLLVersion Method

WPFApplicationCheckDLLVersion Method
Checks a loaded DLL's version number against a minimum required version.
Examples
This code demonstrates how to check a DLL version against a known minimum requirement.
Copy
static void Main()
{
    string minimumRequiredVersion = "6.5";
    if (CheckDLLVersion(@"c:\bncs\lib\bncslib.dll", minimumRequiredVersion)
        Console.WriteLine("The DLL loaded is compatable");
    else
        Console.WriteLine("The DLL loaded is not compatable, you need a minimum DLL version of " + minimumRequiredVersion);
}

Namespace: Bncs.WPF
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static bool CheckDLLVersion(
    string dll_,
    string minimumRequiredVersion_
)

Parameters

dll_
Type: SystemString
DLL path/name
minimumRequiredVersion_
Type: SystemString
Minimum version number

Return Value

Type: Boolean
True if the supplied version number is equal to or greater than that loaded
See Also

Reference

WPFApplication Class
Bncs.WPF Namespace


WPFApplication.DoEvents Method

WPFApplicationDoEvents Method
Forces a UI update
Examples
This code demonstrates how to report various data elements pertaining to the current WPF application to a list box.
Copy
public partial class MainWindow : Window
{
    // In constructor add some data about this application to the list box
    public MainWindow()
    {
        InitializeComponent();

        // Common application data path
        listBox.Items.Add(WPFApplication.CommonAppDataPath);
        // Curent applications start up URI
        listBox.Items.Add(WPFApplication.Current.StartupUri);
        // Executable name
        listBox.Items.Add(WPFApplication.ExecutableName);
        // Executable path
        listBox.Items.Add(WPFApplication.ExecutablePath);
        // Product name
        listBox.Items.Add(WPFApplication.ProductName);
        // Product version
        listBox.Items.Add(WPFApplication.ProductVersion);
        // Start up path
        listBox.Items.Add(WPFApplication.StartupPath);

        // Force an update
        WPFApplication.DoEvents();
    }
}

Namespace: Bncs.WPF
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static void DoEvents()
See Also

Reference

WPFApplication Class
Bncs.WPF Namespace


WPFApplication Properties

WPFApplication Properties

The WPFApplication type exposes the following members.

Properties
Name Description
CommonAppDataPath
Gets the path for the application data that is shared among all users
Examples
This code demonstrates how to report various data elements pertaining to the current WPF application to a list box.
Copy
public partial class MainWindow : Window
{
    // In constructor add some data about this application to the list box
    public MainWindow()
    {
        InitializeComponent();

        // Common application data path
        listBox.Items.Add(WPFApplication.CommonAppDataPath);
        // Curent applications start up URI
        listBox.Items.Add(WPFApplication.Current.StartupUri);
        // Executable name
        listBox.Items.Add(WPFApplication.ExecutableName);
        // Executable path
        listBox.Items.Add(WPFApplication.ExecutablePath);
        // Product name
        listBox.Items.Add(WPFApplication.ProductName);
        // Product version
        listBox.Items.Add(WPFApplication.ProductVersion);
        // Start up path
        listBox.Items.Add(WPFApplication.StartupPath);

        // Force an update
        WPFApplication.DoEvents();
    }
}
CommonAppDataRegistry
Gets the registry key for the application data that is shared among all users
CompanyName
Gets the company name associated with this application
Public property Dispatcher
Gets the Dispatcher this DispatcherObject is associated with.
(Inherited from DispatcherObject.)
ExecutableName
Gets the executable file name that started the application, NOT including the path
Examples
This code demonstrates how to report various data elements pertaining to the current WPF application to a list box.
Copy
public partial class MainWindow : Window
{
    // In constructor add some data about this application to the list box
    public MainWindow()
    {
        InitializeComponent();

        // Common application data path
        listBox.Items.Add(WPFApplication.CommonAppDataPath);
        // Curent applications start up URI
        listBox.Items.Add(WPFApplication.Current.StartupUri);
        // Executable name
        listBox.Items.Add(WPFApplication.ExecutableName);
        // Executable path
        listBox.Items.Add(WPFApplication.ExecutablePath);
        // Product name
        listBox.Items.Add(WPFApplication.ProductName);
        // Product version
        listBox.Items.Add(WPFApplication.ProductVersion);
        // Start up path
        listBox.Items.Add(WPFApplication.StartupPath);

        // Force an update
        WPFApplication.DoEvents();
    }
}
ExecutablePath
Gets the executable file that started the application, including the executable name
Examples
This code demonstrates how to report various data elements pertaining to the current WPF application to a list box.
Copy
public partial class MainWindow : Window
{
    // In constructor add some data about this application to the list box
    public MainWindow()
    {
        InitializeComponent();

        // Common application data path
        listBox.Items.Add(WPFApplication.CommonAppDataPath);
        // Curent applications start up URI
        listBox.Items.Add(WPFApplication.Current.StartupUri);
        // Executable name
        listBox.Items.Add(WPFApplication.ExecutableName);
        // Executable path
        listBox.Items.Add(WPFApplication.ExecutablePath);
        // Product name
        listBox.Items.Add(WPFApplication.ProductName);
        // Product version
        listBox.Items.Add(WPFApplication.ProductVersion);
        // Start up path
        listBox.Items.Add(WPFApplication.StartupPath);

        // Force an update
        WPFApplication.DoEvents();
    }
}
Handle
Gets the main window handle of the application.
Public property MainWindow
Gets or sets the main window of the application.
(Inherited from Application.)
ProductName
Gets the product name associated with this application
Examples
This code demonstrates how to report various data elements pertaining to the current WPF application to a list box.
Copy
public partial class MainWindow : Window
{
    // In constructor add some data about this application to the list box
    public MainWindow()
    {
        InitializeComponent();

        // Common application data path
        listBox.Items.Add(WPFApplication.CommonAppDataPath);
        // Curent applications start up URI
        listBox.Items.Add(WPFApplication.Current.StartupUri);
        // Executable name
        listBox.Items.Add(WPFApplication.ExecutableName);
        // Executable path
        listBox.Items.Add(WPFApplication.ExecutablePath);
        // Product name
        listBox.Items.Add(WPFApplication.ProductName);
        // Product version
        listBox.Items.Add(WPFApplication.ProductVersion);
        // Start up path
        listBox.Items.Add(WPFApplication.StartupPath);

        // Force an update
        WPFApplication.DoEvents();
    }
}
ProductVersion
Gets the product version associated with this application
Examples
This code demonstrates how to report various data elements pertaining to the current WPF application to a list box.
Copy
public partial class MainWindow : Window
{
    // In constructor add some data about this application to the list box
    public MainWindow()
    {
        InitializeComponent();

        // Common application data path
        listBox.Items.Add(WPFApplication.CommonAppDataPath);
        // Curent applications start up URI
        listBox.Items.Add(WPFApplication.Current.StartupUri);
        // Executable name
        listBox.Items.Add(WPFApplication.ExecutableName);
        // Executable path
        listBox.Items.Add(WPFApplication.ExecutablePath);
        // Product name
        listBox.Items.Add(WPFApplication.ProductName);
        // Product version
        listBox.Items.Add(WPFApplication.ProductVersion);
        // Start up path
        listBox.Items.Add(WPFApplication.StartupPath);

        // Force an update
        WPFApplication.DoEvents();
    }
}
Public property Properties
Gets a collection of application-scope properties.
(Inherited from Application.)
Public property Resources
Gets or sets a collection of application-scope resources, such as styles and brushes.
(Inherited from Application.)
Public property ShutdownMode
Gets or sets the condition that causes the Shutdown method to be called.
(Inherited from Application.)
StartupPath
Gets the path for the executable file that started the application, NOT including the executable name
Examples
This code demonstrates how to report various data elements pertaining to the current WPF application to a list box.
Copy
public partial class MainWindow : Window
{
    // In constructor add some data about this application to the list box
    public MainWindow()
    {
        InitializeComponent();

        // Common application data path
        listBox.Items.Add(WPFApplication.CommonAppDataPath);
        // Curent applications start up URI
        listBox.Items.Add(WPFApplication.Current.StartupUri);
        // Executable name
        listBox.Items.Add(WPFApplication.ExecutableName);
        // Executable path
        listBox.Items.Add(WPFApplication.ExecutablePath);
        // Product name
        listBox.Items.Add(WPFApplication.ProductName);
        // Product version
        listBox.Items.Add(WPFApplication.ProductVersion);
        // Start up path
        listBox.Items.Add(WPFApplication.StartupPath);

        // Force an update
        WPFApplication.DoEvents();
    }
}
Public property StartupUri
Gets or sets a UI that is automatically shown when an application starts.
(Inherited from Application.)
ThreadID
Gets the current thread ID.
UserAppDataPath
Gets the path for the application data of a user
UserAppDataRegistry
Gets the registry key for the application data of a user
Public property Windows
Gets the instantiated windows in an application.
(Inherited from Application.)
Top
See Also

Reference

WPFApplication Class
Bncs.WPF Namespace


WPFApplication.CommonAppDataPath Property

WPFApplicationCommonAppDataPath Property
Gets the path for the application data that is shared among all users
Examples
This code demonstrates how to report various data elements pertaining to the current WPF application to a list box.
Copy
public partial class MainWindow : Window
{
    // In constructor add some data about this application to the list box
    public MainWindow()
    {
        InitializeComponent();

        // Common application data path
        listBox.Items.Add(WPFApplication.CommonAppDataPath);
        // Curent applications start up URI
        listBox.Items.Add(WPFApplication.Current.StartupUri);
        // Executable name
        listBox.Items.Add(WPFApplication.ExecutableName);
        // Executable path
        listBox.Items.Add(WPFApplication.ExecutablePath);
        // Product name
        listBox.Items.Add(WPFApplication.ProductName);
        // Product version
        listBox.Items.Add(WPFApplication.ProductVersion);
        // Start up path
        listBox.Items.Add(WPFApplication.StartupPath);

        // Force an update
        WPFApplication.DoEvents();
    }
}

Namespace: Bncs.WPF
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string CommonAppDataPath { get; }

Property Value

Type: String
See Also

Reference

WPFApplication Class
Bncs.WPF Namespace


WPFApplication.CommonAppDataRegistry Property

WPFApplicationCommonAppDataRegistry Property
Gets the registry key for the application data that is shared among all users

Namespace: Bncs.WPF
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static RegistryKey CommonAppDataRegistry { get; }

Property Value

Type: RegistryKey
See Also

Reference

WPFApplication Class
Bncs.WPF Namespace


WPFApplication.CompanyName Property

WPFApplicationCompanyName Property
Gets the company name associated with this application

Namespace: Bncs.WPF
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string CompanyName { get; }

Property Value

Type: String
See Also

Reference

WPFApplication Class
Bncs.WPF Namespace


WPFApplication.ExecutableName Property

WPFApplicationExecutableName Property
Gets the executable file name that started the application, NOT including the path
Examples
This code demonstrates how to report various data elements pertaining to the current WPF application to a list box.
Copy
public partial class MainWindow : Window
{
    // In constructor add some data about this application to the list box
    public MainWindow()
    {
        InitializeComponent();

        // Common application data path
        listBox.Items.Add(WPFApplication.CommonAppDataPath);
        // Curent applications start up URI
        listBox.Items.Add(WPFApplication.Current.StartupUri);
        // Executable name
        listBox.Items.Add(WPFApplication.ExecutableName);
        // Executable path
        listBox.Items.Add(WPFApplication.ExecutablePath);
        // Product name
        listBox.Items.Add(WPFApplication.ProductName);
        // Product version
        listBox.Items.Add(WPFApplication.ProductVersion);
        // Start up path
        listBox.Items.Add(WPFApplication.StartupPath);

        // Force an update
        WPFApplication.DoEvents();
    }
}

Namespace: Bncs.WPF
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string ExecutableName { get; }

Property Value

Type: String
See Also

Reference

WPFApplication Class
Bncs.WPF Namespace


WPFApplication.ExecutablePath Property

WPFApplicationExecutablePath Property
Gets the executable file that started the application, including the executable name
Examples
This code demonstrates how to report various data elements pertaining to the current WPF application to a list box.
Copy
public partial class MainWindow : Window
{
    // In constructor add some data about this application to the list box
    public MainWindow()
    {
        InitializeComponent();

        // Common application data path
        listBox.Items.Add(WPFApplication.CommonAppDataPath);
        // Curent applications start up URI
        listBox.Items.Add(WPFApplication.Current.StartupUri);
        // Executable name
        listBox.Items.Add(WPFApplication.ExecutableName);
        // Executable path
        listBox.Items.Add(WPFApplication.ExecutablePath);
        // Product name
        listBox.Items.Add(WPFApplication.ProductName);
        // Product version
        listBox.Items.Add(WPFApplication.ProductVersion);
        // Start up path
        listBox.Items.Add(WPFApplication.StartupPath);

        // Force an update
        WPFApplication.DoEvents();
    }
}

Namespace: Bncs.WPF
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string ExecutablePath { get; }

Property Value

Type: String
See Also

Reference

WPFApplication Class
Bncs.WPF Namespace


WPFApplication.Handle Property

WPFApplicationHandle Property
Gets the main window handle of the application.

Namespace: Bncs.WPF
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static IntPtr Handle { get; }

Property Value

Type: IntPtr
See Also

Reference

WPFApplication Class
Bncs.WPF Namespace


WPFApplication.ProductName Property

WPFApplicationProductName Property
Gets the product name associated with this application
Examples
This code demonstrates how to report various data elements pertaining to the current WPF application to a list box.
Copy
public partial class MainWindow : Window
{
    // In constructor add some data about this application to the list box
    public MainWindow()
    {
        InitializeComponent();

        // Common application data path
        listBox.Items.Add(WPFApplication.CommonAppDataPath);
        // Curent applications start up URI
        listBox.Items.Add(WPFApplication.Current.StartupUri);
        // Executable name
        listBox.Items.Add(WPFApplication.ExecutableName);
        // Executable path
        listBox.Items.Add(WPFApplication.ExecutablePath);
        // Product name
        listBox.Items.Add(WPFApplication.ProductName);
        // Product version
        listBox.Items.Add(WPFApplication.ProductVersion);
        // Start up path
        listBox.Items.Add(WPFApplication.StartupPath);

        // Force an update
        WPFApplication.DoEvents();
    }
}

Namespace: Bncs.WPF
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string ProductName { get; }

Property Value

Type: String
See Also

Reference

WPFApplication Class
Bncs.WPF Namespace


WPFApplication.ProductVersion Property

WPFApplicationProductVersion Property
Gets the product version associated with this application
Examples
This code demonstrates how to report various data elements pertaining to the current WPF application to a list box.
Copy
public partial class MainWindow : Window
{
    // In constructor add some data about this application to the list box
    public MainWindow()
    {
        InitializeComponent();

        // Common application data path
        listBox.Items.Add(WPFApplication.CommonAppDataPath);
        // Curent applications start up URI
        listBox.Items.Add(WPFApplication.Current.StartupUri);
        // Executable name
        listBox.Items.Add(WPFApplication.ExecutableName);
        // Executable path
        listBox.Items.Add(WPFApplication.ExecutablePath);
        // Product name
        listBox.Items.Add(WPFApplication.ProductName);
        // Product version
        listBox.Items.Add(WPFApplication.ProductVersion);
        // Start up path
        listBox.Items.Add(WPFApplication.StartupPath);

        // Force an update
        WPFApplication.DoEvents();
    }
}

Namespace: Bncs.WPF
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string ProductVersion { get; }

Property Value

Type: String
See Also

Reference

WPFApplication Class
Bncs.WPF Namespace


WPFApplication.StartupPath Property

WPFApplicationStartupPath Property
Gets the path for the executable file that started the application, NOT including the executable name
Examples
This code demonstrates how to report various data elements pertaining to the current WPF application to a list box.
Copy
public partial class MainWindow : Window
{
    // In constructor add some data about this application to the list box
    public MainWindow()
    {
        InitializeComponent();

        // Common application data path
        listBox.Items.Add(WPFApplication.CommonAppDataPath);
        // Curent applications start up URI
        listBox.Items.Add(WPFApplication.Current.StartupUri);
        // Executable name
        listBox.Items.Add(WPFApplication.ExecutableName);
        // Executable path
        listBox.Items.Add(WPFApplication.ExecutablePath);
        // Product name
        listBox.Items.Add(WPFApplication.ProductName);
        // Product version
        listBox.Items.Add(WPFApplication.ProductVersion);
        // Start up path
        listBox.Items.Add(WPFApplication.StartupPath);

        // Force an update
        WPFApplication.DoEvents();
    }
}

Namespace: Bncs.WPF
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string StartupPath { get; }

Property Value

Type: String
See Also

Reference

WPFApplication Class
Bncs.WPF Namespace


WPFApplication.ThreadID Property

WPFApplicationThreadID Property
Gets the current thread ID.

Namespace: Bncs.WPF
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static int ThreadID { get; }

Property Value

Type: Int32
See Also

Reference

WPFApplication Class
Bncs.WPF Namespace


WPFApplication.UserAppDataPath Property

WPFApplicationUserAppDataPath Property
Gets the path for the application data of a user

Namespace: Bncs.WPF
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static string UserAppDataPath { get; }

Property Value

Type: String
See Also

Reference

WPFApplication Class
Bncs.WPF Namespace


WPFApplication.UserAppDataRegistry Property

WPFApplicationUserAppDataRegistry Property
Gets the registry key for the application data of a user

Namespace: Bncs.WPF
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static RegistryKey UserAppDataRegistry { get; }

Property Value

Type: RegistryKey
See Also

Reference

WPFApplication Class
Bncs.WPF Namespace


WPFApplication Events

WPFApplication Events

The WPFApplication type exposes the following members.

Events
 | Name | Description
Public event | Activated | Occurs when an application becomes the foreground application. (Inherited from Application.)
Public event | Deactivated | Occurs when an application stops being the foreground application. (Inherited from Application.)
Public event | DispatcherUnhandledException | Occurs when an exception is thrown by an application but not handled. (Inherited from Application.)
Public event | Exit | Occurs just before an application shuts down, and cannot be canceled. (Inherited from Application.)
Public event | FragmentNavigation | Occurs when a navigator in the application begins navigation to a content fragment, Navigation occurs immediately if the desired fragment is in the current content, or after the source XAML content has been loaded if the desired fragment is in different content. (Inherited from Application.)
Public event | LoadCompleted | Occurs when content that was navigated to by a navigator in the application has been loaded, parsed, and has begun rendering. (Inherited from Application.)
Public event | Navigated | Occurs when the content that is being navigated to by a navigator in the application has been found, although it may not have completed loading. (Inherited from Application.)
Public event | Navigating | Occurs when a new navigation is requested by a navigator in the application. (Inherited from Application.)
Public event | NavigationFailed | Occurs when an error occurs while a navigator in the application is navigating to the requested content. (Inherited from Application.)
Public event | NavigationProgress | Occurs periodically during a download that is being managed by a navigator in the application to provide navigation progress information. (Inherited from Application.)
Public event | NavigationStopped | Occurs when the StopLoading method of a navigator in the application is called, or when a new navigation is requested by a navigator while a current navigation is in progress. (Inherited from Application.)
Public event | SessionEnding | Occurs when the user ends the Windows session by logging off or shutting down the operating system. (Inherited from Application.)
Public event | Startup | Occurs when the Run method of the Application object is called. (Inherited from Application.)
Top
See Also

Reference

WPFApplication Class
Bncs.WPF Namespace


WPFMessageHandler Class

WPFMessageHandler Class
A wrapper class to simplify system message handling to a WPF window.
Inheritance Hierarchy
SystemObject
Bncs.WPFWPFMessageHandler

Namespace: Bncs.WPF
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class WPFMessageHandler

The WPFMessageHandler type exposes the following members.

Constructors
Name Description
WPFMessageHandler
Constructor
Examples
This code demonstrates how to trap Windows system messages in a WPF application.
Copy
public partial class MainWindow : Window
{
    private WPFMessageHandler _handler = null;

    public MainWindow()
    {
        InitializeComponent();
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Once our app has loaded we may create our handler
        _handler = new WPFMessageHandler(this);
        // Hook up the OnMessage event handler.
        _handler.OnMessage += _handler_OnMessage;
    }

    // Event handler fires each time a Windows message comes in
    private IntPtr _handler_OnMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
    {
        // Add the message and parameters to a list box.
        listBox.Items.Add("Msg: " + msg.ToString() + " WParam: " + wParam.ToString() + " LParam: " + lParam.ToString());
        return _handler.Handle;
    }
}
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
Name Description
Handle
Gets the handle of the WPF window.
Examples
This code demonstrates how to trap Windows system messages in a WPF application.
Copy
public partial class MainWindow : Window
{
    private WPFMessageHandler _handler = null;

    public MainWindow()
    {
        InitializeComponent();
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Once our app has loaded we may create our handler
        _handler = new WPFMessageHandler(this);
        // Hook up the OnMessage event handler.
        _handler.OnMessage += _handler_OnMessage;
        // Show the handle in our title bar
        Title = _handler.Handle.ToString();
    }

    // Event handler fires each time a Windows message comes in
    private IntPtr _handler_OnMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
    {
        // Add the message and parameters to a list box.
        listBox.Items.Add("Msg: " + msg.ToString() + " WParam: " + wParam.ToString() + " LParam: " + lParam.ToString());
        return _handler.Handle;
    }
}
Top
Events
Name Description
OnMessage
Event handler that fires when a Windows message is received.
Examples
This code demonstrates how to trap Windows system messages in a WPF application.
Copy
public partial class MainWindow : Window
{
    private WPFMessageHandler _handler = null;

    public MainWindow()
    {
        InitializeComponent();
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Once our app has loaded we may create our handler
        _handler = new WPFMessageHandler(this);
        // Hook up the OnMessage event handler.
        _handler.OnMessage += _handler_OnMessage;
    }

    // Event handler fires each time a Windows message comes in
    private IntPtr _handler_OnMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
    {
        // Add the message and parameters to a list box.
        listBox.Items.Add("Msg: " + msg.ToString() + " WParam: " + wParam.ToString() + " LParam: " + lParam.ToString());
        return _handler.Handle;
    }
}
Top
See Also

Reference

Bncs.WPF Namespace


WPFMessageHandler Constructor

WPFMessageHandler Constructor
Constructor
Examples
This code demonstrates how to trap Windows system messages in a WPF application.
Copy
public partial class MainWindow : Window
{
    private WPFMessageHandler _handler = null;

    public MainWindow()
    {
        InitializeComponent();
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Once our app has loaded we may create our handler
        _handler = new WPFMessageHandler(this);
        // Hook up the OnMessage event handler.
        _handler.OnMessage += _handler_OnMessage;
    }

    // Event handler fires each time a Windows message comes in
    private IntPtr _handler_OnMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
    {
        // Add the message and parameters to a list box.
        listBox.Items.Add("Msg: " + msg.ToString() + " WParam: " + wParam.ToString() + " LParam: " + lParam.ToString());
        return _handler.Handle;
    }
}

Namespace: Bncs.WPF
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public WPFMessageHandler(
    Window window_
)

Parameters

window_
Type: System.WindowsWindow
Window instance to report messages from.
See Also

Reference

WPFMessageHandler Class
Bncs.WPF Namespace


WPFMessageHandler Methods

WPFMessageHandler Methods

The WPFMessageHandler type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

WPFMessageHandler Class
Bncs.WPF Namespace


WPFMessageHandler Properties

WPFMessageHandler Properties

The WPFMessageHandler type exposes the following members.

Properties
Name Description
Handle
Gets the handle of the WPF window.
Examples
This code demonstrates how to trap Windows system messages in a WPF application.
Copy
public partial class MainWindow : Window
{
    private WPFMessageHandler _handler = null;

    public MainWindow()
    {
        InitializeComponent();
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Once our app has loaded we may create our handler
        _handler = new WPFMessageHandler(this);
        // Hook up the OnMessage event handler.
        _handler.OnMessage += _handler_OnMessage;
        // Show the handle in our title bar
        Title = _handler.Handle.ToString();
    }

    // Event handler fires each time a Windows message comes in
    private IntPtr _handler_OnMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
    {
        // Add the message and parameters to a list box.
        listBox.Items.Add("Msg: " + msg.ToString() + " WParam: " + wParam.ToString() + " LParam: " + lParam.ToString());
        return _handler.Handle;
    }
}
Top
See Also

Reference

WPFMessageHandler Class
Bncs.WPF Namespace


WPFMessageHandler.Handle Property

WPFMessageHandlerHandle Property
Gets the handle of the WPF window.
Examples
This code demonstrates how to trap Windows system messages in a WPF application.
Copy
public partial class MainWindow : Window
{
    private WPFMessageHandler _handler = null;

    public MainWindow()
    {
        InitializeComponent();
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Once our app has loaded we may create our handler
        _handler = new WPFMessageHandler(this);
        // Hook up the OnMessage event handler.
        _handler.OnMessage += _handler_OnMessage;
        // Show the handle in our title bar
        Title = _handler.Handle.ToString();
    }

    // Event handler fires each time a Windows message comes in
    private IntPtr _handler_OnMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
    {
        // Add the message and parameters to a list box.
        listBox.Items.Add("Msg: " + msg.ToString() + " WParam: " + wParam.ToString() + " LParam: " + lParam.ToString());
        return _handler.Handle;
    }
}

Namespace: Bncs.WPF
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public IntPtr Handle { get; }

Property Value

Type: IntPtr
See Also

Reference

WPFMessageHandler Class
Bncs.WPF Namespace


WPFMessageHandler Events

WPFMessageHandler Events

The WPFMessageHandler type exposes the following members.

Events
Name Description
OnMessage
Event handler that fires when a Windows message is received.
Examples
This code demonstrates how to trap Windows system messages in a WPF application.
Copy
public partial class MainWindow : Window
{
    private WPFMessageHandler _handler = null;

    public MainWindow()
    {
        InitializeComponent();
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Once our app has loaded we may create our handler
        _handler = new WPFMessageHandler(this);
        // Hook up the OnMessage event handler.
        _handler.OnMessage += _handler_OnMessage;
    }

    // Event handler fires each time a Windows message comes in
    private IntPtr _handler_OnMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
    {
        // Add the message and parameters to a list box.
        listBox.Items.Add("Msg: " + msg.ToString() + " WParam: " + wParam.ToString() + " LParam: " + lParam.ToString());
        return _handler.Handle;
    }
}
Top
See Also

Reference

WPFMessageHandler Class
Bncs.WPF Namespace


WPFMessageHandler.OnMessage Event

WPFMessageHandlerOnMessage Event
Event handler that fires when a Windows message is received.
Examples
This code demonstrates how to trap Windows system messages in a WPF application.
Copy
public partial class MainWindow : Window
{
    private WPFMessageHandler _handler = null;

    public MainWindow()
    {
        InitializeComponent();
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Once our app has loaded we may create our handler
        _handler = new WPFMessageHandler(this);
        // Hook up the OnMessage event handler.
        _handler.OnMessage += _handler_OnMessage;
    }

    // Event handler fires each time a Windows message comes in
    private IntPtr _handler_OnMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
    {
        // Add the message and parameters to a list box.
        listBox.Items.Add("Msg: " + msg.ToString() + " WParam: " + wParam.ToString() + " LParam: " + lParam.ToString());
        return _handler.Handle;
    }
}

Namespace: Bncs.WPF
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event OnMessageEventHandler OnMessage

Value

Type: Bncs.WPFOnMessageEventHandler
See Also

Reference

WPFMessageHandler Class
Bncs.WPF Namespace


WPFMessageHandlerException Class

WPFMessageHandlerException Class
An exception class for the WPFMessageHandler class.
Inheritance Hierarchy
SystemObject
SystemException
Bncs.WPFWPFMessageHandlerException

Namespace: Bncs.WPF
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class WPFMessageHandlerException : Exception

The WPFMessageHandlerException type exposes the following members.

Constructors
 | Name | Description
Public method | WPFMessageHandlerException | Constructor
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetBaseException | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions. (Inherited from Exception.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetObjectData | When overridden in a derived class, sets the SerializationInfo with information about the exception. (Inherited from Exception.)
Public method | GetType | Gets the runtime type of the current instance. (Inherited from Exception.)
Public method | ToString | Creates and returns a string representation of the current exception. (Inherited from Exception.)
Top
Properties
 | Name | Description
Public property | Data | Gets a collection of key/value pairs that provide additional user-defined information about the exception. (Inherited from Exception.)
Public property | HelpLink | Gets or sets a link to the help file associated with this exception. (Inherited from Exception.)
Public property | InnerException | Gets the Exception instance that caused the current exception. (Inherited from Exception.)
Public property | Message | Gets a message that describes the current exception. (Inherited from Exception.)
Public property | Source | Gets or sets the name of the application or the object that causes the error. (Inherited from Exception.)
Public property | StackTrace | Gets a string representation of the immediate frames on the call stack. (Inherited from Exception.)
Public property | TargetSite | Gets the method that throws the current exception. (Inherited from Exception.)
Top
See Also

Reference

Bncs.WPF Namespace


WPFMessageHandlerException Constructor

WPFMessageHandlerException Constructor
Constructor

Namespace: Bncs.WPF
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public WPFMessageHandlerException(
    string message_
)

Parameters

message_
Type: SystemString
Exception message
See Also

Reference

WPFMessageHandlerException Class
Bncs.WPF Namespace


WPFMessageHandlerException Methods

WPFMessageHandlerException Methods

The WPFMessageHandlerException type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetBaseException | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions. (Inherited from Exception.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetObjectData | When overridden in a derived class, sets the SerializationInfo with information about the exception. (Inherited from Exception.)
Public method | GetType | Gets the runtime type of the current instance. (Inherited from Exception.)
Public method | ToString | Creates and returns a string representation of the current exception. (Inherited from Exception.)
Top
See Also

Reference

WPFMessageHandlerException Class
Bncs.WPF Namespace


WPFMessageHandlerException Properties

WPFMessageHandlerException Properties

The WPFMessageHandlerException type exposes the following members.

Properties
 | Name | Description
Public property | Data | Gets a collection of key/value pairs that provide additional user-defined information about the exception. (Inherited from Exception.)
Public property | HelpLink | Gets or sets a link to the help file associated with this exception. (Inherited from Exception.)
Public property | InnerException | Gets the Exception instance that caused the current exception. (Inherited from Exception.)
Public property | Message | Gets a message that describes the current exception. (Inherited from Exception.)
Public property | Source | Gets or sets the name of the application or the object that causes the error. (Inherited from Exception.)
Public property | StackTrace | Gets a string representation of the immediate frames on the call stack. (Inherited from Exception.)
Public property | TargetSite | Gets the method that throws the current exception. (Inherited from Exception.)
Top
See Also

Reference

WPFMessageHandlerException Class
Bncs.WPF Namespace


Bncs.XML Namespace

Bncs.XML Namespace
This namespace has the base class used for serialising your objects to and deserialising them from file.
Classes
 | Class | Description
Public class | PersistedXML | A class that serializes/deserializes classes to and from XML files.


PersistedXML Class

PersistedXML Class
A class that serializes/deserializes classes to and from XML files.
Inheritance Hierarchy
SystemObject
Bncs.XMLPersistedXML
Bncs.CommsCommsSettings
Bncs.GraphicsPicture

Namespace: Bncs.XML
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
[SerializableAttribute]
public class PersistedXML

The PersistedXML type exposes the following members.

Constructors
Name Description
PersistedXML
Default constructor
Examples
This code demonstrates how to serialise/deserialise objects to and from disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File name to serialise/deserialise to/from
        const string filename = @"c:\MyObject.xml";
        // Our PersistedXML object
        MyObject myObject = null;
        // Debug message variable
        string debug;
        // New instance of object flag
        bool newInstance;

        // Check file exists ...
        if (FileFuncs.Exists(filename))
        {
            // ... it does so deserialise the onject ...
            myObject = ((MyObject)MyObject.Open(filename, typeof(MyObject), out debug, out newInstance));
            if (null == myObject) // we have a problem!
                Console.WriteLine("Deserialisation returned NULL: " + debug);
            else
            {
                // Report instance and data deserialised to user
                Console.WriteLine(newInstance ? "A new instance was initialised." : "Data deserialised from file ok.");
                if (myObject.IsValid)
                {
                    Console.WriteLine("Name: " + myObject.Name);
                    Console.WriteLine("Number: " + myObject.Number.ToString());
                }
                else
                    Console.WriteLine("Object could not be validated.");

                if (debug.Length > 0)
                    Console.WriteLine("Debug from deserialiser reads: \"" + debug + "\"");
            }
        }
        else
        {
            // ... it doesn't so create and then serialise the object ...
            myObject = new MyObject();
            // set some properties ...
            myObject.Name = "Fred";
            myObject.Number = 13;
            // Report object data to user
            Console.WriteLine("Name: " + myObject.Name);
            Console.WriteLine("Number: " + myObject.Number.ToString());
            // Serialise the object to disk file
            Console.WriteLine("Serialising to disk file...");
            if (myObject.Save(filename, out debug))
                // Alls well
                Console.WriteLine("Rerun this app to deserialise this object from disk file.");
            else
            {
                // Report deserialisation error
                string message = "Error serialising to disk file";
                if (myObject.SaveErrorMessage.Length > 0)
                    message += ": \"" + myObject.SaveErrorMessage + "\"";
                else if (debug.Length > 0)
                    message += ": \"" + debug + "\"";
                Console.WriteLine(message);
            }
        }

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }
}
Top
Methods
Name Description
Public method Equals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public method GetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Open(Byte, Type)
Deserialises an object from a byte stream.
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}
Open(String, Type)
Deserializes an object from an Xml file with no error information.
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}
Open(Byte, Type, Boolean)
Deserialises an object from a byte stream and passes back information if any.
Open(Byte, Type, String)
Deserialises an object from a byte stream and passes back information if any.
Open(String, Type, Boolean)
Deserializes an object from an Xml file with a new instance flag.
Open(String, Type, String)
Deserializes an object from an Xml file with no error information.
Open(String, Type, String)
Deserializes an object from an Xml file with error information.
Open(Byte, Type, String, Boolean)
Deserialises an object from a byte stream and passes back information if any and if a new instance was created and returned.
Open(String, Type, Boolean, String)
Deserializes an object from an Xml file with a new instance flag.
Open(String, Type, String, String)
Deserializes an object from an Xml file with error information.
Open(Byte, Type, String, Boolean, String)
Deserialises an object from a byte stream allowing the setting of the XML root name and passes back information if any and if a new instance was created and returned.
Open(String, Type, String, Boolean, String)
Deserializes an object from an Xml file with error information and a new instance flag.
Examples
This code demonstrates how to serialise/deserialise objects to and from disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File name to serialise/deserialise to/from
        const string filename = @"c:\MyObject.xml";
        // Our PersistedXML object
        MyObject myObject = null;
        // Debug message variable
        string debug;
        // New instance of object flag
        bool newInstance;

        // Check file exists ...
        if (FileFuncs.Exists(filename))
        {
            // ... it does so deserialise the onject ...
            myObject = ((MyObject)MyObject.Open(filename, typeof(MyObject), out debug, out newInstance));
            if (null == myObject) // we have a problem!
                Console.WriteLine("Deserialisation returned NULL: " + debug);
            else
            {
                // Report instance and data deserialised to user
                Console.WriteLine(newInstance ? "A new instance was initialised." : "Data deserialised from file ok.");
                if (myObject.IsValid)
                {
                    Console.WriteLine("Name: " + myObject.Name);
                    Console.WriteLine("Number: " + myObject.Number.ToString());
                }
                else
                    Console.WriteLine("Object could not be validated.");

                if (debug.Length > 0)
                    Console.WriteLine("Debug from deserialiser reads: \"" + debug + "\"");
            }
        }
        else
        {
            // ... it doesn't so create and then serialise the onject ...
            myObject = new MyObject();
            // set some properties ...
            myObject.Name = "Fred";
            myObject.Number = 13;
            // Report object data to user
            Console.WriteLine("Name: " + myObject.Name);
            Console.WriteLine("Number: " + myObject.Number.ToString());
            // Serialise the object to disk file
            Console.WriteLine("Serialising to disk file...");
            if (myObject.Save(filename, out debug))
                // Alls well
                Console.WriteLine("Rerun this app to deserialise this object from disk file.");
            else
            {
                // Report deserialisation error
                string message = "Error serialising to disk file";
                if (myObject.SaveErrorMessage.Length > 0)
                    message += ": \"" + myObject.SaveErrorMessage + "\"";
                else if (debug.Length > 0)
                    message += ": \"" + debug + "\"";
                Console.WriteLine(message);
            }
        }

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }
}
Public method Save
Serializes the repository to a NON-read only XML file providing that the Filename property has been set. Error information is accessable through the SaveErrorInformation property.
Save(String)
Serializes the repository to a NON-read only XML file with no error information.
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}
Public method Save(String, String)
Serializes the repository to a NON-read only XML file with no error information.
Save(String, String)
Serializes the repository to a NON-read only XML file with error information.
Examples
This code demonstrates how to serialise/deserialise objects to and from disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File name to serialise/deserialise to/from
        const string filename = @"c:\MyObject.xml";
        // Our PersistedXML object
        MyObject myObject = null;
        // Debug message variable
        string debug;
        // New instance of object flag
        bool newInstance;

        // Check file exists ...
        if (FileFuncs.Exists(filename))
        {
            // ... it does so deserialise the onject ...
            myObject = ((MyObject)MyObject.Open(filename, typeof(MyObject), out debug, out newInstance));
            if (null == myObject) // we have a problem!
                Console.WriteLine("Deserialisation returned NULL: " + debug);
            else
            {
                // Report instance and data deserialised to user
                Console.WriteLine(newInstance ? "A new instance was initialised." : "Data deserialised from file ok.");
                if (myObject.IsValid)
                {
                    Console.WriteLine("Name: " + myObject.Name);
                    Console.WriteLine("Number: " + myObject.Number.ToString());
                }
                else
                    Console.WriteLine("Object could not be validated.");

                if (debug.Length > 0)
                    Console.WriteLine("Debug from deserialiser reads: \"" + debug + "\"");
            }
        }
        else
        {
            // ... it doesn't so create and then serialise the onject ...
            myObject = new MyObject();
            // set some properties ...
            myObject.Name = "Fred";
            myObject.Number = 13;
            // Report object data to user
            Console.WriteLine("Name: " + myObject.Name);
            Console.WriteLine("Number: " + myObject.Number.ToString());
            // Serialise the object to disk file
            Console.WriteLine("Serialising to disk file...");
            if (myObject.Save(filename, out debug))
                // Alls well
                Console.WriteLine("Rerun this app to deserialise this object from disk file.");
            else
            {
                // Report deserialisation error
                string message = "Error serialising to disk file";
                if (myObject.SaveErrorMessage.Length > 0)
                    message += ": \"" + myObject.SaveErrorMessage + "\"";
                else if (debug.Length > 0)
                    message += ": \"" + debug + "\"";
                Console.WriteLine(message);
            }
        }

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }
}
Public method Save(String, String, Boolean)
Serializes the repository to an XML file with error information.
Public method Save(String, String, String)
Serializes the repository to a NON-read only XML file with error information.
Public method Save(String, String, Boolean, String)
Serializes the repository to an XML file with error information.
Public method Save(String, String, Boolean, Boolean, String)
Serializes the repository to an XML file with error information.
SaveToBuffer
Serializes the object to a buffer
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}
Public method SaveToBuffer(String)
Serializes the object to a buffer
Public method SaveToBuffer(String, String)
Serializes the object to a buffer
Public method ToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
Name Description
Public property Filename
Gets or sets the XML file name property.
SaveErrorMessage
Gets an error message set if the previous Save() operation failed.
Examples
This code demonstrates how to serialise/deserialise objects to and from disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File name to serialise/deserialise to/from
        const string filename = @"c:\MyObject.xml";
        // Our PersistedXML object
        MyObject myObject = null;
        // Debug message variable
        string debug;
        // New instance of object flag
        bool newInstance;

        // Check file exists ...
        if (FileFuncs.Exists(filename))
        {
            // ... it does so deserialise the onject ...
            myObject = ((MyObject)MyObject.Open(filename, typeof(MyObject), out debug, out newInstance));
            if (null == myObject) // we have a problem!
                Console.WriteLine("Deserialisation returned NULL: " + debug);
            else
            {
                // Report instance and data deserialised to user
                Console.WriteLine(newInstance ? "A new instance was initialised." : "Data deserialised from file ok.");
                if (myObject.IsValid)
                {
                    Console.WriteLine("Name: " + myObject.Name);
                    Console.WriteLine("Number: " + myObject.Number.ToString());
                }
                else
                    Console.WriteLine("Object could not be validated.");

                if (debug.Length > 0)
                    Console.WriteLine("Debug from deserialiser reads: \"" + debug + "\"");
            }
        }
        else
        {
            // ... it doesn't so create and then serialise the onject ...
            myObject = new MyObject();
            // set some properties ...
            myObject.Name = "Fred";
            myObject.Number = 13;
            // Report object data to user
            Console.WriteLine("Name: " + myObject.Name);
            Console.WriteLine("Number: " + myObject.Number.ToString());
            // Serialise the object to disk file
            Console.WriteLine("Serialising to disk file...");
            if (myObject.Save(filename, out debug))
                // Alls well
                Console.WriteLine("Rerun this app to deserialise this object from disk file.");
            else
            {
                // Report deserialisation error
                string message = "Error serialising to disk file";
                if (myObject.SaveErrorMessage.Length > 0)
                    message += ": \"" + myObject.SaveErrorMessage + "\"";
                else if (debug.Length > 0)
                    message += ": \"" + debug + "\"";
                Console.WriteLine(message);
            }
        }

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }
}
Top
See Also

Reference

Bncs.XML Namespace


PersistedXML Constructor

PersistedXML Constructor
Default constructor
Examples
This code demonstrates how to serialise/deserialise objects to and from disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File name to serialise/deserialise to/from
        const string filename = @"c:\MyObject.xml";
        // Our PersistedXML object
        MyObject myObject = null;
        // Debug message variable
        string debug;
        // New instance of object flag
        bool newInstance;

        // Check file exists ...
        if (FileFuncs.Exists(filename))
        {
            // ... it does so deserialise the onject ...
            myObject = ((MyObject)MyObject.Open(filename, typeof(MyObject), out debug, out newInstance));
            if (null == myObject) // we have a problem!
                Console.WriteLine("Deserialisation returned NULL: " + debug);
            else
            {
                // Report instance and data deserialised to user
                Console.WriteLine(newInstance ? "A new instance was initialised." : "Data deserialised from file ok.");
                if (myObject.IsValid)
                {
                    Console.WriteLine("Name: " + myObject.Name);
                    Console.WriteLine("Number: " + myObject.Number.ToString());
                }
                else
                    Console.WriteLine("Object could not be validated.");

                if (debug.Length > 0)
                    Console.WriteLine("Debug from deserialiser reads: \"" + debug + "\"");
            }
        }
        else
        {
            // ... it doesn't so create and then serialise the object ...
            myObject = new MyObject();
            // set some properties ...
            myObject.Name = "Fred";
            myObject.Number = 13;
            // Report object data to user
            Console.WriteLine("Name: " + myObject.Name);
            Console.WriteLine("Number: " + myObject.Number.ToString());
            // Serialise the object to disk file
            Console.WriteLine("Serialising to disk file...");
            if (myObject.Save(filename, out debug))
                // Alls well
                Console.WriteLine("Rerun this app to deserialise this object from disk file.");
            else
            {
                // Report deserialisation error
                string message = "Error serialising to disk file";
                if (myObject.SaveErrorMessage.Length > 0)
                    message += ": \"" + myObject.SaveErrorMessage + "\"";
                else if (debug.Length > 0)
                    message += ": \"" + debug + "\"";
                Console.WriteLine(message);
            }
        }

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }
}

Namespace: Bncs.XML
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public PersistedXML()
See Also

Reference

PersistedXML Class
Bncs.XML Namespace


PersistedXML Methods

PersistedXML Methods

The PersistedXML type exposes the following members.

Methods
Name Description
Public method Equals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public method GetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Open(Byte, Type)
Deserialises an object from a byte stream.
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}
Open(String, Type)
Deserializes an object from an Xml file with no error information.
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}
Open(Byte, Type, Boolean)
Deserialises an object from a byte stream and passes back information if any.
Open(Byte, Type, String)
Deserialises an object from a byte stream and passes back information if any.
Open(String, Type, Boolean)
Deserializes an object from an Xml file with a new instance flag.
Open(String, Type, String)
Deserializes an object from an Xml file with no error information.
Open(String, Type, String)
Deserializes an object from an Xml file with error information.
Open(Byte, Type, String, Boolean)
Deserialises an object from a byte stream and passes back information if any and if a new instance was created and returned.
Open(String, Type, Boolean, String)
Deserializes an object from an Xml file with a new instance flag.
Open(String, Type, String, String)
Deserializes an object from an Xml file with error information.
Open(Byte, Type, String, Boolean, String)
Deserialises an object from a byte stream allowing the setting of the XML root name and passes back information if any and if a new instance was created and returned.
Open(String, Type, String, Boolean, String)
Deserializes an object from an Xml file with error information and a new instance flag.
Examples
This code demonstrates how to serialise/deserialise objects to and from disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File name to serialise/deserialise to/from
        const string filename = @"c:\MyObject.xml";
        // Our PersistedXML object
        MyObject myObject = null;
        // Debug message variable
        string debug;
        // New instance of object flag
        bool newInstance;

        // Check file exists ...
        if (FileFuncs.Exists(filename))
        {
            // ... it does so deserialise the onject ...
            myObject = ((MyObject)MyObject.Open(filename, typeof(MyObject), out debug, out newInstance));
            if (null == myObject) // we have a problem!
                Console.WriteLine("Deserialisation returned NULL: " + debug);
            else
            {
                // Report instance and data deserialised to user
                Console.WriteLine(newInstance ? "A new instance was initialised." : "Data deserialised from file ok.");
                if (myObject.IsValid)
                {
                    Console.WriteLine("Name: " + myObject.Name);
                    Console.WriteLine("Number: " + myObject.Number.ToString());
                }
                else
                    Console.WriteLine("Object could not be validated.");

                if (debug.Length > 0)
                    Console.WriteLine("Debug from deserialiser reads: \"" + debug + "\"");
            }
        }
        else
        {
            // ... it doesn't so create and then serialise the onject ...
            myObject = new MyObject();
            // set some properties ...
            myObject.Name = "Fred";
            myObject.Number = 13;
            // Report object data to user
            Console.WriteLine("Name: " + myObject.Name);
            Console.WriteLine("Number: " + myObject.Number.ToString());
            // Serialise the object to disk file
            Console.WriteLine("Serialising to disk file...");
            if (myObject.Save(filename, out debug))
                // Alls well
                Console.WriteLine("Rerun this app to deserialise this object from disk file.");
            else
            {
                // Report deserialisation error
                string message = "Error serialising to disk file";
                if (myObject.SaveErrorMessage.Length > 0)
                    message += ": \"" + myObject.SaveErrorMessage + "\"";
                else if (debug.Length > 0)
                    message += ": \"" + debug + "\"";
                Console.WriteLine(message);
            }
        }

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }
}
Public method Save
Serializes the repository to a NON-read only XML file providing that the Filename property has been set. Error information is accessable through the SaveErrorInformation property.
Save(String)
Serializes the repository to a NON-read only XML file with no error information.
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}
Public method Save(String, String)
Serializes the repository to a NON-read only XML file with no error information.
Save(String, String)
Serializes the repository to a NON-read only XML file with error information.
Examples
This code demonstrates how to serialise/deserialise objects to and from disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File name to serialise/deserialise to/from
        const string filename = @"c:\MyObject.xml";
        // Our PersistedXML object
        MyObject myObject = null;
        // Debug message variable
        string debug;
        // New instance of object flag
        bool newInstance;

        // Check file exists ...
        if (FileFuncs.Exists(filename))
        {
            // ... it does so deserialise the onject ...
            myObject = ((MyObject)MyObject.Open(filename, typeof(MyObject), out debug, out newInstance));
            if (null == myObject) // we have a problem!
                Console.WriteLine("Deserialisation returned NULL: " + debug);
            else
            {
                // Report instance and data deserialised to user
                Console.WriteLine(newInstance ? "A new instance was initialised." : "Data deserialised from file ok.");
                if (myObject.IsValid)
                {
                    Console.WriteLine("Name: " + myObject.Name);
                    Console.WriteLine("Number: " + myObject.Number.ToString());
                }
                else
                    Console.WriteLine("Object could not be validated.");

                if (debug.Length > 0)
                    Console.WriteLine("Debug from deserialiser reads: \"" + debug + "\"");
            }
        }
        else
        {
            // ... it doesn't so create and then serialise the onject ...
            myObject = new MyObject();
            // set some properties ...
            myObject.Name = "Fred";
            myObject.Number = 13;
            // Report object data to user
            Console.WriteLine("Name: " + myObject.Name);
            Console.WriteLine("Number: " + myObject.Number.ToString());
            // Serialise the object to disk file
            Console.WriteLine("Serialising to disk file...");
            if (myObject.Save(filename, out debug))
                // Alls well
                Console.WriteLine("Rerun this app to deserialise this object from disk file.");
            else
            {
                // Report deserialisation error
                string message = "Error serialising to disk file";
                if (myObject.SaveErrorMessage.Length > 0)
                    message += ": \"" + myObject.SaveErrorMessage + "\"";
                else if (debug.Length > 0)
                    message += ": \"" + debug + "\"";
                Console.WriteLine(message);
            }
        }

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }
}
Public method Save(String, String, Boolean)
Serializes the repository to an XML file with error information.
Public method Save(String, String, String)
Serializes the repository to a NON-read only XML file with error information.
Public method Save(String, String, Boolean, String)
Serializes the repository to an XML file with error information.
Public method Save(String, String, Boolean, Boolean, String)
Serializes the repository to an XML file with error information.
SaveToBuffer
Serializes the object to a buffer
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}
Public method SaveToBuffer(String)
Serializes the object to a buffer
Public method SaveToBuffer(String, String)
Serializes the object to a buffer
Public method ToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
See Also

Reference

PersistedXML Class
Bncs.XML Namespace


PersistedXML.Open Method

PersistedXMLOpen Method
Overload List
Name Description
Open(Byte, Type)
Deserialises an object from a byte stream.
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}
Open(String, Type)
Deserializes an object from an Xml file with no error information.
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}
Open(Byte, Type, Boolean)
Deserialises an object from a byte stream and passes back information if any.
Open(Byte, Type, String)
Deserialises an object from a byte stream and passes back information if any.
Open(String, Type, Boolean)
Deserializes an object from an Xml file with a new instance flag.
Open(String, Type, String)
Deserializes an object from an Xml file with no error information.
Open(String, Type, String)
Deserializes an object from an Xml file with error information.
Open(Byte, Type, String, Boolean)
Deserialises an object from a byte stream and passes back information if any and if a new instance was created and returned.
Open(String, Type, Boolean, String)
Deserializes an object from an Xml file with a new instance flag.
Open(String, Type, String, String)
Deserializes an object from an Xml file with error information.
Open(Byte, Type, String, Boolean, String)
Deserialises an object from a byte stream allowing the setting of the XML root name and passes back information if any and if a new instance was created and returned.
Open(String, Type, String, Boolean, String)
Deserializes an object from an Xml file with error information and a new instance flag.
Examples
This code demonstrates how to serialise/deserialise objects to and from disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File name to serialise/deserialise to/from
        const string filename = @"c:\MyObject.xml";
        // Our PersistedXML object
        MyObject myObject = null;
        // Debug message variable
        string debug;
        // New instance of object flag
        bool newInstance;

        // Check file exists ...
        if (FileFuncs.Exists(filename))
        {
            // ... it does so deserialise the onject ...
            myObject = ((MyObject)MyObject.Open(filename, typeof(MyObject), out debug, out newInstance));
            if (null == myObject) // we have a problem!
                Console.WriteLine("Deserialisation returned NULL: " + debug);
            else
            {
                // Report instance and data deserialised to user
                Console.WriteLine(newInstance ? "A new instance was initialised." : "Data deserialised from file ok.");
                if (myObject.IsValid)
                {
                    Console.WriteLine("Name: " + myObject.Name);
                    Console.WriteLine("Number: " + myObject.Number.ToString());
                }
                else
                    Console.WriteLine("Object could not be validated.");

                if (debug.Length > 0)
                    Console.WriteLine("Debug from deserialiser reads: \"" + debug + "\"");
            }
        }
        else
        {
            // ... it doesn't so create and then serialise the onject ...
            myObject = new MyObject();
            // set some properties ...
            myObject.Name = "Fred";
            myObject.Number = 13;
            // Report object data to user
            Console.WriteLine("Name: " + myObject.Name);
            Console.WriteLine("Number: " + myObject.Number.ToString());
            // Serialise the object to disk file
            Console.WriteLine("Serialising to disk file...");
            if (myObject.Save(filename, out debug))
                // Alls well
                Console.WriteLine("Rerun this app to deserialise this object from disk file.");
            else
            {
                // Report deserialisation error
                string message = "Error serialising to disk file";
                if (myObject.SaveErrorMessage.Length > 0)
                    message += ": \"" + myObject.SaveErrorMessage + "\"";
                else if (debug.Length > 0)
                    message += ": \"" + debug + "\"";
                Console.WriteLine(message);
            }
        }

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }
}
Top
See Also

Reference

PersistedXML Class
Bncs.XML Namespace


PersistedXML.Open Method (Byte[], Type)

PersistedXMLOpen Method (Byte, Type)
Deserialises an object from a byte stream.
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}

Namespace: Bncs.XML
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static Object Open(
    byte[] content_,
    Type expectedType_
)

Parameters

content_
Type: SystemByte
Object as an array of bytes
expectedType_
Type: SystemType
Type to return

Return Value

Type: Object
An object instantiation from the provided content stream or a new instantiation. You will need to cast the result to the type specified in the expectedType_ argument.
See Also

Reference

PersistedXML Class
Open Overload
Bncs.XML Namespace


PersistedXML.Open Method (String, Type)

PersistedXMLOpen Method (String, Type)
Deserializes an object from an Xml file with no error information.
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}

Namespace: Bncs.XML
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static Object Open(
    string fileName_,
    Type expectedType_
)

Parameters

fileName_
Type: SystemString
Name of the file to read
expectedType_
Type: SystemType
Type to return

Return Value

Type: Object
An object instantiation from the provided file name or a new instantiation. You will need to cast the result to the type specified in the expectedType_ argument.
See Also

Reference

PersistedXML Class
Open Overload
Bncs.XML Namespace


PersistedXML.Open Method (Byte[], Type, Boolean)

PersistedXMLOpen Method (Byte, Type, Boolean)
Deserialises an object from a byte stream and passes back information if any.

Namespace: Bncs.XML
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static Object Open(
    byte[] content_,
    Type expectedType_,
    out bool newInstance_
)

Parameters

content_
Type: SystemByte
Object as an array of bytes
expectedType_
Type: SystemType
Type to return
newInstance_
Type: SystemBoolean
Returns true if a new empty instance was returned

Return Value

Type: Object
An object instantiation from the provided content stream or a new instantiation. You will need to cast the result to the type specified in the expectedType_ argument.
See Also

Reference

PersistedXML Class
Open Overload
Bncs.XML Namespace


PersistedXML.Open Method (Byte[], Type, String)

PersistedXMLOpen Method (Byte, Type, String)
Deserialises an object from a byte stream and passes back information if any.

Namespace: Bncs.XML
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static Object Open(
    byte[] content_,
    Type expectedType_,
    out string information_
)

Parameters

content_
Type: SystemByte
Object as an array of bytes
expectedType_
Type: SystemType
Type to return
information_
Type: SystemString
Extra information

Return Value

Type: Object
An object instantiation from the provided content stream or a new instantiation. You will need to cast the result to the type specified in the expectedType_ argument.
See Also

Reference

PersistedXML Class
Open Overload
Bncs.XML Namespace


PersistedXML.Open Method (String, Type, Boolean)

PersistedXMLOpen Method (String, Type, Boolean)
Deserializes an object from an Xml file with a new instance flag.

Namespace: Bncs.XML
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static Object Open(
    string fileName_,
    Type expectedType_,
    out bool newInstance_
)

Parameters

fileName_
Type: SystemString
Name of the file to read
expectedType_
Type: SystemType
Type to return
newInstance_
Type: SystemBoolean
Returns true if a new empty instance was returned

Return Value

Type: Object
An object instantiation from the provided file name or a new instantiation. You will need to cast the result to the type specified in the expectedType_ argument.
See Also

Reference

PersistedXML Class
Open Overload
Bncs.XML Namespace


PersistedXML.Open Method (String, Type, String)

PersistedXMLOpen Method (String, Type, String)
Deserializes an object from an Xml file with no error information.

Namespace: Bncs.XML
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static Object Open(
    string fileName_,
    Type expectedType_,
    string xmlRootName_
)

Parameters

fileName_
Type: SystemString
Name of the file to read
expectedType_
Type: SystemType
Type to return
xmlRootName_
Type: SystemString
The Name of the Root node if different from the class name

Return Value

Type: Object
An object instantiation from the provided file name or a new instantiation. You will need to cast the result to the type specified in the expectedType_ argument.
See Also

Reference

PersistedXML Class
Open Overload
Bncs.XML Namespace


PersistedXML.Open Method (String, Type, String)

PersistedXMLOpen Method (String, Type, String)
Deserializes an object from an Xml file with error information.

Namespace: Bncs.XML
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static Object Open(
    string fileName_,
    Type expectedType_,
    out string information_
)

Parameters

fileName_
Type: SystemString
Name of the file to read
expectedType_
Type: SystemType
Type to return
information_
Type: SystemString
Extra information

Return Value

Type: Object
An object instantiation from the provided file name or a new instantiation. You will need to cast the result to the type specified in the expectedType_ argument.
See Also

Reference

PersistedXML Class
Open Overload
Bncs.XML Namespace


PersistedXML.Open Method (Byte[], Type, String, Boolean)

PersistedXMLOpen Method (Byte, Type, String, Boolean)
Deserialises an object from a byte stream and passes back information if any and if a new instance was created and returned.

Namespace: Bncs.XML
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static Object Open(
    byte[] content_,
    Type expectedType_,
    out string information_,
    out bool newInstance_
)

Parameters

content_
Type: SystemByte
Object as an array of bytes
expectedType_
Type: SystemType
Type to return
information_
Type: SystemString
Extra information
newInstance_
Type: SystemBoolean
Returns true if a new empty instance was returned

Return Value

Type: Object
An object instantiation from the provided content stream or a new instantiation. You will need to cast the result to the type specified in the expectedType_ argument.
See Also

Reference

PersistedXML Class
Open Overload
Bncs.XML Namespace


PersistedXML.Open Method (String, Type, Boolean, String)

PersistedXMLOpen Method (String, Type, Boolean, String)
Deserializes an object from an Xml file with a new instance flag.

Namespace: Bncs.XML
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static Object Open(
    string fileName_,
    Type expectedType_,
    out bool newInstance_,
    string xmlRootName_
)

Parameters

fileName_
Type: SystemString
Name of the file to read
expectedType_
Type: SystemType
Type to return
newInstance_
Type: SystemBoolean
Returns true if a new empty instance was returned
xmlRootName_
Type: SystemString
The Name of the Root node if different from the class name

Return Value

Type: Object
An object instantiation from the provided file name or a new instantiation. You will need to cast the result to the type specified in the expectedType_ argument.
See Also

Reference

PersistedXML Class
Open Overload
Bncs.XML Namespace


PersistedXML.Open Method (String, Type, String, String)

PersistedXMLOpen Method (String, Type, String, String)
Deserializes an object from an Xml file with error information.

Namespace: Bncs.XML
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static Object Open(
    string fileName_,
    Type expectedType_,
    out string information_,
    string xmlRootName_
)

Parameters

fileName_
Type: SystemString
Name of the file to read
expectedType_
Type: SystemType
Type to return
information_
Type: SystemString
Extra information
xmlRootName_
Type: SystemString
The Name of the Root node if different from the class name

Return Value

Type: Object
An object instantiation from the provided file name or a new instantiation. You will need to cast the result to the type specified in the expectedType_ argument.
See Also

Reference

PersistedXML Class
Open Overload
Bncs.XML Namespace


PersistedXML.Open Method (Byte[], Type, String, Boolean, String)

PersistedXMLOpen Method (Byte, Type, String, Boolean, String)
Deserialises an object from a byte stream allowing the setting of the XML root name and passes back information if any and if a new instance was created and returned.

Namespace: Bncs.XML
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static Object Open(
    byte[] content_,
    Type expectedType_,
    out string information_,
    out bool newInstance_,
    string xmlRootName_ = ""
)

Parameters

content_
Type: SystemByte
Object as an array of bytes
expectedType_
Type: SystemType
Type to return
information_
Type: SystemString
Extra information
newInstance_
Type: SystemBoolean
Returns true if a new empty instance was returned
xmlRootName_ (Optional)
Type: SystemString
XML root node name

Return Value

Type: Object
An object instantiation from the provided content stream or a new instantiation. You will need to cast the result to the type specified in the expectedType_ argument.
See Also

Reference

PersistedXML Class
Open Overload
Bncs.XML Namespace


PersistedXML.Open Method (String, Type, String, Boolean, String)

PersistedXMLOpen Method (String, Type, String, Boolean, String)
Deserializes an object from an Xml file with error information and a new instance flag.
Examples
This code demonstrates how to serialise/deserialise objects to and from disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File name to serialise/deserialise to/from
        const string filename = @"c:\MyObject.xml";
        // Our PersistedXML object
        MyObject myObject = null;
        // Debug message variable
        string debug;
        // New instance of object flag
        bool newInstance;

        // Check file exists ...
        if (FileFuncs.Exists(filename))
        {
            // ... it does so deserialise the onject ...
            myObject = ((MyObject)MyObject.Open(filename, typeof(MyObject), out debug, out newInstance));
            if (null == myObject) // we have a problem!
                Console.WriteLine("Deserialisation returned NULL: " + debug);
            else
            {
                // Report instance and data deserialised to user
                Console.WriteLine(newInstance ? "A new instance was initialised." : "Data deserialised from file ok.");
                if (myObject.IsValid)
                {
                    Console.WriteLine("Name: " + myObject.Name);
                    Console.WriteLine("Number: " + myObject.Number.ToString());
                }
                else
                    Console.WriteLine("Object could not be validated.");

                if (debug.Length > 0)
                    Console.WriteLine("Debug from deserialiser reads: \"" + debug + "\"");
            }
        }
        else
        {
            // ... it doesn't so create and then serialise the onject ...
            myObject = new MyObject();
            // set some properties ...
            myObject.Name = "Fred";
            myObject.Number = 13;
            // Report object data to user
            Console.WriteLine("Name: " + myObject.Name);
            Console.WriteLine("Number: " + myObject.Number.ToString());
            // Serialise the object to disk file
            Console.WriteLine("Serialising to disk file...");
            if (myObject.Save(filename, out debug))
                // Alls well
                Console.WriteLine("Rerun this app to deserialise this object from disk file.");
            else
            {
                // Report deserialisation error
                string message = "Error serialising to disk file";
                if (myObject.SaveErrorMessage.Length > 0)
                    message += ": \"" + myObject.SaveErrorMessage + "\"";
                else if (debug.Length > 0)
                    message += ": \"" + debug + "\"";
                Console.WriteLine(message);
            }
        }

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }
}

Namespace: Bncs.XML
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static Object Open(
    string fileName_,
    Type expectedType_,
    out string information_,
    out bool newInstance_,
    string xmlRootName_ = ""
)

Parameters

fileName_
Type: SystemString
Name of the file to read
expectedType_
Type: SystemType
Type to return
information_
Type: SystemString
Extra information
newInstance_
Type: SystemBoolean
Returns true if a new empty instance was returned
xmlRootName_ (Optional)
Type: SystemString
The Name of the Root node if different from the class name

Return Value

Type: Object
An object instantiation from the provided file name or a new instantiation. You will need to cast the result to the type specified in the expectedType_ argument.
See Also

Reference

PersistedXML Class
Open Overload
Bncs.XML Namespace


PersistedXML.Save Method

PersistedXMLSave Method
Overload List
Name Description
Public method Save
Serializes the repository to a NON-read only XML file providing that the Filename property has been set. Error information is accessable through the SaveErrorInformation property.
Save(String)
Serializes the repository to a NON-read only XML file with no error information.
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}
Public method Save(String, String)
Serializes the repository to a NON-read only XML file with no error information.
Save(String, String)
Serializes the repository to a NON-read only XML file with error information.
Examples
This code demonstrates how to serialise/deserialise objects to and from disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File name to serialise/deserialise to/from
        const string filename = @"c:\MyObject.xml";
        // Our PersistedXML object
        MyObject myObject = null;
        // Debug message variable
        string debug;
        // New instance of object flag
        bool newInstance;

        // Check file exists ...
        if (FileFuncs.Exists(filename))
        {
            // ... it does so deserialise the onject ...
            myObject = ((MyObject)MyObject.Open(filename, typeof(MyObject), out debug, out newInstance));
            if (null == myObject) // we have a problem!
                Console.WriteLine("Deserialisation returned NULL: " + debug);
            else
            {
                // Report instance and data deserialised to user
                Console.WriteLine(newInstance ? "A new instance was initialised." : "Data deserialised from file ok.");
                if (myObject.IsValid)
                {
                    Console.WriteLine("Name: " + myObject.Name);
                    Console.WriteLine("Number: " + myObject.Number.ToString());
                }
                else
                    Console.WriteLine("Object could not be validated.");

                if (debug.Length > 0)
                    Console.WriteLine("Debug from deserialiser reads: \"" + debug + "\"");
            }
        }
        else
        {
            // ... it doesn't so create and then serialise the onject ...
            myObject = new MyObject();
            // set some properties ...
            myObject.Name = "Fred";
            myObject.Number = 13;
            // Report object data to user
            Console.WriteLine("Name: " + myObject.Name);
            Console.WriteLine("Number: " + myObject.Number.ToString());
            // Serialise the object to disk file
            Console.WriteLine("Serialising to disk file...");
            if (myObject.Save(filename, out debug))
                // Alls well
                Console.WriteLine("Rerun this app to deserialise this object from disk file.");
            else
            {
                // Report deserialisation error
                string message = "Error serialising to disk file";
                if (myObject.SaveErrorMessage.Length > 0)
                    message += ": \"" + myObject.SaveErrorMessage + "\"";
                else if (debug.Length > 0)
                    message += ": \"" + debug + "\"";
                Console.WriteLine(message);
            }
        }

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }
}
Public method Save(String, String, Boolean)
Serializes the repository to an XML file with error information.
Public method Save(String, String, String)
Serializes the repository to a NON-read only XML file with error information.
Public method Save(String, String, Boolean, String)
Serializes the repository to an XML file with error information.
Public method Save(String, String, Boolean, Boolean, String)
Serializes the repository to an XML file with error information.
Top
See Also

Reference

PersistedXML Class
Bncs.XML Namespace


PersistedXML.Save Method

PersistedXMLSave Method
Serializes the repository to a NON-read only XML file providing that the Filename property has been set. Error information is accessable through the SaveErrorInformation property.

Namespace: Bncs.XML
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Save()

Return Value

Type: Boolean
True on succes
See Also

Reference

PersistedXML Class
Save Overload
Bncs.XML Namespace


PersistedXML.Save Method (String)

PersistedXMLSave Method (String)
Serializes the repository to a NON-read only XML file with no error information.
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}

Namespace: Bncs.XML
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Save(
    string fileName_
)

Parameters

fileName_
Type: SystemString

[Missing <param name="fileName_"/> documentation for "M:Bncs.XML.PersistedXML.Save(System.String)"]

Return Value

Type: Boolean
True on success
See Also

Reference

PersistedXML Class
Save Overload
Bncs.XML Namespace


PersistedXML.Save Method (String, String)

PersistedXMLSave Method (String, String)
Serializes the repository to a NON-read only XML file with no error information.

Namespace: Bncs.XML
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Save(
    string fileName_,
    string xmlRootName_
)

Parameters

fileName_
Type: SystemString
File name to write to
xmlRootName_
Type: SystemString
The Name of the Root node if different from the class name

Return Value

Type: Boolean
True on success
See Also

Reference

PersistedXML Class
Save Overload
Bncs.XML Namespace


PersistedXML.Save Method (String, String)

PersistedXMLSave Method (String, String)
Serializes the repository to a NON-read only XML file with error information.
Examples
This code demonstrates how to serialise/deserialise objects to and from disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File name to serialise/deserialise to/from
        const string filename = @"c:\MyObject.xml";
        // Our PersistedXML object
        MyObject myObject = null;
        // Debug message variable
        string debug;
        // New instance of object flag
        bool newInstance;

        // Check file exists ...
        if (FileFuncs.Exists(filename))
        {
            // ... it does so deserialise the onject ...
            myObject = ((MyObject)MyObject.Open(filename, typeof(MyObject), out debug, out newInstance));
            if (null == myObject) // we have a problem!
                Console.WriteLine("Deserialisation returned NULL: " + debug);
            else
            {
                // Report instance and data deserialised to user
                Console.WriteLine(newInstance ? "A new instance was initialised." : "Data deserialised from file ok.");
                if (myObject.IsValid)
                {
                    Console.WriteLine("Name: " + myObject.Name);
                    Console.WriteLine("Number: " + myObject.Number.ToString());
                }
                else
                    Console.WriteLine("Object could not be validated.");

                if (debug.Length > 0)
                    Console.WriteLine("Debug from deserialiser reads: \"" + debug + "\"");
            }
        }
        else
        {
            // ... it doesn't so create and then serialise the onject ...
            myObject = new MyObject();
            // set some properties ...
            myObject.Name = "Fred";
            myObject.Number = 13;
            // Report object data to user
            Console.WriteLine("Name: " + myObject.Name);
            Console.WriteLine("Number: " + myObject.Number.ToString());
            // Serialise the object to disk file
            Console.WriteLine("Serialising to disk file...");
            if (myObject.Save(filename, out debug))
                // Alls well
                Console.WriteLine("Rerun this app to deserialise this object from disk file.");
            else
            {
                // Report deserialisation error
                string message = "Error serialising to disk file";
                if (myObject.SaveErrorMessage.Length > 0)
                    message += ": \"" + myObject.SaveErrorMessage + "\"";
                else if (debug.Length > 0)
                    message += ": \"" + debug + "\"";
                Console.WriteLine(message);
            }
        }

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }
}

Namespace: Bncs.XML
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Save(
    string fileName_,
    out string information_
)

Parameters

fileName_
Type: SystemString
File name to write to
information_
Type: SystemString
Extra information

Return Value

Type: Boolean
True on success
See Also

Reference

PersistedXML Class
Save Overload
Bncs.XML Namespace


PersistedXML.Save Method (String, String, Boolean)

PersistedXMLSave Method (String, String, Boolean)
Serializes the repository to an XML file with error information.

Namespace: Bncs.XML
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Save(
    string fileName_,
    out string information_,
    bool readOnly_
)

Parameters

fileName_
Type: SystemString
File name to write to
information_
Type: SystemString
Extra information
readOnly_
Type: SystemBoolean
If true the XML file is marked as read-only

Return Value

Type: Boolean
True on success
See Also

Reference

PersistedXML Class
Save Overload
Bncs.XML Namespace


PersistedXML.Save Method (String, String, String)

PersistedXMLSave Method (String, String, String)
Serializes the repository to a NON-read only XML file with error information.

Namespace: Bncs.XML
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Save(
    string fileName_,
    out string information_,
    string xmlRootName_
)

Parameters

fileName_
Type: SystemString
File name to write to
information_
Type: SystemString
Extra information
xmlRootName_
Type: SystemString
The Name of the Root node if different from the class name

Return Value

Type: Boolean
True on success
See Also

Reference

PersistedXML Class
Save Overload
Bncs.XML Namespace


PersistedXML.Save Method (String, String, Boolean, String)

PersistedXMLSave Method (String, String, Boolean, String)
Serializes the repository to an XML file with error information.

Namespace: Bncs.XML
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Save(
    string fileName_,
    out string information_,
    bool readOnly_,
    string xmlRootName_
)

Parameters

fileName_
Type: SystemString
File name to write to
information_
Type: SystemString
Extra information
readOnly_
Type: SystemBoolean
If true the XML file is marked as read-only
xmlRootName_
Type: SystemString
The Name of the Root node if different from the class name

Return Value

Type: Boolean
True on success
See Also

Reference

PersistedXML Class
Save Overload
Bncs.XML Namespace


PersistedXML.Save Method (String, String, Boolean, Boolean, String)

PersistedXMLSave Method (String, String, Boolean, Boolean, String)
Serializes the repository to an XML file with error information.

Namespace: Bncs.XML
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Save(
    string fileName_,
    out string information_,
    bool readOnly_,
    bool backup_,
    string xmlRootName_ = ""
)

Parameters

fileName_
Type: SystemString
File name to write to
information_
Type: SystemString
Extra information
readOnly_
Type: SystemBoolean
If true the XML file is marked as read-only
backup_
Type: SystemBoolean
If true the XML file is backed up during the write phase
xmlRootName_ (Optional)
Type: SystemString
The Name of the Root node if different from the class name

Return Value

Type: Boolean
True on success
See Also

Reference

PersistedXML Class
Save Overload
Bncs.XML Namespace


PersistedXML.SaveToBuffer Method

PersistedXMLSaveToBuffer Method
Overload List
Name Description
SaveToBuffer
Serializes the object to a buffer
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}
Public method SaveToBuffer(String)
Serializes the object to a buffer
Public method SaveToBuffer(String, String)
Serializes the object to a buffer
Top
See Also

Reference

PersistedXML Class
Bncs.XML Namespace


PersistedXML.SaveToBuffer Method

PersistedXMLSaveToBuffer Method
Serializes the object to a buffer
Examples
This code demonstrates how to deserialise an object, convert it to a byte stream and serialise the stream back to an identical disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File names to serialise/deserialise to/from
        const string filename1 = @"c:\MyObject.xml";
        const string filename2 = @"c:\MyObjectBuffer.xml";
        // Deserialise our PersistedXML object from file
        MyObject myObject = ((MyObject)MyObject.Open(filename1, typeof(MyObject)));
        if (null != myObject)
        {
            // Copy our object to an array of bytes
            byte[] objectStream = myObject.SaveToBuffer();
            // "Transmit" the bytes or, in this case, just send them to a method called Transmit() ... and read it back as a new MyObject instance ...
            MyObject myTransmittedObject = Transmit(objectStream);
            // Compare onject instances, they should be the same
            if (myTransmittedObject.Name.Equals(myObject.Name) && myTransmittedObject.Number == myObject.Number)
            {
                Console.WriteLine("Both objects are the same after transmission");
                // For demo purposes save the deserialised stream back to a second disk file, the two files should be identical
                myTransmittedObject.Save(filename2);
            }
            else
                Console.WriteLine("Unexpected difference in objects after transmission!");

        }
        else
            Console.WriteLine("Error deserialising object from disk file.");

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }

    // Fake "transmission" method, this of course could be over some form of wire
    static MyObject Transmit(byte[] buffer_)
    {
        // For debug purposes create a DataBuffer from the input buffer
        DataBuffer buffer = new DataBuffer(buffer_);
        // Print out the contents
        Console.WriteLine("MyObject received in a byte stream, looks like this:");
        foreach (string xmlLine in buffer.ToStrings())
            Console.WriteLine(xmlLine);
        // Now create a new MyObject instance from the stream ...
        MyObject myTransmittedObject = ((MyObject)MyObject.Open(buffer_, typeof(MyObject)));
        // ... and return it ...
        return myTransmittedObject;
    }
}

Namespace: Bncs.XML
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[] SaveToBuffer()

Return Value

Type: Byte
An array of bytes containing the serialized object
See Also

Reference

PersistedXML Class
SaveToBuffer Overload
Bncs.XML Namespace


PersistedXML.SaveToBuffer Method (String)

PersistedXMLSaveToBuffer Method (String)
Serializes the object to a buffer

Namespace: Bncs.XML
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[] SaveToBuffer(
    string xmlRootName_ = ""
)

Parameters

xmlRootName_ (Optional)
Type: SystemString
The Name of the Root node if different from the class name

Return Value

Type: Byte
An array of bytes containing the serialized object
See Also

Reference

PersistedXML Class
SaveToBuffer Overload
Bncs.XML Namespace


PersistedXML.SaveToBuffer Method (String, String)

PersistedXMLSaveToBuffer Method (String, String)
Serializes the object to a buffer

Namespace: Bncs.XML
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public byte[] SaveToBuffer(
    out string information_,
    string xmlRootName_ = ""
)

Parameters

information_
Type: SystemString
Extra information
xmlRootName_ (Optional)
Type: SystemString
The Name of the Root node if different from the class name

Return Value

Type: Byte
An array of bytes containing the serialized object
See Also

Reference

PersistedXML Class
SaveToBuffer Overload
Bncs.XML Namespace


PersistedXML Properties

PersistedXML Properties

The PersistedXML type exposes the following members.

Properties
Name Description
Public property Filename
Gets or sets the XML file name property.
SaveErrorMessage
Gets an error message set if the previous Save() operation failed.
Examples
This code demonstrates how to serialise/deserialise objects to and from disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File name to serialise/deserialise to/from
        const string filename = @"c:\MyObject.xml";
        // Our PersistedXML object
        MyObject myObject = null;
        // Debug message variable
        string debug;
        // New instance of object flag
        bool newInstance;

        // Check file exists ...
        if (FileFuncs.Exists(filename))
        {
            // ... it does so deserialise the onject ...
            myObject = ((MyObject)MyObject.Open(filename, typeof(MyObject), out debug, out newInstance));
            if (null == myObject) // we have a problem!
                Console.WriteLine("Deserialisation returned NULL: " + debug);
            else
            {
                // Report instance and data deserialised to user
                Console.WriteLine(newInstance ? "A new instance was initialised." : "Data deserialised from file ok.");
                if (myObject.IsValid)
                {
                    Console.WriteLine("Name: " + myObject.Name);
                    Console.WriteLine("Number: " + myObject.Number.ToString());
                }
                else
                    Console.WriteLine("Object could not be validated.");

                if (debug.Length > 0)
                    Console.WriteLine("Debug from deserialiser reads: \"" + debug + "\"");
            }
        }
        else
        {
            // ... it doesn't so create and then serialise the onject ...
            myObject = new MyObject();
            // set some properties ...
            myObject.Name = "Fred";
            myObject.Number = 13;
            // Report object data to user
            Console.WriteLine("Name: " + myObject.Name);
            Console.WriteLine("Number: " + myObject.Number.ToString());
            // Serialise the object to disk file
            Console.WriteLine("Serialising to disk file...");
            if (myObject.Save(filename, out debug))
                // Alls well
                Console.WriteLine("Rerun this app to deserialise this object from disk file.");
            else
            {
                // Report deserialisation error
                string message = "Error serialising to disk file";
                if (myObject.SaveErrorMessage.Length > 0)
                    message += ": \"" + myObject.SaveErrorMessage + "\"";
                else if (debug.Length > 0)
                    message += ": \"" + debug + "\"";
                Console.WriteLine(message);
            }
        }

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }
}
Top
See Also

Reference

PersistedXML Class
Bncs.XML Namespace


PersistedXML.Filename Property

PersistedXMLFilename Property
Gets or sets the XML file name property.

Namespace: Bncs.XML
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Filename { get; set; }

Property Value

Type: String
See Also

Reference

PersistedXML Class
Bncs.XML Namespace


PersistedXML.SaveErrorMessage Property

PersistedXMLSaveErrorMessage Property
Gets an error message set if the previous Save() operation failed.
Examples
This code demonstrates how to serialise/deserialise objects to and from disk file
Copy
// A simple test object
public class MyObject : PersistedXML
{
    // Field variables
    private string _name = string.Empty;
    private int _number = 0;

    // Public property that gets/sets the Name member
    [XmlAttribute("nme")]
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    // Public property that gets/sets the Number member
    [XmlAttribute("num")]
    public int Number
    {
        get { return _number; }
        set { _number = value; }
    }

    // Public r/o property returns true if the instance is validated
    [XmlIgnore]
    public bool IsValid
    {
        get { return _number > 0 && _name.Length > 0; }
    }
}

// Main program
class Program
{
    static void Main()
    {
        // File name to serialise/deserialise to/from
        const string filename = @"c:\MyObject.xml";
        // Our PersistedXML object
        MyObject myObject = null;
        // Debug message variable
        string debug;
        // New instance of object flag
        bool newInstance;

        // Check file exists ...
        if (FileFuncs.Exists(filename))
        {
            // ... it does so deserialise the onject ...
            myObject = ((MyObject)MyObject.Open(filename, typeof(MyObject), out debug, out newInstance));
            if (null == myObject) // we have a problem!
                Console.WriteLine("Deserialisation returned NULL: " + debug);
            else
            {
                // Report instance and data deserialised to user
                Console.WriteLine(newInstance ? "A new instance was initialised." : "Data deserialised from file ok.");
                if (myObject.IsValid)
                {
                    Console.WriteLine("Name: " + myObject.Name);
                    Console.WriteLine("Number: " + myObject.Number.ToString());
                }
                else
                    Console.WriteLine("Object could not be validated.");

                if (debug.Length > 0)
                    Console.WriteLine("Debug from deserialiser reads: \"" + debug + "\"");
            }
        }
        else
        {
            // ... it doesn't so create and then serialise the onject ...
            myObject = new MyObject();
            // set some properties ...
            myObject.Name = "Fred";
            myObject.Number = 13;
            // Report object data to user
            Console.WriteLine("Name: " + myObject.Name);
            Console.WriteLine("Number: " + myObject.Number.ToString());
            // Serialise the object to disk file
            Console.WriteLine("Serialising to disk file...");
            if (myObject.Save(filename, out debug))
                // Alls well
                Console.WriteLine("Rerun this app to deserialise this object from disk file.");
            else
            {
                // Report deserialisation error
                string message = "Error serialising to disk file";
                if (myObject.SaveErrorMessage.Length > 0)
                    message += ": \"" + myObject.SaveErrorMessage + "\"";
                else if (debug.Length > 0)
                    message += ": \"" + debug + "\"";
                Console.WriteLine(message);
            }
        }

        Console.Write("Press any key to close...");
        Console.ReadKey();
    }
}

Namespace: Bncs.XML
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string SaveErrorMessage { get; }

Property Value

Type: String
See Also

Reference

PersistedXML Class
Bncs.XML Namespace


DigitalGiles.AboutForm Namespace

DigitalGiles.AboutForm Namespace
A configurable WinForms about box.
Classes
 | Class | Description
Public class | aboutForm | Class encapsulating a standardised About Box for use with BNCS drivers and Automatics.


aboutForm Class

aboutForm Class
Class encapsulating a standardised About Box for use with BNCS drivers and Automatics.
Inheritance Hierarchy
SystemObject
SystemMarshalByRefObject
System.ComponentModelComponent
System.Windows.FormsControl
System.Windows.FormsScrollableControl
System.Windows.FormsContainerControl
System.Windows.FormsForm
DigitalGiles.AboutFormaboutForm

Namespace: DigitalGiles.AboutForm
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class aboutForm : Form

The aboutForm type exposes the following members.

Constructors
 | Name | Description
Public method | aboutForm | Constructor
Top
Methods
 | Name | Description
Public method | Activate | Activates the form and gives it focus. (Inherited from Form.)
Public method | AddOwnedForm | Adds an owned form to this form. (Inherited from Form.)
Public method | BeginInvoke(Delegate) | Executes the specified delegate asynchronously on the thread that the control's underlying handle was created on. (Inherited from Control.)
Public method | BeginInvoke(Delegate, Object) | Executes the specified delegate asynchronously with the specified arguments, on the thread that the control's underlying handle was created on. (Inherited from Control.)
Public method | BringToFront | Brings the control to the front of the z-order. (Inherited from Control.)
Public method | Close | Closes the form. (Inherited from Form.)
Public method | Contains | Retrieves a value indicating whether the specified control is a child of the control. (Inherited from Control.)
Public method | CreateControl | Forces the creation of the visible control, including the creation of the handle and any visible child controls. (Inherited from Control.)
Public method | CreateGraphics | Creates the Graphics for the control. (Inherited from Control.)
Public method | CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.)
Public method | Dispose | Releases all resources used by the Component. (Inherited from Component.)
Public method | DoDragDrop | Begins a drag-and-drop operation. (Inherited from Control.)
Public method | DrawToBitmap | Supports rendering to the specified bitmap. (Inherited from Control.)
Public method | EndInvoke | Retrieves the return value of the asynchronous operation represented by the IAsyncResult passed. (Inherited from Control.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | FindForm | Retrieves the form that the control is on. (Inherited from Control.)
Public method | Focus | Sets input focus to the control. (Inherited from Control.)
Public method | GetChildAtPoint(Point) | Retrieves the child control that is located at the specified coordinates. (Inherited from Control.)
Public method | GetChildAtPoint(Point, GetChildAtPointSkip) | Retrieves the child control that is located at the specified coordinates, specifying whether to ignore child controls of a certain type. (Inherited from Control.)
Public method | GetContainerControl | Returns the next ContainerControl up the control's chain of parent controls. (Inherited from Control.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Public method | GetNextControl | Retrieves the next control forward or back in the tab order of child controls. (Inherited from Control.)
Public method | GetPreferredSize | Retrieves the size of a rectangular area into which a control can be fitted. (Inherited from Control.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Hide | Conceals the control from the user. (Inherited from Control.)
Public method | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Public method | Invalidate | Invalidates the entire surface of the control and causes the control to be redrawn. (Inherited from Control.)
Public method | Invalidate(Region) | Invalidates the specified region of the control (adds it to the control's update region, which is the area that will be repainted at the next paint operation), and causes a paint message to be sent to the control. (Inherited from Control.)
Public method | Invalidate(Boolean) | Invalidates a specific region of the control and causes a paint message to be sent to the control. Optionally, invalidates the child controls assigned to the control. (Inherited from Control.)
Public method | Invalidate(Rectangle) | Invalidates the specified region of the control (adds it to the control's update region, which is the area that will be repainted at the next paint operation), and causes a paint message to be sent to the control. (Inherited from Control.)
Public method | Invalidate(Region, Boolean) | Invalidates the specified region of the control (adds it to the control's update region, which is the area that will be repainted at the next paint operation), and causes a paint message to be sent to the control. Optionally, invalidates the child controls assigned to the control. (Inherited from Control.)
Public method | Invalidate(Rectangle, Boolean) | Invalidates the specified region of the control (adds it to the control's update region, which is the area that will be repainted at the next paint operation), and causes a paint message to be sent to the control. Optionally, invalidates the child controls assigned to the control. (Inherited from Control.)
Public method | Invoke(Delegate) | Executes the specified delegate on the thread that owns the control's underlying window handle. (Inherited from Control.)
Public method | Invoke(Delegate, Object) | Executes the specified delegate, on the thread that owns the control's underlying window handle, with the specified list of arguments. (Inherited from Control.)
Public method | LayoutMdi | Arranges the multiple-document interface (MDI) child forms within the MDI parent form. (Inherited from Form.)
Public method | PerformAutoScale | Performs scaling of the container control and its children. (Inherited from ContainerControl.)
Public method | PerformLayout | Forces the control to apply layout logic to all its child controls. (Inherited from Control.)
Public method | PerformLayout(Control, String) | Forces the control to apply layout logic to all its child controls. (Inherited from Control.)
Public method | PointToClient | Computes the location of the specified screen point into client coordinates. (Inherited from Control.)
Public method | PointToScreen | Computes the location of the specified client point into screen coordinates. (Inherited from Control.)
Public method | PreProcessControlMessage | Preprocesses keyboard or input messages within the message loop before they are dispatched. (Inherited from Control.)
Public method | PreProcessMessage | Preprocesses keyboard or input messages within the message loop before they are dispatched. (Inherited from Control.)
Public method | RectangleToClient | Computes the size and location of the specified screen rectangle in client coordinates. (Inherited from Control.)
Public method | RectangleToScreen | Computes the size and location of the specified client rectangle in screen coordinates. (Inherited from Control.)
Public method | Refresh | Forces the control to invalidate its client area and immediately redraw itself and any child controls. (Inherited from Control.)
Public method | RemoveOwnedForm | Removes an owned form from this form. (Inherited from Form.)
Public method | ResetBackColor | Resets the BackColor property to its default value. (Inherited from Control.)
Public method | ResetBindings | Causes a control bound to the BindingSource to reread all the items in the list and refresh their displayed values. (Inherited from Control.)
Public method | ResetCursor | Resets the Cursor property to its default value. (Inherited from Control.)
Public method | ResetFont | Resets the Font property to its default value. (Inherited from Control.)
Public method | ResetForeColor | Resets the ForeColor property to its default value. (Inherited from Control.)
Public method | ResetImeMode | Resets the ImeMode property to its default value. (Inherited from Control.)
Public method | ResetRightToLeft | Resets the RightToLeft property to its default value. (Inherited from Control.)
Public method | ResetText | Resets the Text property to its default value. (Inherited from Control.)
Public method | ResumeLayout | Resumes usual layout logic. (Inherited from Control.)
Public method | ResumeLayout(Boolean) | Resumes usual layout logic, optionally forcing an immediate layout of pending layout requests. (Inherited from Control.)
Public method | Scale(Single) | Obsolete. Scales the control and any child controls. (Inherited from Control.)
Public method | Scale(SizeF) | Scales the control and all child controls by the specified scaling factor. (Inherited from Control.)
Public method | Scale(Single, Single) | Obsolete. Scales the entire control and any child controls. (Inherited from Control.)
Public method | ScrollControlIntoView | Scrolls the specified child control into view on an auto-scroll enabled control. (Inherited from ScrollableControl.)
Public method | Select | Activates the control. (Inherited from Control.)
Public method | SelectNextControl | Activates the next control. (Inherited from Control.)
Public method | SendToBack | Sends the control to the back of the z-order. (Inherited from Control.)
Public method | SetAutoScrollMargin | Sets the size of the auto-scroll margins. (Inherited from ScrollableControl.)
Public method | SetBounds(Int32, Int32, Int32, Int32) | Sets the bounds of the control to the specified location and size. (Inherited from Control.)
Public method | SetBounds(Int32, Int32, Int32, Int32, BoundsSpecified) | Sets the specified bounds of the control to the specified location and size. (Inherited from Control.)
Public method | SetDesktopBounds | Sets the bounds of the form in desktop coordinates. (Inherited from Form.)
Public method | SetDesktopLocation | Sets the location of the form in desktop coordinates. (Inherited from Form.)
Public method | SetDetails | Confiugure the information displayed on the AboutForm
Public method | Show | Displays the control to the user. (Inherited from Control.)
Public method | Show(IWin32Window) | Shows the form with the specified owner to the user. (Inherited from Form.)
Public method | ShowDialog | Shows the form as a modal dialog box. (Inherited from Form.)
Public method | ShowDialog(IWin32Window) | Shows the form as a modal dialog box with the specified owner. (Inherited from Form.)
Public method | SuspendLayout | Temporarily suspends the layout logic for the control. (Inherited from Control.)
Public method | ToString | Gets a string representing the current instance of the form. (Inherited from Form.)
Public method | Update | Causes the control to redraw the invalidated regions within its client area. (Inherited from Control.)
Public method | Validate | Verifies the value of the control losing focus by causing the Validating and Validated events to occur, in that order. (Inherited from ContainerControl.)
Public method | Validate(Boolean) | Verifies the value of the control that is losing focus; conditionally dependent on whether automatic validation is turned on. (Inherited from ContainerControl.)
Public method | ValidateChildren | (Inherited from Form.)
Public method | ValidateChildren(ValidationConstraints) | (Inherited from Form.)
Top
Properties
 | Name | Description
Public property | AcceptButton | Gets or sets the button on the form that is clicked when the user presses the ENTER key. (Inherited from Form.)
Public property | AccessibilityObject | Gets the AccessibleObject assigned to the control. (Inherited from Control.)
Public property | AccessibleDefaultActionDescription | Gets or sets the default action description of the control for use by accessibility client applications. (Inherited from Control.)
Public property | AccessibleDescription | Gets or sets the description of the control used by accessibility client applications. (Inherited from Control.)
Public property | AccessibleName | Gets or sets the name of the control used by accessibility client applications. (Inherited from Control.)
Public property | AccessibleRole | Gets or sets the accessible role of the control (Inherited from Control.)
Public property | ActiveControl | Gets or sets the active control on the container control. (Inherited from ContainerControl.)
Public property | ActiveMdiChild | Gets the currently active multiple-document interface (MDI) child window. (Inherited from Form.)
Public property | AllowDrop | Gets or sets a value indicating whether the control can accept data that the user drags onto it. (Inherited from Control.)
Public property | AllowTransparency | Gets or sets a value indicating whether the opacity of the form can be adjusted. (Inherited from Form.)
Public property | Anchor | Gets or sets the edges of the container to which a control is bound and determines how a control is resized with its parent. (Inherited from Control.)
Public property | AutoScale | Obsolete. Gets or sets a value indicating whether the form adjusts its size to fit the height of the font used on the form and scales its controls. (Inherited from Form.)
Public property | AutoScaleBaseSize | Gets or sets the base size used for autoscaling of the form. (Inherited from Form.)
Public property | AutoScaleDimensions | Gets or sets the dimensions that the control was designed to. (Inherited from ContainerControl.)
Public property | AutoScaleMode | Gets or sets the automatic scaling mode of the control. (Inherited from ContainerControl.)
Public property | AutoScroll | Gets or sets a value indicating whether the form enables autoscrolling. (Inherited from Form.)
Public property | AutoScrollMargin | Gets or sets the size of the auto-scroll margin. (Inherited from ScrollableControl.)
Public property | AutoScrollMinSize | Gets or sets the minimum size of the auto-scroll. (Inherited from ScrollableControl.)
Public property | AutoScrollOffset | Gets or sets where this control is scrolled to in ScrollControlIntoView(Control). (Inherited from Control.)
Public property | AutoScrollPosition | Gets or sets the location of the auto-scroll position. (Inherited from ScrollableControl.)
Public property | AutoSize | Resize the form according to the setting of AutoSizeMode. (Inherited from Form.)
Public property | AutoSizeMode | Gets or sets the mode by which the form automatically resizes itself. (Inherited from Form.)
Public property | AutoValidate | (Inherited from Form.)
Public property | BackColor | (Inherited from Form.)
Public property | BackgroundImage | Gets or sets the background image displayed in the control. (Inherited from Control.)
Public property | BackgroundImageLayout | Gets or sets the background image layout as defined in the ImageLayout enumeration. (Inherited from Control.)
Public property | BindingContext | (Inherited from ContainerControl.)
Public property | Bottom | Gets the distance, in pixels, between the bottom edge of the control and the top edge of its container's client area. (Inherited from Control.)
Public property | Bounds | Gets or sets the size and location of the control including its nonclient elements, in pixels, relative to the parent control. (Inherited from Control.)
Public property | CancelButton | Gets or sets the button control that is clicked when the user presses the ESC key. (Inherited from Form.)
Public property | CanFocus | Gets a value indicating whether the control can receive focus. (Inherited from Control.)
Public property | CanSelect | Gets a value indicating whether the control can be selected. (Inherited from Control.)
Public property | Capture | Gets or sets a value indicating whether the control has captured the mouse. (Inherited from Control.)
Public property | CausesValidation | Gets or sets a value indicating whether the control causes validation to be performed on any controls that require validation when it receives focus. (Inherited from Control.)
Public property | ClientRectangle | Gets the rectangle that represents the client area of the control. (Inherited from Control.)
Public property | ClientSize | Gets or sets the size of the client area of the form. (Inherited from Form.)
Public property | CompanyName | Gets the name of the company or creator of the application containing the control. (Inherited from Control.)
Public property | Container | Gets the IContainer that contains the Component. (Inherited from Component.)
Public property | ContainsFocus | Gets a value indicating whether the control, or one of its child controls, currently has the input focus. (Inherited from Control.)
Public property | ContextMenu | Gets or sets the shortcut menu associated with the control. (Inherited from Control.)
Public property | ContextMenuStrip | Gets or sets the ContextMenuStrip associated with this control. (Inherited from Control.)
Public property | ControlBox | Gets or sets a value indicating whether a control box is displayed in the caption bar of the form. (Inherited from Form.)
Public property | Controls | Gets the collection of controls contained within the control. (Inherited from Control.)
Public property | Created | Gets a value indicating whether the control has been created. (Inherited from Control.)
Public property | CurrentAutoScaleDimensions | Gets the current run-time dimensions of the screen. (Inherited from ContainerControl.)
Public property | Cursor | Gets or sets the cursor that is displayed when the mouse pointer is over the control. (Inherited from Control.)
Public property | DataBindings | Gets the data bindings for the control. (Inherited from Control.)
Public property | DesktopBounds | Gets or sets the size and location of the form on the Windows desktop. (Inherited from Form.)
Public property | DesktopLocation | Gets or sets the location of the form on the Windows desktop. (Inherited from Form.)
Public property | DevMode | Gets or sets the development mode.
Public property | DialogResult | Gets or sets the dialog result for the form. (Inherited from Form.)
Public property | DisplayRectangle | Gets the rectangle that represents the virtual display area of the control. (Inherited from ScrollableControl.)
Public property | Disposing | Gets a value indicating whether the base Control class is in the process of disposing. (Inherited from Control.)
Public property | Dock | Gets or sets which control borders are docked to its parent control and determines how a control is resized with its parent. (Inherited from Control.)
Public property | DockPadding | Gets the dock padding settings for all edges of the control. (Inherited from ScrollableControl.)
Public property | Enabled | Gets or sets a value indicating whether the control can respond to user interaction. (Inherited from Control.)
Public property | Focused | Gets a value indicating whether the control has input focus. (Inherited from Control.)
Public property | Font | Gets or sets the font of the text displayed by the control. (Inherited from Control.)
Public property | ForeColor | Gets or sets the foreground color of the control. (Inherited from Control.)
Public property | FormBorderStyle | Gets or sets the border style of the form. (Inherited from Form.)
Public property | Handle | Gets the window handle that the control is bound to. (Inherited from Control.)
Public property | HasChildren | Gets a value indicating whether the control contains one or more child controls. (Inherited from Control.)
Public property | Height | Gets or sets the height of the control. (Inherited from Control.)
Public property | HelpButton | Gets or sets a value indicating whether a Help button should be displayed in the caption box of the form. (Inherited from Form.)
Public property | HorizontalScroll | Gets the characteristics associated with the horizontal scroll bar. (Inherited from ScrollableControl.)
Public property | Icon | Gets or sets the icon for the form. (Inherited from Form.)
Public property | ImeMode | Gets or sets the Input Method Editor (IME) mode of the control. (Inherited from Control.)
Public property | IniFileVersion | The BNCS Ini file version that the driver has worked out it is running as.
Public property | InvokeRequired | Gets a value indicating whether the caller must call an invoke method when making method calls to the control because the caller is on a different thread than the one the control was created on. (Inherited from Control.)
Public property | IsAccessible | Gets or sets a value indicating whether the control is visible to accessibility applications. (Inherited from Control.)
Public property | IsDisposed | Gets a value indicating whether the control has been disposed of. (Inherited from Control.)
Public property | IsHandleCreated | Gets a value indicating whether the control has a handle associated with it. (Inherited from Control.)
Public property | IsMdiChild | Gets a value indicating whether the form is a multiple-document interface (MDI) child form. (Inherited from Form.)
Public property | IsMdiContainer | Gets or sets a value indicating whether the form is a container for multiple-document interface (MDI) child forms. (Inherited from Form.)
Public property | IsMirrored | Gets a value indicating whether the control is mirrored. (Inherited from Control.)
Public property | IsRestrictedWindow | Gets a value indicating whether the form can use all windows and user input events without restriction. (Inherited from Form.)
Public property | KeyPreview | Gets or sets a value indicating whether the form will receive key events before the event is passed to the control that has focus. (Inherited from Form.)
Public property | LayoutEngine | Gets a cached instance of the control's layout engine. (Inherited from Control.)
Public property | Left | Gets or sets the distance, in pixels, between the left edge of the control and the left edge of its container's client area. (Inherited from Control.)
Public property | Location | Gets or sets the Point that represents the upper-left corner of the Form in screen coordinates. (Inherited from Form.)
Public property | MainMenuStrip | Gets or sets the primary menu container for the form. (Inherited from Form.)
Public property | Margin | Gets or sets the space between controls. (Inherited from Form.)
Public property | MaximizeBox | Gets or sets a value indicating whether the Maximize button is displayed in the caption bar of the form. (Inherited from Form.)
Public property | MaximumSize | Gets the maximum size the form can be resized to. (Inherited from Form.)
Public property | MdiChildren | Gets an array of forms that represent the multiple-document interface (MDI) child forms that are parented to this form. (Inherited from Form.)
Public property | MdiParent | Gets or sets the current multiple-document interface (MDI) parent form of this form. (Inherited from Form.)
Public property | Menu | Gets or sets the MainMenu that is displayed in the form. (Inherited from Form.)
Public property | MergedMenu | Gets the merged menu for the form. (Inherited from Form.)
Public property | MinimizeBox | Gets or sets a value indicating whether the Minimize button is displayed in the caption bar of the form. (Inherited from Form.)
Public property | MinimumSize | Gets or sets the minimum size the form can be resized to. (Inherited from Form.)
Public property | Modal | Gets a value indicating whether this form is displayed modally. (Inherited from Form.)
Public property | Name | Gets or sets the name of the control. (Inherited from Control.)
Public property | Opacity | Gets or sets the opacity level of the form. (Inherited from Form.)
Public property | OwnedForms | Gets an array of Form objects that represent all forms that are owned by this form. (Inherited from Form.)
Public property | Owner | Gets or sets the form that owns this form. (Inherited from Form.)
Public property | Padding | Gets or sets padding within the control. (Inherited from Control.)
Public property | Parent | Gets or sets the parent container of the control. (Inherited from Control.)
Public property | ParentForm | Gets the form that the container control is assigned to. (Inherited from ContainerControl.)
Public property | PreferredSize | Gets the size of a rectangular area into which the control can fit. (Inherited from Control.)
Public property | ProductName | Gets the product name of the assembly containing the control. (Inherited from Control.)
Public property | ProductVersion | Gets the version of the assembly containing the control. (Inherited from Control.)
Public property | RecreatingHandle | Gets a value indicating whether the control is currently re-creating its handle. (Inherited from Control.)
Public property | Region | Gets or sets the window region associated with the control. (Inherited from Control.)
Public property | RestoreBounds | Gets the location and size of the form in its normal window state. (Inherited from Form.)
Public property | Right | Gets the distance, in pixels, between the right edge of the control and the left edge of its container's client area. (Inherited from Control.)
Public property | RightToLeft | Gets or sets a value indicating whether control's elements are aligned to support locales using right-to-left fonts. (Inherited from Control.)
Public property | RightToLeftLayout | Gets or sets a value indicating whether right-to-left mirror placement is turned on. (Inherited from Form.)
Public property | ShowIcon | Gets or sets a value indicating whether an icon is displayed in the caption bar of the form. (Inherited from Form.)
Public property | ShowInTaskbar | Gets or sets a value indicating whether the form is displayed in the Windows taskbar. (Inherited from Form.)
Public property | Site | Gets or sets the site of the control. (Inherited from Control.)
Public property | Size | Gets or sets the size of the form. (Inherited from Form.)
Public property | SizeGripStyle | Gets or sets the style of the size grip to display in the lower-right corner of the form. (Inherited from Form.)
Public property | StartPosition | Gets or sets the starting position of the form at run time. (Inherited from Form.)
Public property | TabIndex | Gets or sets the tab order of the control within its container. (Inherited from Form.)
Public property | TabStop | Gets or sets a value indicating whether the user can give the focus to this control using the TAB key. (Inherited from Form.)
Public property | Tag | Gets or sets the object that contains data about the control. (Inherited from Control.)
Public property | Text | (Inherited from Form.)
Public property | Top | Gets or sets the distance, in pixels, between the top edge of the control and the top edge of its container's client area. (Inherited from Control.)
Public property | TopLevel | Gets or sets a value indicating whether to display the form as a top-level window. (Inherited from Form.)
Public property | TopLevelControl | Gets the parent control that is not parented by another Windows Forms control. Typically, this is the outermost Form that the control is contained in. (Inherited from Control.)
Public property | TopMost | Gets or sets a value indicating whether the form should be displayed as a topmost form. (Inherited from Form.)
Public property | TransparencyKey | Gets or sets the color that will represent transparent areas of the form. (Inherited from Form.)
Public property | UseWaitCursor | Gets or sets a value indicating whether to use the wait cursor for the current control and all child controls. (Inherited from Control.)
Public property | VerticalScroll | Gets the characteristics associated with the vertical scroll bar. (Inherited from ScrollableControl.)
Public property | Visible | Gets or sets a value indicating whether the control and all its child controls are displayed. (Inherited from Control.)
Public property | Width | Gets or sets the width of the control. (Inherited from Control.)
Public property | WindowState | Gets or sets a value that indicates whether form is minimized, maximized, or normal. (Inherited from Form.)
Public property | WindowTarget | This property is not relevant for this class. (Inherited from Control.)
Top
Events
 | Name | Description
Public event | Activated | Occurs when the form is activated in code or by the user. (Inherited from Form.)
Public event | AutoSizeChanged | Occurs when the AutoSize property changes. (Inherited from Form.)
Public event | AutoValidateChanged | Occurs when the AutoValidate property changes. (Inherited from Form.)
Public event | BackColorChanged | Occurs when the value of the BackColor property changes. (Inherited from Control.)
Public event | BackgroundImageChanged | Occurs when the value of the BackgroundImage property changes. (Inherited from Control.)
Public event | BackgroundImageLayoutChanged | Occurs when the BackgroundImageLayout property changes. (Inherited from Control.)
Public event | BindingContextChanged | Occurs when the value of the BindingContext property changes. (Inherited from Control.)
Public event | CausesValidationChanged | Occurs when the value of the CausesValidation property changes. (Inherited from Control.)
Public event | ChangeUICues | Occurs when the focus or keyboard user interface (UI) cues change. (Inherited from Control.)
Public event | Click | Occurs when the control is clicked. (Inherited from Control.)
Public event | ClientSizeChanged | Occurs when the value of the ClientSize property changes. (Inherited from Control.)
Public event | Closed | Occurs when the form is closed. (Inherited from Form.)
Public event | Closing | Occurs when the form is closing. (Inherited from Form.)
Public event | ContextMenuChanged | Occurs when the value of the ContextMenu property changes. (Inherited from Control.)
Public event | ContextMenuStripChanged | Occurs when the value of the ContextMenuStrip property changes. (Inherited from Control.)
Public event | ControlAdded | Occurs when a new control is added to the ControlControlCollection. (Inherited from Control.)
Public event | ControlRemoved | Occurs when a control is removed from the ControlControlCollection. (Inherited from Control.)
Public event | CursorChanged | Occurs when the value of the Cursor property changes. (Inherited from Control.)
Public event | Deactivate | Occurs when the form loses focus and is no longer the active form. (Inherited from Form.)
Public event | Disposed | Occurs when the component is disposed by a call to the Dispose method. (Inherited from Component.)
Public event | DockChanged | Occurs when the value of the Dock property changes. (Inherited from Control.)
Public event | DoubleClick | Occurs when the control is double-clicked. (Inherited from Control.)
Public event | DragDrop | Occurs when a drag-and-drop operation is completed. (Inherited from Control.)
Public event | DragEnter | Occurs when an object is dragged into the control's bounds. (Inherited from Control.)
Public event | DragLeave | Occurs when an object is dragged out of the control's bounds. (Inherited from Control.)
Public event | DragOver | Occurs when an object is dragged over the control's bounds. (Inherited from Control.)
Public event | EnabledChanged | Occurs when the Enabled property value has changed. (Inherited from Control.)
Public event | Enter | Occurs when the control is entered. (Inherited from Control.)
Public event | FontChanged | Occurs when the Font property value changes. (Inherited from Control.)
Public event | ForeColorChanged | Occurs when the ForeColor property value changes. (Inherited from Control.)
Public event | FormClosed | Occurs after the form is closed. (Inherited from Form.)
Public event | FormClosing | Occurs before the form is closed. (Inherited from Form.)
Public event | GiveFeedback | Occurs during a drag operation. (Inherited from Control.)
Public event | GotFocus | Occurs when the control receives focus. (Inherited from Control.)
Public event | HandleCreated | Occurs when a handle is created for the control. (Inherited from Control.)
Public event | HandleDestroyed | Occurs when the control's handle is in the process of being destroyed. (Inherited from Control.)
Public event | HelpButtonClicked | Occurs when the Help button is clicked. (Inherited from Form.)
Public event | HelpRequested | Occurs when the user requests help for a control. (Inherited from Control.)
Public event | ImeModeChanged | Occurs when the ImeMode property has changed. (Inherited from Control.)
Public event | InputLanguageChanged | Occurs after the input language of the form has changed. (Inherited from Form.)
Public event | InputLanguageChanging | Occurs when the user attempts to change the input language for the form. (Inherited from Form.)
Public event | Invalidated | Occurs when a control's display requires redrawing. (Inherited from Control.)
Public event | KeyDown | Occurs when a key is pressed while the control has focus. (Inherited from Control.)
Public event | KeyPress | Occurs when a key is pressed while the control has focus. (Inherited from Control.)
Public event | KeyUp | Occurs when a key is released while the control has focus. (Inherited from Control.)
Public event | Layout | Occurs when a control should reposition its child controls. (Inherited from Control.)
Public event | Leave | Occurs when the input focus leaves the control. (Inherited from Control.)
Public event | Load | Occurs before a form is displayed for the first time. (Inherited from Form.)
Public event | LocationChanged | Occurs when the Location property value has changed. (Inherited from Control.)
Public event | LostFocus | Occurs when the control loses focus. (Inherited from Control.)
Public event | MarginChanged | Occurs when the Margin property changes. (Inherited from Form.)
Public event | MaximizedBoundsChanged | Occurs when the value of the MaximizedBounds property has changed. (Inherited from Form.)
Public event | MaximumSizeChanged | Occurs when the value of the MaximumSize property has changed. (Inherited from Form.)
Public event | MdiChildActivate | Occurs when a multiple-document interface (MDI) child form is activated or closed within an MDI application. (Inherited from Form.)
Public event | MenuComplete | Occurs when the menu of a form loses focus. (Inherited from Form.)
Public event | MenuStart | Occurs when the menu of a form receives focus. (Inherited from Form.)
Public event | MinimumSizeChanged | Occurs when the value of the MinimumSize property has changed. (Inherited from Form.)
Public event | MouseCaptureChanged | Occurs when the control loses mouse capture. (Inherited from Control.)
Public event | MouseClick | Occurs when the control is clicked by the mouse. (Inherited from Control.)
Public event | MouseDoubleClick | Occurs when the control is double clicked by the mouse. (Inherited from Control.)
Public event | MouseDown | Occurs when the mouse pointer is over the control and a mouse button is pressed. (Inherited from Control.)
Public event | MouseEnter | Occurs when the mouse pointer enters the control. (Inherited from Control.)
Public event | MouseHover | Occurs when the mouse pointer rests on the control. (Inherited from Control.)
Public event | MouseLeave | Occurs when the mouse pointer leaves the control. (Inherited from Control.)
Public event | MouseMove | Occurs when the mouse pointer is moved over the control. (Inherited from Control.)
Public event | MouseUp | Occurs when the mouse pointer is over the control and a mouse button is released. (Inherited from Control.)
Public event | MouseWheel | Occurs when the mouse wheel moves while the control has focus. (Inherited from Control.)
Public event | Move | Occurs when the control is moved. (Inherited from Control.)
Public event | PaddingChanged | Occurs when the control's padding changes. (Inherited from Control.)
Public event | Paint | Occurs when the control is redrawn. (Inherited from Control.)
Public event | ParentChanged | Occurs when the Parent property value changes. (Inherited from Control.)
Public event | PreviewKeyDown | Occurs before the KeyDown event when a key is pressed while focus is on this control. (Inherited from Control.)
Public event | QueryAccessibilityHelp | Occurs when AccessibleObject is providing help to accessibility applications. (Inherited from Control.)
Public event | QueryContinueDrag | Occurs during a drag-and-drop operation and enables the drag source to determine whether the drag-and-drop operation should be canceled. (Inherited from Control.)
Public event | RegionChanged | Occurs when the value of the Region property changes. (Inherited from Control.)
Public event | Resize | Occurs when the control is resized. (Inherited from Control.)
Public event | ResizeBegin | Occurs when a form enters resizing mode. (Inherited from Form.)
Public event | ResizeEnd | Occurs when a form exits resizing mode. (Inherited from Form.)
Public event | RightToLeftChanged | Occurs when the RightToLeft property value changes. (Inherited from Control.)
Public event | RightToLeftLayoutChanged | Occurs after the value of the RightToLeftLayout property changes. (Inherited from Form.)
Public event | Scroll | Occurs when the user or code scrolls through the client area. (Inherited from ScrollableControl.)
Public event | Shown | Occurs whenever the form is first displayed. (Inherited from Form.)
Public event | SizeChanged | Occurs when the Size property value changes. (Inherited from Control.)
Public event | StyleChanged | Occurs when the control style changes. (Inherited from Control.)
Public event | SystemColorsChanged | Occurs when the system colors change. (Inherited from Control.)
Public event | TabIndexChanged | Occurs when the value of the TabIndex property changes. (Inherited from Form.)
Public event | TabStopChanged | Occurs when the TabStop property changes. (Inherited from Form.)
Public event | TextChanged | Occurs when the Text property value changes. (Inherited from Control.)
Public event | Validated | Occurs when the control is finished validating. (Inherited from Control.)
Public event | Validating | Occurs when the control is validating. (Inherited from Control.)
Public event | VisibleChanged | Occurs when the Visible property value changes. (Inherited from Control.)
Top
See Also

Reference

DigitalGiles.AboutForm Namespace


aboutForm Constructor

aboutForm Constructor
Constructor

Namespace: DigitalGiles.AboutForm
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public aboutForm()
See Also

Reference

aboutForm Class
DigitalGiles.AboutForm Namespace


aboutForm Methods

aboutForm Methods

The aboutForm type exposes the following members.

Methods
 | Name | Description
Public method | Activate | Activates the form and gives it focus. (Inherited from Form.)
Public method | AddOwnedForm | Adds an owned form to this form. (Inherited from Form.)
Public method | BeginInvoke(Delegate) | Executes the specified delegate asynchronously on the thread that the control's underlying handle was created on. (Inherited from Control.)
Public method | BeginInvoke(Delegate, Object) | Executes the specified delegate asynchronously with the specified arguments, on the thread that the control's underlying handle was created on. (Inherited from Control.)
Public method | BringToFront | Brings the control to the front of the z-order. (Inherited from Control.)
Public method | Close | Closes the form. (Inherited from Form.)
Public method | Contains | Retrieves a value indicating whether the specified control is a child of the control. (Inherited from Control.)
Public method | CreateControl | Forces the creation of the visible control, including the creation of the handle and any visible child controls. (Inherited from Control.)
Public method | CreateGraphics | Creates the Graphics for the control. (Inherited from Control.)
Public method | CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.)
Public method | Dispose | Releases all resources used by the Component. (Inherited from Component.)
Public method | DoDragDrop | Begins a drag-and-drop operation. (Inherited from Control.)
Public method | DrawToBitmap | Supports rendering to the specified bitmap. (Inherited from Control.)
Public method | EndInvoke | Retrieves the return value of the asynchronous operation represented by the IAsyncResult passed. (Inherited from Control.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | FindForm | Retrieves the form that the control is on. (Inherited from Control.)
Public method | Focus | Sets input focus to the control. (Inherited from Control.)
Public method | GetChildAtPoint(Point) | Retrieves the child control that is located at the specified coordinates. (Inherited from Control.)
Public method | GetChildAtPoint(Point, GetChildAtPointSkip) | Retrieves the child control that is located at the specified coordinates, specifying whether to ignore child controls of a certain type. (Inherited from Control.)
Public method | GetContainerControl | Returns the next ContainerControl up the control's chain of parent controls. (Inherited from Control.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Public method | GetNextControl | Retrieves the next control forward or back in the tab order of child controls. (Inherited from Control.)
Public method | GetPreferredSize | Retrieves the size of a rectangular area into which a control can be fitted. (Inherited from Control.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Hide | Conceals the control from the user. (Inherited from Control.)
Public method | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Public method | Invalidate | Invalidates the entire surface of the control and causes the control to be redrawn. (Inherited from Control.)
Public method | Invalidate(Region) | Invalidates the specified region of the control (adds it to the control's update region, which is the area that will be repainted at the next paint operation), and causes a paint message to be sent to the control. (Inherited from Control.)
Public method | Invalidate(Boolean) | Invalidates a specific region of the control and causes a paint message to be sent to the control. Optionally, invalidates the child controls assigned to the control. (Inherited from Control.)
Public method | Invalidate(Rectangle) | Invalidates the specified region of the control (adds it to the control's update region, which is the area that will be repainted at the next paint operation), and causes a paint message to be sent to the control. (Inherited from Control.)
Public method | Invalidate(Region, Boolean) | Invalidates the specified region of the control (adds it to the control's update region, which is the area that will be repainted at the next paint operation), and causes a paint message to be sent to the control. Optionally, invalidates the child controls assigned to the control. (Inherited from Control.)
Public method | Invalidate(Rectangle, Boolean) | Invalidates the specified region of the control (adds it to the control's update region, which is the area that will be repainted at the next paint operation), and causes a paint message to be sent to the control. Optionally, invalidates the child controls assigned to the control. (Inherited from Control.)
Public method | Invoke(Delegate) | Executes the specified delegate on the thread that owns the control's underlying window handle. (Inherited from Control.)
Public method | Invoke(Delegate, Object) | Executes the specified delegate, on the thread that owns the control's underlying window handle, with the specified list of arguments. (Inherited from Control.)
Public method | LayoutMdi | Arranges the multiple-document interface (MDI) child forms within the MDI parent form. (Inherited from Form.)
Public method | PerformAutoScale | Performs scaling of the container control and its children. (Inherited from ContainerControl.)
Public method | PerformLayout | Forces the control to apply layout logic to all its child controls. (Inherited from Control.)
Public method | PerformLayout(Control, String) | Forces the control to apply layout logic to all its child controls. (Inherited from Control.)
Public method | PointToClient | Computes the location of the specified screen point into client coordinates. (Inherited from Control.)
Public method | PointToScreen | Computes the location of the specified client point into screen coordinates. (Inherited from Control.)
Public method | PreProcessControlMessage | Preprocesses keyboard or input messages within the message loop before they are dispatched. (Inherited from Control.)
Public method | PreProcessMessage | Preprocesses keyboard or input messages within the message loop before they are dispatched. (Inherited from Control.)
Public method | RectangleToClient | Computes the size and location of the specified screen rectangle in client coordinates. (Inherited from Control.)
Public method | RectangleToScreen | Computes the size and location of the specified client rectangle in screen coordinates. (Inherited from Control.)
Public method | Refresh | Forces the control to invalidate its client area and immediately redraw itself and any child controls. (Inherited from Control.)
Public method | RemoveOwnedForm | Removes an owned form from this form. (Inherited from Form.)
Public method | ResetBackColor | Resets the BackColor property to its default value. (Inherited from Control.)
Public method | ResetBindings | Causes a control bound to the BindingSource to reread all the items in the list and refresh their displayed values. (Inherited from Control.)
Public method | ResetCursor | Resets the Cursor property to its default value. (Inherited from Control.)
Public method | ResetFont | Resets the Font property to its default value. (Inherited from Control.)
Public method | ResetForeColor | Resets the ForeColor property to its default value. (Inherited from Control.)
Public method | ResetImeMode | Resets the ImeMode property to its default value. (Inherited from Control.)
Public method | ResetRightToLeft | Resets the RightToLeft property to its default value. (Inherited from Control.)
Public method | ResetText | Resets the Text property to its default value. (Inherited from Control.)
Public method | ResumeLayout | Resumes usual layout logic. (Inherited from Control.)
Public method | ResumeLayout(Boolean) | Resumes usual layout logic, optionally forcing an immediate layout of pending layout requests. (Inherited from Control.)
Public method | Scale(Single) | Obsolete. Scales the control and any child controls. (Inherited from Control.)
Public method | Scale(SizeF) | Scales the control and all child controls by the specified scaling factor. (Inherited from Control.)
Public method | Scale(Single, Single) | Obsolete. Scales the entire control and any child controls. (Inherited from Control.)
Public method | ScrollControlIntoView | Scrolls the specified child control into view on an auto-scroll enabled control. (Inherited from ScrollableControl.)
Public method | Select | Activates the control. (Inherited from Control.)
Public method | SelectNextControl | Activates the next control. (Inherited from Control.)
Public method | SendToBack | Sends the control to the back of the z-order. (Inherited from Control.)
Public method | SetAutoScrollMargin | Sets the size of the auto-scroll margins. (Inherited from ScrollableControl.)
Public method | SetBounds(Int32, Int32, Int32, Int32) | Sets the bounds of the control to the specified location and size. (Inherited from Control.)
Public method | SetBounds(Int32, Int32, Int32, Int32, BoundsSpecified) | Sets the specified bounds of the control to the specified location and size. (Inherited from Control.)
Public method | SetDesktopBounds | Sets the bounds of the form in desktop coordinates. (Inherited from Form.)
Public method | SetDesktopLocation | Sets the location of the form in desktop coordinates. (Inherited from Form.)
Public method | SetDetails | Confiugure the information displayed on the AboutForm
Public method | Show | Displays the control to the user. (Inherited from Control.)
Public method | Show(IWin32Window) | Shows the form with the specified owner to the user. (Inherited from Form.)
Public method | ShowDialog | Shows the form as a modal dialog box. (Inherited from Form.)
Public method | ShowDialog(IWin32Window) | Shows the form as a modal dialog box with the specified owner. (Inherited from Form.)
Public method | SuspendLayout | Temporarily suspends the layout logic for the control. (Inherited from Control.)
Public method | ToString | Gets a string representing the current instance of the form. (Inherited from Form.)
Public method | Update | Causes the control to redraw the invalidated regions within its client area. (Inherited from Control.)
Public method | Validate | Verifies the value of the control losing focus by causing the Validating and Validated events to occur, in that order. (Inherited from ContainerControl.)
Public method | Validate(Boolean) | Verifies the value of the control that is losing focus; conditionally dependent on whether automatic validation is turned on. (Inherited from ContainerControl.)
Public method | ValidateChildren | (Inherited from Form.)
Public method | ValidateChildren(ValidationConstraints) | (Inherited from Form.)
Top
See Also

Reference

aboutForm Class
DigitalGiles.AboutForm Namespace


aboutForm.SetDetails Method

aboutFormSetDetails Method
Confiugure the information displayed on the AboutForm

Namespace: DigitalGiles.AboutForm
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void SetDetails(
    string Name,
    string Top,
    string Bottom
)

Parameters

Name
Type: SystemString
The name of the driver (large letters at the top of the form).
Top
Type: SystemString
The first line of description text.
Bottom
Type: SystemString
The second line of description text.
See Also

Reference

aboutForm Class
DigitalGiles.AboutForm Namespace


aboutForm Properties

aboutForm Properties

The aboutForm type exposes the following members.

Properties
 | Name | Description
Public property | AcceptButton | Gets or sets the button on the form that is clicked when the user presses the ENTER key. (Inherited from Form.)
Public property | AccessibilityObject | Gets the AccessibleObject assigned to the control. (Inherited from Control.)
Public property | AccessibleDefaultActionDescription | Gets or sets the default action description of the control for use by accessibility client applications. (Inherited from Control.)
Public property | AccessibleDescription | Gets or sets the description of the control used by accessibility client applications. (Inherited from Control.)
Public property | AccessibleName | Gets or sets the name of the control used by accessibility client applications. (Inherited from Control.)
Public property | AccessibleRole | Gets or sets the accessible role of the control (Inherited from Control.)
Public property | ActiveControl | Gets or sets the active control on the container control. (Inherited from ContainerControl.)
Public property | ActiveMdiChild | Gets the currently active multiple-document interface (MDI) child window. (Inherited from Form.)
Public property | AllowDrop | Gets or sets a value indicating whether the control can accept data that the user drags onto it. (Inherited from Control.)
Public property | AllowTransparency | Gets or sets a value indicating whether the opacity of the form can be adjusted. (Inherited from Form.)
Public property | Anchor | Gets or sets the edges of the container to which a control is bound and determines how a control is resized with its parent. (Inherited from Control.)
Public property | AutoScale | Obsolete. Gets or sets a value indicating whether the form adjusts its size to fit the height of the font used on the form and scales its controls. (Inherited from Form.)
Public property | AutoScaleBaseSize | Gets or sets the base size used for autoscaling of the form. (Inherited from Form.)
Public property | AutoScaleDimensions | Gets or sets the dimensions that the control was designed to. (Inherited from ContainerControl.)
Public property | AutoScaleMode | Gets or sets the automatic scaling mode of the control. (Inherited from ContainerControl.)
Public property | AutoScroll | Gets or sets a value indicating whether the form enables autoscrolling. (Inherited from Form.)
Public property | AutoScrollMargin | Gets or sets the size of the auto-scroll margin. (Inherited from ScrollableControl.)
Public property | AutoScrollMinSize | Gets or sets the minimum size of the auto-scroll. (Inherited from ScrollableControl.)
Public property | AutoScrollOffset | Gets or sets where this control is scrolled to in ScrollControlIntoView(Control). (Inherited from Control.)
Public property | AutoScrollPosition | Gets or sets the location of the auto-scroll position. (Inherited from ScrollableControl.)
Public property | AutoSize | Resize the form according to the setting of AutoSizeMode. (Inherited from Form.)
Public property | AutoSizeMode | Gets or sets the mode by which the form automatically resizes itself. (Inherited from Form.)
Public property | AutoValidate | (Inherited from Form.)
Public property | BackColor | (Inherited from Form.)
Public property | BackgroundImage | Gets or sets the background image displayed in the control. (Inherited from Control.)
Public property | BackgroundImageLayout | Gets or sets the background image layout as defined in the ImageLayout enumeration. (Inherited from Control.)
Public property | BindingContext | (Inherited from ContainerControl.)
Public property | Bottom | Gets the distance, in pixels, between the bottom edge of the control and the top edge of its container's client area. (Inherited from Control.)
Public property | Bounds | Gets or sets the size and location of the control including its nonclient elements, in pixels, relative to the parent control. (Inherited from Control.)
Public property | CancelButton | Gets or sets the button control that is clicked when the user presses the ESC key. (Inherited from Form.)
Public property | CanFocus | Gets a value indicating whether the control can receive focus. (Inherited from Control.)
Public property | CanSelect | Gets a value indicating whether the control can be selected. (Inherited from Control.)
Public property | Capture | Gets or sets a value indicating whether the control has captured the mouse. (Inherited from Control.)
Public property | CausesValidation | Gets or sets a value indicating whether the control causes validation to be performed on any controls that require validation when it receives focus. (Inherited from Control.)
Public property | ClientRectangle | Gets the rectangle that represents the client area of the control. (Inherited from Control.)
Public property | ClientSize | Gets or sets the size of the client area of the form. (Inherited from Form.)
Public property | CompanyName | Gets the name of the company or creator of the application containing the control. (Inherited from Control.)
Public property | Container | Gets the IContainer that contains the Component. (Inherited from Component.)
Public property | ContainsFocus | Gets a value indicating whether the control, or one of its child controls, currently has the input focus. (Inherited from Control.)
Public property | ContextMenu | Gets or sets the shortcut menu associated with the control. (Inherited from Control.)
Public property | ContextMenuStrip | Gets or sets the ContextMenuStrip associated with this control. (Inherited from Control.)
Public property | ControlBox | Gets or sets a value indicating whether a control box is displayed in the caption bar of the form. (Inherited from Form.)
Public property | Controls | Gets the collection of controls contained within the control. (Inherited from Control.)
Public property | Created | Gets a value indicating whether the control has been created. (Inherited from Control.)
Public property | CurrentAutoScaleDimensions | Gets the current run-time dimensions of the screen. (Inherited from ContainerControl.)
Public property | Cursor | Gets or sets the cursor that is displayed when the mouse pointer is over the control. (Inherited from Control.)
Public property | DataBindings | Gets the data bindings for the control. (Inherited from Control.)
Public property | DesktopBounds | Gets or sets the size and location of the form on the Windows desktop. (Inherited from Form.)
Public property | DesktopLocation | Gets or sets the location of the form on the Windows desktop. (Inherited from Form.)
Public property | DevMode | Gets or sets the development mode.
Public property | DialogResult | Gets or sets the dialog result for the form. (Inherited from Form.)
Public property | DisplayRectangle | Gets the rectangle that represents the virtual display area of the control. (Inherited from ScrollableControl.)
Public property | Disposing | Gets a value indicating whether the base Control class is in the process of disposing. (Inherited from Control.)
Public property | Dock | Gets or sets which control borders are docked to its parent control and determines how a control is resized with its parent. (Inherited from Control.)
Public property | DockPadding | Gets the dock padding settings for all edges of the control. (Inherited from ScrollableControl.)
Public property | Enabled | Gets or sets a value indicating whether the control can respond to user interaction. (Inherited from Control.)
Public property | Focused | Gets a value indicating whether the control has input focus. (Inherited from Control.)
Public property | Font | Gets or sets the font of the text displayed by the control. (Inherited from Control.)
Public property | ForeColor | Gets or sets the foreground color of the control. (Inherited from Control.)
Public property | FormBorderStyle | Gets or sets the border style of the form. (Inherited from Form.)
Public property | Handle | Gets the window handle that the control is bound to. (Inherited from Control.)
Public property | HasChildren | Gets a value indicating whether the control contains one or more child controls. (Inherited from Control.)
Public property | Height | Gets or sets the height of the control. (Inherited from Control.)
Public property | HelpButton | Gets or sets a value indicating whether a Help button should be displayed in the caption box of the form. (Inherited from Form.)
Public property | HorizontalScroll | Gets the characteristics associated with the horizontal scroll bar. (Inherited from ScrollableControl.)
Public property | Icon | Gets or sets the icon for the form. (Inherited from Form.)
Public property | ImeMode | Gets or sets the Input Method Editor (IME) mode of the control. (Inherited from Control.)
Public property | IniFileVersion | The BNCS Ini file version that the driver has worked out it is running as.
Public property | InvokeRequired | Gets a value indicating whether the caller must call an invoke method when making method calls to the control because the caller is on a different thread than the one the control was created on. (Inherited from Control.)
Public property | IsAccessible | Gets or sets a value indicating whether the control is visible to accessibility applications. (Inherited from Control.)
Public property | IsDisposed | Gets a value indicating whether the control has been disposed of. (Inherited from Control.)
Public property | IsHandleCreated | Gets a value indicating whether the control has a handle associated with it. (Inherited from Control.)
Public property | IsMdiChild | Gets a value indicating whether the form is a multiple-document interface (MDI) child form. (Inherited from Form.)
Public property | IsMdiContainer | Gets or sets a value indicating whether the form is a container for multiple-document interface (MDI) child forms. (Inherited from Form.)
Public property | IsMirrored | Gets a value indicating whether the control is mirrored. (Inherited from Control.)
Public property | IsRestrictedWindow | Gets a value indicating whether the form can use all windows and user input events without restriction. (Inherited from Form.)
Public property | KeyPreview | Gets or sets a value indicating whether the form will receive key events before the event is passed to the control that has focus. (Inherited from Form.)
Public property | LayoutEngine | Gets a cached instance of the control's layout engine. (Inherited from Control.)
Public property | Left | Gets or sets the distance, in pixels, between the left edge of the control and the left edge of its container's client area. (Inherited from Control.)
Public property | Location | Gets or sets the Point that represents the upper-left corner of the Form in screen coordinates. (Inherited from Form.)
Public property | MainMenuStrip | Gets or sets the primary menu container for the form. (Inherited from Form.)
Public property | Margin | Gets or sets the space between controls. (Inherited from Form.)
Public property | MaximizeBox | Gets or sets a value indicating whether the Maximize button is displayed in the caption bar of the form. (Inherited from Form.)
Public property | MaximumSize | Gets the maximum size the form can be resized to. (Inherited from Form.)
Public property | MdiChildren | Gets an array of forms that represent the multiple-document interface (MDI) child forms that are parented to this form. (Inherited from Form.)
Public property | MdiParent | Gets or sets the current multiple-document interface (MDI) parent form of this form. (Inherited from Form.)
Public property | Menu | Gets or sets the MainMenu that is displayed in the form. (Inherited from Form.)
Public property | MergedMenu | Gets the merged menu for the form. (Inherited from Form.)
Public property | MinimizeBox | Gets or sets a value indicating whether the Minimize button is displayed in the caption bar of the form. (Inherited from Form.)
Public property | MinimumSize | Gets or sets the minimum size the form can be resized to. (Inherited from Form.)
Public property | Modal | Gets a value indicating whether this form is displayed modally. (Inherited from Form.)
Public property | Name | Gets or sets the name of the control. (Inherited from Control.)
Public property | Opacity | Gets or sets the opacity level of the form. (Inherited from Form.)
Public property | OwnedForms | Gets an array of Form objects that represent all forms that are owned by this form. (Inherited from Form.)
Public property | Owner | Gets or sets the form that owns this form. (Inherited from Form.)
Public property | Padding | Gets or sets padding within the control. (Inherited from Control.)
Public property | Parent | Gets or sets the parent container of the control. (Inherited from Control.)
Public property | ParentForm | Gets the form that the container control is assigned to. (Inherited from ContainerControl.)
Public property | PreferredSize | Gets the size of a rectangular area into which the control can fit. (Inherited from Control.)
Public property | ProductName | Gets the product name of the assembly containing the control. (Inherited from Control.)
Public property | ProductVersion | Gets the version of the assembly containing the control. (Inherited from Control.)
Public property | RecreatingHandle | Gets a value indicating whether the control is currently re-creating its handle. (Inherited from Control.)
Public property | Region | Gets or sets the window region associated with the control. (Inherited from Control.)
Public property | RestoreBounds | Gets the location and size of the form in its normal window state. (Inherited from Form.)
Public property | Right | Gets the distance, in pixels, between the right edge of the control and the left edge of its container's client area. (Inherited from Control.)
Public property | RightToLeft | Gets or sets a value indicating whether control's elements are aligned to support locales using right-to-left fonts. (Inherited from Control.)
Public property | RightToLeftLayout | Gets or sets a value indicating whether right-to-left mirror placement is turned on. (Inherited from Form.)
Public property | ShowIcon | Gets or sets a value indicating whether an icon is displayed in the caption bar of the form. (Inherited from Form.)
Public property | ShowInTaskbar | Gets or sets a value indicating whether the form is displayed in the Windows taskbar. (Inherited from Form.)
Public property | Site | Gets or sets the site of the control. (Inherited from Control.)
Public property | Size | Gets or sets the size of the form. (Inherited from Form.)
Public property | SizeGripStyle | Gets or sets the style of the size grip to display in the lower-right corner of the form. (Inherited from Form.)
Public property | StartPosition | Gets or sets the starting position of the form at run time. (Inherited from Form.)
Public property | TabIndex | Gets or sets the tab order of the control within its container. (Inherited from Form.)
Public property | TabStop | Gets or sets a value indicating whether the user can give the focus to this control using the TAB key. (Inherited from Form.)
Public property | Tag | Gets or sets the object that contains data about the control. (Inherited from Control.)
Public property | Text | (Inherited from Form.)
Public property | Top | Gets or sets the distance, in pixels, between the top edge of the control and the top edge of its container's client area. (Inherited from Control.)
Public property | TopLevel | Gets or sets a value indicating whether to display the form as a top-level window. (Inherited from Form.)
Public property | TopLevelControl | Gets the parent control that is not parented by another Windows Forms control. Typically, this is the outermost Form that the control is contained in. (Inherited from Control.)
Public property | TopMost | Gets or sets a value indicating whether the form should be displayed as a topmost form. (Inherited from Form.)
Public property | TransparencyKey | Gets or sets the color that will represent transparent areas of the form. (Inherited from Form.)
Public property | UseWaitCursor | Gets or sets a value indicating whether to use the wait cursor for the current control and all child controls. (Inherited from Control.)
Public property | VerticalScroll | Gets the characteristics associated with the vertical scroll bar. (Inherited from ScrollableControl.)
Public property | Visible | Gets or sets a value indicating whether the control and all its child controls are displayed. (Inherited from Control.)
Public property | Width | Gets or sets the width of the control. (Inherited from Control.)
Public property | WindowState | Gets or sets a value that indicates whether form is minimized, maximized, or normal. (Inherited from Form.)
Public property | WindowTarget | This property is not relevant for this class. (Inherited from Control.)
Top
See Also

Reference

aboutForm Class
DigitalGiles.AboutForm Namespace


aboutForm.DevMode Property

aboutFormDevMode Property
Gets or sets the development mode.

Namespace: DigitalGiles.AboutForm
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool DevMode { get; set; }

Property Value

Type: Boolean
See Also

Reference

aboutForm Class
DigitalGiles.AboutForm Namespace


aboutForm.IniFileVersion Property

aboutFormIniFileVersion Property
The BNCS Ini file version that the driver has worked out it is running as.

Namespace: DigitalGiles.AboutForm
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public DriverVersion IniFileVersion { get; set; }

Property Value

Type: DriverVersion
See Also

Reference

aboutForm Class
DigitalGiles.AboutForm Namespace


aboutForm Events

aboutForm Events

The aboutForm type exposes the following members.

Events
 | Name | Description
Public event | Activated | Occurs when the form is activated in code or by the user. (Inherited from Form.)
Public event | AutoSizeChanged | Occurs when the AutoSize property changes. (Inherited from Form.)
Public event | AutoValidateChanged | Occurs when the AutoValidate property changes. (Inherited from Form.)
Public event | BackColorChanged | Occurs when the value of the BackColor property changes. (Inherited from Control.)
Public event | BackgroundImageChanged | Occurs when the value of the BackgroundImage property changes. (Inherited from Control.)
Public event | BackgroundImageLayoutChanged | Occurs when the BackgroundImageLayout property changes. (Inherited from Control.)
Public event | BindingContextChanged | Occurs when the value of the BindingContext property changes. (Inherited from Control.)
Public event | CausesValidationChanged | Occurs when the value of the CausesValidation property changes. (Inherited from Control.)
Public event | ChangeUICues | Occurs when the focus or keyboard user interface (UI) cues change. (Inherited from Control.)
Public event | Click | Occurs when the control is clicked. (Inherited from Control.)
Public event | ClientSizeChanged | Occurs when the value of the ClientSize property changes. (Inherited from Control.)
Public event | Closed | Occurs when the form is closed. (Inherited from Form.)
Public event | Closing | Occurs when the form is closing. (Inherited from Form.)
Public event | ContextMenuChanged | Occurs when the value of the ContextMenu property changes. (Inherited from Control.)
Public event | ContextMenuStripChanged | Occurs when the value of the ContextMenuStrip property changes. (Inherited from Control.)
Public event | ControlAdded | Occurs when a new control is added to the ControlControlCollection. (Inherited from Control.)
Public event | ControlRemoved | Occurs when a control is removed from the ControlControlCollection. (Inherited from Control.)
Public event | CursorChanged | Occurs when the value of the Cursor property changes. (Inherited from Control.)
Public event | Deactivate | Occurs when the form loses focus and is no longer the active form. (Inherited from Form.)
Public event | Disposed | Occurs when the component is disposed by a call to the Dispose method. (Inherited from Component.)
Public event | DockChanged | Occurs when the value of the Dock property changes. (Inherited from Control.)
Public event | DoubleClick | Occurs when the control is double-clicked. (Inherited from Control.)
Public event | DragDrop | Occurs when a drag-and-drop operation is completed. (Inherited from Control.)
Public event | DragEnter | Occurs when an object is dragged into the control's bounds. (Inherited from Control.)
Public event | DragLeave | Occurs when an object is dragged out of the control's bounds. (Inherited from Control.)
Public event | DragOver | Occurs when an object is dragged over the control's bounds. (Inherited from Control.)
Public event | EnabledChanged | Occurs when the Enabled property value has changed. (Inherited from Control.)
Public event | Enter | Occurs when the control is entered. (Inherited from Control.)
Public event | FontChanged | Occurs when the Font property value changes. (Inherited from Control.)
Public event | ForeColorChanged | Occurs when the ForeColor property value changes. (Inherited from Control.)
Public event | FormClosed | Occurs after the form is closed. (Inherited from Form.)
Public event | FormClosing | Occurs before the form is closed. (Inherited from Form.)
Public event | GiveFeedback | Occurs during a drag operation. (Inherited from Control.)
Public event | GotFocus | Occurs when the control receives focus. (Inherited from Control.)
Public event | HandleCreated | Occurs when a handle is created for the control. (Inherited from Control.)
Public event | HandleDestroyed | Occurs when the control's handle is in the process of being destroyed. (Inherited from Control.)
Public event | HelpButtonClicked | Occurs when the Help button is clicked. (Inherited from Form.)
Public event | HelpRequested | Occurs when the user requests help for a control. (Inherited from Control.)
Public event | ImeModeChanged | Occurs when the ImeMode property has changed. (Inherited from Control.)
Public event | InputLanguageChanged | Occurs after the input language of the form has changed. (Inherited from Form.)
Public event | InputLanguageChanging | Occurs when the user attempts to change the input language for the form. (Inherited from Form.)
Public event | Invalidated | Occurs when a control's display requires redrawing. (Inherited from Control.)
Public event | KeyDown | Occurs when a key is pressed while the control has focus. (Inherited from Control.)
Public event | KeyPress | Occurs when a key is pressed while the control has focus. (Inherited from Control.)
Public event | KeyUp | Occurs when a key is released while the control has focus. (Inherited from Control.)
Public event | Layout | Occurs when a control should reposition its child controls. (Inherited from Control.)
Public event | Leave | Occurs when the input focus leaves the control. (Inherited from Control.)
Public event | Load | Occurs before a form is displayed for the first time. (Inherited from Form.)
Public event | LocationChanged | Occurs when the Location property value has changed. (Inherited from Control.)
Public event | LostFocus | Occurs when the control loses focus. (Inherited from Control.)
Public event | MarginChanged | Occurs when the Margin property changes. (Inherited from Form.)
Public event | MaximizedBoundsChanged | Occurs when the value of the MaximizedBounds property has changed. (Inherited from Form.)
Public event | MaximumSizeChanged | Occurs when the value of the MaximumSize property has changed. (Inherited from Form.)
Public event | MdiChildActivate | Occurs when a multiple-document interface (MDI) child form is activated or closed within an MDI application. (Inherited from Form.)
Public event | MenuComplete | Occurs when the menu of a form loses focus. (Inherited from Form.)
Public event | MenuStart | Occurs when the menu of a form receives focus. (Inherited from Form.)
Public event | MinimumSizeChanged | Occurs when the value of the MinimumSize property has changed. (Inherited from Form.)
Public event | MouseCaptureChanged | Occurs when the control loses mouse capture. (Inherited from Control.)
Public event | MouseClick | Occurs when the control is clicked by the mouse. (Inherited from Control.)
Public event | MouseDoubleClick | Occurs when the control is double clicked by the mouse. (Inherited from Control.)
Public event | MouseDown | Occurs when the mouse pointer is over the control and a mouse button is pressed. (Inherited from Control.)
Public event | MouseEnter | Occurs when the mouse pointer enters the control. (Inherited from Control.)
Public event | MouseHover | Occurs when the mouse pointer rests on the control. (Inherited from Control.)
Public event | MouseLeave | Occurs when the mouse pointer leaves the control. (Inherited from Control.)
Public event | MouseMove | Occurs when the mouse pointer is moved over the control. (Inherited from Control.)
Public event | MouseUp | Occurs when the mouse pointer is over the control and a mouse button is released. (Inherited from Control.)
Public event | MouseWheel | Occurs when the mouse wheel moves while the control has focus. (Inherited from Control.)
Public event | Move | Occurs when the control is moved. (Inherited from Control.)
Public event | PaddingChanged | Occurs when the control's padding changes. (Inherited from Control.)
Public event | Paint | Occurs when the control is redrawn. (Inherited from Control.)
Public event | ParentChanged | Occurs when the Parent property value changes. (Inherited from Control.)
Public event | PreviewKeyDown | Occurs before the KeyDown event when a key is pressed while focus is on this control. (Inherited from Control.)
Public event | QueryAccessibilityHelp | Occurs when AccessibleObject is providing help to accessibility applications. (Inherited from Control.)
Public event | QueryContinueDrag | Occurs during a drag-and-drop operation and enables the drag source to determine whether the drag-and-drop operation should be canceled. (Inherited from Control.)
Public event | RegionChanged | Occurs when the value of the Region property changes. (Inherited from Control.)
Public event | Resize | Occurs when the control is resized. (Inherited from Control.)
Public event | ResizeBegin | Occurs when a form enters resizing mode. (Inherited from Form.)
Public event | ResizeEnd | Occurs when a form exits resizing mode. (Inherited from Form.)
Public event | RightToLeftChanged | Occurs when the RightToLeft property value changes. (Inherited from Control.)
Public event | RightToLeftLayoutChanged | Occurs after the value of the RightToLeftLayout property changes. (Inherited from Form.)
Public event | Scroll | Occurs when the user or code scrolls through the client area. (Inherited from ScrollableControl.)
Public event | Shown | Occurs whenever the form is first displayed. (Inherited from Form.)
Public event | SizeChanged | Occurs when the Size property value changes. (Inherited from Control.)
Public event | StyleChanged | Occurs when the control style changes. (Inherited from Control.)
Public event | SystemColorsChanged | Occurs when the system colors change. (Inherited from Control.)
Public event | TabIndexChanged | Occurs when the value of the TabIndex property changes. (Inherited from Form.)
Public event | TabStopChanged | Occurs when the TabStop property changes. (Inherited from Form.)
Public event | TextChanged | Occurs when the Text property value changes. (Inherited from Control.)
Public event | Validated | Occurs when the control is finished validating. (Inherited from Control.)
Public event | Validating | Occurs when the control is validating. (Inherited from Control.)
Public event | VisibleChanged | Occurs when the Visible property value changes. (Inherited from Control.)
Top
See Also

Reference

aboutForm Class
DigitalGiles.AboutForm Namespace


DigitalGiles.BNCS Namespace

DigitalGiles.BNCS Namespace
This namespace represents the BNCS core featuring CSI, ID and GRD classes.
Classes
Class Description
Public class BncsClientDatabaseChangeEventArgs
Event arguments associated with the ClientDatabaseChanged event
Public class BncsClientPktSerErrEventArgs
Event arguments associated with the ClientPacketSerialErrorDetected event.
Public class BncsClientRevertiveEventArgs
Base class of the BNCS ClientEventArgs
Public class BncsClientTxRxNetMsgEventArgs
Event arguments associated with the TxRxMessageReceived event
Public class BncsClosingEventArgs
Event arguments associated with the Closing event
Public class BncsCommunicationException
The exception that is throw when the program encounters an error communicating with BNCS
Public class BncsConnectAttemptEventArgs
Event arguments associated with the ConnectAttempt event
Public class BncsConnectedEventArgs
Event arguments associated with the Connected event
Public class BncsConnectStatusChangedEventArgs
Event arguments associated with the ConnectStatusChanged event
Public class BncsCrosspointRequestEventArgs
Event arguments associated with the CrosspointRequest event
Public class BNCSCsi
Class encapsulating a Control System Interface
Public class BncsDatabaseChangeEventArgs
Event arguments associated with the DatabaseChanged event
Public class BNCSDevice
Giles' BNCSDevice class, provides the base from which all driver objects are derived
Public class BNCSGenericRouterDriver
Class encapsulating a BNCS Generic Router Driver
Public class BncsGpiClientRevertiveEventArgs
Event arguments associated with the GpiClientRevertiveReceived event
Public class BncsIfModeEventArgs
Event arguments associated with the IfModeChanged event
Public class BncsIfModeException
The exception that is throw when a problem is encountered with the BNCS IFMODE configuration.
Public class BNCSInfoDriver
Class encapsulating a BNCS InfoDriver device
Public class BncsInfoDriverClientRevertiveEventArgs
Event arguments associated with the InfoDriverClientRevertiveReceived event
Public class BncsNotConnectedException
The exception thrown if an operation could not be performed because a host BNCS driver is disconnected
BNCSResilentInfoDriver
An alternative version of BNCSInfoDriver, surfaces all public methods, surfaces all events and all properties though, with exception of Tag, these are read only. This class should be instantiated instead of BNCSInfoDriver when a driver needs to run as a resilient pair. The HostDriverConnected r/w property controls the resilience behaviour, the IFMode, OkToGoTXRX and OkToGoRxOnly properties are now read only and are controlled by the setting of the HostDriverConnected flag. Adds a new event handler, ResiliencyMessageHandled, for debug purposes to follow resiliency messages received and how the instance responded.
Examples
This code is a demonstration of creating and using BNCSCsi and DigitalGiles.BNCS.BNCSResilientInfodriver classes.
Copy
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Infodriver variable
    private BNCSResilientInfoDriver _id = null;
    // Info driver number.
    private const int _idNumber = 403;
    // A flag betraying host driver connectivity status, in this case with an HTTP server
    private bool _httpServerConnected = false;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    // Some method that fires when our connection status to an HTTP server changes
    private void HTTPServerResponseStatusChanged(bool connected_)
    {
        // Capture our HTTP connected status here
        _httpServerConnected = connected_;
        // Now simply update our InfoDriver with this change here
        if (null != _infoDriver)
            _infoDriver.HostDriverConnected = _httpServerConnected; // All operations for resiliency are handled by this single line of code, CSI will do the rest for you
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);

        // Create, setup and connect our Infodriver.
        _id = new BNCSResilientInfoDriver("Pathfinder GPIO Driver", _idNumber, _httpServerConnected);
        _id.SlotMessageReceived += _id_SlotMessageReceived;
        _id.Connect(true);
    }

    void _id_SlotMessageReceived(object sender, BncsSlotMessageEventArgs e)
    {
        // Log slot changes to a ListBox
        listBox.Items.Add("Change to slot #" + e.Slot.ToString() + ": " + e.Message);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // Dispose of the Info Driver, this method takes care of all disposal considerations
        _id.Dispose();

        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
Public class BncsRouterClientRevertiveEventArgs
Event arguments associated with the RouterClientRevertiveReceived event
Public class BncsSlotMessageEventArgs
Event arguments associated with the SlotMessageReceived event
Public class BncsSpecificClientEventArgs
Base class of the driver-speficic BNCS ClientEventArgs
Public class BncsUserStrEventArgs
Event arguments associated with the UserStringReceived event
Public class BncsWrongDriverTypeException
The exception that is thrown when an operation could not be peformed on a BNCS driver because it is of the wrong type. For example, this exception is throw if you call GetTxRx on a CSI type driver.
Public class ResilientIDMessageEventArgs
Event argument class for resilience messages
Public class VersionChecker
gBNCS class providing cross-version compatibility methods.
Structures
 | Structure | Description
Public structure | BNCSDeviceStats | Structure containing counters commonly of interest.
Public structure | BncsRegistration | Structure defining a CSI client registration.
Public structure | CsiDeviceStatus | Structure containing the results of a call to GetDeviceStatus().
Public structure | IniFileLocation | Structure defining an INI file.
Delegates
 | Delegate | Description
Public delegate | ResilientIDMessageEventHandler | Delegate for resiliency message events
Enumerations
 | Enumeration | Description
Public enumeration | BNCSInfoDriverResiliencyRole | A type betraying the current role of an InfoDriver either as a singular ID or it's role within a resilient pair.
Public enumeration | BNCSResilienceMessageType | A type betraying the type of resiliency message handled by a resilient InfoDriver
Public enumeration | CsiCache | Enumeration of CSI cache settings
Public enumeration | CsiIniFileType | Device type based on CSI INI files.
Public enumeration | CsiIniFileVersion | Device version based on CSI INI files. Whether CSI thinks the device is a V1 (GRD/GPID/INFO INI) or V2 (DEV INI) device.
Public enumeration | DriverVersion | Enumeration of the different sorts of driver machine available.
Public enumeration | HostDriverConnectState | BNCS connect state enumeration.
Public enumeration | HostDriverIFMode | BNCS IFMODE enumeration.
Public enumeration | HostDriverType | BNCS driver type enumeration.
Public enumeration | TxRxNetMsgStatus | Enumeration of TxRx network status messages


BncsClientDatabaseChangeEventArgs Class

BncsClientDatabaseChangeEventArgs Class
Event arguments associated with the ClientDatabaseChanged event
Inheritance Hierarchy
SystemObject
SystemEventArgs
DigitalGiles.BNCSBncsClientDatabaseChangeEventArgs

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BncsClientDatabaseChangeEventArgs : EventArgs

The BncsClientDatabaseChangeEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | BncsClientDatabaseChangeEventArgs | Creates a new BncsRouterModifyEventArgs object
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | DatabaseIndex | The database index that has been updated
Public property | DatabaseNumber | The database number that has been updated
Public property | DriverNumber | The driver number whose database has been updated
Top
See Also

Reference

DigitalGiles.BNCS Namespace


BncsClientDatabaseChangeEventArgs Constructor

BncsClientDatabaseChangeEventArgs Constructor
Creates a new BncsRouterModifyEventArgs object

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsClientDatabaseChangeEventArgs()
See Also

Reference

BncsClientDatabaseChangeEventArgs Class
DigitalGiles.BNCS Namespace


BncsClientDatabaseChangeEventArgs Methods

BncsClientDatabaseChangeEventArgs Methods

The BncsClientDatabaseChangeEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

BncsClientDatabaseChangeEventArgs Class
DigitalGiles.BNCS Namespace


BncsClientDatabaseChangeEventArgs Properties

BncsClientDatabaseChangeEventArgs Properties

The BncsClientDatabaseChangeEventArgs type exposes the following members.

Properties
 | Name | Description
Public property | DatabaseIndex | The database index that has been updated
Public property | DatabaseNumber | The database number that has been updated
Public property | DriverNumber | The driver number whose database has been updated
Top
See Also

Reference

BncsClientDatabaseChangeEventArgs Class
DigitalGiles.BNCS Namespace


BncsClientDatabaseChangeEventArgs.DatabaseIndex Property

BncsClientDatabaseChangeEventArgsDatabaseIndex Property
The database index that has been updated

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint DatabaseIndex { get; set; }

Property Value

Type: UInt32
See Also

Reference

BncsClientDatabaseChangeEventArgs Class
DigitalGiles.BNCS Namespace


BncsClientDatabaseChangeEventArgs.DatabaseNumber Property

BncsClientDatabaseChangeEventArgsDatabaseNumber Property
The database number that has been updated

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint DatabaseNumber { get; set; }

Property Value

Type: UInt32
See Also

Reference

BncsClientDatabaseChangeEventArgs Class
DigitalGiles.BNCS Namespace


BncsClientDatabaseChangeEventArgs.DriverNumber Property

BncsClientDatabaseChangeEventArgsDriverNumber Property
The driver number whose database has been updated

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint DriverNumber { get; set; }

Property Value

Type: UInt32
See Also

Reference

BncsClientDatabaseChangeEventArgs Class
DigitalGiles.BNCS Namespace


BncsClientPktSerErrEventArgs Class

BncsClientPktSerErrEventArgs Class
Event arguments associated with the ClientPacketSerialErrorDetected event.
Inheritance Hierarchy
SystemObject
SystemEventArgs
DigitalGiles.BNCSBncsClientPktSerErrEventArgs

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BncsClientPktSerErrEventArgs : EventArgs

The BncsClientPktSerErrEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | BncsClientPktSerErrEventArgs | Creates a new BncsCsiTxRxNetMsgEventArgs object.
Public method | BncsClientPktSerErrEventArgs(UInt32, UInt32) | Creates a new BncsClientPktSerErrEventArgs object with the supplied parameters.
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | DeviceNumber | Device number.
Public property | Workstation | Workstation number the device is running on.
Top
See Also

Reference

DigitalGiles.BNCS Namespace


BncsClientPktSerErrEventArgs Constructor

BncsClientPktSerErrEventArgs Constructor
Overload List
 | Name | Description
Public method | BncsClientPktSerErrEventArgs | Creates a new BncsCsiTxRxNetMsgEventArgs object.
Public method | BncsClientPktSerErrEventArgs(UInt32, UInt32) | Creates a new BncsClientPktSerErrEventArgs object with the supplied parameters.
Top
See Also

Reference

BncsClientPktSerErrEventArgs Class
DigitalGiles.BNCS Namespace


BncsClientPktSerErrEventArgs Constructor

BncsClientPktSerErrEventArgs Constructor
Creates a new BncsCsiTxRxNetMsgEventArgs object.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsClientPktSerErrEventArgs()
See Also

Reference

BncsClientPktSerErrEventArgs Class
BncsClientPktSerErrEventArgs Overload
DigitalGiles.BNCS Namespace


BncsClientPktSerErrEventArgs Constructor (UInt32, UInt32)

BncsClientPktSerErrEventArgs Constructor (UInt32, UInt32)
Creates a new BncsClientPktSerErrEventArgs object with the supplied parameters.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsClientPktSerErrEventArgs(
    uint reportedDriver,
    uint reportedWorkstation
)

Parameters

reportedDriver
Type: SystemUInt32
Driver number.
reportedWorkstation
Type: SystemUInt32
Workstation number on which the driver is reportedly running.
See Also

Reference

BncsClientPktSerErrEventArgs Class
BncsClientPktSerErrEventArgs Overload
DigitalGiles.BNCS Namespace


BncsClientPktSerErrEventArgs Methods

BncsClientPktSerErrEventArgs Methods

The BncsClientPktSerErrEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

BncsClientPktSerErrEventArgs Class
DigitalGiles.BNCS Namespace


BncsClientPktSerErrEventArgs Properties

BncsClientPktSerErrEventArgs Properties

The BncsClientPktSerErrEventArgs type exposes the following members.

Properties
 | Name | Description
Public property | DeviceNumber | Device number.
Public property | Workstation | Workstation number the device is running on.
Top
See Also

Reference

BncsClientPktSerErrEventArgs Class
DigitalGiles.BNCS Namespace


BncsClientPktSerErrEventArgs.DeviceNumber Property

BncsClientPktSerErrEventArgsDeviceNumber Property
Device number.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint DeviceNumber { get; set; }

Property Value

Type: UInt32
See Also

Reference

BncsClientPktSerErrEventArgs Class
DigitalGiles.BNCS Namespace


BncsClientPktSerErrEventArgs.Workstation Property

BncsClientPktSerErrEventArgsWorkstation Property
Workstation number the device is running on.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint Workstation { get; set; }

Property Value

Type: UInt32
See Also

Reference

BncsClientPktSerErrEventArgs Class
DigitalGiles.BNCS Namespace


BncsClientRevertiveEventArgs Class

BncsClientRevertiveEventArgs Class
Base class of the BNCS ClientEventArgs
Inheritance Hierarchy
SystemObject
SystemEventArgs
DigitalGiles.BNCSBncsClientRevertiveEventArgs
DigitalGiles.BNCSBncsSpecificClientEventArgs

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BncsClientRevertiveEventArgs : EventArgs

The BncsClientRevertiveEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | BncsClientRevertiveEventArgs | Creates a new BncsClientRevertiveEventArgs object
Public method | BncsClientRevertiveEventArgs(String) | Creates a new BncsClientRevertiveEventArgs object with a supplied client string
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | RevertiveString | Revertive string as received from CSI
Top
See Also

Reference

DigitalGiles.BNCS Namespace


BncsClientRevertiveEventArgs Constructor

BncsClientRevertiveEventArgs Constructor
Overload List
 | Name | Description
Public method | BncsClientRevertiveEventArgs | Creates a new BncsClientRevertiveEventArgs object
Public method | BncsClientRevertiveEventArgs(String) | Creates a new BncsClientRevertiveEventArgs object with a supplied client string
Top
See Also

Reference

BncsClientRevertiveEventArgs Class
DigitalGiles.BNCS Namespace


BncsClientRevertiveEventArgs Constructor

BncsClientRevertiveEventArgs Constructor
Creates a new BncsClientRevertiveEventArgs object

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsClientRevertiveEventArgs()
See Also

Reference

BncsClientRevertiveEventArgs Class
BncsClientRevertiveEventArgs Overload
DigitalGiles.BNCS Namespace


BncsClientRevertiveEventArgs Constructor (String)

BncsClientRevertiveEventArgs Constructor (String)
Creates a new BncsClientRevertiveEventArgs object with a supplied client string

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsClientRevertiveEventArgs(
    string clientMessage_
)

Parameters

clientMessage_
Type: SystemString
Client string
See Also

Reference

BncsClientRevertiveEventArgs Class
BncsClientRevertiveEventArgs Overload
DigitalGiles.BNCS Namespace


BncsClientRevertiveEventArgs Methods

BncsClientRevertiveEventArgs Methods

The BncsClientRevertiveEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

BncsClientRevertiveEventArgs Class
DigitalGiles.BNCS Namespace


BncsClientRevertiveEventArgs Properties

BncsClientRevertiveEventArgs Properties

The BncsClientRevertiveEventArgs type exposes the following members.

Properties
 | Name | Description
Public property | RevertiveString | Revertive string as received from CSI
Top
See Also

Reference

BncsClientRevertiveEventArgs Class
DigitalGiles.BNCS Namespace


BncsClientRevertiveEventArgs.RevertiveString Property

BncsClientRevertiveEventArgsRevertiveString Property
Revertive string as received from CSI

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string RevertiveString { get; set; }

Property Value

Type: String
See Also

Reference

BncsClientRevertiveEventArgs Class
DigitalGiles.BNCS Namespace


BncsClientTxRxNetMsgEventArgs Class

BncsClientTxRxNetMsgEventArgs Class
Event arguments associated with the TxRxMessageReceived event
Inheritance Hierarchy
SystemObject
SystemEventArgs
DigitalGiles.BNCSBncsClientTxRxNetMsgEventArgs

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BncsClientTxRxNetMsgEventArgs : EventArgs

The BncsClientTxRxNetMsgEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | BncsClientTxRxNetMsgEventArgs | Creates a new BncsCsiTxRxNetMsgEventArgs object
Public method | BncsClientTxRxNetMsgEventArgs(UInt32, UInt32, TxRxNetMsgStatus) | Creates a new BncsCsiTxRxNetMsgEventArgs object with the supplied parameters
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | DeviceNumber | Device number
Public property | DeviceStatus | Reported state of the driver (1=RxOnly, 2=TxRx)
Public property | Workstation | Workstation number the device is running on
Top
See Also

Reference

DigitalGiles.BNCS Namespace


BncsClientTxRxNetMsgEventArgs Constructor

BncsClientTxRxNetMsgEventArgs Constructor
Overload List
 | Name | Description
Public method | BncsClientTxRxNetMsgEventArgs | Creates a new BncsCsiTxRxNetMsgEventArgs object
Public method | BncsClientTxRxNetMsgEventArgs(UInt32, UInt32, TxRxNetMsgStatus) | Creates a new BncsCsiTxRxNetMsgEventArgs object with the supplied parameters
Top
See Also

Reference

BncsClientTxRxNetMsgEventArgs Class
DigitalGiles.BNCS Namespace


BncsClientTxRxNetMsgEventArgs Constructor

BncsClientTxRxNetMsgEventArgs Constructor
Creates a new BncsCsiTxRxNetMsgEventArgs object

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsClientTxRxNetMsgEventArgs()
See Also

Reference

BncsClientTxRxNetMsgEventArgs Class
BncsClientTxRxNetMsgEventArgs Overload
DigitalGiles.BNCS Namespace


BncsClientTxRxNetMsgEventArgs Constructor (UInt32, UInt32, TxRxNetMsgStatus)

BncsClientTxRxNetMsgEventArgs Constructor (UInt32, UInt32, TxRxNetMsgStatus)
Creates a new BncsCsiTxRxNetMsgEventArgs object with the supplied parameters

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsClientTxRxNetMsgEventArgs(
    uint reportedDriver_,
    uint reportedWorkstation_,
    TxRxNetMsgStatus reportedStatus_
)

Parameters

reportedDriver_
Type: SystemUInt32
Driver number
reportedWorkstation_
Type: SystemUInt32
Workstation number on which the driver is reportedly running
reportedStatus_
Type: DigitalGiles.BNCSTxRxNetMsgStatus
The reported status of the driver
See Also

Reference

BncsClientTxRxNetMsgEventArgs Class
BncsClientTxRxNetMsgEventArgs Overload
DigitalGiles.BNCS Namespace


BncsClientTxRxNetMsgEventArgs Methods

BncsClientTxRxNetMsgEventArgs Methods

The BncsClientTxRxNetMsgEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

BncsClientTxRxNetMsgEventArgs Class
DigitalGiles.BNCS Namespace


BncsClientTxRxNetMsgEventArgs Properties

BncsClientTxRxNetMsgEventArgs Properties

The BncsClientTxRxNetMsgEventArgs type exposes the following members.

Properties
 | Name | Description
Public property | DeviceNumber | Device number
Public property | DeviceStatus | Reported state of the driver (1=RxOnly, 2=TxRx)
Public property | Workstation | Workstation number the device is running on
Top
See Also

Reference

BncsClientTxRxNetMsgEventArgs Class
DigitalGiles.BNCS Namespace


BncsClientTxRxNetMsgEventArgs.DeviceNumber Property

BncsClientTxRxNetMsgEventArgsDeviceNumber Property
Device number

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint DeviceNumber { get; set; }

Property Value

Type: UInt32
See Also

Reference

BncsClientTxRxNetMsgEventArgs Class
DigitalGiles.BNCS Namespace


BncsClientTxRxNetMsgEventArgs.DeviceStatus Property

BncsClientTxRxNetMsgEventArgsDeviceStatus Property
Reported state of the driver (1=RxOnly, 2=TxRx)

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public TxRxNetMsgStatus DeviceStatus { get; set; }

Property Value

Type: TxRxNetMsgStatus
See Also

Reference

BncsClientTxRxNetMsgEventArgs Class
DigitalGiles.BNCS Namespace


BncsClientTxRxNetMsgEventArgs.Workstation Property

BncsClientTxRxNetMsgEventArgsWorkstation Property
Workstation number the device is running on

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint Workstation { get; set; }

Property Value

Type: UInt32
See Also

Reference

BncsClientTxRxNetMsgEventArgs Class
DigitalGiles.BNCS Namespace


BncsClosingEventArgs Class

BncsClosingEventArgs Class
Event arguments associated with the Closing event
Inheritance Hierarchy
SystemObject
SystemEventArgs
DigitalGiles.BNCSBncsClosingEventArgs

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BncsClosingEventArgs : EventArgs

The BncsClosingEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | BncsClosingEventArgs | Creates a new BncsClosingEventArgs object
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

DigitalGiles.BNCS Namespace


BncsClosingEventArgs Constructor

BncsClosingEventArgs Constructor
Creates a new BncsClosingEventArgs object

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsClosingEventArgs()
See Also

Reference

BncsClosingEventArgs Class
DigitalGiles.BNCS Namespace


BncsClosingEventArgs Methods

BncsClosingEventArgs Methods

The BncsClosingEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

BncsClosingEventArgs Class
DigitalGiles.BNCS Namespace


BncsCommunicationException Class

BncsCommunicationException Class
The exception that is throw when the program encounters an error communicating with BNCS
Inheritance Hierarchy
SystemObject
SystemException
DigitalGiles.BNCSBncsCommunicationException

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BncsCommunicationException : Exception

The BncsCommunicationException type exposes the following members.

Constructors
 | Name | Description
Public method | BncsCommunicationException | Initialises a new BncsCommunicationException object.
Public method | BncsCommunicationException(String) | Initialises a new BncsCommunicationException object.
Public method | BncsCommunicationException(String, Exception) | Initialises a new BncsCommunicationException object.
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetBaseException | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions. (Inherited from Exception.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetObjectData | When overridden in a derived class, sets the SerializationInfo with information about the exception. (Inherited from Exception.)
Public method | GetType | Gets the runtime type of the current instance. (Inherited from Exception.)
Public method | ToString | Creates and returns a string representation of the current exception. (Inherited from Exception.)
Top
Properties
 | Name | Description
Public property | Data | Gets a collection of key/value pairs that provide additional user-defined information about the exception. (Inherited from Exception.)
Public property | HelpLink | Gets or sets a link to the help file associated with this exception. (Inherited from Exception.)
Public property | InnerException | Gets the Exception instance that caused the current exception. (Inherited from Exception.)
Public property | Message | Gets a message that describes the current exception. (Inherited from Exception.)
Public property | Source | Gets or sets the name of the application or the object that causes the error. (Inherited from Exception.)
Public property | StackTrace | Gets a string representation of the immediate frames on the call stack. (Inherited from Exception.)
Public property | TargetSite | Gets the method that throws the current exception. (Inherited from Exception.)
Top
See Also

Reference

DigitalGiles.BNCS Namespace


BncsCommunicationException Constructor

BncsCommunicationException Constructor
Overload List
 | Name | Description
Public method | BncsCommunicationException | Initialises a new BncsCommunicationException object.
Public method | BncsCommunicationException(String) | Initialises a new BncsCommunicationException object.
Public method | BncsCommunicationException(String, Exception) | Initialises a new BncsCommunicationException object.
Top
See Also

Reference

BncsCommunicationException Class
DigitalGiles.BNCS Namespace


BncsCommunicationException Constructor

BncsCommunicationException Constructor
Initialises a new BncsCommunicationException object.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsCommunicationException()
See Also

Reference

BncsCommunicationException Class
BncsCommunicationException Overload
DigitalGiles.BNCS Namespace


BncsCommunicationException Constructor (String)

BncsCommunicationException Constructor (String)
Initialises a new BncsCommunicationException object.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsCommunicationException(
    string message_
)

Parameters

message_
Type: SystemString
Message containing further detail about the exception
See Also

Reference

BncsCommunicationException Class
BncsCommunicationException Overload
DigitalGiles.BNCS Namespace


BncsCommunicationException Constructor (String, Exception)

BncsCommunicationException Constructor (String, Exception)
Initialises a new BncsCommunicationException object.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsCommunicationException(
    string message_,
    Exception innerException_
)

Parameters

message_
Type: SystemString
Message containing further detail about the exception.
innerException_
Type: SystemException
The inner exception that caused this one.
See Also

Reference

BncsCommunicationException Class
BncsCommunicationException Overload
DigitalGiles.BNCS Namespace


BncsCommunicationException Methods

BncsCommunicationException Methods

The BncsCommunicationException type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetBaseException | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions. (Inherited from Exception.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetObjectData | When overridden in a derived class, sets the SerializationInfo with information about the exception. (Inherited from Exception.)
Public method | GetType | Gets the runtime type of the current instance. (Inherited from Exception.)
Public method | ToString | Creates and returns a string representation of the current exception. (Inherited from Exception.)
Top
See Also

Reference

BncsCommunicationException Class
DigitalGiles.BNCS Namespace


BncsCommunicationException Properties

BncsCommunicationException Properties

The BncsCommunicationException type exposes the following members.

Properties
 | Name | Description
Public property | Data | Gets a collection of key/value pairs that provide additional user-defined information about the exception. (Inherited from Exception.)
Public property | HelpLink | Gets or sets a link to the help file associated with this exception. (Inherited from Exception.)
Public property | InnerException | Gets the Exception instance that caused the current exception. (Inherited from Exception.)
Public property | Message | Gets a message that describes the current exception. (Inherited from Exception.)
Public property | Source | Gets or sets the name of the application or the object that causes the error. (Inherited from Exception.)
Public property | StackTrace | Gets a string representation of the immediate frames on the call stack. (Inherited from Exception.)
Public property | TargetSite | Gets the method that throws the current exception. (Inherited from Exception.)
Top
See Also

Reference

BncsCommunicationException Class
DigitalGiles.BNCS Namespace


BncsConnectAttemptEventArgs Class

BncsConnectAttemptEventArgs Class
Event arguments associated with the ConnectAttempt event
Inheritance Hierarchy
SystemObject
SystemEventArgs
DigitalGiles.BNCSBncsConnectAttemptEventArgs

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BncsConnectAttemptEventArgs : EventArgs

The BncsConnectAttemptEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | BncsConnectAttemptEventArgs | Creates a new BncsConnectAttemptEventArgs object with the supplied connect attempt number.
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | AttemptCount | The number of this connect attempt.
Top
See Also

Reference

DigitalGiles.BNCS Namespace


BncsConnectAttemptEventArgs Constructor

BncsConnectAttemptEventArgs Constructor
Creates a new BncsConnectAttemptEventArgs object with the supplied connect attempt number.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsConnectAttemptEventArgs(
    int attemptCount_
)

Parameters

attemptCount_
Type: SystemInt32
The number of this connect attempt.
See Also

Reference

BncsConnectAttemptEventArgs Class
DigitalGiles.BNCS Namespace


BncsConnectAttemptEventArgs Methods

BncsConnectAttemptEventArgs Methods

The BncsConnectAttemptEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

BncsConnectAttemptEventArgs Class
DigitalGiles.BNCS Namespace


BncsConnectAttemptEventArgs Properties

BncsConnectAttemptEventArgs Properties

The BncsConnectAttemptEventArgs type exposes the following members.

Properties
 | Name | Description
Public property | AttemptCount | The number of this connect attempt.
Top
See Also

Reference

BncsConnectAttemptEventArgs Class
DigitalGiles.BNCS Namespace


BncsConnectAttemptEventArgs.AttemptCount Property

BncsConnectAttemptEventArgsAttemptCount Property
The number of this connect attempt.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int AttemptCount { get; set; }

Property Value

Type: Int32
See Also

Reference

BncsConnectAttemptEventArgs Class
DigitalGiles.BNCS Namespace


BncsConnectedEventArgs Class

BncsConnectedEventArgs Class
Event arguments associated with the Connected event
Inheritance Hierarchy
SystemObject
SystemEventArgs
DigitalGiles.BNCSBncsConnectedEventArgs

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BncsConnectedEventArgs : EventArgs

The BncsConnectedEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | BncsConnectedEventArgs | Creates a new BncsConnectedEventArgs object
Public method | BncsConnectedEventArgs(Int32) | Creates a new BncsConnectedEventArgs with the supplied window handle
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | Handle | The window handle of the connected BNCS driver
Top
See Also

Reference

DigitalGiles.BNCS Namespace


BncsConnectedEventArgs Constructor

BncsConnectedEventArgs Constructor
Overload List
 | Name | Description
Public method | BncsConnectedEventArgs | Creates a new BncsConnectedEventArgs object
Public method | BncsConnectedEventArgs(Int32) | Creates a new BncsConnectedEventArgs with the supplied window handle
Top
See Also

Reference

BncsConnectedEventArgs Class
DigitalGiles.BNCS Namespace


BncsConnectedEventArgs Constructor

BncsConnectedEventArgs Constructor
Creates a new BncsConnectedEventArgs object

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsConnectedEventArgs()
See Also

Reference

BncsConnectedEventArgs Class
BncsConnectedEventArgs Overload
DigitalGiles.BNCS Namespace


BncsConnectedEventArgs Constructor (Int32)

BncsConnectedEventArgs Constructor (Int32)
Creates a new BncsConnectedEventArgs with the supplied window handle

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsConnectedEventArgs(
    int handle_
)

Parameters

handle_
Type: SystemInt32
Window handle of the connected BNCS driver
See Also

Reference

BncsConnectedEventArgs Class
BncsConnectedEventArgs Overload
DigitalGiles.BNCS Namespace


BncsConnectedEventArgs Methods

BncsConnectedEventArgs Methods

The BncsConnectedEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

BncsConnectedEventArgs Class
DigitalGiles.BNCS Namespace


BncsConnectedEventArgs Properties

BncsConnectedEventArgs Properties

The BncsConnectedEventArgs type exposes the following members.

Properties
 | Name | Description
Public property | Handle | The window handle of the connected BNCS driver
Top
See Also

Reference

BncsConnectedEventArgs Class
DigitalGiles.BNCS Namespace


BncsConnectedEventArgs.Handle Property

BncsConnectedEventArgsHandle Property
The window handle of the connected BNCS driver

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Handle { get; set; }

Property Value

Type: Int32
See Also

Reference

BncsConnectedEventArgs Class
DigitalGiles.BNCS Namespace


BncsConnectStatusChangedEventArgs Class

BncsConnectStatusChangedEventArgs Class
Event arguments associated with the ConnectStatusChanged event
Inheritance Hierarchy
SystemObject
SystemEventArgs
DigitalGiles.BNCSBncsConnectStatusChangedEventArgs

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BncsConnectStatusChangedEventArgs : EventArgs

The BncsConnectStatusChangedEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | BncsConnectStatusChangedEventArgs | Creates a new BncsIfModeEventArgs object.
Public method | BncsConnectStatusChangedEventArgs(HostDriverConnectState) | Creates a new BncsConnectStatusChangedEventArgs with a supplied HostDriverConnectState
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | ConnectStatus | The HostDriverConnectState of the host driver
Top
See Also

Reference

DigitalGiles.BNCS Namespace


BncsConnectStatusChangedEventArgs Constructor

BncsConnectStatusChangedEventArgs Constructor
Overload List
 | Name | Description
Public method | BncsConnectStatusChangedEventArgs | Creates a new BncsIfModeEventArgs object.
Public method | BncsConnectStatusChangedEventArgs(HostDriverConnectState) | Creates a new BncsConnectStatusChangedEventArgs with a supplied HostDriverConnectState
Top
See Also

Reference

BncsConnectStatusChangedEventArgs Class
DigitalGiles.BNCS Namespace


BncsConnectStatusChangedEventArgs Constructor

BncsConnectStatusChangedEventArgs Constructor
Creates a new BncsIfModeEventArgs object.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsConnectStatusChangedEventArgs()
See Also

Reference

BncsConnectStatusChangedEventArgs Class
BncsConnectStatusChangedEventArgs Overload
DigitalGiles.BNCS Namespace


BncsConnectStatusChangedEventArgs Constructor (HostDriverConnectState)

BncsConnectStatusChangedEventArgs Constructor (HostDriverConnectState)
Creates a new BncsConnectStatusChangedEventArgs with a supplied HostDriverConnectState

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsConnectStatusChangedEventArgs(
    HostDriverConnectState newMode
)

Parameters

newMode
Type: DigitalGiles.BNCSHostDriverConnectState
HostDriverConnectState of the host driver
See Also

Reference

BncsConnectStatusChangedEventArgs Class
BncsConnectStatusChangedEventArgs Overload
DigitalGiles.BNCS Namespace


BncsConnectStatusChangedEventArgs Methods

BncsConnectStatusChangedEventArgs Methods

The BncsConnectStatusChangedEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

BncsConnectStatusChangedEventArgs Class
DigitalGiles.BNCS Namespace


BncsConnectStatusChangedEventArgs Properties

BncsConnectStatusChangedEventArgs Properties

The BncsConnectStatusChangedEventArgs type exposes the following members.

Properties
 | Name | Description
Public property | ConnectStatus | The HostDriverConnectState of the host driver
Top
See Also

Reference

BncsConnectStatusChangedEventArgs Class
DigitalGiles.BNCS Namespace


BncsConnectStatusChangedEventArgs.ConnectStatus Property

BncsConnectStatusChangedEventArgsConnectStatus Property
The HostDriverConnectState of the host driver

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public HostDriverConnectState ConnectStatus { get; set; }

Property Value

Type: HostDriverConnectState
See Also

Reference

BncsConnectStatusChangedEventArgs Class
DigitalGiles.BNCS Namespace


BncsCrosspointRequestEventArgs Class

BncsCrosspointRequestEventArgs Class
Event arguments associated with the CrosspointRequest event
Inheritance Hierarchy
SystemObject
SystemEventArgs
DigitalGiles.BNCSBncsCrosspointRequestEventArgs

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BncsCrosspointRequestEventArgs : EventArgs

The BncsCrosspointRequestEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | BncsCrosspointRequestEventArgs | Creates a new BncsGenericRouterDriverMsgEventArgs object
Public method | BncsCrosspointRequestEventArgs(Int32, UInt32) | Creates a new BncsGenericRouterDriverMsgEventArgs object with supplied source and destination
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | Destination | The destination number
Public property | Source | The source number
Top
See Also

Reference

DigitalGiles.BNCS Namespace


BncsCrosspointRequestEventArgs Constructor

BncsCrosspointRequestEventArgs Constructor
Overload List
 | Name | Description
Public method | BncsCrosspointRequestEventArgs | Creates a new BncsGenericRouterDriverMsgEventArgs object
Public method | BncsCrosspointRequestEventArgs(Int32, UInt32) | Creates a new BncsGenericRouterDriverMsgEventArgs object with supplied source and destination
Top
See Also

Reference

BncsCrosspointRequestEventArgs Class
DigitalGiles.BNCS Namespace


BncsCrosspointRequestEventArgs Constructor

BncsCrosspointRequestEventArgs Constructor
Creates a new BncsGenericRouterDriverMsgEventArgs object

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsCrosspointRequestEventArgs()
See Also

Reference

BncsCrosspointRequestEventArgs Class
BncsCrosspointRequestEventArgs Overload
DigitalGiles.BNCS Namespace


BncsCrosspointRequestEventArgs Constructor (Int32, UInt32)

BncsCrosspointRequestEventArgs Constructor (Int32, UInt32)
Creates a new BncsGenericRouterDriverMsgEventArgs object with supplied source and destination

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsCrosspointRequestEventArgs(
    int source_,
    uint destination_
)

Parameters

source_
Type: SystemInt32
The source number
destination_
Type: SystemUInt32
The destination number
See Also

Reference

BncsCrosspointRequestEventArgs Class
BncsCrosspointRequestEventArgs Overload
DigitalGiles.BNCS Namespace


BncsCrosspointRequestEventArgs Methods

BncsCrosspointRequestEventArgs Methods

The BncsCrosspointRequestEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

BncsCrosspointRequestEventArgs Class
DigitalGiles.BNCS Namespace


BncsCrosspointRequestEventArgs Properties

BncsCrosspointRequestEventArgs Properties

The BncsCrosspointRequestEventArgs type exposes the following members.

Properties
 | Name | Description
Public property | Destination | The destination number
Public property | Source | The source number
Top
See Also

Reference

BncsCrosspointRequestEventArgs Class
DigitalGiles.BNCS Namespace


BncsCrosspointRequestEventArgs.Destination Property

BncsCrosspointRequestEventArgsDestination Property
The destination number

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint Destination { get; set; }

Property Value

Type: UInt32
See Also

Reference

BncsCrosspointRequestEventArgs Class
DigitalGiles.BNCS Namespace


BncsCrosspointRequestEventArgs.Source Property

BncsCrosspointRequestEventArgsSource Property
The source number

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Source { get; set; }

Property Value

Type: Int32
See Also

Reference

BncsCrosspointRequestEventArgs Class
DigitalGiles.BNCS Namespace


BNCSCsi Class

BNCSCsi Class
Class encapsulating a Control System Interface
Inheritance Hierarchy
SystemObject
DigitalGiles.BNCSBNCSDevice
DigitalGiles.BNCSBNCSCsi

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BNCSCsi : BNCSDevice

The BNCSCsi type exposes the following members.

Methods
Name Description
Public method CacheControl
Turns the CSI revertive cache on or off
Public method CacheFlush
Flushes the CSI revertive cache
Public method CacheQuery
Queries CSI for the current cache setting
Public method ChangeIfMode
Sets the If Mode
(Overrides BNCSDeviceChangeIfMode(HostDriverIFMode).)
Public method ClearStatistics
Clears all statistics counters.
(Inherited from BNCSDevice.)
Connect
Attempt to connect to BNCS.
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
Disconnect
Disconnect from BNCS
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
Public method Dispose
Dispose of the BNCS Device and release all its resources.
(Inherited from BNCSDevice.)
Public method Equals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public method GetDBIndex
Returns a BNCS database index
Public method GetDBName
Returns a BNCS database name
Public method GetDeviceStatus
Returns properties about the supplied device based on CSI's INI files.
Public method GetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public method GetIfMode
Retrieves the IFMODE of the connected host driver
(Inherited from BNCSDevice.)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method GpiLock
Locks or unlocks a range of GPIs.
Public method GpiPoll
Polls a GPI Device for a range of tallies
Public method GpiQuery
Queries a GPI Device for a range of tallies
Public method GpiSet
Requests that a GPI driver changes an output
Public method IncrementUserCounter
Increment a User Counter.
(Inherited from BNCSDevice.)
Public method InfoLock
Locks or unlocks a range of slots in the InfoDriver.
Public method InfoPoll(UInt32, UInt32, UInt32)
Polls an InfoDriver for a range of slots, the resulting message sent does not write immediatley to avoid flooding the network
Public method InfoPoll(UInt32, UInt32, UInt32, Boolean)
Polls an InfoDriver for a range of slots
Public method InfoQuery
Queries an InfoDriver for a range of slots
Public method InfoWrite
Requests that a message be stored in an InfoDriver slot
RegisterAsClient
Registers as a client with the host CSI
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
RegisterForDevice
Registers for revertives from a particular device
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
Public method RegisterForDriverID
Registers with CSI as a driver.
Public method RegisterForPacketErrors
Registers with CSI to receive notification of packet errors.
Public method RouterCrosspoint(UInt32, UInt32, UInt32)
Requests that a router driver make a crosspoint
Public method RouterCrosspoint(UInt32, UInt32, UInt32, String)
Requests that a router driver make a crosspoint
Public method RouterLock
Locks or unlocks a range of destinations in the GRD.
Public method RouterModify
Instructs a router to change its database.
Public method RouterPoll
Polls a router driver for a range of destination tallies
Public method RouterQuery
Queries a router driver for a range of destination tallies
Public method SendClientNetworkMessage
Sends a client message (eg "IW 123 'hello' 1") to CSI.
Public method SendCsiClosingMessage
Sends the CSI Closing message to the host driver, which should cause it to shut down. Only valid for InfoDrivers and GRDs.
(Inherited from BNCSDevice.)
Public method StopThread
Stops the RX message thread
(Inherited from BNCSDevice.)
Public method StopTimer
Forcibly stops the connect timer, if running
(Inherited from BNCSDevice.)
Public method ToString
Returns a string that represents the current object.
(Inherited from Object.)
UnregisterAsClient
Unregisters as a client with CSI
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
Public method UnregisterForDevice
Unregisters for revertives from a particular device.
Public method UnregisterForDeviceEntirely
Unregisters entirely from a device.
Public method UnregisterForDriverID
Unregisters with CSI as a driver.
Public method UnRegisterForPacketErrors
UnRegisters with CSI so we no longer receive notification of packet errors.
Public method VerbatimMessage
Sends a universal revertive message to the network
Top
Properties
Name Description
Public property DevNum
BNCS device number
(Inherited from BNCSDevice.)
HostConnectState
Device connection status
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
Public property IfMode
Current TXRX mode (updated with GetTxRx, SetRxOnly and SetTxRx)
(Inherited from BNCSDevice.)
IsRegisteredAsClient
Whether we are registered as a client with CSI
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
Public property IsRegisteredForPktErrs
Whether we are registered with CSI to receive packet error notifications.
Public property LocalHandle
Local window handle
(Inherited from BNCSDevice.)
Public property Name
Device name, for custom use
(Inherited from BNCSDevice.)
Public property OkToGoRxOnly
Whether the host InfoDriver can change its IfMode to RxOnly (defaults to true)
(Inherited from BNCSDevice.)
Public property OkToGoTXRX
Whether the host InfoDriver can change its IfMode to TxRx (defaults to false)
(Inherited from BNCSDevice.)
Public property Statistics
Message and error counts.
(Inherited from BNCSDevice.)
Public property Tag
User-defined object used to identify this driver instance.
(Inherited from BNCSDevice.)
Public property WindowHandle
Driver window handle
(Inherited from BNCSDevice.)
Public property WorkstationID
Workstation ID, returned by a Connect call to CSI
Top
Events
Name Description
Public event ClientDatabaseChanged
Event triggered when a database changes (notification only, actual information needs to be requested directly from CSI)
Public event ClientPacketSerialErrorDetected
Event triggered when CSI detects a packet serial number error.
Public event ClientRevertiveReceived
Event triggered when a client revertive string is received from CSI
Public event ClientTxRxMessageReceived
Event triggered when a NETTXRXSTATUS message is received by CSI
Public event ConnectAttempt
Event triggered when a connect attempt is made to the host driver.
(Inherited from BNCSDevice.)
Public event DatabaseChanged
Event triggered when the host driver indicates a database change has occurred
(Inherited from BNCSDevice.)
Public event GpiClientRevertiveReceived
Event triggered when a GPI client revertive is received
Public event HostClosing
Event triggered when the host BNCS driver is closing
(Inherited from BNCSDevice.)
HostConnected
Event triggered when the host BNCS driver has connected
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
HostConnectStatusChanged
Event triggered when the connect status of the host driver has changed
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
Public event HostIfModeChanged
Event triggered when the IfMode of the host BNCS driver has changed
(Inherited from BNCSDevice.)
Public event InfoDriverClientRevertiveReceived
Event triggered when an InfoDriver client revertive is received
Public event RouterClientRevertiveReceived
Event triggered when a Router client revertive is received
Public event UserStringReceived
Event triggered when a new User String is received from the host infodriver
(Inherited from BNCSDevice.)
Top
See Also

Reference

DigitalGiles.BNCS Namespace


BNCSCsi Methods

BNCSCsi Methods

The BNCSCsi type exposes the following members.

Methods
Name Description
Public method CacheControl
Turns the CSI revertive cache on or off
Public method CacheFlush
Flushes the CSI revertive cache
Public method CacheQuery
Queries CSI for the current cache setting
Public method ChangeIfMode
Sets the If Mode
(Overrides BNCSDeviceChangeIfMode(HostDriverIFMode).)
Public method ClearStatistics
Clears all statistics counters.
(Inherited from BNCSDevice.)
Connect
Attempt to connect to BNCS.
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
Disconnect
Disconnect from BNCS
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
Public method Dispose
Dispose of the BNCS Device and release all its resources.
(Inherited from BNCSDevice.)
Public method Equals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public method GetDBIndex
Returns a BNCS database index
Public method GetDBName
Returns a BNCS database name
Public method GetDeviceStatus
Returns properties about the supplied device based on CSI's INI files.
Public method GetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public method GetIfMode
Retrieves the IFMODE of the connected host driver
(Inherited from BNCSDevice.)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method GpiLock
Locks or unlocks a range of GPIs.
Public method GpiPoll
Polls a GPI Device for a range of tallies
Public method GpiQuery
Queries a GPI Device for a range of tallies
Public method GpiSet
Requests that a GPI driver changes an output
Public method IncrementUserCounter
Increment a User Counter.
(Inherited from BNCSDevice.)
Public method InfoLock
Locks or unlocks a range of slots in the InfoDriver.
Public method InfoPoll(UInt32, UInt32, UInt32)
Polls an InfoDriver for a range of slots, the resulting message sent does not write immediatley to avoid flooding the network
Public method InfoPoll(UInt32, UInt32, UInt32, Boolean)
Polls an InfoDriver for a range of slots
Public method InfoQuery
Queries an InfoDriver for a range of slots
Public method InfoWrite
Requests that a message be stored in an InfoDriver slot
RegisterAsClient
Registers as a client with the host CSI
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
RegisterForDevice
Registers for revertives from a particular device
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
Public method RegisterForDriverID
Registers with CSI as a driver.
Public method RegisterForPacketErrors
Registers with CSI to receive notification of packet errors.
Public method RouterCrosspoint(UInt32, UInt32, UInt32)
Requests that a router driver make a crosspoint
Public method RouterCrosspoint(UInt32, UInt32, UInt32, String)
Requests that a router driver make a crosspoint
Public method RouterLock
Locks or unlocks a range of destinations in the GRD.
Public method RouterModify
Instructs a router to change its database.
Public method RouterPoll
Polls a router driver for a range of destination tallies
Public method RouterQuery
Queries a router driver for a range of destination tallies
Public method SendClientNetworkMessage
Sends a client message (eg "IW 123 'hello' 1") to CSI.
Public method SendCsiClosingMessage
Sends the CSI Closing message to the host driver, which should cause it to shut down. Only valid for InfoDrivers and GRDs.
(Inherited from BNCSDevice.)
Public method StopThread
Stops the RX message thread
(Inherited from BNCSDevice.)
Public method StopTimer
Forcibly stops the connect timer, if running
(Inherited from BNCSDevice.)
Public method ToString
Returns a string that represents the current object.
(Inherited from Object.)
UnregisterAsClient
Unregisters as a client with CSI
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
Public method UnregisterForDevice
Unregisters for revertives from a particular device.
Public method UnregisterForDeviceEntirely
Unregisters entirely from a device.
Public method UnregisterForDriverID
Unregisters with CSI as a driver.
Public method UnRegisterForPacketErrors
UnRegisters with CSI so we no longer receive notification of packet errors.
Public method VerbatimMessage
Sends a universal revertive message to the network
Top
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.CacheControl Method

BNCSCsiCacheControl Method
Turns the CSI revertive cache on or off

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void CacheControl(
    CsiCache newCacheSetting_
)

Parameters

newCacheSetting_
Type: DigitalGiles.BNCSCsiCache
CSICACHE enumerated constant
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.CacheFlush Method

BNCSCsiCacheFlush Method
Flushes the CSI revertive cache

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void CacheFlush()
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.CacheQuery Method

BNCSCsiCacheQuery Method
Queries CSI for the current cache setting

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CsiCache CacheQuery()

Return Value

Type: CsiCache
Current cache setting
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.ChangeIfMode Method

BNCSCsiChangeIfMode Method
Sets the If Mode

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override void ChangeIfMode(
    HostDriverIFMode newIfMode
)

Parameters

newIfMode
Type: DigitalGiles.BNCSHostDriverIFMode
The required IF Mode
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.GetDBIndex Method

BNCSCsiGetDBIndex Method
Returns a BNCS database index

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int GetDBIndex(
    int deviceNumber_,
    int databaseNumber_,
    string entry_
)

Parameters

deviceNumber_
Type: SystemInt32
Device number to pull database from
databaseNumber_
Type: SystemInt32
Database number (0=Sces, 1=Dests, others won't work)
entry_
Type: SystemString
Database name to search for

Return Value

Type: Int32
Database index number (0 if not found)
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.GetDBName Method

BNCSCsiGetDBName Method
Returns a BNCS database name

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string GetDBName(
    uint device_,
    uint databaseNumber_,
    uint index_
)

Parameters

device_
Type: SystemUInt32
Device number to pull database from
databaseNumber_
Type: SystemUInt32
Database number (0=Sces, 1=Dests, 2-9=UserDefined)
index_
Type: SystemUInt32
Database index

Return Value

Type: String
String containing the database entry
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.GetDeviceStatus Method

BNCSCsiGetDeviceStatus Method
Returns properties about the supplied device based on CSI's INI files.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CsiDeviceStatus GetDeviceStatus(
    uint deviceID_
)

Parameters

deviceID_
Type: SystemUInt32
The device number to query.

Return Value

Type: CsiDeviceStatus
The device status
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.GpiLock Method

BNCSCsiGpiLock Method
Locks or unlocks a range of GPIs.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void GpiLock(
    uint deviceNumber_,
    uint startGpi_,
    uint endGpi_,
    bool lock_
)

Parameters

deviceNumber_
Type: SystemUInt32
Device number of the GPI driver.
startGpi_
Type: SystemUInt32
The first GPI to lock.
endGpi_
Type: SystemUInt32
The last GPI to lock.
lock_
Type: SystemBoolean
Set flag to TRUE to lock this range of GPIs. FALSE to unlock.
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.GpiPoll Method

BNCSCsiGpiPoll Method
Polls a GPI Device for a range of tallies

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void GpiPoll(
    uint deviceNumber_,
    uint startGpi_,
    uint endGpi_
)

Parameters

deviceNumber_
Type: SystemUInt32
Device number of the GPI driver
startGpi_
Type: SystemUInt32
The first GPI to poll
endGpi_
Type: SystemUInt32
The last GPI to poll
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.GpiQuery Method

BNCSCsiGpiQuery Method
Queries a GPI Device for a range of tallies

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void GpiQuery(
    uint deviceNumber_,
    uint startGpi_,
    uint endGpi_
)

Parameters

deviceNumber_
Type: SystemUInt32
Device number of the GPI driver
startGpi_
Type: SystemUInt32
The first GPI to poll
endGpi_
Type: SystemUInt32
The last GPI to poll
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.GpiSet Method

BNCSCsiGpiSet Method
Requests that a GPI driver changes an output

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void GpiSet(
    uint deviceNumber_,
    uint gpi_,
    bool enabled_
)

Parameters

deviceNumber_
Type: SystemUInt32
Device number of the GPI driver
gpi_
Type: SystemUInt32
The GPI to set
enabled_
Type: SystemBoolean
Whether the GPI should be set enabled/on or disabled/off
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.InfoLock Method

BNCSCsiInfoLock Method
Locks or unlocks a range of slots in the InfoDriver.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void InfoLock(
    uint deviceNumber_,
    uint startIndex_,
    uint endIndex_,
    bool locked_
)

Parameters

deviceNumber_
Type: SystemUInt32
Device number of the InfoDriver.
startIndex_
Type: SystemUInt32
The first slot to lock.
endIndex_
Type: SystemUInt32
The last slot to lock.
locked_
Type: SystemBoolean
Set flag to TRUE to lock this range of slots. FALSE to unlock.
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.InfoPoll Method

BNCSCsiInfoPoll Method
Overload List
 | Name | Description
Public method | InfoPoll(UInt32, UInt32, UInt32) | Polls an InfoDriver for a range of slots, the resulting message sent does not write immediatley to avoid flooding the network
Public method | InfoPoll(UInt32, UInt32, UInt32, Boolean) | Polls an InfoDriver for a range of slots
Top
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.InfoPoll Method (UInt32, UInt32, UInt32)

BNCSCsiInfoPoll Method (UInt32, UInt32, UInt32)
Polls an InfoDriver for a range of slots, the resulting message sent does not write immediatley to avoid flooding the network

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void InfoPoll(
    uint deviceNumber_,
    uint startSlot_,
    uint endSlot_
)

Parameters

deviceNumber_
Type: SystemUInt32
Device number of the InfoDriver
startSlot_
Type: SystemUInt32
The first slot to poll
endSlot_
Type: SystemUInt32
The last slot to poll
See Also

Reference

BNCSCsi Class
InfoPoll Overload
DigitalGiles.BNCS Namespace


BNCSCsi.InfoPoll Method (UInt32, UInt32, UInt32, Boolean)

BNCSCsiInfoPoll Method (UInt32, UInt32, UInt32, Boolean)
Polls an InfoDriver for a range of slots

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void InfoPoll(
    uint deviceNumber_,
    uint startSlot_,
    uint endSlot_,
    bool writeNow_
)

Parameters

deviceNumber_
Type: SystemUInt32
Device number of the InfoDriver
startSlot_
Type: SystemUInt32
The first slot to poll
endSlot_
Type: SystemUInt32
The last slot to poll
writeNow_
Type: SystemBoolean
Optional write now flag, set to false to avoid flooding the network
See Also

Reference

BNCSCsi Class
InfoPoll Overload
DigitalGiles.BNCS Namespace


BNCSCsi.InfoQuery Method

BNCSCsiInfoQuery Method
Queries an InfoDriver for a range of slots

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void InfoQuery(
    uint deviceNumber_,
    uint startSlot_,
    uint endSlot_
)

Parameters

deviceNumber_
Type: SystemUInt32
Device number of the InfoDriver
startSlot_
Type: SystemUInt32
The first slot to poll
endSlot_
Type: SystemUInt32
The last slot to poll
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.InfoWrite Method

BNCSCsiInfoWrite Method
Requests that a message be stored in an InfoDriver slot

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void InfoWrite(
    uint deviceNumber_,
    uint slot_,
    string message_
)

Parameters

deviceNumber_
Type: SystemUInt32
Device number of the InfoDriver
slot_
Type: SystemUInt32
Slot in which the message is to be stored
message_
Type: SystemString
The message to store into the slot
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.RegisterAsClient Method

BNCSCsiRegisterAsClient Method
Registers as a client with the host CSI
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void RegisterAsClient()
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.RegisterForDevice Method

BNCSCsiRegisterForDevice Method
Registers for revertives from a particular device
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void RegisterForDevice(
    uint deviceNumber_,
    uint startIndex_,
    uint endIndex_,
    bool addExistingDeviceRegistration
)

Parameters

deviceNumber_
Type: SystemUInt32
Device number
startIndex_
Type: SystemUInt32
Starting index of registration
endIndex_
Type: SystemUInt32
Ending index of registration
addExistingDeviceRegistration
Type: SystemBoolean
Set this to true to add to an existing device registration
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.RegisterForDriverID Method

BNCSCsiRegisterForDriverID Method
Registers with CSI as a driver.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void RegisterForDriverID(
    uint driverId_
)

Parameters

driverId_
Type: SystemUInt32
Driver ID
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.RegisterForPacketErrors Method

BNCSCsiRegisterForPacketErrors Method
Registers with CSI to receive notification of packet errors.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void RegisterForPacketErrors()
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.RouterCrosspoint Method

BNCSCsiRouterCrosspoint Method
Overload List
 | Name | Description
Public method | RouterCrosspoint(UInt32, UInt32, UInt32) | Requests that a router driver make a crosspoint
Public method | RouterCrosspoint(UInt32, UInt32, UInt32, String) | Requests that a router driver make a crosspoint
Top
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.RouterCrosspoint Method (UInt32, UInt32, UInt32)

BNCSCsiRouterCrosspoint Method (UInt32, UInt32, UInt32)
Requests that a router driver make a crosspoint

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void RouterCrosspoint(
    uint deviceNumber_,
    uint sourceNumber_,
    uint destinationNumber_
)

Parameters

deviceNumber_
Type: SystemUInt32
Device number of the router driver
sourceNumber_
Type: SystemUInt32
Requested source
destinationNumber_
Type: SystemUInt32
Requested destination
See Also

Reference

BNCSCsi Class
RouterCrosspoint Overload
DigitalGiles.BNCS Namespace


BNCSCsi.RouterCrosspoint Method (UInt32, UInt32, UInt32, String)

BNCSCsiRouterCrosspoint Method (UInt32, UInt32, UInt32, String)
Requests that a router driver make a crosspoint

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void RouterCrosspoint(
    uint deviceNumber_,
    uint sourceNumber_,
    uint destinationNumber_,
    string routerMask_
)

Parameters

deviceNumber_
Type: SystemUInt32
Device number of the router driver
sourceNumber_
Type: SystemUInt32
Requested source
destinationNumber_
Type: SystemUInt32
Requested destination
routerMask_
Type: SystemString
Router mask (eg 'FORWARD') that is sometimes required by devices
See Also

Reference

BNCSCsi Class
RouterCrosspoint Overload
DigitalGiles.BNCS Namespace


BNCSCsi.RouterLock Method

BNCSCsiRouterLock Method
Locks or unlocks a range of destinations in the GRD.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void RouterLock(
    uint deviceNumber_,
    uint startDestination_,
    uint endDestination_,
    bool lock_
)

Parameters

deviceNumber_
Type: SystemUInt32
Device number of the GRD.
startDestination_
Type: SystemUInt32
The first destination to lock.
endDestination_
Type: SystemUInt32
The last destination to lock.
lock_
Type: SystemBoolean
Set flag to TRUE to lock this range of destinations. FALSE to unlock.
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.RouterModify Method

BNCSCsiRouterModify Method
Instructs a router to change its database.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void RouterModify(
    uint device_,
    uint database_,
    uint index_,
    string name_,
    bool dumpTallyTable_
)

Parameters

device_
Type: SystemUInt32
Driver number.
database_
Type: SystemUInt32
Database number, between 1 and 9.
index_
Type: SystemUInt32
The index to modify in the database.
name_
Type: SystemString
The new name for the database entry.
dumpTallyTable_
Type: SystemBoolean
Signals to the router driver to send a complete tally table dump in order to update any revertive source names that may have changed. If several database changes are being made this this flag should be set to 'FALSE' and only be set to 'TRUE' for the very last command. If only destination names are changing then no revertive update is needed.
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.RouterPoll Method

BNCSCsiRouterPoll Method
Polls a router driver for a range of destination tallies

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void RouterPoll(
    uint deviceNumber_,
    uint startDestination_,
    uint endDestination_
)

Parameters

deviceNumber_
Type: SystemUInt32
Device number of the router driver
startDestination_
Type: SystemUInt32
The first destination to poll
endDestination_
Type: SystemUInt32
The last destination to poll
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.RouterQuery Method

BNCSCsiRouterQuery Method
Queries a router driver for a range of destination tallies

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void RouterQuery(
    uint deviceNumber_,
    uint startDestination_,
    uint endDestination_
)

Parameters

deviceNumber_
Type: SystemUInt32
Device number of the router driver
startDestination_
Type: SystemUInt32
The first destination to poll
endDestination_
Type: SystemUInt32
The last destination to poll
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.SendClientNetworkMessage Method

BNCSCsiSendClientNetworkMessage Method
Sends a client message (eg "IW 123 'hello' 1") to CSI.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool SendClientNetworkMessage(
    BncsNetworkMessage message_
)

Parameters

message_
Type: BNCSBncsNetworkMessage
Pre configured Bncs Network message

Return Value

Type: Boolean
True if the network message is not null and has been properly assembled.
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.UnregisterAsClient Method

BNCSCsiUnregisterAsClient Method
Unregisters as a client with CSI
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void UnregisterAsClient()
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.UnregisterForDevice Method

BNCSCsiUnregisterForDevice Method
Unregisters for revertives from a particular device.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void UnregisterForDevice(
    uint deviceNumber_,
    uint startIndex_,
    uint endIndex_
)

Parameters

deviceNumber_
Type: SystemUInt32
Device number
startIndex_
Type: SystemUInt32
Starting index of registration
endIndex_
Type: SystemUInt32
Ending index of registration
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.UnregisterForDeviceEntirely Method

BNCSCsiUnregisterForDeviceEntirely Method
Unregisters entirely from a device.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void UnregisterForDeviceEntirely(
    uint deviceNumber_
)

Parameters

deviceNumber_
Type: SystemUInt32
Device number
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.UnregisterForDriverID Method

BNCSCsiUnregisterForDriverID Method
Unregisters with CSI as a driver.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void UnregisterForDriverID(
    uint driverId_
)

Parameters

driverId_
Type: SystemUInt32
Driver ID
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.UnRegisterForPacketErrors Method

BNCSCsiUnRegisterForPacketErrors Method
UnRegisters with CSI so we no longer receive notification of packet errors.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void UnRegisterForPacketErrors()
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.VerbatimMessage Method

BNCSCsiVerbatimMessage Method
Sends a universal revertive message to the network

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void VerbatimMessage(
    string message_
)

Parameters

message_
Type: SystemString
Message to send
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi Properties

BNCSCsi Properties

The BNCSCsi type exposes the following members.

Properties
Name Description
Public property DevNum
BNCS device number
(Inherited from BNCSDevice.)
HostConnectState
Device connection status
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
Public property IfMode
Current TXRX mode (updated with GetTxRx, SetRxOnly and SetTxRx)
(Inherited from BNCSDevice.)
IsRegisteredAsClient
Whether we are registered as a client with CSI
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
Public property IsRegisteredForPktErrs
Whether we are registered with CSI to receive packet error notifications.
Public property LocalHandle
Local window handle
(Inherited from BNCSDevice.)
Public property Name
Device name, for custom use
(Inherited from BNCSDevice.)
Public property OkToGoRxOnly
Whether the host InfoDriver can change its IfMode to RxOnly (defaults to true)
(Inherited from BNCSDevice.)
Public property OkToGoTXRX
Whether the host InfoDriver can change its IfMode to TxRx (defaults to false)
(Inherited from BNCSDevice.)
Public property Statistics
Message and error counts.
(Inherited from BNCSDevice.)
Public property Tag
User-defined object used to identify this driver instance.
(Inherited from BNCSDevice.)
Public property WindowHandle
Driver window handle
(Inherited from BNCSDevice.)
Public property WorkstationID
Workstation ID, returned by a Connect call to CSI
Top
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.IsRegisteredAsClient Property

BNCSCsiIsRegisteredAsClient Property
Whether we are registered as a client with CSI
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool IsRegisteredAsClient { get; set; }

Property Value

Type: Boolean
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.IsRegisteredForPktErrs Property

BNCSCsiIsRegisteredForPktErrs Property
Whether we are registered with CSI to receive packet error notifications.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool IsRegisteredForPktErrs { get; set; }

Property Value

Type: Boolean
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.WorkstationID Property

BNCSCsiWorkstationID Property
Workstation ID, returned by a Connect call to CSI

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint WorkstationID { get; set; }

Property Value

Type: UInt32
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi Events

BNCSCsi Events

The BNCSCsi type exposes the following members.

Events
Name Description
Public event ClientDatabaseChanged
Event triggered when a database changes (notification only, actual information needs to be requested directly from CSI)
Public event ClientPacketSerialErrorDetected
Event triggered when CSI detects a packet serial number error.
Public event ClientRevertiveReceived
Event triggered when a client revertive string is received from CSI
Public event ClientTxRxMessageReceived
Event triggered when a NETTXRXSTATUS message is received by CSI
Public event ConnectAttempt
Event triggered when a connect attempt is made to the host driver.
(Inherited from BNCSDevice.)
Public event DatabaseChanged
Event triggered when the host driver indicates a database change has occurred
(Inherited from BNCSDevice.)
Public event GpiClientRevertiveReceived
Event triggered when a GPI client revertive is received
Public event HostClosing
Event triggered when the host BNCS driver is closing
(Inherited from BNCSDevice.)
HostConnected
Event triggered when the host BNCS driver has connected
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
HostConnectStatusChanged
Event triggered when the connect status of the host driver has changed
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
Public event HostIfModeChanged
Event triggered when the IfMode of the host BNCS driver has changed
(Inherited from BNCSDevice.)
Public event InfoDriverClientRevertiveReceived
Event triggered when an InfoDriver client revertive is received
Public event RouterClientRevertiveReceived
Event triggered when a Router client revertive is received
Public event UserStringReceived
Event triggered when a new User String is received from the host infodriver
(Inherited from BNCSDevice.)
Top
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.ClientDatabaseChanged Event

BNCSCsiClientDatabaseChanged Event
Event triggered when a database changes (notification only, actual information needs to be requested directly from CSI)

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event EventHandler<BncsClientDatabaseChangeEventArgs> ClientDatabaseChanged

Value

Type: SystemEventHandler BncsClientDatabaseChangeEventArgs
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.ClientPacketSerialErrorDetected Event

BNCSCsiClientPacketSerialErrorDetected Event
Event triggered when CSI detects a packet serial number error.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event EventHandler<BncsClientPktSerErrEventArgs> ClientPacketSerialErrorDetected

Value

Type: SystemEventHandler BncsClientPktSerErrEventArgs
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.ClientRevertiveReceived Event

BNCSCsiClientRevertiveReceived Event
Event triggered when a client revertive string is received from CSI

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event EventHandler<BncsClientRevertiveEventArgs> ClientRevertiveReceived

Value

Type: SystemEventHandler BncsClientRevertiveEventArgs
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.ClientTxRxMessageReceived Event

BNCSCsiClientTxRxMessageReceived Event
Event triggered when a NETTXRXSTATUS message is received by CSI

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event EventHandler<BncsClientTxRxNetMsgEventArgs> ClientTxRxMessageReceived

Value

Type: SystemEventHandler BncsClientTxRxNetMsgEventArgs
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.GpiClientRevertiveReceived Event

BNCSCsiGpiClientRevertiveReceived Event
Event triggered when a GPI client revertive is received

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event EventHandler<BncsGpiClientRevertiveEventArgs> GpiClientRevertiveReceived

Value

Type: SystemEventHandler BncsGpiClientRevertiveEventArgs
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.InfoDriverClientRevertiveReceived Event

BNCSCsiInfoDriverClientRevertiveReceived Event
Event triggered when an InfoDriver client revertive is received

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event EventHandler<BncsInfoDriverClientRevertiveEventArgs> InfoDriverClientRevertiveReceived

Value

Type: SystemEventHandler BncsInfoDriverClientRevertiveEventArgs
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BNCSCsi.RouterClientRevertiveReceived Event

BNCSCsiRouterClientRevertiveReceived Event
Event triggered when a Router client revertive is received

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event EventHandler<BncsRouterClientRevertiveEventArgs> RouterClientRevertiveReceived

Value

Type: SystemEventHandler BncsRouterClientRevertiveEventArgs
See Also

Reference

BNCSCsi Class
DigitalGiles.BNCS Namespace


BncsDatabaseChangeEventArgs Class

BncsDatabaseChangeEventArgs Class
Event arguments associated with the DatabaseChanged event
Inheritance Hierarchy
SystemObject
SystemEventArgs
DigitalGiles.BNCSBncsUserStrEventArgs
DigitalGiles.BNCSBncsDatabaseChangeEventArgs

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BncsDatabaseChangeEventArgs : BncsUserStrEventArgs

The BncsDatabaseChangeEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | BncsDatabaseChangeEventArgs | Creates a new BncsDatabaseChangeEventArgs object
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns the class represented as a string (Inherited from BncsUserStrEventArgs.)
Top
Properties
 | Name | Description
Public property | DatabaseIndex | The database index that has been updated
Public property | DatabaseNumber | The database number that has been updated
Public property | DatabaseValue | The new database value
Public property | DriverNumber | The driver number whose database has been updated (not really needed for anything)
Public property | Flag | Database updates flag
Public property | UserString | The User String (like "IW 104 'hello' 1") that was received (Inherited from BncsUserStrEventArgs.)
Public property | Workstation | The workstation number that originated the request
Top
See Also

Reference

DigitalGiles.BNCS Namespace


BncsDatabaseChangeEventArgs Constructor

BncsDatabaseChangeEventArgs Constructor
Creates a new BncsDatabaseChangeEventArgs object

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsDatabaseChangeEventArgs()
See Also

Reference

BncsDatabaseChangeEventArgs Class
DigitalGiles.BNCS Namespace


BncsDatabaseChangeEventArgs Methods

BncsDatabaseChangeEventArgs Methods

The BncsDatabaseChangeEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns the class represented as a string (Inherited from BncsUserStrEventArgs.)
Top
See Also

Reference

BncsDatabaseChangeEventArgs Class
DigitalGiles.BNCS Namespace


BncsDatabaseChangeEventArgs Properties

BncsDatabaseChangeEventArgs Properties

The BncsDatabaseChangeEventArgs type exposes the following members.

Properties
 | Name | Description
Public property | DatabaseIndex | The database index that has been updated
Public property | DatabaseNumber | The database number that has been updated
Public property | DatabaseValue | The new database value
Public property | DriverNumber | The driver number whose database has been updated (not really needed for anything)
Public property | Flag | Database updates flag
Public property | UserString | The User String (like "IW 104 'hello' 1") that was received (Inherited from BncsUserStrEventArgs.)
Public property | Workstation | The workstation number that originated the request
Top
See Also

Reference

BncsDatabaseChangeEventArgs Class
DigitalGiles.BNCS Namespace


BncsDatabaseChangeEventArgs.DatabaseIndex Property

BncsDatabaseChangeEventArgsDatabaseIndex Property
The database index that has been updated

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint DatabaseIndex { get; set; }

Property Value

Type: UInt32
See Also

Reference

BncsDatabaseChangeEventArgs Class
DigitalGiles.BNCS Namespace


BncsDatabaseChangeEventArgs.DatabaseNumber Property

BncsDatabaseChangeEventArgsDatabaseNumber Property
The database number that has been updated

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint DatabaseNumber { get; set; }

Property Value

Type: UInt32
See Also

Reference

BncsDatabaseChangeEventArgs Class
DigitalGiles.BNCS Namespace


BncsDatabaseChangeEventArgs.DatabaseValue Property

BncsDatabaseChangeEventArgsDatabaseValue Property
The new database value

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string DatabaseValue { get; set; }

Property Value

Type: String
See Also

Reference

BncsDatabaseChangeEventArgs Class
DigitalGiles.BNCS Namespace


BncsDatabaseChangeEventArgs.DriverNumber Property

BncsDatabaseChangeEventArgsDriverNumber Property
The driver number whose database has been updated (not really needed for anything)

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint DriverNumber { get; set; }

Property Value

Type: UInt32
See Also

Reference

BncsDatabaseChangeEventArgs Class
DigitalGiles.BNCS Namespace


BncsDatabaseChangeEventArgs.Flag Property

BncsDatabaseChangeEventArgsFlag Property
Database updates flag

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Flag { get; set; }

Property Value

Type: Int32
See Also

Reference

BncsDatabaseChangeEventArgs Class
DigitalGiles.BNCS Namespace


BncsDatabaseChangeEventArgs.Workstation Property

BncsDatabaseChangeEventArgsWorkstation Property
The workstation number that originated the request

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint Workstation { get; set; }

Property Value

Type: UInt32
See Also

Reference

BncsDatabaseChangeEventArgs Class
DigitalGiles.BNCS Namespace


BNCSDevice Class

BNCSDevice Class
Giles' BNCSDevice class, provides the base from which all driver objects are derived
Inheritance Hierarchy
SystemObject
DigitalGiles.BNCSBNCSDevice
DigitalGiles.BNCSBNCSCsi
DigitalGiles.BNCSBNCSGenericRouterDriver
DigitalGiles.BNCSBNCSInfoDriver
DigitalGiles.BNCSBNCSResilentInfoDriver

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public abstract class BNCSDevice : IDisposable

The BNCSDevice type exposes the following members.

Constructors
 | Name | Description
Public method | BNCSDevice | Initializes a new instance of the BNCSDevice class
Top
Methods
Name Description
Public method ChangeIfMode
Sets the InfoDriver's IfMode
Public method ClearStatistics
Clears all statistics counters.
Connect
Attempt to connect to BNCS.
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
Disconnect
Disconnect from BNCS
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
Public method Dispose
Dispose of the BNCS Device and release all its resources.
Public method Equals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public method GetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public method GetIfMode
Retrieves the IFMODE of the connected host driver
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method IncrementUserCounter
Increment a User Counter.
Public method SendCsiClosingMessage
Sends the CSI Closing message to the host driver, which should cause it to shut down. Only valid for InfoDrivers and GRDs.
Public method StopThread
Stops the RX message thread
Public method StopTimer
Forcibly stops the connect timer, if running
Public method ToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
Name Description
Public property DevNum
BNCS device number
HostConnectState
Device connection status
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
Public property IfMode
Current TXRX mode (updated with GetTxRx, SetRxOnly and SetTxRx)
Public property LocalHandle
Local window handle
Public property Name
Device name, for custom use
Public property OkToGoRxOnly
Whether the host InfoDriver can change its IfMode to RxOnly (defaults to true)
Public property OkToGoTXRX
Whether the host InfoDriver can change its IfMode to TxRx (defaults to false)
Public property Statistics
Message and error counts.
Public property Tag
User-defined object used to identify this driver instance.
Public property WindowHandle
Driver window handle
Top
Events
Name Description
Public event ConnectAttempt
Event triggered when a connect attempt is made to the host driver.
Public event DatabaseChanged
Event triggered when the host driver indicates a database change has occurred
Public event HostClosing
Event triggered when the host BNCS driver is closing
HostConnected
Event triggered when the host BNCS driver has connected
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
HostConnectStatusChanged
Event triggered when the connect status of the host driver has changed
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
Public event HostIfModeChanged
Event triggered when the IfMode of the host BNCS driver has changed
Public event UserStringReceived
Event triggered when a new User String is received from the host infodriver
Top
See Also

Reference

DigitalGiles.BNCS Namespace


BNCSDevice Constructor

BNCSDevice Constructor
Initializes a new instance of the BNCSDevice class

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSDevice()
See Also

Reference

BNCSDevice Class
DigitalGiles.BNCS Namespace


BNCSDevice Methods

BNCSDevice Methods

The BNCSDevice type exposes the following members.

Methods
Name Description
Public method ChangeIfMode
Sets the InfoDriver's IfMode
Public method ClearStatistics
Clears all statistics counters.
Connect
Attempt to connect to BNCS.
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
Disconnect
Disconnect from BNCS
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
Public method Dispose
Dispose of the BNCS Device and release all its resources.
Public method Equals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public method GetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public method GetIfMode
Retrieves the IFMODE of the connected host driver
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method IncrementUserCounter
Increment a User Counter.
Public method SendCsiClosingMessage
Sends the CSI Closing message to the host driver, which should cause it to shut down. Only valid for InfoDrivers and GRDs.
Public method StopThread
Stops the RX message thread
Public method StopTimer
Forcibly stops the connect timer, if running
Public method ToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
See Also

Reference

BNCSDevice Class
DigitalGiles.BNCS Namespace


BNCSDevice.ChangeIfMode Method

BNCSDeviceChangeIfMode Method
Sets the InfoDriver's IfMode

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public virtual void ChangeIfMode(
    HostDriverIFMode newIfMode_
)

Parameters

newIfMode_
Type: DigitalGiles.BNCSHostDriverIFMode
The required IfMode
See Also

Reference

BNCSDevice Class
DigitalGiles.BNCS Namespace


BNCSDevice.ClearStatistics Method

BNCSDeviceClearStatistics Method
Clears all statistics counters.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void ClearStatistics()
See Also

Reference

BNCSDevice Class
DigitalGiles.BNCS Namespace


BNCSDevice.Connect Method

BNCSDeviceConnect Method
Attempt to connect to BNCS.
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Connect(
    bool retry_
)

Parameters

retry_
Type: SystemBoolean
Set to TRUE to continually try connecting if the first attempt receives no reply
See Also

Reference

BNCSDevice Class
DigitalGiles.BNCS Namespace


BNCSDevice.Disconnect Method

BNCSDeviceDisconnect Method
Disconnect from BNCS
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Disconnect()
See Also

Reference

BNCSDevice Class
DigitalGiles.BNCS Namespace


BNCSDevice.Dispose Method

BNCSDeviceDispose Method
Dispose of the BNCS Device and release all its resources.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Dispose()

Implements

IDisposableDispose
See Also

Reference

BNCSDevice Class
DigitalGiles.BNCS Namespace


BNCSDevice.GetIfMode Method

BNCSDeviceGetIfMode Method
Retrieves the IFMODE of the connected host driver

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public HostDriverIFMode GetIfMode()

Return Value

Type: HostDriverIFMode
The current IFMode
See Also

Reference

BNCSDevice Class
DigitalGiles.BNCS Namespace


BNCSDevice.IncrementUserCounter Method

BNCSDeviceIncrementUserCounter Method
Increment a User Counter.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void IncrementUserCounter(
    int counter_
)

Parameters

counter_
Type: SystemInt32
The user counter to increment. If the counter is not defined, the request fails silently.
See Also

Reference

BNCSDevice Class
DigitalGiles.BNCS Namespace


BNCSDevice.SendCsiClosingMessage Method

BNCSDeviceSendCsiClosingMessage Method
Sends the CSI Closing message to the host driver, which should cause it to shut down. Only valid for InfoDrivers and GRDs.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void SendCsiClosingMessage()
See Also

Reference

BNCSDevice Class
DigitalGiles.BNCS Namespace


BNCSDevice.StopThread Method

BNCSDeviceStopThread Method
Stops the RX message thread

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool StopThread()

Return Value

Type: Boolean
True if the indow thread has been instantiated
See Also

Reference

BNCSDevice Class
DigitalGiles.BNCS Namespace


BNCSDevice.StopTimer Method

BNCSDeviceStopTimer Method
Forcibly stops the connect timer, if running

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void StopTimer()
See Also

Reference

BNCSDevice Class
DigitalGiles.BNCS Namespace


BNCSDevice Properties

BNCSDevice Properties

The BNCSDevice type exposes the following members.

Properties
Name Description
Public property DevNum
BNCS device number
HostConnectState
Device connection status
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
Public property IfMode
Current TXRX mode (updated with GetTxRx, SetRxOnly and SetTxRx)
Public property LocalHandle
Local window handle
Public property Name
Device name, for custom use
Public property OkToGoRxOnly
Whether the host InfoDriver can change its IfMode to RxOnly (defaults to true)
Public property OkToGoTXRX
Whether the host InfoDriver can change its IfMode to TxRx (defaults to false)
Public property Statistics
Message and error counts.
Public property Tag
User-defined object used to identify this driver instance.
Public property WindowHandle
Driver window handle
Top
See Also

Reference

BNCSDevice Class
DigitalGiles.BNCS Namespace


BNCSDevice.DevNum Property

BNCSDeviceDevNum Property
BNCS device number

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint DevNum { get; set; }

Property Value

Type: UInt32
See Also

Reference

BNCSDevice Class
DigitalGiles.BNCS Namespace


BNCSDevice.HostConnectState Property

BNCSDeviceHostConnectState Property
Device connection status
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public HostDriverConnectState HostConnectState { get; set; }

Property Value

Type: HostDriverConnectState
See Also

Reference

BNCSDevice Class
DigitalGiles.BNCS Namespace


BNCSDevice.IfMode Property

BNCSDeviceIfMode Property
Current TXRX mode (updated with GetTxRx, SetRxOnly and SetTxRx)

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public HostDriverIFMode IfMode { get; set; }

Property Value

Type: HostDriverIFMode
See Also

Reference

BNCSDevice Class
DigitalGiles.BNCS Namespace


BNCSDevice.LocalHandle Property

BNCSDeviceLocalHandle Property
Local window handle

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int LocalHandle { get; }

Property Value

Type: Int32
See Also

Reference

BNCSDevice Class
DigitalGiles.BNCS Namespace


BNCSDevice.Name Property

BNCSDeviceName Property
Device name, for custom use

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Name { get; set; }

Property Value

Type: String
See Also

Reference

BNCSDevice Class
DigitalGiles.BNCS Namespace


BNCSDevice.OkToGoRxOnly Property

BNCSDeviceOkToGoRxOnly Property
Whether the host InfoDriver can change its IfMode to RxOnly (defaults to true)

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool OkToGoRxOnly { get; set; }

Property Value

Type: Boolean
See Also

Reference

BNCSDevice Class
DigitalGiles.BNCS Namespace


BNCSDevice.OkToGoTXRX Property

BNCSDeviceOkToGoTXRX Property
Whether the host InfoDriver can change its IfMode to TxRx (defaults to false)

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool OkToGoTXRX { get; set; }

Property Value

Type: Boolean
See Also

Reference

BNCSDevice Class
DigitalGiles.BNCS Namespace


BNCSDevice.Statistics Property

BNCSDeviceStatistics Property
Message and error counts.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSDeviceStats Statistics { get; }

Property Value

Type: BNCSDeviceStats
See Also

Reference

BNCSDevice Class
DigitalGiles.BNCS Namespace


BNCSDevice.Tag Property

BNCSDeviceTag Property
User-defined object used to identify this driver instance.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Object Tag { get; set; }

Property Value

Type: Object
See Also

Reference

BNCSDevice Class
DigitalGiles.BNCS Namespace


BNCSDevice.WindowHandle Property

BNCSDeviceWindowHandle Property
Driver window handle

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int WindowHandle { get; }

Property Value

Type: Int32
See Also

Reference

BNCSDevice Class
DigitalGiles.BNCS Namespace


BNCSDevice Events

BNCSDevice Events

The BNCSDevice type exposes the following members.

Events
Name Description
Public event ConnectAttempt
Event triggered when a connect attempt is made to the host driver.
Public event DatabaseChanged
Event triggered when the host driver indicates a database change has occurred
Public event HostClosing
Event triggered when the host BNCS driver is closing
HostConnected
Event triggered when the host BNCS driver has connected
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
HostConnectStatusChanged
Event triggered when the connect status of the host driver has changed
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
Public event HostIfModeChanged
Event triggered when the IfMode of the host BNCS driver has changed
Public event UserStringReceived
Event triggered when a new User String is received from the host infodriver
Top
See Also

Reference

BNCSDevice Class
DigitalGiles.BNCS Namespace


BNCSDevice.ConnectAttempt Event

BNCSDeviceConnectAttempt Event
Event triggered when a connect attempt is made to the host driver.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event EventHandler<BncsConnectAttemptEventArgs> ConnectAttempt

Value

Type: SystemEventHandler BncsConnectAttemptEventArgs
See Also

Reference

BNCSDevice Class
DigitalGiles.BNCS Namespace


BNCSDevice.DatabaseChanged Event

BNCSDeviceDatabaseChanged Event
Event triggered when the host driver indicates a database change has occurred

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event EventHandler<BncsDatabaseChangeEventArgs> DatabaseChanged

Value

Type: SystemEventHandler BncsDatabaseChangeEventArgs
See Also

Reference

BNCSDevice Class
DigitalGiles.BNCS Namespace


BNCSDevice.HostClosing Event

BNCSDeviceHostClosing Event
Event triggered when the host BNCS driver is closing

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event EventHandler<BncsClosingEventArgs> HostClosing

Value

Type: SystemEventHandler BncsClosingEventArgs
See Also

Reference

BNCSDevice Class
DigitalGiles.BNCS Namespace


BNCSDevice.HostConnected Event

BNCSDeviceHostConnected Event
Event triggered when the host BNCS driver has connected
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event EventHandler<BncsConnectedEventArgs> HostConnected

Value

Type: SystemEventHandler BncsConnectedEventArgs
See Also

Reference

BNCSDevice Class
DigitalGiles.BNCS Namespace


BNCSDevice.HostConnectStatusChanged Event

BNCSDeviceHostConnectStatusChanged Event
Event triggered when the connect status of the host driver has changed
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event EventHandler<BncsConnectStatusChangedEventArgs> HostConnectStatusChanged

Value

Type: SystemEventHandler BncsConnectStatusChangedEventArgs
See Also

Reference

BNCSDevice Class
DigitalGiles.BNCS Namespace


BNCSDevice.HostIfModeChanged Event

BNCSDeviceHostIfModeChanged Event
Event triggered when the IfMode of the host BNCS driver has changed

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event EventHandler<BncsIfModeEventArgs> HostIfModeChanged

Value

Type: SystemEventHandler BncsIfModeEventArgs
See Also

Reference

BNCSDevice Class
DigitalGiles.BNCS Namespace


BNCSDevice.UserStringReceived Event

BNCSDeviceUserStringReceived Event
Event triggered when a new User String is received from the host infodriver

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event EventHandler<BncsUserStrEventArgs> UserStringReceived

Value

Type: SystemEventHandler BncsUserStrEventArgs
See Also

Reference

BNCSDevice Class
DigitalGiles.BNCS Namespace


BNCSDeviceStats Structure

BNCSDeviceStats Structure
Structure containing counters commonly of interest.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public struct BNCSDeviceStats

The BNCSDeviceStats type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Indicates whether this instance and a specified object are equal. (Inherited from ValueType.)
Public method | GetHashCode | Returns the hash code for this instance. (Inherited from ValueType.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns the fully qualified type name of this instance. (Inherited from ValueType.)
Top
Fields
 | Name | Description
Public field | Errors | Errors
Public field | MessagesRx | RX Messages
Public field | MessagesTx | TX Messages
Public field | Tag | Tag
Public field | UserCounter1 | User count 1
Public field | UserCounter2 | User count 2
Public field | UserCounter3 | User count 3
Public field | UserCounter4 | User count 4
Public field | UserString1 | User string 1
Public field | UserString2 | User string 2
Public field | UserString3 | User string 3
Public field | UserString4 | User string 4
Top
See Also

Reference

DigitalGiles.BNCS Namespace


BNCSDeviceStats Fields

BNCSDeviceStats Fields

The BNCSDeviceStats type exposes the following members.

Fields
 | Name | Description
Public field | Errors | Errors
Public field | MessagesRx | RX Messages
Public field | MessagesTx | TX Messages
Public field | Tag | Tag
Public field | UserCounter1 | User count 1
Public field | UserCounter2 | User count 2
Public field | UserCounter3 | User count 3
Public field | UserCounter4 | User count 4
Public field | UserString1 | User string 1
Public field | UserString2 | User string 2
Public field | UserString3 | User string 3
Public field | UserString4 | User string 4
Top
See Also

Reference

BNCSDeviceStats Structure
DigitalGiles.BNCS Namespace


BNCSDeviceStats.Errors Field

BNCSDeviceStatsErrors Field
Errors

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint Errors

Field Value

Type: UInt32
See Also

Reference

BNCSDeviceStats Structure
DigitalGiles.BNCS Namespace


BNCSDeviceStats.MessagesRx Field

BNCSDeviceStatsMessagesRx Field
RX Messages

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint MessagesRx

Field Value

Type: UInt32
See Also

Reference

BNCSDeviceStats Structure
DigitalGiles.BNCS Namespace


BNCSDeviceStats.MessagesTx Field

BNCSDeviceStatsMessagesTx Field
TX Messages

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint MessagesTx

Field Value

Type: UInt32
See Also

Reference

BNCSDeviceStats Structure
DigitalGiles.BNCS Namespace


BNCSDeviceStats.Tag Field

BNCSDeviceStatsTag Field
Tag

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public Object Tag

Field Value

Type: Object
See Also

Reference

BNCSDeviceStats Structure
DigitalGiles.BNCS Namespace


BNCSDeviceStats.UserCounter1 Field

BNCSDeviceStatsUserCounter1 Field
User count 1

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint UserCounter1

Field Value

Type: UInt32
See Also

Reference

BNCSDeviceStats Structure
DigitalGiles.BNCS Namespace


BNCSDeviceStats.UserCounter2 Field

BNCSDeviceStatsUserCounter2 Field
User count 2

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint UserCounter2

Field Value

Type: UInt32
See Also

Reference

BNCSDeviceStats Structure
DigitalGiles.BNCS Namespace


BNCSDeviceStats.UserCounter3 Field

BNCSDeviceStatsUserCounter3 Field
User count 3

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint UserCounter3

Field Value

Type: UInt32
See Also

Reference

BNCSDeviceStats Structure
DigitalGiles.BNCS Namespace


BNCSDeviceStats.UserCounter4 Field

BNCSDeviceStatsUserCounter4 Field
User count 4

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint UserCounter4

Field Value

Type: UInt32
See Also

Reference

BNCSDeviceStats Structure
DigitalGiles.BNCS Namespace


BNCSDeviceStats.UserString1 Field

BNCSDeviceStatsUserString1 Field
User string 1

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string UserString1

Field Value

Type: String
See Also

Reference

BNCSDeviceStats Structure
DigitalGiles.BNCS Namespace


BNCSDeviceStats.UserString2 Field

BNCSDeviceStatsUserString2 Field
User string 2

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string UserString2

Field Value

Type: String
See Also

Reference

BNCSDeviceStats Structure
DigitalGiles.BNCS Namespace


BNCSDeviceStats.UserString3 Field

BNCSDeviceStatsUserString3 Field
User string 3

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string UserString3

Field Value

Type: String
See Also

Reference

BNCSDeviceStats Structure
DigitalGiles.BNCS Namespace


BNCSDeviceStats.UserString4 Field

BNCSDeviceStatsUserString4 Field
User string 4

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string UserString4

Field Value

Type: String
See Also

Reference

BNCSDeviceStats Structure
DigitalGiles.BNCS Namespace


BNCSDeviceStats Methods

BNCSDeviceStats Methods

The BNCSDeviceStats type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Indicates whether this instance and a specified object are equal. (Inherited from ValueType.)
Public method | GetHashCode | Returns the hash code for this instance. (Inherited from ValueType.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns the fully qualified type name of this instance. (Inherited from ValueType.)
Top
See Also

Reference

BNCSDeviceStats Structure
DigitalGiles.BNCS Namespace


BNCSGenericRouterDriver Class

BNCSGenericRouterDriver Class
Class encapsulating a BNCS Generic Router Driver
Inheritance Hierarchy
SystemObject
DigitalGiles.BNCSBNCSDevice
DigitalGiles.BNCSBNCSGenericRouterDriver

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public sealed class BNCSGenericRouterDriver : BNCSDevice

The BNCSGenericRouterDriver type exposes the following members.

Methods
Name Description
Public method ChangeIfMode
Sets the IF mode
(Overrides BNCSDeviceChangeIfMode(HostDriverIFMode).)
Public method ClearStatistics
Clears all statistics counters.
(Inherited from BNCSDevice.)
Connect
Attempt to connect to BNCS.
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
Disconnect
Disconnect from BNCS
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
Public method Dispose
Dispose of the BNCS Device and release all its resources.
(Inherited from BNCSDevice.)
Public method Equals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public method GetDestList
Iterates through the destination array and returns a list of destinations to which the supplied source is routed.
Public method GetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public method GetIfMode
Retrieves the IFMODE of the connected host driver
(Inherited from BNCSDevice.)
Public method GetSource
Returns the source routed to the supplied destination (local lookup only, use Poll() to store value from BNCS).
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method IncrementUserCounter
Increment a User Counter.
(Inherited from BNCSDevice.)
Public method Poll
Gets the current destination info for all GRD destinations (expect and ignore BBC_GRDDESTINFO for each).
Public method Poll(UInt32)
Polls GRD for what's routed to a particular destination and stores locally (expect and ignore BBC_GRDDESTINFO).
Public method Poll(UInt32, UInt32)
Gets the current destination info for a range of GRD destinations (expect and ignore BBC_GRDDESTINFO for each).
Public method SendCsiClosingMessage
Sends the CSI Closing message to the host driver, which should cause it to shut down. Only valid for InfoDrivers and GRDs.
(Inherited from BNCSDevice.)
Public method SendRevertive
Sets a GRD destination to a particular source (i.e. sends a revertive). Expect BBC_GRDREVINFO back.
Public method SendRevertiveIfChanged
Stores an updated tally if the source differs from what's currently routed.
Public method StopThread
Stops the RX message thread
(Inherited from BNCSDevice.)
Public method StopTimer
Forcibly stops the connect timer, if running
(Inherited from BNCSDevice.)
Public method ToString
Returns a string that represents the current object.
(Inherited from Object.)
Public method UpdateDestInfo
Stores a new source-destination crosspoint in memory (i.e. does not touch BNCS).
Top
Properties
Name Description
Public property DestCount
Gets the GRD's number of destinations.
Public property DevNum
BNCS device number
(Inherited from BNCSDevice.)
HostConnectState
Device connection status
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
Public property IfMode
Current TXRX mode (updated with GetTxRx, SetRxOnly and SetTxRx)
(Inherited from BNCSDevice.)
Public property LocalHandle
Local window handle
(Inherited from BNCSDevice.)
Public property Name
Device name, for custom use
(Inherited from BNCSDevice.)
Public property OkToGoRxOnly
Whether the host InfoDriver can change its IfMode to RxOnly (defaults to true)
(Inherited from BNCSDevice.)
Public property OkToGoTXRX
Whether the host InfoDriver can change its IfMode to TxRx (defaults to false)
(Inherited from BNCSDevice.)
Public property Statistics
Message and error counts.
(Inherited from BNCSDevice.)
Public property Tag
User-defined object used to identify this driver instance.
(Inherited from BNCSDevice.)
Public property WindowHandle
Driver window handle
(Inherited from BNCSDevice.)
Top
Events
Name Description
Public event ConnectAttempt
Event triggered when a connect attempt is made to the host driver.
(Inherited from BNCSDevice.)
Public event CrosspointRequest
Event triggered when the connected GRD receives a request to set a crosspoint
Public event DatabaseChanged
Event triggered when the host driver indicates a database change has occurred
(Inherited from BNCSDevice.)
Public event HostClosing
Event triggered when the host BNCS driver is closing
(Inherited from BNCSDevice.)
HostConnected
Event triggered when the host BNCS driver has connected
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
HostConnectStatusChanged
Event triggered when the connect status of the host driver has changed
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
Public event HostIfModeChanged
Event triggered when the IfMode of the host BNCS driver has changed
(Inherited from BNCSDevice.)
Public event UserStringReceived
Event triggered when a new User String is received from the host infodriver
(Inherited from BNCSDevice.)
Top
See Also

Reference

DigitalGiles.BNCS Namespace


BNCSGenericRouterDriver Methods

BNCSGenericRouterDriver Methods

The BNCSGenericRouterDriver type exposes the following members.

Methods
Name Description
Public method ChangeIfMode
Sets the IF mode
(Overrides BNCSDeviceChangeIfMode(HostDriverIFMode).)
Public method ClearStatistics
Clears all statistics counters.
(Inherited from BNCSDevice.)
Connect
Attempt to connect to BNCS.
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
Disconnect
Disconnect from BNCS
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
Public method Dispose
Dispose of the BNCS Device and release all its resources.
(Inherited from BNCSDevice.)
Public method Equals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public method GetDestList
Iterates through the destination array and returns a list of destinations to which the supplied source is routed.
Public method GetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public method GetIfMode
Retrieves the IFMODE of the connected host driver
(Inherited from BNCSDevice.)
Public method GetSource
Returns the source routed to the supplied destination (local lookup only, use Poll() to store value from BNCS).
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method IncrementUserCounter
Increment a User Counter.
(Inherited from BNCSDevice.)
Public method Poll
Gets the current destination info for all GRD destinations (expect and ignore BBC_GRDDESTINFO for each).
Public method Poll(UInt32)
Polls GRD for what's routed to a particular destination and stores locally (expect and ignore BBC_GRDDESTINFO).
Public method Poll(UInt32, UInt32)
Gets the current destination info for a range of GRD destinations (expect and ignore BBC_GRDDESTINFO for each).
Public method SendCsiClosingMessage
Sends the CSI Closing message to the host driver, which should cause it to shut down. Only valid for InfoDrivers and GRDs.
(Inherited from BNCSDevice.)
Public method SendRevertive
Sets a GRD destination to a particular source (i.e. sends a revertive). Expect BBC_GRDREVINFO back.
Public method SendRevertiveIfChanged
Stores an updated tally if the source differs from what's currently routed.
Public method StopThread
Stops the RX message thread
(Inherited from BNCSDevice.)
Public method StopTimer
Forcibly stops the connect timer, if running
(Inherited from BNCSDevice.)
Public method ToString
Returns a string that represents the current object.
(Inherited from Object.)
Public method UpdateDestInfo
Stores a new source-destination crosspoint in memory (i.e. does not touch BNCS).
Top
See Also

Reference

BNCSGenericRouterDriver Class
DigitalGiles.BNCS Namespace


BNCSGenericRouterDriver.ChangeIfMode Method

BNCSGenericRouterDriverChangeIfMode Method
Sets the IF mode

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override void ChangeIfMode(
    HostDriverIFMode newIfMode_
)

Parameters

newIfMode_
Type: DigitalGiles.BNCSHostDriverIFMode
The required IfMode
See Also

Reference

BNCSGenericRouterDriver Class
DigitalGiles.BNCS Namespace


BNCSGenericRouterDriver.GetDestList Method

BNCSGenericRouterDriverGetDestList Method
Iterates through the destination array and returns a list of destinations to which the supplied source is routed.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public List<uint> GetDestList(
    int sourceNumber_
)

Parameters

sourceNumber_
Type: SystemInt32
The source to search by.

Return Value

Type: List UInt32
List of destinations
See Also

Reference

BNCSGenericRouterDriver Class
DigitalGiles.BNCS Namespace


BNCSGenericRouterDriver.GetSource Method

BNCSGenericRouterDriverGetSource Method
Returns the source routed to the supplied destination (local lookup only, use Poll() to store value from BNCS).

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int GetSource(
    uint destinationNumber_
)

Parameters

destinationNumber_
Type: SystemUInt32
Destination number of interest.

Return Value

Type: Int32
A source number
See Also

Reference

BNCSGenericRouterDriver Class
DigitalGiles.BNCS Namespace


BNCSGenericRouterDriver.Poll Method

BNCSGenericRouterDriverPoll Method
Overload List
 | Name | Description
Public method | Poll | Gets the current destination info for all GRD destinations (expect and ignore BBC_GRDDESTINFO for each).
Public method | Poll(UInt32) | Polls GRD for what's routed to a particular destination and stores locally (expect and ignore BBC_GRDDESTINFO).
Public method | Poll(UInt32, UInt32) | Gets the current destination info for a range of GRD destinations (expect and ignore BBC_GRDDESTINFO for each).
Top
See Also

Reference

BNCSGenericRouterDriver Class
DigitalGiles.BNCS Namespace


BNCSGenericRouterDriver.Poll Method

BNCSGenericRouterDriverPoll Method
Gets the current destination info for all GRD destinations (expect and ignore BBC_GRDDESTINFO for each).

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Poll()

Return Value

Type: Boolean
True if all destinations look to have been got.
See Also

Reference

BNCSGenericRouterDriver Class
Poll Overload
DigitalGiles.BNCS Namespace


BNCSGenericRouterDriver.Poll Method (UInt32)

BNCSGenericRouterDriverPoll Method (UInt32)
Polls GRD for what's routed to a particular destination and stores locally (expect and ignore BBC_GRDDESTINFO).

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Poll(
    uint destinationNumber_
)

Parameters

destinationNumber_
Type: SystemUInt32
Destination of interest.

Return Value

Type: Boolean
True if the operation was successful
See Also

Reference

BNCSGenericRouterDriver Class
Poll Overload
DigitalGiles.BNCS Namespace


BNCSGenericRouterDriver.Poll Method (UInt32, UInt32)

BNCSGenericRouterDriverPoll Method (UInt32, UInt32)
Gets the current destination info for a range of GRD destinations (expect and ignore BBC_GRDDESTINFO for each).

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Poll(
    uint startDestination_,
    uint endDestination_
)

Parameters

startDestination_
Type: SystemUInt32
Starting destination.
endDestination_
Type: SystemUInt32
End destination.

Return Value

Type: Boolean
True if all destinations look to have been got.
See Also

Reference

BNCSGenericRouterDriver Class
Poll Overload
DigitalGiles.BNCS Namespace


BNCSGenericRouterDriver.SendRevertive Method

BNCSGenericRouterDriverSendRevertive Method
Sets a GRD destination to a particular source (i.e. sends a revertive). Expect BBC_GRDREVINFO back.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void SendRevertive(
    int sourceNumber_,
    uint destinationNumber_
)

Parameters

sourceNumber_
Type: SystemInt32
Source routed.
destinationNumber_
Type: SystemUInt32
Destination that the source is routed to.
See Also

Reference

BNCSGenericRouterDriver Class
DigitalGiles.BNCS Namespace


BNCSGenericRouterDriver.SendRevertiveIfChanged Method

BNCSGenericRouterDriverSendRevertiveIfChanged Method
Stores an updated tally if the source differs from what's currently routed.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void SendRevertiveIfChanged(
    int sourceNumber_,
    uint destinationNumber_
)

Parameters

sourceNumber_
Type: SystemInt32
Source routed.
destinationNumber_
Type: SystemUInt32
Destination that the source is routed to.
See Also

Reference

BNCSGenericRouterDriver Class
DigitalGiles.BNCS Namespace


BNCSGenericRouterDriver.UpdateDestInfo Method

BNCSGenericRouterDriverUpdateDestInfo Method
Stores a new source-destination crosspoint in memory (i.e. does not touch BNCS).

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool UpdateDestInfo(
    uint destination_,
    int source_
)

Parameters

destination_
Type: SystemUInt32
Destination.
source_
Type: SystemInt32
Source.

Return Value

Type: Boolean
True if the operation was successful.
See Also

Reference

BNCSGenericRouterDriver Class
DigitalGiles.BNCS Namespace


BNCSGenericRouterDriver Properties

BNCSGenericRouterDriver Properties

The BNCSGenericRouterDriver type exposes the following members.

Properties
Name Description
Public property DestCount
Gets the GRD's number of destinations.
Public property DevNum
BNCS device number
(Inherited from BNCSDevice.)
HostConnectState
Device connection status
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
Public property IfMode
Current TXRX mode (updated with GetTxRx, SetRxOnly and SetTxRx)
(Inherited from BNCSDevice.)
Public property LocalHandle
Local window handle
(Inherited from BNCSDevice.)
Public property Name
Device name, for custom use
(Inherited from BNCSDevice.)
Public property OkToGoRxOnly
Whether the host InfoDriver can change its IfMode to RxOnly (defaults to true)
(Inherited from BNCSDevice.)
Public property OkToGoTXRX
Whether the host InfoDriver can change its IfMode to TxRx (defaults to false)
(Inherited from BNCSDevice.)
Public property Statistics
Message and error counts.
(Inherited from BNCSDevice.)
Public property Tag
User-defined object used to identify this driver instance.
(Inherited from BNCSDevice.)
Public property WindowHandle
Driver window handle
(Inherited from BNCSDevice.)
Top
See Also

Reference

BNCSGenericRouterDriver Class
DigitalGiles.BNCS Namespace


BNCSGenericRouterDriver.DestCount Property

BNCSGenericRouterDriverDestCount Property
Gets the GRD's number of destinations.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint DestCount { get; }

Property Value

Type: UInt32
See Also

Reference

BNCSGenericRouterDriver Class
DigitalGiles.BNCS Namespace


BNCSGenericRouterDriver Events

BNCSGenericRouterDriver Events

The BNCSGenericRouterDriver type exposes the following members.

Events
Name Description
Public event ConnectAttempt
Event triggered when a connect attempt is made to the host driver.
(Inherited from BNCSDevice.)
Public event CrosspointRequest
Event triggered when the connected GRD receives a request to set a crosspoint
Public event DatabaseChanged
Event triggered when the host driver indicates a database change has occurred
(Inherited from BNCSDevice.)
Public event HostClosing
Event triggered when the host BNCS driver is closing
(Inherited from BNCSDevice.)
HostConnected
Event triggered when the host BNCS driver has connected
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
HostConnectStatusChanged
Event triggered when the connect status of the host driver has changed
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
Public event HostIfModeChanged
Event triggered when the IfMode of the host BNCS driver has changed
(Inherited from BNCSDevice.)
Public event UserStringReceived
Event triggered when a new User String is received from the host infodriver
(Inherited from BNCSDevice.)
Top
See Also

Reference

BNCSGenericRouterDriver Class
DigitalGiles.BNCS Namespace


BNCSGenericRouterDriver.CrosspointRequest Event

BNCSGenericRouterDriverCrosspointRequest Event
Event triggered when the connected GRD receives a request to set a crosspoint

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event EventHandler<BncsCrosspointRequestEventArgs> CrosspointRequest

Value

Type: SystemEventHandler BncsCrosspointRequestEventArgs
See Also

Reference

BNCSGenericRouterDriver Class
DigitalGiles.BNCS Namespace


BncsGpiClientRevertiveEventArgs Class

BncsGpiClientRevertiveEventArgs Class
Event arguments associated with the GpiClientRevertiveReceived event
Inheritance Hierarchy
SystemObject
SystemEventArgs
DigitalGiles.BNCSBncsClientRevertiveEventArgs
DigitalGiles.BNCSBncsSpecificClientEventArgs
DigitalGiles.BNCSBncsGpiClientRevertiveEventArgs

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BncsGpiClientRevertiveEventArgs : BncsSpecificClientEventArgs

The BncsGpiClientRevertiveEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | BncsGpiClientRevertiveEventArgs | Creates a new BncsGpiClientRevertiveEventArgs object
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | DriverNumber | The driver number (Inherited from BncsSpecificClientEventArgs.)
Public property | Index | The GPI that has changed
Public property | RevertiveString | Revertive string as received from CSI (Inherited from BncsClientRevertiveEventArgs.)
Public property | Status | The current status (true or false) of the GPI
Top
See Also

Reference

DigitalGiles.BNCS Namespace


BncsGpiClientRevertiveEventArgs Constructor

BncsGpiClientRevertiveEventArgs Constructor
Creates a new BncsGpiClientRevertiveEventArgs object

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsGpiClientRevertiveEventArgs()
See Also

Reference

BncsGpiClientRevertiveEventArgs Class
DigitalGiles.BNCS Namespace


BncsGpiClientRevertiveEventArgs Methods

BncsGpiClientRevertiveEventArgs Methods

The BncsGpiClientRevertiveEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

BncsGpiClientRevertiveEventArgs Class
DigitalGiles.BNCS Namespace


BncsGpiClientRevertiveEventArgs Properties

BncsGpiClientRevertiveEventArgs Properties

The BncsGpiClientRevertiveEventArgs type exposes the following members.

Properties
 | Name | Description
Public property | DriverNumber | The driver number (Inherited from BncsSpecificClientEventArgs.)
Public property | Index | The GPI that has changed
Public property | RevertiveString | Revertive string as received from CSI (Inherited from BncsClientRevertiveEventArgs.)
Public property | Status | The current status (true or false) of the GPI
Top
See Also

Reference

BncsGpiClientRevertiveEventArgs Class
DigitalGiles.BNCS Namespace


BncsGpiClientRevertiveEventArgs.Index Property

BncsGpiClientRevertiveEventArgsIndex Property
The GPI that has changed

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint Index { get; set; }

Property Value

Type: UInt32
See Also

Reference

BncsGpiClientRevertiveEventArgs Class
DigitalGiles.BNCS Namespace


BncsGpiClientRevertiveEventArgs.Status Property

BncsGpiClientRevertiveEventArgsStatus Property
The current status (true or false) of the GPI

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Status { get; set; }

Property Value

Type: Boolean
See Also

Reference

BncsGpiClientRevertiveEventArgs Class
DigitalGiles.BNCS Namespace


BncsIfModeEventArgs Class

BncsIfModeEventArgs Class
Event arguments associated with the IfModeChanged event
Inheritance Hierarchy
SystemObject
SystemEventArgs
DigitalGiles.BNCSBncsIfModeEventArgs

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BncsIfModeEventArgs : EventArgs

The BncsIfModeEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | BncsIfModeEventArgs | Creates a new BncsIfModeEventArgs object
Public method | BncsIfModeEventArgs(HostDriverIFMode) | Creates a new BncsIfModeEventArgs with a supplied IfMode
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | IfMode | The IfMode of the host driver
Top
See Also

Reference

DigitalGiles.BNCS Namespace


BncsIfModeEventArgs Constructor

BncsIfModeEventArgs Constructor
Overload List
 | Name | Description
Public method | BncsIfModeEventArgs | Creates a new BncsIfModeEventArgs object
Public method | BncsIfModeEventArgs(HostDriverIFMode) | Creates a new BncsIfModeEventArgs with a supplied IfMode
Top
See Also

Reference

BncsIfModeEventArgs Class
DigitalGiles.BNCS Namespace


BncsIfModeEventArgs Constructor

BncsIfModeEventArgs Constructor
Creates a new BncsIfModeEventArgs object

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsIfModeEventArgs()
See Also

Reference

BncsIfModeEventArgs Class
BncsIfModeEventArgs Overload
DigitalGiles.BNCS Namespace


BncsIfModeEventArgs Constructor (HostDriverIFMode)

BncsIfModeEventArgs Constructor (HostDriverIFMode)
Creates a new BncsIfModeEventArgs with a supplied IfMode

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsIfModeEventArgs(
    HostDriverIFMode newMode_
)

Parameters

newMode_
Type: DigitalGiles.BNCSHostDriverIFMode
IfMode of the host driver
See Also

Reference

BncsIfModeEventArgs Class
BncsIfModeEventArgs Overload
DigitalGiles.BNCS Namespace


BncsIfModeEventArgs Methods

BncsIfModeEventArgs Methods

The BncsIfModeEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

BncsIfModeEventArgs Class
DigitalGiles.BNCS Namespace


BncsIfModeEventArgs Properties

BncsIfModeEventArgs Properties

The BncsIfModeEventArgs type exposes the following members.

Properties
 | Name | Description
Public property | IfMode | The IfMode of the host driver
Top
See Also

Reference

BncsIfModeEventArgs Class
DigitalGiles.BNCS Namespace


BncsIfModeEventArgs.IfMode Property

BncsIfModeEventArgsIfMode Property
The IfMode of the host driver

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public HostDriverIFMode IfMode { get; set; }

Property Value

Type: HostDriverIFMode
See Also

Reference

BncsIfModeEventArgs Class
DigitalGiles.BNCS Namespace


BncsIfModeException Class

BncsIfModeException Class
The exception that is throw when a problem is encountered with the BNCS IFMODE configuration.
Inheritance Hierarchy
SystemObject
SystemException
DigitalGiles.BNCSBncsIfModeException

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BncsIfModeException : Exception

The BncsIfModeException type exposes the following members.

Constructors
 | Name | Description
Public method | BncsIfModeException | Initialises a new BncsIfModeException object.
Public method | BncsIfModeException(String) | Initialises a new BncsIfModeException object.
Public method | BncsIfModeException(String, Exception) | Initialises a new BncsIfModeException object.
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetBaseException | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions. (Inherited from Exception.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetObjectData | When overridden in a derived class, sets the SerializationInfo with information about the exception. (Inherited from Exception.)
Public method | GetType | Gets the runtime type of the current instance. (Inherited from Exception.)
Public method | ToString | Creates and returns a string representation of the current exception. (Inherited from Exception.)
Top
Properties
 | Name | Description
Public property | Data | Gets a collection of key/value pairs that provide additional user-defined information about the exception. (Inherited from Exception.)
Public property | HelpLink | Gets or sets a link to the help file associated with this exception. (Inherited from Exception.)
Public property | InnerException | Gets the Exception instance that caused the current exception. (Inherited from Exception.)
Public property | Message | Gets a message that describes the current exception. (Inherited from Exception.)
Public property | Source | Gets or sets the name of the application or the object that causes the error. (Inherited from Exception.)
Public property | StackTrace | Gets a string representation of the immediate frames on the call stack. (Inherited from Exception.)
Public property | TargetSite | Gets the method that throws the current exception. (Inherited from Exception.)
Top
See Also

Reference

DigitalGiles.BNCS Namespace


BncsIfModeException Constructor

BncsIfModeException Constructor
Overload List
 | Name | Description
Public method | BncsIfModeException | Initialises a new BncsIfModeException object.
Public method | BncsIfModeException(String) | Initialises a new BncsIfModeException object.
Public method | BncsIfModeException(String, Exception) | Initialises a new BncsIfModeException object.
Top
See Also

Reference

BncsIfModeException Class
DigitalGiles.BNCS Namespace


BncsIfModeException Constructor

BncsIfModeException Constructor
Initialises a new BncsIfModeException object.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsIfModeException()
See Also

Reference

BncsIfModeException Class
BncsIfModeException Overload
DigitalGiles.BNCS Namespace


BncsIfModeException Constructor (String)

BncsIfModeException Constructor (String)
Initialises a new BncsIfModeException object.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsIfModeException(
    string message_
)

Parameters

message_
Type: SystemString
Message containing further detail about the exception.
See Also

Reference

BncsIfModeException Class
BncsIfModeException Overload
DigitalGiles.BNCS Namespace


BncsIfModeException Constructor (String, Exception)

BncsIfModeException Constructor (String, Exception)
Initialises a new BncsIfModeException object.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsIfModeException(
    string message_,
    Exception innerException_
)

Parameters

message_
Type: SystemString
Message containing further detail about the exception.
innerException_
Type: SystemException
The inner exception that caused this one.
See Also

Reference

BncsIfModeException Class
BncsIfModeException Overload
DigitalGiles.BNCS Namespace


BncsIfModeException Methods

BncsIfModeException Methods

The BncsIfModeException type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetBaseException | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions. (Inherited from Exception.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetObjectData | When overridden in a derived class, sets the SerializationInfo with information about the exception. (Inherited from Exception.)
Public method | GetType | Gets the runtime type of the current instance. (Inherited from Exception.)
Public method | ToString | Creates and returns a string representation of the current exception. (Inherited from Exception.)
Top
See Also

Reference

BncsIfModeException Class
DigitalGiles.BNCS Namespace


BncsIfModeException Properties

BncsIfModeException Properties

The BncsIfModeException type exposes the following members.

Properties
 | Name | Description
Public property | Data | Gets a collection of key/value pairs that provide additional user-defined information about the exception. (Inherited from Exception.)
Public property | HelpLink | Gets or sets a link to the help file associated with this exception. (Inherited from Exception.)
Public property | InnerException | Gets the Exception instance that caused the current exception. (Inherited from Exception.)
Public property | Message | Gets a message that describes the current exception. (Inherited from Exception.)
Public property | Source | Gets or sets the name of the application or the object that causes the error. (Inherited from Exception.)
Public property | StackTrace | Gets a string representation of the immediate frames on the call stack. (Inherited from Exception.)
Public property | TargetSite | Gets the method that throws the current exception. (Inherited from Exception.)
Top
See Also

Reference

BncsIfModeException Class
DigitalGiles.BNCS Namespace


BNCSInfoDriver Class

BNCSInfoDriver Class
Class encapsulating a BNCS InfoDriver device
Inheritance Hierarchy
SystemObject
DigitalGiles.BNCSBNCSDevice
DigitalGiles.BNCSBNCSInfoDriver

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public sealed class BNCSInfoDriver : BNCSDevice

The BNCSInfoDriver type exposes the following members.

Methods
Name Description
Public method ChangeIfMode
Sets the InfoDriver's IF Mode
(Overrides BNCSDeviceChangeIfMode(HostDriverIFMode).)
Public method ClearStatistics
Clears all statistics counters.
(Inherited from BNCSDevice.)
Connect
Attempt to connect to BNCS.
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
Disconnect
Disconnect from BNCS
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
Public method Dispose
Dispose of the BNCS Device and release all its resources.
(Inherited from BNCSDevice.)
Public method Equals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public method GetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public method GetIfMode
Retrieves the IFMODE of the connected host driver
(Inherited from BNCSDevice.)
Public method GetSlot
Gets a slot message from the array store, without going to BNCS
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method IncrementUserCounter
Increment a User Counter.
(Inherited from BNCSDevice.)
Public method Poll(UInt32)
Gets contents of a slot from BNCS InfoDriver and stores locally.
Public method Poll(UInt32, UInt32)
Gets a range of InfoDriver slots from BNCS and stores them locally
Public method SendCsiClosingMessage
Sends the CSI Closing message to the host driver, which should cause it to shut down. Only valid for InfoDrivers and GRDs.
(Inherited from BNCSDevice.)
Public method SendRevertive(UInt32, String)
Stores a message in an InfoDriver slot
Public method SendRevertive(UInt32, String, Boolean)
Stores a message in an InfoDriver slot
Public method SendRevertiveIfChanged(UInt32, String)
Stores a message in an InfoDriver slot if the message differs from what's currently stored there
Public method SendRevertiveIfChanged(UInt32, String, Boolean)
Stores a message in an InfoDriver slot if the message differs from what's currently stored there. The wait flag when set causes a 1ms delay before sending the revertive. FOOT NOTE Added by PFD as a workaround for bug whereby rapid value changes cause the IF to fail when the value has changed. Typically a 1 ms deolay buys time for the in memory slot buffer to update correctly. Should this not be the case then time may be extended using the SendRevertiveIfChanged(uint, string, int) overload.
Public method SendRevertiveIfChanged(UInt32, String, Int32)
Stores a message in an InfoDriver slot if the message differs from what's currently stored there. The msWait value when greater than zero causes a delay of msWait milliseconds before sending the revertive. FOOT NOTE Added by PFD as a workaround for bug whereby rapid value changes cause the IF to fail when the value has changed. A delay (typically only 1 ms required) buys time for the in memory slot buffer to update correctly.
Public method SetRedundancyMaster
Ask CSI to set the redundancy master for this device to the given master note This feature requires infodriver32 version 1.0.5 or later, and CSI version 1.2.59 note This feature has not been implemented yet and will always return -1
Public method StopThread
Stops the RX message thread
(Inherited from BNCSDevice.)
Public method StopTimer
Forcibly stops the connect timer, if running
(Inherited from BNCSDevice.)
Public method StoreRevertive
Stores a slot message to the local array store, without going to BNCS
Public method ToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
Name Description
Public property DevNum
BNCS device number
(Inherited from BNCSDevice.)
HostConnectState
Device connection status
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
Public property IfMode
Current TXRX mode (updated with GetTxRx, SetRxOnly and SetTxRx)
(Inherited from BNCSDevice.)
Public property LocalHandle
Local window handle
(Inherited from BNCSDevice.)
Public property Name
Device name, for custom use
(Inherited from BNCSDevice.)
Public property OkToGoRxOnly
Whether the host InfoDriver can change its IfMode to RxOnly (defaults to true)
(Inherited from BNCSDevice.)
Public property OkToGoTXRX
Whether the host InfoDriver can change its IfMode to TxRx (defaults to false)
(Inherited from BNCSDevice.)
Public property Statistics
Message and error counts.
(Inherited from BNCSDevice.)
Public property Tag
User-defined object used to identify this driver instance.
(Inherited from BNCSDevice.)
Public property WindowHandle
Driver window handle
(Inherited from BNCSDevice.)
Top
Events
Name Description
Public event ConnectAttempt
Event triggered when a connect attempt is made to the host driver.
(Inherited from BNCSDevice.)
Public event DatabaseChanged
Event triggered when the host driver indicates a database change has occurred
(Inherited from BNCSDevice.)
Public event HostClosing
Event triggered when the host BNCS driver is closing
(Inherited from BNCSDevice.)
HostConnected
Event triggered when the host BNCS driver has connected
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
HostConnectStatusChanged
Event triggered when the connect status of the host driver has changed
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
Public event HostIfModeChanged
Event triggered when the IfMode of the host BNCS driver has changed
(Inherited from BNCSDevice.)
SlotMessageReceived
Event triggered when a new slot message is received from the host InfoDriver
Examples
This code is a demonstration of creating and using BNCSCsi and DigitalGiles.BNCS.BncsInfodriver classes.
Copy
ic partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Infodriver variable
    private BNCSInfoDriver _id = null;
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);

        // Create, setup and connect our Infodriver.
        _id = pBNCSFactory.IDFactory("Pathfinder GPIO Driver", _idNumber);
        _id.SlotMessageReceived += _id_SlotMessageReceived;
        _id.Connect(true);
    }

    void _id_SlotMessageReceived(object sender, BncsSlotMessageEventArgs e)
    {
        // Log slot changes to a ListBox
        listBox.Items.Add("Change to slot #" + e.Slot.ToString() + ": " + e.Message);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected change modes and disconnect
        if (_id.HostConnectState == HostDriverConnectState.Connected)
        {
            _id.OkToGoRxOnly = true;
            _id.OkToGoTXRX = false;
            try
            {
                _id.ChangeIfMode(HostDriverIFMode.RxOnly);
            }
            catch { }
            _id.Disconnect();
        }
        // Dispose of the Info Driver
        _id.Dispose();

        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
Public event UserStringReceived
Event triggered when a new User String is received from the host infodriver
(Inherited from BNCSDevice.)
Top
See Also

Reference

DigitalGiles.BNCS Namespace


BNCSInfoDriver Methods

BNCSInfoDriver Methods

The BNCSInfoDriver type exposes the following members.

Methods
Name Description
Public method ChangeIfMode
Sets the InfoDriver's IF Mode
(Overrides BNCSDeviceChangeIfMode(HostDriverIFMode).)
Public method ClearStatistics
Clears all statistics counters.
(Inherited from BNCSDevice.)
Connect
Attempt to connect to BNCS.
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
Disconnect
Disconnect from BNCS
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
Public method Dispose
Dispose of the BNCS Device and release all its resources.
(Inherited from BNCSDevice.)
Public method Equals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public method GetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public method GetIfMode
Retrieves the IFMODE of the connected host driver
(Inherited from BNCSDevice.)
Public method GetSlot
Gets a slot message from the array store, without going to BNCS
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method IncrementUserCounter
Increment a User Counter.
(Inherited from BNCSDevice.)
Public method Poll(UInt32)
Gets contents of a slot from BNCS InfoDriver and stores locally.
Public method Poll(UInt32, UInt32)
Gets a range of InfoDriver slots from BNCS and stores them locally
Public method SendCsiClosingMessage
Sends the CSI Closing message to the host driver, which should cause it to shut down. Only valid for InfoDrivers and GRDs.
(Inherited from BNCSDevice.)
Public method SendRevertive(UInt32, String)
Stores a message in an InfoDriver slot
Public method SendRevertive(UInt32, String, Boolean)
Stores a message in an InfoDriver slot
Public method SendRevertiveIfChanged(UInt32, String)
Stores a message in an InfoDriver slot if the message differs from what's currently stored there
Public method SendRevertiveIfChanged(UInt32, String, Boolean)
Stores a message in an InfoDriver slot if the message differs from what's currently stored there. The wait flag when set causes a 1ms delay before sending the revertive. FOOT NOTE Added by PFD as a workaround for bug whereby rapid value changes cause the IF to fail when the value has changed. Typically a 1 ms deolay buys time for the in memory slot buffer to update correctly. Should this not be the case then time may be extended using the SendRevertiveIfChanged(uint, string, int) overload.
Public method SendRevertiveIfChanged(UInt32, String, Int32)
Stores a message in an InfoDriver slot if the message differs from what's currently stored there. The msWait value when greater than zero causes a delay of msWait milliseconds before sending the revertive. FOOT NOTE Added by PFD as a workaround for bug whereby rapid value changes cause the IF to fail when the value has changed. A delay (typically only 1 ms required) buys time for the in memory slot buffer to update correctly.
Public method SetRedundancyMaster
Ask CSI to set the redundancy master for this device to the given master note This feature requires infodriver32 version 1.0.5 or later, and CSI version 1.2.59 note This feature has not been implemented yet and will always return -1
Public method StopThread
Stops the RX message thread
(Inherited from BNCSDevice.)
Public method StopTimer
Forcibly stops the connect timer, if running
(Inherited from BNCSDevice.)
Public method StoreRevertive
Stores a slot message to the local array store, without going to BNCS
Public method ToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
See Also

Reference

BNCSInfoDriver Class
DigitalGiles.BNCS Namespace


BNCSInfoDriver.ChangeIfMode Method

BNCSInfoDriverChangeIfMode Method
Sets the InfoDriver's IF Mode

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override void ChangeIfMode(
    HostDriverIFMode newIfMode_
)

Parameters

newIfMode_
Type: DigitalGiles.BNCSHostDriverIFMode
The required IfMode
See Also

Reference

BNCSInfoDriver Class
DigitalGiles.BNCS Namespace


BNCSInfoDriver.GetSlot Method

BNCSInfoDriverGetSlot Method
Gets a slot message from the array store, without going to BNCS

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string GetSlot(
    uint slotNumber_
)

Parameters

slotNumber_
Type: SystemUInt32
Slot number to retrieve

Return Value

Type: String
Slot contents
See Also

Reference

BNCSInfoDriver Class
DigitalGiles.BNCS Namespace


BNCSInfoDriver.Poll Method

BNCSInfoDriverPoll Method
Overload List
 | Name | Description
Public method | Poll(UInt32) | Gets contents of a slot from BNCS InfoDriver and stores locally.
Public method | Poll(UInt32, UInt32) | Gets a range of InfoDriver slots from BNCS and stores them locally
Top
See Also

Reference

BNCSInfoDriver Class
DigitalGiles.BNCS Namespace


BNCSInfoDriver.Poll Method (UInt32)

BNCSInfoDriverPoll Method (UInt32)
Gets contents of a slot from BNCS InfoDriver and stores locally.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Poll(
    uint slotNumber_
)

Parameters

slotNumber_
Type: SystemUInt32
The slot to retrieve

Return Value

Type: Boolean
True if the operation was successful
See Also

Reference

BNCSInfoDriver Class
Poll Overload
DigitalGiles.BNCS Namespace


BNCSInfoDriver.Poll Method (UInt32, UInt32)

BNCSInfoDriverPoll Method (UInt32, UInt32)
Gets a range of InfoDriver slots from BNCS and stores them locally

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Poll(
    uint startSlot_,
    uint endSlot_
)

Parameters

startSlot_
Type: SystemUInt32
Starting slot
endSlot_
Type: SystemUInt32
End slot

Return Value

Type: Boolean
True if all slots appear to have been successfully retrieved
See Also

Reference

BNCSInfoDriver Class
Poll Overload
DigitalGiles.BNCS Namespace


BNCSInfoDriver.SendRevertive Method

BNCSInfoDriverSendRevertive Method
Overload List
 | Name | Description
Public method | SendRevertive(UInt32, String) | Stores a message in an InfoDriver slot
Public method | SendRevertive(UInt32, String, Boolean) | Stores a message in an InfoDriver slot
Top
See Also

Reference

BNCSInfoDriver Class
DigitalGiles.BNCS Namespace


BNCSInfoDriver.SendRevertive Method (UInt32, String)

BNCSInfoDriverSendRevertive Method (UInt32, String)
Stores a message in an InfoDriver slot

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool SendRevertive(
    uint slotNumber_,
    string message_
)

Parameters

slotNumber_
Type: SystemUInt32
Slot to store message in
message_
Type: SystemString
Message to store

Return Value

Type: Boolean
True on success
See Also

Reference

BNCSInfoDriver Class
SendRevertive Overload
DigitalGiles.BNCS Namespace


BNCSInfoDriver.SendRevertive Method (UInt32, String, Boolean)

BNCSInfoDriverSendRevertive Method (UInt32, String, Boolean)
Stores a message in an InfoDriver slot

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool SendRevertive(
    uint slotNumber_,
    string message_,
    bool updateNetwork_
)

Parameters

slotNumber_
Type: SystemUInt32
Slot to store message in
message_
Type: SystemString
Message to store
updateNetwork_
Type: SystemBoolean
Set to false to store to BNCS without updating the network (you will also want to StoreRevertive(): The local store is updated with the IDREVINFO message from BNCS and this is not sent if the network is not updated)

Return Value

Type: Boolean
True on success
See Also

Reference

BNCSInfoDriver Class
SendRevertive Overload
DigitalGiles.BNCS Namespace


BNCSInfoDriver.SendRevertiveIfChanged Method

BNCSInfoDriverSendRevertiveIfChanged Method
Overload List
 | Name | Description
Public method | SendRevertiveIfChanged(UInt32, String) | Stores a message in an InfoDriver slot if the message differs from what's currently stored there
Public method | SendRevertiveIfChanged(UInt32, String, Boolean) | Stores a message in an InfoDriver slot if the message differs from what's currently stored there. The wait flag when set causes a 1ms delay before sending the revertive. FOOT NOTE Added by PFD as a workaround for bug whereby rapid value changes cause the IF to fail when the value has changed. Typically a 1 ms deolay buys time for the in memory slot buffer to update correctly. Should this not be the case then time may be extended using the SendRevertiveIfChanged(uint, string, int) overload.
Public method | SendRevertiveIfChanged(UInt32, String, Int32) | Stores a message in an InfoDriver slot if the message differs from what's currently stored there. The msWait value when greater than zero causes a delay of msWait milliseconds before sending the revertive. FOOT NOTE Added by PFD as a workaround for bug whereby rapid value changes cause the IF to fail when the value has changed. A delay (typically only 1 ms required) buys time for the in memory slot buffer to update correctly.
Top
See Also

Reference

BNCSInfoDriver Class
DigitalGiles.BNCS Namespace


BNCSInfoDriver.SendRevertiveIfChanged Method (UInt32, String)

BNCSInfoDriverSendRevertiveIfChanged Method (UInt32, String)
Stores a message in an InfoDriver slot if the message differs from what's currently stored there

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool SendRevertiveIfChanged(
    uint slotNumber_,
    string message_
)

Parameters

slotNumber_
Type: SystemUInt32
Slot to store message in
message_
Type: SystemString
Message to store

Return Value

Type: Boolean
True on success
See Also

Reference

BNCSInfoDriver Class
SendRevertiveIfChanged Overload
DigitalGiles.BNCS Namespace


BNCSInfoDriver.SendRevertiveIfChanged Method (UInt32, String, Boolean)

BNCSInfoDriverSendRevertiveIfChanged Method (UInt32, String, Boolean)
Stores a message in an InfoDriver slot if the message differs from what's currently stored there. The wait flag when set causes a 1ms delay before sending the revertive. FOOT NOTE Added by PFD as a workaround for bug whereby rapid value changes cause the IF to fail when the value has changed. Typically a 1 ms deolay buys time for the in memory slot buffer to update correctly. Should this not be the case then time may be extended using the SendRevertiveIfChanged(uint, string, int) overload.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool SendRevertiveIfChanged(
    uint slotNumber_,
    string message_,
    bool wait_
)

Parameters

slotNumber_
Type: SystemUInt32
Slot to store message in
message_
Type: SystemString
Message to store
wait_
Type: SystemBoolean
1ms wait flag, when set the method waits for 1ms before sending the revertive

Return Value

Type: Boolean
True on success
See Also

Reference

BNCSInfoDriver Class
SendRevertiveIfChanged Overload
DigitalGiles.BNCS Namespace


BNCSInfoDriver.SendRevertiveIfChanged Method (UInt32, String, Int32)

BNCSInfoDriverSendRevertiveIfChanged Method (UInt32, String, Int32)
Stores a message in an InfoDriver slot if the message differs from what's currently stored there. The msWait value when greater than zero causes a delay of msWait milliseconds before sending the revertive. FOOT NOTE Added by PFD as a workaround for bug whereby rapid value changes cause the IF to fail when the value has changed. A delay (typically only 1 ms required) buys time for the in memory slot buffer to update correctly.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool SendRevertiveIfChanged(
    uint slotNumber_,
    string message_,
    int msWait_
)

Parameters

slotNumber_
Type: SystemUInt32
Slot to store message in
message_
Type: SystemString
Message to store
msWait_
Type: SystemInt32
Number of milliseconds to wait.

Return Value

Type: Boolean
True on success
See Also

Reference

BNCSInfoDriver Class
SendRevertiveIfChanged Overload
DigitalGiles.BNCS Namespace


BNCSInfoDriver.SetRedundancyMaster Method

BNCSInfoDriverSetRedundancyMaster Method
Ask CSI to set the redundancy master for this device to the given master note This feature requires infodriver32 version 1.0.5 or later, and CSI version 1.2.59 note This feature has not been implemented yet and will always return -1

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int SetRedundancyMaster(
    int masterDevice_
)

Parameters

masterDevice_
Type: SystemInt32
Master device number

Return Value

Type: Int32
The master device number or -1 on failure
See Also

Reference

BNCSInfoDriver Class
DigitalGiles.BNCS Namespace


BNCSInfoDriver.StoreRevertive Method

BNCSInfoDriverStoreRevertive Method
Stores a slot message to the local array store, without going to BNCS

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void StoreRevertive(
    uint slotNumber_,
    string message_
)

Parameters

slotNumber_
Type: SystemUInt32
Slot number to set
message_
Type: SystemString
New slot contents
See Also

Reference

BNCSInfoDriver Class
DigitalGiles.BNCS Namespace


BNCSInfoDriver Properties

BNCSInfoDriver Properties

The BNCSInfoDriver type exposes the following members.

Properties
Name Description
Public property DevNum
BNCS device number
(Inherited from BNCSDevice.)
HostConnectState
Device connection status
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
Public property IfMode
Current TXRX mode (updated with GetTxRx, SetRxOnly and SetTxRx)
(Inherited from BNCSDevice.)
Public property LocalHandle
Local window handle
(Inherited from BNCSDevice.)
Public property Name
Device name, for custom use
(Inherited from BNCSDevice.)
Public property OkToGoRxOnly
Whether the host InfoDriver can change its IfMode to RxOnly (defaults to true)
(Inherited from BNCSDevice.)
Public property OkToGoTXRX
Whether the host InfoDriver can change its IfMode to TxRx (defaults to false)
(Inherited from BNCSDevice.)
Public property Statistics
Message and error counts.
(Inherited from BNCSDevice.)
Public property Tag
User-defined object used to identify this driver instance.
(Inherited from BNCSDevice.)
Public property WindowHandle
Driver window handle
(Inherited from BNCSDevice.)
Top
See Also

Reference

BNCSInfoDriver Class
DigitalGiles.BNCS Namespace


BNCSInfoDriver Events

BNCSInfoDriver Events

The BNCSInfoDriver type exposes the following members.

Events
Name Description
Public event ConnectAttempt
Event triggered when a connect attempt is made to the host driver.
(Inherited from BNCSDevice.)
Public event DatabaseChanged
Event triggered when the host driver indicates a database change has occurred
(Inherited from BNCSDevice.)
Public event HostClosing
Event triggered when the host BNCS driver is closing
(Inherited from BNCSDevice.)
HostConnected
Event triggered when the host BNCS driver has connected
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
HostConnectStatusChanged
Event triggered when the connect status of the host driver has changed
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
Public event HostIfModeChanged
Event triggered when the IfMode of the host BNCS driver has changed
(Inherited from BNCSDevice.)
SlotMessageReceived
Event triggered when a new slot message is received from the host InfoDriver
Examples
This code is a demonstration of creating and using BNCSCsi and DigitalGiles.BNCS.BncsInfodriver classes.
Copy
ic partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Infodriver variable
    private BNCSInfoDriver _id = null;
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);

        // Create, setup and connect our Infodriver.
        _id = pBNCSFactory.IDFactory("Pathfinder GPIO Driver", _idNumber);
        _id.SlotMessageReceived += _id_SlotMessageReceived;
        _id.Connect(true);
    }

    void _id_SlotMessageReceived(object sender, BncsSlotMessageEventArgs e)
    {
        // Log slot changes to a ListBox
        listBox.Items.Add("Change to slot #" + e.Slot.ToString() + ": " + e.Message);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected change modes and disconnect
        if (_id.HostConnectState == HostDriverConnectState.Connected)
        {
            _id.OkToGoRxOnly = true;
            _id.OkToGoTXRX = false;
            try
            {
                _id.ChangeIfMode(HostDriverIFMode.RxOnly);
            }
            catch { }
            _id.Disconnect();
        }
        // Dispose of the Info Driver
        _id.Dispose();

        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
Public event UserStringReceived
Event triggered when a new User String is received from the host infodriver
(Inherited from BNCSDevice.)
Top
See Also

Reference

BNCSInfoDriver Class
DigitalGiles.BNCS Namespace


BNCSInfoDriver.SlotMessageReceived Event

BNCSInfoDriverSlotMessageReceived Event
Event triggered when a new slot message is received from the host InfoDriver
Examples
This code is a demonstration of creating and using BNCSCsi and DigitalGiles.BNCS.BncsInfodriver classes.
Copy
ic partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Infodriver variable
    private BNCSInfoDriver _id = null;
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);

        // Create, setup and connect our Infodriver.
        _id = pBNCSFactory.IDFactory("Pathfinder GPIO Driver", _idNumber);
        _id.SlotMessageReceived += _id_SlotMessageReceived;
        _id.Connect(true);
    }

    void _id_SlotMessageReceived(object sender, BncsSlotMessageEventArgs e)
    {
        // Log slot changes to a ListBox
        listBox.Items.Add("Change to slot #" + e.Slot.ToString() + ": " + e.Message);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected change modes and disconnect
        if (_id.HostConnectState == HostDriverConnectState.Connected)
        {
            _id.OkToGoRxOnly = true;
            _id.OkToGoTXRX = false;
            try
            {
                _id.ChangeIfMode(HostDriverIFMode.RxOnly);
            }
            catch { }
            _id.Disconnect();
        }
        // Dispose of the Info Driver
        _id.Dispose();

        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event EventHandler<BncsSlotMessageEventArgs> SlotMessageReceived

Value

Type: SystemEventHandler BncsSlotMessageEventArgs
See Also

Reference

BNCSInfoDriver Class
DigitalGiles.BNCS Namespace


BncsInfoDriverClientRevertiveEventArgs Class

BncsInfoDriverClientRevertiveEventArgs Class
Event arguments associated with the InfoDriverClientRevertiveReceived event
Inheritance Hierarchy
SystemObject
SystemEventArgs
DigitalGiles.BNCSBncsClientRevertiveEventArgs
DigitalGiles.BNCSBncsSpecificClientEventArgs
DigitalGiles.BNCSBncsInfoDriverClientRevertiveEventArgs

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BncsInfoDriverClientRevertiveEventArgs : BncsSpecificClientEventArgs

The BncsInfoDriverClientRevertiveEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | BncsInfoDriverClientRevertiveEventArgs | Creates a new BncsInfoDriverClientRevertiveEventArgs object
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | DriverNumber | The driver number (Inherited from BncsSpecificClientEventArgs.)
Public property | Message | The message contained within the slot
Public property | RevertiveString | Revertive string as received from CSI (Inherited from BncsClientRevertiveEventArgs.)
Public property | SlotNumber | The slot number associated with the revertive
Top
See Also

Reference

DigitalGiles.BNCS Namespace


BncsInfoDriverClientRevertiveEventArgs Constructor

BncsInfoDriverClientRevertiveEventArgs Constructor
Creates a new BncsInfoDriverClientRevertiveEventArgs object

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsInfoDriverClientRevertiveEventArgs()
See Also

Reference

BncsInfoDriverClientRevertiveEventArgs Class
DigitalGiles.BNCS Namespace


BncsInfoDriverClientRevertiveEventArgs Methods

BncsInfoDriverClientRevertiveEventArgs Methods

The BncsInfoDriverClientRevertiveEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

BncsInfoDriverClientRevertiveEventArgs Class
DigitalGiles.BNCS Namespace


BncsInfoDriverClientRevertiveEventArgs Properties

BncsInfoDriverClientRevertiveEventArgs Properties

The BncsInfoDriverClientRevertiveEventArgs type exposes the following members.

Properties
 | Name | Description
Public property | DriverNumber | The driver number (Inherited from BncsSpecificClientEventArgs.)
Public property | Message | The message contained within the slot
Public property | RevertiveString | Revertive string as received from CSI (Inherited from BncsClientRevertiveEventArgs.)
Public property | SlotNumber | The slot number associated with the revertive
Top
See Also

Reference

BncsInfoDriverClientRevertiveEventArgs Class
DigitalGiles.BNCS Namespace


BncsInfoDriverClientRevertiveEventArgs.Message Property

BncsInfoDriverClientRevertiveEventArgsMessage Property
The message contained within the slot

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Message { get; set; }

Property Value

Type: String
See Also

Reference

BncsInfoDriverClientRevertiveEventArgs Class
DigitalGiles.BNCS Namespace


BncsInfoDriverClientRevertiveEventArgs.SlotNumber Property

BncsInfoDriverClientRevertiveEventArgsSlotNumber Property
The slot number associated with the revertive

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint SlotNumber { get; set; }

Property Value

Type: UInt32
See Also

Reference

BncsInfoDriverClientRevertiveEventArgs Class
DigitalGiles.BNCS Namespace


BNCSInfoDriverResiliencyRole Enumeration

BNCSInfoDriverResiliencyRole Enumeration
A type betraying the current role of an InfoDriver either as a singular ID or it's role within a resilient pair.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum BNCSInfoDriverResiliencyRole
Members
Member name | Value | Description
Active | 0 | The InfoDriver is fullfilling the active TxRx role either singularly or within a resilient pair of InfoDrivers
Passive | 1 | The InfoDriver is fullfilling the passive RxOnly role either singularly or within a resilient pair of InfoDrivers
See Also

Reference

DigitalGiles.BNCS Namespace


BncsNotConnectedException Class

BncsNotConnectedException Class
The exception thrown if an operation could not be performed because a host BNCS driver is disconnected
Inheritance Hierarchy
SystemObject
SystemException
DigitalGiles.BNCSBncsNotConnectedException

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BncsNotConnectedException : Exception

The BncsNotConnectedException type exposes the following members.

Constructors
 | Name | Description
Public method | BncsNotConnectedException | Initialises a new BncsNotConnectedException
Public method | BncsNotConnectedException(String) | Initialises a new BncsNotConnectedException with supplied detail message
Public method | BncsNotConnectedException(String, Exception) | Initialises a new BncsNotConnectedException object.
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetBaseException | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions. (Inherited from Exception.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetObjectData | When overridden in a derived class, sets the SerializationInfo with information about the exception. (Inherited from Exception.)
Public method | GetType | Gets the runtime type of the current instance. (Inherited from Exception.)
Public method | ToString | Creates and returns a string representation of the current exception. (Inherited from Exception.)
Top
Properties
 | Name | Description
Public property | Data | Gets a collection of key/value pairs that provide additional user-defined information about the exception. (Inherited from Exception.)
Public property | HelpLink | Gets or sets a link to the help file associated with this exception. (Inherited from Exception.)
Public property | InnerException | Gets the Exception instance that caused the current exception. (Inherited from Exception.)
Public property | Message | Gets a message that describes the current exception. (Inherited from Exception.)
Public property | Source | Gets or sets the name of the application or the object that causes the error. (Inherited from Exception.)
Public property | StackTrace | Gets a string representation of the immediate frames on the call stack. (Inherited from Exception.)
Public property | TargetSite | Gets the method that throws the current exception. (Inherited from Exception.)
Top
See Also

Reference

DigitalGiles.BNCS Namespace


BncsNotConnectedException Constructor

BncsNotConnectedException Constructor
Overload List
 | Name | Description
Public method | BncsNotConnectedException | Initialises a new BncsNotConnectedException
Public method | BncsNotConnectedException(String) | Initialises a new BncsNotConnectedException with supplied detail message
Public method | BncsNotConnectedException(String, Exception) | Initialises a new BncsNotConnectedException object.
Top
See Also

Reference

BncsNotConnectedException Class
DigitalGiles.BNCS Namespace


BncsNotConnectedException Constructor

BncsNotConnectedException Constructor
Initialises a new BncsNotConnectedException

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsNotConnectedException()
See Also

Reference

BncsNotConnectedException Class
BncsNotConnectedException Overload
DigitalGiles.BNCS Namespace


BncsNotConnectedException Constructor (String)

BncsNotConnectedException Constructor (String)
Initialises a new BncsNotConnectedException with supplied detail message

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsNotConnectedException(
    string message_
)

Parameters

message_
Type: SystemString
Message containing further detail about the exception
See Also

Reference

BncsNotConnectedException Class
BncsNotConnectedException Overload
DigitalGiles.BNCS Namespace


BncsNotConnectedException Constructor (String, Exception)

BncsNotConnectedException Constructor (String, Exception)
Initialises a new BncsNotConnectedException object.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsNotConnectedException(
    string message_,
    Exception innerException_
)

Parameters

message_
Type: SystemString
Message containing further detail about the exception.
innerException_
Type: SystemException
The inner exception that caused this one.
See Also

Reference

BncsNotConnectedException Class
BncsNotConnectedException Overload
DigitalGiles.BNCS Namespace


BncsNotConnectedException Methods

BncsNotConnectedException Methods

The BncsNotConnectedException type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetBaseException | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions. (Inherited from Exception.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetObjectData | When overridden in a derived class, sets the SerializationInfo with information about the exception. (Inherited from Exception.)
Public method | GetType | Gets the runtime type of the current instance. (Inherited from Exception.)
Public method | ToString | Creates and returns a string representation of the current exception. (Inherited from Exception.)
Top
See Also

Reference

BncsNotConnectedException Class
DigitalGiles.BNCS Namespace


BncsNotConnectedException Properties

BncsNotConnectedException Properties

The BncsNotConnectedException type exposes the following members.

Properties
 | Name | Description
Public property | Data | Gets a collection of key/value pairs that provide additional user-defined information about the exception. (Inherited from Exception.)
Public property | HelpLink | Gets or sets a link to the help file associated with this exception. (Inherited from Exception.)
Public property | InnerException | Gets the Exception instance that caused the current exception. (Inherited from Exception.)
Public property | Message | Gets a message that describes the current exception. (Inherited from Exception.)
Public property | Source | Gets or sets the name of the application or the object that causes the error. (Inherited from Exception.)
Public property | StackTrace | Gets a string representation of the immediate frames on the call stack. (Inherited from Exception.)
Public property | TargetSite | Gets the method that throws the current exception. (Inherited from Exception.)
Top
See Also

Reference

BncsNotConnectedException Class
DigitalGiles.BNCS Namespace


BncsRegistration Structure

BncsRegistration Structure
Structure defining a CSI client registration.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public struct BncsRegistration

The BncsRegistration type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Indicates whether this instance and a specified object are equal. (Inherited from ValueType.)
Public method | GetHashCode | Returns the hash code for this instance. (Inherited from ValueType.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns the fully qualified type name of this instance. (Inherited from ValueType.)
Top
Fields
 | Name | Description
Public field | DeviceNumber | Device number
Public field | DriverType | Driver type
Public field | EndIndex | End index
Public field | StartIndex | Start index
Top
See Also

Reference

DigitalGiles.BNCS Namespace


BncsRegistration Fields

BncsRegistration Fields

The BncsRegistration type exposes the following members.

Fields
 | Name | Description
Public field | DeviceNumber | Device number
Public field | DriverType | Driver type
Public field | EndIndex | End index
Public field | StartIndex | Start index
Top
See Also

Reference

BncsRegistration Structure
DigitalGiles.BNCS Namespace


BncsRegistration.DeviceNumber Field

BncsRegistrationDeviceNumber Field
Device number

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint DeviceNumber

Field Value

Type: UInt32
See Also

Reference

BncsRegistration Structure
DigitalGiles.BNCS Namespace


BncsRegistration.DriverType Field

BncsRegistrationDriverType Field
Driver type

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public HostDriverType DriverType

Field Value

Type: HostDriverType
See Also

Reference

BncsRegistration Structure
DigitalGiles.BNCS Namespace


BncsRegistration.EndIndex Field

BncsRegistrationEndIndex Field
End index

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint EndIndex

Field Value

Type: UInt32
See Also

Reference

BncsRegistration Structure
DigitalGiles.BNCS Namespace


BncsRegistration.StartIndex Field

BncsRegistrationStartIndex Field
Start index

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint StartIndex

Field Value

Type: UInt32
See Also

Reference

BncsRegistration Structure
DigitalGiles.BNCS Namespace


BncsRegistration Methods

BncsRegistration Methods

The BncsRegistration type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Indicates whether this instance and a specified object are equal. (Inherited from ValueType.)
Public method | GetHashCode | Returns the hash code for this instance. (Inherited from ValueType.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns the fully qualified type name of this instance. (Inherited from ValueType.)
Top
See Also

Reference

BncsRegistration Structure
DigitalGiles.BNCS Namespace


BNCSResilentInfoDriver Class

BNCSResilentInfoDriver Class
An alternative version of BNCSInfoDriver, surfaces all public methods, surfaces all events and all properties though, with exception of Tag, these are read only. This class should be instantiated instead of BNCSInfoDriver when a driver needs to run as a resilient pair. The HostDriverConnected r/w property controls the resilience behaviour, the IFMode, OkToGoTXRX and OkToGoRxOnly properties are now read only and are controlled by the setting of the HostDriverConnected flag. Adds a new event handler, ResiliencyMessageHandled, for debug purposes to follow resiliency messages received and how the instance responded.
Examples
This code is a demonstration of creating and using BNCSCsi and DigitalGiles.BNCS.BNCSResilientInfodriver classes.
Copy
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Infodriver variable
    private BNCSResilientInfoDriver _id = null;
    // Info driver number.
    private const int _idNumber = 403;
    // A flag betraying host driver connectivity status, in this case with an HTTP server
    private bool _httpServerConnected = false;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    // Some method that fires when our connection status to an HTTP server changes
    private void HTTPServerResponseStatusChanged(bool connected_)
    {
        // Capture our HTTP connected status here
        _httpServerConnected = connected_;
        // Now simply update our InfoDriver with this change here
        if (null != _infoDriver)
            _infoDriver.HostDriverConnected = _httpServerConnected; // All operations for resiliency are handled by this single line of code, CSI will do the rest for you
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);

        // Create, setup and connect our Infodriver.
        _id = new BNCSResilientInfoDriver("Pathfinder GPIO Driver", _idNumber, _httpServerConnected);
        _id.SlotMessageReceived += _id_SlotMessageReceived;
        _id.Connect(true);
    }

    void _id_SlotMessageReceived(object sender, BncsSlotMessageEventArgs e)
    {
        // Log slot changes to a ListBox
        listBox.Items.Add("Change to slot #" + e.Slot.ToString() + ": " + e.Message);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // Dispose of the Info Driver, this method takes care of all disposal considerations
        _id.Dispose();

        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
Inheritance Hierarchy
SystemObject
DigitalGiles.BNCSBNCSDevice
DigitalGiles.BNCSBNCSResilentInfoDriver

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BNCSResilentInfoDriver : BNCSDevice

The BNCSResilentInfoDriver type exposes the following members.

Constructors
 | Name | Description
Public method | BNCSResilentInfoDriver | Constructor
Top
Methods
Name Description
Public method ChangeIfMode
Sets the InfoDriver's IfMode Resiliency comes in many flavours (so it seems). This class is designed around what has been termed "the BBC's interpretation of resiliency". As such you should not call this method and should yield to your use of the HostDriverConnected property in conjunction with CSI to assert the IF mode. This method is provided by request and allows you to assert the IF mode, it's use will certainly commpromise the BBC interpretation and consequently override CSI's management of resiliency.
Public method ClearStatistics
Clears all statistics counters.
(Inherited from BNCSDevice.)
Connect
Attempt to connect to BNCS.
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
Disconnect
Disconnect from BNCS
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
Dispose
Clean up all resources used by this InfoDriver.
Examples
This code is a demonstration of creating and using BNCSCsi and DigitalGiles.BNCS.BncsInfodriver classes.
Copy
ic partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Infodriver variable
    private BNCSInfoDriver _id = null;
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);

        // Create, setup and connect our Infodriver.
        _id = pBNCSFactory.IDFactory("Pathfinder GPIO Driver", _idNumber);
        _id.SlotMessageReceived += _id_SlotMessageReceived;
        _id.Connect(true);
    }

    void _id_SlotMessageReceived(object sender, BncsSlotMessageEventArgs e)
    {
        // Log slot changes to a ListBox
        listBox.Items.Add("Change to slot #" + e.Slot.ToString() + ": " + e.Message);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // Dispose of the Info Driver
        _id.Dispose();

        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
Public method Equals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public method GetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public method GetIfMode
Retrieves the IFMODE of the connected host driver
(Inherited from BNCSDevice.)
Public method GetSlot
Gets a slot message from the array store, without going to BNCS
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method IncrementUserCounter
Increment a User Counter.
(Inherited from BNCSDevice.)
Public method Poll(UInt32)
Gets contents of a slot from BNCS InfoDriver and stores locally.
Public method Poll(UInt32, UInt32)
Gets a range of InfoDriver slots from BNCS and stores them locally
Public method SendCsiClosingMessage
Sends the CSI Closing message to the host driver, which should cause it to shut down. Only valid for InfoDrivers and GRDs.
(Inherited from BNCSDevice.)
Public method SendRevertive(UInt32, String)
Stores a message in an InfoDriver slot
Public method SendRevertive(UInt32, String, Boolean)
Stores a message in an InfoDriver slot
Public method SendRevertiveIfChanged(UInt32, String)
Stores a message in an InfoDriver slot if the message differs from what's currently stored there
Public method SendRevertiveIfChanged(UInt32, String, Boolean)
Stores a message in an InfoDriver slot if the message differs from what's currently stored there. The wait flag when set causes a 1ms delay before sending the revertive. FOOT NOTE Added by PFD as a workaround for bug whereby rapid value changes cause the IF to fail when the value has changed. Typically a 1 ms deolay buys time for the in memory slot buffer to update correctly. Should this not be the case then time may be extended using the SendRevertiveIfChanged(uint, string, int) overload.
Public method SendRevertiveIfChanged(UInt32, String, Int32)
Stores a message in an InfoDriver slot if the message differs from what's currently stored there. The msWait value when greater than zero causes a delay of msWait milliseconds before sending the revertive. FOOT NOTE Added by PFD as a workaround for bug whereby rapid value changes cause the IF to fail when the value has changed. A delay (typically only 1 ms required) buys time for the in memory slot buffer to update correctly.
Public method SetRedundancyMaster
Ask CSI to set the redundancy master for this device to the given master note This feature requires infodriver32 version 1.0.5 or later, and CSI version 1.2.59 note This feature has not been implemented yet and will always return -1
Public method StopThread
Stops the RX message thread
(Inherited from BNCSDevice.)
Public method StopTimer
Forcibly stops the connect timer, if running
(Inherited from BNCSDevice.)
Public method StoreRevertive
Stores a slot message to the local array store, without going to BNCS
Public method ToString
Gets the instance as a string.
(Overrides ObjectToString.)
Top
Properties
 | Name | Description
Public property | DevNum | Gets the BNCS device number
Public property | HostConnectState | Gets the Device connection status
Public property | HostDriverConnected | Gets/sets the comms state, this being the current perceived state of whatever it is your driver is connecting to. For instance this may be a TCP/IP server, a UDP server, an HTTP server or a serial connection to a hardware unit. Set to TRUE when your driver has comms (comms OK) else false (comms fail). This property manages the OkToGoTXRX and OkToGoRxOnly flags. When set to false this property will cause a change of IF mode to TxRxOnly. Therefore this property controls all redundancy behaviour between a pair of drivers which are running as a resilient pair. Simply set this accordingly and let CSI do the rest.
Public property | IfMode | Gets the Current TXRX mode (updated with GetTxRx, SetRxOnly and SetTxRx)
Public property | LocalHandle | Gets the Local window handle
Public property | Name | Gets the Device name, for custom use
Public property | OkToGoRxOnly | Gets the OkToGoRxOnly flag
Public property | OkToGoTXRX | Gets the OkToGoTXRX flag
Public property | ResiliencyRole | Gets the current role that this InfoDriver is playing either within a single ID solution or a resilient pair of ID's running on the same network with identical device numbers.
Public property | Statistics | Gets Message and error counts.
Public property | Tag | User-defined object used to identify this driver instance. (Inherited from BNCSDevice.)
Public property | WindowHandle | Gets the Driver window handle
Top
Events
Name Description
Public event ConnectAttempt
Event triggered when a connect attempt is made to the host driver.
(Inherited from BNCSDevice.)
Public event DatabaseChanged
Event triggered when the host driver indicates a database change has occurred
(Inherited from BNCSDevice.)
Public event HostClosing
Event triggered when the host BNCS driver is closing
(Inherited from BNCSDevice.)
HostConnected
Event triggered when the host BNCS driver has connected
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
HostConnectStatusChanged
Event triggered when the connect status of the host driver has changed
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
Public event HostIfModeChanged
Event triggered when the IfMode of the host BNCS driver has changed
(Inherited from BNCSDevice.)
Public event ResiliencyMessageHandled
Event handler which fires when a resiliency message is received from CSI
SlotMessageReceived
Event triggered when a new slot message is received from the host InfoDriver
Examples
This code is a demonstration of creating and using BNCSCsi and DigitalGiles.BNCS.BncsInfodriver classes.
Copy
ic partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Infodriver variable
    private BNCSInfoDriver _id = null;
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);

        // Create, setup and connect our Infodriver.
        _id = pBNCSFactory.IDFactory("Pathfinder GPIO Driver", _idNumber);
        _id.SlotMessageReceived += _id_SlotMessageReceived;
        _id.Connect(true);
    }

    void _id_SlotMessageReceived(object sender, BncsSlotMessageEventArgs e)
    {
        // Log slot changes to a ListBox
        listBox.Items.Add("Change to slot #" + e.Slot.ToString() + ": " + e.Message);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // Dispose of the Info Driver
        _id.Dispose();

        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
Public event UserStringReceived
Event triggered when a new User String is received from the host infodriver
(Inherited from BNCSDevice.)
Top
See Also

Reference

DigitalGiles.BNCS Namespace


BNCSResilentInfoDriver Constructor

BNCSResilentInfoDriver Constructor
Constructor

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSResilentInfoDriver(
    string name_,
    uint deviceNumber_,
    bool hostDriverConnected_ = false
)

Parameters

name_
Type: SystemString
Info driver configuration name
deviceNumber_
Type: SystemUInt32
InfoDriver device number to connect to
hostDriverConnected_ (Optional)
Type: SystemBoolean
Host driver communication status (optional, defaults to FALSE)
See Also

Reference

BNCSResilentInfoDriver Class
DigitalGiles.BNCS Namespace


BNCSResilentInfoDriver Methods

BNCSResilentInfoDriver Methods

The BNCSResilentInfoDriver type exposes the following members.

Methods
Name Description
Public method ChangeIfMode
Sets the InfoDriver's IfMode Resiliency comes in many flavours (so it seems). This class is designed around what has been termed "the BBC's interpretation of resiliency". As such you should not call this method and should yield to your use of the HostDriverConnected property in conjunction with CSI to assert the IF mode. This method is provided by request and allows you to assert the IF mode, it's use will certainly commpromise the BBC interpretation and consequently override CSI's management of resiliency.
Public method ClearStatistics
Clears all statistics counters.
(Inherited from BNCSDevice.)
Connect
Attempt to connect to BNCS.
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
Disconnect
Disconnect from BNCS
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
Dispose
Clean up all resources used by this InfoDriver.
Examples
This code is a demonstration of creating and using BNCSCsi and DigitalGiles.BNCS.BncsInfodriver classes.
Copy
ic partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Infodriver variable
    private BNCSInfoDriver _id = null;
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);

        // Create, setup and connect our Infodriver.
        _id = pBNCSFactory.IDFactory("Pathfinder GPIO Driver", _idNumber);
        _id.SlotMessageReceived += _id_SlotMessageReceived;
        _id.Connect(true);
    }

    void _id_SlotMessageReceived(object sender, BncsSlotMessageEventArgs e)
    {
        // Log slot changes to a ListBox
        listBox.Items.Add("Change to slot #" + e.Slot.ToString() + ": " + e.Message);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // Dispose of the Info Driver
        _id.Dispose();

        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
Public method Equals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public method GetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public method GetIfMode
Retrieves the IFMODE of the connected host driver
(Inherited from BNCSDevice.)
Public method GetSlot
Gets a slot message from the array store, without going to BNCS
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method IncrementUserCounter
Increment a User Counter.
(Inherited from BNCSDevice.)
Public method Poll(UInt32)
Gets contents of a slot from BNCS InfoDriver and stores locally.
Public method Poll(UInt32, UInt32)
Gets a range of InfoDriver slots from BNCS and stores them locally
Public method SendCsiClosingMessage
Sends the CSI Closing message to the host driver, which should cause it to shut down. Only valid for InfoDrivers and GRDs.
(Inherited from BNCSDevice.)
Public method SendRevertive(UInt32, String)
Stores a message in an InfoDriver slot
Public method SendRevertive(UInt32, String, Boolean)
Stores a message in an InfoDriver slot
Public method SendRevertiveIfChanged(UInt32, String)
Stores a message in an InfoDriver slot if the message differs from what's currently stored there
Public method SendRevertiveIfChanged(UInt32, String, Boolean)
Stores a message in an InfoDriver slot if the message differs from what's currently stored there. The wait flag when set causes a 1ms delay before sending the revertive. FOOT NOTE Added by PFD as a workaround for bug whereby rapid value changes cause the IF to fail when the value has changed. Typically a 1 ms deolay buys time for the in memory slot buffer to update correctly. Should this not be the case then time may be extended using the SendRevertiveIfChanged(uint, string, int) overload.
Public method SendRevertiveIfChanged(UInt32, String, Int32)
Stores a message in an InfoDriver slot if the message differs from what's currently stored there. The msWait value when greater than zero causes a delay of msWait milliseconds before sending the revertive. FOOT NOTE Added by PFD as a workaround for bug whereby rapid value changes cause the IF to fail when the value has changed. A delay (typically only 1 ms required) buys time for the in memory slot buffer to update correctly.
Public method SetRedundancyMaster
Ask CSI to set the redundancy master for this device to the given master note This feature requires infodriver32 version 1.0.5 or later, and CSI version 1.2.59 note This feature has not been implemented yet and will always return -1
Public method StopThread
Stops the RX message thread
(Inherited from BNCSDevice.)
Public method StopTimer
Forcibly stops the connect timer, if running
(Inherited from BNCSDevice.)
Public method StoreRevertive
Stores a slot message to the local array store, without going to BNCS
Public method ToString
Gets the instance as a string.
(Overrides ObjectToString.)
Top
See Also

Reference

BNCSResilentInfoDriver Class
DigitalGiles.BNCS Namespace


BNCSResilentInfoDriver.ChangeIfMode Method

BNCSResilentInfoDriverChangeIfMode Method
Sets the InfoDriver's IfMode Resiliency comes in many flavours (so it seems). This class is designed around what has been termed "the BBC's interpretation of resiliency". As such you should not call this method and should yield to your use of the HostDriverConnected property in conjunction with CSI to assert the IF mode. This method is provided by request and allows you to assert the IF mode, it's use will certainly commpromise the BBC interpretation and consequently override CSI's management of resiliency.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void ChangeIfMode(
    HostDriverIFMode newIfMode_
)

Parameters

newIfMode_
Type: DigitalGiles.BNCSHostDriverIFMode
The required IfMode
See Also

Reference

BNCSResilentInfoDriver Class
DigitalGiles.BNCS Namespace


BNCSResilentInfoDriver.Dispose Method

BNCSResilentInfoDriverDispose Method
Clean up all resources used by this InfoDriver.
Examples
This code is a demonstration of creating and using BNCSCsi and DigitalGiles.BNCS.BncsInfodriver classes.
Copy
ic partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Infodriver variable
    private BNCSInfoDriver _id = null;
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);

        // Create, setup and connect our Infodriver.
        _id = pBNCSFactory.IDFactory("Pathfinder GPIO Driver", _idNumber);
        _id.SlotMessageReceived += _id_SlotMessageReceived;
        _id.Connect(true);
    }

    void _id_SlotMessageReceived(object sender, BncsSlotMessageEventArgs e)
    {
        // Log slot changes to a ListBox
        listBox.Items.Add("Change to slot #" + e.Slot.ToString() + ": " + e.Message);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // Dispose of the Info Driver
        _id.Dispose();

        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Dispose()
See Also

Reference

BNCSResilentInfoDriver Class
DigitalGiles.BNCS Namespace


BNCSResilentInfoDriver.GetSlot Method

BNCSResilentInfoDriverGetSlot Method
Gets a slot message from the array store, without going to BNCS

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string GetSlot(
    uint slotNumber_
)

Parameters

slotNumber_
Type: SystemUInt32
Slot number to retrieve

Return Value

Type: String
Slot contents
See Also

Reference

BNCSResilentInfoDriver Class
DigitalGiles.BNCS Namespace


BNCSResilentInfoDriver.Poll Method

BNCSResilentInfoDriverPoll Method
Overload List
 | Name | Description
Public method | Poll(UInt32) | Gets contents of a slot from BNCS InfoDriver and stores locally.
Public method | Poll(UInt32, UInt32) | Gets a range of InfoDriver slots from BNCS and stores them locally
Top
See Also

Reference

BNCSResilentInfoDriver Class
DigitalGiles.BNCS Namespace


BNCSResilentInfoDriver.Poll Method (UInt32)

BNCSResilentInfoDriverPoll Method (UInt32)
Gets contents of a slot from BNCS InfoDriver and stores locally.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Poll(
    uint slotNumber_
)

Parameters

slotNumber_
Type: SystemUInt32

[Missing <param name="slotNumber_"/> documentation for "M:DigitalGiles.BNCS.BNCSResilentInfoDriver.Poll(System.UInt32)"]

Return Value

Type: Boolean
True if the operation was successful
See Also

Reference

BNCSResilentInfoDriver Class
Poll Overload
DigitalGiles.BNCS Namespace


BNCSResilentInfoDriver.Poll Method (UInt32, UInt32)

BNCSResilentInfoDriverPoll Method (UInt32, UInt32)
Gets a range of InfoDriver slots from BNCS and stores them locally

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Poll(
    uint startSlot_,
    uint endSlot_
)

Parameters

startSlot_
Type: SystemUInt32
Starting slot
endSlot_
Type: SystemUInt32
End slot

Return Value

Type: Boolean
True if all slots appear to have been successfully retrieved
See Also

Reference

BNCSResilentInfoDriver Class
Poll Overload
DigitalGiles.BNCS Namespace


BNCSResilentInfoDriver.SendRevertive Method

BNCSResilentInfoDriverSendRevertive Method
Overload List
 | Name | Description
Public method | SendRevertive(UInt32, String) | Stores a message in an InfoDriver slot
Public method | SendRevertive(UInt32, String, Boolean) | Stores a message in an InfoDriver slot
Top
See Also

Reference

BNCSResilentInfoDriver Class
DigitalGiles.BNCS Namespace


BNCSResilentInfoDriver.SendRevertive Method (UInt32, String)

BNCSResilentInfoDriverSendRevertive Method (UInt32, String)
Stores a message in an InfoDriver slot

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool SendRevertive(
    uint slotNumber_,
    string message_
)

Parameters

slotNumber_
Type: SystemUInt32
Slot to store message in
message_
Type: SystemString
Message to store

Return Value

Type: Boolean
True on success
See Also

Reference

BNCSResilentInfoDriver Class
SendRevertive Overload
DigitalGiles.BNCS Namespace


BNCSResilentInfoDriver.SendRevertive Method (UInt32, String, Boolean)

BNCSResilentInfoDriverSendRevertive Method (UInt32, String, Boolean)
Stores a message in an InfoDriver slot

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool SendRevertive(
    uint slotNumber_,
    string message_,
    bool updateNetwork_
)

Parameters

slotNumber_
Type: SystemUInt32
Slot to store message in
message_
Type: SystemString
Message to store
updateNetwork_
Type: SystemBoolean
Set to false to store to BNCS without updating the network (you will also want to StoreRevertive(): The local store is updated with the IDREVINFO message from BNCS and this is not sent if the network is not updated)

Return Value

Type: Boolean
True on success
See Also

Reference

BNCSResilentInfoDriver Class
SendRevertive Overload
DigitalGiles.BNCS Namespace


BNCSResilentInfoDriver.SendRevertiveIfChanged Method

BNCSResilentInfoDriverSendRevertiveIfChanged Method
Overload List
 | Name | Description
Public method | SendRevertiveIfChanged(UInt32, String) | Stores a message in an InfoDriver slot if the message differs from what's currently stored there
Public method | SendRevertiveIfChanged(UInt32, String, Boolean) | Stores a message in an InfoDriver slot if the message differs from what's currently stored there. The wait flag when set causes a 1ms delay before sending the revertive. FOOT NOTE Added by PFD as a workaround for bug whereby rapid value changes cause the IF to fail when the value has changed. Typically a 1 ms deolay buys time for the in memory slot buffer to update correctly. Should this not be the case then time may be extended using the SendRevertiveIfChanged(uint, string, int) overload.
Public method | SendRevertiveIfChanged(UInt32, String, Int32) | Stores a message in an InfoDriver slot if the message differs from what's currently stored there. The msWait value when greater than zero causes a delay of msWait milliseconds before sending the revertive. FOOT NOTE Added by PFD as a workaround for bug whereby rapid value changes cause the IF to fail when the value has changed. A delay (typically only 1 ms required) buys time for the in memory slot buffer to update correctly.
Top
See Also

Reference

BNCSResilentInfoDriver Class
DigitalGiles.BNCS Namespace


BNCSResilentInfoDriver.SendRevertiveIfChanged Method (UInt32, String)

BNCSResilentInfoDriverSendRevertiveIfChanged Method (UInt32, String)
Stores a message in an InfoDriver slot if the message differs from what's currently stored there

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool SendRevertiveIfChanged(
    uint slotNumber_,
    string message_
)

Parameters

slotNumber_
Type: SystemUInt32
Slot to store message in
message_
Type: SystemString
Message to store

Return Value

Type: Boolean
True on success
See Also

Reference

BNCSResilentInfoDriver Class
SendRevertiveIfChanged Overload
DigitalGiles.BNCS Namespace


BNCSResilentInfoDriver.SendRevertiveIfChanged Method (UInt32, String, Boolean)

BNCSResilentInfoDriverSendRevertiveIfChanged Method (UInt32, String, Boolean)
Stores a message in an InfoDriver slot if the message differs from what's currently stored there. The wait flag when set causes a 1ms delay before sending the revertive. FOOT NOTE Added by PFD as a workaround for bug whereby rapid value changes cause the IF to fail when the value has changed. Typically a 1 ms deolay buys time for the in memory slot buffer to update correctly. Should this not be the case then time may be extended using the SendRevertiveIfChanged(uint, string, int) overload.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool SendRevertiveIfChanged(
    uint slotNumber_,
    string message_,
    bool wait_
)

Parameters

slotNumber_
Type: SystemUInt32
Slot to store message in
message_
Type: SystemString
Message to store
wait_
Type: SystemBoolean
1ms wait flag, when set the method waits for 1ms before sending the revertive

Return Value

Type: Boolean
True on success
See Also

Reference

BNCSResilentInfoDriver Class
SendRevertiveIfChanged Overload
DigitalGiles.BNCS Namespace


BNCSResilentInfoDriver.SendRevertiveIfChanged Method (UInt32, String, Int32)

BNCSResilentInfoDriverSendRevertiveIfChanged Method (UInt32, String, Int32)
Stores a message in an InfoDriver slot if the message differs from what's currently stored there. The msWait value when greater than zero causes a delay of msWait milliseconds before sending the revertive. FOOT NOTE Added by PFD as a workaround for bug whereby rapid value changes cause the IF to fail when the value has changed. A delay (typically only 1 ms required) buys time for the in memory slot buffer to update correctly.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool SendRevertiveIfChanged(
    uint slotNumber_,
    string message_,
    int msWait_
)

Parameters

slotNumber_
Type: SystemUInt32
Slot to store message in
message_
Type: SystemString
Message to store
msWait_
Type: SystemInt32
Number of milliseconds to wait

Return Value

Type: Boolean
True on success
See Also

Reference

BNCSResilentInfoDriver Class
SendRevertiveIfChanged Overload
DigitalGiles.BNCS Namespace


BNCSResilentInfoDriver.SetRedundancyMaster Method

BNCSResilentInfoDriverSetRedundancyMaster Method
Ask CSI to set the redundancy master for this device to the given master note This feature requires infodriver32 version 1.0.5 or later, and CSI version 1.2.59 note This feature has not been implemented yet and will always return -1

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int SetRedundancyMaster(
    int masterDevice_
)

Parameters

masterDevice_
Type: SystemInt32
Master device number

Return Value

Type: Int32
The master device number or -1 on failure
See Also

Reference

BNCSResilentInfoDriver Class
DigitalGiles.BNCS Namespace


BNCSResilentInfoDriver.StoreRevertive Method

BNCSResilentInfoDriverStoreRevertive Method
Stores a slot message to the local array store, without going to BNCS

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void StoreRevertive(
    uint slotNumber,
    string message
)

Parameters

slotNumber
Type: SystemUInt32

[Missing <param name="slotNumber"/> documentation for "M:DigitalGiles.BNCS.BNCSResilentInfoDriver.StoreRevertive(System.UInt32,System.String)"]

message
Type: SystemString

[Missing <param name="message"/> documentation for "M:DigitalGiles.BNCS.BNCSResilentInfoDriver.StoreRevertive(System.UInt32,System.String)"]

See Also

Reference

BNCSResilentInfoDriver Class
DigitalGiles.BNCS Namespace


BNCSResilentInfoDriver.ToString Method

BNCSResilentInfoDriverToString Method
Gets the instance as a string.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
Comms status, OkToGo flags, IF mode and IF start mode
See Also

Reference

BNCSResilentInfoDriver Class
DigitalGiles.BNCS Namespace


BNCSResilentInfoDriver Properties

BNCSResilentInfoDriver Properties

The BNCSResilentInfoDriver type exposes the following members.

Properties
 | Name | Description
Public property | DevNum | Gets the BNCS device number
Public property | HostConnectState | Gets the Device connection status
Public property | HostDriverConnected | Gets/sets the comms state, this being the current perceived state of whatever it is your driver is connecting to. For instance this may be a TCP/IP server, a UDP server, an HTTP server or a serial connection to a hardware unit. Set to TRUE when your driver has comms (comms OK) else false (comms fail). This property manages the OkToGoTXRX and OkToGoRxOnly flags. When set to false this property will cause a change of IF mode to TxRxOnly. Therefore this property controls all redundancy behaviour between a pair of drivers which are running as a resilient pair. Simply set this accordingly and let CSI do the rest.
Public property | IfMode | Gets the Current TXRX mode (updated with GetTxRx, SetRxOnly and SetTxRx)
Public property | LocalHandle | Gets the Local window handle
Public property | Name | Gets the Device name, for custom use
Public property | OkToGoRxOnly | Gets the OkToGoRxOnly flag
Public property | OkToGoTXRX | Gets the OkToGoTXRX flag
Public property | ResiliencyRole | Gets the current role that this InfoDriver is playing either within a single ID solution or a resilient pair of ID's running on the same network with identical device numbers.
Public property | Statistics | Gets Message and error counts.
Public property | Tag | User-defined object used to identify this driver instance. (Inherited from BNCSDevice.)
Public property | WindowHandle | Gets the Driver window handle
Top
See Also

Reference

BNCSResilentInfoDriver Class
DigitalGiles.BNCS Namespace


BNCSResilentInfoDriver.DevNum Property

BNCSResilentInfoDriverDevNum Property
Gets the BNCS device number

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint DevNum { get; }

Property Value

Type: UInt32
See Also

Reference

BNCSResilentInfoDriver Class
DigitalGiles.BNCS Namespace


BNCSResilentInfoDriver.HostConnectState Property

BNCSResilentInfoDriverHostConnectState Property
Gets the Device connection status

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public HostDriverConnectState HostConnectState { get; }

Property Value

Type: HostDriverConnectState
See Also

Reference

BNCSResilentInfoDriver Class
DigitalGiles.BNCS Namespace


BNCSResilentInfoDriver.HostDriverConnected Property

BNCSResilentInfoDriverHostDriverConnected Property
Gets/sets the comms state, this being the current perceived state of whatever it is your driver is connecting to. For instance this may be a TCP/IP server, a UDP server, an HTTP server or a serial connection to a hardware unit. Set to TRUE when your driver has comms (comms OK) else false (comms fail). This property manages the OkToGoTXRX and OkToGoRxOnly flags. When set to false this property will cause a change of IF mode to TxRxOnly. Therefore this property controls all redundancy behaviour between a pair of drivers which are running as a resilient pair. Simply set this accordingly and let CSI do the rest.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool HostDriverConnected { get; set; }

Property Value

Type: Boolean
See Also

Reference

BNCSResilentInfoDriver Class
DigitalGiles.BNCS Namespace


BNCSResilentInfoDriver.IfMode Property

BNCSResilentInfoDriverIfMode Property
Gets the Current TXRX mode (updated with GetTxRx, SetRxOnly and SetTxRx)

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public HostDriverIFMode IfMode { get; }

Property Value

Type: HostDriverIFMode
See Also

Reference

BNCSResilentInfoDriver Class
DigitalGiles.BNCS Namespace


BNCSResilentInfoDriver.LocalHandle Property

BNCSResilentInfoDriverLocalHandle Property
Gets the Local window handle

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int LocalHandle { get; }

Property Value

Type: Int32
See Also

Reference

BNCSResilentInfoDriver Class
DigitalGiles.BNCS Namespace


BNCSResilentInfoDriver.Name Property

BNCSResilentInfoDriverName Property
Gets the Device name, for custom use

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Name { get; }

Property Value

Type: String
See Also

Reference

BNCSResilentInfoDriver Class
DigitalGiles.BNCS Namespace


BNCSResilentInfoDriver.OkToGoRxOnly Property

BNCSResilentInfoDriverOkToGoRxOnly Property
Gets the OkToGoRxOnly flag

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool OkToGoRxOnly { get; }

Property Value

Type: Boolean
See Also

Reference

BNCSResilentInfoDriver Class
DigitalGiles.BNCS Namespace


BNCSResilentInfoDriver.OkToGoTXRX Property

BNCSResilentInfoDriverOkToGoTXRX Property
Gets the OkToGoTXRX flag

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool OkToGoTXRX { get; }

Property Value

Type: Boolean
See Also

Reference

BNCSResilentInfoDriver Class
DigitalGiles.BNCS Namespace


BNCSResilentInfoDriver.ResiliencyRole Property

BNCSResilentInfoDriverResiliencyRole Property
Gets the current role that this InfoDriver is playing either within a single ID solution or a resilient pair of ID's running on the same network with identical device numbers.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSInfoDriverResiliencyRole ResiliencyRole { get; }

Property Value

Type: BNCSInfoDriverResiliencyRole
See Also

Reference

BNCSResilentInfoDriver Class
DigitalGiles.BNCS Namespace


BNCSResilentInfoDriver.Statistics Property

BNCSResilentInfoDriverStatistics Property
Gets Message and error counts.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSDeviceStats Statistics { get; }

Property Value

Type: BNCSDeviceStats
See Also

Reference

BNCSResilentInfoDriver Class
DigitalGiles.BNCS Namespace


BNCSResilentInfoDriver.WindowHandle Property

BNCSResilentInfoDriverWindowHandle Property
Gets the Driver window handle

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int WindowHandle { get; }

Property Value

Type: Int32
See Also

Reference

BNCSResilentInfoDriver Class
DigitalGiles.BNCS Namespace


BNCSResilentInfoDriver Events

BNCSResilentInfoDriver Events

The BNCSResilentInfoDriver type exposes the following members.

Events
Name Description
Public event ConnectAttempt
Event triggered when a connect attempt is made to the host driver.
(Inherited from BNCSDevice.)
Public event DatabaseChanged
Event triggered when the host driver indicates a database change has occurred
(Inherited from BNCSDevice.)
Public event HostClosing
Event triggered when the host BNCS driver is closing
(Inherited from BNCSDevice.)
HostConnected
Event triggered when the host BNCS driver has connected
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
HostConnectStatusChanged
Event triggered when the connect status of the host driver has changed
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
(Inherited from BNCSDevice.)
Public event HostIfModeChanged
Event triggered when the IfMode of the host BNCS driver has changed
(Inherited from BNCSDevice.)
Public event ResiliencyMessageHandled
Event handler which fires when a resiliency message is received from CSI
SlotMessageReceived
Event triggered when a new slot message is received from the host InfoDriver
Examples
This code is a demonstration of creating and using BNCSCsi and DigitalGiles.BNCS.BncsInfodriver classes.
Copy
ic partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Infodriver variable
    private BNCSInfoDriver _id = null;
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);

        // Create, setup and connect our Infodriver.
        _id = pBNCSFactory.IDFactory("Pathfinder GPIO Driver", _idNumber);
        _id.SlotMessageReceived += _id_SlotMessageReceived;
        _id.Connect(true);
    }

    void _id_SlotMessageReceived(object sender, BncsSlotMessageEventArgs e)
    {
        // Log slot changes to a ListBox
        listBox.Items.Add("Change to slot #" + e.Slot.ToString() + ": " + e.Message);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // Dispose of the Info Driver
        _id.Dispose();

        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
Public event UserStringReceived
Event triggered when a new User String is received from the host infodriver
(Inherited from BNCSDevice.)
Top
See Also

Reference

BNCSResilentInfoDriver Class
DigitalGiles.BNCS Namespace


BNCSResilentInfoDriver.ResiliencyMessageHandled Event

BNCSResilentInfoDriverResiliencyMessageHandled Event
Event handler which fires when a resiliency message is received from CSI

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event ResilientIDMessageEventHandler ResiliencyMessageHandled

Value

Type: DigitalGiles.BNCSResilientIDMessageEventHandler
See Also

Reference

BNCSResilentInfoDriver Class
DigitalGiles.BNCS Namespace


BNCSResilentInfoDriver.SlotMessageReceived Event

BNCSResilentInfoDriverSlotMessageReceived Event
Event triggered when a new slot message is received from the host InfoDriver
Examples
This code is a demonstration of creating and using BNCSCsi and DigitalGiles.BNCS.BncsInfodriver classes.
Copy
ic partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Infodriver variable
    private BNCSInfoDriver _id = null;
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);

        // Create, setup and connect our Infodriver.
        _id = pBNCSFactory.IDFactory("Pathfinder GPIO Driver", _idNumber);
        _id.SlotMessageReceived += _id_SlotMessageReceived;
        _id.Connect(true);
    }

    void _id_SlotMessageReceived(object sender, BncsSlotMessageEventArgs e)
    {
        // Log slot changes to a ListBox
        listBox.Items.Add("Change to slot #" + e.Slot.ToString() + ": " + e.Message);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // Dispose of the Info Driver
        _id.Dispose();

        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event EventHandler<BncsSlotMessageEventArgs> SlotMessageReceived

Value

Type: SystemEventHandler BncsSlotMessageEventArgs
See Also

Reference

BNCSResilentInfoDriver Class
DigitalGiles.BNCS Namespace


BNCSResilienceMessageType Enumeration

BNCSResilienceMessageType Enumeration
A type betraying the type of resiliency message handled by a resilient InfoDriver

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum BNCSResilienceMessageType
Members
Member name | Value | Description
InqDeviceGoTxRx | 2181 | CSI is enquiring if your device is happy to go into TX/RX mode
RequestDeviceGoRxOnly | 2179 | CSI is asking your device to go into RX Only mode
RequestDeviceGoTxRx | 2180 | CSI is asking your device to go into TX/RX mode
DeviceIDInUse | 2190 | Device ID in use message
See Also

Reference

DigitalGiles.BNCS Namespace


BncsRouterClientRevertiveEventArgs Class

BncsRouterClientRevertiveEventArgs Class
Event arguments associated with the RouterClientRevertiveReceived event
Inheritance Hierarchy
SystemObject
SystemEventArgs
DigitalGiles.BNCSBncsClientRevertiveEventArgs
DigitalGiles.BNCSBncsSpecificClientEventArgs
DigitalGiles.BNCSBncsRouterClientRevertiveEventArgs

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BncsRouterClientRevertiveEventArgs : BncsSpecificClientEventArgs

The BncsRouterClientRevertiveEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | BncsRouterClientRevertiveEventArgs | Creates a new BncsRouterClientRevertiveEventArgs object
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | Destination | The destination
Public property | DriverNumber | The driver number (Inherited from BncsSpecificClientEventArgs.)
Public property | RevertiveString | Revertive string as received from CSI (Inherited from BncsClientRevertiveEventArgs.)
Public property | Source | The source
Public property | SourceName | The name of the source currently routed
Top
See Also

Reference

DigitalGiles.BNCS Namespace


BncsRouterClientRevertiveEventArgs Constructor

BncsRouterClientRevertiveEventArgs Constructor
Creates a new BncsRouterClientRevertiveEventArgs object

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsRouterClientRevertiveEventArgs()
See Also

Reference

BncsRouterClientRevertiveEventArgs Class
DigitalGiles.BNCS Namespace


BncsRouterClientRevertiveEventArgs Methods

BncsRouterClientRevertiveEventArgs Methods

The BncsRouterClientRevertiveEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

BncsRouterClientRevertiveEventArgs Class
DigitalGiles.BNCS Namespace


BncsRouterClientRevertiveEventArgs Properties

BncsRouterClientRevertiveEventArgs Properties

The BncsRouterClientRevertiveEventArgs type exposes the following members.

Properties
 | Name | Description
Public property | Destination | The destination
Public property | DriverNumber | The driver number (Inherited from BncsSpecificClientEventArgs.)
Public property | RevertiveString | Revertive string as received from CSI (Inherited from BncsClientRevertiveEventArgs.)
Public property | Source | The source
Public property | SourceName | The name of the source currently routed
Top
See Also

Reference

BncsRouterClientRevertiveEventArgs Class
DigitalGiles.BNCS Namespace


BncsRouterClientRevertiveEventArgs.Destination Property

BncsRouterClientRevertiveEventArgsDestination Property
The destination

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint Destination { get; set; }

Property Value

Type: UInt32
See Also

Reference

BncsRouterClientRevertiveEventArgs Class
DigitalGiles.BNCS Namespace


BncsRouterClientRevertiveEventArgs.Source Property

BncsRouterClientRevertiveEventArgsSource Property
The source

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Source { get; set; }

Property Value

Type: Int32
See Also

Reference

BncsRouterClientRevertiveEventArgs Class
DigitalGiles.BNCS Namespace


BncsRouterClientRevertiveEventArgs.SourceName Property

BncsRouterClientRevertiveEventArgsSourceName Property
The name of the source currently routed

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string SourceName { get; set; }

Property Value

Type: String
See Also

Reference

BncsRouterClientRevertiveEventArgs Class
DigitalGiles.BNCS Namespace


BncsSlotMessageEventArgs Class

BncsSlotMessageEventArgs Class
Event arguments associated with the SlotMessageReceived event
Inheritance Hierarchy
SystemObject
SystemEventArgs
DigitalGiles.BNCSBncsSlotMessageEventArgs

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BncsSlotMessageEventArgs : EventArgs

The BncsSlotMessageEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | BncsSlotMessageEventArgs | Creates a new BncsInfoDriverMsgEventArgs object
Public method | BncsSlotMessageEventArgs(UInt32, String) | Creates a new BncsInfoDriverMsgEventArgs object with supplied slot number and message
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | Message | Message string delivered from the host driver
Public property | Slot | The host driver index from which this message came
Top
See Also

Reference

DigitalGiles.BNCS Namespace


BncsSlotMessageEventArgs Constructor

BncsSlotMessageEventArgs Constructor
Overload List
 | Name | Description
Public method | BncsSlotMessageEventArgs | Creates a new BncsInfoDriverMsgEventArgs object
Public method | BncsSlotMessageEventArgs(UInt32, String) | Creates a new BncsInfoDriverMsgEventArgs object with supplied slot number and message
Top
See Also

Reference

BncsSlotMessageEventArgs Class
DigitalGiles.BNCS Namespace


BncsSlotMessageEventArgs Constructor

BncsSlotMessageEventArgs Constructor
Creates a new BncsInfoDriverMsgEventArgs object

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsSlotMessageEventArgs()
See Also

Reference

BncsSlotMessageEventArgs Class
BncsSlotMessageEventArgs Overload
DigitalGiles.BNCS Namespace


BncsSlotMessageEventArgs Constructor (UInt32, String)

BncsSlotMessageEventArgs Constructor (UInt32, String)
Creates a new BncsInfoDriverMsgEventArgs object with supplied slot number and message

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsSlotMessageEventArgs(
    uint slotNumber_,
    string slotMessage_
)

Parameters

slotNumber_
Type: SystemUInt32
Slot number
slotMessage_
Type: SystemString
Slot message
See Also

Reference

BncsSlotMessageEventArgs Class
BncsSlotMessageEventArgs Overload
DigitalGiles.BNCS Namespace


BncsSlotMessageEventArgs Methods

BncsSlotMessageEventArgs Methods

The BncsSlotMessageEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

BncsSlotMessageEventArgs Class
DigitalGiles.BNCS Namespace


BncsSlotMessageEventArgs Properties

BncsSlotMessageEventArgs Properties

The BncsSlotMessageEventArgs type exposes the following members.

Properties
 | Name | Description
Public property | Message | Message string delivered from the host driver
Public property | Slot | The host driver index from which this message came
Top
See Also

Reference

BncsSlotMessageEventArgs Class
DigitalGiles.BNCS Namespace


BncsSlotMessageEventArgs.Message Property

BncsSlotMessageEventArgsMessage Property
Message string delivered from the host driver

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Message { get; set; }

Property Value

Type: String
See Also

Reference

BncsSlotMessageEventArgs Class
DigitalGiles.BNCS Namespace


BncsSlotMessageEventArgs.Slot Property

BncsSlotMessageEventArgsSlot Property
The host driver index from which this message came

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint Slot { get; set; }

Property Value

Type: UInt32
See Also

Reference

BncsSlotMessageEventArgs Class
DigitalGiles.BNCS Namespace


BncsSpecificClientEventArgs Class

BncsSpecificClientEventArgs Class
Base class of the driver-speficic BNCS ClientEventArgs
Inheritance Hierarchy
SystemObject
SystemEventArgs
DigitalGiles.BNCSBncsClientRevertiveEventArgs
DigitalGiles.BNCSBncsSpecificClientEventArgs
DigitalGiles.BNCSBncsGpiClientRevertiveEventArgs
DigitalGiles.BNCSBncsInfoDriverClientRevertiveEventArgs
DigitalGiles.BNCSBncsRouterClientRevertiveEventArgs

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BncsSpecificClientEventArgs : BncsClientRevertiveEventArgs

The BncsSpecificClientEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | BncsSpecificClientEventArgs | Creates a new BncsSpecificClientEventArgs object
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | DriverNumber | The driver number
Public property | RevertiveString | Revertive string as received from CSI (Inherited from BncsClientRevertiveEventArgs.)
Top
See Also

Reference

DigitalGiles.BNCS Namespace


BncsSpecificClientEventArgs Constructor

BncsSpecificClientEventArgs Constructor
Creates a new BncsSpecificClientEventArgs object

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsSpecificClientEventArgs()
See Also

Reference

BncsSpecificClientEventArgs Class
DigitalGiles.BNCS Namespace


BncsSpecificClientEventArgs Methods

BncsSpecificClientEventArgs Methods

The BncsSpecificClientEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

BncsSpecificClientEventArgs Class
DigitalGiles.BNCS Namespace


BncsSpecificClientEventArgs Properties

BncsSpecificClientEventArgs Properties

The BncsSpecificClientEventArgs type exposes the following members.

Properties
 | Name | Description
Public property | DriverNumber | The driver number
Public property | RevertiveString | Revertive string as received from CSI (Inherited from BncsClientRevertiveEventArgs.)
Top
See Also

Reference

BncsSpecificClientEventArgs Class
DigitalGiles.BNCS Namespace


BncsSpecificClientEventArgs.DriverNumber Property

BncsSpecificClientEventArgsDriverNumber Property
The driver number

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint DriverNumber { get; set; }

Property Value

Type: UInt32
See Also

Reference

BncsSpecificClientEventArgs Class
DigitalGiles.BNCS Namespace


BncsUserStrEventArgs Class

BncsUserStrEventArgs Class
Event arguments associated with the UserStringReceived event
Inheritance Hierarchy
SystemObject
SystemEventArgs
DigitalGiles.BNCSBncsUserStrEventArgs
DigitalGiles.BNCSBncsDatabaseChangeEventArgs

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BncsUserStrEventArgs : EventArgs

The BncsUserStrEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | BncsUserStrEventArgs | Creates a new BncsInfoDriverUserStrEventArgs object
Public method | BncsUserStrEventArgs(String) | Creates a new BncsInfoDriverUserStrEventArgs object with the supplied User String
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns the class represented as a string (Overrides ObjectToString.)
Top
Properties
 | Name | Description
Public property | UserString | The User String (like "IW 104 'hello' 1") that was received
Top
See Also

Reference

DigitalGiles.BNCS Namespace


BncsUserStrEventArgs Constructor

BncsUserStrEventArgs Constructor
Overload List
 | Name | Description
Public method | BncsUserStrEventArgs | Creates a new BncsInfoDriverUserStrEventArgs object
Public method | BncsUserStrEventArgs(String) | Creates a new BncsInfoDriverUserStrEventArgs object with the supplied User String
Top
See Also

Reference

BncsUserStrEventArgs Class
DigitalGiles.BNCS Namespace


BncsUserStrEventArgs Constructor

BncsUserStrEventArgs Constructor
Creates a new BncsInfoDriverUserStrEventArgs object

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsUserStrEventArgs()
See Also

Reference

BncsUserStrEventArgs Class
BncsUserStrEventArgs Overload
DigitalGiles.BNCS Namespace


BncsUserStrEventArgs Constructor (String)

BncsUserStrEventArgs Constructor (String)
Creates a new BncsInfoDriverUserStrEventArgs object with the supplied User String

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsUserStrEventArgs(
    string message_
)

Parameters

message_
Type: SystemString
The User String received
See Also

Reference

BncsUserStrEventArgs Class
BncsUserStrEventArgs Overload
DigitalGiles.BNCS Namespace


BncsUserStrEventArgs Methods

BncsUserStrEventArgs Methods

The BncsUserStrEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns the class represented as a string (Overrides ObjectToString.)
Top
See Also

Reference

BncsUserStrEventArgs Class
DigitalGiles.BNCS Namespace


BncsUserStrEventArgs.ToString Method

BncsUserStrEventArgsToString Method
Returns the class represented as a string

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
The user string
See Also

Reference

BncsUserStrEventArgs Class
DigitalGiles.BNCS Namespace


BncsUserStrEventArgs Properties

BncsUserStrEventArgs Properties

The BncsUserStrEventArgs type exposes the following members.

Properties
 | Name | Description
Public property | UserString | The User String (like "IW 104 'hello' 1") that was received
Top
See Also

Reference

BncsUserStrEventArgs Class
DigitalGiles.BNCS Namespace


BncsUserStrEventArgs.UserString Property

BncsUserStrEventArgsUserString Property
The User String (like "IW 104 'hello' 1") that was received

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string UserString { get; set; }

Property Value

Type: String
See Also

Reference

BncsUserStrEventArgs Class
DigitalGiles.BNCS Namespace


BncsWrongDriverTypeException Class

BncsWrongDriverTypeException Class
The exception that is thrown when an operation could not be peformed on a BNCS driver because it is of the wrong type. For example, this exception is throw if you call GetTxRx on a CSI type driver.
Inheritance Hierarchy
SystemObject
SystemException
DigitalGiles.BNCSBncsWrongDriverTypeException

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class BncsWrongDriverTypeException : Exception

The BncsWrongDriverTypeException type exposes the following members.

Constructors
 | Name | Description
Public method | BncsWrongDriverTypeException | Initialises a new BncsWrongDriverTypeException exception
Public method | BncsWrongDriverTypeException(String) | Initialises a new BncsWrongDriverTypeException exception with the supplied detail message
Public method | BncsWrongDriverTypeException(String, Exception) | Initialises a new BncsWrongDriverTypeException object.
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetBaseException | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions. (Inherited from Exception.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetObjectData | When overridden in a derived class, sets the SerializationInfo with information about the exception. (Inherited from Exception.)
Public method | GetType | Gets the runtime type of the current instance. (Inherited from Exception.)
Public method | ToString | Creates and returns a string representation of the current exception. (Inherited from Exception.)
Top
Properties
 | Name | Description
Public property | Data | Gets a collection of key/value pairs that provide additional user-defined information about the exception. (Inherited from Exception.)
Public property | HelpLink | Gets or sets a link to the help file associated with this exception. (Inherited from Exception.)
Public property | InnerException | Gets the Exception instance that caused the current exception. (Inherited from Exception.)
Public property | Message | Gets a message that describes the current exception. (Inherited from Exception.)
Public property | Source | Gets or sets the name of the application or the object that causes the error. (Inherited from Exception.)
Public property | StackTrace | Gets a string representation of the immediate frames on the call stack. (Inherited from Exception.)
Public property | TargetSite | Gets the method that throws the current exception. (Inherited from Exception.)
Top
See Also

Reference

DigitalGiles.BNCS Namespace


BncsWrongDriverTypeException Constructor

BncsWrongDriverTypeException Constructor
Overload List
 | Name | Description
Public method | BncsWrongDriverTypeException | Initialises a new BncsWrongDriverTypeException exception
Public method | BncsWrongDriverTypeException(String) | Initialises a new BncsWrongDriverTypeException exception with the supplied detail message
Public method | BncsWrongDriverTypeException(String, Exception) | Initialises a new BncsWrongDriverTypeException object.
Top
See Also

Reference

BncsWrongDriverTypeException Class
DigitalGiles.BNCS Namespace


BncsWrongDriverTypeException Constructor

BncsWrongDriverTypeException Constructor
Initialises a new BncsWrongDriverTypeException exception

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsWrongDriverTypeException()
See Also

Reference

BncsWrongDriverTypeException Class
BncsWrongDriverTypeException Overload
DigitalGiles.BNCS Namespace


BncsWrongDriverTypeException Constructor (String)

BncsWrongDriverTypeException Constructor (String)
Initialises a new BncsWrongDriverTypeException exception with the supplied detail message

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsWrongDriverTypeException(
    string message_
)

Parameters

message_
Type: SystemString
Message containing further detail about the exception
See Also

Reference

BncsWrongDriverTypeException Class
BncsWrongDriverTypeException Overload
DigitalGiles.BNCS Namespace


BncsWrongDriverTypeException Constructor (String, Exception)

BncsWrongDriverTypeException Constructor (String, Exception)
Initialises a new BncsWrongDriverTypeException object.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BncsWrongDriverTypeException(
    string message_,
    Exception innerException_
)

Parameters

message_
Type: SystemString
Message containing further detail about the exception.
innerException_
Type: SystemException
The inner exception that caused this one.
See Also

Reference

BncsWrongDriverTypeException Class
BncsWrongDriverTypeException Overload
DigitalGiles.BNCS Namespace


BncsWrongDriverTypeException Methods

BncsWrongDriverTypeException Methods

The BncsWrongDriverTypeException type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetBaseException | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions. (Inherited from Exception.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetObjectData | When overridden in a derived class, sets the SerializationInfo with information about the exception. (Inherited from Exception.)
Public method | GetType | Gets the runtime type of the current instance. (Inherited from Exception.)
Public method | ToString | Creates and returns a string representation of the current exception. (Inherited from Exception.)
Top
See Also

Reference

BncsWrongDriverTypeException Class
DigitalGiles.BNCS Namespace


BncsWrongDriverTypeException Properties

BncsWrongDriverTypeException Properties

The BncsWrongDriverTypeException type exposes the following members.

Properties
 | Name | Description
Public property | Data | Gets a collection of key/value pairs that provide additional user-defined information about the exception. (Inherited from Exception.)
Public property | HelpLink | Gets or sets a link to the help file associated with this exception. (Inherited from Exception.)
Public property | InnerException | Gets the Exception instance that caused the current exception. (Inherited from Exception.)
Public property | Message | Gets a message that describes the current exception. (Inherited from Exception.)
Public property | Source | Gets or sets the name of the application or the object that causes the error. (Inherited from Exception.)
Public property | StackTrace | Gets a string representation of the immediate frames on the call stack. (Inherited from Exception.)
Public property | TargetSite | Gets the method that throws the current exception. (Inherited from Exception.)
Top
See Also

Reference

BncsWrongDriverTypeException Class
DigitalGiles.BNCS Namespace


CsiCache Enumeration

CsiCache Enumeration
Enumeration of CSI cache settings

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum CsiCache
Members
Member name | Value | Description
Off | 0 | Cache off.
On | 1 | Cache on.
See Also

Reference

DigitalGiles.BNCS Namespace


CsiDeviceStatus Structure

CsiDeviceStatus Structure
Structure containing the results of a call to GetDeviceStatus().

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public struct CsiDeviceStatus

The CsiDeviceStatus type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Indicates whether this instance and a specified object are equal. (Inherited from ValueType.)
Public method | GetHashCode | Returns the hash code for this instance. (Inherited from ValueType.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns the fully qualified type name of this instance. (Inherited from ValueType.)
Top
Fields
 | Name | Description
Public field | DatabaseDefined0 | Database defined flag 0
Public field | DatabaseDefined1 | Database defined flag 1
Public field | DatabaseDefined2 | Database defined flag 2
Public field | DatabaseDefined3 | Database defined flag 3
Public field | DatabaseDefined4 | Database defined flag 4
Public field | DatabaseDefined5 | Database defined flag 5
Public field | DatabaseDefined6 | Database defined flag 6
Public field | DatabaseDefined7 | Database defined flag 7
Public field | DatabaseDefined8 | Database defined flag 8
Public field | DatabaseDefined9 | Database defined flag 9
Public field | DatabaseSize0 | DB 0
Public field | DatabaseSize1 | DB 1
Public field | DeviceID | Device ID
Public field | PropertyString | Property string
Public field | Type | Type
Public field | Version | Version
Top
See Also

Reference

DigitalGiles.BNCS Namespace


CsiDeviceStatus Fields

CsiDeviceStatus Fields

The CsiDeviceStatus type exposes the following members.

Fields
 | Name | Description
Public field | DatabaseDefined0 | Database defined flag 0
Public field | DatabaseDefined1 | Database defined flag 1
Public field | DatabaseDefined2 | Database defined flag 2
Public field | DatabaseDefined3 | Database defined flag 3
Public field | DatabaseDefined4 | Database defined flag 4
Public field | DatabaseDefined5 | Database defined flag 5
Public field | DatabaseDefined6 | Database defined flag 6
Public field | DatabaseDefined7 | Database defined flag 7
Public field | DatabaseDefined8 | Database defined flag 8
Public field | DatabaseDefined9 | Database defined flag 9
Public field | DatabaseSize0 | DB 0
Public field | DatabaseSize1 | DB 1
Public field | DeviceID | Device ID
Public field | PropertyString | Property string
Public field | Type | Type
Public field | Version | Version
Top
See Also

Reference

CsiDeviceStatus Structure
DigitalGiles.BNCS Namespace


CsiDeviceStatus.DatabaseDefined0 Field

CsiDeviceStatusDatabaseDefined0 Field
Database defined flag 0

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool DatabaseDefined0

Field Value

Type: Boolean
See Also

Reference

CsiDeviceStatus Structure
DigitalGiles.BNCS Namespace


CsiDeviceStatus.DatabaseDefined1 Field

CsiDeviceStatusDatabaseDefined1 Field
Database defined flag 1

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool DatabaseDefined1

Field Value

Type: Boolean
See Also

Reference

CsiDeviceStatus Structure
DigitalGiles.BNCS Namespace


CsiDeviceStatus.DatabaseDefined2 Field

CsiDeviceStatusDatabaseDefined2 Field
Database defined flag 2

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool DatabaseDefined2

Field Value

Type: Boolean
See Also

Reference

CsiDeviceStatus Structure
DigitalGiles.BNCS Namespace


CsiDeviceStatus.DatabaseDefined3 Field

CsiDeviceStatusDatabaseDefined3 Field
Database defined flag 3

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool DatabaseDefined3

Field Value

Type: Boolean
See Also

Reference

CsiDeviceStatus Structure
DigitalGiles.BNCS Namespace


CsiDeviceStatus.DatabaseDefined4 Field

CsiDeviceStatusDatabaseDefined4 Field
Database defined flag 4

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool DatabaseDefined4

Field Value

Type: Boolean
See Also

Reference

CsiDeviceStatus Structure
DigitalGiles.BNCS Namespace


CsiDeviceStatus.DatabaseDefined5 Field

CsiDeviceStatusDatabaseDefined5 Field
Database defined flag 5

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool DatabaseDefined5

Field Value

Type: Boolean
See Also

Reference

CsiDeviceStatus Structure
DigitalGiles.BNCS Namespace


CsiDeviceStatus.DatabaseDefined6 Field

CsiDeviceStatusDatabaseDefined6 Field
Database defined flag 6

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool DatabaseDefined6

Field Value

Type: Boolean
See Also

Reference

CsiDeviceStatus Structure
DigitalGiles.BNCS Namespace


CsiDeviceStatus.DatabaseDefined7 Field

CsiDeviceStatusDatabaseDefined7 Field
Database defined flag 7

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool DatabaseDefined7

Field Value

Type: Boolean
See Also

Reference

CsiDeviceStatus Structure
DigitalGiles.BNCS Namespace


CsiDeviceStatus.DatabaseDefined8 Field

CsiDeviceStatusDatabaseDefined8 Field
Database defined flag 8

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool DatabaseDefined8

Field Value

Type: Boolean
See Also

Reference

CsiDeviceStatus Structure
DigitalGiles.BNCS Namespace


CsiDeviceStatus.DatabaseDefined9 Field

CsiDeviceStatusDatabaseDefined9 Field
Database defined flag 9

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool DatabaseDefined9

Field Value

Type: Boolean
See Also

Reference

CsiDeviceStatus Structure
DigitalGiles.BNCS Namespace


CsiDeviceStatus.DatabaseSize0 Field

CsiDeviceStatusDatabaseSize0 Field
DB 0

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint DatabaseSize0

Field Value

Type: UInt32
See Also

Reference

CsiDeviceStatus Structure
DigitalGiles.BNCS Namespace


CsiDeviceStatus.DatabaseSize1 Field

CsiDeviceStatusDatabaseSize1 Field
DB 1

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint DatabaseSize1

Field Value

Type: UInt32
See Also

Reference

CsiDeviceStatus Structure
DigitalGiles.BNCS Namespace


CsiDeviceStatus.DeviceID Field

CsiDeviceStatusDeviceID Field
Device ID

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint DeviceID

Field Value

Type: UInt32
See Also

Reference

CsiDeviceStatus Structure
DigitalGiles.BNCS Namespace


CsiDeviceStatus.PropertyString Field

CsiDeviceStatusPropertyString Field
Property string

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string PropertyString

Field Value

Type: String
See Also

Reference

CsiDeviceStatus Structure
DigitalGiles.BNCS Namespace


CsiDeviceStatus.Type Field

CsiDeviceStatusType Field
Type

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CsiIniFileType Type

Field Value

Type: CsiIniFileType
See Also

Reference

CsiDeviceStatus Structure
DigitalGiles.BNCS Namespace


CsiDeviceStatus.Version Field

CsiDeviceStatusVersion Field
Version

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public CsiIniFileVersion Version

Field Value

Type: CsiIniFileVersion
See Also

Reference

CsiDeviceStatus Structure
DigitalGiles.BNCS Namespace


CsiDeviceStatus Methods

CsiDeviceStatus Methods

The CsiDeviceStatus type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Indicates whether this instance and a specified object are equal. (Inherited from ValueType.)
Public method | GetHashCode | Returns the hash code for this instance. (Inherited from ValueType.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns the fully qualified type name of this instance. (Inherited from ValueType.)
Top
See Also

Reference

CsiDeviceStatus Structure
DigitalGiles.BNCS Namespace


CsiIniFileType Enumeration

CsiIniFileType Enumeration
Device type based on CSI INI files.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum CsiIniFileType
Members
Member name | Value | Description
Dev | 0 | Device.
Grd | 1 | Generic Router Driver.
Gpid | 2 | GPIO driver.
Info | 3 | Info driver.
See Also

Reference

DigitalGiles.BNCS Namespace


CsiIniFileVersion Enumeration

CsiIniFileVersion Enumeration
Device version based on CSI INI files. Whether CSI thinks the device is a V1 (GRD/GPID/INFO INI) or V2 (DEV INI) device.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum CsiIniFileVersion
Members
Member name | Value | Description
Unknown | 0 | Unknown INI file version.
Version1 | 1 | CSI v1 INI file.
Version2 | 2 | CSI v2 INI file.
See Also

Reference

DigitalGiles.BNCS Namespace


DriverVersion Enumeration

DriverVersion Enumeration
Enumeration of the different sorts of driver machine available.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum DriverVersion
Members
Member name | Value | Description
Unknown | 0 | Version unknown.
Local | 1 | Local.
V4 | 2 | Version 4.
V3 | 3 | Version 3.
V2 | 4 | Version 2.
See Also

Reference

DigitalGiles.BNCS Namespace


HostDriverConnectState Enumeration

HostDriverConnectState Enumeration
BNCS connect state enumeration.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum HostDriverConnectState
Members
Member name | Value | Description
Disconnected | 0 | Disconnected from driver.
Connected | 1 | Connected to driver.
Disconnecting | 2 | Disconnecting from driver.
Connecting | 3 | Connecting to driver.
See Also

Reference

DigitalGiles.BNCS Namespace


HostDriverIFMode Enumeration

HostDriverIFMode Enumeration
BNCS IFMODE enumeration.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum HostDriverIFMode
Members
Member name | Value | Description
None | 0 | No mode.
RxOnly | 1 | RX only.
TxRx | 2 | TX and RX.
ForceTxRx | 3 | Force to TX/RX mode.
TxRxInq | 4 | TX/RX Inq mode.
See Also

Reference

DigitalGiles.BNCS Namespace


HostDriverType Enumeration

HostDriverType Enumeration
BNCS driver type enumeration.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum HostDriverType
Members
Member name | Value | Description
None | 0 | Unknown
Grd | 1 | Generic router driver.
Id | 2 | Info driver.
Gpid | 3 | General purpose input/output driver.
Csi | 4 | Control system interface.
Rev | 5 | Rev.
See Also

Reference

DigitalGiles.BNCS Namespace


IniFileLocation Structure

IniFileLocation Structure
Structure defining an INI file.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public struct IniFileLocation

The IniFileLocation type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Indicates whether this instance and a specified object are equal. (Inherited from ValueType.)
Public method | GetHashCode | Returns the hash code for this instance. (Inherited from ValueType.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns the fully qualified type name of this instance. (Inherited from ValueType.)
Top
Fields
 | Name | Description
Public field | DeviceID | Driver ID.
Public field | FullName | Fully-qualified path including filename to the INI file.
Public field | Name | INI file name (no path).
Public field | Path | INI file path (no name or trailing backslash).
Public field | V4Root | Defined for V4 only, this is the path to the root CollediaControl folder.
Public field | Version | Driver version type.
Public field | Workstation | Workstation number on which this driver is running.
Top
See Also

Reference

DigitalGiles.BNCS Namespace


IniFileLocation Fields

IniFileLocation Fields

The IniFileLocation type exposes the following members.

Fields
 | Name | Description
Public field | DeviceID | Driver ID.
Public field | FullName | Fully-qualified path including filename to the INI file.
Public field | Name | INI file name (no path).
Public field | Path | INI file path (no name or trailing backslash).
Public field | V4Root | Defined for V4 only, this is the path to the root CollediaControl folder.
Public field | Version | Driver version type.
Public field | Workstation | Workstation number on which this driver is running.
Top
See Also

Reference

IniFileLocation Structure
DigitalGiles.BNCS Namespace


IniFileLocation.DeviceID Field

IniFileLocationDeviceID Field
Driver ID.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint DeviceID

Field Value

Type: UInt32
See Also

Reference

IniFileLocation Structure
DigitalGiles.BNCS Namespace


IniFileLocation.FullName Field

IniFileLocationFullName Field
Fully-qualified path including filename to the INI file.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string FullName

Field Value

Type: String
See Also

Reference

IniFileLocation Structure
DigitalGiles.BNCS Namespace


IniFileLocation.Name Field

IniFileLocationName Field
INI file name (no path).

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Name

Field Value

Type: String
See Also

Reference

IniFileLocation Structure
DigitalGiles.BNCS Namespace


IniFileLocation.Path Field

IniFileLocationPath Field
INI file path (no name or trailing backslash).

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Path

Field Value

Type: String
See Also

Reference

IniFileLocation Structure
DigitalGiles.BNCS Namespace


IniFileLocation.V4Root Field

IniFileLocationV4Root Field
Defined for V4 only, this is the path to the root CollediaControl folder.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string V4Root

Field Value

Type: String
See Also

Reference

IniFileLocation Structure
DigitalGiles.BNCS Namespace


IniFileLocation.Version Field

IniFileLocationVersion Field
Driver version type.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public DriverVersion Version

Field Value

Type: DriverVersion
See Also

Reference

IniFileLocation Structure
DigitalGiles.BNCS Namespace


IniFileLocation.Workstation Field

IniFileLocationWorkstation Field
Workstation number on which this driver is running.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public uint Workstation

Field Value

Type: UInt32
See Also

Reference

IniFileLocation Structure
DigitalGiles.BNCS Namespace


IniFileLocation Methods

IniFileLocation Methods

The IniFileLocation type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Indicates whether this instance and a specified object are equal. (Inherited from ValueType.)
Public method | GetHashCode | Returns the hash code for this instance. (Inherited from ValueType.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns the fully qualified type name of this instance. (Inherited from ValueType.)
Top
See Also

Reference

IniFileLocation Structure
DigitalGiles.BNCS Namespace


ResilientIDMessageEventArgs Class

ResilientIDMessageEventArgs Class
Event argument class for resilience messages
Inheritance Hierarchy
SystemObject
SystemEventArgs
DigitalGiles.BNCSResilientIDMessageEventArgs

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class ResilientIDMessageEventArgs : EventArgs

The ResilientIDMessageEventArgs type exposes the following members.

Methods
 | Name | Description
 | CreateEventArgs | Creates a new ResilientIDMessageEventArgs instance based on the message value supplied. This must be one of the following: NativeMethods.BBC_INQDEVGOTXRX, NativeMethods.BBC_REQDEVGORXONLY, NativeMethods.BBC_REQDEVGOTXRX or NativeMethods.BBC_DEVICEIDINUSE, else this method will return null.
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | MessageType | Message type
Public property | Response | Response to CSI flag
Top
See Also

Reference

DigitalGiles.BNCS Namespace


ResilientIDMessageEventArgs Methods

ResilientIDMessageEventArgs Methods

The ResilientIDMessageEventArgs type exposes the following members.

Methods
 | Name | Description
 | CreateEventArgs | Creates a new ResilientIDMessageEventArgs instance based on the message value supplied. This must be one of the following: NativeMethods.BBC_INQDEVGOTXRX, NativeMethods.BBC_REQDEVGORXONLY, NativeMethods.BBC_REQDEVGOTXRX or NativeMethods.BBC_DEVICEIDINUSE, else this method will return null.
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

ResilientIDMessageEventArgs Class
DigitalGiles.BNCS Namespace


ResilientIDMessageEventArgs.CreateEventArgs Method

ResilientIDMessageEventArgsCreateEventArgs Method
Creates a new ResilientIDMessageEventArgs instance based on the message value supplied. This must be one of the following: NativeMethods.BBC_INQDEVGOTXRX, NativeMethods.BBC_REQDEVGORXONLY, NativeMethods.BBC_REQDEVGOTXRX or NativeMethods.BBC_DEVICEIDINUSE, else this method will return null.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static ResilientIDMessageEventArgs CreateEventArgs(
    int message_
)

Parameters

message_
Type: SystemInt32
Message value to test

Return Value

Type: ResilientIDMessageEventArgs
A ResilientIDMessageEventArgs when the supplied message value is a valid resiliency message else null
See Also

Reference

ResilientIDMessageEventArgs Class
DigitalGiles.BNCS Namespace


ResilientIDMessageEventArgs Properties

ResilientIDMessageEventArgs Properties

The ResilientIDMessageEventArgs type exposes the following members.

Properties
 | Name | Description
Public property | MessageType | Message type
Public property | Response | Response to CSI flag
Top
See Also

Reference

ResilientIDMessageEventArgs Class
DigitalGiles.BNCS Namespace


ResilientIDMessageEventArgs.MessageType Property

ResilientIDMessageEventArgsMessageType Property
Message type

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public BNCSResilienceMessageType MessageType { get; }

Property Value

Type: BNCSResilienceMessageType
See Also

Reference

ResilientIDMessageEventArgs Class
DigitalGiles.BNCS Namespace


ResilientIDMessageEventArgs.Response Property

ResilientIDMessageEventArgsResponse Property
Response to CSI flag

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Response { get; set; }

Property Value

Type: Boolean
See Also

Reference

ResilientIDMessageEventArgs Class
DigitalGiles.BNCS Namespace


ResilientIDMessageEventHandler Delegate

ResilientIDMessageEventHandler Delegate
Delegate for resiliency message events

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void ResilientIDMessageEventHandler(
    Object sender,
    ResilientIDMessageEventArgs e
)

Parameters

sender
Type: SystemObject
Calling object
e
Type: DigitalGiles.BNCSResilientIDMessageEventArgs
Arguments
See Also

Reference

DigitalGiles.BNCS Namespace


TxRxNetMsgStatus Enumeration

TxRxNetMsgStatus Enumeration
Enumeration of TxRx network status messages

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum TxRxNetMsgStatus
Members
Member name | Value | Description
Unknown | 0 | Status unknown.
RxOnly | 1 | RX only.
TxRx | 2 | TX and RX.
See Also

Reference

DigitalGiles.BNCS Namespace


VersionChecker Class

VersionChecker Class
gBNCS class providing cross-version compatibility methods.
Inheritance Hierarchy
SystemObject
DigitalGiles.BNCSVersionChecker

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public sealed class VersionChecker

The VersionChecker type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
 | GetLocation(String, DriverVersion) | Determines what sort of driver machine this is (V2, V3 or V4) and works out what the correct INI file is.
 | GetLocation(UInt32, DriverVersion) | Determines what sort of driver machine this is (V2, V3 or V4) and works out what the correct INI file is.
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

DigitalGiles.BNCS Namespace


VersionChecker Methods

VersionChecker Methods

The VersionChecker type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
 | GetLocation(String, DriverVersion) | Determines what sort of driver machine this is (V2, V3 or V4) and works out what the correct INI file is.
 | GetLocation(UInt32, DriverVersion) | Determines what sort of driver machine this is (V2, V3 or V4) and works out what the correct INI file is.
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

VersionChecker Class
DigitalGiles.BNCS Namespace


VersionChecker.GetLocation Method

VersionCheckerGetLocation Method
Overload List
Name | Description
GetLocation(String, DriverVersion) | Determines what sort of driver machine this is (V2, V3 or V4) and works out what the correct INI file is.
GetLocation(UInt32, DriverVersion) | Determines what sort of driver machine this is (V2, V3 or V4) and works out what the correct INI file is.
Top
See Also

Reference

VersionChecker Class
DigitalGiles.BNCS Namespace


VersionChecker.GetLocation Method (String, DriverVersion)

VersionCheckerGetLocation Method (String, DriverVersion)
Determines what sort of driver machine this is (V2, V3 or V4) and works out what the correct INI file is.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static IniFileLocation GetLocation(
    string iniFileName,
    DriverVersion preferredVersion
)

Parameters

iniFileName
Type: SystemString
Name of INI file.
preferredVersion
Type: DigitalGiles.BNCSDriverVersion
The config environment to choose if there is more than one choice available.

Return Value

Type: IniFileLocation
The INI file location
See Also

Reference

VersionChecker Class
GetLocation Overload
DigitalGiles.BNCS Namespace


VersionChecker.GetLocation Method (UInt32, DriverVersion)

VersionCheckerGetLocation Method (UInt32, DriverVersion)
Determines what sort of driver machine this is (V2, V3 or V4) and works out what the correct INI file is.

Namespace: DigitalGiles.BNCS
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static IniFileLocation GetLocation(
    uint driverNumber_,
    DriverVersion preferredVersion_
)

Parameters

driverNumber_
Type: SystemUInt32
Driver number, required to form the INI file name.
preferredVersion_
Type: DigitalGiles.BNCSDriverVersion
The config environment to choose if there is more than one choice available.

Return Value

Type: IniFileLocation
The INI file location
See Also

Reference

VersionChecker Class
GetLocation Overload
DigitalGiles.BNCS Namespace


DigitalGiles.External Namespace

DigitalGiles.External Namespace
This namespace has factory methods enabling the instanciation of CSI, ID and GRD classes from outside of the DigitalGiles.BNCS namespace.
Classes
 | Class | Description
Public class | pBNCSFactory | A static class enabling instanciation of the BNCSInfoDriver and BNCSCsi classes from an external assembly. The constructors for the classes are marked with an internal access specifier. This is fine until you wish to create instances from this DLL project, as they are internal then this scenario will mean that the constructors cannot be seen in your assembley. These methods create these class instances withing the same assembley and pass them back to yours; creation by proxy.


pBNCSFactory Class

pBNCSFactory Class
A static class enabling instanciation of the BNCSInfoDriver and BNCSCsi classes from an external assembly. The constructors for the classes are marked with an internal access specifier. This is fine until you wish to create instances from this DLL project, as they are internal then this scenario will mean that the constructors cannot be seen in your assembley. These methods create these class instances withing the same assembley and pass them back to yours; creation by proxy.
Inheritance Hierarchy
SystemObject
DigitalGiles.ExternalpBNCSFactory

Namespace: DigitalGiles.External
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static class pBNCSFactory

The pBNCSFactory type exposes the following members.

Methods
Name Description
CSIFactory
Returns a new instance of a BNCSCsi class using the provided argument.
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
GetNativeMethodField
Returns the value of a public const from the NativeMethods static class
GetNativeMethodFields
Returns all field names and values from NativeMethods class
GRDFactory
Returns a new instance of a BNCSGenericRouterDriver class using the provided arguments.
IDFactory
Returns a new instance of a BNCSInfoDriver class using the provided arguments.
Examples
This code is a demonstration of creating and using BNCSCsi and DigitalGiles.BNCS.BncsInfodriver classes.
Copy
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Infodriver variable
    private BNCSInfoDriver _id = null;
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);

        // Create, setup and connect our Infodriver.
        _id = pBNCSFactory.IDFactory("Pathfinder GPIO Driver", _idNumber);
        _id.SlotMessageReceived += _id_SlotMessageReceived;
        _id.Connect(true);
    }

    void _id_SlotMessageReceived(object sender, BncsSlotMessageEventArgs e)
    {
        // Log slot changes to a ListBox
        listBox.Items.Add("Change to slot #" + e.Slot.ToString() + ": " + e.Message);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected change modes and disconnect
        if (_id.HostConnectState == HostDriverConnectState.Connected)
        {
            _id.OkToGoRxOnly = true;
            _id.OkToGoTXRX = false;
            try
            {
                _id.ChangeIfMode(HostDriverIFMode.RxOnly);
            }
            catch { }
            _id.Disconnect();
        }
        // Dispose of the Info Driver
        _id.Dispose();

        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
ResilientIDFactory
Returns a new instance of a BNCSResilientInfoDriver class using the provided arguments. NB this method is provided purely for parity with the IDFactory() method which returns a BNCSInfoDriver. A BNCSResilientInfoDriver is not derived from an abstract class and therefore it's constructor may be called directly.
Top
See Also

Reference

DigitalGiles.External Namespace


pBNCSFactory Methods

pBNCSFactory Methods

The pBNCSFactory type exposes the following members.

Methods
Name Description
CSIFactory
Returns a new instance of a BNCSCsi class using the provided argument.
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
GetNativeMethodField
Returns the value of a public const from the NativeMethods static class
GetNativeMethodFields
Returns all field names and values from NativeMethods class
GRDFactory
Returns a new instance of a BNCSGenericRouterDriver class using the provided arguments.
IDFactory
Returns a new instance of a BNCSInfoDriver class using the provided arguments.
Examples
This code is a demonstration of creating and using BNCSCsi and DigitalGiles.BNCS.BncsInfodriver classes.
Copy
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Infodriver variable
    private BNCSInfoDriver _id = null;
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);

        // Create, setup and connect our Infodriver.
        _id = pBNCSFactory.IDFactory("Pathfinder GPIO Driver", _idNumber);
        _id.SlotMessageReceived += _id_SlotMessageReceived;
        _id.Connect(true);
    }

    void _id_SlotMessageReceived(object sender, BncsSlotMessageEventArgs e)
    {
        // Log slot changes to a ListBox
        listBox.Items.Add("Change to slot #" + e.Slot.ToString() + ": " + e.Message);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected change modes and disconnect
        if (_id.HostConnectState == HostDriverConnectState.Connected)
        {
            _id.OkToGoRxOnly = true;
            _id.OkToGoTXRX = false;
            try
            {
                _id.ChangeIfMode(HostDriverIFMode.RxOnly);
            }
            catch { }
            _id.Disconnect();
        }
        // Dispose of the Info Driver
        _id.Dispose();

        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}
ResilientIDFactory
Returns a new instance of a BNCSResilientInfoDriver class using the provided arguments. NB this method is provided purely for parity with the IDFactory() method which returns a BNCSInfoDriver. A BNCSResilientInfoDriver is not derived from an abstract class and therefore it's constructor may be called directly.
Top
See Also

Reference

pBNCSFactory Class
DigitalGiles.External Namespace


pBNCSFactory.CSIFactory Method

pBNCSFactoryCSIFactory Method
Returns a new instance of a BNCSCsi class using the provided argument.
Examples
This code demonstrates how to connect to a CSI instance.
Copy
// Main window class
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}

Namespace: DigitalGiles.External
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static BNCSCsi CSIFactory(
    string name_
)

Parameters

name_
Type: SystemString
User defined device name

Return Value

Type: BNCSCsi
A new BNCSCsi instance
See Also

Reference

pBNCSFactory Class
DigitalGiles.External Namespace


pBNCSFactory.GetNativeMethodField Method

pBNCSFactoryGetNativeMethodField Method
Returns the value of a public const from the NativeMethods static class

Namespace: DigitalGiles.External
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static int GetNativeMethodField(
    string fieldName_
)

Parameters

fieldName_
Type: SystemString
Field name to return

Return Value

Type: Int32
The value found or -1 if not found
See Also

Reference

pBNCSFactory Class
DigitalGiles.External Namespace


pBNCSFactory.GetNativeMethodFields Method

pBNCSFactoryGetNativeMethodFields Method
Returns all field names and values from NativeMethods class

Namespace: DigitalGiles.External
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static Dictionary<string, int> GetNativeMethodFields()

Return Value

Type: Dictionary String, Int32
Dictionary of all field names and values from NativeMethods class
See Also

Reference

pBNCSFactory Class
DigitalGiles.External Namespace


pBNCSFactory.GRDFactory Method

pBNCSFactoryGRDFactory Method
Returns a new instance of a BNCSGenericRouterDriver class using the provided arguments.

Namespace: DigitalGiles.External
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static BNCSGenericRouterDriver GRDFactory(
    string name_,
    uint number_,
    uint size_,
    bool allowNegativeSourcesAndDestinations_ = false
)

Parameters

name_
Type: SystemString
User defined device name
number_
Type: SystemUInt32
BNCS device number
size_
Type: SystemUInt32
Size
allowNegativeSourcesAndDestinations_ (Optional)
Type: SystemBoolean
Optional flag, default is false, if set then minimum sources and destinations are set to -1

Return Value

Type: BNCSGenericRouterDriver
A new BNCSGenericRouterDriver instance.
See Also

Reference

pBNCSFactory Class
DigitalGiles.External Namespace


pBNCSFactory.IDFactory Method

pBNCSFactoryIDFactory Method
Returns a new instance of a BNCSInfoDriver class using the provided arguments.
Examples
This code is a demonstration of creating and using BNCSCsi and DigitalGiles.BNCS.BncsInfodriver classes.
Copy
public partial class MainWindow : Window
{
    // Create a CSI instance.
    private BNCSCsi _csi = pBNCSFactory.CSIFactory("");
    // Infodriver variable
    private BNCSInfoDriver _id = null;
    // Info driver number.
    private const int _idNumber = 403;

    public MainWindow()
    {
        InitializeComponent();

        // Assign some CSI event handlers.
        _csi.HostConnectStatusChanged += csi_HostConnectStatusChanged;
        _csi.HostConnected += _csi_HostConnected;
    }

    private void AppLoaded(object sender, RoutedEventArgs e)
    {
        // Connect to CSI
        _csi.Connect(true);
    }

    void _csi_HostConnected(object sender, BncsConnectedEventArgs e)
    {
        // Register CSI when connected
        _csi.RegisterAsClient();
        _csi.RegisterForDevice(_idNumber, 1, 10, false);

        // Create, setup and connect our Infodriver.
        _id = pBNCSFactory.IDFactory("Pathfinder GPIO Driver", _idNumber);
        _id.SlotMessageReceived += _id_SlotMessageReceived;
        _id.Connect(true);
    }

    void _id_SlotMessageReceived(object sender, BncsSlotMessageEventArgs e)
    {
        // Log slot changes to a ListBox
        listBox.Items.Add("Change to slot #" + e.Slot.ToString() + ": " + e.Message);
    }

    void csi_HostConnectStatusChanged(object sender, BncsConnectStatusChangedEventArgs e)
    {
        // Log CSI connection state to a ListBox
        listBox.Items.Add("CSI: " + e.ConnectStatus.ToString());
    }

    private void AppClosing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        // If connected change modes and disconnect
        if (_id.HostConnectState == HostDriverConnectState.Connected)
        {
            _id.OkToGoRxOnly = true;
            _id.OkToGoTXRX = false;
            try
            {
                _id.ChangeIfMode(HostDriverIFMode.RxOnly);
            }
            catch { }
            _id.Disconnect();
        }
        // Dispose of the Info Driver
        _id.Dispose();

        // If connected then unregister and disconnect from CSI.
        if (_csi.HostConnectState == HostDriverConnectState.Connected)
        {
            if (_csi.IsRegisteredAsClient)
                _csi.UnregisterAsClient();

            _csi.Disconnect();
        }
        // Finally dispose of CSI
        _csi.Dispose();
    }
}

Namespace: DigitalGiles.External
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static BNCSInfoDriver IDFactory(
    string name_,
    uint number_
)

Parameters

name_
Type: SystemString
User defined device name
number_
Type: SystemUInt32
BNCS device number

Return Value

Type: BNCSInfoDriver
A new BNCSInfoDriver instance
See Also

Reference

pBNCSFactory Class
DigitalGiles.External Namespace


pBNCSFactory.ResilientIDFactory Method

pBNCSFactoryResilientIDFactory Method
Returns a new instance of a BNCSResilientInfoDriver class using the provided arguments. NB this method is provided purely for parity with the IDFactory() method which returns a BNCSInfoDriver. A BNCSResilientInfoDriver is not derived from an abstract class and therefore it's constructor may be called directly.

Namespace: DigitalGiles.External
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static BNCSResilentInfoDriver ResilientIDFactory(
    string name_,
    uint number_,
    bool hostDriverConnected_ = false
)

Parameters

name_
Type: SystemString
User defined device name
number_
Type: SystemUInt32
BNCS device number
hostDriverConnected_ (Optional)
Type: SystemBoolean
Optional host driver connection status, defaults to false

Return Value

Type: BNCSResilentInfoDriver
A new [!:DigitalGiles.BNCS.BNCSResilientInfoDriver] instance
See Also

Reference

pBNCSFactory Class
DigitalGiles.External Namespace


DigitalGiles.INIFile Namespace

DigitalGiles.INIFile Namespace
This namespace has a class for reading from and writing to INI files.
Classes
 | Class | Description
Public class | INIFileWrangler | Class encapsulating creation and manipulation of INI files.


INIFileWrangler Class

INIFileWrangler Class
Class encapsulating creation and manipulation of INI files.
Inheritance Hierarchy
SystemObject
DigitalGiles.INIFileINIFileWrangler

Namespace: DigitalGiles.INIFile
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class INIFileWrangler : IDisposable

The INIFileWrangler type exposes the following members.

Constructors
 | Name | Description
Public method | INIFileWrangler | Creates a new INIFileWrangler object to read/write settings from/to a specified INI file.
Top
Methods
 | Name | Description
Public method | DeleteSetting | Deletes the specified line from the INI file.
Public method | Dispose | Implements IDisposable - do not make this method virtual! A derived class should not be able to override this method.
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ReadAllSectionNames | Returns an ArrayList with all the section names found in the INI file
Public method | ReadAllSettingsInSection | Returns an ArrayList with all the settings from the specified section.
Public method | ReadBool | Reads a boolean value from the INI file.
Public method | ReadInt | Reads an integral value from the INI file.
Public method | ReadOrInitAllSettingsInSect | Automated settings import method that accepts an ArrayList of INIFileSettings, attempts to find them in the INI file and writes the default values back if they're missing.
Public method | ReadOrInitBool | Reads a boolean value from the INI file, if it is not found then the default value is returned and written to file.
Public method | ReadOrInitInt | Reads an integral value from the INI file, if it is not found then the default value is returned and written to file.
Public method | ReadOrInitSetting | Reads a string value from the INI file, if it is not found then the default value is returned and written to file.
Public method | ReadSetting(String, String, Boolean) | Reads a string value from the INI file.
Public method | ReadSetting(String, String, String) | Reads a string value from the INI file.
Public method | SaveSetting | Stores a value to the INI file.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | IsReadOnly | Gets the read only flag.
Top
See Also

Reference

DigitalGiles.INIFile Namespace


INIFileWrangler Constructor

INIFileWrangler Constructor
Creates a new INIFileWrangler object to read/write settings from/to a specified INI file.

Namespace: DigitalGiles.INIFile
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public INIFileWrangler(
    string filename_,
    bool share_
)

Parameters

filename_
Type: SystemString
Full path and filename of the INI file.
share_
Type: SystemBoolean
True if the file should be opened in such a way that other processes can also access it at the same time.
See Also

Reference

INIFileWrangler Class
DigitalGiles.INIFile Namespace


INIFileWrangler Methods

INIFileWrangler Methods

The INIFileWrangler type exposes the following members.

Methods
 | Name | Description
Public method | DeleteSetting | Deletes the specified line from the INI file.
Public method | Dispose | Implements IDisposable - do not make this method virtual! A derived class should not be able to override this method.
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ReadAllSectionNames | Returns an ArrayList with all the section names found in the INI file
Public method | ReadAllSettingsInSection | Returns an ArrayList with all the settings from the specified section.
Public method | ReadBool | Reads a boolean value from the INI file.
Public method | ReadInt | Reads an integral value from the INI file.
Public method | ReadOrInitAllSettingsInSect | Automated settings import method that accepts an ArrayList of INIFileSettings, attempts to find them in the INI file and writes the default values back if they're missing.
Public method | ReadOrInitBool | Reads a boolean value from the INI file, if it is not found then the default value is returned and written to file.
Public method | ReadOrInitInt | Reads an integral value from the INI file, if it is not found then the default value is returned and written to file.
Public method | ReadOrInitSetting | Reads a string value from the INI file, if it is not found then the default value is returned and written to file.
Public method | ReadSetting(String, String, Boolean) | Reads a string value from the INI file.
Public method | ReadSetting(String, String, String) | Reads a string value from the INI file.
Public method | SaveSetting | Stores a value to the INI file.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

INIFileWrangler Class
DigitalGiles.INIFile Namespace


INIFileWrangler.DeleteSetting Method

INIFileWranglerDeleteSetting Method
Deletes the specified line from the INI file.

Namespace: DigitalGiles.INIFile
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool DeleteSetting(
    string iniFileSection_,
    string settingToDelete_,
    bool caseSensitive_
)

Parameters

iniFileSection_
Type: SystemString
Section name in which the setting is located.
settingToDelete_
Type: SystemString
The setting to delete.
caseSensitive_
Type: SystemBoolean
True if searches for section and setting names should be case sensititve.

Return Value

Type: Boolean
True on success
See Also

Reference

INIFileWrangler Class
DigitalGiles.INIFile Namespace


INIFileWrangler.Dispose Method

INIFileWranglerDispose Method
Implements IDisposable - do not make this method virtual! A derived class should not be able to override this method.

Namespace: DigitalGiles.INIFile
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Dispose()

Implements

IDisposableDispose
See Also

Reference

INIFileWrangler Class
DigitalGiles.INIFile Namespace


INIFileWrangler.ReadAllSectionNames Method

INIFileWranglerReadAllSectionNames Method
Returns an ArrayList with all the section names found in the INI file

Namespace: DigitalGiles.INIFile
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ArrayList ReadAllSectionNames()

Return Value

Type: ArrayList
An ArrayList of section names
See Also

Reference

INIFileWrangler Class
DigitalGiles.INIFile Namespace


INIFileWrangler.ReadAllSettingsInSection Method

INIFileWranglerReadAllSettingsInSection Method
Returns an ArrayList with all the settings from the specified section.

Namespace: DigitalGiles.INIFile
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public ArrayList ReadAllSettingsInSection(
    string iniFileSection,
    bool caseSensitive
)

Parameters

iniFileSection
Type: SystemString
The section to probe.
caseSensitive
Type: SystemBoolean
True if search for section name should be case sensititve.

Return Value

Type: ArrayList
An array list of all settings.
See Also

Reference

INIFileWrangler Class
DigitalGiles.INIFile Namespace


INIFileWrangler.ReadBool Method

INIFileWranglerReadBool Method
Reads a boolean value from the INI file.

Namespace: DigitalGiles.INIFile
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool ReadBool(
    string section_,
    string setting_,
    bool defaultValue_
)

Parameters

section_
Type: SystemString
Section name in which to search for the setting.
setting_
Type: SystemString
The setting name.
defaultValue_
Type: SystemBoolean
Value to return if the setting was not found.

Return Value

Type: Boolean
The setting if found, the defualt value if the setting is not found
See Also

Reference

INIFileWrangler Class
DigitalGiles.INIFile Namespace


INIFileWrangler.ReadInt Method

INIFileWranglerReadInt Method
Reads an integral value from the INI file.

Namespace: DigitalGiles.INIFile
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int ReadInt(
    string section_,
    string setting_,
    int defaultValue_
)

Parameters

section_
Type: SystemString
Section name in which to search for the setting.
setting_
Type: SystemString
The setting name.
defaultValue_
Type: SystemInt32
Value to return if the setting was not found.

Return Value

Type: Int32
The setting if found, the defualt value if the setting is not found
See Also

Reference

INIFileWrangler Class
DigitalGiles.INIFile Namespace


INIFileWrangler.ReadOrInitAllSettingsInSect Method

INIFileWranglerReadOrInitAllSettingsInSect Method
Automated settings import method that accepts an ArrayList of INIFileSettings, attempts to find them in the INI file and writes the default values back if they're missing.

Namespace: DigitalGiles.INIFile
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void ReadOrInitAllSettingsInSect(
    string iniFileSection_,
    ArrayList settingsOfInterest_,
    bool caseSensitive_
)

Parameters

iniFileSection_
Type: SystemString
Section of interest.
settingsOfInterest_
Type: System.CollectionsArrayList
ArrayList of INIFileSettings to process.
caseSensitive_
Type: SystemBoolean
True if search for section name should be case sensititve.
See Also

Reference

INIFileWrangler Class
DigitalGiles.INIFile Namespace


INIFileWrangler.ReadOrInitBool Method

INIFileWranglerReadOrInitBool Method
Reads a boolean value from the INI file, if it is not found then the default value is returned and written to file.

Namespace: DigitalGiles.INIFile
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool ReadOrInitBool(
    string section_,
    string setting_,
    bool defaultValue_
)

Parameters

section_
Type: SystemString
Section name in which to search for the setting.
setting_
Type: SystemString
The setting name.
defaultValue_
Type: SystemBoolean
Value to return if the setting was not found.

Return Value

Type: Boolean
The setting if found, the defualt value if the setting is not found
See Also

Reference

INIFileWrangler Class
DigitalGiles.INIFile Namespace


INIFileWrangler.ReadOrInitInt Method

INIFileWranglerReadOrInitInt Method
Reads an integral value from the INI file, if it is not found then the default value is returned and written to file.

Namespace: DigitalGiles.INIFile
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int ReadOrInitInt(
    string section_,
    string setting_,
    int defaultValue_
)

Parameters

section_
Type: SystemString
Section name in which to search for the setting.
setting_
Type: SystemString
The setting name.
defaultValue_
Type: SystemInt32
Value to return if the setting was not found.

Return Value

Type: Int32
The setting if found, the defualt value if the setting is not found
See Also

Reference

INIFileWrangler Class
DigitalGiles.INIFile Namespace


INIFileWrangler.ReadOrInitSetting Method

INIFileWranglerReadOrInitSetting Method
Reads a string value from the INI file, if it is not found then the default value is returned and written to file.

Namespace: DigitalGiles.INIFile
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string ReadOrInitSetting(
    string section_,
    string setting_,
    string defaultValue_
)

Parameters

section_
Type: SystemString
Section name in which to search for the setting.
setting_
Type: SystemString
The setting name.
defaultValue_
Type: SystemString
Value to return if the setting was not found.

Return Value

Type: String
The setting if found, the defualt value if the setting is not found
See Also

Reference

INIFileWrangler Class
DigitalGiles.INIFile Namespace


INIFileWrangler.ReadSetting Method

INIFileWranglerReadSetting Method
Overload List
 | Name | Description
Public method | ReadSetting(String, String, Boolean) | Reads a string value from the INI file.
Public method | ReadSetting(String, String, String) | Reads a string value from the INI file.
Top
See Also

Reference

INIFileWrangler Class
DigitalGiles.INIFile Namespace


INIFileWrangler.ReadSetting Method (String, String, Boolean)

INIFileWranglerReadSetting Method (String, String, Boolean)
Reads a string value from the INI file.

Namespace: DigitalGiles.INIFile
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string ReadSetting(
    string section_,
    string setting_,
    bool caseSensitive_
)

Parameters

section_
Type: SystemString
Section name in which to search for the setting.
setting_
Type: SystemString
The setting name.
caseSensitive_
Type: SystemBoolean
True if you want a case sensitive search.

Return Value

Type: String
The setting if found, null if the setting is not found
See Also

Reference

INIFileWrangler Class
ReadSetting Overload
DigitalGiles.INIFile Namespace


INIFileWrangler.ReadSetting Method (String, String, String)

INIFileWranglerReadSetting Method (String, String, String)
Reads a string value from the INI file.

Namespace: DigitalGiles.INIFile
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string ReadSetting(
    string section_,
    string setting_,
    string defaultValue_
)

Parameters

section_
Type: SystemString
Section name in which to search for the setting.
setting_
Type: SystemString
The setting name.
defaultValue_
Type: SystemString
Value to return if the setting was not found.

Return Value

Type: String
The setting if found, the defualt value if the setting is not found
See Also

Reference

INIFileWrangler Class
ReadSetting Overload
DigitalGiles.INIFile Namespace


INIFileWrangler.SaveSetting Method

INIFileWranglerSaveSetting Method
Stores a value to the INI file.

Namespace: DigitalGiles.INIFile
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void SaveSetting(
    string iniFileSection_,
    string newSetting_,
    string newValue_,
    bool caseSensitive_
)

Parameters

iniFileSection_
Type: SystemString
Section name in which to store the setting.
newSetting_
Type: SystemString
The setting name.
newValue_
Type: SystemString
The new value for the setting.
caseSensitive_
Type: SystemBoolean
True if searches for section and setting names should be case sensititve.
See Also

Reference

INIFileWrangler Class
DigitalGiles.INIFile Namespace


INIFileWrangler Properties

INIFileWrangler Properties

The INIFileWrangler type exposes the following members.

Properties
 | Name | Description
Public property | IsReadOnly | Gets the read only flag.
Top
See Also

Reference

INIFileWrangler Class
DigitalGiles.INIFile Namespace


INIFileWrangler.IsReadOnly Property

INIFileWranglerIsReadOnly Property
Gets the read only flag.

Namespace: DigitalGiles.INIFile
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool IsReadOnly { get; }

Property Value

Type: Boolean
See Also

Reference

INIFileWrangler Class
DigitalGiles.INIFile Namespace


DigitalGiles.Logging Namespace

DigitalGiles.Logging Namespace
This namespace has a logging class for BNCS.
Classes
 | Class | Description
Public class | LogFileOpenedEventArgs | Event arguments associated with the Speaking event.
Public class | Logger | Giles' logging class
Public class | LoggingListBox | Giles' LoggingListBox control, extends the function of the standard Listbox for his nefarious purposes.
Public class | LogItem | An item posted to the application log
Public class | LogWriter | Class encapsulating a log file writer.
Delegates
 | Delegate | Description
Public delegate | LoggerlogEventDelegate | Log Event Delegate
Enumerations
 | Enumeration | Description
Public enumeration | LogFileNameFormat | Enumeration of Log File naming and automatic-rotation formats.


LogFileNameFormat Enumeration

LogFileNameFormat Enumeration
Enumeration of Log File naming and automatic-rotation formats.

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public enum LogFileNameFormat
Members
Member name | Value | Description
None | 0 | Disables log file writing.
Daily_MonthlyRotation | 1 | One log file is created per day, filename format is DEV_###.dd. Logs are automatically rotated every month.
Daily_NoRotation | 2 | One log file is created per day, filename format is DEV_###.yyyyMMdd. Logs are never automatically rotated.
Hourly_DailyRotation | 3 | One log file is created per hour, filename format is DEV_###.HH. Logs are automatically rotated every day.
Hourly_NoRotation | 4 | One log file is created per hour, filename format is DEV_###_yyyyMMdd.HH. Logs are never automatically rotated.
See Also

Reference

DigitalGiles.Logging Namespace


LogFileOpenedEventArgs Class

LogFileOpenedEventArgs Class
Event arguments associated with the Speaking event.
Inheritance Hierarchy
SystemObject
SystemEventArgs
DigitalGiles.LoggingLogFileOpenedEventArgs

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class LogFileOpenedEventArgs : EventArgs

The LogFileOpenedEventArgs type exposes the following members.

Constructors
 | Name | Description
Public method | LogFileOpenedEventArgs(String) | Creates a new LogFileOpenedEventArgs eith a status of OK.
Public method | LogFileOpenedEventArgs(String, String) | Creates a new LogFileOpenedEventArgs with a status of FAIL.
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
Properties
 | Name | Description
Public property | Error | The error message encountered when trying to open the file.
Public property | FileOpened | The filename (and path) that has been opened.
Public property | Success | Indication of whether the file open operation was successful, or not.
Top
See Also

Reference

DigitalGiles.Logging Namespace


LogFileOpenedEventArgs Constructor

LogFileOpenedEventArgs Constructor
Overload List
 | Name | Description
Public method | LogFileOpenedEventArgs(String) | Creates a new LogFileOpenedEventArgs eith a status of OK.
Public method | LogFileOpenedEventArgs(String, String) | Creates a new LogFileOpenedEventArgs with a status of FAIL.
Top
See Also

Reference

LogFileOpenedEventArgs Class
DigitalGiles.Logging Namespace


LogFileOpenedEventArgs Constructor (String)

LogFileOpenedEventArgs Constructor (String)
Creates a new LogFileOpenedEventArgs eith a status of OK.

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public LogFileOpenedEventArgs(
    string File
)

Parameters

File
Type: SystemString
The name and path of the file that has been opened.
See Also

Reference

LogFileOpenedEventArgs Class
LogFileOpenedEventArgs Overload
DigitalGiles.Logging Namespace


LogFileOpenedEventArgs Constructor (String, String)

LogFileOpenedEventArgs Constructor (String, String)
Creates a new LogFileOpenedEventArgs with a status of FAIL.

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public LogFileOpenedEventArgs(
    string File,
    string ErrorMessage
)

Parameters

File
Type: SystemString
The name and path of the file that has been opened.
ErrorMessage
Type: SystemString
The error message encountered when trying to open the file.
See Also

Reference

LogFileOpenedEventArgs Class
LogFileOpenedEventArgs Overload
DigitalGiles.Logging Namespace


LogFileOpenedEventArgs Methods

LogFileOpenedEventArgs Methods

The LogFileOpenedEventArgs type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Top
See Also

Reference

LogFileOpenedEventArgs Class
DigitalGiles.Logging Namespace


LogFileOpenedEventArgs Properties

LogFileOpenedEventArgs Properties

The LogFileOpenedEventArgs type exposes the following members.

Properties
 | Name | Description
Public property | Error | The error message encountered when trying to open the file.
Public property | FileOpened | The filename (and path) that has been opened.
Public property | Success | Indication of whether the file open operation was successful, or not.
Top
See Also

Reference

LogFileOpenedEventArgs Class
DigitalGiles.Logging Namespace


LogFileOpenedEventArgs.Error Property

LogFileOpenedEventArgsError Property
The error message encountered when trying to open the file.

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Error { get; }

Property Value

Type: String
See Also

Reference

LogFileOpenedEventArgs Class
DigitalGiles.Logging Namespace


LogFileOpenedEventArgs.FileOpened Property

LogFileOpenedEventArgsFileOpened Property
The filename (and path) that has been opened.

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string FileOpened { get; }

Property Value

Type: String
See Also

Reference

LogFileOpenedEventArgs Class
DigitalGiles.Logging Namespace


LogFileOpenedEventArgs.Success Property

LogFileOpenedEventArgsSuccess Property
Indication of whether the file open operation was successful, or not.

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool Success { get; }

Property Value

Type: Boolean
See Also

Reference

LogFileOpenedEventArgs Class
DigitalGiles.Logging Namespace


Logger Class

Logger Class
Giles' logging class
Inheritance Hierarchy
SystemObject
DigitalGiles.LoggingLogger

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static class Logger

The Logger type exposes the following members.

Methods
Name | Description
LogMessage(String, String, Int32) | Appends a line to the application log
LogMessage(Int32, String, String, Int32) | Appends a line to the application log
LogMessage(String, String, Int32, Int32) | Appends a line to the application log
LogMessage(Int32, String, String, Int32, Int32) | Appends a line to the application log
Top
Events
Name | Description
LogEventHappened | Event triggered whenever a message is posted to the application log
Top
See Also

Reference

DigitalGiles.Logging Namespace


Logger Methods

Logger Methods
Methods
Name | Description
LogMessage(String, String, Int32) | Appends a line to the application log
LogMessage(Int32, String, String, Int32) | Appends a line to the application log
LogMessage(String, String, Int32, Int32) | Appends a line to the application log
LogMessage(Int32, String, String, Int32, Int32) | Appends a line to the application log
Top
See Also

Reference

Logger Class
DigitalGiles.Logging Namespace


Logger.LogMessage Method

LoggerLogMessage Method
Overload List
Name | Description
LogMessage(String, String, Int32) | Appends a line to the application log
LogMessage(Int32, String, String, Int32) | Appends a line to the application log
LogMessage(String, String, Int32, Int32) | Appends a line to the application log
LogMessage(Int32, String, String, Int32, Int32) | Appends a line to the application log
Top
See Also

Reference

Logger Class
DigitalGiles.Logging Namespace


Logger.LogMessage Method (String, String, Int32)

LoggerLogMessage Method (String, String, Int32)
Appends a line to the application log

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static void LogMessage(
    string section,
    string message,
    int logLevel
)

Parameters

section
Type: SystemString
The message's subsection.
message
Type: SystemString
The message to log.
logLevel
Type: SystemInt32
The logging level that the debug window must be set to in order to print this message.
See Also

Reference

Logger Class
LogMessage Overload
DigitalGiles.Logging Namespace


Logger.LogMessage Method (Int32, String, String, Int32)

LoggerLogMessage Method (Int32, String, String, Int32)
Appends a line to the application log

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static void LogMessage(
    int moduleID,
    string section,
    string message,
    int logLevel
)

Parameters

moduleID
Type: SystemInt32
The ID of the module that originated this message (0 if message was not from a module).
section
Type: SystemString
The message's subsection.
message
Type: SystemString
The message to log.
logLevel
Type: SystemInt32
The logging level that the debug window must be set to in order to print this message.
See Also

Reference

Logger Class
LogMessage Overload
DigitalGiles.Logging Namespace


Logger.LogMessage Method (String, String, Int32, Int32)

LoggerLogMessage Method (String, String, Int32, Int32)
Appends a line to the application log

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static void LogMessage(
    string section,
    string message,
    int logLevel,
    int colour
)

Parameters

section
Type: SystemString
The message's subsection.
message
Type: SystemString
The message to log.
logLevel
Type: SystemInt32
The logging level that the debug window must be set to in order to print this message.
colour
Type: SystemInt32
The colour of the text in the debug window.
See Also

Reference

Logger Class
LogMessage Overload
DigitalGiles.Logging Namespace


Logger.LogMessage Method (Int32, String, String, Int32, Int32)

LoggerLogMessage Method (Int32, String, String, Int32, Int32)
Appends a line to the application log

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static void LogMessage(
    int moduleID,
    string section,
    string message,
    int logLevel,
    int colour
)

Parameters

moduleID
Type: SystemInt32
The ID of the module that originated this message (0 if message was not from a module).
section
Type: SystemString
The message's subsection.
message
Type: SystemString
The message to log.
logLevel
Type: SystemInt32
The logging level that the debug window must be set to in order to print this message.
colour
Type: SystemInt32
The colour of the text in the debug window.
See Also

Reference

Logger Class
LogMessage Overload
DigitalGiles.Logging Namespace


Logger Events

Logger Events

The Logger type exposes the following members.

Events
Name | Description
LogEventHappened | Event triggered whenever a message is posted to the application log
Top
See Also

Reference

Logger Class
DigitalGiles.Logging Namespace


Logger.LogEventHappened Event

LoggerLogEventHappened Event
Event triggered whenever a message is posted to the application log

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public static event LoggerlogEventDelegate LogEventHappened

Value

Type: DigitalGiles.LoggingLoggerlogEventDelegate
See Also

Reference

Logger Class
DigitalGiles.Logging Namespace


Logger.logEventDelegate Delegate

LoggerlogEventDelegate Delegate
Log Event Delegate

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void logEventDelegate(
    LogItem loggedMessage
)

Parameters

loggedMessage
Type: DigitalGiles.LoggingLogItem
The LogItem containing the parameters for this LogEvent
See Also

Reference

DigitalGiles.Logging Namespace


LoggingListBox Class

LoggingListBox Class
Giles' LoggingListBox control, extends the function of the standard Listbox for his nefarious purposes.
Inheritance Hierarchy
SystemObject
SystemMarshalByRefObject
System.ComponentModelComponent
System.Windows.FormsControl
System.Windows.FormsListControl
System.Windows.FormsListBox
DigitalGiles.LoggingLoggingListBox

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class LoggingListBox : ListBox

The LoggingListBox type exposes the following members.

Constructors
 | Name | Description
Public method | LoggingListBox | Instantiates a new LoggingListBox control
Top
Methods
 | Name | Description
Public method | AddMessage | Appends a message to the log queue
Public method | BeginInvoke(Delegate) | Executes the specified delegate asynchronously on the thread that the control's underlying handle was created on. (Inherited from Control.)
Public method | BeginInvoke(Delegate, Object) | Executes the specified delegate asynchronously with the specified arguments, on the thread that the control's underlying handle was created on. (Inherited from Control.)
Public method | BeginUpdate | Maintains performance while items are added to the ListBox one at a time by preventing the control from drawing until the EndUpdate method is called. (Inherited from ListBox.)
Public method | BringToFront | Brings the control to the front of the z-order. (Inherited from Control.)
Public method | ClearSelected | Unselects all items in the ListBox. (Inherited from ListBox.)
Public method | Contains | Retrieves a value indicating whether the specified control is a child of the control. (Inherited from Control.)
Public method | CreateControl | Forces the creation of the visible control, including the creation of the handle and any visible child controls. (Inherited from Control.)
Public method | CreateGraphics | Creates the Graphics for the control. (Inherited from Control.)
Public method | CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.)
Public method | Dispose | Releases all resources used by the Component. (Inherited from Component.)
Public method | DoDragDrop | Begins a drag-and-drop operation. (Inherited from Control.)
Public method | DrawToBitmap | Supports rendering to the specified bitmap. (Inherited from Control.)
Public method | EndInvoke | Retrieves the return value of the asynchronous operation represented by the IAsyncResult passed. (Inherited from Control.)
Public method | EndUpdate | Resumes painting the ListBox control after painting is suspended by the BeginUpdate method. (Inherited from ListBox.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | FindForm | Retrieves the form that the control is on. (Inherited from Control.)
Public method | FindString(String) | Finds the first item in the ListBox that starts with the specified string. (Inherited from ListBox.)
Public method | FindString(String, Int32) | Finds the first item in the ListBox that starts with the specified string. The search starts at a specific starting index. (Inherited from ListBox.)
Public method | FindStringExact(String) | Finds the first item in the ListBox that exactly matches the specified string. (Inherited from ListBox.)
Public method | FindStringExact(String, Int32) | Finds the first item in the ListBox that exactly matches the specified string. The search starts at a specific starting index. (Inherited from ListBox.)
Public method | Focus | Sets input focus to the control. (Inherited from Control.)
Public method | GetChildAtPoint(Point) | Retrieves the child control that is located at the specified coordinates. (Inherited from Control.)
Public method | GetChildAtPoint(Point, GetChildAtPointSkip) | Retrieves the child control that is located at the specified coordinates, specifying whether to ignore child controls of a certain type. (Inherited from Control.)
Public method | GetContainerControl | Returns the next ContainerControl up the control's chain of parent controls. (Inherited from Control.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetItemHeight | Returns the height of an item in the ListBox. (Inherited from ListBox.)
Public method | GetItemRectangle | Returns the bounding rectangle for an item in the ListBox. (Inherited from ListBox.)
Public method | GetItemText | Returns the text representation of the specified item. (Inherited from ListControl.)
Public method | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Public method | GetNextControl | Retrieves the next control forward or back in the tab order of child controls. (Inherited from Control.)
Public method | GetPreferredSize | Retrieves the size of a rectangular area into which a control can be fitted. (Inherited from Control.)
Public method | GetSelected | Returns a value indicating whether the specified item is selected. (Inherited from ListBox.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Hide | Conceals the control from the user. (Inherited from Control.)
Public method | IndexFromPoint(Point) | Returns the zero-based index of the item at the specified coordinates. (Inherited from ListBox.)
Public method | IndexFromPoint(Int32, Int32) | Returns the zero-based index of the item at the specified coordinates. (Inherited from ListBox.)
Public method | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Public method | Invalidate | Invalidates the entire surface of the control and causes the control to be redrawn. (Inherited from Control.)
Public method | Invalidate(Region) | Invalidates the specified region of the control (adds it to the control's update region, which is the area that will be repainted at the next paint operation), and causes a paint message to be sent to the control. (Inherited from Control.)
Public method | Invalidate(Boolean) | Invalidates a specific region of the control and causes a paint message to be sent to the control. Optionally, invalidates the child controls assigned to the control. (Inherited from Control.)
Public method | Invalidate(Rectangle) | Invalidates the specified region of the control (adds it to the control's update region, which is the area that will be repainted at the next paint operation), and causes a paint message to be sent to the control. (Inherited from Control.)
Public method | Invalidate(Region, Boolean) | Invalidates the specified region of the control (adds it to the control's update region, which is the area that will be repainted at the next paint operation), and causes a paint message to be sent to the control. Optionally, invalidates the child controls assigned to the control. (Inherited from Control.)
Public method | Invalidate(Rectangle, Boolean) | Invalidates the specified region of the control (adds it to the control's update region, which is the area that will be repainted at the next paint operation), and causes a paint message to be sent to the control. Optionally, invalidates the child controls assigned to the control. (Inherited from Control.)
Public method | Invoke(Delegate) | Executes the specified delegate on the thread that owns the control's underlying window handle. (Inherited from Control.)
Public method | Invoke(Delegate, Object) | Executes the specified delegate, on the thread that owns the control's underlying window handle, with the specified list of arguments. (Inherited from Control.)
Public method | PerformLayout | Forces the control to apply layout logic to all its child controls. (Inherited from Control.)
Public method | PerformLayout(Control, String) | Forces the control to apply layout logic to all its child controls. (Inherited from Control.)
Public method | PointToClient | Computes the location of the specified screen point into client coordinates. (Inherited from Control.)
Public method | PointToScreen | Computes the location of the specified client point into screen coordinates. (Inherited from Control.)
Public method | PreProcessControlMessage | Preprocesses keyboard or input messages within the message loop before they are dispatched. (Inherited from Control.)
Public method | PreProcessMessage | Preprocesses keyboard or input messages within the message loop before they are dispatched. (Inherited from Control.)
Public method | RectangleToClient | Computes the size and location of the specified screen rectangle in client coordinates. (Inherited from Control.)
Public method | RectangleToScreen | Computes the size and location of the specified client rectangle in screen coordinates. (Inherited from Control.)
Public method | Refresh | Forces the control to invalidate its client area and immediately redraw itself and any child controls. (Inherited from ListBox.)
Public method | ResetBackColor | (Inherited from ListBox.)
Public method | ResetBindings | Causes a control bound to the BindingSource to reread all the items in the list and refresh their displayed values. (Inherited from Control.)
Public method | ResetCursor | Resets the Cursor property to its default value. (Inherited from Control.)
Public method | ResetFont | Resets the Font property to its default value. (Inherited from Control.)
Public method | ResetForeColor | (Inherited from ListBox.)
Public method | ResetImeMode | Resets the ImeMode property to its default value. (Inherited from Control.)
Public method | ResetRightToLeft | Resets the RightToLeft property to its default value. (Inherited from Control.)
Public method | ResetText | Resets the Text property to its default value. (Inherited from Control.)
Public method | ResumeLayout | Resumes usual layout logic. (Inherited from Control.)
Public method | ResumeLayout(Boolean) | Resumes usual layout logic, optionally forcing an immediate layout of pending layout requests. (Inherited from Control.)
Public method | Scale(Single) | Obsolete. Scales the control and any child controls. (Inherited from Control.)
Public method | Scale(SizeF) | Scales the control and all child controls by the specified scaling factor. (Inherited from Control.)
Public method | Scale(Single, Single) | Obsolete. Scales the entire control and any child controls. (Inherited from Control.)
Public method | Select | Activates the control. (Inherited from Control.)
Public method | SelectNextControl | Activates the next control. (Inherited from Control.)
Public method | SendToBack | Sends the control to the back of the z-order. (Inherited from Control.)
Public method | SetBounds(Int32, Int32, Int32, Int32) | Sets the bounds of the control to the specified location and size. (Inherited from Control.)
Public method | SetBounds(Int32, Int32, Int32, Int32, BoundsSpecified) | Sets the specified bounds of the control to the specified location and size. (Inherited from Control.)
Public method | SetFilter | Configures the filtering function to ONLY display messages from this particular module ID. Set to 0 to disable filtering function.
Public method | SetSelected | Selects or clears the selection for the specified item in a ListBox. (Inherited from ListBox.)
Public method | Show | Displays the control to the user. (Inherited from Control.)
Public method | Start | Starts the timer that periodically updates the log window
Public method | Stop | Stops the timer that periodically updates the log window
Public method | SuspendLayout | Temporarily suspends the layout logic for the control. (Inherited from Control.)
Public method | ToString | Returns a string representation of the ListBox. (Inherited from ListBox.)
Public method | Update | Causes the control to redraw the invalidated regions within its client area. (Inherited from Control.)
Top
Properties
 | Name | Description
Public property | AccessibilityObject | Gets the AccessibleObject assigned to the control. (Inherited from Control.)
Public property | AccessibleDefaultActionDescription | Gets or sets the default action description of the control for use by accessibility client applications. (Inherited from Control.)
Public property | AccessibleDescription | Gets or sets the description of the control used by accessibility client applications. (Inherited from Control.)
Public property | AccessibleName | Gets or sets the name of the control used by accessibility client applications. (Inherited from Control.)
Public property | AccessibleRole | Gets or sets the accessible role of the control (Inherited from Control.)
Public property | AllowDrop | Gets or sets a value indicating whether the control can accept data that the user drags onto it. (Inherited from Control.)
Public property | Anchor | Gets or sets the edges of the container to which a control is bound and determines how a control is resized with its parent. (Inherited from Control.)
Public property | AutoScrollOffset | Gets or sets where this control is scrolled to in ScrollControlIntoView(Control). (Inherited from Control.)
Public property | AutoSize | This property is not relevant for this class. (Inherited from Control.)
Public property | BackColor | (Inherited from ListBox.)
Public property | BackgroundImage | This property is not relevant to this class. (Inherited from ListBox.)
Public property | BackgroundImageLayout | Gets or sets the background image layout for a ListBox as defined in the ImageLayout enumeration. (Inherited from ListBox.)
Public property | BindingContext | Gets or sets the BindingContext for the control. (Inherited from Control.)
Public property | BorderStyle | Gets or sets the type of border that is drawn around the ListBox. (Inherited from ListBox.)
Public property | Bottom | Gets the distance, in pixels, between the bottom edge of the control and the top edge of its container's client area. (Inherited from Control.)
Public property | Bounds | Gets or sets the size and location of the control including its nonclient elements, in pixels, relative to the parent control. (Inherited from Control.)
Public property | CanFocus | Gets a value indicating whether the control can receive focus. (Inherited from Control.)
Public property | CanSelect | Gets a value indicating whether the control can be selected. (Inherited from Control.)
Public property | Capture | Gets or sets a value indicating whether the control has captured the mouse. (Inherited from Control.)
Public property | CausesValidation | Gets or sets a value indicating whether the control causes validation to be performed on any controls that require validation when it receives focus. (Inherited from Control.)
Public property | ClientRectangle | Gets the rectangle that represents the client area of the control. (Inherited from Control.)
Public property | ClientSize | Gets or sets the height and width of the client area of the control. (Inherited from Control.)
Public property | ColumnWidth | Gets or sets the width of columns in a multicolumn ListBox. (Inherited from ListBox.)
Public property | CompanyName | Gets the name of the company or creator of the application containing the control. (Inherited from Control.)
Public property | Container | Gets the IContainer that contains the Component. (Inherited from Component.)
Public property | ContainsFocus | Gets a value indicating whether the control, or one of its child controls, currently has the input focus. (Inherited from Control.)
Public property | ContextMenu | Gets or sets the shortcut menu associated with the control. (Inherited from Control.)
Public property | ContextMenuStrip | Gets or sets the ContextMenuStrip associated with this control. (Inherited from Control.)
Public property | Controls | Gets the collection of controls contained within the control. (Inherited from Control.)
Public property | Created | Gets a value indicating whether the control has been created. (Inherited from Control.)
Public property | Cursor | Gets or sets the cursor that is displayed when the mouse pointer is over the control. (Inherited from Control.)
Public property | CustomTabOffsets | Gets the width of the tabs between the items in the ListBox. (Inherited from ListBox.)
Public property | DataBindings | Gets the data bindings for the control. (Inherited from Control.)
Public property | DataSource | Gets or sets the data source for this ListControl. (Inherited from ListControl.)
Public property | DisplayMember | Gets or sets the property to display for this ListControl. (Inherited from ListControl.)
Public property | DisplayRectangle | Gets the rectangle that represents the display area of the control. (Inherited from Control.)
Public property | Disposing | Gets a value indicating whether the base Control class is in the process of disposing. (Inherited from Control.)
Public property | Dock | Gets or sets which control borders are docked to its parent control and determines how a control is resized with its parent. (Inherited from Control.)
Public property | DrawMode | Gets or sets the drawing mode for the control. (Inherited from ListBox.)
Public property | Enabled | Gets or sets a value indicating whether the control can respond to user interaction. (Inherited from Control.)
Public property | Focused | Gets a value indicating whether the control has input focus. (Inherited from Control.)
Public property | Font | (Inherited from ListBox.)
Public property | ForeColor | (Inherited from ListBox.)
Public property | FormatInfo | Gets or sets the IFormatProvider that provides custom formatting behavior. (Inherited from ListControl.)
Public property | FormatString | Gets or sets the format-specifier characters that indicate how a value is to be displayed. (Inherited from ListControl.)
Public property | FormattingEnabled | Gets or sets a value indicating whether formatting is applied to the DisplayMember property of the ListControl. (Inherited from ListControl.)
Public property | Handle | Gets the window handle that the control is bound to. (Inherited from Control.)
Public property | HasChildren | Gets a value indicating whether the control contains one or more child controls. (Inherited from Control.)
Public property | Height | Gets or sets the height of the control. (Inherited from Control.)
Public property | HorizontalExtent | Gets or sets the width by which the horizontal scroll bar of a ListBox can scroll. (Inherited from ListBox.)
Public property | HorizontalScrollbar | Gets or sets a value indicating whether a horizontal scroll bar is displayed in the control. (Inherited from ListBox.)
Public property | ImeMode | Gets or sets the Input Method Editor (IME) mode of the control. (Inherited from Control.)
Public property | IntegralHeight | Gets or sets a value indicating whether the control should resize to avoid showing partial items. (Inherited from ListBox.)
Public property | InvokeRequired | Gets a value indicating whether the caller must call an invoke method when making method calls to the control because the caller is on a different thread than the one the control was created on. (Inherited from Control.)
Public property | IsAccessible | Gets or sets a value indicating whether the control is visible to accessibility applications. (Inherited from Control.)
Public property | IsDisposed | Gets a value indicating whether the control has been disposed of. (Inherited from Control.)
Public property | IsHandleCreated | Gets a value indicating whether the control has a handle associated with it. (Inherited from Control.)
Public property | IsMirrored | Gets a value indicating whether the control is mirrored. (Inherited from Control.)
Public property | ItemHeight | Gets or sets the height of an item in the ListBox. (Inherited from ListBox.)
Public property | Items | Gets the items of the ListBox. (Inherited from ListBox.)
Public property | LayoutEngine | Gets a cached instance of the control's layout engine. (Inherited from Control.)
Public property | Left | Gets or sets the distance, in pixels, between the left edge of the control and the left edge of its container's client area. (Inherited from Control.)
Public property | Location | Gets or sets the coordinates of the upper-left corner of the control relative to the upper-left corner of its container. (Inherited from Control.)
Public property | LoggingLevel | Message filtering level. Messages with a priority below this will not be displayed.
Public property | Margin | Gets or sets the space between controls. (Inherited from Control.)
Public property | MaximumItems | The maximum number of items in the listbox. Excess items are removed from the top of the listbox.
Public property | MaximumSize | Gets or sets the size that is the upper limit that GetPreferredSize(Size) can specify. (Inherited from Control.)
Public property | MinimumSize | Gets or sets the size that is the lower limit that GetPreferredSize(Size) can specify. (Inherited from Control.)
Public property | MultiColumn | Gets or sets a value indicating whether the ListBox supports multiple columns. (Inherited from ListBox.)
Public property | Name | Gets or sets the name of the control. (Inherited from Control.)
Public property | Padding | This property is not relevant to this class. (Inherited from ListBox.)
Public property | Parent | Gets or sets the parent container of the control. (Inherited from Control.)
Public property | PreferredHeight | Gets the combined height of all items in the ListBox. (Inherited from ListBox.)
Public property | PreferredSize | Gets the size of a rectangular area into which the control can fit. (Inherited from Control.)
Public property | ProductName | Gets the product name of the assembly containing the control. (Inherited from Control.)
Public property | ProductVersion | Gets the version of the assembly containing the control. (Inherited from Control.)
Public property | RecreatingHandle | Gets a value indicating whether the control is currently re-creating its handle. (Inherited from Control.)
Public property | Region | Gets or sets the window region associated with the control. (Inherited from Control.)
Public property | Right | Gets the distance, in pixels, between the right edge of the control and the left edge of its container's client area. (Inherited from Control.)
Public property | RightToLeft | Gets or sets a value indicating whether text displayed by the control is displayed from right to left. (Inherited from ListBox.)
Public property | ScrollAlwaysVisible | Gets or sets a value indicating whether the vertical scroll bar is shown at all times. (Inherited from ListBox.)
Public property | SelectedIndex | Gets or sets the zero-based index of the currently selected item in a ListBox. (Inherited from ListBox.)
Public property | SelectedIndices | Gets a collection that contains the zero-based indexes of all currently selected items in the ListBox. (Inherited from ListBox.)
Public property | SelectedItem | Gets or sets the currently selected item in the ListBox. (Inherited from ListBox.)
Public property | SelectedItems | Gets a collection containing the currently selected items in the ListBox. (Inherited from ListBox.)
Public property | SelectedValue | Gets or sets the value of the member property specified by the ValueMember property. (Inherited from ListControl.)
Public property | SelectionMode | Gets or sets the method in which items are selected in the ListBox. (Inherited from ListBox.)
Public property | Site | Gets or sets the site of the control. (Inherited from Control.)
Public property | Size | Gets or sets the height and width of the control. (Inherited from Control.)
Public property | Sorted | Gets or sets a value indicating whether the items in the ListBox are sorted alphabetically. (Inherited from ListBox.)
Public property | TabIndex | Gets or sets the tab order of the control within its container. (Inherited from Control.)
Public property | TabStop | Gets or sets a value indicating whether the user can give the focus to this control using the TAB key. (Inherited from Control.)
Public property | Tag | Gets or sets the object that contains data about the control. (Inherited from Control.)
Public property | Text | Gets or searches for the text of the currently selected item in the ListBox. (Inherited from ListBox.)
Public property | Top | Gets or sets the distance, in pixels, between the top edge of the control and the top edge of its container's client area. (Inherited from Control.)
Public property | TopIndex | Gets or sets the index of the first visible item in the ListBox. (Inherited from ListBox.)
Public property | TopLevelControl | Gets the parent control that is not parented by another Windows Forms control. Typically, this is the outermost Form that the control is contained in. (Inherited from Control.)
Public property | UseCustomTabOffsets | Gets or sets a value indicating whether the ListBox recognizes and expands tab characters when it draws its strings by using the CustomTabOffsets integer array. (Inherited from ListBox.)
Public property | UseTabStops | Gets or sets a value indicating whether the ListBox can recognize and expand tab characters when drawing its strings. (Inherited from ListBox.)
Public property | UseWaitCursor | Gets or sets a value indicating whether to use the wait cursor for the current control and all child controls. (Inherited from Control.)
Public property | ValueMember | Gets or sets the property to use as the actual value for the items in the ListControl. (Inherited from ListControl.)
Public property | Visible | Gets or sets a value indicating whether the control and all its child controls are displayed. (Inherited from Control.)
Public property | Width | Gets or sets the width of the control. (Inherited from Control.)
Public property | WindowTarget | This property is not relevant for this class. (Inherited from Control.)
Top
Events
 | Name | Description
Public event | AutoSizeChanged | This event is not relevant for this class. (Inherited from Control.)
Public event | BackColorChanged | Occurs when the value of the BackColor property changes. (Inherited from Control.)
Public event | BackgroundImageChanged | Occurs when the BackgroundImage property of the label changes. (Inherited from ListBox.)
Public event | BackgroundImageLayoutChanged | Occurs when the BackgroundImageLayout property changes. (Inherited from ListBox.)
Public event | BindingContextChanged | Occurs when the value of the BindingContext property changes. (Inherited from Control.)
Public event | CausesValidationChanged | Occurs when the value of the CausesValidation property changes. (Inherited from Control.)
Public event | ChangeUICues | Occurs when the focus or keyboard user interface (UI) cues change. (Inherited from Control.)
Public event | Click | Occurs when the ListBox control is clicked. (Inherited from ListBox.)
Public event | ClientSizeChanged | Occurs when the value of the ClientSize property changes. (Inherited from Control.)
Public event | ContextMenuChanged | Occurs when the value of the ContextMenu property changes. (Inherited from Control.)
Public event | ContextMenuStripChanged | Occurs when the value of the ContextMenuStrip property changes. (Inherited from Control.)
Public event | ControlAdded | Occurs when a new control is added to the ControlControlCollection. (Inherited from Control.)
Public event | ControlRemoved | Occurs when a control is removed from the ControlControlCollection. (Inherited from Control.)
Public event | CursorChanged | Occurs when the value of the Cursor property changes. (Inherited from Control.)
Public event | DataSourceChanged | Occurs when the DataSource changes. (Inherited from ListControl.)
Public event | DisplayMemberChanged | Occurs when the DisplayMember property changes. (Inherited from ListControl.)
Public event | Disposed | Occurs when the component is disposed by a call to the Dispose method. (Inherited from Component.)
Public event | DockChanged | Occurs when the value of the Dock property changes. (Inherited from Control.)
Public event | DoubleClick | Occurs when the control is double-clicked. (Inherited from Control.)
Public event | DragDrop | Occurs when a drag-and-drop operation is completed. (Inherited from Control.)
Public event | DragEnter | Occurs when an object is dragged into the control's bounds. (Inherited from Control.)
Public event | DragLeave | Occurs when an object is dragged out of the control's bounds. (Inherited from Control.)
Public event | DragOver | Occurs when an object is dragged over the control's bounds. (Inherited from Control.)
Public event | DrawItem | Occurs when a visual aspect of an owner-drawn ListBox changes. (Inherited from ListBox.)
Public event | EnabledChanged | Occurs when the Enabled property value has changed. (Inherited from Control.)
Public event | Enter | Occurs when the control is entered. (Inherited from Control.)
Public event | FontChanged | Occurs when the Font property value changes. (Inherited from Control.)
Public event | ForeColorChanged | Occurs when the ForeColor property value changes. (Inherited from Control.)
Public event | Format | Occurs when the control is bound to a data value. (Inherited from ListControl.)
Public event | FormatInfoChanged | Occurs when the value of the FormatInfo property changes. (Inherited from ListControl.)
Public event | FormatStringChanged | Occurs when value of the FormatString property changes (Inherited from ListControl.)
Public event | FormattingEnabledChanged | Occurs when the value of the FormattingEnabled property changes. (Inherited from ListControl.)
Public event | GiveFeedback | Occurs during a drag operation. (Inherited from Control.)
Public event | GotFocus | Occurs when the control receives focus. (Inherited from Control.)
Public event | HandleCreated | Occurs when a handle is created for the control. (Inherited from Control.)
Public event | HandleDestroyed | Occurs when the control's handle is in the process of being destroyed. (Inherited from Control.)
Public event | HelpRequested | Occurs when the user requests help for a control. (Inherited from Control.)
Public event | ImeModeChanged | Occurs when the ImeMode property has changed. (Inherited from Control.)
Public event | Invalidated | Occurs when a control's display requires redrawing. (Inherited from Control.)
Public event | KeyDown | Occurs when a key is pressed while the control has focus. (Inherited from Control.)
Public event | KeyPress | Occurs when a key is pressed while the control has focus. (Inherited from Control.)
Public event | KeyUp | Occurs when a key is released while the control has focus. (Inherited from Control.)
Public event | Layout | Occurs when a control should reposition its child controls. (Inherited from Control.)
Public event | Leave | Occurs when the input focus leaves the control. (Inherited from Control.)
Public event | LocationChanged | Occurs when the Location property value has changed. (Inherited from Control.)
Public event | LostFocus | Occurs when the control loses focus. (Inherited from Control.)
Public event | MarginChanged | Occurs when the control's margin changes. (Inherited from Control.)
Public event | MeasureItem | Occurs when an owner-drawn ListBox is created and the sizes of the list items are determined. (Inherited from ListBox.)
Public event | MouseCaptureChanged | Occurs when the control loses mouse capture. (Inherited from Control.)
Public event | MouseClick | Occurs when the user clicks the ListBox control with the mouse pointer. (Inherited from ListBox.)
Public event | MouseDoubleClick | Occurs when the control is double clicked by the mouse. (Inherited from Control.)
Public event | MouseDown | Occurs when the mouse pointer is over the control and a mouse button is pressed. (Inherited from Control.)
Public event | MouseEnter | Occurs when the mouse pointer enters the control. (Inherited from Control.)
Public event | MouseHover | Occurs when the mouse pointer rests on the control. (Inherited from Control.)
Public event | MouseLeave | Occurs when the mouse pointer leaves the control. (Inherited from Control.)
Public event | MouseMove | Occurs when the mouse pointer is moved over the control. (Inherited from Control.)
Public event | MouseUp | Occurs when the mouse pointer is over the control and a mouse button is released. (Inherited from Control.)
Public event | MouseWheel | Occurs when the mouse wheel moves while the control has focus. (Inherited from Control.)
Public event | Move | Occurs when the control is moved. (Inherited from Control.)
Public event | PaddingChanged | Occurs when the value of the Padding property changes. (Inherited from ListBox.)
Public event | Paint | Occurs when the ListBox control is painted. (Inherited from ListBox.)
Public event | ParentChanged | Occurs when the Parent property value changes. (Inherited from Control.)
Public event | PreviewKeyDown | Occurs before the KeyDown event when a key is pressed while focus is on this control. (Inherited from Control.)
Public event | QueryAccessibilityHelp | Occurs when AccessibleObject is providing help to accessibility applications. (Inherited from Control.)
Public event | QueryContinueDrag | Occurs during a drag-and-drop operation and enables the drag source to determine whether the drag-and-drop operation should be canceled. (Inherited from Control.)
Public event | RegionChanged | Occurs when the value of the Region property changes. (Inherited from Control.)
Public event | Resize | Occurs when the control is resized. (Inherited from Control.)
Public event | RightToLeftChanged | Occurs when the RightToLeft property value changes. (Inherited from Control.)
Public event | SelectedIndexChanged | Occurs when the SelectedIndex property or the SelectedIndices collection has changed. (Inherited from ListBox.)
Public event | SelectedValueChanged | Occurs when the SelectedValue property changes. (Inherited from ListControl.)
Public event | SizeChanged | Occurs when the Size property value changes. (Inherited from Control.)
Public event | StyleChanged | Occurs when the control style changes. (Inherited from Control.)
Public event | SystemColorsChanged | Occurs when the system colors change. (Inherited from Control.)
Public event | TabIndexChanged | Occurs when the TabIndex property value changes. (Inherited from Control.)
Public event | TabStopChanged | Occurs when the TabStop property value changes. (Inherited from Control.)
Public event | TextChanged | Occurs when the Text property is changed. (Inherited from ListBox.)
Public event | Validated | Occurs when the control is finished validating. (Inherited from Control.)
Public event | Validating | Occurs when the control is validating. (Inherited from Control.)
Public event | ValueMemberChanged | Occurs when the ValueMember property changes. (Inherited from ListControl.)
Public event | VisibleChanged | Occurs when the Visible property value changes. (Inherited from Control.)
Top
See Also

Reference

DigitalGiles.Logging Namespace


LoggingListBox Constructor

LoggingListBox Constructor
Instantiates a new LoggingListBox control

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public LoggingListBox()
See Also

Reference

LoggingListBox Class
DigitalGiles.Logging Namespace


LoggingListBox Methods

LoggingListBox Methods

The LoggingListBox type exposes the following members.

Methods
 | Name | Description
Public method | AddMessage | Appends a message to the log queue
Public method | BeginInvoke(Delegate) | Executes the specified delegate asynchronously on the thread that the control's underlying handle was created on. (Inherited from Control.)
Public method | BeginInvoke(Delegate, Object) | Executes the specified delegate asynchronously with the specified arguments, on the thread that the control's underlying handle was created on. (Inherited from Control.)
Public method | BeginUpdate | Maintains performance while items are added to the ListBox one at a time by preventing the control from drawing until the EndUpdate method is called. (Inherited from ListBox.)
Public method | BringToFront | Brings the control to the front of the z-order. (Inherited from Control.)
Public method | ClearSelected | Unselects all items in the ListBox. (Inherited from ListBox.)
Public method | Contains | Retrieves a value indicating whether the specified control is a child of the control. (Inherited from Control.)
Public method | CreateControl | Forces the creation of the visible control, including the creation of the handle and any visible child controls. (Inherited from Control.)
Public method | CreateGraphics | Creates the Graphics for the control. (Inherited from Control.)
Public method | CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.)
Public method | Dispose | Releases all resources used by the Component. (Inherited from Component.)
Public method | DoDragDrop | Begins a drag-and-drop operation. (Inherited from Control.)
Public method | DrawToBitmap | Supports rendering to the specified bitmap. (Inherited from Control.)
Public method | EndInvoke | Retrieves the return value of the asynchronous operation represented by the IAsyncResult passed. (Inherited from Control.)
Public method | EndUpdate | Resumes painting the ListBox control after painting is suspended by the BeginUpdate method. (Inherited from ListBox.)
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | FindForm | Retrieves the form that the control is on. (Inherited from Control.)
Public method | FindString(String) | Finds the first item in the ListBox that starts with the specified string. (Inherited from ListBox.)
Public method | FindString(String, Int32) | Finds the first item in the ListBox that starts with the specified string. The search starts at a specific starting index. (Inherited from ListBox.)
Public method | FindStringExact(String) | Finds the first item in the ListBox that exactly matches the specified string. (Inherited from ListBox.)
Public method | FindStringExact(String, Int32) | Finds the first item in the ListBox that exactly matches the specified string. The search starts at a specific starting index. (Inherited from ListBox.)
Public method | Focus | Sets input focus to the control. (Inherited from Control.)
Public method | GetChildAtPoint(Point) | Retrieves the child control that is located at the specified coordinates. (Inherited from Control.)
Public method | GetChildAtPoint(Point, GetChildAtPointSkip) | Retrieves the child control that is located at the specified coordinates, specifying whether to ignore child controls of a certain type. (Inherited from Control.)
Public method | GetContainerControl | Returns the next ContainerControl up the control's chain of parent controls. (Inherited from Control.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetItemHeight | Returns the height of an item in the ListBox. (Inherited from ListBox.)
Public method | GetItemRectangle | Returns the bounding rectangle for an item in the ListBox. (Inherited from ListBox.)
Public method | GetItemText | Returns the text representation of the specified item. (Inherited from ListControl.)
Public method | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Public method | GetNextControl | Retrieves the next control forward or back in the tab order of child controls. (Inherited from Control.)
Public method | GetPreferredSize | Retrieves the size of a rectangular area into which a control can be fitted. (Inherited from Control.)
Public method | GetSelected | Returns a value indicating whether the specified item is selected. (Inherited from ListBox.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Hide | Conceals the control from the user. (Inherited from Control.)
Public method | IndexFromPoint(Point) | Returns the zero-based index of the item at the specified coordinates. (Inherited from ListBox.)
Public method | IndexFromPoint(Int32, Int32) | Returns the zero-based index of the item at the specified coordinates. (Inherited from ListBox.)
Public method | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Public method | Invalidate | Invalidates the entire surface of the control and causes the control to be redrawn. (Inherited from Control.)
Public method | Invalidate(Region) | Invalidates the specified region of the control (adds it to the control's update region, which is the area that will be repainted at the next paint operation), and causes a paint message to be sent to the control. (Inherited from Control.)
Public method | Invalidate(Boolean) | Invalidates a specific region of the control and causes a paint message to be sent to the control. Optionally, invalidates the child controls assigned to the control. (Inherited from Control.)
Public method | Invalidate(Rectangle) | Invalidates the specified region of the control (adds it to the control's update region, which is the area that will be repainted at the next paint operation), and causes a paint message to be sent to the control. (Inherited from Control.)
Public method | Invalidate(Region, Boolean) | Invalidates the specified region of the control (adds it to the control's update region, which is the area that will be repainted at the next paint operation), and causes a paint message to be sent to the control. Optionally, invalidates the child controls assigned to the control. (Inherited from Control.)
Public method | Invalidate(Rectangle, Boolean) | Invalidates the specified region of the control (adds it to the control's update region, which is the area that will be repainted at the next paint operation), and causes a paint message to be sent to the control. Optionally, invalidates the child controls assigned to the control. (Inherited from Control.)
Public method | Invoke(Delegate) | Executes the specified delegate on the thread that owns the control's underlying window handle. (Inherited from Control.)
Public method | Invoke(Delegate, Object) | Executes the specified delegate, on the thread that owns the control's underlying window handle, with the specified list of arguments. (Inherited from Control.)
Public method | PerformLayout | Forces the control to apply layout logic to all its child controls. (Inherited from Control.)
Public method | PerformLayout(Control, String) | Forces the control to apply layout logic to all its child controls. (Inherited from Control.)
Public method | PointToClient | Computes the location of the specified screen point into client coordinates. (Inherited from Control.)
Public method | PointToScreen | Computes the location of the specified client point into screen coordinates. (Inherited from Control.)
Public method | PreProcessControlMessage | Preprocesses keyboard or input messages within the message loop before they are dispatched. (Inherited from Control.)
Public method | PreProcessMessage | Preprocesses keyboard or input messages within the message loop before they are dispatched. (Inherited from Control.)
Public method | RectangleToClient | Computes the size and location of the specified screen rectangle in client coordinates. (Inherited from Control.)
Public method | RectangleToScreen | Computes the size and location of the specified client rectangle in screen coordinates. (Inherited from Control.)
Public method | Refresh | Forces the control to invalidate its client area and immediately redraw itself and any child controls. (Inherited from ListBox.)
Public method | ResetBackColor | (Inherited from ListBox.)
Public method | ResetBindings | Causes a control bound to the BindingSource to reread all the items in the list and refresh their displayed values. (Inherited from Control.)
Public method | ResetCursor | Resets the Cursor property to its default value. (Inherited from Control.)
Public method | ResetFont | Resets the Font property to its default value. (Inherited from Control.)
Public method | ResetForeColor | (Inherited from ListBox.)
Public method | ResetImeMode | Resets the ImeMode property to its default value. (Inherited from Control.)
Public method | ResetRightToLeft | Resets the RightToLeft property to its default value. (Inherited from Control.)
Public method | ResetText | Resets the Text property to its default value. (Inherited from Control.)
Public method | ResumeLayout | Resumes usual layout logic. (Inherited from Control.)
Public method | ResumeLayout(Boolean) | Resumes usual layout logic, optionally forcing an immediate layout of pending layout requests. (Inherited from Control.)
Public method | Scale(Single) | Obsolete. Scales the control and any child controls. (Inherited from Control.)
Public method | Scale(SizeF) | Scales the control and all child controls by the specified scaling factor. (Inherited from Control.)
Public method | Scale(Single, Single) | Obsolete. Scales the entire control and any child controls. (Inherited from Control.)
Public method | Select | Activates the control. (Inherited from Control.)
Public method | SelectNextControl | Activates the next control. (Inherited from Control.)
Public method | SendToBack | Sends the control to the back of the z-order. (Inherited from Control.)
Public method | SetBounds(Int32, Int32, Int32, Int32) | Sets the bounds of the control to the specified location and size. (Inherited from Control.)
Public method | SetBounds(Int32, Int32, Int32, Int32, BoundsSpecified) | Sets the specified bounds of the control to the specified location and size. (Inherited from Control.)
Public method | SetFilter | Configures the filtering function to ONLY display messages from this particular module ID. Set to 0 to disable filtering function.
Public method | SetSelected | Selects or clears the selection for the specified item in a ListBox. (Inherited from ListBox.)
Public method | Show | Displays the control to the user. (Inherited from Control.)
Public method | Start | Starts the timer that periodically updates the log window
Public method | Stop | Stops the timer that periodically updates the log window
Public method | SuspendLayout | Temporarily suspends the layout logic for the control. (Inherited from Control.)
Public method | ToString | Returns a string representation of the ListBox. (Inherited from ListBox.)
Public method | Update | Causes the control to redraw the invalidated regions within its client area. (Inherited from Control.)
Top
See Also

Reference

LoggingListBox Class
DigitalGiles.Logging Namespace


LoggingListBox.AddMessage Method

LoggingListBoxAddMessage Method
Appends a message to the log queue

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void AddMessage(
    LogItem message
)

Parameters

message
Type: DigitalGiles.LoggingLogItem
LogItem containing the message to log and associated parameters
See Also

Reference

LoggingListBox Class
DigitalGiles.Logging Namespace


LoggingListBox.SetFilter Method

LoggingListBoxSetFilter Method
Configures the filtering function to ONLY display messages from this particular module ID. Set to 0 to disable filtering function.

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void SetFilter(
    int moduleID
)

Parameters

moduleID
Type: SystemInt32
Module ID
See Also

Reference

LoggingListBox Class
DigitalGiles.Logging Namespace


LoggingListBox.Start Method

LoggingListBoxStart Method
Starts the timer that periodically updates the log window

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Start()
See Also

Reference

LoggingListBox Class
DigitalGiles.Logging Namespace


LoggingListBox.Stop Method

LoggingListBoxStop Method
Stops the timer that periodically updates the log window

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Stop()
See Also

Reference

LoggingListBox Class
DigitalGiles.Logging Namespace


LoggingListBox Properties

LoggingListBox Properties

The LoggingListBox type exposes the following members.

Properties
 | Name | Description
Public property | AccessibilityObject | Gets the AccessibleObject assigned to the control. (Inherited from Control.)
Public property | AccessibleDefaultActionDescription | Gets or sets the default action description of the control for use by accessibility client applications. (Inherited from Control.)
Public property | AccessibleDescription | Gets or sets the description of the control used by accessibility client applications. (Inherited from Control.)
Public property | AccessibleName | Gets or sets the name of the control used by accessibility client applications. (Inherited from Control.)
Public property | AccessibleRole | Gets or sets the accessible role of the control (Inherited from Control.)
Public property | AllowDrop | Gets or sets a value indicating whether the control can accept data that the user drags onto it. (Inherited from Control.)
Public property | Anchor | Gets or sets the edges of the container to which a control is bound and determines how a control is resized with its parent. (Inherited from Control.)
Public property | AutoScrollOffset | Gets or sets where this control is scrolled to in ScrollControlIntoView(Control). (Inherited from Control.)
Public property | AutoSize | This property is not relevant for this class. (Inherited from Control.)
Public property | BackColor | (Inherited from ListBox.)
Public property | BackgroundImage | This property is not relevant to this class. (Inherited from ListBox.)
Public property | BackgroundImageLayout | Gets or sets the background image layout for a ListBox as defined in the ImageLayout enumeration. (Inherited from ListBox.)
Public property | BindingContext | Gets or sets the BindingContext for the control. (Inherited from Control.)
Public property | BorderStyle | Gets or sets the type of border that is drawn around the ListBox. (Inherited from ListBox.)
Public property | Bottom | Gets the distance, in pixels, between the bottom edge of the control and the top edge of its container's client area. (Inherited from Control.)
Public property | Bounds | Gets or sets the size and location of the control including its nonclient elements, in pixels, relative to the parent control. (Inherited from Control.)
Public property | CanFocus | Gets a value indicating whether the control can receive focus. (Inherited from Control.)
Public property | CanSelect | Gets a value indicating whether the control can be selected. (Inherited from Control.)
Public property | Capture | Gets or sets a value indicating whether the control has captured the mouse. (Inherited from Control.)
Public property | CausesValidation | Gets or sets a value indicating whether the control causes validation to be performed on any controls that require validation when it receives focus. (Inherited from Control.)
Public property | ClientRectangle | Gets the rectangle that represents the client area of the control. (Inherited from Control.)
Public property | ClientSize | Gets or sets the height and width of the client area of the control. (Inherited from Control.)
Public property | ColumnWidth | Gets or sets the width of columns in a multicolumn ListBox. (Inherited from ListBox.)
Public property | CompanyName | Gets the name of the company or creator of the application containing the control. (Inherited from Control.)
Public property | Container | Gets the IContainer that contains the Component. (Inherited from Component.)
Public property | ContainsFocus | Gets a value indicating whether the control, or one of its child controls, currently has the input focus. (Inherited from Control.)
Public property | ContextMenu | Gets or sets the shortcut menu associated with the control. (Inherited from Control.)
Public property | ContextMenuStrip | Gets or sets the ContextMenuStrip associated with this control. (Inherited from Control.)
Public property | Controls | Gets the collection of controls contained within the control. (Inherited from Control.)
Public property | Created | Gets a value indicating whether the control has been created. (Inherited from Control.)
Public property | Cursor | Gets or sets the cursor that is displayed when the mouse pointer is over the control. (Inherited from Control.)
Public property | CustomTabOffsets | Gets the width of the tabs between the items in the ListBox. (Inherited from ListBox.)
Public property | DataBindings | Gets the data bindings for the control. (Inherited from Control.)
Public property | DataSource | Gets or sets the data source for this ListControl. (Inherited from ListControl.)
Public property | DisplayMember | Gets or sets the property to display for this ListControl. (Inherited from ListControl.)
Public property | DisplayRectangle | Gets the rectangle that represents the display area of the control. (Inherited from Control.)
Public property | Disposing | Gets a value indicating whether the base Control class is in the process of disposing. (Inherited from Control.)
Public property | Dock | Gets or sets which control borders are docked to its parent control and determines how a control is resized with its parent. (Inherited from Control.)
Public property | DrawMode | Gets or sets the drawing mode for the control. (Inherited from ListBox.)
Public property | Enabled | Gets or sets a value indicating whether the control can respond to user interaction. (Inherited from Control.)
Public property | Focused | Gets a value indicating whether the control has input focus. (Inherited from Control.)
Public property | Font | (Inherited from ListBox.)
Public property | ForeColor | (Inherited from ListBox.)
Public property | FormatInfo | Gets or sets the IFormatProvider that provides custom formatting behavior. (Inherited from ListControl.)
Public property | FormatString | Gets or sets the format-specifier characters that indicate how a value is to be displayed. (Inherited from ListControl.)
Public property | FormattingEnabled | Gets or sets a value indicating whether formatting is applied to the DisplayMember property of the ListControl. (Inherited from ListControl.)
Public property | Handle | Gets the window handle that the control is bound to. (Inherited from Control.)
Public property | HasChildren | Gets a value indicating whether the control contains one or more child controls. (Inherited from Control.)
Public property | Height | Gets or sets the height of the control. (Inherited from Control.)
Public property | HorizontalExtent | Gets or sets the width by which the horizontal scroll bar of a ListBox can scroll. (Inherited from ListBox.)
Public property | HorizontalScrollbar | Gets or sets a value indicating whether a horizontal scroll bar is displayed in the control. (Inherited from ListBox.)
Public property | ImeMode | Gets or sets the Input Method Editor (IME) mode of the control. (Inherited from Control.)
Public property | IntegralHeight | Gets or sets a value indicating whether the control should resize to avoid showing partial items. (Inherited from ListBox.)
Public property | InvokeRequired | Gets a value indicating whether the caller must call an invoke method when making method calls to the control because the caller is on a different thread than the one the control was created on. (Inherited from Control.)
Public property | IsAccessible | Gets or sets a value indicating whether the control is visible to accessibility applications. (Inherited from Control.)
Public property | IsDisposed | Gets a value indicating whether the control has been disposed of. (Inherited from Control.)
Public property | IsHandleCreated | Gets a value indicating whether the control has a handle associated with it. (Inherited from Control.)
Public property | IsMirrored | Gets a value indicating whether the control is mirrored. (Inherited from Control.)
Public property | ItemHeight | Gets or sets the height of an item in the ListBox. (Inherited from ListBox.)
Public property | Items | Gets the items of the ListBox. (Inherited from ListBox.)
Public property | LayoutEngine | Gets a cached instance of the control's layout engine. (Inherited from Control.)
Public property | Left | Gets or sets the distance, in pixels, between the left edge of the control and the left edge of its container's client area. (Inherited from Control.)
Public property | Location | Gets or sets the coordinates of the upper-left corner of the control relative to the upper-left corner of its container. (Inherited from Control.)
Public property | LoggingLevel | Message filtering level. Messages with a priority below this will not be displayed.
Public property | Margin | Gets or sets the space between controls. (Inherited from Control.)
Public property | MaximumItems | The maximum number of items in the listbox. Excess items are removed from the top of the listbox.
Public property | MaximumSize | Gets or sets the size that is the upper limit that GetPreferredSize(Size) can specify. (Inherited from Control.)
Public property | MinimumSize | Gets or sets the size that is the lower limit that GetPreferredSize(Size) can specify. (Inherited from Control.)
Public property | MultiColumn | Gets or sets a value indicating whether the ListBox supports multiple columns. (Inherited from ListBox.)
Public property | Name | Gets or sets the name of the control. (Inherited from Control.)
Public property | Padding | This property is not relevant to this class. (Inherited from ListBox.)
Public property | Parent | Gets or sets the parent container of the control. (Inherited from Control.)
Public property | PreferredHeight | Gets the combined height of all items in the ListBox. (Inherited from ListBox.)
Public property | PreferredSize | Gets the size of a rectangular area into which the control can fit. (Inherited from Control.)
Public property | ProductName | Gets the product name of the assembly containing the control. (Inherited from Control.)
Public property | ProductVersion | Gets the version of the assembly containing the control. (Inherited from Control.)
Public property | RecreatingHandle | Gets a value indicating whether the control is currently re-creating its handle. (Inherited from Control.)
Public property | Region | Gets or sets the window region associated with the control. (Inherited from Control.)
Public property | Right | Gets the distance, in pixels, between the right edge of the control and the left edge of its container's client area. (Inherited from Control.)
Public property | RightToLeft | Gets or sets a value indicating whether text displayed by the control is displayed from right to left. (Inherited from ListBox.)
Public property | ScrollAlwaysVisible | Gets or sets a value indicating whether the vertical scroll bar is shown at all times. (Inherited from ListBox.)
Public property | SelectedIndex | Gets or sets the zero-based index of the currently selected item in a ListBox. (Inherited from ListBox.)
Public property | SelectedIndices | Gets a collection that contains the zero-based indexes of all currently selected items in the ListBox. (Inherited from ListBox.)
Public property | SelectedItem | Gets or sets the currently selected item in the ListBox. (Inherited from ListBox.)
Public property | SelectedItems | Gets a collection containing the currently selected items in the ListBox. (Inherited from ListBox.)
Public property | SelectedValue | Gets or sets the value of the member property specified by the ValueMember property. (Inherited from ListControl.)
Public property | SelectionMode | Gets or sets the method in which items are selected in the ListBox. (Inherited from ListBox.)
Public property | Site | Gets or sets the site of the control. (Inherited from Control.)
Public property | Size | Gets or sets the height and width of the control. (Inherited from Control.)
Public property | Sorted | Gets or sets a value indicating whether the items in the ListBox are sorted alphabetically. (Inherited from ListBox.)
Public property | TabIndex | Gets or sets the tab order of the control within its container. (Inherited from Control.)
Public property | TabStop | Gets or sets a value indicating whether the user can give the focus to this control using the TAB key. (Inherited from Control.)
Public property | Tag | Gets or sets the object that contains data about the control. (Inherited from Control.)
Public property | Text | Gets or searches for the text of the currently selected item in the ListBox. (Inherited from ListBox.)
Public property | Top | Gets or sets the distance, in pixels, between the top edge of the control and the top edge of its container's client area. (Inherited from Control.)
Public property | TopIndex | Gets or sets the index of the first visible item in the ListBox. (Inherited from ListBox.)
Public property | TopLevelControl | Gets the parent control that is not parented by another Windows Forms control. Typically, this is the outermost Form that the control is contained in. (Inherited from Control.)
Public property | UseCustomTabOffsets | Gets or sets a value indicating whether the ListBox recognizes and expands tab characters when it draws its strings by using the CustomTabOffsets integer array. (Inherited from ListBox.)
Public property | UseTabStops | Gets or sets a value indicating whether the ListBox can recognize and expand tab characters when drawing its strings. (Inherited from ListBox.)
Public property | UseWaitCursor | Gets or sets a value indicating whether to use the wait cursor for the current control and all child controls. (Inherited from Control.)
Public property | ValueMember | Gets or sets the property to use as the actual value for the items in the ListControl. (Inherited from ListControl.)
Public property | Visible | Gets or sets a value indicating whether the control and all its child controls are displayed. (Inherited from Control.)
Public property | Width | Gets or sets the width of the control. (Inherited from Control.)
Public property | WindowTarget | This property is not relevant for this class. (Inherited from Control.)
Top
See Also

Reference

LoggingListBox Class
DigitalGiles.Logging Namespace


LoggingListBox.LoggingLevel Property

LoggingListBoxLoggingLevel Property
Message filtering level. Messages with a priority below this will not be displayed.

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int LoggingLevel { get; set; }

Property Value

Type: Int32
See Also

Reference

LoggingListBox Class
DigitalGiles.Logging Namespace


LoggingListBox.MaximumItems Property

LoggingListBoxMaximumItems Property
The maximum number of items in the listbox. Excess items are removed from the top of the listbox.

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int MaximumItems { get; set; }

Property Value

Type: Int32
See Also

Reference

LoggingListBox Class
DigitalGiles.Logging Namespace


LoggingListBox Events

LoggingListBox Events

The LoggingListBox type exposes the following members.

Events
 | Name | Description
Public event | AutoSizeChanged | This event is not relevant for this class. (Inherited from Control.)
Public event | BackColorChanged | Occurs when the value of the BackColor property changes. (Inherited from Control.)
Public event | BackgroundImageChanged | Occurs when the BackgroundImage property of the label changes. (Inherited from ListBox.)
Public event | BackgroundImageLayoutChanged | Occurs when the BackgroundImageLayout property changes. (Inherited from ListBox.)
Public event | BindingContextChanged | Occurs when the value of the BindingContext property changes. (Inherited from Control.)
Public event | CausesValidationChanged | Occurs when the value of the CausesValidation property changes. (Inherited from Control.)
Public event | ChangeUICues | Occurs when the focus or keyboard user interface (UI) cues change. (Inherited from Control.)
Public event | Click | Occurs when the ListBox control is clicked. (Inherited from ListBox.)
Public event | ClientSizeChanged | Occurs when the value of the ClientSize property changes. (Inherited from Control.)
Public event | ContextMenuChanged | Occurs when the value of the ContextMenu property changes. (Inherited from Control.)
Public event | ContextMenuStripChanged | Occurs when the value of the ContextMenuStrip property changes. (Inherited from Control.)
Public event | ControlAdded | Occurs when a new control is added to the ControlControlCollection. (Inherited from Control.)
Public event | ControlRemoved | Occurs when a control is removed from the ControlControlCollection. (Inherited from Control.)
Public event | CursorChanged | Occurs when the value of the Cursor property changes. (Inherited from Control.)
Public event | DataSourceChanged | Occurs when the DataSource changes. (Inherited from ListControl.)
Public event | DisplayMemberChanged | Occurs when the DisplayMember property changes. (Inherited from ListControl.)
Public event | Disposed | Occurs when the component is disposed by a call to the Dispose method. (Inherited from Component.)
Public event | DockChanged | Occurs when the value of the Dock property changes. (Inherited from Control.)
Public event | DoubleClick | Occurs when the control is double-clicked. (Inherited from Control.)
Public event | DragDrop | Occurs when a drag-and-drop operation is completed. (Inherited from Control.)
Public event | DragEnter | Occurs when an object is dragged into the control's bounds. (Inherited from Control.)
Public event | DragLeave | Occurs when an object is dragged out of the control's bounds. (Inherited from Control.)
Public event | DragOver | Occurs when an object is dragged over the control's bounds. (Inherited from Control.)
Public event | DrawItem | Occurs when a visual aspect of an owner-drawn ListBox changes. (Inherited from ListBox.)
Public event | EnabledChanged | Occurs when the Enabled property value has changed. (Inherited from Control.)
Public event | Enter | Occurs when the control is entered. (Inherited from Control.)
Public event | FontChanged | Occurs when the Font property value changes. (Inherited from Control.)
Public event | ForeColorChanged | Occurs when the ForeColor property value changes. (Inherited from Control.)
Public event | Format | Occurs when the control is bound to a data value. (Inherited from ListControl.)
Public event | FormatInfoChanged | Occurs when the value of the FormatInfo property changes. (Inherited from ListControl.)
Public event | FormatStringChanged | Occurs when value of the FormatString property changes (Inherited from ListControl.)
Public event | FormattingEnabledChanged | Occurs when the value of the FormattingEnabled property changes. (Inherited from ListControl.)
Public event | GiveFeedback | Occurs during a drag operation. (Inherited from Control.)
Public event | GotFocus | Occurs when the control receives focus. (Inherited from Control.)
Public event | HandleCreated | Occurs when a handle is created for the control. (Inherited from Control.)
Public event | HandleDestroyed | Occurs when the control's handle is in the process of being destroyed. (Inherited from Control.)
Public event | HelpRequested | Occurs when the user requests help for a control. (Inherited from Control.)
Public event | ImeModeChanged | Occurs when the ImeMode property has changed. (Inherited from Control.)
Public event | Invalidated | Occurs when a control's display requires redrawing. (Inherited from Control.)
Public event | KeyDown | Occurs when a key is pressed while the control has focus. (Inherited from Control.)
Public event | KeyPress | Occurs when a key is pressed while the control has focus. (Inherited from Control.)
Public event | KeyUp | Occurs when a key is released while the control has focus. (Inherited from Control.)
Public event | Layout | Occurs when a control should reposition its child controls. (Inherited from Control.)
Public event | Leave | Occurs when the input focus leaves the control. (Inherited from Control.)
Public event | LocationChanged | Occurs when the Location property value has changed. (Inherited from Control.)
Public event | LostFocus | Occurs when the control loses focus. (Inherited from Control.)
Public event | MarginChanged | Occurs when the control's margin changes. (Inherited from Control.)
Public event | MeasureItem | Occurs when an owner-drawn ListBox is created and the sizes of the list items are determined. (Inherited from ListBox.)
Public event | MouseCaptureChanged | Occurs when the control loses mouse capture. (Inherited from Control.)
Public event | MouseClick | Occurs when the user clicks the ListBox control with the mouse pointer. (Inherited from ListBox.)
Public event | MouseDoubleClick | Occurs when the control is double clicked by the mouse. (Inherited from Control.)
Public event | MouseDown | Occurs when the mouse pointer is over the control and a mouse button is pressed. (Inherited from Control.)
Public event | MouseEnter | Occurs when the mouse pointer enters the control. (Inherited from Control.)
Public event | MouseHover | Occurs when the mouse pointer rests on the control. (Inherited from Control.)
Public event | MouseLeave | Occurs when the mouse pointer leaves the control. (Inherited from Control.)
Public event | MouseMove | Occurs when the mouse pointer is moved over the control. (Inherited from Control.)
Public event | MouseUp | Occurs when the mouse pointer is over the control and a mouse button is released. (Inherited from Control.)
Public event | MouseWheel | Occurs when the mouse wheel moves while the control has focus. (Inherited from Control.)
Public event | Move | Occurs when the control is moved. (Inherited from Control.)
Public event | PaddingChanged | Occurs when the value of the Padding property changes. (Inherited from ListBox.)
Public event | Paint | Occurs when the ListBox control is painted. (Inherited from ListBox.)
Public event | ParentChanged | Occurs when the Parent property value changes. (Inherited from Control.)
Public event | PreviewKeyDown | Occurs before the KeyDown event when a key is pressed while focus is on this control. (Inherited from Control.)
Public event | QueryAccessibilityHelp | Occurs when AccessibleObject is providing help to accessibility applications. (Inherited from Control.)
Public event | QueryContinueDrag | Occurs during a drag-and-drop operation and enables the drag source to determine whether the drag-and-drop operation should be canceled. (Inherited from Control.)
Public event | RegionChanged | Occurs when the value of the Region property changes. (Inherited from Control.)
Public event | Resize | Occurs when the control is resized. (Inherited from Control.)
Public event | RightToLeftChanged | Occurs when the RightToLeft property value changes. (Inherited from Control.)
Public event | SelectedIndexChanged | Occurs when the SelectedIndex property or the SelectedIndices collection has changed. (Inherited from ListBox.)
Public event | SelectedValueChanged | Occurs when the SelectedValue property changes. (Inherited from ListControl.)
Public event | SizeChanged | Occurs when the Size property value changes. (Inherited from Control.)
Public event | StyleChanged | Occurs when the control style changes. (Inherited from Control.)
Public event | SystemColorsChanged | Occurs when the system colors change. (Inherited from Control.)
Public event | TabIndexChanged | Occurs when the TabIndex property value changes. (Inherited from Control.)
Public event | TabStopChanged | Occurs when the TabStop property value changes. (Inherited from Control.)
Public event | TextChanged | Occurs when the Text property is changed. (Inherited from ListBox.)
Public event | Validated | Occurs when the control is finished validating. (Inherited from Control.)
Public event | Validating | Occurs when the control is validating. (Inherited from Control.)
Public event | ValueMemberChanged | Occurs when the ValueMember property changes. (Inherited from ListControl.)
Public event | VisibleChanged | Occurs when the Visible property value changes. (Inherited from Control.)
Top
See Also

Reference

LoggingListBox Class
DigitalGiles.Logging Namespace


LogItem Class

LogItem Class
An item posted to the application log
Inheritance Hierarchy
SystemObject
DigitalGiles.LoggingLogItem

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class LogItem

The LogItem type exposes the following members.

Constructors
 | Name | Description
Public method | LogItem(Int32, String, String, Int32, Int32) | Creates a new LogItem.
Public method | LogItem(Int32, String, String, Int32, Int32, DateTime) | Creates a new LogItem.
Top
Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns the instance as a string. (Overrides ObjectToString.)
Top
Properties
 | Name | Description
Public property | Colour | The colour in which to display this message in the debug window.
Public property | LogLevel | Log level associated with this message.
Public property | Message | The message.
Public property | ModuleID | The ID of the module that originated this message (0 if message was not from a module).
Public property | Section | The message's subsection.
Public property | Time | The time at which this log message was posted
Top
See Also

Reference

DigitalGiles.Logging Namespace


LogItem Constructor

LogItem Constructor
Overload List
 | Name | Description
Public method | LogItem(Int32, String, String, Int32, Int32) | Creates a new LogItem.
Public method | LogItem(Int32, String, String, Int32, Int32, DateTime) | Creates a new LogItem.
Top
See Also

Reference

LogItem Class
DigitalGiles.Logging Namespace


LogItem Constructor (Int32, String, String, Int32, Int32)

LogItem Constructor (Int32, String, String, Int32, Int32)
Creates a new LogItem.

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public LogItem(
    int moduleID,
    string section,
    string logmsg,
    int loglevel,
    int logcolour
)

Parameters

moduleID
Type: SystemInt32
The ID of the module that originated this message (0 if message was not from a module).
section
Type: SystemString
The message's subsection.
logmsg
Type: SystemString
The message.
loglevel
Type: SystemInt32
Associated logging level for this message.
logcolour
Type: SystemInt32
The colour in which to display this message in the debug window.
See Also

Reference

LogItem Class
LogItem Overload
DigitalGiles.Logging Namespace


LogItem Constructor (Int32, String, String, Int32, Int32, DateTime)

LogItem Constructor (Int32, String, String, Int32, Int32, DateTime)
Creates a new LogItem.

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public LogItem(
    int moduleID,
    string section,
    string logmsg,
    int loglevel,
    int logcolour,
    DateTime logTime
)

Parameters

moduleID
Type: SystemInt32
The ID of the module that originated this message (0 if message was not from a module).
section
Type: SystemString
The message's subsection.
logmsg
Type: SystemString
The message.
loglevel
Type: SystemInt32
Associated logging level for this message.
logcolour
Type: SystemInt32
The colour in which to display this message in the debug window.
logTime
Type: SystemDateTime
The time that this log message was generated.
See Also

Reference

LogItem Class
LogItem Overload
DigitalGiles.Logging Namespace


LogItem Methods

LogItem Methods

The LogItem type exposes the following members.

Methods
 | Name | Description
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | ToString | Returns the instance as a string. (Overrides ObjectToString.)
Top
See Also

Reference

LogItem Class
DigitalGiles.Logging Namespace


LogItem.ToString Method

LogItemToString Method
Returns the instance as a string.

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
Message string
See Also

Reference

LogItem Class
DigitalGiles.Logging Namespace


LogItem Properties

LogItem Properties

The LogItem type exposes the following members.

Properties
 | Name | Description
Public property | Colour | The colour in which to display this message in the debug window.
Public property | LogLevel | Log level associated with this message.
Public property | Message | The message.
Public property | ModuleID | The ID of the module that originated this message (0 if message was not from a module).
Public property | Section | The message's subsection.
Public property | Time | The time at which this log message was posted
Top
See Also

Reference

LogItem Class
DigitalGiles.Logging Namespace


LogItem.Colour Property

LogItemColour Property
The colour in which to display this message in the debug window.

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int Colour { get; set; }

Property Value

Type: Int32
See Also

Reference

LogItem Class
DigitalGiles.Logging Namespace


LogItem.LogLevel Property

LogItemLogLevel Property
Log level associated with this message.

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int LogLevel { get; set; }

Property Value

Type: Int32
See Also

Reference

LogItem Class
DigitalGiles.Logging Namespace


LogItem.Message Property

LogItemMessage Property
The message.

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Message { get; set; }

Property Value

Type: String
See Also

Reference

LogItem Class
DigitalGiles.Logging Namespace


LogItem.ModuleID Property

LogItemModuleID Property
The ID of the module that originated this message (0 if message was not from a module).

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public int ModuleID { get; set; }

Property Value

Type: Int32
See Also

Reference

LogItem Class
DigitalGiles.Logging Namespace


LogItem.Section Property

LogItemSection Property
The message's subsection.

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string Section { get; set; }

Property Value

Type: String
See Also

Reference

LogItem Class
DigitalGiles.Logging Namespace


LogItem.Time Property

LogItemTime Property
The time at which this log message was posted

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public DateTime Time { get; set; }

Property Value

Type: DateTime
See Also

Reference

LogItem Class
DigitalGiles.Logging Namespace


LogWriter Class

LogWriter Class
Class encapsulating a log file writer.
Inheritance Hierarchy
SystemObject
DigitalGiles.LoggingLogWriter

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public class LogWriter : IDisposable

The LogWriter type exposes the following members.

Constructors
 | Name | Description
Public method | LogWriter | Creates a new LogWriter.
Top
Methods
 | Name | Description
Public method | Dispose | Releases all resources used by the LogWriter
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Open(LogFileNameFormat) | Opens a logfile if one isn't already open.
Public method | Open(LogFileNameFormat, Int32) | Opens a logfile if one isn't already open and allows a custom offset to be inserted into the rollover time.
Public method | SetAppName | Sets the name of the application, which is written at the start of each logfile.
Public method | SetFileName(String) | Sets the actual file name to use.
Public method | SetFileName(UInt32) | Sets the file name based on the device number in the standard BNCS way.
Public method | SetFilePath | Folder path to the log file location. Throws an ArgumentException if the folder is not found.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Public method | WriteLine | Writes a line to the log
Top
Properties
 | Name | Description
Public property | DevelopmentMode | If we're in development mode, this appends the current time (in ticks) to the end of the filename to make it easier to identify logs from instances.
Public property | FileName | The file name to which we are logging.
Public property | FileNameAndPath | The full path and file name to which we are logging.
Public property | LogFileMode | Logfile naming scheme - Provides options to append a full date to the log filename to avoid monthly overwriting. Set by the Open() method.
Public property | UseFullFormat | Whether to use 'full format' log file writing (i.e. whether to include the log level and colour information from the logged ListItem.
Top
Events
 | Name | Description
Public event | LogFileOpened | Event triggered when a new logfile is opened.
Top
See Also

Reference

DigitalGiles.Logging Namespace


LogWriter Constructor

LogWriter Constructor
Creates a new LogWriter.

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public LogWriter()
See Also

Reference

LogWriter Class
DigitalGiles.Logging Namespace


LogWriter Methods

LogWriter Methods

The LogWriter type exposes the following members.

Methods
 | Name | Description
Public method | Dispose |
Public method | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
Public method | GetType | Gets the Type of the current instance. (Inherited from Object.)
Public method | Open(LogFileNameFormat) | Opens a logfile if one isn't already open.
Public method | Open(LogFileNameFormat, Int32) | Opens a logfile if one isn't already open and allows a custom offset to be inserted into the rollover time.
Public method | SetAppName | Sets the name of the application, which is written at the start of each logfile.
Public method | SetFileName(String) | Sets the actual file name to use.
Public method | SetFileName(UInt32) | Sets the file name based on the device number in the standard BNCS way.
Public method | SetFilePath | Folder path to the log file location. Throws an ArgumentException if the folder is not found.
Public method | ToString | Returns a string that represents the current object. (Inherited from Object.)
Public method | WriteLine | Writes a line to the log
Top
See Also

Reference

LogWriter Class
DigitalGiles.Logging Namespace


LogWriter.Dispose Method

LogWriterDispose Method
Releases all resources used by the LogWriter

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Dispose()

Implements

IDisposableDispose
See Also

Reference

LogWriter Class
DigitalGiles.Logging Namespace


LogWriter.Open Method

LogWriterOpen Method
Overload List
 | Name | Description
Public method | Open(LogFileNameFormat) | Opens a logfile if one isn't already open.
Public method | Open(LogFileNameFormat, Int32) | Opens a logfile if one isn't already open and allows a custom offset to be inserted into the rollover time.
Top
See Also

Reference

LogWriter Class
DigitalGiles.Logging Namespace


LogWriter.Open Method (LogFileNameFormat)

LogWriterOpen Method (LogFileNameFormat)
Opens a logfile if one isn't already open.

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Open(
    LogFileNameFormat Mode
)

Parameters

Mode
Type: DigitalGiles.LoggingLogFileNameFormat
The LogFileNameFormat mode (filename format and rotation type) to open the new logfile as.
See Also

Reference

LogWriter Class
Open Overload
DigitalGiles.Logging Namespace


LogWriter.Open Method (LogFileNameFormat, Int32)

LogWriterOpen Method (LogFileNameFormat, Int32)
Opens a logfile if one isn't already open and allows a custom offset to be inserted into the rollover time.

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void Open(
    LogFileNameFormat Mode,
    int AdditionalOffset
)

Parameters

Mode
Type: DigitalGiles.LoggingLogFileNameFormat
The LogFileNameFormat mode (filename format and rotation type) to open the new logfile as.
AdditionalOffset
Type: SystemInt32
A number of milliseconds after the true rollover time (e.g. midnight) to wait before actually rolling over. Designed to allow spacing out of file creation attempts.
See Also

Reference

LogWriter Class
Open Overload
DigitalGiles.Logging Namespace


LogWriter.SetAppName Method

LogWriterSetAppName Method
Sets the name of the application, which is written at the start of each logfile.

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void SetAppName(
    string Name
)

Parameters

Name
Type: SystemString
The application name and version number.
See Also

Reference

LogWriter Class
DigitalGiles.Logging Namespace


LogWriter.SetFileName Method

LogWriterSetFileName Method
Overload List
 | Name | Description
Public method | SetFileName(String) | Sets the actual file name to use.
Public method | SetFileName(UInt32) | Sets the file name based on the device number in the standard BNCS way.
Top
See Also

Reference

LogWriter Class
DigitalGiles.Logging Namespace


LogWriter.SetFileName Method (String)

LogWriterSetFileName Method (String)
Sets the actual file name to use.

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void SetFileName(
    string Name
)

Parameters

Name
Type: SystemString
The name, without extension.
See Also

Reference

LogWriter Class
SetFileName Overload
DigitalGiles.Logging Namespace


LogWriter.SetFileName Method (UInt32)

LogWriterSetFileName Method (UInt32)
Sets the file name based on the device number in the standard BNCS way.

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void SetFileName(
    uint DeviceNumber
)

Parameters

DeviceNumber
Type: SystemUInt32
Device number to use.
See Also

Reference

LogWriter Class
SetFileName Overload
DigitalGiles.Logging Namespace


LogWriter.SetFilePath Method

LogWriterSetFilePath Method
Folder path to the log file location. Throws an ArgumentException if the folder is not found.

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void SetFilePath(
    string Path
)

Parameters

Path
Type: SystemString
Folder path to use.
See Also

Reference

LogWriter Class
DigitalGiles.Logging Namespace


LogWriter.WriteLine Method

LogWriterWriteLine Method
Writes a line to the log

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public void WriteLine(
    LogItem li
)

Parameters

li
Type: DigitalGiles.LoggingLogItem
LogItem containing the log message information
See Also

Reference

LogWriter Class
DigitalGiles.Logging Namespace


LogWriter Properties

LogWriter Properties

The LogWriter type exposes the following members.

Properties
 | Name | Description
Public property | DevelopmentMode | If we're in development mode, this appends the current time (in ticks) to the end of the filename to make it easier to identify logs from instances.
Public property | FileName | The file name to which we are logging.
Public property | FileNameAndPath | The full path and file name to which we are logging.
Public property | LogFileMode | Logfile naming scheme - Provides options to append a full date to the log filename to avoid monthly overwriting. Set by the Open() method.
Public property | UseFullFormat | Whether to use 'full format' log file writing (i.e. whether to include the log level and colour information from the logged ListItem.
Top
See Also

Reference

LogWriter Class
DigitalGiles.Logging Namespace


LogWriter.DevelopmentMode Property

LogWriterDevelopmentMode Property
If we're in development mode, this appends the current time (in ticks) to the end of the filename to make it easier to identify logs from instances.

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool DevelopmentMode { get; set; }

Property Value

Type: Boolean
See Also

Reference

LogWriter Class
DigitalGiles.Logging Namespace


LogWriter.FileName Property

LogWriterFileName Property
The file name to which we are logging.

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string FileName { get; }

Property Value

Type: String
See Also

Reference

LogWriter Class
DigitalGiles.Logging Namespace


LogWriter.FileNameAndPath Property

LogWriterFileNameAndPath Property
The full path and file name to which we are logging.

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public string FileNameAndPath { get; }

Property Value

Type: String
See Also

Reference

LogWriter Class
DigitalGiles.Logging Namespace


LogWriter.LogFileMode Property

LogWriterLogFileMode Property
Logfile naming scheme - Provides options to append a full date to the log filename to avoid monthly overwriting. Set by the Open() method.

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public LogFileNameFormat LogFileMode { get; }

Property Value

Type: LogFileNameFormat
See Also

Reference

LogWriter Class
DigitalGiles.Logging Namespace


LogWriter.UseFullFormat Property

LogWriterUseFullFormat Property
Whether to use 'full format' log file writing (i.e. whether to include the log level and colour information from the logged ListItem.

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public bool UseFullFormat { get; set; }

Property Value

Type: Boolean
See Also

Reference

LogWriter Class
DigitalGiles.Logging Namespace


LogWriter Events

LogWriter Events

The LogWriter type exposes the following members.

Events
 | Name | Description
Public event | LogFileOpened | Event triggered when a new logfile is opened.
Top
See Also

Reference

LogWriter Class
DigitalGiles.Logging Namespace


LogWriter.LogFileOpened Event

LogWriterLogFileOpened Event
Event triggered when a new logfile is opened.

Namespace: DigitalGiles.Logging
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public event EventHandler<LogFileOpenedEventArgs> LogFileOpened

Value

Type: SystemEventHandler LogFileOpenedEventArgs
See Also

Reference

LogWriter Class
DigitalGiles.Logging Namespace


DigitalGiles.Timer Namespace

DigitalGiles.Timer Namespace
This namespace contains the MidnightTimer class.
Delegates
 | Delegate | Description
Public delegate | TimeReachedEventHandler | Fires when the timer expires.


TimeReachedEventHandler Delegate

TimeReachedEventHandler Delegate
Fires when the timer expires.

Namespace: DigitalGiles.Timer
Assembly: BNCSLib (in BNCSLib.dll) Version: 10.0.0.11 (10.0.0.11)
Syntax
C#
Copy
public delegate void TimeReachedEventHandler()
See Also

Reference

DigitalGiles.Timer Namespace