Class Extensions
Class Extensions
Inheritance
System.Object
Extensions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: TM
Assembly: TM.dll
Syntax
public static class Extensions
Methods
| Improve this Doc View SourceByteArrayToStructure(Byte[], Object, Int32)
Bytes the array to structure.
Declaration
public static object ByteArrayToStructure(this byte[] bytearray, object structureObj, int position)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | bytearray | The bytearray. |
System.Object | structureObj | The structure object. |
System.Int32 | position | The position. |
Returns
Type | Description |
---|---|
System.Object | System.Object. |
Copy(Double[])
Copies the specified hist.
Declaration
public static double[] Copy(this double[] hist)
Parameters
Type | Name | Description |
---|---|---|
System.Double[] | hist | The hist. |
Returns
Type | Description |
---|---|
System.Double[] | System.Double[][]. |
Copy(Stream, Stream, Action<Stream, Stream, Exception>)
This is not suitable for large files because the SEND() buffer
may get filled up and throw an exception if you attempt to write to it.
You should change this to use the strongly typed network stream and ensure
you have enough room to send data
Declaration
public static void Copy(this Stream source, Stream destination, Action<Stream, Stream, Exception> completed = null)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | source | The source. |
System.IO.Stream | destination | The destination. |
System.Action<System.IO.Stream, System.IO.Stream, System.Exception> | completed | The completed. |
Description(Enum)
Descriptions the specified value.
Declaration
public static string Description(this Enum value)
Parameters
Type | Name | Description |
---|---|---|
System.Enum | value | The value. |
Returns
Type | Description |
---|---|
System.String | System.String. |
SplitString(String, Int32)
Splits the string.
Declaration
public static IEnumerable<string> SplitString(this string s, int length)
Parameters
Type | Name | Description |
---|---|---|
System.String | s | The s. |
System.Int32 | length | The length. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> | IEnumerable<System.String>. |
ToBool(String, Boolean)
To the bool.
Declaration
public static bool ToBool(this string str, bool def)
Parameters
Type | Name | Description |
---|---|---|
System.String | str | The string. |
System.Boolean | def | if set to true [def]. |
Returns
Type | Description |
---|---|
System.Boolean | true if XXXX, false otherwise |
ToByte(Int16[])
Converts the 16bit to to 8bit array.
Declaration
public static byte[] ToByte(this short[] arr)
Parameters
Type | Name | Description |
---|---|---|
System.Int16[] | arr | The arr. |
Returns
Type | Description |
---|---|
System.Byte[] | System.Byte[][]. |
ToDegrees(Single)
Converts to degrees.
Declaration
public static float ToDegrees(this float radians)
Parameters
Type | Name | Description |
---|---|---|
System.Single | radians | The radians. |
Returns
Type | Description |
---|---|
System.Single | System.Single. |
ToDouble(String, Double)
To the double.
Declaration
public static double ToDouble(this string str, double def)
Parameters
Type | Name | Description |
---|---|---|
System.String | str | The string. |
System.Double | def | The def. |
Returns
Type | Description |
---|---|
System.Double | System.Double. |
ToFloat(String, Single)
To the float.
Declaration
public static float ToFloat(this string str, float def)
Parameters
Type | Name | Description |
---|---|---|
System.String | str | The string. |
System.Single | def | The def. |
Returns
Type | Description |
---|---|
System.Single | System.Single. |
ToInt(String, Int32)
To the int.
Declaration
public static int ToInt(this string str, int def)
Parameters
Type | Name | Description |
---|---|---|
System.String | str | The string. |
System.Int32 | def | The def. |
Returns
Type | Description |
---|---|
System.Int32 | System.Int32. |
WriteMultiLine(String, Int32)
Writes the multi line.
Declaration
public static void WriteMultiLine(this string lstring, int len = 110)
Parameters
Type | Name | Description |
---|---|---|
System.String | lstring | The lstring. |
System.Int32 | len | The length. |