SetResponse() public method

Sets the response to the dialog.
public SetResponse ( ISystemContext context, int response ) : void
context ISystemContext The system context.
response int The selected response.
return void
Beispiel #1
0
        /// <summary>
        /// Called when the dialog receives a response.
        /// </summary>
        private ServiceResult OnRespond(
            ISystemContext context,
            DialogConditionState dialog,
            int selectedResponse)
        {
            // response 0 means set the source online.
            if (selectedResponse == 0)
            {
                m_source.SetOfflineState(false);
            }

            // response 1 means set the source offine.
            if (selectedResponse == 1)
            {
                m_source.SetOfflineState(true);
            }

            // other responses mean do nothing.
            dialog.SetResponse(context, selectedResponse);

            // dialog no longer interesting once it is deactivated.
            dialog.Message.Value = "The dialog was deactivated";
            dialog.Retain.Value = false;

            return ServiceResult.Good;
        }