Loads the schedule from the underlying data source using the specified value converter.
Namespace: MindFusion.Scheduling.WinForms
Assembly: MindFusion.Scheduling
Syntax
Visual Basic
Copy Code
|
---|
Public Sub LoadFromDataSource ( _ converter As IValueConverter _ ) |
Parameters
Example
The following example demonstrates a sample implementation of the IValueConverter interface which converts all byte values to boolean:
C#
Copy Code
|
---|
public class ByteToBoolConverter : IValueConverter { public object Convert(object value, object destination, string destinationMember, Type destinationType) { if (value is byte && destinationType == typeof(bool)) return (byte)value != 0;
return value; }
public bool Supports(object value, object destination, string destinationMember, Type destinationType) { return value is byte && destinationType == typeof(bool); } } |
Visual Basic
Copy Code
|
---|
Public Class ByteToBoolConverter Implements IValueConverter
Public Function Convert(ByVal value As Object, ByVal destination As Object, _ ByVal destinationMember As String, ByVal destinationType As Type) As Object Implements IValueConverter.Convert
If TypeOf value Is Byte And destinationType Is GetType(Boolean) Then Return CByte(value) <> 0 End If
Return value
End Function
Public Function Supports(ByVal value As Object, ByVal destination As Object, _ ByVal destinationMember As String, ByVal destinationType As Type) As Boolean Implements IValueConverter.Supports
Return TypeOf value Is Byte And destinationType Is GetType(Boolean)
End Function
End Class |
See Also