text: //*********************************************************
  //
  // Copyright (c) Microsoft. All rights reserved.
  // This code is licensed under the MIT License (MIT).
  // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
  // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
  // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
  // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
  //
  //*********************************************************
  //-----------------------------------------------------------------------------
  // <auto-generated> 
  //   This code was generated by a tool. 
  // 
  //   Changes to this file may cause incorrect behavior and will be lost if  
  //   the code is regenerated.
  //
  //   Tool: AllJoynCodeGenerator.exe
  //
  //   This tool is located in the Windows 10 SDK and the Windows 10 AllJoyn 
  //   Visual Studio Extension in the Visual Studio Gallery.  
  //
  //   The generated code should be packaged in a Windows 10 C++/CX Runtime  
  //   Component which can be consumed in any UWP-supported language using 
  //   APIs that are available in Windows.Devices.AllJoyn.
  //
  //   Using AllJoynCodeGenerator - Invoke the following command with a valid 
  //   Introspection XML file and a writable output directory:
  //     AllJoynCodeGenerator -i <INPUT XML FILE> -o <OUTPUT DIRECTORY>
  // </auto-generated>
  //-----------------------------------------------------------------------------
  #include "pch.h"
  
  using namespace Microsoft::WRL;
  using namespace Platform;
  using namespace Windows::Devices::AllJoyn;
  using namespace Windows::Foundation;
  using namespace com::microsoft::Samples::SecureInterface;
  
  void SecureInterfaceSignals::Initialize(_In_ alljoyn_busobject busObject, _In_ alljoyn_sessionid sessionId)
  {
      m_busObject = busObject;
      m_sessionId = sessionId;
  
      auto interfaceDefinition = alljoyn_busattachment_getinterface(alljoyn_busobject_getbusattachment(busObject), "com.microsoft.Samples.SecureInterface");
      alljoyn_interfacedescription_getmember(interfaceDefinition, "TextSent", &m_memberTextSent);
  }
  
  void SecureInterfaceSignals::TextSent(_In_ Platform::String^ interfaceMemberMessage)
  {
      if (nullptr == m_busObject)
      {
          return;
      }
  
      size_t argCount = 1;
      alljoyn_msgarg arguments = alljoyn_msgarg_array_create(argCount);
      TypeConversionHelpers::SetAllJoynMessageArg(alljoyn_msgarg_array_element(arguments, 0), "s", interfaceMemberMessage);
      
      alljoyn_busobject_signal(
          m_busObject, 
          NULL,  // Generated code only supports broadcast signals.
          m_sessionId,
          m_memberTextSent,
          arguments,
          argCount, 
          0, // A signal with a TTL of 0 will be sent to every member of the session, regardless of how long it takes to deliver the message
          ALLJOYN_MESSAGE_FLAG_GLOBAL_BROADCAST, // Broadcast to everyone in the session.
          NULL); // The generated code does not need the generated signal message
  
      alljoyn_msgarg_destroy(arguments);
  }
  
  void SecureInterfaceSignals::CallTextSentReceived(_In_ SecureInterfaceSignals^ sender, _In_ SecureInterfaceTextSentReceivedEventArgs^ args)
  {
      AllJoynHelpers::DispatchEvent([=]() {
          TextSentReceived(sender, args);
      });
  }
  
  