public SaHpiCtrlRecUnionT DemarshalSaHpiCtrlRecUnionT( long mod ) { SaHpiCtrlRecUnionT x = new SaHpiCtrlRecUnionT(); if ( mod == HpiConst.SAHPI_CTRL_TYPE_DIGITAL ) { x.Digital = DemarshalSaHpiCtrlRecDigitalT(); } if ( mod == HpiConst.SAHPI_CTRL_TYPE_DISCRETE ) { x.Discrete = DemarshalSaHpiCtrlRecDiscreteT(); } if ( mod == HpiConst.SAHPI_CTRL_TYPE_ANALOG ) { x.Analog = DemarshalSaHpiCtrlRecAnalogT(); } if ( mod == HpiConst.SAHPI_CTRL_TYPE_STREAM ) { x.Stream = DemarshalSaHpiCtrlRecStreamT(); } if ( mod == HpiConst.SAHPI_CTRL_TYPE_TEXT ) { x.Text = DemarshalSaHpiCtrlRecTextT(); } if ( mod == HpiConst.SAHPI_CTRL_TYPE_OEM ) { x.Oem = DemarshalSaHpiCtrlRecOemT(); } return x; }
public void MarshalSaHpiCtrlRecUnionT( SaHpiCtrlRecUnionT x, long mod ) { if ( mod == HpiConst.SAHPI_CTRL_TYPE_DIGITAL ) { MarshalSaHpiCtrlRecDigitalT( x.Digital ); } if ( mod == HpiConst.SAHPI_CTRL_TYPE_DISCRETE ) { MarshalSaHpiCtrlRecDiscreteT( x.Discrete ); } if ( mod == HpiConst.SAHPI_CTRL_TYPE_ANALOG ) { MarshalSaHpiCtrlRecAnalogT( x.Analog ); } if ( mod == HpiConst.SAHPI_CTRL_TYPE_STREAM ) { MarshalSaHpiCtrlRecStreamT( x.Stream ); } if ( mod == HpiConst.SAHPI_CTRL_TYPE_TEXT ) { MarshalSaHpiCtrlRecTextT( x.Text ); } if ( mod == HpiConst.SAHPI_CTRL_TYPE_OEM ) { MarshalSaHpiCtrlRecOemT( x.Oem ); } }
/** * Check function for HPI union SaHpiCtrlRecUnionT */ public static bool Check( SaHpiCtrlRecUnionT x, long mod ) { if ( x == null ) { return false; } if ( mod == HpiConst.SAHPI_CTRL_TYPE_DIGITAL ) { if ( !Check( x.Digital ) ) { return false; } } if ( mod == HpiConst.SAHPI_CTRL_TYPE_DISCRETE ) { if ( !Check( x.Discrete ) ) { return false; } } if ( mod == HpiConst.SAHPI_CTRL_TYPE_ANALOG ) { if ( !Check( x.Analog ) ) { return false; } } if ( mod == HpiConst.SAHPI_CTRL_TYPE_STREAM ) { if ( !Check( x.Stream ) ) { return false; } } if ( mod == HpiConst.SAHPI_CTRL_TYPE_TEXT ) { if ( !Check( x.Text ) ) { return false; } } if ( mod == HpiConst.SAHPI_CTRL_TYPE_OEM ) { if ( !Check( x.Oem ) ) { return false; } } return true; }